summaryrefslogtreecommitdiff
path: root/spec/ruby/library/csv/writer/append_spec.rb
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2022-02-24 12:57:57 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2022-02-24 10:59:58 -0800
commit8b3b113d84cc9d4c38e2b19f2d54d4d0457b93fd (patch)
tree3faf412b96c3e8afded6e3d9fe9b19950b759e59 /spec/ruby/library/csv/writer/append_spec.rb
parent92d553b7c9a5977d6ccde773c686ca75b0a69d03 (diff)
[DOC] Fix typo in yjit docs
I noticed this yesterday when pairing with Aaron, there was an extra "e" in "callees".
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5597
Diffstat (limited to 'spec/ruby/library/csv/writer/append_spec.rb')
0 files changed, 0 insertions, 0 deletions
branch.yml22
-rw-r--r--.github/workflows/cygwin.yml79
-rw-r--r--.github/workflows/macos.yml81
-rw-r--r--.github/workflows/mjit.yml79
-rw-r--r--.github/workflows/ubuntu.yml115
-rw-r--r--.github/workflows/windows.yml90
-rw-r--r--.gitignore98
-rw-r--r--.indent.pro21
-rw-r--r--.rspec_parallel2
-rw-r--r--.travis.yml578
-rw-r--r--COPYING76
-rw-r--r--COPYING.ja66
-rw-r--r--ChangeLog14850
-rw-r--r--KNOWNBUGS.rb6
-rw-r--r--LEGAL831
-rw-r--r--Makefile.in506
-rw-r--r--NEWS1113
-rw-r--r--README.EXT1732
-rw-r--r--README.EXT.ja1721
-rw-r--r--README.ja.md90
-rw-r--r--README.md133
-rw-r--r--aclocal.m447
-rw-r--r--addr2line.c1889
-rw-r--r--addr2line.h2
-rw-r--r--appveyor.yml147
-rw-r--r--array.c2514
-rw-r--r--ast.c691
-rw-r--r--ast.rb144
-rwxr-xr-xbasictest/runner.rb33
-rwxr-xr-xbasictest/test.rb2360
-rw-r--r--benchmark/README.md72
-rw-r--r--benchmark/app_aobench.rb297
-rw-r--r--benchmark/app_erb.yml23
-rw-r--r--benchmark/app_pentomino.rb130
-rw-r--r--benchmark/array_flatten.yml19
-rw-r--r--benchmark/array_intersection.yml14
-rw-r--r--benchmark/array_sample_100k_10.rb2
-rw-r--r--benchmark/array_sample_100k_11.rb2
-rw-r--r--benchmark/array_sample_100k__100.rb2
-rw-r--r--benchmark/array_sample_100k__1k.rb2
-rw-r--r--benchmark/array_sample_100k__6k.rb2
-rw-r--r--benchmark/array_sample_100k___10k.rb2
-rw-r--r--benchmark/array_sample_100k___50k.rb2
-rw-r--r--benchmark/array_shift.rb14
-rw-r--r--benchmark/array_small_and.rb17
-rw-r--r--benchmark/array_small_diff.rb17
-rw-r--r--benchmark/array_small_or.rb17
-rw-r--r--benchmark/array_sort_block.rb2
-rw-r--r--benchmark/array_sort_float.rb2
-rw-r--r--benchmark/array_values_at_int.rb2
-rw-r--r--benchmark/array_values_at_range.rb2
-rw-r--r--benchmark/bighash.rb1
-rw-r--r--benchmark/bm_app_answer.rb (renamed from benchmark/app_answer.rb)0
-rw-r--r--benchmark/bm_app_aobench.rb291
-rw-r--r--benchmark/bm_app_erb.rb26
-rw-r--r--benchmark/bm_app_factorial.rb (renamed from benchmark/app_factorial.rb)0
-rw-r--r--benchmark/bm_app_fib.rb (renamed from benchmark/app_fib.rb)0
-rw-r--r--benchmark/bm_app_lc_fizzbuzz.rb (renamed from benchmark/app_lc_fizzbuzz.rb)0
-rw-r--r--benchmark/bm_app_mandelbrot.rb (renamed from benchmark/app_mandelbrot.rb)0
-rw-r--r--benchmark/bm_app_pentomino.rb259
-rw-r--r--benchmark/bm_app_raise.rb (renamed from benchmark/app_raise.rb)0
-rw-r--r--benchmark/bm_app_strconcat.rb (renamed from benchmark/app_strconcat.rb)0
-rw-r--r--benchmark/bm_app_tak.rb (renamed from benchmark/app_tak.rb)0
-rw-r--r--benchmark/bm_app_tarai.rb (renamed from benchmark/app_tarai.rb)0
-rw-r--r--benchmark/bm_app_uri.rb (renamed from benchmark/app_uri.rb)0
-rw-r--r--benchmark/bm_hash_aref_flo.rb (renamed from benchmark/hash_aref_flo.rb)0
-rw-r--r--benchmark/bm_hash_aref_miss.rb (renamed from benchmark/hash_aref_miss.rb)0
-rw-r--r--benchmark/bm_hash_aref_str.rb (renamed from benchmark/hash_aref_str.rb)0
-rw-r--r--benchmark/bm_hash_aref_sym.rb (renamed from benchmark/hash_aref_sym.rb)0
-rw-r--r--benchmark/bm_hash_aref_sym_long.rb (renamed from benchmark/hash_aref_sym_long.rb)0
-rw-r--r--benchmark/bm_hash_flatten.rb (renamed from benchmark/hash_flatten.rb)0
-rw-r--r--benchmark/bm_hash_ident_flo.rb (renamed from benchmark/hash_ident_flo.rb)0
-rw-r--r--benchmark/bm_hash_ident_num.rb (renamed from benchmark/hash_ident_num.rb)0
-rw-r--r--benchmark/bm_hash_ident_obj.rb (renamed from benchmark/hash_ident_obj.rb)0
-rw-r--r--benchmark/bm_hash_ident_str.rb (renamed from benchmark/hash_ident_str.rb)0
-rw-r--r--benchmark/bm_hash_ident_sym.rb (renamed from benchmark/hash_ident_sym.rb)0
-rw-r--r--benchmark/bm_hash_keys.rb (renamed from benchmark/hash_keys.rb)0
-rw-r--r--benchmark/bm_hash_shift.rb (renamed from benchmark/hash_shift.rb)0
-rw-r--r--benchmark/bm_hash_values.rb (renamed from benchmark/hash_values.rb)0
-rw-r--r--benchmark/bm_io_file_create.rb (renamed from benchmark/io_file_create.rb)0
-rw-r--r--benchmark/bm_io_file_read.rb (renamed from benchmark/io_file_read.rb)0
-rw-r--r--benchmark/bm_io_file_write.rb (renamed from benchmark/io_file_write.rb)0
-rw-r--r--benchmark/bm_io_select.rb (renamed from benchmark/io_select.rb)0
-rw-r--r--benchmark/bm_io_select2.rb (renamed from benchmark/io_select2.rb)0
-rw-r--r--benchmark/bm_io_select3.rb (renamed from benchmark/io_select3.rb)0
-rw-r--r--benchmark/bm_loop_for.rb (renamed from benchmark/loop_for.rb)0
-rw-r--r--benchmark/bm_loop_generator.rb (renamed from benchmark/loop_generator.rb)0
-rw-r--r--benchmark/bm_loop_times.rb (renamed from benchmark/loop_times.rb)0
-rw-r--r--benchmark/bm_loop_whileloop.rb (renamed from benchmark/loop_whileloop.rb)0
-rw-r--r--benchmark/bm_loop_whileloop2.rb (renamed from benchmark/loop_whileloop2.rb)0
-rw-r--r--benchmark/bm_marshal_dump_flo.rb (renamed from benchmark/marshal_dump_flo.rb)0
-rw-r--r--benchmark/bm_securerandom.rb (renamed from benchmark/securerandom.rb)0
-rw-r--r--benchmark/bm_so_ackermann.rb19
-rw-r--r--benchmark/bm_so_array.rb23
-rw-r--r--benchmark/bm_so_binary_trees.rb (renamed from benchmark/so_binary_trees.rb)0
-rw-r--r--benchmark/bm_so_concatenate.rb18
-rw-r--r--benchmark/bm_so_count_words.rb19
-rw-r--r--benchmark/bm_so_exception.rb61
-rw-r--r--benchmark/bm_so_fannkuch.rb (renamed from benchmark/so_fannkuch.rb)0
-rw-r--r--benchmark/bm_so_fasta.rb81
-rw-r--r--benchmark/bm_so_k_nucleotide.rb48
-rw-r--r--benchmark/bm_so_lists.rb (renamed from benchmark/so_lists.rb)0
-rw-r--r--benchmark/bm_so_mandelbrot.rb (renamed from benchmark/so_mandelbrot.rb)0
-rw-r--r--benchmark/bm_so_matrix.rb48
-rw-r--r--benchmark/bm_so_meteor_contest.rb564
-rw-r--r--benchmark/bm_so_nbody.rb (renamed from benchmark/so_nbody.rb)0
-rw-r--r--benchmark/bm_so_nested_loop.rb24
-rw-r--r--benchmark/bm_so_nsieve.rb (renamed from benchmark/so_nsieve.rb)0
-rw-r--r--benchmark/bm_so_nsieve_bits.rb (renamed from benchmark/so_nsieve_bits.rb)0
-rw-r--r--benchmark/bm_so_object.rb56
-rw-r--r--benchmark/bm_so_partial_sums.rb (renamed from benchmark/so_partial_sums.rb)0
-rw-r--r--benchmark/bm_so_pidigits.rb92
-rw-r--r--benchmark/bm_so_random.rb (renamed from benchmark/so_random.rb)0
-rw-r--r--benchmark/bm_so_reverse_complement.rb30
-rw-r--r--benchmark/bm_so_sieve.rb (renamed from benchmark/so_sieve.rb)0
-rw-r--r--benchmark/bm_so_spectralnorm.rb (renamed from benchmark/so_spectralnorm.rb)0
-rw-r--r--benchmark/bm_vm1_attr_ivar.rb14
-rw-r--r--benchmark/bm_vm1_attr_ivar_set.rb14
-rw-r--r--benchmark/bm_vm1_block.rb10
-rw-r--r--benchmark/bm_vm1_const.rb8
-rw-r--r--benchmark/bm_vm1_ensure.rb11
-rw-r--r--benchmark/bm_vm1_float_simple.rb7
-rw-r--r--benchmark/bm_vm1_gc_short_lived.rb10
-rw-r--r--benchmark/bm_vm1_gc_short_with_complex_long.rb27
-rw-r--r--benchmark/bm_vm1_gc_short_with_long.rb13
-rw-r--r--benchmark/bm_vm1_gc_short_with_symbol.rb15
-rw-r--r--benchmark/bm_vm1_gc_wb_ary.rb10
-rw-r--r--benchmark/bm_vm1_gc_wb_obj.rb13
-rw-r--r--benchmark/bm_vm1_ivar.rb8
-rw-r--r--benchmark/bm_vm1_ivar_set.rb6
-rw-r--r--benchmark/bm_vm1_length.rb9
-rw-r--r--benchmark/bm_vm1_lvar_init.rb18
-rw-r--r--benchmark/bm_vm1_lvar_set.rb5
-rw-r--r--benchmark/bm_vm1_neq.rb8
-rw-r--r--benchmark/bm_vm1_not.rb7
-rw-r--r--benchmark/bm_vm1_rescue.rb7
-rw-r--r--benchmark/bm_vm1_simplereturn.rb9
-rw-r--r--benchmark/bm_vm1_swap.rb8
-rw-r--r--benchmark/bm_vm1_yield.rb10
-rw-r--r--benchmark/bm_vm2_array.rb5
-rw-r--r--benchmark/bm_vm2_bigarray.rb106
-rw-r--r--benchmark/bm_vm2_bighash.rb5
-rw-r--r--benchmark/bm_vm2_case.rb14
-rw-r--r--benchmark/bm_vm2_defined_method.rb9
-rw-r--r--benchmark/bm_vm2_dstr.rb6
-rw-r--r--benchmark/bm_vm2_eval.rb6
-rw-r--r--benchmark/bm_vm2_method.rb9
-rw-r--r--benchmark/bm_vm2_method_missing.rb12
-rw-r--r--benchmark/bm_vm2_method_with_block.rb9
-rw-r--r--benchmark/bm_vm2_mutex.rb9
-rw-r--r--benchmark/bm_vm2_newlambda.rb5
-rw-r--r--benchmark/bm_vm2_poly_method.rb20
-rw-r--r--benchmark/bm_vm2_poly_method_ov.rb20
-rw-r--r--benchmark/bm_vm2_proc.rb14
-rw-r--r--benchmark/bm_vm2_raise1.rb18
-rw-r--r--benchmark/bm_vm2_raise2.rb18
-rw-r--r--benchmark/bm_vm2_regexp.rb6
-rw-r--r--benchmark/bm_vm2_send.rb12
-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_small_aref.rb7
-rw-r--r--benchmark/bm_vm2_struct_small_aset.rb7
-rw-r--r--benchmark/bm_vm2_super.rb20
-rw-r--r--benchmark/bm_vm2_unif1.rb8
-rw-r--r--benchmark/bm_vm2_zsuper.rb20
-rw-r--r--benchmark/bm_vm3_backtrace.rb (renamed from benchmark/vm3_backtrace.rb)0
-rw-r--r--benchmark/bm_vm3_clearmethodcache.rb (renamed from benchmark/vm3_clearmethodcache.rb)0
-rwxr-xr-xbenchmark/bm_vm3_gc.rb7
-rw-r--r--benchmark/bm_vm_thread_alive_check1.rb6
-rw-r--r--benchmark/bm_vm_thread_close.rb (renamed from benchmark/vm_thread_close.rb)0
-rw-r--r--benchmark/bm_vm_thread_create_join.rb (renamed from benchmark/vm_thread_create_join.rb)0
-rw-r--r--benchmark/bm_vm_thread_mutex1.rb21
-rw-r--r--benchmark/bm_vm_thread_mutex2.rb21
-rw-r--r--benchmark/bm_vm_thread_mutex3.rb20
-rw-r--r--benchmark/bm_vm_thread_pass.rb15
-rw-r--r--benchmark/bm_vm_thread_pass_flood.rb8
-rw-r--r--benchmark/bm_vm_thread_pipe.rb17
-rw-r--r--benchmark/bm_vm_thread_queue.rb18
-rw-r--r--benchmark/cgi_escape_html.yml40
-rw-r--r--benchmark/complex_float_add.yml7
-rw-r--r--benchmark/complex_float_div.yml7
-rw-r--r--benchmark/complex_float_mul.yml7
-rw-r--r--benchmark/complex_float_new.yml7
-rw-r--r--benchmark/complex_float_power.yml7
-rw-r--r--benchmark/complex_float_sub.yml7
-rw-r--r--benchmark/dir_empty_p.rb5
-rw-r--r--benchmark/driver.rb321
-rw-r--r--benchmark/enum_lazy_grep_v_100.rb4
-rw-r--r--benchmark/enum_lazy_grep_v_20.rb4
-rw-r--r--benchmark/enum_lazy_grep_v_50.rb4
-rw-r--r--benchmark/enum_lazy_uniq_100.rb4
-rw-r--r--benchmark/enum_lazy_uniq_20.rb4
-rw-r--r--benchmark/enum_lazy_uniq_50.rb4
-rw-r--r--benchmark/erb_render.yml24
-rwxr-xr-xbenchmark/fiber_chain.yml36
-rw-r--r--benchmark/file_chmod.rb9
-rw-r--r--benchmark/file_rename.rb11
-rw-r--r--benchmark/gc/aobench.rb2
-rw-r--r--benchmark/gc/binary_trees.rb2
-rw-r--r--benchmark/gc/gcbench.rb3
-rw-r--r--benchmark/gc/pentomino.rb2
-rw-r--r--benchmark/hash_aref_dsym.rb4
-rw-r--r--benchmark/hash_aref_dsym_long.rb21
-rw-r--r--benchmark/hash_aref_fix.rb4
-rw-r--r--benchmark/hash_dup.yml8
-rw-r--r--benchmark/hash_literal_small2.rb3
-rw-r--r--benchmark/hash_literal_small4.rb3
-rw-r--r--benchmark/hash_literal_small8.rb3
-rw-r--r--benchmark/hash_long.rb4
-rw-r--r--benchmark/hash_shift_u16.rb10
-rw-r--r--benchmark/hash_shift_u24.rb10
-rw-r--r--benchmark/hash_shift_u32.rb10
-rw-r--r--benchmark/hash_small2.rb1
-rw-r--r--benchmark/hash_small4.rb1
-rw-r--r--benchmark/hash_small8.rb1
-rw-r--r--benchmark/hash_to_proc.rb9
-rw-r--r--benchmark/int_quo.rb1
-rw-r--r--benchmark/io_copy_stream_write.rb24
-rw-r--r--benchmark/io_copy_stream_write_socket.rb35
-rw-r--r--benchmark/io_nonblock_noex.rb22
-rw-r--r--benchmark/io_nonblock_noex2.rb21
-rw-r--r--benchmark/io_pipe_rw.rb13
-rw-r--r--benchmark/irb_color.yml13
-rw-r--r--benchmark/irb_exec.yml10
-rw-r--r--benchmark/lib/benchmark_driver/output/driver.rb36
-rw-r--r--benchmark/lib/benchmark_driver/runner/cstime.rb22
-rw-r--r--benchmark/lib/benchmark_driver/runner/cutime.rb22
-rw-r--r--benchmark/lib/benchmark_driver/runner/mjit_exec.rb237
-rw-r--r--benchmark/lib/benchmark_driver/runner/peak.rb151
-rw-r--r--benchmark/lib/benchmark_driver/runner/size.rb25
-rw-r--r--benchmark/lib/benchmark_driver/runner/stime.rb22
-rw-r--r--benchmark/lib/benchmark_driver/runner/total.rb137
-rw-r--r--benchmark/lib/benchmark_driver/runner/utime.rb22
-rw-r--r--benchmark/lib/load.rb18
-rw-r--r--benchmark/make_fasta_output.rb19
-rw-r--r--benchmark/marshal_dump_load_geniv.rb10
-rw-r--r--benchmark/marshal_dump_load_time.rb1
-rw-r--r--benchmark/match_gt4.rb1
-rw-r--r--benchmark/match_small.rb1
-rw-r--r--benchmark/mjit_exec_jt2jt.yml8
-rw-r--r--benchmark/mjit_exec_vm2jt.yml8
-rw-r--r--benchmark/mjit_exec_vm2vm.yml8
-rw-r--r--benchmark/nil_p.yml9
-rw-r--r--benchmark/other-lang/fact.py2
-rw-r--r--benchmark/prepare_so_count_words.rb15
-rw-r--r--benchmark/prepare_so_k_nucleotide.rb2
-rw-r--r--benchmark/prepare_so_reverse_complement.rb2
-rw-r--r--benchmark/range_last.yml4
-rw-r--r--benchmark/realpath.yml30
-rw-r--r--benchmark/report.rb79
-rw-r--r--benchmark/require.yml32
-rw-r--r--benchmark/require_thread.yml40
-rw-r--r--benchmark/run.rb127
-rw-r--r--benchmark/runc.rb27
-rw-r--r--benchmark/so_ackermann.rb19
-rw-r--r--benchmark/so_array.rb23
-rw-r--r--benchmark/so_concatenate.rb18
-rw-r--r--benchmark/so_count_words.yml65
-rw-r--r--benchmark/so_exception.rb61
-rw-r--r--benchmark/so_fasta.rb81
-rw-r--r--benchmark/so_k_nucleotide.yml155
-rw-r--r--benchmark/so_matrix.rb48
-rw-r--r--benchmark/so_meteor_contest.rb563
-rw-r--r--benchmark/so_nested_loop.rb24
-rw-r--r--benchmark/so_object.rb56
-rw-r--r--benchmark/so_pidigits.rb92
-rw-r--r--benchmark/so_reverse_complement.yml137
-rw-r--r--benchmark/string_capitalize.yml10
-rw-r--r--benchmark/string_downcase.yml10
-rw-r--r--benchmark/string_index.rb3
-rw-r--r--benchmark/string_scan_re.rb2
-rw-r--r--benchmark/string_scan_str.rb2
-rw-r--r--benchmark/string_split.yml7
-rw-r--r--benchmark/string_swapcase.yml10
-rw-r--r--benchmark/string_upcase.yml10
-rw-r--r--benchmark/time_strptime.yml13
-rw-r--r--benchmark/time_subsec.rb2
-rw-r--r--benchmark/vm1_attr_ivar.yml14
-rw-r--r--benchmark/vm1_attr_ivar_set.yml14
-rw-r--r--benchmark/vm1_block.yml9
-rw-r--r--benchmark/vm1_blockparam.yml7
-rw-r--r--benchmark/vm1_blockparam_call.yml8
-rw-r--r--benchmark/vm1_blockparam_pass.yml12
-rw-r--r--benchmark/vm1_blockparam_yield.yml8
-rw-r--r--benchmark/vm1_const.yml7
-rw-r--r--benchmark/vm1_ensure.yml14
-rw-r--r--benchmark/vm1_float_simple.yml8
-rw-r--r--benchmark/vm1_gc_short_lived.yml9
-rw-r--r--benchmark/vm1_gc_short_with_complex_long.yml25
-rw-r--r--benchmark/vm1_gc_short_with_long.yml13
-rw-r--r--benchmark/vm1_gc_short_with_symbol.yml13
-rw-r--r--benchmark/vm1_gc_wb_ary.yml12
-rw-r--r--benchmark/vm1_gc_wb_ary_promoted.yml15
-rw-r--r--benchmark/vm1_gc_wb_obj.yml15
-rw-r--r--benchmark/vm1_gc_wb_obj_promoted.yml17
-rw-r--r--benchmark/vm1_ivar.yml6
-rw-r--r--benchmark/vm1_ivar_set.yml5
-rw-r--r--benchmark/vm1_length.yml8
-rw-r--r--benchmark/vm1_lvar_init.yml21
-rw-r--r--benchmark/vm1_lvar_set.yml4
-rw-r--r--benchmark/vm1_neq.yml7
-rw-r--r--benchmark/vm1_not.yml6
-rw-r--r--benchmark/vm1_rescue.yml6
-rw-r--r--benchmark/vm1_simplereturn.yml7
-rw-r--r--benchmark/vm1_swap.yml7
-rw-r--r--benchmark/vm1_yield.yml13
-rw-r--r--benchmark/vm2_array.yml4
-rw-r--r--benchmark/vm2_bigarray.yml105
-rw-r--r--benchmark/vm2_bighash.yml4
-rw-r--r--benchmark/vm2_case.yml13
-rw-r--r--benchmark/vm2_case_lit.yml23
-rw-r--r--benchmark/vm2_defined_method.yml8
-rw-r--r--benchmark/vm2_dstr.yml6
-rw-r--r--benchmark/vm2_eval.yml4
-rw-r--r--benchmark/vm2_fiber_allocate.yml8
-rw-r--r--benchmark/vm2_fiber_count.yml10
-rw-r--r--benchmark/vm2_fiber_reuse.yml14
-rw-r--r--benchmark/vm2_fiber_reuse_gc.yml12
-rw-r--r--benchmark/vm2_fiber_switch.yml9
-rw-r--r--benchmark/vm2_freezestring.yml10
-rw-r--r--benchmark/vm2_method.yml8
-rw-r--r--benchmark/vm2_method_missing.yml11
-rw-r--r--benchmark/vm2_method_with_block.yml8
-rw-r--r--benchmark/vm2_module_ann_const_set.yml4
-rw-r--r--benchmark/vm2_module_const_set.yml8
-rw-r--r--benchmark/vm2_mutex.yml8
-rw-r--r--benchmark/vm2_newlambda.yml4
-rw-r--r--benchmark/vm2_poly_method.yml24
-rw-r--r--benchmark/vm2_poly_method_ov.yml24
-rw-r--r--benchmark/vm2_poly_same_method.yml25
-rw-r--r--benchmark/vm2_poly_singleton.yml18
-rw-r--r--benchmark/vm2_proc.yml12
-rw-r--r--benchmark/vm2_raise1.yml16
-rw-r--r--benchmark/vm2_raise2.yml16
-rw-r--r--benchmark/vm2_regexp.yml8
-rw-r--r--benchmark/vm2_send.yml11
-rw-r--r--benchmark/vm2_string_literal.yml4
-rw-r--r--benchmark/vm2_struct_big_aref_hi.yml7
-rw-r--r--benchmark/vm2_struct_big_aref_lo.yml7
-rw-r--r--benchmark/vm2_struct_big_aset.yml11
-rw-r--r--benchmark/vm2_struct_big_href_hi.yml7
-rw-r--r--benchmark/vm2_struct_big_href_lo.yml7
-rw-r--r--benchmark/vm2_struct_big_hset.yml11
-rw-r--r--benchmark/vm2_struct_small_aref.yml7
-rw-r--r--benchmark/vm2_struct_small_aset.yml11
-rw-r--r--benchmark/vm2_struct_small_href.yml7
-rw-r--r--benchmark/vm2_struct_small_hset.yml7
-rw-r--r--benchmark/vm2_super.yml17
-rw-r--r--benchmark/vm2_unif1.yml7
-rw-r--r--benchmark/vm2_zsuper.yml18
-rw-r--r--benchmark/vm3_gc.rb6
-rw-r--r--benchmark/vm3_gc_old_full.rb4
-rw-r--r--benchmark/vm3_gc_old_immediate.rb4
-rw-r--r--benchmark/vm3_gc_old_lazy.rb4
-rw-r--r--benchmark/vm_symbol_block_pass.rb13
-rw-r--r--benchmark/vm_thread_alive_check.yml8
-rw-r--r--benchmark/vm_thread_condvar1.rb28
-rw-r--r--benchmark/vm_thread_condvar2.rb35
-rw-r--r--benchmark/vm_thread_mutex1.rb21
-rw-r--r--benchmark/vm_thread_mutex2.rb21
-rw-r--r--benchmark/vm_thread_mutex3.rb20
-rw-r--r--benchmark/vm_thread_pass.rb15
-rw-r--r--benchmark/vm_thread_pass_flood.rb10
-rw-r--r--benchmark/vm_thread_pipe.rb17
-rw-r--r--benchmark/vm_thread_queue.rb18
-rw-r--r--benchmark/vm_thread_sized_queue.rb20
-rw-r--r--benchmark/vm_thread_sized_queue2.rb23
-rw-r--r--benchmark/vm_thread_sized_queue3.rb22
-rw-r--r--benchmark/vm_thread_sized_queue4.rb26
-rw-r--r--benchmark/vm_thread_sleep.yml4
-rw-r--r--benchmark/wc.input.base25
-rw-r--r--bignum.c1490
-rwxr-xr-xbin/bundle27
-rwxr-xr-xbin/bundler27
-rwxr-xr-xbin/erb19
-rwxr-xr-xbin/irb28
-rwxr-xr-xbin/racc27
-rwxr-xr-xbin/racc2y27
-rwxr-xr-xbin/rake33
-rwxr-xr-xbin/rdoc53
-rwxr-xr-xbin/ri31
-rwxr-xr-xbin/y2racc27
-rw-r--r--bootstraptest/pending.rb5
-rwxr-xr-xbootstraptest/runner.rb83
-rw-r--r--bootstraptest/test_env.rb12
-rw-r--r--bootstraptest/test_eval.rb5
-rw-r--r--bootstraptest/test_exception.rb2
-rw-r--r--bootstraptest/test_fiber.rb39
-rw-r--r--bootstraptest/test_flow.rb10
-rw-r--r--bootstraptest/test_fork.rb6
-rw-r--r--bootstraptest/test_insns.rb440
-rw-r--r--bootstraptest/test_io.rb4
-rw-r--r--bootstraptest/test_jump.rb7
-rw-r--r--bootstraptest/test_literal.rb40
-rw-r--r--bootstraptest/test_literal_suffix.rb6
-rw-r--r--bootstraptest/test_method.rb32
-rw-r--r--bootstraptest/test_objectspace.rb11
-rw-r--r--bootstraptest/test_proc.rb4
-rw-r--r--bootstraptest/test_syntax.rb2
-rw-r--r--bootstraptest/test_thread.rb53
-rw-r--r--builtin.c69
-rw-r--r--builtin.h78
-rw-r--r--ccan/list/list.h223
-rw-r--r--class.c1068
-rw-r--r--common.mk1900
-rw-r--r--compar.c187
-rw-r--r--compile.c10457
-rw-r--r--complex.c1242
-rw-r--r--configure.ac4089
-rw-r--r--configure.in4340
-rw-r--r--constant.h23
-rw-r--r--cont.c2589
-rw-r--r--coroutine/amd64/Context.S46
-rw-r--r--coroutine/amd64/Context.h52
-rw-r--r--coroutine/arm32/Context.S22
-rw-r--r--coroutine/arm32/Context.h51
-rw-r--r--coroutine/arm64/Context.S59
-rw-r--r--coroutine/arm64/Context.h50
-rw-r--r--coroutine/copy/Context.c141
-rw-r--r--coroutine/copy/Context.h86
-rw-r--r--coroutine/ppc64le/Context.S72
-rw-r--r--coroutine/ppc64le/Context.h49
-rw-r--r--coroutine/ucontext/Context.c22
-rw-r--r--coroutine/ucontext/Context.h70
-rw-r--r--coroutine/win32/Context.S47
-rw-r--r--coroutine/win32/Context.asm55
-rw-r--r--coroutine/win32/Context.h57
-rw-r--r--coroutine/win64/Context.S77
-rw-r--r--coroutine/win64/Context.asm79
-rw-r--r--coroutine/win64/Context.h67
-rw-r--r--coroutine/x86/Context.S42
-rw-r--r--coroutine/x86/Context.h53
-rw-r--r--coverage/README2
-rw-r--r--cygwin/GNUmakefile.in35
-rw-r--r--debug.c164
-rw-r--r--debug_counter.c135
-rw-r--r--debug_counter.h390
-rw-r--r--defs/default_gems4
-rw-r--r--defs/gmake.mk327
-rw-r--r--defs/id.def90
-rw-r--r--defs/keywords4
-rw-r--r--defs/known_errors.def251
-rw-r--r--defs/lex.c.src4
-rw-r--r--defs/opt_insn_unif.def2
-rw-r--r--defs/separated_version.mk38
-rw-r--r--defs/universal.mk5
-rw-r--r--dir.c1485
-rw-r--r--dln.c102
-rw-r--r--dln_find.c17
-rw-r--r--dmydln.c3
-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.04
-rw-r--r--doc/ChangeLog-1.9.38
-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-YARV12
-rw-r--r--doc/NEWS-1.8.74
-rw-r--r--doc/NEWS-1.9.24
-rw-r--r--doc/NEWS-2.0.05
-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/NEWS-2.5.0565
-rw-r--r--doc/NEWS-2.6.0662
-rw-r--r--doc/bug_triaging.rdoc79
-rw-r--r--doc/contributing.rdoc207
-rw-r--r--doc/contributors.rdoc21
-rw-r--r--doc/dtrace_probes.rdoc10
-rw-r--r--doc/etc.rd.ja75
-rw-r--r--doc/extension.ja.rdoc1834
-rw-r--r--doc/extension.rdoc2105
-rw-r--r--doc/globals.rdoc92
-rw-r--r--doc/irb/irb.rd.ja80
-rw-r--r--doc/keywords.rdoc8
-rw-r--r--doc/maintainers.rdoc441
-rw-r--r--doc/marshal.rdoc4
-rw-r--r--doc/regexp.rdoc65
-rw-r--r--doc/security.rdoc55
-rw-r--r--doc/shell.rd.ja335
-rw-r--r--doc/signals.rdoc106
-rw-r--r--doc/standard_library.rdoc121
-rw-r--r--doc/syntax.rdoc2
-rw-r--r--doc/syntax/assignment.rdoc36
-rw-r--r--doc/syntax/calling_methods.rdoc74
-rw-r--r--doc/syntax/comments.rdoc37
-rw-r--r--doc/syntax/control_expressions.rdoc93
-rw-r--r--doc/syntax/exceptions.rdoc16
-rw-r--r--doc/syntax/literals.rdoc109
-rw-r--r--doc/syntax/methods.rdoc224
-rw-r--r--doc/syntax/miscellaneous.rdoc11
-rw-r--r--doc/syntax/modules_and_classes.rdoc43
-rw-r--r--doc/syntax/precedence.rdoc6
-rw-r--r--doc/syntax/refinements.rdoc118
-rw-r--r--enc/Makefile.in14
-rw-r--r--enc/ascii.c10
-rw-r--r--enc/big5.c3
-rw-r--r--enc/cesu_8.c454
-rw-r--r--enc/cp949.c1
-rw-r--r--enc/depend302
-rw-r--r--enc/ebcdic.h11
-rw-r--r--enc/emacs_mule.c3
-rw-r--r--enc/euc_jp.c7
-rw-r--r--enc/euc_kr.c26
-rw-r--r--enc/euc_tw.c1
-rw-r--r--enc/gb18030.c2
-rw-r--r--enc/gb2312.c4
-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.c55
-rw-r--r--enc/iso_8859_10.c58
-rw-r--r--enc/iso_8859_11.c1
-rw-r--r--enc/iso_8859_13.c72
-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.c53
-rw-r--r--enc/iso_8859_3.c67
-rw-r--r--enc/iso_8859_4.c56
-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.rb32
-rw-r--r--enc/mktable.c42
-rw-r--r--enc/prelude.rb4
-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/JISX0212%UCS.src2
-rw-r--r--enc/trans/JIS/UCS%JISX0212.src2
-rw-r--r--enc/trans/cesu_8.trans85
-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.c327
-rw-r--r--enc/unicode/12.1.0/casefold.h7428
-rw-r--r--enc/unicode/12.1.0/name2ctype.h41810
-rwxr-xr-xenc/unicode/case-folding.rb258
-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.c57
-rw-r--r--enc/windows_1251.c47
-rw-r--r--enc/windows_1252.c53
-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.c296
-rw-r--r--enum.c1709
-rw-r--r--enumerator.c2476
-rw-r--r--error.c1610
-rw-r--r--eval.c1335
-rw-r--r--eval_error.c479
-rw-r--r--eval_intern.h211
-rw-r--r--eval_jump.c37
-rw-r--r--ext/-test-/arith_seq/extract/depend13
-rw-r--r--ext/-test-/arith_seq/extract/extconf.rb2
-rw-r--r--ext/-test-/arith_seq/extract/extract.c27
-rw-r--r--ext/-test-/array/resize/depend13
-rw-r--r--ext/-test-/array/resize/extconf.rb1
-rw-r--r--ext/-test-/auto_ext.rb10
-rw-r--r--ext/-test-/bignum/depend52
-rw-r--r--ext/-test-/bignum/extconf.rb10
-rw-r--r--ext/-test-/bignum/mul.c4
-rw-r--r--ext/-test-/bug-14834/bug-14384.c39
-rw-r--r--ext/-test-/bug-14834/depend14
-rw-r--r--ext/-test-/bug-14834/extconf.rb2
-rw-r--r--ext/-test-/bug-3571/bug.c4
-rw-r--r--ext/-test-/bug-3571/depend14
-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/depend14
-rw-r--r--ext/-test-/bug-5832/extconf.rb3
-rw-r--r--ext/-test-/bug_reporter/depend14
-rw-r--r--ext/-test-/bug_reporter/extconf.rb3
-rw-r--r--ext/-test-/class/depend25
-rw-r--r--ext/-test-/class/extconf.rb10
-rw-r--r--ext/-test-/cxxanyargs/cxxanyargs.cpp619
-rw-r--r--ext/-test-/cxxanyargs/depend25
-rw-r--r--ext/-test-/cxxanyargs/extconf.rb31
-rw-r--r--ext/-test-/cxxanyargs/failure.cpp13
-rw-r--r--ext/-test-/cxxanyargs/failurem1.cpp13
-rw-r--r--ext/-test-/debug/depend8
-rw-r--r--ext/-test-/debug/extconf.rb9
-rw-r--r--ext/-test-/dln/empty/depend3
-rw-r--r--ext/-test-/dln/empty/extconf.rb1
-rw-r--r--ext/-test-/enumerator_kw/depend14
-rw-r--r--ext/-test-/enumerator_kw/enumerator_kw.c21
-rw-r--r--ext/-test-/enumerator_kw/extconf.rb1
-rw-r--r--ext/-test-/exception/depend15
-rw-r--r--ext/-test-/exception/enc_raise.c2
-rw-r--r--ext/-test-/exception/ensured.c14
-rw-r--r--ext/-test-/exception/extconf.rb9
-rw-r--r--ext/-test-/fatal/depend14
-rw-r--r--ext/-test-/fatal/extconf.rb1
-rw-r--r--ext/-test-/file/depend10
-rw-r--r--ext/-test-/file/extconf.rb10
-rw-r--r--ext/-test-/file/fs.c6
-rw-r--r--ext/-test-/float/depend31
-rw-r--r--ext/-test-/float/extconf.rb10
-rw-r--r--ext/-test-/funcall/depend14
-rw-r--r--ext/-test-/funcall/extconf.rb3
-rw-r--r--ext/-test-/funcall/funcall.c72
-rw-r--r--ext/-test-/funcall/passing_block.c30
-rw-r--r--ext/-test-/gvl/call_without_gvl/call_without_gvl.c76
-rw-r--r--ext/-test-/gvl/call_without_gvl/depend14
-rw-r--r--ext/-test-/gvl/call_without_gvl/extconf.rb2
-rw-r--r--ext/-test-/hash/depend26
-rw-r--r--ext/-test-/hash/extconf.rb10
-rw-r--r--ext/-test-/integer/core_ext.c36
-rw-r--r--ext/-test-/integer/depend39
-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/depend14
-rw-r--r--ext/-test-/iseq_load/extconf.rb3
-rw-r--r--ext/-test-/iter/break.c4
-rw-r--r--ext/-test-/iter/depend38
-rw-r--r--ext/-test-/iter/extconf.rb10
-rw-r--r--ext/-test-/iter/yield.c2
-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/depend14
-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/depend14
-rw-r--r--ext/-test-/marshal/compat/extconf.rb1
-rw-r--r--ext/-test-/marshal/internal_ivar/depend14
-rw-r--r--ext/-test-/marshal/internal_ivar/extconf.rb2
-rw-r--r--ext/-test-/marshal/internal_ivar/internal_ivar.c48
-rw-r--r--ext/-test-/marshal/usr/depend14
-rw-r--r--ext/-test-/marshal/usr/extconf.rb1
-rw-r--r--ext/-test-/memory_status/depend14
-rw-r--r--ext/-test-/memory_status/extconf.rb12
-rw-r--r--ext/-test-/memory_status/memory_status.c69
-rw-r--r--ext/-test-/method/depend26
-rw-r--r--ext/-test-/method/extconf.rb9
-rw-r--r--ext/-test-/notimplement/bug.c18
-rw-r--r--ext/-test-/notimplement/depend14
-rw-r--r--ext/-test-/notimplement/extconf.rb2
-rw-r--r--ext/-test-/num2int/depend14
-rw-r--r--ext/-test-/num2int/extconf.rb3
-rw-r--r--ext/-test-/path_to_class/depend14
-rw-r--r--ext/-test-/path_to_class/extconf.rb3
-rw-r--r--ext/-test-/popen_deadlock/depend14
-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/depend16
-rw-r--r--ext/-test-/postponed_job/extconf.rb1
-rw-r--r--ext/-test-/postponed_job/postponed_job.c18
-rw-r--r--ext/-test-/printf/depend20
-rw-r--r--ext/-test-/printf/extconf.rb1
-rw-r--r--ext/-test-/printf/printf.c8
-rw-r--r--ext/-test-/proc/depend38
-rw-r--r--ext/-test-/proc/extconf.rb10
-rw-r--r--ext/-test-/rational/depend7
-rw-r--r--ext/-test-/rational/extconf.rb1
-rw-r--r--ext/-test-/rb_call_super_kw/depend14
-rw-r--r--ext/-test-/rb_call_super_kw/extconf.rb1
-rw-r--r--ext/-test-/rb_call_super_kw/rb_call_super_kw.c14
-rw-r--r--ext/-test-/recursion/depend14
-rw-r--r--ext/-test-/recursion/extconf.rb1
-rw-r--r--ext/-test-/regexp/depend27
-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
-rw-r--r--ext/-test-/scan_args/depend14
-rw-r--r--ext/-test-/scan_args/extconf.rb1
-rw-r--r--ext/-test-/scan_args/scan_args.c315
-rw-r--r--ext/-test-/st/foreach/depend14
-rw-r--r--ext/-test-/st/foreach/extconf.rb1
-rw-r--r--ext/-test-/st/foreach/foreach.c14
-rw-r--r--ext/-test-/st/numhash/depend14
-rw-r--r--ext/-test-/st/numhash/extconf.rb1
-rw-r--r--ext/-test-/st/numhash/numhash.c5
-rw-r--r--ext/-test-/st/update/depend14
-rw-r--r--ext/-test-/st/update/extconf.rb1
-rw-r--r--ext/-test-/string/capacity.c17
-rw-r--r--ext/-test-/string/coderange.c4
-rw-r--r--ext/-test-/string/cstr.c98
-rw-r--r--ext/-test-/string/depend109
-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.c2
-rw-r--r--ext/-test-/string/normalize.c2
-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/depend50
-rw-r--r--ext/-test-/struct/extconf.rb10
-rw-r--r--ext/-test-/struct/len.c13
-rw-r--r--ext/-test-/symbol/depend26
-rw-r--r--ext/-test-/symbol/extconf.rb9
-rw-r--r--ext/-test-/symbol/init.c16
-rw-r--r--ext/-test-/thread_fd_close/depend13
-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/depend38
-rw-r--r--ext/-test-/time/extconf.rb3
-rw-r--r--ext/-test-/time/init.c11
-rw-r--r--ext/-test-/time/leap_second.c15
-rw-r--r--ext/-test-/time/new.c34
-rw-r--r--ext/-test-/tracepoint/depend4
-rw-r--r--ext/-test-/tracepoint/extconf.rb1
-rw-r--r--ext/-test-/tracepoint/gc_hook.c2
-rw-r--r--ext/-test-/typeddata/depend14
-rw-r--r--ext/-test-/typeddata/extconf.rb3
-rw-r--r--ext/-test-/typeddata/typeddata.c24
-rw-r--r--ext/-test-/vm/depend14
-rw-r--r--ext/-test-/wait_for_single_fd/depend3
-rw-r--r--ext/-test-/wait_for_single_fd/extconf.rb5
-rw-r--r--ext/-test-/wait_for_single_fd/wait_for_single_fd.c64
-rw-r--r--ext/-test-/win32/console/attribute.c29
-rw-r--r--ext/-test-/win32/console/extconf.rb9
-rw-r--r--ext/-test-/win32/dln/depend9
-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/Setup19
-rw-r--r--ext/Setup.atheos2
-rw-r--r--ext/Setup.emx31
-rw-r--r--ext/Setup.nacl45
-rw-r--r--ext/Setup.nt2
-rw-r--r--ext/bigdecimal/bigdecimal.c1321
-rw-r--r--ext/bigdecimal/bigdecimal.gemspec44
-rw-r--r--ext/bigdecimal/bigdecimal.h92
-rw-r--r--ext/bigdecimal/depend6
-rw-r--r--ext/bigdecimal/extconf.rb48
-rw-r--r--ext/bigdecimal/lib/bigdecimal.rb1
-rw-r--r--ext/bigdecimal/lib/bigdecimal/jacobian.rb5
-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.rb127
-rw-r--r--ext/bigdecimal/sample/linear.rb22
-rw-r--r--ext/bigdecimal/sample/nlsolve.rb11
-rw-r--r--ext/bigdecimal/sample/pi.rb1
-rw-r--r--ext/bigdecimal/util/depend14
-rw-r--r--ext/cgi/escape/depend17
-rw-r--r--ext/cgi/escape/escape.c407
-rw-r--r--ext/cgi/escape/extconf.rb3
-rw-r--r--ext/continuation/depend13
-rw-r--r--ext/continuation/extconf.rb1
-rw-r--r--ext/coverage/coverage.c279
-rw-r--r--ext/coverage/depend22
-rw-r--r--ext/coverage/extconf.rb1
-rw-r--r--ext/coverage/lib/coverage.rb14
-rw-r--r--ext/date/date.gemspec21
-rw-r--r--ext/date/date_core.c1353
-rw-r--r--ext/date/date_parse.c505
-rw-r--r--ext/date/date_strptime.c87
-rw-r--r--ext/date/date_tmx.h2
-rw-r--r--ext/date/depend20
-rw-r--r--ext/date/extconf.rb10
-rw-r--r--ext/date/lib/date.rb19
-rw-r--r--ext/date/prereq.mk12
-rw-r--r--ext/date/update-abbr35
-rw-r--r--ext/date/zonetab.h1562
-rw-r--r--ext/date/zonetab.list327
-rw-r--r--ext/dbm/dbm.c133
-rw-r--r--ext/dbm/dbm.gemspec20
-rw-r--r--ext/dbm/depend14
-rw-r--r--ext/dbm/extconf.rb7
-rw-r--r--ext/digest/bubblebabble/bubblebabble.c3
-rw-r--r--ext/digest/bubblebabble/depend6
-rw-r--r--ext/digest/bubblebabble/extconf.rb1
-rw-r--r--ext/digest/depend4
-rw-r--r--ext/digest/digest.c115
-rw-r--r--ext/digest/digest.h32
-rw-r--r--ext/digest/digest_conf.rb84
-rw-r--r--ext/digest/extconf.rb1
-rw-r--r--ext/digest/lib/digest.rb3
-rw-r--r--ext/digest/md5/depend9
-rw-r--r--ext/digest/md5/extconf.rb13
-rw-r--r--ext/digest/md5/md5cc.h19
-rw-r--r--ext/digest/md5/md5init.c32
-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.rb13
-rw-r--r--ext/digest/rmd160/rmd160init.c30
-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.rb13
-rw-r--r--ext/digest/sha1/sha1cc.h14
-rw-r--r--ext/digest/sha1/sha1init.c34
-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.rb14
-rw-r--r--ext/digest/sha2/lib/sha2.rb45
-rw-r--r--ext/digest/sha2/sha2.c2
-rw-r--r--ext/digest/sha2/sha2cc.h31
-rw-r--r--ext/digest/sha2/sha2init.c10
-rw-r--r--ext/digest/sha2/sha2ossl.c13
-rw-r--r--ext/digest/sha2/sha2ossl.h16
-rw-r--r--ext/etc/depend24
-rw-r--r--ext/etc/etc.c57
-rw-r--r--ext/etc/etc.gemspec45
-rw-r--r--ext/etc/extconf.rb13
-rw-r--r--ext/etc/mkconstants.rb17
-rwxr-xr-xext/extmk.rb380
-rw-r--r--ext/fcntl/depend14
-rw-r--r--ext/fcntl/extconf.rb1
-rw-r--r--ext/fcntl/fcntl.c2
-rw-r--r--ext/fcntl/fcntl.gemspec25
-rw-r--r--ext/fiber/depend3
-rw-r--r--ext/fiber/extconf.rb1
-rw-r--r--ext/fiddle/closure.c97
-rw-r--r--ext/fiddle/conversions.h4
-rw-r--r--ext/fiddle/depend128
-rw-r--r--ext/fiddle/extconf.rb49
-rw-r--r--ext/fiddle/extlibs5
-rw-r--r--ext/fiddle/fiddle.gemspec23
-rw-r--r--ext/fiddle/function.c117
-rw-r--r--ext/fiddle/handle.c13
-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.rb28
-rw-r--r--ext/fiddle/lib/fiddle/pack.rb24
-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.rb28
-rw-r--r--ext/fiddle/pointer.c17
-rw-r--r--ext/fiddle/win32/libffi-3.2.1-mswin.patch65
-rwxr-xr-xext/fiddle/win32/libffi-config.rb1
-rw-r--r--ext/gdbm/depend14
-rw-r--r--ext/gdbm/extconf.rb1
-rw-r--r--ext/gdbm/gdbm.c60
-rw-r--r--ext/gdbm/gdbm.gemspec21
-rwxr-xr-xext/io/console/buildgem.sh5
-rw-r--r--ext/io/console/console.c987
-rw-r--r--ext/io/console/depend43
-rw-r--r--ext/io/console/extconf.rb13
-rw-r--r--ext/io/console/io-console.gemspec22
-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/depend22
-rw-r--r--ext/io/nonblock/extconf.rb1
-rw-r--r--ext/io/nonblock/nonblock.c12
-rw-r--r--ext/io/wait/depend22
-rw-r--r--ext/io/wait/extconf.rb1
-rw-r--r--ext/io/wait/wait.c158
-rw-r--r--ext/json/depend2
-rw-r--r--ext/json/extconf.rb1
-rw-r--r--ext/json/fbuffer/fbuffer.h3
-rw-r--r--ext/json/generator/depend7
-rw-r--r--ext/json/generator/generator.c279
-rw-r--r--ext/json/generator/generator.h27
-rw-r--r--ext/json/json.gemspec133
-rw-r--r--ext/json/lib/json.rb1
-rw-r--r--ext/json/lib/json/add/bigdecimal.rb5
-rw-r--r--ext/json/lib/json/add/complex.rb11
-rw-r--r--ext/json/lib/json/add/core.rb1
-rw-r--r--ext/json/lib/json/add/date.rb1
-rw-r--r--ext/json/lib/json/add/date_time.rb1
-rw-r--r--ext/json/lib/json/add/exception.rb1
-rw-r--r--ext/json/lib/json/add/ostruct.rb5
-rw-r--r--ext/json/lib/json/add/range.rb1
-rw-r--r--ext/json/lib/json/add/rational.rb10
-rw-r--r--ext/json/lib/json/add/regexp.rb5
-rw-r--r--ext/json/lib/json/add/set.rb29
-rw-r--r--ext/json/lib/json/add/struct.rb1
-rw-r--r--ext/json/lib/json/add/symbol.rb1
-rw-r--r--ext/json/lib/json/add/time.rb3
-rw-r--r--ext/json/lib/json/common.rb86
-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/depend7
-rw-r--r--ext/json/parser/extconf.rb1
-rw-r--r--ext/json/parser/parser.c843
-rw-r--r--ext/json/parser/parser.h25
-rw-r--r--ext/json/parser/parser.rl324
-rw-r--r--ext/json/parser/prereq.mk3
-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/monitor/depend13
-rw-r--r--ext/monitor/extconf.rb2
-rw-r--r--ext/monitor/lib/monitor.rb284
-rw-r--r--ext/monitor/monitor.c221
-rw-r--r--ext/nkf/depend3
-rw-r--r--ext/nkf/extconf.rb1
-rw-r--r--ext/nkf/lib/kconv.rb1
-rw-r--r--ext/nkf/nkf-utf8/nkf.c60
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.c160
-rw-r--r--ext/nkf/nkf-utf8/utf8tbl.h2
-rw-r--r--ext/nkf/nkf.c10
-rw-r--r--ext/objspace/depend21
-rw-r--r--ext/objspace/extconf.rb1
-rw-r--r--ext/objspace/object_tracing.c44
-rw-r--r--ext/objspace/objspace.c336
-rw-r--r--ext/objspace/objspace_dump.c149
-rw-r--r--ext/openssl/History.md339
-rw-r--r--ext/openssl/depend284
-rw-r--r--ext/openssl/deprecation.rb18
-rw-r--r--ext/openssl/extconf.rb238
-rw-r--r--ext/openssl/lib/openssl.rb10
-rw-r--r--ext/openssl/lib/openssl/bn.rb13
-rw-r--r--ext/openssl/lib/openssl/buffering.rb86
-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.rb328
-rw-r--r--ext/openssl/lib/openssl/x509.rb51
-rw-r--r--ext/openssl/openssl.gemspec29
-rw-r--r--ext/openssl/openssl_missing.c368
-rw-r--r--ext/openssl/openssl_missing.h253
-rw-r--r--ext/openssl/ossl.c574
-rw-r--r--ext/openssl/ossl.h159
-rw-r--r--ext/openssl/ossl_asn1.c963
-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.c603
-rw-r--r--ext/openssl/ossl_bn.h8
-rw-r--r--ext/openssl/ossl_cipher.c495
-rw-r--r--ext/openssl/ossl_cipher.h6
-rw-r--r--ext/openssl/ossl_config.c22
-rw-r--r--ext/openssl/ossl_config.h5
-rw-r--r--ext/openssl/ossl_digest.c94
-rw-r--r--ext/openssl/ossl_digest.h6
-rw-r--r--ext/openssl/ossl_engine.c245
-rw-r--r--ext/openssl/ossl_engine.h3
-rw-r--r--ext/openssl/ossl_hmac.c173
-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.c71
-rw-r--r--ext/openssl/ossl_ns_spki.h4
-rw-r--r--ext/openssl/ossl_ocsp.c1178
-rw-r--r--ext/openssl/ossl_ocsp.h5
-rw-r--r--ext/openssl/ossl_pkcs12.c119
-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.c140
-rw-r--r--ext/openssl/ossl_pkcs7.h4
-rw-r--r--ext/openssl/ossl_pkey.c285
-rw-r--r--ext/openssl/ossl_pkey.h167
-rw-r--r--ext/openssl/ossl_pkey_dh.c322
-rw-r--r--ext/openssl/ossl_pkey_dsa.c294
-rw-r--r--ext/openssl/ossl_pkey_ec.c1281
-rw-r--r--ext/openssl/ossl_pkey_rsa.c533
-rw-r--r--ext/openssl/ossl_rand.c74
-rw-r--r--ext/openssl/ossl_rand.h4
-rw-r--r--ext/openssl/ossl_ssl.c2059
-rw-r--r--ext/openssl/ossl_ssl.h14
-rw-r--r--ext/openssl/ossl_ssl_session.c160
-rw-r--r--ext/openssl/ossl_version.h5
-rw-r--r--ext/openssl/ossl_x509.c93
-rw-r--r--ext/openssl/ossl_x509.h29
-rw-r--r--ext/openssl/ossl_x509attr.c159
-rw-r--r--ext/openssl/ossl_x509cert.c184
-rw-r--r--ext/openssl/ossl_x509crl.c169
-rw-r--r--ext/openssl/ossl_x509ext.c172
-rw-r--r--ext/openssl/ossl_x509name.c222
-rw-r--r--ext/openssl/ossl_x509req.c137
-rw-r--r--ext/openssl/ossl_x509revoked.c109
-rw-r--r--ext/openssl/ossl_x509store.c465
-rw-r--r--ext/openssl/ruby_missing.h20
-rw-r--r--ext/pathname/depend20
-rw-r--r--ext/pathname/extconf.rb3
-rw-r--r--ext/pathname/lib/pathname.rb42
-rw-r--r--ext/pathname/pathname.c415
-rw-r--r--ext/psych/.gitignore11
-rw-r--r--ext/psych/depend107
-rw-r--r--ext/psych/extconf.rb9
-rw-r--r--ext/psych/lib/psych.rb251
-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.rb8
-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.rb3
-rw-r--r--ext/psych/lib/psych/nodes/document.rb3
-rw-r--r--ext/psych/lib/psych/nodes/mapping.rb3
-rw-r--r--ext/psych/lib/psych/nodes/node.rb20
-rw-r--r--ext/psych/lib/psych/nodes/scalar.rb3
-rw-r--r--ext/psych/lib/psych/nodes/sequence.rb3
-rw-r--r--ext/psych/lib/psych/nodes/stream.rb3
-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.rb65
-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.rb10
-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.rb60
-rw-r--r--ext/psych/lib/psych/visitors/visitor.rb1
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb256
-rw-r--r--ext/psych/lib/psych/y.rb1
-rw-r--r--ext/psych/psych.gemspec81
-rw-r--r--ext/psych/psych.h3
-rw-r--r--ext/psych/psych_emitter.c73
-rw-r--r--ext/psych/psych_parser.c102
-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.c108
-rw-r--r--ext/psych/yaml/config.h14
-rw-r--r--ext/psych/yaml/dumper.c4
-rw-r--r--ext/psych/yaml/emitter.c27
-rw-r--r--ext/psych/yaml/loader.c33
-rw-r--r--ext/psych/yaml/parser.c10
-rw-r--r--ext/psych/yaml/reader.c6
-rw-r--r--ext/psych/yaml/scanner.c61
-rw-r--r--ext/psych/yaml/yaml_private.h62
-rw-r--r--ext/pty/depend5
-rw-r--r--ext/pty/extconf.rb4
-rw-r--r--ext/pty/lib/expect.rb10
-rw-r--r--ext/pty/pty.c174
-rw-r--r--ext/racc/cparse/README2
-rw-r--r--ext/racc/cparse/cparse.c12
-rw-r--r--ext/racc/cparse/depend14
-rw-r--r--ext/racc/cparse/extconf.rb7
-rw-r--r--ext/rbconfig/sizeof/depend28
-rw-r--r--ext/rbconfig/sizeof/extconf.rb35
-rw-r--r--ext/readline/.gitignore1
-rw-r--r--ext/readline/depend5
-rw-r--r--ext/readline/extconf.rb11
-rw-r--r--ext/readline/readline-ext.gemspec21
-rw-r--r--ext/readline/readline.c219
-rw-r--r--ext/ripper/depend28
-rw-r--r--ext/ripper/eventids2.c350
-rw-r--r--ext/ripper/extconf.rb11
-rw-r--r--ext/ripper/lib/ripper.rb9
-rw-r--r--ext/ripper/lib/ripper/core.rb24
-rw-r--r--ext/ripper/lib/ripper/filter.rb11
-rw-r--r--ext/ripper/lib/ripper/lexer.rb159
-rw-r--r--ext/ripper/lib/ripper/sexp.rb104
-rw-r--r--ext/ripper/tools/dsl.rb85
-rwxr-xr-x[-rw-r--r--]ext/ripper/tools/generate-param-macros.rb1
-rwxr-xr-x[-rw-r--r--]ext/ripper/tools/generate.rb14
-rwxr-xr-x[-rw-r--r--]ext/ripper/tools/preproc.rb44
-rwxr-xr-x[-rw-r--r--]ext/ripper/tools/strip.rb8
-rw-r--r--ext/rubyvm/depend2
-rw-r--r--ext/rubyvm/extconf.rb1
-rw-r--r--ext/rubyvm/lib/forwardable/impl.rb16
-rw-r--r--ext/sdbm/_sdbm.c68
-rw-r--r--ext/sdbm/depend10
-rw-r--r--ext/sdbm/extconf.rb1
-rw-r--r--ext/sdbm/init.c34
-rw-r--r--ext/sdbm/sdbm.gemspec21
-rw-r--r--ext/socket/ancdata.c284
-rw-r--r--ext/socket/basicsocket.c140
-rw-r--r--ext/socket/constants.c3
-rw-r--r--ext/socket/depend83
-rw-r--r--ext/socket/extconf.rb42
-rw-r--r--ext/socket/getaddrinfo.c16
-rw-r--r--ext/socket/getnameinfo.c10
-rw-r--r--ext/socket/ifaddr.c90
-rw-r--r--ext/socket/init.c336
-rw-r--r--ext/socket/ipsocket.c66
-rw-r--r--ext/socket/lib/socket.rb614
-rw-r--r--ext/socket/mkconstants.rb32
-rw-r--r--ext/socket/option.c40
-rw-r--r--ext/socket/raddrinfo.c329
-rw-r--r--ext/socket/rubysocket.h67
-rw-r--r--ext/socket/socket.c463
-rw-r--r--ext/socket/sockssocket.c14
-rw-r--r--ext/socket/tcpserver.c44
-rw-r--r--ext/socket/tcpsocket.c17
-rw-r--r--ext/socket/udpsocket.c191
-rw-r--r--ext/socket/unixserver.c45
-rw-r--r--ext/socket/unixsocket.c73
-rw-r--r--ext/stringio/README18
-rw-r--r--ext/stringio/README.md10
-rw-r--r--ext/stringio/depend22
-rw-r--r--ext/stringio/extconf.rb2
-rw-r--r--ext/stringio/stringio.c666
-rw-r--r--ext/stringio/stringio.gemspec34
-rw-r--r--ext/strscan/depend5
-rw-r--r--ext/strscan/extconf.rb4
-rw-r--r--ext/strscan/strscan.c441
-rw-r--r--ext/strscan/strscan.gemspec20
-rw-r--r--ext/syslog/depend2
-rw-r--r--ext/syslog/extconf.rb3
-rw-r--r--ext/syslog/lib/syslog/logger.rb5
-rw-r--r--ext/syslog/syslog.c16
-rw-r--r--ext/thread/extconf.rb3
-rw-r--r--ext/thread/thread.c656
-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.rb5775
-rw-r--r--ext/tk/lib/tk/after.rb6
-rw-r--r--ext/tk/lib/tk/autoload.rb762
-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.rb180
-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/tk_mac.rb158
-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/validator.rb65
-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.rb1336
-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/dted.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/raw.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.c11130
-rw-r--r--ext/tk/tkutil/depend1
-rw-r--r--ext/tk/tkutil/extconf.rb11
-rw-r--r--ext/tk/tkutil/tkutil.c1878
-rw-r--r--ext/win32/depend2
-rw-r--r--ext/win32/extconf.rb3
-rw-r--r--ext/win32/lib/Win32API.rb30
-rw-r--r--ext/win32/lib/win32/importer.rb1
-rw-r--r--ext/win32/lib/win32/registry.rb32
-rw-r--r--ext/win32/lib/win32/resolv.rb324
-rw-r--r--ext/win32/lib/win32/resolv9x.rb253
-rw-r--r--ext/win32/lib/win32/sspi.rb3
-rw-r--r--ext/win32/resolv/depend17
-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.rb5
-rw-r--r--ext/win32ole/sample/excel2.rb3
-rw-r--r--ext/win32ole/sample/excel3.rb3
-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.c456
-rw-r--r--ext/win32ole/win32ole.h12
-rw-r--r--ext/win32ole/win32ole_error.c1
-rw-r--r--ext/win32ole/win32ole_error.h3
-rw-r--r--ext/win32ole/win32ole_event.c68
-rw-r--r--ext/win32ole/win32ole_method.c38
-rw-r--r--ext/win32ole/win32ole_param.c2
-rw-r--r--ext/win32ole/win32ole_record.c8
-rw-r--r--ext/win32ole/win32ole_type.c8
-rw-r--r--ext/win32ole/win32ole_typelib.c8
-rw-r--r--ext/win32ole/win32ole_variable.c2
-rw-r--r--ext/win32ole/win32ole_variant.c43
-rw-r--r--ext/win32ole/win32ole_variant_m.c52
-rw-r--r--ext/zlib/.gitignore1
-rw-r--r--ext/zlib/depend24
-rw-r--r--ext/zlib/extconf.rb82
-rw-r--r--ext/zlib/zlib.c742
-rw-r--r--ext/zlib/zlib.gemspec35
-rw-r--r--file.c2136
-rw-r--r--gc.c6169
-rw-r--r--gc.h30
-rw-r--r--gc.rb169
-rw-r--r--gem_prelude.rb1
-rw-r--r--gems/bundled_gems9
-rw-r--r--golf_prelude.rb9
-rw-r--r--goruby.c10
-rw-r--r--hash.c3912
-rw-r--r--hrtime.h168
-rw-r--r--ia64.s42
-rw-r--r--id_table.c325
-rw-r--r--id_table.h34
-rw-r--r--include/ruby/assert.h54
-rw-r--r--include/ruby/backward.h79
-rw-r--r--include/ruby/backward/classext.h2
-rw-r--r--include/ruby/backward/cxxanyargs.hpp439
-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.h7
-rw-r--r--include/ruby/defines.h297
-rw-r--r--include/ruby/encoding.h218
-rw-r--r--include/ruby/intern.h522
-rw-r--r--include/ruby/io.h23
-rw-r--r--include/ruby/missing.h44
-rw-r--r--include/ruby/onigmo.h941
-rw-r--r--include/ruby/oniguruma.h841
-rw-r--r--include/ruby/re.h3
-rw-r--r--include/ruby/ruby.h1920
-rw-r--r--include/ruby/st.h184
-rw-r--r--include/ruby/thread.h12
-rw-r--r--include/ruby/util.h15
-rw-r--r--include/ruby/version.h4
-rw-r--r--include/ruby/vm.h3
-rw-r--r--include/ruby/win32.h164
-rw-r--r--inits.c23
-rw-r--r--insns.def2266
-rw-r--r--internal.h2090
-rw-r--r--io.c3764
-rw-r--r--io.rb123
-rw-r--r--iseq.c3014
-rw-r--r--iseq.h290
-rw-r--r--lex.c.blt218
-rw-r--r--lib/.document25
-rw-r--r--lib/English.rb53
-rw-r--r--lib/abbrev.rb1
-rw-r--r--lib/base64.rb27
-rw-r--r--lib/benchmark.rb58
-rw-r--r--lib/benchmark/benchmark.gemspec29
-rw-r--r--lib/benchmark/version.rb3
-rw-r--r--lib/bundler.rb682
-rw-r--r--lib/bundler/build_metadata.rb51
-rw-r--r--lib/bundler/bundler.gemspec44
-rw-r--r--lib/bundler/capistrano.rb22
-rw-r--r--lib/bundler/cli.rb828
-rw-r--r--lib/bundler/cli/add.rb47
-rw-r--r--lib/bundler/cli/binstubs.rb49
-rw-r--r--lib/bundler/cli/cache.rb48
-rw-r--r--lib/bundler/cli/check.rb38
-rw-r--r--lib/bundler/cli/clean.rb25
-rw-r--r--lib/bundler/cli/common.rb101
-rw-r--r--lib/bundler/cli/config.rb194
-rw-r--r--lib/bundler/cli/console.rb43
-rw-r--r--lib/bundler/cli/doctor.rb140
-rw-r--r--lib/bundler/cli/exec.rb93
-rw-r--r--lib/bundler/cli/gem.rb252
-rw-r--r--lib/bundler/cli/info.rb62
-rw-r--r--lib/bundler/cli/init.rb47
-rw-r--r--lib/bundler/cli/inject.rb60
-rw-r--r--lib/bundler/cli/install.rb218
-rw-r--r--lib/bundler/cli/issue.rb40
-rw-r--r--lib/bundler/cli/list.rb58
-rw-r--r--lib/bundler/cli/lock.rb63
-rw-r--r--lib/bundler/cli/open.rb30
-rw-r--r--lib/bundler/cli/outdated.rb270
-rw-r--r--lib/bundler/cli/package.rb48
-rw-r--r--lib/bundler/cli/platform.rb46
-rw-r--r--lib/bundler/cli/plugin.rb31
-rw-r--r--lib/bundler/cli/pristine.rb47
-rw-r--r--lib/bundler/cli/remove.rb18
-rw-r--r--lib/bundler/cli/show.rb75
-rw-r--r--lib/bundler/cli/update.rb111
-rw-r--r--lib/bundler/cli/viz.rb31
-rw-r--r--lib/bundler/compact_index_client.rb125
-rw-r--r--lib/bundler/compact_index_client/cache.rb118
-rw-r--r--lib/bundler/compact_index_client/updater.rb112
-rw-r--r--lib/bundler/constants.rb7
-rw-r--r--lib/bundler/current_ruby.rb95
-rw-r--r--lib/bundler/definition.rb1002
-rw-r--r--lib/bundler/dep_proxy.rb48
-rw-r--r--lib/bundler/dependency.rb151
-rw-r--r--lib/bundler/deployment.rb69
-rw-r--r--lib/bundler/deprecate.rb44
-rw-r--r--lib/bundler/dsl.rb591
-rw-r--r--lib/bundler/endpoint_specification.rb141
-rw-r--r--lib/bundler/env.rb150
-rw-r--r--lib/bundler/environment_preserver.rb58
-rw-r--r--lib/bundler/errors.rb158
-rw-r--r--lib/bundler/feature_flag.rb63
-rw-r--r--lib/bundler/fetcher.rb315
-rw-r--r--lib/bundler/fetcher/base.rb52
-rw-r--r--lib/bundler/fetcher/compact_index.rb140
-rw-r--r--lib/bundler/fetcher/dependency.rb82
-rw-r--r--lib/bundler/fetcher/downloader.rb87
-rw-r--r--lib/bundler/fetcher/index.rb54
-rw-r--r--lib/bundler/friendly_errors.rb130
-rw-r--r--lib/bundler/gem_helper.rb217
-rw-r--r--lib/bundler/gem_helpers.rb99
-rw-r--r--lib/bundler/gem_remote_fetcher.rb43
-rw-r--r--lib/bundler/gem_tasks.rb7
-rw-r--r--lib/bundler/gem_version_promoter.rb190
-rw-r--r--lib/bundler/gemdeps.rb29
-rw-r--r--lib/bundler/graph.rb152
-rw-r--r--lib/bundler/index.rb213
-rw-r--r--lib/bundler/injector.rb255
-rw-r--r--lib/bundler/inline.rb84
-rw-r--r--lib/bundler/installer.rb311
-rw-r--r--lib/bundler/installer/gem_installer.rb89
-rw-r--r--lib/bundler/installer/parallel_installer.rb229
-rw-r--r--lib/bundler/installer/standalone.rb52
-rw-r--r--lib/bundler/lazy_specification.rb122
-rw-r--r--lib/bundler/lockfile_generator.rb95
-rw-r--r--lib/bundler/lockfile_parser.rb249
-rw-r--r--lib/bundler/match_platform.rb24
-rw-r--r--lib/bundler/mirror.rb223
-rw-r--r--lib/bundler/plugin.rb305
-rw-r--r--lib/bundler/plugin/api.rb81
-rw-r--r--lib/bundler/plugin/api/source.rb304
-rw-r--r--lib/bundler/plugin/dsl.rb53
-rw-r--r--lib/bundler/plugin/events.rb61
-rw-r--r--lib/bundler/plugin/index.rb173
-rw-r--r--lib/bundler/plugin/installer.rb109
-rw-r--r--lib/bundler/plugin/installer/git.rb38
-rw-r--r--lib/bundler/plugin/installer/rubygems.rb27
-rw-r--r--lib/bundler/plugin/source_list.rb27
-rw-r--r--lib/bundler/process_lock.rb24
-rw-r--r--lib/bundler/psyched_yaml.rb37
-rw-r--r--lib/bundler/remote_specification.rb112
-rw-r--r--lib/bundler/resolver.rb421
-rw-r--r--lib/bundler/resolver/spec_group.rb107
-rw-r--r--lib/bundler/retry.rb66
-rw-r--r--lib/bundler/ruby_dsl.rb18
-rw-r--r--lib/bundler/ruby_version.rb137
-rw-r--r--lib/bundler/rubygems_ext.rb154
-rw-r--r--lib/bundler/rubygems_gem_installer.rb99
-rw-r--r--lib/bundler/rubygems_integration.rb648
-rw-r--r--lib/bundler/runtime.rb315
-rw-r--r--lib/bundler/settings.rb434
-rw-r--r--lib/bundler/settings/validator.rb102
-rw-r--r--lib/bundler/setup.rb27
-rw-r--r--lib/bundler/shared_helpers.rb358
-rw-r--r--lib/bundler/similarity_detector.rb63
-rw-r--r--lib/bundler/source.rb94
-rw-r--r--lib/bundler/source/gemspec.rb18
-rw-r--r--lib/bundler/source/git.rb336
-rw-r--r--lib/bundler/source/git/git_proxy.rb259
-rw-r--r--lib/bundler/source/metadata.rb67
-rw-r--r--lib/bundler/source/path.rb254
-rw-r--r--lib/bundler/source/path/installer.rb74
-rw-r--r--lib/bundler/source/rubygems.rb545
-rw-r--r--lib/bundler/source/rubygems/remote.rb68
-rw-r--r--lib/bundler/source_list.rb183
-rw-r--r--lib/bundler/spec_set.rb203
-rw-r--r--lib/bundler/stub_specification.rb96
-rw-r--r--lib/bundler/templates/.document1
-rw-r--r--lib/bundler/templates/Executable29
-rw-r--r--lib/bundler/templates/Executable.bundler114
-rw-r--r--lib/bundler/templates/Executable.standalone14
-rw-r--r--lib/bundler/templates/Gemfile7
-rw-r--r--lib/bundler/templates/gems.rb8
-rw-r--r--lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt74
-rw-r--r--lib/bundler/templates/newgem/Gemfile.tt12
-rw-r--r--lib/bundler/templates/newgem/LICENSE.txt.tt21
-rw-r--r--lib/bundler/templates/newgem/README.md.tt48
-rw-r--r--lib/bundler/templates/newgem/Rakefile.tt29
-rw-r--r--lib/bundler/templates/newgem/bin/console.tt14
-rw-r--r--lib/bundler/templates/newgem/bin/setup.tt8
-rw-r--r--lib/bundler/templates/newgem/exe/newgem.tt3
-rw-r--r--lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt3
-rw-r--r--lib/bundler/templates/newgem/ext/newgem/newgem.c.tt9
-rw-r--r--lib/bundler/templates/newgem/ext/newgem/newgem.h.tt6
-rw-r--r--lib/bundler/templates/newgem/gitignore.tt20
-rw-r--r--lib/bundler/templates/newgem/lib/newgem.rb.tt13
-rw-r--r--lib/bundler/templates/newgem/lib/newgem/version.rb.tt7
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt34
-rw-r--r--lib/bundler/templates/newgem/rspec.tt3
-rw-r--r--lib/bundler/templates/newgem/spec/newgem_spec.rb.tt9
-rw-r--r--lib/bundler/templates/newgem/spec/spec_helper.rb.tt14
-rw-r--r--lib/bundler/templates/newgem/test/newgem_test.rb.tt11
-rw-r--r--lib/bundler/templates/newgem/test/test_helper.rb.tt4
-rw-r--r--lib/bundler/templates/newgem/travis.yml.tt6
-rw-r--r--lib/bundler/ui.rb9
-rw-r--r--lib/bundler/ui/rg_proxy.rb19
-rw-r--r--lib/bundler/ui/shell.rb142
-rw-r--r--lib/bundler/ui/silent.rb69
-rw-r--r--lib/bundler/uri_credentials_filter.rb41
-rw-r--r--lib/bundler/vendor/connection_pool/lib/connection_pool.rb161
-rw-r--r--lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb66
-rw-r--r--lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb176
-rw-r--r--lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb3
-rw-r--r--lib/bundler/vendor/fileutils/lib/fileutils.rb1764
-rw-r--r--lib/bundler/vendor/fileutils/lib/fileutils/version.rb5
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo.rb12
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb26
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb57
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb81
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb223
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb36
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb66
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb62
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb63
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb61
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb126
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb46
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb36
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb158
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/errors.rb143
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb6
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb101
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb67
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb837
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb46
-rw-r--r--lib/bundler/vendor/molinillo/lib/molinillo/state.rb58
-rw-r--r--lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb1202
-rw-r--r--lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb40
-rw-r--r--lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb53
-rw-r--r--lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb79
-rw-r--r--lib/bundler/vendor/thor/lib/thor.rb524
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions.rb336
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/create_file.rb104
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/create_link.rb60
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/directory.rb108
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb143
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb373
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb120
-rw-r--r--lib/bundler/vendor/thor/lib/thor/base.rb690
-rw-r--r--lib/bundler/vendor/thor/lib/thor/command.rb142
-rw-r--r--lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb97
-rw-r--r--lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb12
-rw-r--r--lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb129
-rw-r--r--lib/bundler/vendor/thor/lib/thor/error.rb110
-rw-r--r--lib/bundler/vendor/thor/lib/thor/group.rb281
-rw-r--r--lib/bundler/vendor/thor/lib/thor/invocation.rb178
-rw-r--r--lib/bundler/vendor/thor/lib/thor/line_editor.rb17
-rw-r--r--lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb37
-rw-r--r--lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb88
-rw-r--r--lib/bundler/vendor/thor/lib/thor/nested_context.rb29
-rw-r--r--lib/bundler/vendor/thor/lib/thor/parser.rb4
-rw-r--r--lib/bundler/vendor/thor/lib/thor/parser/argument.rb70
-rw-r--r--lib/bundler/vendor/thor/lib/thor/parser/arguments.rb175
-rw-r--r--lib/bundler/vendor/thor/lib/thor/parser/option.rb159
-rw-r--r--lib/bundler/vendor/thor/lib/thor/parser/options.rb236
-rw-r--r--lib/bundler/vendor/thor/lib/thor/rake_compat.rb72
-rw-r--r--lib/bundler/vendor/thor/lib/thor/runner.rb325
-rw-r--r--lib/bundler/vendor/thor/lib/thor/shell.rb81
-rw-r--r--lib/bundler/vendor/thor/lib/thor/shell/basic.rb491
-rw-r--r--lib/bundler/vendor/thor/lib/thor/shell/color.rb153
-rw-r--r--lib/bundler/vendor/thor/lib/thor/shell/html.rb126
-rw-r--r--lib/bundler/vendor/thor/lib/thor/util.rb284
-rw-r--r--lib/bundler/vendor/thor/lib/thor/version.rb3
-rw-r--r--lib/bundler/vendor/uri/lib/uri.rb104
-rw-r--r--lib/bundler/vendor/uri/lib/uri/common.rb744
-rw-r--r--lib/bundler/vendor/uri/lib/uri/file.rb94
-rw-r--r--lib/bundler/vendor/uri/lib/uri/ftp.rb267
-rw-r--r--lib/bundler/vendor/uri/lib/uri/generic.rb1568
-rw-r--r--lib/bundler/vendor/uri/lib/uri/http.rb88
-rw-r--r--lib/bundler/vendor/uri/lib/uri/https.rb23
-rw-r--r--lib/bundler/vendor/uri/lib/uri/ldap.rb261
-rw-r--r--lib/bundler/vendor/uri/lib/uri/ldaps.rb21
-rw-r--r--lib/bundler/vendor/uri/lib/uri/mailto.rb294
-rw-r--r--lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb546
-rw-r--r--lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb125
-rw-r--r--lib/bundler/vendor/uri/lib/uri/version.rb6
-rw-r--r--lib/bundler/vendored_fileutils.rb4
-rw-r--r--lib/bundler/vendored_molinillo.rb4
-rw-r--r--lib/bundler/vendored_persistent.rb54
-rw-r--r--lib/bundler/vendored_thor.rb8
-rw-r--r--lib/bundler/vendored_uri.rb4
-rw-r--r--lib/bundler/version.rb9
-rw-r--r--lib/bundler/version_ranges.rb122
-rw-r--r--lib/bundler/vlad.rb17
-rw-r--r--lib/bundler/worker.rb104
-rw-r--r--lib/bundler/yaml_serializer.rb89
-rw-r--r--lib/cgi.rb5
-rw-r--r--lib/cgi/cgi.gemspec27
-rw-r--r--lib/cgi/cookie.rb80
-rw-r--r--lib/cgi/core.rb61
-rw-r--r--lib/cgi/html.rb11
-rw-r--r--lib/cgi/session.rb39
-rw-r--r--lib/cgi/session/pstore.rb4
-rw-r--r--lib/cgi/util.rb93
-rw-r--r--lib/cgi/version.rb3
-rw-r--r--lib/cmath.rb442
-rw-r--r--lib/csv.rb2582
-rw-r--r--lib/csv/core_ext/array.rb9
-rw-r--r--lib/csv/core_ext/string.rb9
-rw-r--r--lib/csv/csv.gemspec44
-rw-r--r--lib/csv/delete_suffix.rb18
-rw-r--r--lib/csv/fields_converter.rb84
-rw-r--r--lib/csv/match_p.rb20
-rw-r--r--lib/csv/parser.rb1136
-rw-r--r--lib/csv/row.rb390
-rw-r--r--lib/csv/table.rb402
-rw-r--r--lib/csv/version.rb6
-rw-r--r--lib/csv/writer.rb168
-rw-r--r--lib/debug.rb33
-rw-r--r--lib/delegate.rb131
-rw-r--r--lib/delegate/delegate.gemspec27
-rw-r--r--lib/delegate/version.rb3
-rw-r--r--lib/did_you_mean.rb110
-rw-r--r--lib/did_you_mean/core_ext/name_error.rb25
-rw-r--r--lib/did_you_mean/did_you_mean.gemspec27
-rw-r--r--lib/did_you_mean/experimental.rb2
-rw-r--r--lib/did_you_mean/experimental/initializer_name_correction.rb20
-rw-r--r--lib/did_you_mean/experimental/ivar_name_correction.rb76
-rw-r--r--lib/did_you_mean/formatters/plain_formatter.rb33
-rw-r--r--lib/did_you_mean/formatters/verbose_formatter.rb49
-rw-r--r--lib/did_you_mean/jaro_winkler.rb87
-rw-r--r--lib/did_you_mean/levenshtein.rb57
-rw-r--r--lib/did_you_mean/spell_checker.rb46
-rw-r--r--lib/did_you_mean/spell_checkers/key_error_checker.rb20
-rw-r--r--lib/did_you_mean/spell_checkers/method_name_checker.rb64
-rw-r--r--lib/did_you_mean/spell_checkers/name_error_checkers.rb20
-rw-r--r--lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb49
-rw-r--r--lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb82
-rw-r--r--lib/did_you_mean/spell_checkers/null_checker.rb6
-rw-r--r--lib/did_you_mean/tree_spell_checker.rb137
-rw-r--r--lib/did_you_mean/verbose.rb4
-rw-r--r--lib/did_you_mean/version.rb3
-rw-r--r--lib/drb.rb1
-rw-r--r--lib/drb/acl.rb11
-rw-r--r--lib/drb/drb.rb346
-rw-r--r--lib/drb/eq.rb1
-rw-r--r--lib/drb/extserv.rb3
-rw-r--r--lib/drb/extservm.rb11
-rw-r--r--lib/drb/gw.rb3
-rw-r--r--lib/drb/invokemethod.rb1
-rw-r--r--lib/drb/observer.rb1
-rw-r--r--lib/drb/ssl.rb15
-rw-r--r--lib/drb/timeridconv.rb46
-rw-r--r--lib/drb/unix.rb11
-rw-r--r--lib/drb/weakidconv.rb59
-rw-r--r--lib/e2mmap.rb172
-rw-r--r--lib/erb.rb349
-rw-r--r--lib/fileutils.gemspec31
-rw-r--r--lib/fileutils.rb919
-rw-r--r--lib/find.rb12
-rw-r--r--lib/forwardable.rb149
-rw-r--r--lib/forwardable/forwardable.gemspec23
-rw-r--r--lib/forwardable/impl.rb16
-rw-r--r--lib/forwardable/version.rb5
-rw-r--r--lib/getoptlong.rb25
-rw-r--r--lib/getoptlong/getoptlong.gemspec29
-rw-r--r--lib/getoptlong/version.rb3
-rw-r--r--lib/ipaddr.gemspec28
-rw-r--r--lib/ipaddr.rb114
-rw-r--r--lib/irb.rb348
-rw-r--r--lib/irb/cmd/chws.rb9
-rw-r--r--lib/irb/cmd/fork.rb5
-rw-r--r--lib/irb/cmd/help.rb19
-rw-r--r--lib/irb/cmd/load.rb11
-rw-r--r--lib/irb/cmd/nop.rb1
-rw-r--r--lib/irb/cmd/pushws.rb11
-rw-r--r--lib/irb/cmd/subirb.rb13
-rw-r--r--lib/irb/color.rb233
-rw-r--r--lib/irb/completion.rb198
-rw-r--r--lib/irb/context.rb178
-rw-r--r--lib/irb/ext/change-ws.rb1
-rw-r--r--lib/irb/ext/history.rb57
-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.rb16
-rw-r--r--lib/irb/ext/save-history.rb22
-rw-r--r--lib/irb/ext/tracer.rb16
-rw-r--r--lib/irb/ext/use-loader.rb8
-rw-r--r--lib/irb/ext/workspaces.rb1
-rw-r--r--lib/irb/extend-command.rb124
-rw-r--r--lib/irb/frame.rb20
-rw-r--r--lib/irb/help.rb3
-rw-r--r--lib/irb/init.rb86
-rw-r--r--lib/irb/input-method.rb116
-rw-r--r--lib/irb/inspector.rb15
-rw-r--r--lib/irb/irb.gemspec83
-rw-r--r--lib/irb/lc/error.rb72
-rw-r--r--lib/irb/lc/help-message16
-rw-r--r--lib/irb/lc/ja/encoding_aliases.rb1
-rw-r--r--lib/irb/lc/ja/error.rb70
-rw-r--r--lib/irb/lc/ja/help-message16
-rw-r--r--lib/irb/locale.rb9
-rw-r--r--lib/irb/magic-file.rb3
-rw-r--r--lib/irb/notifier.rb29
-rw-r--r--lib/irb/output-method.rb15
-rw-r--r--lib/irb/ruby-lex.rb1376
-rw-r--r--lib/irb/ruby-token.rb266
-rw-r--r--lib/irb/ruby_logo.aa38
-rw-r--r--lib/irb/slex.rb281
-rw-r--r--lib/irb/src_encoding.rb7
-rw-r--r--lib/irb/version.rb6
-rw-r--r--lib/irb/workspace.rb105
-rw-r--r--lib/irb/ws-for-case-2.rb1
-rw-r--r--lib/irb/xmp.rb3
-rw-r--r--lib/logger.rb428
-rw-r--r--lib/logger/errors.rb9
-rw-r--r--lib/logger/formatter.rb36
-rw-r--r--lib/logger/log_device.rb205
-rw-r--r--lib/logger/logger.gemspec29
-rw-r--r--lib/logger/period.rb47
-rw-r--r--lib/logger/severity.rb19
-rw-r--r--lib/logger/version.rb5
-rw-r--r--lib/mathn.rb191
-rw-r--r--lib/matrix.rb676
-rw-r--r--lib/matrix/eigenvalue_decomposition.rb232
-rw-r--r--lib/matrix/lup_decomposition.rb11
-rw-r--r--lib/matrix/matrix.gemspec28
-rw-r--r--lib/matrix/version.rb5
-rw-r--r--lib/mkmf.rb379
-rw-r--r--lib/monitor.rb300
-rw-r--r--lib/mutex_m.gemspec27
-rw-r--r--lib/mutex_m.rb15
-rw-r--r--lib/net/ftp.rb729
-rw-r--r--lib/net/http.rb350
-rw-r--r--lib/net/http/backward.rb1
-rw-r--r--lib/net/http/exceptions.rb8
-rw-r--r--lib/net/http/generic_request.rb20
-rw-r--r--lib/net/http/header.rb116
-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.rb30
-rw-r--r--lib/net/http/responses.rb68
-rw-r--r--lib/net/http/status.rb83
-rw-r--r--lib/net/https.rb5
-rw-r--r--lib/net/imap.rb219
-rw-r--r--lib/net/pop.rb38
-rw-r--r--lib/net/pop/net-pop.gemspec27
-rw-r--r--lib/net/pop/version.rb6
-rw-r--r--lib/net/protocol.rb160
-rw-r--r--lib/net/smtp.rb43
-rw-r--r--lib/net/smtp/net-smtp.gemspec27
-rw-r--r--lib/net/smtp/version.rb6
-rw-r--r--lib/net/telnet.rb763
-rw-r--r--lib/observer.rb3
-rw-r--r--lib/observer/observer.gemspec29
-rw-r--r--lib/observer/version.rb3
-rw-r--r--lib/open-uri.rb66
-rw-r--r--lib/open3.rb133
-rw-r--r--lib/open3/open3.gemspec29
-rw-r--r--lib/open3/version.rb3
-rw-r--r--lib/optionparser.rb1
-rw-r--r--lib/optparse.rb504
-rw-r--r--lib/optparse/ac.rb8
-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.rb297
-rw-r--r--lib/ostruct/ostruct.gemspec28
-rw-r--r--lib/ostruct/version.rb5
-rw-r--r--lib/pp.rb135
-rw-r--r--lib/prettyprint.rb8
-rw-r--r--lib/prime.gemspec27
-rw-r--r--lib/prime.rb116
-rw-r--r--lib/profile.rb10
-rw-r--r--lib/profiler.rb148
-rw-r--r--lib/pstore.rb29
-rw-r--r--lib/pstore/pstore.gemspec29
-rw-r--r--lib/pstore/version.rb3
-rw-r--r--lib/racc.rb6
-rw-r--r--lib/racc/compat.rb32
-rw-r--r--lib/racc/debugflags.rb59
-rw-r--r--lib/racc/exception.rb13
-rw-r--r--lib/racc/grammar.rb1113
-rw-r--r--lib/racc/grammarfileparser.rb560
-rw-r--r--lib/racc/info.rb14
-rw-r--r--lib/racc/iset.rb91
-rw-r--r--lib/racc/logfilegenerator.rb211
-rw-r--r--lib/racc/parser-text.rb643
-rw-r--r--lib/racc/parser.rb82
-rw-r--r--lib/racc/parserfilegenerator.rb510
-rw-r--r--lib/racc/pre-setup13
-rw-r--r--lib/racc/racc.gemspec105
-rw-r--r--lib/racc/rdoc/grammar.en.rdoc32
-rw-r--r--lib/racc/sourcetext.rb34
-rw-r--r--lib/racc/state.rb969
-rw-r--r--lib/racc/statetransitiontable.rb316
-rw-r--r--lib/racc/static.rb5
-rw-r--r--lib/rake.rb79
-rw-r--r--lib/rake/alt_system.rb110
-rw-r--r--lib/rake/application.rb790
-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.rb125
-rw-r--r--lib/rake/default_loader.rb14
-rw-r--r--lib/rake/dsl_definition.rb201
-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.rb16
-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/late_time.rb17
-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.rb199
-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.rb15
-rw-r--r--lib/rdoc/.document2
-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.rb7
-rw-r--r--lib/rdoc/code_object.rb14
-rw-r--r--lib/rdoc/code_objects.rb1
-rw-r--r--lib/rdoc/comment.rb43
-rw-r--r--lib/rdoc/constant.rb5
-rw-r--r--lib/rdoc/context.rb89
-rw-r--r--lib/rdoc/context/section.rb9
-rw-r--r--lib/rdoc/cross_reference.rb45
-rw-r--r--lib/rdoc/encoding.rb147
-rw-r--r--lib/rdoc/erb_partial.rb1
-rw-r--r--lib/rdoc/erbio.rb9
-rw-r--r--lib/rdoc/extend.rb1
-rw-r--r--lib/rdoc/generator.rb2
-rw-r--r--lib/rdoc/generator/darkfish.rb92
-rw-r--r--lib/rdoc/generator/json_index.rb22
-rw-r--r--lib/rdoc/generator/markup.rb15
-rw-r--r--lib/rdoc/generator/pot.rb7
-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.rhtml4
-rw-r--r--lib/rdoc/generator/template/darkfish/_head.rhtml10
-rw-r--r--lib/rdoc/generator/template/darkfish/class.rhtml4
-rw-r--r--lib/rdoc/generator/template/darkfish/css/fonts.css12
-rw-r--r--lib/rdoc/generator/template/darkfish/css/rdoc.css41
-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/json_index/js/navigation.js45
-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.rb5
-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.rb1
-rw-r--r--lib/rdoc/markdown.rb1332
-rw-r--r--lib/rdoc/markdown/entities.rb1
-rw-r--r--lib/rdoc/markdown/literals.rb417
-rw-r--r--lib/rdoc/markdown/literals_1_9.rb420
-rw-r--r--lib/rdoc/markup.rb29
-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.rb47
-rw-r--r--lib/rdoc/markup/attributes.rb13
-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.rb48
-rw-r--r--lib/rdoc/markup/formatter_test_case.rb767
-rw-r--r--lib/rdoc/markup/hard_break.rb1
-rw-r--r--lib/rdoc/markup/heading.rb7
-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.rb139
-rw-r--r--lib/rdoc/markup/pre_process.rb19
-rw-r--r--lib/rdoc/markup/raw.rb1
-rw-r--r--lib/rdoc/markup/regexp_handling.rb41
-rw-r--r--lib/rdoc/markup/rule.rb1
-rw-r--r--lib/rdoc/markup/special.rb40
-rw-r--r--lib/rdoc/markup/text_formatter_test_case.rb114
-rw-r--r--lib/rdoc/markup/to_ansi.rb1
-rw-r--r--lib/rdoc/markup/to_bs.rb9
-rw-r--r--lib/rdoc/markup/to_html.rb52
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb52
-rw-r--r--lib/rdoc/markup/to_html_snippet.rb19
-rw-r--r--lib/rdoc/markup/to_joined_paragraph.rb37
-rw-r--r--lib/rdoc/markup/to_label.rb19
-rw-r--r--lib/rdoc/markup/to_markdown.rb17
-rw-r--r--lib/rdoc/markup/to_rdoc.rb13
-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.rb5
-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.rb114
-rw-r--r--lib/rdoc/parser.rb55
-rw-r--r--lib/rdoc/parser/c.rb366
-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.rb590
-rw-r--r--lib/rdoc/parser/ruby.rb1103
-rw-r--r--lib/rdoc/parser/ruby_tools.rb66
-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.rb109
-rw-r--r--lib/rdoc/rd/inline.rb9
-rw-r--r--lib/rdoc/rd/inline_parser.rb333
-rw-r--r--lib/rdoc/rdoc.gemspec246
-rw-r--r--lib/rdoc/rdoc.rb84
-rw-r--r--lib/rdoc/require.rb1
-rw-r--r--lib/rdoc/ri.rb1
-rw-r--r--lib/rdoc/ri/driver.rb177
-rw-r--r--lib/rdoc/ri/formatter.rb1
-rw-r--r--lib/rdoc/ri/paths.rb6
-rw-r--r--lib/rdoc/ri/store.rb1
-rw-r--r--lib/rdoc/ri/task.rb2
-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.rb33
-rw-r--r--lib/rdoc/single_class.rb1
-rw-r--r--lib/rdoc/stats.rb1
-rw-r--r--lib/rdoc/stats/normal.rb41
-rw-r--r--lib/rdoc/stats/quiet.rb1
-rw-r--r--lib/rdoc/stats/verbose.rb1
-rw-r--r--lib/rdoc/store.rb80
-rw-r--r--lib/rdoc/task.rb5
-rw-r--r--lib/rdoc/test_case.rb217
-rw-r--r--lib/rdoc/text.rb58
-rw-r--r--lib/rdoc/token_stream.rb88
-rw-r--r--lib/rdoc/tom_doc.rb28
-rw-r--r--lib/rdoc/top_level.rb11
-rw-r--r--lib/rdoc/version.rb8
-rw-r--r--lib/readline.gemspec35
-rw-r--r--lib/readline.rb6
-rw-r--r--lib/reline.rb425
-rw-r--r--lib/reline/ansi.rb141
-rw-r--r--lib/reline/config.rb286
-rw-r--r--lib/reline/general_io.rb67
-rw-r--r--lib/reline/history.rb56
-rw-r--r--lib/reline/key_actor.rb7
-rw-r--r--lib/reline/key_actor/base.rb7
-rw-r--r--lib/reline/key_actor/emacs.rb517
-rw-r--r--lib/reline/key_actor/vi_command.rb518
-rw-r--r--lib/reline/key_actor/vi_insert.rb517
-rw-r--r--lib/reline/key_stroke.rb53
-rw-r--r--lib/reline/kill_ring.rb113
-rw-r--r--lib/reline/line_editor.rb2129
-rw-r--r--lib/reline/reline.gemspec26
-rw-r--r--lib/reline/unicode.rb527
-rw-r--r--lib/reline/unicode/east_asian_width.rb1145
-rw-r--r--lib/reline/version.rb3
-rw-r--r--lib/reline/windows.rb236
-rw-r--r--lib/resolv-replace.rb2
-rw-r--r--lib/resolv.rb248
-rw-r--r--lib/rexml/attlistdecl.rb7
-rw-r--r--lib/rexml/attribute.rb32
-rw-r--r--lib/rexml/cdata.rb5
-rw-r--r--lib/rexml/child.rb3
-rw-r--r--lib/rexml/comment.rb5
-rw-r--r--lib/rexml/doctype.rb42
-rw-r--r--lib/rexml/document.rb29
-rw-r--r--lib/rexml/dtd/attlistdecl.rb3
-rw-r--r--lib/rexml/dtd/dtd.rb13
-rw-r--r--lib/rexml/dtd/elementdecl.rb3
-rw-r--r--lib/rexml/dtd/entitydecl.rb3
-rw-r--r--lib/rexml/dtd/notationdecl.rb3
-rw-r--r--lib/rexml/element.rb65
-rw-r--r--lib/rexml/encoding.rb1
-rw-r--r--lib/rexml/entity.rb14
-rw-r--r--lib/rexml/formatters/default.rb15
-rw-r--r--lib/rexml/formatters/pretty.rb3
-rw-r--r--lib/rexml/formatters/transitive.rb3
-rw-r--r--lib/rexml/functions.rb141
-rw-r--r--lib/rexml/instruction.rb35
-rw-r--r--lib/rexml/light/node.rb3
-rw-r--r--lib/rexml/namespace.rb26
-rw-r--r--lib/rexml/node.rb9
-rw-r--r--lib/rexml/output.rb3
-rw-r--r--lib/rexml/parent.rb3
-rw-r--r--lib/rexml/parseexception.rb1
-rw-r--r--lib/rexml/parsers/baseparser.rb182
-rw-r--r--lib/rexml/parsers/lightparser.rb7
-rw-r--r--lib/rexml/parsers/pullparser.rb7
-rw-r--r--lib/rexml/parsers/sax2parser.rb9
-rw-r--r--lib/rexml/parsers/streamparser.rb11
-rw-r--r--lib/rexml/parsers/treeparser.rb5
-rw-r--r--lib/rexml/parsers/ultralightparser.rb5
-rw-r--r--lib/rexml/parsers/xpathparser.rb79
-rw-r--r--lib/rexml/quickpath.rb9
-rw-r--r--lib/rexml/rexml.gemspec84
-rw-r--r--lib/rexml/rexml.rb7
-rw-r--r--lib/rexml/sax2listener.rb1
-rw-r--r--lib/rexml/security.rb1
-rw-r--r--lib/rexml/source.rb10
-rw-r--r--lib/rexml/streamlistener.rb1
-rw-r--r--lib/rexml/syncenumerator.rb32
-rw-r--r--lib/rexml/text.rb71
-rw-r--r--lib/rexml/undefinednamespaceexception.rb3
-rw-r--r--lib/rexml/validation/relaxng.rb5
-rw-r--r--lib/rexml/validation/validation.rb3
-rw-r--r--lib/rexml/validation/validationexception.rb1
-rw-r--r--lib/rexml/xmldecl.rb41
-rw-r--r--lib/rexml/xmltokens.rb1
-rw-r--r--lib/rexml/xpath.rb17
-rw-r--r--lib/rexml/xpath_parser.rb983
-rw-r--r--lib/rinda/rinda.rb2
-rw-r--r--lib/rinda/ring.rb12
-rw-r--r--lib/rinda/tuplespace.rb7
-rw-r--r--lib/rss.rb3
-rw-r--r--lib/rss/0.9.rb3
-rw-r--r--lib/rss/1.0.rb3
-rw-r--r--lib/rss/2.0.rb1
-rw-r--r--lib/rss/atom.rb262
-rw-r--r--lib/rss/content.rb3
-rw-r--r--lib/rss/content/1.0.rb1
-rw-r--r--lib/rss/content/2.0.rb1
-rw-r--r--lib/rss/converter.rb3
-rw-r--r--lib/rss/dublincore.rb5
-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.rb3
-rw-r--r--lib/rss/image.rb3
-rw-r--r--lib/rss/itunes.rb39
-rw-r--r--lib/rss/maker.rb27
-rw-r--r--lib/rss/maker/0.9.rb7
-rw-r--r--lib/rss/maker/1.0.rb5
-rw-r--r--lib/rss/maker/2.0.rb5
-rw-r--r--lib/rss/maker/atom.rb5
-rw-r--r--lib/rss/maker/base.rb3
-rw-r--r--lib/rss/maker/content.rb7
-rw-r--r--lib/rss/maker/dublincore.rb5
-rw-r--r--lib/rss/maker/entry.rb5
-rw-r--r--lib/rss/maker/feed.rb3
-rw-r--r--lib/rss/maker/image.rb7
-rw-r--r--lib/rss/maker/itunes.rb13
-rw-r--r--lib/rss/maker/slash.rb5
-rw-r--r--lib/rss/maker/syndication.rb5
-rw-r--r--lib/rss/maker/taxonomy.rb7
-rw-r--r--lib/rss/maker/trackback.rb7
-rw-r--r--lib/rss/parser.rb29
-rw-r--r--lib/rss/rexmlparser.rb1
-rw-r--r--lib/rss/rss.gemspec80
-rw-r--r--lib/rss/rss.rb40
-rw-r--r--lib/rss/slash.rb1
-rw-r--r--lib/rss/syndication.rb3
-rw-r--r--lib/rss/taxonomy.rb3
-rw-r--r--lib/rss/trackback.rb1
-rw-r--r--lib/rss/utils.rb7
-rw-r--r--lib/rss/version.rb4
-rw-r--r--lib/rss/xml-stylesheet.rb3
-rw-r--r--lib/rss/xml.rb3
-rw-r--r--lib/rss/xmlparser.rb1
-rw-r--r--lib/rss/xmlscanner.rb1
-rw-r--r--lib/rubygems.rb532
-rw-r--r--lib/rubygems/LICENSE.txt54
-rw-r--r--lib/rubygems/available_set.rb4
-rw-r--r--lib/rubygems/basic_specification.rb175
-rw-r--r--lib/rubygems/bundler_version_finder.rb104
-rw-r--r--lib/rubygems/command.rb116
-rw-r--r--lib/rubygems/command_manager.rb34
-rw-r--r--lib/rubygems/commands/build_command.rb68
-rw-r--r--lib/rubygems/commands/cert_command.rb82
-rw-r--r--lib/rubygems/commands/check_command.rb3
-rw-r--r--lib/rubygems/commands/cleanup_command.rb52
-rw-r--r--lib/rubygems/commands/contents_command.rb36
-rw-r--r--lib/rubygems/commands/dependency_command.rb76
-rw-r--r--lib/rubygems/commands/environment_command.rb32
-rw-r--r--lib/rubygems/commands/fetch_command.rb6
-rw-r--r--lib/rubygems/commands/generate_index_command.rb11
-rw-r--r--lib/rubygems/commands/help_command.rb42
-rw-r--r--lib/rubygems/commands/info_command.rb35
-rw-r--r--lib/rubygems/commands/install_command.rb143
-rw-r--r--lib/rubygems/commands/list_command.rb6
-rw-r--r--lib/rubygems/commands/lock_command.rb12
-rw-r--r--lib/rubygems/commands/mirror_command.rb2
-rw-r--r--lib/rubygems/commands/open_command.rb38
-rw-r--r--lib/rubygems/commands/outdated_command.rb2
-rw-r--r--lib/rubygems/commands/owner_command.rb40
-rw-r--r--lib/rubygems/commands/pristine_command.rb65
-rw-r--r--lib/rubygems/commands/push_command.rb74
-rw-r--r--lib/rubygems/commands/query_command.rb242
-rw-r--r--lib/rubygems/commands/rdoc_command.rb9
-rw-r--r--lib/rubygems/commands/search_command.rb2
-rw-r--r--lib/rubygems/commands/server_command.rb4
-rw-r--r--lib/rubygems/commands/setup_command.rb367
-rw-r--r--lib/rubygems/commands/signin_command.rb35
-rw-r--r--lib/rubygems/commands/signout_command.rb33
-rw-r--r--lib/rubygems/commands/sources_command.rb40
-rw-r--r--lib/rubygems/commands/specification_command.rb16
-rw-r--r--lib/rubygems/commands/stale_command.rb3
-rw-r--r--lib/rubygems/commands/uninstall_command.rb77
-rw-r--r--lib/rubygems/commands/unpack_command.rb67
-rw-r--r--lib/rubygems/commands/update_command.rb79
-rw-r--r--lib/rubygems/commands/which_command.rb17
-rw-r--r--lib/rubygems/commands/yank_command.rb50
-rw-r--r--lib/rubygems/compatibility.rb31
-rw-r--r--lib/rubygems/config_file.rb187
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb14
-rwxr-xr-x[-rw-r--r--]lib/rubygems/core_ext/kernel_require.rb103
-rw-r--r--lib/rubygems/core_ext/kernel_warn.rb55
-rw-r--r--lib/rubygems/defaults.rb86
-rw-r--r--lib/rubygems/dependency.rb97
-rw-r--r--lib/rubygems/dependency_installer.rb183
-rw-r--r--lib/rubygems/dependency_list.rb46
-rw-r--r--lib/rubygems/deprecate.rb16
-rw-r--r--lib/rubygems/doctor.rb12
-rw-r--r--lib/rubygems/errors.rb63
-rw-r--r--lib/rubygems/exceptions.rb44
-rw-r--r--lib/rubygems/ext.rb2
-rw-r--r--lib/rubygems/ext/build_error.rb2
-rw-r--r--lib/rubygems/ext/builder.rb93
-rw-r--r--lib/rubygems/ext/cmake_builder.rb7
-rw-r--r--lib/rubygems/ext/configure_builder.rb6
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb49
-rw-r--r--lib/rubygems/ext/rake_builder.rb35
-rw-r--r--lib/rubygems/gem_runner.rb11
-rw-r--r--lib/rubygems/gemcutter_utilities.rb90
-rw-r--r--lib/rubygems/indexer.rb166
-rw-r--r--lib/rubygems/install_default_message.rb2
-rw-r--r--lib/rubygems/install_message.rb2
-rw-r--r--lib/rubygems/install_update_options.rb116
-rw-r--r--lib/rubygems/installer.rb349
-rw-r--r--lib/rubygems/installer_test_case.rb144
-rw-r--r--lib/rubygems/local_remote_options.rb10
-rw-r--r--lib/rubygems/mock_gem_ui.rb13
-rw-r--r--lib/rubygems/name_tuple.rb12
-rw-r--r--lib/rubygems/package.rb249
-rw-r--r--lib/rubygems/package/digest_io.rb8
-rw-r--r--lib/rubygems/package/file_source.rb12
-rw-r--r--lib/rubygems/package/io_source.rb4
-rw-r--r--lib/rubygems/package/old.rb38
-rw-r--r--lib/rubygems/package/source.rb2
-rw-r--r--lib/rubygems/package/tar_header.rb42
-rw-r--r--lib/rubygems/package/tar_reader.rb32
-rw-r--r--lib/rubygems/package/tar_reader/entry.rb33
-rw-r--r--lib/rubygems/package/tar_test_case.rb26
-rw-r--r--lib/rubygems/package/tar_writer.rb72
-rw-r--r--lib/rubygems/package_task.rb2
-rw-r--r--lib/rubygems/path_support.rb75
-rw-r--r--lib/rubygems/platform.rb20
-rw-r--r--lib/rubygems/psych_additions.rb3
-rw-r--r--lib/rubygems/psych_tree.rb5
-rw-r--r--lib/rubygems/rdoc.rb319
-rw-r--r--lib/rubygems/remote_fetcher.rb179
-rw-r--r--lib/rubygems/request.rb95
-rw-r--r--lib/rubygems/request/connection_pools.rb48
-rw-r--r--lib/rubygems/request/http_pool.rb9
-rw-r--r--lib/rubygems/request/https_pool.rb7
-rw-r--r--lib/rubygems/request_set.rb176
-rw-r--r--lib/rubygems/request_set/gem_dependency_api.rb171
-rw-r--r--lib/rubygems/request_set/lockfile.rb545
-rw-r--r--lib/rubygems/request_set/lockfile/parser.rb345
-rw-r--r--lib/rubygems/request_set/lockfile/tokenizer.rb114
-rw-r--r--lib/rubygems/requirement.rb104
-rw-r--r--lib/rubygems/resolver.rb354
-rw-r--r--lib/rubygems/resolver/activation_request.rb96
-rw-r--r--lib/rubygems/resolver/api_set.rb12
-rw-r--r--lib/rubygems/resolver/api_specification.rb11
-rw-r--r--lib/rubygems/resolver/best_set.rb16
-rw-r--r--lib/rubygems/resolver/composed_set.rb12
-rw-r--r--lib/rubygems/resolver/conflict.rb17
-rw-r--r--lib/rubygems/resolver/current_set.rb4
-rw-r--r--lib/rubygems/resolver/dependency_request.rb14
-rw-r--r--lib/rubygems/resolver/git_set.rb12
-rw-r--r--lib/rubygems/resolver/git_specification.rb13
-rw-r--r--lib/rubygems/resolver/index_set.rb12
-rw-r--r--lib/rubygems/resolver/index_specification.rb8
-rw-r--r--lib/rubygems/resolver/installed_specification.rb8
-rw-r--r--lib/rubygems/resolver/installer_set.rb47
-rw-r--r--lib/rubygems/resolver/local_specification.rb4
-rw-r--r--lib/rubygems/resolver/lock_set.rb22
-rw-r--r--lib/rubygems/resolver/lock_specification.rb25
-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.rb4
-rw-r--r--lib/rubygems/resolver/set.rb7
-rw-r--r--lib/rubygems/resolver/source_set.rb47
-rw-r--r--lib/rubygems/resolver/spec_specification.rb4
-rw-r--r--lib/rubygems/resolver/specification.rb21
-rw-r--r--lib/rubygems/resolver/stats.rb5
-rw-r--r--lib/rubygems/resolver/vendor_set.rb10
-rw-r--r--lib/rubygems/resolver/vendor_specification.rb6
-rw-r--r--lib/rubygems/s3_uri_signer.rb183
-rw-r--r--lib/rubygems/safe_yaml.rb59
-rw-r--r--lib/rubygems/security.rb62
-rw-r--r--lib/rubygems/security/policies.rb4
-rw-r--r--lib/rubygems/security/policy.rb54
-rw-r--r--lib/rubygems/security/signer.rb104
-rw-r--r--lib/rubygems/security/trust_dir.rb21
-rw-r--r--lib/rubygems/security_option.rb42
-rw-r--r--lib/rubygems/server.rb131
-rw-r--r--lib/rubygems/source.rb65
-rw-r--r--lib/rubygems/source/git.rb23
-rw-r--r--lib/rubygems/source/installed.rb8
-rw-r--r--lib/rubygems/source/local.rb84
-rw-r--r--lib/rubygems/source/lock.rb14
-rw-r--r--lib/rubygems/source/specific_file.rb11
-rw-r--r--lib/rubygems/source/vendor.rb6
-rw-r--r--lib/rubygems/source_list.rb12
-rw-r--r--lib/rubygems/source_local.rb6
-rw-r--r--lib/rubygems/source_specific_file.rb6
-rw-r--r--lib/rubygems/spec_fetcher.rb33
-rw-r--r--lib/rubygems/specification.rb1472
-rw-r--r--lib/rubygems/specification_policy.rb427
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem (renamed from lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem)0
-rw-r--r--lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem32
-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/GlobalSignRootCA.pem (renamed from lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem)0
-rw-r--r--lib/rubygems/stub_specification.rb192
-rw-r--r--lib/rubygems/syck_hack.rb3
-rw-r--r--lib/rubygems/test_case.rb650
-rw-r--r--lib/rubygems/test_utilities.rb115
-rw-r--r--lib/rubygems/text.rb36
-rw-r--r--lib/rubygems/uninstaller.rb98
-rw-r--r--lib/rubygems/uri_formatter.rb5
-rw-r--r--lib/rubygems/uri_parser.rb36
-rw-r--r--lib/rubygems/uri_parsing.rb23
-rw-r--r--lib/rubygems/user_interaction.rb176
-rw-r--r--lib/rubygems/util.rb109
-rw-r--r--lib/rubygems/util/licenses.rb439
-rw-r--r--lib/rubygems/util/list.rb35
-rw-r--r--lib/rubygems/util/stringio.rb34
-rw-r--r--lib/rubygems/validator.rb52
-rw-r--r--lib/rubygems/version.rb140
-rw-r--r--lib/rubygems/version_option.rb13
-rw-r--r--lib/scanf.rb776
-rw-r--r--lib/securerandom.rb390
-rw-r--r--lib/set.rb477
-rw-r--r--lib/shell.rb458
-rw-r--r--lib/shell/builtin-command.rb146
-rw-r--r--lib/shell/command-processor.rb667
-rw-r--r--lib/shell/error.rb25
-rw-r--r--lib/shell/filter.rb137
-rw-r--r--lib/shell/process-controller.rb310
-rw-r--r--lib/shell/system-command.rb158
-rw-r--r--lib/shell/version.rb15
-rw-r--r--lib/shellwords.rb30
-rw-r--r--lib/singleton.rb33
-rw-r--r--lib/singleton/singleton.gemspec27
-rw-r--r--lib/singleton/version.rb3
-rw-r--r--lib/sync.rb328
-rw-r--r--lib/tempfile.rb155
-rw-r--r--lib/thwait.rb140
-rw-r--r--lib/time.rb258
-rw-r--r--lib/timeout.rb37
-rw-r--r--lib/timeout/timeout.gemspec27
-rw-r--r--lib/timeout/version.rb3
-rw-r--r--lib/tmpdir.rb74
-rw-r--r--lib/tracer.rb19
-rw-r--r--lib/tracer/tracer.gemspec23
-rw-r--r--lib/tracer/version.rb5
-rw-r--r--lib/tsort.rb2
-rw-r--r--lib/ubygems.rb10
-rw-r--r--lib/un.rb55
-rw-r--r--lib/unicode_normalize.rb78
-rw-r--r--lib/unicode_normalize/normalize.rb39
-rw-r--r--lib/unicode_normalize/tables.rb10116
-rw-r--r--lib/uri.rb53
-rw-r--r--lib/uri/common.rb176
-rw-r--r--lib/uri/file.rb94
-rw-r--r--lib/uri/ftp.rb67
-rw-r--r--lib/uri/generic.rb509
-rw-r--r--lib/uri/http.rb76
-rw-r--r--lib/uri/https.rb3
-rw-r--r--lib/uri/ldap.rb81
-rw-r--r--lib/uri/ldaps.rb3
-rw-r--r--lib/uri/mailto.rb61
-rw-r--r--lib/uri/rfc2396_parser.rb55
-rw-r--r--lib/uri/rfc3986_parser.rb7
-rw-r--r--lib/uri/uri.gemspec29
-rw-r--r--lib/uri/version.rb6
-rw-r--r--lib/weakref.rb50
-rw-r--r--lib/webrick.rb5
-rw-r--r--lib/webrick/.document6
-rw-r--r--lib/webrick/accesslog.rb9
-rw-r--r--lib/webrick/cgi.rb11
-rw-r--r--lib/webrick/compat.rb1
-rw-r--r--lib/webrick/config.rb25
-rw-r--r--lib/webrick/cookie.rb5
-rw-r--r--lib/webrick/htmlutils.rb1
-rw-r--r--lib/webrick/httpauth.rb11
-rw-r--r--lib/webrick/httpauth/authenticator.rb1
-rw-r--r--lib/webrick/httpauth/basicauth.rb22
-rw-r--r--lib/webrick/httpauth/digestauth.rb41
-rw-r--r--lib/webrick/httpauth/htdigest.rb13
-rw-r--r--lib/webrick/httpauth/htgroup.rb16
-rw-r--r--lib/webrick/httpauth/htpasswd.rb48
-rw-r--r--lib/webrick/httpauth/userdb.rb1
-rw-r--r--lib/webrick/httpproxy.rb93
-rw-r--r--lib/webrick/httprequest.rb73
-rw-r--r--lib/webrick/httpresponse.rb224
-rw-r--r--lib/webrick/https.rb68
-rw-r--r--lib/webrick/httpserver.rb40
-rw-r--r--lib/webrick/httpservlet.rb11
-rw-r--r--lib/webrick/httpservlet/abstract.rb9
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb5
-rw-r--r--lib/webrick/httpservlet/cgihandler.rb17
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb5
-rw-r--r--lib/webrick/httpservlet/filehandler.rb86
-rw-r--r--lib/webrick/httpservlet/prochandler.rb3
-rw-r--r--lib/webrick/httpstatus.rb8
-rw-r--r--lib/webrick/httputils.rb10
-rw-r--r--lib/webrick/httpversion.rb1
-rw-r--r--lib/webrick/log.rb7
-rw-r--r--lib/webrick/server.rb119
-rw-r--r--lib/webrick/ssl.rb37
-rw-r--r--lib/webrick/utils.rb136
-rw-r--r--lib/webrick/version.rb3
-rw-r--r--lib/webrick/webrick.gemspec76
-rw-r--r--lib/xmlrpc.rb301
-rw-r--r--lib/xmlrpc/base64.rb62
-rw-r--r--lib/xmlrpc/client.rb628
-rw-r--r--lib/xmlrpc/config.rb43
-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.rb870
-rw-r--r--lib/xmlrpc/server.rb707
-rw-r--r--lib/xmlrpc/utils.rb171
-rw-r--r--lib/yaml.rb18
-rw-r--r--lib/yaml/dbm.rb1
-rw-r--r--lib/yaml/store.rb21
-rw-r--r--lib/yaml/yaml.gemspec23
-rwxr-xr-xlibexec/bundle47
-rwxr-xr-xlibexec/bundler4
-rwxr-xr-xlibexec/irb11
-rwxr-xr-xlibexec/racc306
-rwxr-xr-xlibexec/racc2y195
-rwxr-xr-xlibexec/rdoc44
-rwxr-xr-xlibexec/ri12
-rwxr-xr-xlibexec/y2racc339
-rw-r--r--load.c608
-rw-r--r--loadpath.c1
-rw-r--r--localeinit.c97
-rw-r--r--main.c14
-rw-r--r--man/bundle-add.166
-rw-r--r--man/bundle-add.1.txt58
-rw-r--r--man/bundle-add.ronn46
-rw-r--r--man/bundle-binstubs.140
-rw-r--r--man/bundle-binstubs.1.txt48
-rw-r--r--man/bundle-binstubs.ronn43
-rw-r--r--man/bundle-cache.155
-rw-r--r--man/bundle-cache.1.txt78
-rw-r--r--man/bundle-cache.ronn72
-rw-r--r--man/bundle-check.131
-rw-r--r--man/bundle-check.1.txt33
-rw-r--r--man/bundle-check.ronn26
-rw-r--r--man/bundle-clean.124
-rw-r--r--man/bundle-clean.1.txt26
-rw-r--r--man/bundle-clean.ronn18
-rw-r--r--man/bundle-config.1497
-rw-r--r--man/bundle-config.1.txt528
-rw-r--r--man/bundle-config.ronn399
-rw-r--r--man/bundle-doctor.144
-rw-r--r--man/bundle-doctor.1.txt44
-rw-r--r--man/bundle-doctor.ronn33
-rw-r--r--man/bundle-exec.1165
-rw-r--r--man/bundle-exec.1.txt178
-rw-r--r--man/bundle-exec.ronn152
-rw-r--r--man/bundle-gem.180
-rw-r--r--man/bundle-gem.1.txt91
-rw-r--r--man/bundle-gem.ronn78
-rw-r--r--man/bundle-info.120
-rw-r--r--man/bundle-info.1.txt21
-rw-r--r--man/bundle-info.ronn17
-rw-r--r--man/bundle-init.125
-rw-r--r--man/bundle-init.1.txt34
-rw-r--r--man/bundle-init.ronn29
-rw-r--r--man/bundle-inject.133
-rw-r--r--man/bundle-inject.1.txt32
-rw-r--r--man/bundle-inject.ronn22
-rw-r--r--man/bundle-install.1311
-rw-r--r--man/bundle-install.1.txt401
-rw-r--r--man/bundle-install.ronn383
-rw-r--r--man/bundle-list.150
-rw-r--r--man/bundle-list.1.txt43
-rw-r--r--man/bundle-list.ronn33
-rw-r--r--man/bundle-lock.184
-rw-r--r--man/bundle-lock.1.txt93
-rw-r--r--man/bundle-lock.ronn94
-rw-r--r--man/bundle-open.132
-rw-r--r--man/bundle-open.1.txt29
-rw-r--r--man/bundle-open.ronn19
-rw-r--r--man/bundle-outdated.1155
-rw-r--r--man/bundle-outdated.1.txt131
-rw-r--r--man/bundle-outdated.ronn111
-rw-r--r--man/bundle-package.155
-rw-r--r--man/bundle-package.1.txt79
-rw-r--r--man/bundle-package.ronn72
-rw-r--r--man/bundle-platform.161
-rw-r--r--man/bundle-platform.1.txt57
-rw-r--r--man/bundle-platform.ronn42
-rw-r--r--man/bundle-pristine.134
-rw-r--r--man/bundle-pristine.1.txt44
-rw-r--r--man/bundle-pristine.ronn34
-rw-r--r--man/bundle-remove.131
-rw-r--r--man/bundle-remove.1.txt34
-rw-r--r--man/bundle-remove.ronn23
-rw-r--r--man/bundle-show.123
-rw-r--r--man/bundle-show.1.txt27
-rw-r--r--man/bundle-show.ronn21
-rw-r--r--man/bundle-update.1394
-rw-r--r--man/bundle-update.1.txt390
-rw-r--r--man/bundle-update.ronn350
-rw-r--r--man/bundle-viz.139
-rw-r--r--man/bundle-viz.1.txt39
-rw-r--r--man/bundle-viz.ronn30
-rw-r--r--man/bundle.1136
-rw-r--r--man/bundle.1.txt116
-rw-r--r--man/bundle.ronn111
-rw-r--r--man/erb.125
-rw-r--r--man/gemfile.5686
-rw-r--r--man/gemfile.5.ronn517
-rw-r--r--man/gemfile.5.txt649
-rw-r--r--man/goruby.14
-rw-r--r--man/index.txt25
-rw-r--r--man/irb.184
-rw-r--r--man/rake.1141
-rw-r--r--man/ri.1244
-rw-r--r--man/ruby.1127
-rw-r--r--marshal.c479
-rw-r--r--math.c425
-rw-r--r--method.h247
-rw-r--r--mini_builtin.c83
-rw-r--r--miniinit.c23
-rw-r--r--misc/README18
-rwxr-xr-xmisc/expand_tabs.rb169
-rw-r--r--misc/inf-ruby.el418
-rwxr-xr-xmisc/lldb_cruby.py279
-rwxr-xr-xmisc/rb_optparse.zsh2
-rw-r--r--misc/rdoc-mode.el166
-rw-r--r--misc/ruby-additional.el126
-rw-r--r--misc/ruby-electric.el475
-rw-r--r--misc/ruby-mode.el1584
-rw-r--r--misc/ruby-style.el19
-rw-r--r--misc/rubydb2x.el104
-rw-r--r--misc/rubydb3x.el115
-rw-r--r--misc/test_lldb_cruby.rb40
-rw-r--r--missing/crypt.c495
-rw-r--r--missing/crypt.h248
-rw-r--r--missing/des_tables.c1616
-rw-r--r--missing/dtoa.c3417
-rw-r--r--missing/explicit_bzero.c94
-rw-r--r--missing/flock.c2
-rw-r--r--missing/memcmp.c3
-rw-r--r--missing/mt19937.c158
-rw-r--r--missing/nan.c28
-rw-r--r--missing/os2.c138
-rw-r--r--missing/procstat_vm.c85
-rw-r--r--missing/setproctitle.c6
-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--missing/x86_64-chkstk.s (renamed from missing/x86_64-chkstk.S)0
-rw-r--r--mjit.c1036
-rw-r--r--mjit.h177
-rw-r--r--mjit_compile.c478
-rw-r--r--mjit_worker.c1258
-rw-r--r--nacl/GNUmakefile.in100
-rw-r--r--nacl/README.nacl51
-rw-r--r--nacl/create_nmf.rb70
-rw-r--r--nacl/dirent.h15
-rw-r--r--nacl/example.html150
-rwxr-xr-xnacl/nacl-config.rb61
-rw-r--r--nacl/package.rb113
-rw-r--r--nacl/pepper_main.c732
-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.c1093
-rw-r--r--node.h512
-rw-r--r--numeric.c3453
-rw-r--r--object.c2516
-rw-r--r--pack.c490
-rw-r--r--pack.rb283
-rw-r--r--parse.y12184
-rw-r--r--prelude.rb38
-rw-r--r--probes.d6
-rw-r--r--probes_helper.h77
-rw-r--r--proc.c2698
-rw-r--r--process.c2732
-rw-r--r--random.c1021
-rw-r--r--range.c976
-rw-r--r--rational.c1789
-rw-r--r--re.c958
-rw-r--r--regcomp.c763
-rw-r--r--regenc.c85
-rw-r--r--regenc.h140
-rw-r--r--regerror.c73
-rw-r--r--regexec.c1700
-rw-r--r--regint.h464
-rw-r--r--regparse.c1379
-rw-r--r--regparse.h65
-rw-r--r--regsyntax.c15
-rw-r--r--ruby-runner.c98
-rw-r--r--ruby.c1270
-rw-r--r--ruby_assert.h15
-rw-r--r--ruby_atomic.h88
-rw-r--r--rubystub.c60
-rw-r--r--safe.c86
-rw-r--r--sample/README2
-rw-r--r--sample/biorhythm.rb9
-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.rb13
-rw-r--r--sample/drb/name.rb5
-rw-r--r--sample/drb/old_tuplespace.rb4
-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/fact.rb4
-rw-r--r--sample/fib.py2
-rw-r--r--sample/freq.rb12
-rw-r--r--sample/iseq_loader.rb243
-rw-r--r--sample/list.rb2
-rw-r--r--sample/list3.rb2
-rw-r--r--sample/observ.rb3
-rw-r--r--sample/occur.rb2
-rw-r--r--sample/occur2.rb13
-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/ripper/ruby2html.rb6
-rwxr-xr-x[-rw-r--r--]sample/test.rb2365
-rw-r--r--sample/timeout.rb18
-rw-r--r--sample/trick2013/README.md2
-rw-r--r--sample/trick2013/kinaba/remarks.markdown8
-rw-r--r--sample/trick2013/mame/music-box.mp4bin0 -> 580724 bytes-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--sample/trick2018/01-kinaba/authors.markdown3
-rw-r--r--sample/trick2018/01-kinaba/entry.rb8
-rw-r--r--sample/trick2018/01-kinaba/remarks.markdown55
-rw-r--r--sample/trick2018/02-mame/authors.markdown3
-rw-r--r--sample/trick2018/02-mame/entry.rb15
-rw-r--r--sample/trick2018/02-mame/remarks.markdown16
-rw-r--r--sample/trick2018/03-tompng/Gemfile2
-rw-r--r--sample/trick2018/03-tompng/Gemfile.lock13
-rw-r--r--sample/trick2018/03-tompng/authors.markdown3
-rw-r--r--sample/trick2018/03-tompng/entry.rb31
-rw-r--r--sample/trick2018/03-tompng/output.txt44
-rw-r--r--sample/trick2018/03-tompng/remarks.markdown19
-rw-r--r--sample/trick2018/03-tompng/trick.pngbin5661 -> 0 bytes-rw-r--r--sample/trick2018/04-colin/authors.markdown3
-rw-r--r--sample/trick2018/04-colin/entry.rb2
-rw-r--r--sample/trick2018/04-colin/remarks.markdown62
-rw-r--r--sample/trick2018/05-tompng/authors.markdown3
-rw-r--r--sample/trick2018/05-tompng/entry.rb41
-rw-r--r--sample/trick2018/05-tompng/preview_of_output.pngbin66800 -> 0 bytes-rw-r--r--sample/trick2018/05-tompng/remarks.markdown31
-rw-r--r--sample/trick2018/README.md16
-rw-r--r--signal.c701
-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.md130
-rw-r--r--spec/bundler/bundler/build_metadata_spec.rb49
-rw-r--r--spec/bundler/bundler/bundler_spec.rb460
-rw-r--r--spec/bundler/bundler/cli_spec.rb223
-rw-r--r--spec/bundler/bundler/compact_index_client/updater_spec.rb55
-rw-r--r--spec/bundler/bundler/definition_spec.rb351
-rw-r--r--spec/bundler/bundler/dep_proxy_spec.rb22
-rw-r--r--spec/bundler/bundler/dsl_spec.rb302
-rw-r--r--spec/bundler/bundler/endpoint_specification_spec.rb71
-rw-r--r--spec/bundler/bundler/env_spec.rb200
-rw-r--r--spec/bundler/bundler/environment_preserver_spec.rb79
-rw-r--r--spec/bundler/bundler/fetcher/base_spec.rb76
-rw-r--r--spec/bundler/bundler/fetcher/compact_index_spec.rb106
-rw-r--r--spec/bundler/bundler/fetcher/dependency_spec.rb287
-rw-r--r--spec/bundler/bundler/fetcher/downloader_spec.rb269
-rw-r--r--spec/bundler/bundler/fetcher/index_spec.rb116
-rw-r--r--spec/bundler/bundler/fetcher_spec.rb161
-rw-r--r--spec/bundler/bundler/friendly_errors_spec.rb255
-rw-r--r--spec/bundler/bundler/gem_helper_spec.rb348
-rw-r--r--spec/bundler/bundler/gem_version_promoter_spec.rb179
-rw-r--r--spec/bundler/bundler/index_spec.rb36
-rw-r--r--spec/bundler/bundler/installer/gem_installer_spec.rb40
-rw-r--r--spec/bundler/bundler/installer/parallel_installer_spec.rb47
-rw-r--r--spec/bundler/bundler/installer/spec_installation_spec.rb62
-rw-r--r--spec/bundler/bundler/lockfile_parser_spec.rb153
-rw-r--r--spec/bundler/bundler/mirror_spec.rb329
-rw-r--r--spec/bundler/bundler/plugin/api/source_spec.rb82
-rw-r--r--spec/bundler/bundler/plugin/api_spec.rb83
-rw-r--r--spec/bundler/bundler/plugin/dsl_spec.rb38
-rw-r--r--spec/bundler/bundler/plugin/events_spec.rb22
-rw-r--r--spec/bundler/bundler/plugin/index_spec.rb197
-rw-r--r--spec/bundler/bundler/plugin/installer_spec.rb131
-rw-r--r--spec/bundler/bundler/plugin/source_list_spec.rb25
-rw-r--r--spec/bundler/bundler/plugin_spec.rb334
-rw-r--r--spec/bundler/bundler/psyched_yaml_spec.rb9
-rw-r--r--spec/bundler/bundler/remote_specification_spec.rb187
-rw-r--r--spec/bundler/bundler/retry_spec.rb81
-rw-r--r--spec/bundler/bundler/ruby_dsl_spec.rb95
-rw-r--r--spec/bundler/bundler/ruby_version_spec.rb528
-rw-r--r--spec/bundler/bundler/rubygems_integration_spec.rb102
-rw-r--r--spec/bundler/bundler/settings/validator_spec.rb111
-rw-r--r--spec/bundler/bundler/settings_spec.rb328
-rw-r--r--spec/bundler/bundler/shared_helpers_spec.rb515
-rw-r--r--spec/bundler/bundler/source/git/git_proxy_spec.rb148
-rw-r--r--spec/bundler/bundler/source/git_spec.rb28
-rw-r--r--spec/bundler/bundler/source/path_spec.rb31
-rw-r--r--spec/bundler/bundler/source/rubygems/remote_spec.rb172
-rw-r--r--spec/bundler/bundler/source/rubygems_spec.rb33
-rw-r--r--spec/bundler/bundler/source_list_spec.rb463
-rw-r--r--spec/bundler/bundler/source_spec.rb200
-rw-r--r--spec/bundler/bundler/spec_set_spec.rb77
-rw-r--r--spec/bundler/bundler/stub_specification_spec.rb22
-rw-r--r--spec/bundler/bundler/ui/shell_spec.rb53
-rw-r--r--spec/bundler/bundler/ui_spec.rb41
-rw-r--r--spec/bundler/bundler/uri_credentials_filter_spec.rb127
-rw-r--r--spec/bundler/bundler/vendored_persistent_spec.rb77
-rw-r--r--spec/bundler/bundler/version_ranges_spec.rb40
-rw-r--r--spec/bundler/bundler/worker_spec.rb22
-rw-r--r--spec/bundler/bundler/yaml_serializer_spec.rb194
-rw-r--r--spec/bundler/cache/cache_path_spec.rb32
-rw-r--r--spec/bundler/cache/gems_spec.rb304
-rw-r--r--spec/bundler/cache/git_spec.rb239
-rw-r--r--spec/bundler/cache/path_spec.rb144
-rw-r--r--spec/bundler/cache/platform_spec.rb49
-rw-r--r--spec/bundler/commands/add_spec.rb251
-rw-r--r--spec/bundler/commands/binstubs_spec.rb465
-rw-r--r--spec/bundler/commands/cache_spec.rb351
-rw-r--r--spec/bundler/commands/check_spec.rb359
-rw-r--r--spec/bundler/commands/clean_spec.rb892
-rw-r--r--spec/bundler/commands/config_spec.rb493
-rw-r--r--spec/bundler/commands/console_spec.rb106
-rw-r--r--spec/bundler/commands/doctor_spec.rb116
-rw-r--r--spec/bundler/commands/exec_spec.rb913
-rw-r--r--spec/bundler/commands/help_spec.rb89
-rw-r--r--spec/bundler/commands/info_spec.rb145
-rw-r--r--spec/bundler/commands/init_spec.rb177
-rw-r--r--spec/bundler/commands/inject_spec.rb117
-rw-r--r--spec/bundler/commands/install_spec.rb589
-rw-r--r--spec/bundler/commands/issue_spec.rb16
-rw-r--r--spec/bundler/commands/licenses_spec.rb31
-rw-r--r--spec/bundler/commands/list_spec.rb168
-rw-r--r--spec/bundler/commands/lock_spec.rb362
-rw-r--r--spec/bundler/commands/newgem_spec.rb732
-rw-r--r--spec/bundler/commands/open_spec.rb117
-rw-r--r--spec/bundler/commands/outdated_spec.rb780
-rw-r--r--spec/bundler/commands/post_bundle_message_spec.rb210
-rw-r--r--spec/bundler/commands/pristine_spec.rb191
-rw-r--r--spec/bundler/commands/remove_spec.rb595
-rw-r--r--spec/bundler/commands/show_spec.rb225
-rw-r--r--spec/bundler/commands/update_spec.rb1021
-rw-r--r--spec/bundler/commands/version_spec.rb47
-rw-r--r--spec/bundler/commands/viz_spec.rb149
-rw-r--r--spec/bundler/install/allow_offline_install_spec.rb92
-rw-r--r--spec/bundler/install/binstubs_spec.rb51
-rw-r--r--spec/bundler/install/bundler_spec.rb182
-rw-r--r--spec/bundler/install/deploy_spec.rb409
-rw-r--r--spec/bundler/install/failure_spec.rb144
-rw-r--r--spec/bundler/install/gemfile/eval_gemfile_spec.rb82
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb583
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb1455
-rw-r--r--spec/bundler/install/gemfile/groups_spec.rb384
-rw-r--r--spec/bundler/install/gemfile/install_if.rb44
-rw-r--r--spec/bundler/install/gemfile/lockfile_spec.rb48
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb747
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb425
-rw-r--r--spec/bundler/install/gemfile/ruby_spec.rb108
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb647
-rw-r--r--spec/bundler/install/gemfile/specific_platform_spec.rb114
-rw-r--r--spec/bundler/install/gemfile_spec.rb124
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb940
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb760
-rw-r--r--spec/bundler/install/gems/env_spec.rb107
-rw-r--r--spec/bundler/install/gems/flex_spec.rb353
-rw-r--r--spec/bundler/install/gems/mirror_spec.rb39
-rw-r--r--spec/bundler/install/gems/native_extensions_spec.rb131
-rw-r--r--spec/bundler/install/gems/post_install_spec.rb150
-rw-r--r--spec/bundler/install/gems/resolving_spec.rb214
-rw-r--r--spec/bundler/install/gems/standalone_spec.rb337
-rw-r--r--spec/bundler/install/gems/sudo_spec.rb187
-rw-r--r--spec/bundler/install/gems/win32_spec.rb26
-rw-r--r--spec/bundler/install/gemspecs_spec.rb151
-rw-r--r--spec/bundler/install/git_spec.rb85
-rw-r--r--spec/bundler/install/global_cache_spec.rb235
-rw-r--r--spec/bundler/install/path_spec.rb221
-rw-r--r--spec/bundler/install/prereleases_spec.rb41
-rw-r--r--spec/bundler/install/process_lock_spec.rb35
-rw-r--r--spec/bundler/install/redownload_spec.rb90
-rw-r--r--spec/bundler/install/security_policy_spec.rb76
-rw-r--r--spec/bundler/install/yanked_spec.rb73
-rw-r--r--spec/bundler/lock/git_spec.rb34
-rw-r--r--spec/bundler/lock/lockfile_spec.rb1489
-rw-r--r--spec/bundler/other/cli_dispatch_spec.rb20
-rw-r--r--spec/bundler/other/ext_spec.rb61
-rw-r--r--spec/bundler/other/major_deprecation_spec.rb562
-rw-r--r--spec/bundler/other/platform_spec.rb1306
-rw-r--r--spec/bundler/plugins/command_spec.rb80
-rw-r--r--spec/bundler/plugins/hook_spec.rb109
-rw-r--r--spec/bundler/plugins/install_spec.rb309
-rw-r--r--spec/bundler/plugins/list_spec.rb60
-rw-r--r--spec/bundler/plugins/source/example_spec.rb508
-rw-r--r--spec/bundler/plugins/source_spec.rb108
-rw-r--r--spec/bundler/quality_es_spec.rb65
-rw-r--r--spec/bundler/quality_spec.rb289
-rw-r--r--spec/bundler/realworld/dependency_api_spec.rb46
-rw-r--r--spec/bundler/realworld/double_check_spec.rb40
-rw-r--r--spec/bundler/realworld/edgecases_spec.rb347
-rw-r--r--spec/bundler/realworld/gemfile_source_header_spec.rb53
-rw-r--r--spec/bundler/realworld/mirror_probe_spec.rb144
-rw-r--r--spec/bundler/realworld/parallel_spec.rb66
-rw-r--r--spec/bundler/resolver/basic_spec.rb308
-rw-r--r--spec/bundler/resolver/platform_spec.rb100
-rw-r--r--spec/bundler/runtime/executable_spec.rb173
-rw-r--r--spec/bundler/runtime/gem_tasks_spec.rb66
-rw-r--r--spec/bundler/runtime/inline_spec.rb336
-rw-r--r--spec/bundler/runtime/load_spec.rb111
-rw-r--r--spec/bundler/runtime/platform_spec.rb169
-rw-r--r--spec/bundler/runtime/require_spec.rb452
-rw-r--r--spec/bundler/runtime/setup_spec.rb1354
-rw-r--r--spec/bundler/runtime/with_unbundled_env_spec.rb270
-rw-r--r--spec/bundler/spec_helper.rb130
-rw-r--r--spec/bundler/support/artifice/compact_index.rb118
-rw-r--r--spec/bundler/support/artifice/compact_index_api_missing.rb18
-rw-r--r--spec/bundler/support/artifice/compact_index_basic_authentication.rb15
-rw-r--r--spec/bundler/support/artifice/compact_index_checksum_mismatch.rb16
-rw-r--r--spec/bundler/support/artifice/compact_index_concurrent_download.rb32
-rw-r--r--spec/bundler/support/artifice/compact_index_creds_diff_host.rb39
-rw-r--r--spec/bundler/support/artifice/compact_index_extra.rb37
-rw-r--r--spec/bundler/support/artifice/compact_index_extra_api.rb52
-rw-r--r--spec/bundler/support/artifice/compact_index_extra_api_missing.rb17
-rw-r--r--spec/bundler/support/artifice/compact_index_extra_missing.rb17
-rw-r--r--spec/bundler/support/artifice/compact_index_forbidden.rb13
-rw-r--r--spec/bundler/support/artifice/compact_index_host_redirect.rb21
-rw-r--r--spec/bundler/support/artifice/compact_index_no_gem.rb13
-rw-r--r--spec/bundler/support/artifice/compact_index_partial_update.rb38
-rw-r--r--spec/bundler/support/artifice/compact_index_range_not_satisfiable.rb34
-rw-r--r--spec/bundler/support/artifice/compact_index_rate_limited.rb48
-rw-r--r--spec/bundler/support/artifice/compact_index_redirects.rb21
-rw-r--r--spec/bundler/support/artifice/compact_index_strict_basic_authentication.rb20
-rw-r--r--spec/bundler/support/artifice/compact_index_wrong_dependencies.rb17
-rw-r--r--spec/bundler/support/artifice/compact_index_wrong_gem_checksum.rb20
-rw-r--r--spec/bundler/support/artifice/endopint_marshal_fail_basic_authentication.rb15
-rw-r--r--spec/bundler/support/artifice/endpoint.rb100
-rw-r--r--spec/bundler/support/artifice/endpoint_500.rb19
-rw-r--r--spec/bundler/support/artifice/endpoint_api_forbidden.rb13
-rw-r--r--spec/bundler/support/artifice/endpoint_api_missing.rb18
-rw-r--r--spec/bundler/support/artifice/endpoint_basic_authentication.rb15
-rw-r--r--spec/bundler/support/artifice/endpoint_creds_diff_host.rb39
-rw-r--r--spec/bundler/support/artifice/endpoint_extra.rb33
-rw-r--r--spec/bundler/support/artifice/endpoint_extra_api.rb34
-rw-r--r--spec/bundler/support/artifice/endpoint_extra_missing.rb17
-rw-r--r--spec/bundler/support/artifice/endpoint_fallback.rb19
-rw-r--r--spec/bundler/support/artifice/endpoint_host_redirect.rb17
-rw-r--r--spec/bundler/support/artifice/endpoint_marshal_fail.rb13
-rw-r--r--spec/bundler/support/artifice/endpoint_mirror_source.rb15
-rw-r--r--spec/bundler/support/artifice/endpoint_redirect.rb17
-rw-r--r--spec/bundler/support/artifice/endpoint_strict_basic_authentication.rb20
-rw-r--r--spec/bundler/support/artifice/endpoint_timeout.rb15
-rw-r--r--spec/bundler/support/artifice/fail.rb39
-rw-r--r--spec/bundler/support/artifice/vcr.rb152
-rw-r--r--spec/bundler/support/artifice/windows.rb47
-rw-r--r--spec/bundler/support/builders.rb815
-rw-r--r--spec/bundler/support/command_execution.rb44
-rw-r--r--spec/bundler/support/filters.rb45
-rw-r--r--spec/bundler/support/hax.rb68
-rw-r--r--spec/bundler/support/helpers.rb585
-rw-r--r--spec/bundler/support/indexes.rb421
-rw-r--r--spec/bundler/support/matchers.rb224
-rw-r--r--spec/bundler/support/parallel.rb5
-rw-r--r--spec/bundler/support/path.rb191
-rw-r--r--spec/bundler/support/permissions.rb12
-rw-r--r--spec/bundler/support/platforms.rb106
-rw-r--r--spec/bundler/support/rubygems_ext.rb107
-rw-r--r--spec/bundler/support/rubygems_version_manager.rb103
-rw-r--r--spec/bundler/support/silent_logger.rb10
-rw-r--r--spec/bundler/support/sometimes.rb57
-rw-r--r--spec/bundler/support/streams.rb19
-rw-r--r--spec/bundler/support/sudo.rb18
-rw-r--r--spec/bundler/support/the_bundle.rb35
-rw-r--r--spec/bundler/update/gemfile_spec.rb49
-rw-r--r--spec/bundler/update/gems/post_install_spec.rb76
-rw-r--r--spec/bundler/update/git_spec.rb374
-rw-r--r--spec/bundler/update/path_spec.rb18
-rw-r--r--spec/bundler/update/redownload_spec.rb34
-rw-r--r--spec/default.mspec59
-rw-r--r--spec/mspec/Gemfile4
-rw-r--r--spec/mspec/Gemfile.lock21
-rw-r--r--spec/mspec/LICENSE22
-rw-r--r--spec/mspec/README.md86
-rw-r--r--spec/mspec/Rakefile6
-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.rb8
-rwxr-xr-xspec/mspec/lib/mspec/commands/mkspec.rb155
-rw-r--r--spec/mspec/lib/mspec/commands/mspec-ci.rb79
-rw-r--r--spec/mspec/lib/mspec/commands/mspec-run.rb87
-rw-r--r--spec/mspec/lib/mspec/commands/mspec-tag.rb133
-rwxr-xr-xspec/mspec/lib/mspec/commands/mspec.rb118
-rw-r--r--spec/mspec/lib/mspec/expectations.rb2
-rw-r--r--spec/mspec/lib/mspec/expectations/expectations.rb35
-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.rb23
-rw-r--r--spec/mspec/lib/mspec/guards/endian.rb25
-rw-r--r--spec/mspec/lib/mspec/guards/feature.rb45
-rw-r--r--spec/mspec/lib/mspec/guards/guard.rb141
-rw-r--r--spec/mspec/lib/mspec/guards/platform.rb89
-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.rb64
-rw-r--r--spec/mspec/lib/mspec/helpers/io.rb91
-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.rb157
-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.rb19
-rw-r--r--spec/mspec/lib/mspec/matchers.rb37
-rw-r--r--spec/mspec/lib/mspec/matchers/base.rb61
-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.rb29
-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.rb37
-rw-r--r--spec/mspec/lib/mspec/matchers/complain.rb71
-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/include_any_of.rb29
-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.rb80
-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/skip.rb5
-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.rb212
-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/constants_leak_checker.rb79
-rw-r--r--spec/mspec/lib/mspec/runner/actions/filter.rb40
-rw-r--r--spec/mspec/lib/mspec/runner/actions/leakchecker.rb294
-rw-r--r--spec/mspec/lib/mspec/runner/actions/profile.rb60
-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/timeout.rb60
-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.rb23
-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/base.rb128
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/describe.rb23
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/dotted.rb23
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/file.rb24
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/html.rb81
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/junit.rb87
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/method.rb95
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/multi.rb47
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/profile.rb18
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/specdoc.rb41
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/spinner.rb111
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/summary.rb4
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/unit.rb20
-rw-r--r--spec/mspec/lib/mspec/runner/formatters/yaml.rb38
-rw-r--r--spec/mspec/lib/mspec/runner/mspec.rb410
-rw-r--r--spec/mspec/lib/mspec/runner/object.rb26
-rw-r--r--spec/mspec/lib/mspec/runner/parallel.rb98
-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/format.rb20
-rw-r--r--spec/mspec/lib/mspec/utils/name_map.rb121
-rw-r--r--spec/mspec/lib/mspec/utils/options.rb489
-rw-r--r--spec/mspec/lib/mspec/utils/script.rb284
-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/chatty_spec.rb8
-rw-r--r--spec/mspec/spec/fixtures/config.mspec10
-rw-r--r--spec/mspec/spec/fixtures/die_spec.rb7
-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.rb53
-rw-r--r--spec/mspec/spec/guards/endian_spec.rb55
-rw-r--r--spec/mspec/spec/guards/feature_spec.rb120
-rw-r--r--spec/mspec/spec/guards/guard_spec.rb421
-rw-r--r--spec/mspec/spec/guards/platform_spec.rb337
-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.rb136
-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.rb73
-rw-r--r--spec/mspec/spec/integration/tag_spec.rb61
-rw-r--r--spec/mspec/spec/matchers/base_spec.rb228
-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.rb48
-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.rb97
-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_any_of_spec.rb42
-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.rb132
-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.rb530
-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.rb31
-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.rb70
-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
-rwxr-xr-xspec/mspec/tool/pull-latest-mspec-spec26
-rw-r--r--spec/mspec/tool/remove_old_guards.rb65
-rw-r--r--spec/mspec/tool/sync/.gitignore4
-rw-r--r--spec/mspec/tool/sync/sync-rubyspec.rb230
-rwxr-xr-xspec/mspec/tool/tag_from_output.rb42
-rw-r--r--spec/ruby/.gitignore5
-rw-r--r--spec/ruby/.mspec.constants225
-rw-r--r--spec/ruby/.rubocop.yml124
-rw-r--r--spec/ruby/.rubocop_todo.yml149
-rw-r--r--spec/ruby/CONTRIBUTING.md251
-rw-r--r--spec/ruby/LICENSE22
-rw-r--r--spec/ruby/README.md137
-rw-r--r--spec/ruby/TODO8
-rw-r--r--spec/ruby/command_line/dash_a_spec.rb19
-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_encoding_spec.rb30
-rw-r--r--spec/ruby/command_line/dash_external_encoding_spec.rb15
-rw-r--r--spec/ruby/command_line/dash_internal_encoding_spec.rb15
-rw-r--r--spec/ruby/command_line/dash_n_spec.rb36
-rw-r--r--spec/ruby/command_line/dash_p_spec.rb19
-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.rb6
-rw-r--r--spec/ruby/command_line/dash_upper_e_spec.rb36
-rw-r--r--spec/ruby/command_line/dash_upper_f_spec.rb13
-rw-r--r--spec/ruby/command_line/dash_upper_i_spec.rb51
-rw-r--r--spec/ruby/command_line/dash_upper_k_spec.rb65
-rw-r--r--spec/ruby/command_line/dash_upper_s_spec.rb29
-rw-r--r--spec/ruby/command_line/dash_upper_u_spec.rb43
-rw-r--r--spec/ruby/command_line/dash_upper_w_spec.rb20
-rw-r--r--spec/ruby/command_line/dash_upper_x_spec.rb6
-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/feature_spec.rb56
-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
-rwxr-xr-xspec/ruby/command_line/fixtures/bin/launcher.rb2
-rw-r--r--spec/ruby/command_line/fixtures/change_directory_script.rb1
-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/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.rb29
-rw-r--r--spec/ruby/command_line/rubylib_spec.rb69
-rw-r--r--spec/ruby/command_line/rubyopt_spec.rb167
-rw-r--r--spec/ruby/command_line/shared/change_directory.rb21
-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.rb35
-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.rb49
-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.rb80
-rw-r--r--spec/ruby/core/argf/read_spec.rb85
-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.rb75
-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.rb85
-rw-r--r--spec/ruby/core/array/bsearch_spec.rb84
-rw-r--r--spec/ruby/core/array/clear_spec.rb52
-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.rb81
-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.rb63
-rw-r--r--spec/ruby/core/array/delete_if_spec.rb68
-rw-r--r--spec/ruby/core/array/delete_spec.rb68
-rw-r--r--spec/ruby/core/array/difference_spec.rb24
-rw-r--r--spec/ruby/core/array/dig_spec.rb52
-rw-r--r--spec/ruby/core/array/drop_spec.rb51
-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.rb48
-rw-r--r--spec/ruby/core/array/element_reference_spec.rb50
-rw-r--r--spec/ruby/core/array/element_set_spec.rb436
-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/filter_spec.rb16
-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.rb522
-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.rb50
-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.rb116
-rw-r--r--spec/ruby/core/array/min_spec.rb121
-rw-r--r--spec/ruby/core/array/minus_spec.rb7
-rw-r--r--spec/ruby/core/array/multiply_spec.rb134
-rw-r--r--spec/ruby/core/array/new_spec.rb122
-rw-r--r--spec/ruby/core/array/pack/a_spec.rb62
-rw-r--r--spec/ruby/core/array/pack/at_spec.rb30
-rw-r--r--spec/ruby/core/array/pack/b_spec.rb108
-rw-r--r--spec/ruby/core/array/pack/buffer_spec.rb50
-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.rb200
-rw-r--r--spec/ruby/core/array/pack/i_spec.rb133
-rw-r--r--spec/ruby/core/array/pack/j_spec.rb217
-rw-r--r--spec/ruby/core/array/pack/l_spec.rb221
-rw-r--r--spec/ruby/core/array/pack/m_spec.rb309
-rw-r--r--spec/ruby/core/array/pack/n_spec.rb25
-rw-r--r--spec/ruby/core/array/pack/p_spec.rb62
-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.rb69
-rw-r--r--spec/ruby/core/array/pack/shared/encodings.rb16
-rw-r--r--spec/ruby/core/array/pack/shared/float.rb229
-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.rb48
-rw-r--r--spec/ruby/core/array/pack/shared/taint.rb35
-rw-r--r--spec/ruby/core/array/pack/shared/unicode.rb94
-rw-r--r--spec/ruby/core/array/pack/u_spec.rb130
-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.rb34
-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.rb59
-rw-r--r--spec/ruby/core/array/pop_spec.rb176
-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.rb143
-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.rb14
-rw-r--r--spec/ruby/core/array/shared/clone.rb44
-rw-r--r--spec/ruby/core/array/shared/collect.rb140
-rw-r--r--spec/ruby/core/array/shared/delete_if.rb13
-rw-r--r--spec/ruby/core/array/shared/difference.rb78
-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.rb133
-rw-r--r--spec/ruby/core/array/shared/join.rb167
-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/select.rb32
-rw-r--r--spec/ruby/core/array/shared/slice.rb480
-rw-r--r--spec/ruby/core/array/shared/union.rb79
-rw-r--r--spec/ruby/core/array/shared/unshift.rb46
-rw-r--r--spec/ruby/core/array/shift_spec.rb136
-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.rb42
-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.rb81
-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.rb27
-rw-r--r--spec/ruby/core/array/uniq_spec.rb253
-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.rb91
-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.rb188
-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/binding/clone_spec.rb7
-rw-r--r--spec/ruby/core/binding/dup_spec.rb7
-rw-r--r--spec/ruby/core/binding/eval_spec.rb95
-rw-r--r--spec/ruby/core/binding/fixtures/classes.rb52
-rw-r--r--spec/ruby/core/binding/fixtures/irb.rb3
-rw-r--r--spec/ruby/core/binding/fixtures/irbrc1
-rw-r--r--spec/ruby/core/binding/fixtures/location.rb6
-rw-r--r--spec/ruby/core/binding/irb_spec.rb18
-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/receiver_spec.rb11
-rw-r--r--spec/ruby/core/binding/shared/clone.rb34
-rw-r--r--spec/ruby/core/binding/source_location_spec.rb11
-rw-r--r--spec/ruby/core/builtin_constants/builtin_constants_spec.rb57
-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.rb101
-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/comparable/between_spec.rb25
-rw-r--r--spec/ruby/core/comparable/clamp_spec.rb88
-rw-r--r--spec/ruby/core/comparable/equal_value_spec.rb114
-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.rb9
-rw-r--r--spec/ruby/core/complex/abs_spec.rb6
-rw-r--r--spec/ruby/core/complex/angle_spec.rb6
-rw-r--r--spec/ruby/core/complex/arg_spec.rb6
-rw-r--r--spec/ruby/core/complex/coerce_spec.rb70
-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.rb7
-rw-r--r--spec/ruby/core/complex/denominator_spec.rb13
-rw-r--r--spec/ruby/core/complex/divide_spec.rb6
-rw-r--r--spec/ruby/core/complex/eql_spec.rb31
-rw-r--r--spec/ruby/core/complex/equal_value_spec.rb93
-rw-r--r--spec/ruby/core/complex/exponent_spec.rb61
-rw-r--r--spec/ruby/core/complex/fdiv_spec.rb129
-rw-r--r--spec/ruby/core/complex/finite_spec.rb32
-rw-r--r--spec/ruby/core/complex/hash_spec.rb16
-rw-r--r--spec/ruby/core/complex/imag_spec.rb6
-rw-r--r--spec/ruby/core/complex/imaginary_spec.rb6
-rw-r--r--spec/ruby/core/complex/infinite_spec.rb32
-rw-r--r--spec/ruby/core/complex/inspect_spec.rb16
-rw-r--r--spec/ruby/core/complex/integer_spec.rb11
-rw-r--r--spec/ruby/core/complex/magnitude_spec.rb6
-rw-r--r--spec/ruby/core/complex/marshal_dump_spec.rb11
-rw-r--r--spec/ruby/core/complex/minus_spec.rb45
-rw-r--r--spec/ruby/core/complex/multiply_spec.rb49
-rw-r--r--spec/ruby/core/complex/negative_spec.rb13
-rw-r--r--spec/ruby/core/complex/numerator_spec.rb19
-rw-r--r--spec/ruby/core/complex/phase_spec.rb6
-rw-r--r--spec/ruby/core/complex/plus_spec.rb45
-rw-r--r--spec/ruby/core/complex/polar_spec.rb27
-rw-r--r--spec/ruby/core/complex/positive_spec.rb13
-rw-r--r--spec/ruby/core/complex/quo_spec.rb6
-rw-r--r--spec/ruby/core/complex/rationalize_spec.rb31
-rw-r--r--spec/ruby/core/complex/real_spec.rb28
-rw-r--r--spec/ruby/core/complex/rect_spec.rb10
-rw-r--r--spec/ruby/core/complex/rectangular_spec.rb10
-rw-r--r--spec/ruby/core/complex/shared/abs.rb10
-rw-r--r--spec/ruby/core/complex/shared/arg.rb9
-rw-r--r--spec/ruby/core/complex/shared/conjugate.rb8
-rw-r--r--spec/ruby/core/complex/shared/divide.rb82
-rw-r--r--spec/ruby/core/complex/shared/image.rb8
-rw-r--r--spec/ruby/core/complex/shared/rect.rb94
-rw-r--r--spec/ruby/core/complex/spaceship_spec.rb27
-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.rb44
-rw-r--r--spec/ruby/core/complex/uminus_spec.rb11
-rw-r--r--spec/ruby/core/data/constants_spec.rb15
-rw-r--r--spec/ruby/core/dir/chdir_spec.rb124
-rw-r--r--spec/ruby/core/dir/children_spec.rb138
-rw-r--r--spec/ruby/core/dir/chroot_spec.rb47
-rw-r--r--spec/ruby/core/dir/close_spec.rb19
-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.rb105
-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.rb31
-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.rb168
-rw-r--r--spec/ruby/core/dir/home_spec.rb45
-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.rb87
-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.rb63
-rw-r--r--spec/ruby/core/dir/shared/exist.rb56
-rw-r--r--spec/ruby/core/dir/shared/glob.rb415
-rw-r--r--spec/ruby/core/dir/shared/open.rb73
-rw-r--r--spec/ruby/core/dir/shared/path.rb30
-rw-r--r--spec/ruby/core/dir/shared/pos.rb51
-rw-r--r--spec/ruby/core/dir/shared/pwd.rb45
-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.rb43
-rw-r--r--spec/ruby/core/encoding/ascii_compatible_spec.rb11
-rw-r--r--spec/ruby/core/encoding/compatible_spec.rb379
-rw-r--r--spec/ruby/core/encoding/converter/asciicompat_encoding_spec.rb37
-rw-r--r--spec/ruby/core/encoding/converter/constants_spec.rb131
-rw-r--r--spec/ruby/core/encoding/converter/convert_spec.rb45
-rw-r--r--spec/ruby/core/encoding/converter/convpath_spec.rb24
-rw-r--r--spec/ruby/core/encoding/converter/destination_encoding_spec.rb11
-rw-r--r--spec/ruby/core/encoding/converter/finish_spec.rb36
-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.rb91
-rw-r--r--spec/ruby/core/encoding/converter/new_spec.rb119
-rw-r--r--spec/ruby/core/encoding/converter/primitive_convert_spec.rb211
-rw-r--r--spec/ruby/core/encoding/converter/primitive_errinfo_spec.rb68
-rw-r--r--spec/ruby/core/encoding/converter/putback_spec.rb47
-rw-r--r--spec/ruby/core/encoding/converter/replacement_spec.rb72
-rw-r--r--spec/ruby/core/encoding/converter/search_convpath_spec.rb30
-rw-r--r--spec/ruby/core/encoding/converter/source_encoding_spec.rb11
-rw-r--r--spec/ruby/core/encoding/default_external_spec.rb63
-rw-r--r--spec/ruby/core/encoding/default_internal_spec.rb74
-rw-r--r--spec/ruby/core/encoding/dummy_spec.rb14
-rw-r--r--spec/ruby/core/encoding/find_spec.rb82
-rw-r--r--spec/ruby/core/encoding/fixtures/classes.rb49
-rw-r--r--spec/ruby/core/encoding/inspect_spec.rb19
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/destination_encoding_name_spec.rb18
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/destination_encoding_spec.rb18
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/error_bytes_spec.rb30
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/incomplete_input_spec.rb29
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/readagain_bytes_spec.rb30
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/source_encoding_name_spec.rb28
-rw-r--r--spec/ruby/core/encoding/invalid_byte_sequence_error/source_encoding_spec.rb33
-rw-r--r--spec/ruby/core/encoding/list_spec.rb41
-rw-r--r--spec/ruby/core/encoding/locale_charmap_spec.rb45
-rw-r--r--spec/ruby/core/encoding/name_list_spec.rb23
-rw-r--r--spec/ruby/core/encoding/name_spec.rb5
-rw-r--r--spec/ruby/core/encoding/names_spec.rb35
-rw-r--r--spec/ruby/core/encoding/replicate_spec.rb46
-rw-r--r--spec/ruby/core/encoding/shared/name.rb15
-rw-r--r--spec/ruby/core/encoding/to_s_spec.rb5
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/destination_encoding_name_spec.rb15
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/destination_encoding_spec.rb15
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/error_char_spec.rb27
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/source_encoding_name_spec.rb28
-rw-r--r--spec/ruby/core/encoding/undefined_conversion_error/source_encoding_spec.rb29
-rw-r--r--spec/ruby/core/enumerable/all_spec.rb201
-rw-r--r--spec/ruby/core/enumerable/any_spec.rb214
-rw-r--r--spec/ruby/core/enumerable/chain_spec.rb25
-rw-r--r--spec/ruby/core/enumerable/chunk_spec.rb67
-rw-r--r--spec/ruby/core/enumerable/chunk_while_spec.rb42
-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/filter_map_spec.rb26
-rw-r--r--spec/ruby/core/enumerable/filter_spec.rb9
-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.rb345
-rw-r--r--spec/ruby/core/enumerable/flat_map_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/grep_spec.rb74
-rw-r--r--spec/ruby/core/enumerable/grep_v_spec.rb63
-rw-r--r--spec/ruby/core/enumerable/group_by_spec.rb47
-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.rb167
-rw-r--r--spec/ruby/core/enumerable/one_spec.rb169
-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.rb38
-rw-r--r--spec/ruby/core/enumerable/shared/collect_concat.rb54
-rw-r--r--spec/ruby/core/enumerable/shared/entries.rb26
-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.rb77
-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.rb64
-rw-r--r--spec/ruby/core/enumerable/slice_when_spec.rb54
-rw-r--r--spec/ruby/core/enumerable/sort_by_spec.rb43
-rw-r--r--spec/ruby/core/enumerable/sort_spec.rb54
-rw-r--r--spec/ruby/core/enumerable/sum_spec.rb28
-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/tally_spec.rb35
-rw-r--r--spec/ruby/core/enumerable/to_a_spec.rb7
-rw-r--r--spec/ruby/core/enumerable/to_h_spec.rb90
-rw-r--r--spec/ruby/core/enumerable/uniq_spec.rb122
-rw-r--r--spec/ruby/core/enumerable/zip_spec.rb41
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/begin_spec.rb11
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/each_spec.rb19
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/end_spec.rb11
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/eq_spec.rb20
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb19
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/first_spec.rb11
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/hash_spec.rb22
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/inspect_spec.rb22
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/last_spec.rb11
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/new_spec.rb19
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/size_spec.rb19
-rw-r--r--spec/ruby/core/enumerator/arithmetic_sequence/step_spec.rb15
-rw-r--r--spec/ruby/core/enumerator/chain/each_spec.rb17
-rw-r--r--spec/ruby/core/enumerator/chain/initialize_spec.rb33
-rw-r--r--spec/ruby/core/enumerator/chain/inspect_spec.rb16
-rw-r--r--spec/ruby/core/enumerator/chain/rewind_spec.rb53
-rw-r--r--spec/ruby/core/enumerator/chain/size_spec.rb24
-rw-r--r--spec/ruby/core/enumerator/each_spec.rb89
-rw-r--r--spec/ruby/core/enumerator/each_with_index_spec.rb36
-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/inspect_spec.rb17
-rw-r--r--spec/ruby/core/enumerator/lazy/chunk_spec.rb67
-rw-r--r--spec/ruby/core/enumerator/lazy/chunk_while_spec.rb9
-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.rb58
-rw-r--r--spec/ruby/core/enumerator/lazy/drop_while_spec.rb66
-rw-r--r--spec/ruby/core/enumerator/lazy/enum_for_spec.rb8
-rw-r--r--spec/ruby/core/enumerator/lazy/filter_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.rb16
-rw-r--r--spec/ruby/core/enumerator/lazy/force_spec.rb36
-rw-r--r--spec/ruby/core/enumerator/lazy/grep_spec.rb121
-rw-r--r--spec/ruby/core/enumerator/lazy/grep_v_spec.rb123
-rw-r--r--spec/ruby/core/enumerator/lazy/initialize_spec.rb63
-rw-r--r--spec/ruby/core/enumerator/lazy/lazy_spec.rb28
-rw-r--r--spec/ruby/core/enumerator/lazy/map_spec.rb12
-rw-r--r--spec/ruby/core/enumerator/lazy/reject_spec.rb78
-rw-r--r--spec/ruby/core/enumerator/lazy/select_spec.rb47
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/collect.rb62
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/collect_concat.rb78
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/select.rb66
-rw-r--r--spec/ruby/core/enumerator/lazy/shared/to_enum.rb55
-rw-r--r--spec/ruby/core/enumerator/lazy/slice_after_spec.rb9
-rw-r--r--spec/ruby/core/enumerator/lazy/slice_before_spec.rb9
-rw-r--r--spec/ruby/core/enumerator/lazy/slice_when_spec.rb9
-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.rb74
-rw-r--r--spec/ruby/core/enumerator/lazy/zip_spec.rb86
-rw-r--r--spec/ruby/core/enumerator/new_spec.rb41
-rw-r--r--spec/ruby/core/enumerator/next_spec.rb27
-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/plus_spec.rb35
-rw-r--r--spec/ruby/core/enumerator/rewind_spec.rb70
-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.rb24
-rw-r--r--spec/ruby/core/enumerator/yielder/initialize_spec.rb18
-rw-r--r--spec/ruby/core/enumerator/yielder/yield_spec.rb23
-rw-r--r--spec/ruby/core/env/assoc_spec.rb31
-rw-r--r--spec/ruby/core/env/clear_spec.rb20
-rw-r--r--spec/ruby/core/env/delete_if_spec.rb54
-rw-r--r--spec/ruby/core/env/delete_spec.rb42
-rw-r--r--spec/ruby/core/env/each_key_spec.rb34
-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.rb34
-rw-r--r--spec/ruby/core/env/element_reference_spec.rb75
-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.rb62
-rw-r--r--spec/ruby/core/env/filter_spec.rb15
-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.rb12
-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.rb54
-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/merge_spec.rb8
-rw-r--r--spec/ruby/core/env/rassoc_spec.rb42
-rw-r--r--spec/ruby/core/env/rehash_spec.rb7
-rw-r--r--spec/ruby/core/env/reject_spec.rb101
-rw-r--r--spec/ruby/core/env/replace_spec.rb51
-rw-r--r--spec/ruby/core/env/select_spec.rb13
-rw-r--r--spec/ruby/core/env/shared/each.rb65
-rw-r--r--spec/ruby/core/env/shared/include.rb23
-rw-r--r--spec/ruby/core/env/shared/key.rb23
-rw-r--r--spec/ruby/core/env/shared/length.rb13
-rw-r--r--spec/ruby/core/env/shared/select.rb61
-rw-r--r--spec/ruby/core/env/shared/store.rb60
-rw-r--r--spec/ruby/core/env/shared/to_hash.rb33
-rw-r--r--spec/ruby/core/env/shared/update.rb100
-rw-r--r--spec/ruby/core/env/shared/value.rb22
-rw-r--r--spec/ruby/core/env/shift_spec.rb57
-rw-r--r--spec/ruby/core/env/size_spec.rb6
-rw-r--r--spec/ruby/core/env/slice_spec.rb29
-rw-r--r--spec/ruby/core/env/spec_helper.rb26
-rw-r--r--spec/ruby/core/env/store_spec.rb6
-rw-r--r--spec/ruby/core/env/to_a_spec.rb18
-rw-r--r--spec/ruby/core/env/to_h_spec.rb60
-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.rb6
-rw-r--r--spec/ruby/core/env/value_spec.rb6
-rw-r--r--spec/ruby/core/env/values_at_spec.rb37
-rw-r--r--spec/ruby/core/env/values_spec.rb14
-rw-r--r--spec/ruby/core/exception/backtrace_locations_spec.rb39
-rw-r--r--spec/ruby/core/exception/backtrace_spec.rb93
-rw-r--r--spec/ruby/core/exception/case_compare_spec.rb39
-rw-r--r--spec/ruby/core/exception/cause_spec.rb56
-rw-r--r--spec/ruby/core/exception/destination_encoding_name_spec.rb23
-rw-r--r--spec/ruby/core/exception/destination_encoding_spec.rb23
-rw-r--r--spec/ruby/core/exception/dup_spec.rb74
-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.rb12
-rw-r--r--spec/ruby/core/exception/error_char_spec.rb12
-rw-r--r--spec/ruby/core/exception/exception_spec.rb69
-rw-r--r--spec/ruby/core/exception/exit_value_spec.rb5
-rw-r--r--spec/ruby/core/exception/fixtures/common.rb95
-rw-r--r--spec/ruby/core/exception/frozen_error_spec.rb34
-rw-r--r--spec/ruby/core/exception/full_message_spec.rb94
-rw-r--r--spec/ruby/core/exception/hierarchy_spec.rb62
-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.rb24
-rw-r--r--spec/ruby/core/exception/interrupt_spec.rb35
-rw-r--r--spec/ruby/core/exception/io_error_spec.rb51
-rw-r--r--spec/ruby/core/exception/key_error_spec.rb15
-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.rb24
-rw-r--r--spec/ruby/core/exception/name_spec.rb45
-rw-r--r--spec/ruby/core/exception/new_spec.rb7
-rw-r--r--spec/ruby/core/exception/no_method_error_spec.rb106
-rw-r--r--spec/ruby/core/exception/range_error_spec.rb7
-rw-r--r--spec/ruby/core/exception/readagain_bytes_spec.rb12
-rw-r--r--spec/ruby/core/exception/reason_spec.rb5
-rw-r--r--spec/ruby/core/exception/receiver_spec.rb60
-rw-r--r--spec/ruby/core/exception/result_spec.rb29
-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.rb125
-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.rb23
-rw-r--r--spec/ruby/core/exception/source_encoding_spec.rb23
-rw-r--r--spec/ruby/core/exception/standard_error_spec.rb23
-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.rb130
-rw-r--r--spec/ruby/core/exception/system_stack_error_spec.rb7
-rw-r--r--spec/ruby/core/exception/to_s_spec.rb37
-rw-r--r--spec/ruby/core/exception/uncaught_throw_error_spec.rb18
-rw-r--r--spec/ruby/core/false/and_spec.rb11
-rw-r--r--spec/ruby/core/false/dup_spec.rb7
-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.rb17
-rw-r--r--spec/ruby/core/false/xor_spec.rb11
-rw-r--r--spec/ruby/core/fiber/new_spec.rb39
-rw-r--r--spec/ruby/core/fiber/resume_spec.rb48
-rw-r--r--spec/ruby/core/fiber/yield_spec.rb49
-rw-r--r--spec/ruby/core/file/absolute_path_spec.rb90
-rw-r--r--spec/ruby/core/file/atime_spec.rb55
-rw-r--r--spec/ruby/core/file/basename_spec.rb168
-rw-r--r--spec/ruby/core/file/birthtime_spec.rb60
-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.rb185
-rw-r--r--spec/ruby/core/file/chown_spec.rb144
-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.rb13
-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.rb265
-rw-r--r--spec/ruby/core/file/extname_spec.rb66
-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.rb66
-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.rb74
-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.rb19
-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.rb59
-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/lutime_spec.rb40
-rw-r--r--spec/ruby/core/file/mkfifo_spec.rb51
-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.rb700
-rw-r--r--spec/ruby/core/file/owned_spec.rb35
-rw-r--r--spec/ruby/core/file/path_spec.rb40
-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/path.rb77
-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.rb61
-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.rb64
-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.rb64
-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.rb28
-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.rb33
-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.rb7
-rw-r--r--spec/ruby/core/file/stat/setuid_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/size_spec.rb21
-rw-r--r--spec/ruby/core/file/stat/socket_spec.rb7
-rw-r--r--spec/ruby/core/file/stat/sticky_spec.rb7
-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.rb6
-rw-r--r--spec/ruby/core/file/truncate_spec.rb177
-rw-r--r--spec/ruby/core/file/umask_spec.rb57
-rw-r--r--spec/ruby/core/file/unlink_spec.rb6
-rw-r--r--spec/ruby/core/file/utime_spec.rb83
-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.rb6
-rw-r--r--spec/ruby/core/filetest/pipe_spec.rb6
-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.rb6
-rw-r--r--spec/ruby/core/filetest/setuid_spec.rb6
-rw-r--r--spec/ruby/core/filetest/size_spec.rb34
-rw-r--r--spec/ruby/core/filetest/socket_spec.rb6
-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/float/abs_spec.rb6
-rw-r--r--spec/ruby/core/float/angle_spec.rb6
-rw-r--r--spec/ruby/core/float/arg_spec.rb6
-rw-r--r--spec/ruby/core/float/case_compare_spec.rb6
-rw-r--r--spec/ruby/core/float/ceil_spec.rb21
-rw-r--r--spec/ruby/core/float/coerce_spec.rb18
-rw-r--r--spec/ruby/core/float/comparison_spec.rb68
-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.rb39
-rw-r--r--spec/ruby/core/float/divmod_spec.rb43
-rw-r--r--spec/ruby/core/float/dup_spec.rb8
-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/classes.rb4
-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.rb21
-rw-r--r--spec/ruby/core/float/gt_spec.rb17
-rw-r--r--spec/ruby/core/float/gte_spec.rb17
-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.rb17
-rw-r--r--spec/ruby/core/float/lte_spec.rb18
-rw-r--r--spec/ruby/core/float/magnitude_spec.rb5
-rw-r--r--spec/ruby/core/float/minus_spec.rb12
-rw-r--r--spec/ruby/core/float/modulo_spec.rb10
-rw-r--r--spec/ruby/core/float/multiply_spec.rb17
-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.rb6
-rw-r--r--spec/ruby/core/float/plus_spec.rb12
-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.rb117
-rw-r--r--spec/ruby/core/float/shared/abs.rb21
-rw-r--r--spec/ruby/core/float/shared/arg.rb36
-rw-r--r--spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb33
-rw-r--r--spec/ruby/core/float/shared/comparison_exception_in_coerce.rb35
-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.rb310
-rw-r--r--spec/ruby/core/float/truncate_spec.rb14
-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.rb17
-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/stat_spec.rb16
-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.rb12
-rw-r--r--spec/ruby/core/hash/compact_spec.rb59
-rw-r--r--spec/ruby/core/hash/compare_by_identity_spec.rb138
-rw-r--r--spec/ruby/core/hash/constructor_spec.rb123
-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.rb66
-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.rb44
-rw-r--r--spec/ruby/core/hash/fetch_values_spec.rb35
-rw-r--r--spec/ruby/core/hash/filter_spec.rb12
-rw-r--r--spec/ruby/core/hash/fixtures/classes.rb75
-rw-r--r--spec/ruby/core/hash/flatten_spec.rb62
-rw-r--r--spec/ruby/core/hash/gt_spec.rb42
-rw-r--r--spec/ruby/core/hash/gte_spec.rb42
-rw-r--r--spec/ruby/core/hash/has_key_spec.rb7
-rw-r--r--spec/ruby/core/hash/has_value_spec.rb7
-rw-r--r--spec/ruby/core/hash/hash_spec.rb44
-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.rb61
-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.rb42
-rw-r--r--spec/ruby/core/hash/lte_spec.rb42
-rw-r--r--spec/ruby/core/hash/member_spec.rb7
-rw-r--r--spec/ruby/core/hash/merge_spec.rb102
-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.rb66
-rw-r--r--spec/ruby/core/hash/reject_spec.rb102
-rw-r--r--spec/ruby/core/hash/replace_spec.rb7
-rw-r--r--spec/ruby/core/hash/select_spec.rb10
-rw-r--r--spec/ruby/core/hash/shared/comparison.rb15
-rw-r--r--spec/ruby/core/hash/shared/each.rb85
-rw-r--r--spec/ruby/core/hash/shared/eql.rb250
-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/select.rb91
-rw-r--r--spec/ruby/core/hash/shared/store.rb98
-rw-r--r--spec/ruby/core/hash/shared/to_s.rb98
-rw-r--r--spec/ruby/core/hash/shared/update.rb78
-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.rb79
-rw-r--r--spec/ruby/core/hash/size_spec.rb7
-rw-r--r--spec/ruby/core/hash/slice_spec.rb55
-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.rb39
-rw-r--r--spec/ruby/core/hash/to_h_spec.rb74
-rw-r--r--spec/ruby/core/hash/to_hash_spec.rb14
-rw-r--r--spec/ruby/core/hash/to_proc_spec.rb87
-rw-r--r--spec/ruby/core/hash/to_s_spec.rb7
-rw-r--r--spec/ruby/core/hash/transform_keys_spec.rb132
-rw-r--r--spec/ruby/core/hash/transform_values_spec.rb97
-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.rb7
-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/abs_spec.rb6
-rw-r--r--spec/ruby/core/integer/allbits_spec.rb39
-rw-r--r--spec/ruby/core/integer/anybits_spec.rb38
-rw-r--r--spec/ruby/core/integer/bit_and_spec.rb97
-rw-r--r--spec/ruby/core/integer/bit_length_spec.rb76
-rw-r--r--spec/ruby/core/integer/bit_or_spec.rb68
-rw-r--r--spec/ruby/core/integer/bit_xor_spec.rb72
-rw-r--r--spec/ruby/core/integer/case_compare_spec.rb6
-rw-r--r--spec/ruby/core/integer/ceil_spec.rb19
-rw-r--r--spec/ruby/core/integer/chr_spec.rb243
-rw-r--r--spec/ruby/core/integer/coerce_spec.rb104
-rw-r--r--spec/ruby/core/integer/comparison_spec.rb189
-rw-r--r--spec/ruby/core/integer/complement_spec.rb20
-rw-r--r--spec/ruby/core/integer/constants_spec.rb25
-rw-r--r--spec/ruby/core/integer/denominator_spec.rb20
-rw-r--r--spec/ruby/core/integer/digits_spec.rb32
-rw-r--r--spec/ruby/core/integer/div_spec.rb146
-rw-r--r--spec/ruby/core/integer/divide_spec.rb95
-rw-r--r--spec/ruby/core/integer/divmod_spec.rb117
-rw-r--r--spec/ruby/core/integer/downto_spec.rb69
-rw-r--r--spec/ruby/core/integer/dup_spec.rb13
-rw-r--r--spec/ruby/core/integer/element_reference_spec.rb111
-rw-r--r--spec/ruby/core/integer/equal_value_spec.rb6
-rw-r--r--spec/ruby/core/integer/even_spec.rb40
-rw-r--r--spec/ruby/core/integer/exponent_spec.rb7
-rw-r--r--spec/ruby/core/integer/fdiv_spec.rb49
-rw-r--r--spec/ruby/core/integer/fixtures/classes.rb4
-rw-r--r--spec/ruby/core/integer/floor_spec.rb19
-rw-r--r--spec/ruby/core/integer/gcd_spec.rb69
-rw-r--r--spec/ruby/core/integer/gcdlcm_spec.rb53
-rw-r--r--spec/ruby/core/integer/gt_spec.rb49
-rw-r--r--spec/ruby/core/integer/gte_spec.rb49
-rw-r--r--spec/ruby/core/integer/integer_spec.rb20
-rw-r--r--spec/ruby/core/integer/lcm_spec.rb58
-rw-r--r--spec/ruby/core/integer/left_shift_spec.rb165
-rw-r--r--spec/ruby/core/integer/lt_spec.rb51
-rw-r--r--spec/ruby/core/integer/lte_spec.rb54
-rw-r--r--spec/ruby/core/integer/magnitude_spec.rb6
-rw-r--r--spec/ruby/core/integer/minus_spec.rb49
-rw-r--r--spec/ruby/core/integer/modulo_spec.rb10
-rw-r--r--spec/ruby/core/integer/multiply_spec.rb51
-rw-r--r--spec/ruby/core/integer/next_spec.rb6
-rw-r--r--spec/ruby/core/integer/nobits_spec.rb38
-rw-r--r--spec/ruby/core/integer/numerator_spec.rb18
-rw-r--r--spec/ruby/core/integer/odd_spec.rb38
-rw-r--r--spec/ruby/core/integer/ord_spec.rb17
-rw-r--r--spec/ruby/core/integer/plus_spec.rb49
-rw-r--r--spec/ruby/core/integer/pow_spec.rb49
-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/remainder_spec.rb51
-rw-r--r--spec/ruby/core/integer/right_shift_spec.rb191
-rw-r--r--spec/ruby/core/integer/round_spec.rb101
-rw-r--r--spec/ruby/core/integer/shared/abs.rb18
-rw-r--r--spec/ruby/core/integer/shared/arithmetic_coerce.rb31
-rw-r--r--spec/ruby/core/integer/shared/comparison_coerce.rb33
-rw-r--r--spec/ruby/core/integer/shared/equal.rb58
-rw-r--r--spec/ruby/core/integer/shared/exponent.rb118
-rw-r--r--spec/ruby/core/integer/shared/integer_rounding.rb29
-rw-r--r--spec/ruby/core/integer/shared/modulo.rb74
-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/size_spec.rb34
-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_f_spec.rb23
-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/to_s_spec.rb95
-rw-r--r--spec/ruby/core/integer/truncate_spec.rb19
-rw-r--r--spec/ruby/core/integer/uminus_spec.rb30
-rw-r--r--spec/ruby/core/integer/upto_spec.rb69
-rw-r--r--spec/ruby/core/io/advise_spec.rb96
-rw-r--r--spec/ruby/core/io/binmode_spec.rb60
-rw-r--r--spec/ruby/core/io/binread_spec.rb47
-rw-r--r--spec/ruby/core/io/binwrite_spec.rb6
-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.rb80
-rw-r--r--spec/ruby/core/io/close_read_spec.rb60
-rw-r--r--spec/ruby/core/io/close_spec.rb97
-rw-r--r--spec/ruby/core/io/close_write_spec.rb64
-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.rb87
-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.rb43
-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.rb216
-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.rb37
-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.rb327
-rw-r--r--spec/ruby/core/io/initialize_spec.rb49
-rw-r--r--spec/ruby/core/io/inspect_spec.rb23
-rw-r--r--spec/ruby/core/io/internal_encoding_spec.rb138
-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.rb271
-rw-r--r--spec/ruby/core/io/pos_spec.rb11
-rw-r--r--spec/ruby/core/io/pread_spec.rb52
-rw-r--r--spec/ruby/core/io/print_spec.rb53
-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.rb139
-rw-r--r--spec/ruby/core/io/pwrite_spec.rb45
-rw-r--r--spec/ruby/core/io/read_nonblock_spec.rb99
-rw-r--r--spec/ruby/core/io/read_spec.rb616
-rw-r--r--spec/ruby/core/io/readbyte_spec.rb24
-rw-r--r--spec/ruby/core/io/readchar_spec.rb44
-rw-r--r--spec/ruby/core/io/readline_spec.rb51
-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.rb313
-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.rb120
-rw-r--r--spec/ruby/core/io/set_encoding_spec.rb191
-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.rb183
-rw-r--r--spec/ruby/core/io/shared/gets_ascii.rb19
-rw-r--r--spec/ruby/core/io/shared/new.rb382
-rw-r--r--spec/ruby/core/io/shared/pos.rb72
-rw-r--r--spec/ruby/core/io/shared/readlines.rb209
-rw-r--r--spec/ruby/core/io/shared/tty.rb24
-rw-r--r--spec/ruby/core/io/shared/write.rb109
-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.rb71
-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.rb73
-rw-r--r--spec/ruby/core/io/ungetc_spec.rb135
-rw-r--r--spec/ruby/core/io/write_nonblock_spec.rb85
-rw-r--r--spec/ruby/core/io/write_spec.rb166
-rw-r--r--spec/ruby/core/kernel/Array_spec.rb97
-rw-r--r--spec/ruby/core/kernel/Complex_spec.rb187
-rw-r--r--spec/ruby/core/kernel/Float_spec.rb341
-rw-r--r--spec/ruby/core/kernel/Hash_spec.rb63
-rw-r--r--spec/ruby/core/kernel/Integer_spec.rb818
-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.rb20
-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.rb160
-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.rb46
-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.rb65
-rw-r--r--spec/ruby/core/kernel/chop_spec.rb53
-rw-r--r--spec/ruby/core/kernel/class_spec.rb26
-rw-r--r--spec/ruby/core/kernel/clone_spec.rb122
-rw-r--r--spec/ruby/core/kernel/comparison_spec.rb31
-rw-r--r--spec/ruby/core/kernel/define_singleton_method_spec.rb99
-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.rb10
-rw-r--r--spec/ruby/core/kernel/equal_value_spec.rb15
-rw-r--r--spec/ruby/core/kernel/eval_spec.rb362
-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.rb42
-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_d.rb5
-rw-r--r--spec/ruby/core/kernel/fixtures/autoload_from_included_module.rb9
-rw-r--r--spec/ruby/core/kernel/fixtures/autoload_from_included_module2.rb9
-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_at_exit.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.rb492
-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/singleton_methods.rb13
-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.rb33
-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.rb122
-rw-r--r--spec/ruby/core/kernel/load_spec.rb40
-rw-r--r--spec/ruby/core/kernel/local_variables_spec.rb48
-rw-r--r--spec/ruby/core/kernel/loop_spec.rb79
-rw-r--r--spec/ruby/core/kernel/match_spec.rb24
-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.rb144
-rw-r--r--spec/ruby/core/kernel/p_spec.rb83
-rw-r--r--spec/ruby/core/kernel/pp_spec.rb11
-rw-r--r--spec/ruby/core/kernel/print_spec.rb12
-rw-r--r--spec/ruby/core/kernel/printf_spec.rb60
-rw-r--r--spec/ruby/core/kernel/private_methods_spec.rb69
-rw-r--r--spec/ruby/core/kernel/proc_spec.rb62
-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.rb155
-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.rb427
-rw-r--r--spec/ruby/core/kernel/require_spec.rb34
-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.rb18
-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.rb129
-rw-r--r--spec/ruby/core/kernel/shared/kind_of.rb55
-rw-r--r--spec/ruby/core/kernel/shared/lambda.rb9
-rw-r--r--spec/ruby/core/kernel/shared/load.rb172
-rw-r--r--spec/ruby/core/kernel/shared/method.rb50
-rw-r--r--spec/ruby/core/kernel/shared/require.rb773
-rw-r--r--spec/ruby/core/kernel/shared/sprintf.rb877
-rw-r--r--spec/ruby/core/kernel/shared/sprintf_encoding.rb28
-rw-r--r--spec/ruby/core/kernel/shared/then.rb20
-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.rb192
-rw-r--r--spec/ruby/core/kernel/sleep_spec.rb56
-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.rb117
-rw-r--r--spec/ruby/core/kernel/taint_spec.rb47
-rw-r--r--spec/ruby/core/kernel/tainted_spec.rb14
-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/then_spec.rb8
-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.rb18
-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.rb27
-rw-r--r--spec/ruby/core/kernel/untaint_spec.rb27
-rw-r--r--spec/ruby/core/kernel/untrace_var_spec.rb12
-rw-r--r--spec/ruby/core/kernel/untrust_spec.rb27
-rw-r--r--spec/ruby/core/kernel/untrusted_spec.rb30
-rw-r--r--spec/ruby/core/kernel/warn_spec.rb156
-rw-r--r--spec/ruby/core/kernel/yield_self_spec.rb8
-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.rb132
-rw-r--r--spec/ruby/core/marshal/dump_spec.rb615
-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.rb900
-rw-r--r--spec/ruby/core/matchdata/allocate_spec.rb10
-rw-r--r--spec/ruby/core/matchdata/begin_spec.rb104
-rw-r--r--spec/ruby/core/matchdata/captures_spec.rb7
-rw-r--r--spec/ruby/core/matchdata/dup_spec.rb14
-rw-r--r--spec/ruby/core/matchdata/element_reference_spec.rb87
-rw-r--r--spec/ruby/core/matchdata/end_spec.rb104
-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.rb23
-rw-r--r--spec/ruby/core/matchdata/length_spec.rb6
-rw-r--r--spec/ruby/core/matchdata/named_captures_spec.rb15
-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.rb24
-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.rb25
-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.rb21
-rw-r--r--spec/ruby/core/math/acos_spec.rb56
-rw-r--r--spec/ruby/core/math/acosh_spec.rb41
-rw-r--r--spec/ruby/core/math/asin_spec.rb48
-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.rb54
-rw-r--r--spec/ruby/core/math/log10_spec.rb43
-rw-r--r--spec/ruby/core/math/log2_spec.rb41
-rw-r--r--spec/ruby/core/math/log_spec.rb57
-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/case_compare_spec.rb9
-rw-r--r--spec/ruby/core/method/clone_spec.rb14
-rw-r--r--spec/ruby/core/method/compose_spec.rb101
-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.rb210
-rw-r--r--spec/ruby/core/method/hash_spec.rb15
-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/original_name_spec.rb22
-rw-r--r--spec/ruby/core/method/owner_spec.rb26
-rw-r--r--spec/ruby/core/method/parameters_spec.rb261
-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.rb104
-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.rb75
-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.rb155
-rw-r--r--spec/ruby/core/module/attr_writer_spec.rb71
-rw-r--r--spec/ruby/core/module/autoload_spec.rb915
-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.rb229
-rw-r--r--spec/ruby/core/module/const_missing_spec.rb36
-rw-r--r--spec/ruby/core/module/const_set_spec.rb133
-rw-r--r--spec/ruby/core/module/constants_spec.rb91
-rw-r--r--spec/ruby/core/module/define_method_spec.rb678
-rw-r--r--spec/ruby/core/module/define_singleton_method_spec.rb15
-rw-r--r--spec/ruby/core/module/deprecate_constant_spec.rb50
-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.rb70
-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_callback.rb2
-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_during_autoload.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_during_require.rb4
-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_exception.rb3
-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_nested.rb8
-rw-r--r--spec/ruby/core/module/fixtures/autoload_never_set.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_o.rb2
-rw-r--r--spec/ruby/core/module/fixtures/autoload_overridden.rb3
-rw-r--r--spec/ruby/core/module/fixtures/autoload_r.rb4
-rw-r--r--spec/ruby/core/module/fixtures/autoload_raise.rb2
-rw-r--r--spec/ruby/core/module/fixtures/autoload_required_directly.rb7
-rw-r--r--spec/ruby/core/module/fixtures/autoload_required_directly_nested.rb1
-rw-r--r--spec/ruby/core/module/fixtures/autoload_s.rb5
-rw-r--r--spec/ruby/core/module/fixtures/autoload_self_during_require.rb5
-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.rb614
-rw-r--r--spec/ruby/core/module/fixtures/constant_unicode.rb5
-rw-r--r--spec/ruby/core/module/fixtures/constants_autoload.rb6
-rw-r--r--spec/ruby/core/module/fixtures/constants_autoload_a.rb2
-rw-r--r--spec/ruby/core/module/fixtures/constants_autoload_b.rb2
-rw-r--r--spec/ruby/core/module/fixtures/constants_autoload_c.rb3
-rw-r--r--spec/ruby/core/module/fixtures/constants_autoload_d.rb4
-rw-r--r--spec/ruby/core/module/fixtures/module.rb4
-rw-r--r--spec/ruby/core/module/fixtures/multi/foo.rb6
-rw-r--r--spec/ruby/core/module/fixtures/multi/foo/bar_baz.rb11
-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.rb258
-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.rb18
-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.rb100
-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.rb128
-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.rb78
-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.rb122
-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.rb122
-rw-r--r--spec/ruby/core/module/protected_spec.rb55
-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.rb782
-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.rb152
-rw-r--r--spec/ruby/core/module/singleton_class_spec.rb27
-rw-r--r--spec/ruby/core/module/to_s_spec.rb45
-rw-r--r--spec/ruby/core/module/undef_method_spec.rb188
-rw-r--r--spec/ruby/core/module/using_spec.rb287
-rw-r--r--spec/ruby/core/mutex/lock_spec.rb34
-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.rb66
-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.rb7
-rw-r--r--spec/ruby/core/nil/inspect_spec.rb7
-rw-r--r--spec/ruby/core/nil/match_spec.rb19
-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.rb17
-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.rb6
-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.rb59
-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.rb8
-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.rb8
-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.rb41
-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.rb50
-rw-r--r--spec/ruby/core/numeric/positive_spec.rb41
-rw-r--r--spec/ruby/core/numeric/quo_spec.rb55
-rw-r--r--spec/ruby/core/numeric/real_spec.rb37
-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/arg.rb38
-rw-r--r--spec/ruby/core/numeric/shared/conj.rb20
-rw-r--r--spec/ruby/core/numeric/shared/imag.rb26
-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.rb433
-rw-r--r--spec/ruby/core/numeric/singleton_method_added_spec.rb41
-rw-r--r--spec/ruby/core/numeric/step_spec.rb200
-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.rb68
-rw-r--r--spec/ruby/core/objectspace/each_object_spec.rb213
-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.rb43
-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/compose_spec.rb110
-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.rb27
-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/proc_aref.rb9
-rw-r--r--spec/ruby/core/proc/fixtures/proc_aref_frozen.rb10
-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.rb226
-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.rb29
-rw-r--r--spec/ruby/core/proc/shared/compose.rb47
-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.rb57
-rw-r--r--spec/ruby/core/proc/source_location_spec.rb86
-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/clock_getres_spec.rb61
-rw-r--r--spec/ruby/core/process/clock_gettime_spec.rb137
-rw-r--r--spec/ruby/core/process/constants_spec.rb63
-rw-r--r--spec/ruby/core/process/daemon_spec.rb115
-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.rb46
-rw-r--r--spec/ruby/core/process/exec_spec.rb247
-rw-r--r--spec/ruby/core/process/exit_spec.rb10
-rw-r--r--spec/ruby/core/process/fixtures/clocks.rb60
-rw-r--r--spec/ruby/core/process/fixtures/common.rb88
-rw-r--r--spec/ruby/core/process/fixtures/daemon.rb111
-rw-r--r--spec/ruby/core/process/fixtures/in.txt1
-rw-r--r--spec/ruby/core/process/fixtures/kill.rb45
-rw-r--r--spec/ruby/core/process/fixtures/map_fd.rb9
-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.rb63
-rw-r--r--spec/ruby/core/process/initgroups_spec.rb22
-rw-r--r--spec/ruby/core/process/kill_spec.rb132
-rw-r--r--spec/ruby/core/process/last_status_spec.rb20
-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.rb9
-rw-r--r--spec/ruby/core/process/set_proctitle_spec.rb23
-rw-r--r--spec/ruby/core/process/setpgid_spec.rb29
-rw-r--r--spec/ruby/core/process/setpgrp_spec.rb37
-rw-r--r--spec/ruby/core/process/setpriority_spec.rb60
-rw-r--r--spec/ruby/core/process/setrlimit_spec.rb232
-rw-r--r--spec/ruby/core/process/setsid_spec.rb16
-rw-r--r--spec/ruby/core/process/spawn_spec.rb712
-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.rb15
-rw-r--r--spec/ruby/core/process/status/exited_spec.rb37
-rw-r--r--spec/ruby/core/process/status/exitstatus_spec.rb25
-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.rb43
-rw-r--r--spec/ruby/core/process/status/to_i_spec.rb13
-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.rb30
-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.rb57
-rw-r--r--spec/ruby/core/process/wait2_spec.rb36
-rw-r--r--spec/ruby/core/process/wait_spec.rb92
-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.rb13
-rw-r--r--spec/ruby/core/queue/append_spec.rb6
-rw-r--r--spec/ruby/core/queue/clear_spec.rb6
-rw-r--r--spec/ruby/core/queue/close_spec.rb6
-rw-r--r--spec/ruby/core/queue/closed_spec.rb6
-rw-r--r--spec/ruby/core/queue/deq_spec.rb6
-rw-r--r--spec/ruby/core/queue/empty_spec.rb6
-rw-r--r--spec/ruby/core/queue/enq_spec.rb6
-rw-r--r--spec/ruby/core/queue/length_spec.rb6
-rw-r--r--spec/ruby/core/queue/num_waiting_spec.rb6
-rw-r--r--spec/ruby/core/queue/pop_spec.rb6
-rw-r--r--spec/ruby/core/queue/push_spec.rb6
-rw-r--r--spec/ruby/core/queue/shift_spec.rb6
-rw-r--r--spec/ruby/core/queue/size_spec.rb6
-rw-r--r--spec/ruby/core/random/bytes_spec.rb32
-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/fixtures/classes.rb15
-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.rb219
-rw-r--r--spec/ruby/core/random/random_number_spec.rb10
-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/bytes.rb17
-rw-r--r--spec/ruby/core/random/shared/rand.rb9
-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.rb28
-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.rb90
-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.rb28
-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.rb87
-rw-r--r--spec/ruby/core/range/percent_spec.rb18
-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.rb153
-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.rb397
-rw-r--r--spec/ruby/core/range/to_a_spec.rb22
-rw-r--r--spec/ruby/core/range/to_s_spec.rb27
-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.rb22
-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.rb19
-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.rb12
-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.rb7
-rw-r--r--spec/ruby/core/rational/modulo_spec.rb5
-rw-r--r--spec/ruby/core/rational/multiply_spec.rb19
-rw-r--r--spec/ruby/core/rational/numerator_spec.rb5
-rw-r--r--spec/ruby/core/rational/plus_spec.rb18
-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.rb6
-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.rb15
-rw-r--r--spec/ruby/core/regexp/encoding_spec.rb62
-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.rb146
-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.rb27
-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.rb505
-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/fixtures/trap_all.rb15
-rw-r--r--spec/ruby/core/signal/list_spec.rb68
-rw-r--r--spec/ruby/core/signal/signame_spec.rb22
-rw-r--r--spec/ruby/core/signal/trap_spec.rb182
-rw-r--r--spec/ruby/core/sizedqueue/append_spec.rb11
-rw-r--r--spec/ruby/core/sizedqueue/clear_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/close_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/closed_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/deq_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/empty_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/enq_spec.rb11
-rw-r--r--spec/ruby/core/sizedqueue/length_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/max_spec.rb10
-rw-r--r--spec/ruby/core/sizedqueue/new_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/num_waiting_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/pop_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/push_spec.rb11
-rw-r--r--spec/ruby/core/sizedqueue/shift_spec.rb6
-rw-r--r--spec/ruby/core/sizedqueue/size_spec.rb6
-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.rb83
-rw-r--r--spec/ruby/core/string/b_spec.rb24
-rw-r--r--spec/ruby/core/string/bytes_spec.rb55
-rw-r--r--spec/ruby/core/string/bytesize_spec.rb33
-rw-r--r--spec/ruby/core/string/byteslice_spec.rb27
-rw-r--r--spec/ruby/core/string/capitalize_spec.rb187
-rw-r--r--spec/ruby/core/string/case_compare_spec.rb8
-rw-r--r--spec/ruby/core/string/casecmp_spec.rb210
-rw-r--r--spec/ruby/core/string/center_spec.rb135
-rw-r--r--spec/ruby/core/string/chars_spec.rb10
-rw-r--r--spec/ruby/core/string/chomp_spec.rb407
-rw-r--r--spec/ruby/core/string/chop_spec.rb126
-rw-r--r--spec/ruby/core/string/chr_spec.rb42
-rw-r--r--spec/ruby/core/string/clear_spec.rb37
-rw-r--r--spec/ruby/core/string/clone_spec.rb57
-rw-r--r--spec/ruby/core/string/codepoints_spec.rb18
-rw-r--r--spec/ruby/core/string/comparison_spec.rb108
-rw-r--r--spec/ruby/core/string/concat_spec.rb26
-rw-r--r--spec/ruby/core/string/count_spec.rb105
-rw-r--r--spec/ruby/core/string/crypt_spec.rb122
-rw-r--r--spec/ruby/core/string/delete_prefix_spec.rb83
-rw-r--r--spec/ruby/core/string/delete_spec.rb121
-rw-r--r--spec/ruby/core/string/delete_suffix_spec.rb83
-rw-r--r--spec/ruby/core/string/downcase_spec.rb182
-rw-r--r--spec/ruby/core/string/dump_spec.rb402
-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.rb8
-rw-r--r--spec/ruby/core/string/each_grapheme_cluster_spec.rb11
-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.rb606
-rw-r--r--spec/ruby/core/string/empty_spec.rb12
-rw-r--r--spec/ruby/core/string/encode_spec.rb163
-rw-r--r--spec/ruby/core/string/encoding_spec.rb187
-rw-r--r--spec/ruby/core/string/end_with_spec.rb56
-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.rb71
-rw-r--r--spec/ruby/core/string/freeze_spec.rb17
-rw-r--r--spec/ruby/core/string/getbyte_spec.rb69
-rw-r--r--spec/ruby/core/string/grapheme_clusters_spec.rb15
-rw-r--r--spec/ruby/core/string/gsub_spec.rb708
-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.rb312
-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.rb502
-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.rb20
-rw-r--r--spec/ruby/core/string/ljust_spec.rb118
-rw-r--r--spec/ruby/core/string/lstrip_spec.rb52
-rw-r--r--spec/ruby/core/string/match_spec.rb167
-rw-r--r--spec/ruby/core/string/modulo_spec.rb815
-rw-r--r--spec/ruby/core/string/multiply_spec.rb7
-rw-r--r--spec/ruby/core/string/new_spec.rb61
-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.rb28
-rw-r--r--spec/ruby/core/string/partition_spec.rb38
-rw-r--r--spec/ruby/core/string/percent_spec.rb13
-rw-r--r--spec/ruby/core/string/plus_spec.rb49
-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.rb50
-rw-r--r--spec/ruby/core/string/rindex_spec.rb366
-rw-r--r--spec/ruby/core/string/rjust_spec.rb118
-rw-r--r--spec/ruby/core/string/rpartition_spec.rb33
-rw-r--r--spec/ruby/core/string/rstrip_spec.rb54
-rw-r--r--spec/ruby/core/string/scan_spec.rb201
-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.rb62
-rw-r--r--spec/ruby/core/string/shared/concat.rb162
-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.rb178
-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/grapheme_clusters.rb16
-rw-r--r--spec/ruby/core/string/shared/length.rb26
-rw-r--r--spec/ruby/core/string/shared/replace.rb77
-rw-r--r--spec/ruby/core/string/shared/slice.rb569
-rw-r--r--spec/ruby/core/string/shared/succ.rb90
-rw-r--r--spec/ruby/core/string/shared/to_a.rb9
-rw-r--r--spec/ruby/core/string/shared/to_s.rb20
-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.rb433
-rw-r--r--spec/ruby/core/string/squeeze_spec.rb115
-rw-r--r--spec/ruby/core/string/start_with_spec.rb76
-rw-r--r--spec/ruby/core/string/string_spec.rb7
-rw-r--r--spec/ruby/core/string/strip_spec.rb62
-rw-r--r--spec/ruby/core/string/sub_spec.rb583
-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.rb173
-rw-r--r--spec/ruby/core/string/to_c_spec.rb99
-rw-r--r--spec/ruby/core/string/to_f_spec.rb70
-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.rb74
-rw-r--r--spec/ruby/core/string/undump_spec.rb453
-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.rb66
-rw-r--r--spec/ruby/core/string/unpack/at_spec.rb29
-rw-r--r--spec/ruby/core/string/unpack/b_spec.rb193
-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.rb135
-rw-r--r--spec/ruby/core/string/unpack/i_spec.rb152
-rw-r--r--spec/ruby/core/string/unpack/j_spec.rb272
-rw-r--r--spec/ruby/core/string/unpack/l_spec.rb265
-rw-r--r--spec/ruby/core/string/unpack/m_spec.rb173
-rw-r--r--spec/ruby/core/string/unpack/n_spec.rb18
-rw-r--r--spec/ruby/core/string/unpack/p_spec.rb56
-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/taint.rb83
-rw-r--r--spec/ruby/core/string/unpack/shared/unicode.rb60
-rw-r--r--spec/ruby/core/string/unpack/u_spec.rb97
-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.rb23
-rw-r--r--spec/ruby/core/string/unpack1_spec.rb10
-rw-r--r--spec/ruby/core/string/upcase_spec.rb168
-rw-r--r--spec/ruby/core/string/uplus_spec.rb22
-rw-r--r--spec/ruby/core/string/upto_spec.rb98
-rw-r--r--spec/ruby/core/string/valid_encoding_spec.rb127
-rw-r--r--spec/ruby/core/struct/clone_spec.rb7
-rw-r--r--spec/ruby/core/struct/dig_spec.rb42
-rw-r--r--spec/ruby/core/struct/dup_spec.rb23
-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/filter_spec.rb12
-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.rb12
-rw-r--r--spec/ruby/core/struct/instance_variable_get_spec.rb16
-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.rb217
-rw-r--r--spec/ruby/core/struct/select_spec.rb10
-rw-r--r--spec/ruby/core/struct/shared/accessor.rb7
-rw-r--r--spec/ruby/core/struct/shared/dup.rb9
-rw-r--r--spec/ruby/core/struct/shared/equal_value.rb37
-rw-r--r--spec/ruby/core/struct/shared/inspect.rb5
-rw-r--r--spec/ruby/core/struct/shared/select.rb26
-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/to_a_spec.rb12
-rw-r--r--spec/ruby/core/struct/to_h_spec.rb58
-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.rb41
-rw-r--r--spec/ruby/core/symbol/case_compare_spec.rb11
-rw-r--r--spec/ruby/core/symbol/casecmp_spec.rb144
-rw-r--r--spec/ruby/core/symbol/comparison_spec.rb51
-rw-r--r--spec/ruby/core/symbol/downcase_spec.rb25
-rw-r--r--spec/ruby/core/symbol/dup_spec.rb7
-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.rb60
-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.rb282
-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.rb29
-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.rb21
-rw-r--r--spec/ruby/core/systemexit/initialize_spec.rb26
-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.rb61
-rw-r--r--spec/ruby/core/thread/backtrace/location/base_label_spec.rb22
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/absolute_path.rb4
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/absolute_path_method_added.rb10
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/classes.rb35
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/locations_in_main.rb5
-rw-r--r--spec/ruby/core/thread/backtrace/location/fixtures/locations_in_required.rb3
-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.rb37
-rw-r--r--spec/ruby/core/thread/backtrace/location/lineno_spec.rb13
-rw-r--r--spec/ruby/core/thread/backtrace/location/path_spec.rb89
-rw-r--r--spec/ruby/core/thread/backtrace/location/to_s_spec.rb13
-rw-r--r--spec/ruby/core/thread/backtrace_locations_spec.rb33
-rw-r--r--spec/ruby/core/thread/backtrace_spec.rb35
-rw-r--r--spec/ruby/core/thread/current_spec.rb31
-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.rb47
-rw-r--r--spec/ruby/core/thread/exit_spec.rb15
-rw-r--r--spec/ruby/core/thread/fetch_spec.rb38
-rw-r--r--spec/ruby/core/thread/fixtures/classes.rb297
-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.rb6
-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.rb25
-rw-r--r--spec/ruby/core/thread/list_spec.rb55
-rw-r--r--spec/ruby/core/thread/main_spec.rb10
-rw-r--r--spec/ruby/core/thread/name_spec.rb54
-rw-r--r--spec/ruby/core/thread/new_spec.rb83
-rw-r--r--spec/ruby/core/thread/pass_spec.rb8
-rw-r--r--spec/ruby/core/thread/priority_spec.rb72
-rw-r--r--spec/ruby/core/thread/raise_spec.rb208
-rw-r--r--spec/ruby/core/thread/report_on_exception_spec.rb116
-rw-r--r--spec/ruby/core/thread/run_spec.rb8
-rw-r--r--spec/ruby/core/thread/set_trace_func_spec.rb5
-rw-r--r--spec/ruby/core/thread/shared/exit.rb180
-rw-r--r--spec/ruby/core/thread/shared/start.rb41
-rw-r--r--spec/ruby/core/thread/shared/to_s.rb53
-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/to_s_spec.rb8
-rw-r--r--spec/ruby/core/thread/value_spec.rb31
-rw-r--r--spec/ruby/core/thread/wakeup_spec.rb7
-rw-r--r--spec/ruby/core/threadgroup/add_spec.rb39
-rw-r--r--spec/ruby/core/threadgroup/default_spec.rb11
-rw-r--r--spec/ruby/core/threadgroup/enclose_spec.rb24
-rw-r--r--spec/ruby/core/threadgroup/enclosed_spec.rb14
-rw-r--r--spec/ruby/core/threadgroup/list_spec.rb23
-rw-r--r--spec/ruby/core/time/_dump_spec.rb55
-rw-r--r--spec/ruby/core/time/_load_spec.rb52
-rw-r--r--spec/ruby/core/time/asctime_spec.rb6
-rw-r--r--spec/ruby/core/time/at_spec.rb254
-rw-r--r--spec/ruby/core/time/ceil_spec.rb45
-rw-r--r--spec/ruby/core/time/comparison_spec.rb104
-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.rb106
-rw-r--r--spec/ruby/core/time/floor_spec.rb37
-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.rb169
-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.rb123
-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.rb333
-rw-r--r--spec/ruby/core/time/now_spec.rb6
-rw-r--r--spec/ruby/core/time/nsec_spec.rb31
-rw-r--r--spec/ruby/core/time/plus_spec.rb120
-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.rb70
-rw-r--r--spec/ruby/core/time/shared/gmt_offset.rb59
-rw-r--r--spec/ruby/core/time/shared/gmtime.rb33
-rw-r--r--spec/ruby/core/time/shared/inspect.rb21
-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.rb35
-rw-r--r--spec/ruby/core/time/shared/time_params.rb262
-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.rb39
-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.rb43
-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.rb17
-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.rb480
-rw-r--r--spec/ruby/core/tracepoint/enabled_spec.rb14
-rw-r--r--spec/ruby/core/tracepoint/eval_script_spec.rb24
-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.rb28
-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.rb67
-rw-r--r--spec/ruby/core/tracepoint/parameters_spec.rb23
-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.rb20
-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.rb7
-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.rb17
-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_call_spec.rb52
-rw-r--r--spec/ruby/core/unboundmethod/bind_spec.rb61
-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.rb87
-rw-r--r--spec/ruby/core/unboundmethod/hash_spec.rb15
-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/original_name_spec.rb22
-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.rb66
-rw-r--r--spec/ruby/default.mspec49
-rw-r--r--spec/ruby/fixtures/basicobject/method_missing.rb55
-rw-r--r--spec/ruby/fixtures/class.rb138
-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_fixture_and__FILE__.rb1
-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.rb9
-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.rb14
-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.rb258
-rw-r--r--spec/ruby/language/and_spec.rb80
-rw-r--r--spec/ruby/language/array_spec.rb162
-rw-r--r--spec/ruby/language/block_spec.rb933
-rw-r--r--spec/ruby/language/break_spec.rb365
-rw-r--r--spec/ruby/language/case_spec.rb427
-rw-r--r--spec/ruby/language/class_spec.rb332
-rw-r--r--spec/ruby/language/class_variable_spec.rb84
-rw-r--r--spec/ruby/language/constants_spec.rb745
-rw-r--r--spec/ruby/language/def_spec.rb776
-rw-r--r--spec/ruby/language/defined_spec.rb1130
-rw-r--r--spec/ruby/language/encoding_spec.rb36
-rw-r--r--spec/ruby/language/ensure_spec.rb333
-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.rb32
-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.rb61
-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/bytes_magic_comment.rb2
-rw-r--r--spec/ruby/language/fixtures/case_magic_comment.rb2
-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.rb14
-rw-r--r--spec/ruby/language/fixtures/defined.rb303
-rw-r--r--spec/ruby/language/fixtures/dollar_zero.rb6
-rw-r--r--spec/ruby/language/fixtures/emacs_magic_comment.rb2
-rw-r--r--spec/ruby/language/fixtures/ensure.rb121
-rw-r--r--spec/ruby/language/fixtures/file.rb1
-rw-r--r--spec/ruby/language/fixtures/for_scope.rb15
-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_binary.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/magic_comment.rb2
-rw-r--r--spec/ruby/language/fixtures/match_operators.rb9
-rw-r--r--spec/ruby/language/fixtures/metaclass.rb33
-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/no_magic_comment.rb1
-rw-r--r--spec/ruby/language/fixtures/precedence.rb16
-rw-r--r--spec/ruby/language/fixtures/print_magic_comment_result_at_exit.rb3
-rw-r--r--spec/ruby/language/fixtures/private.rb59
-rw-r--r--spec/ruby/language/fixtures/rescue.rb67
-rw-r--r--spec/ruby/language/fixtures/return.rb139
-rw-r--r--spec/ruby/language/fixtures/second_line_magic_comment.rb3
-rw-r--r--spec/ruby/language/fixtures/second_token_magic_comment.rb2
-rw-r--r--spec/ruby/language/fixtures/send.rb141
-rwxr-xr-xspec/ruby/language/fixtures/shebang_magic_comment.rb3
-rw-r--r--spec/ruby/language/fixtures/squiggly_heredoc.rb39
-rw-r--r--spec/ruby/language/fixtures/super.rb696
-rw-r--r--spec/ruby/language/fixtures/utf16-be-nobom.rbbin68 -> 0 bytes-rw-r--r--spec/ruby/language/fixtures/utf16-le-nobom.rbbin69 -> 0 bytes-rw-r--r--spec/ruby/language/fixtures/utf8-bom.rb2
-rw-r--r--spec/ruby/language/fixtures/utf8-nobom.rb2
-rw-r--r--spec/ruby/language/fixtures/variables.rb85
-rw-r--r--spec/ruby/language/fixtures/vim_magic_comment.rb2
-rw-r--r--spec/ruby/language/fixtures/yield.rb41
-rw-r--r--spec/ruby/language/for_spec.rb182
-rw-r--r--spec/ruby/language/hash_spec.rb163
-rw-r--r--spec/ruby/language/heredoc_spec.rb91
-rw-r--r--spec/ruby/language/if_spec.rb371
-rw-r--r--spec/ruby/language/lambda_spec.rb623
-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.rb92
-rw-r--r--spec/ruby/language/match_spec.rb81
-rw-r--r--spec/ruby/language/metaclass_spec.rb143
-rw-r--r--spec/ruby/language/method_spec.rb1487
-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.rb353
-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.rb447
-rw-r--r--spec/ruby/language/predefined/data_spec.rb48
-rw-r--r--spec/ruby/language/predefined/fixtures/data1.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/data2.rb3
-rw-r--r--spec/ruby/language/predefined/fixtures/data3.rb6
-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_offset.rb12
-rw-r--r--spec/ruby/language/predefined/fixtures/data_only.rb2
-rw-r--r--spec/ruby/language/predefined/fixtures/empty_data.rb3
-rw-r--r--spec/ruby/language/predefined/fixtures/print_data.rb3
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_dynamic.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_dynamic_required.rb2
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_id.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_id_required.rb1
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_required_before.rb2
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_values.rb9
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_variables.rb4
-rw-r--r--spec/ruby/language/predefined/fixtures/toplevel_binding_variables_required.rb2
-rw-r--r--spec/ruby/language/predefined/toplevel_binding_spec.rb34
-rw-r--r--spec/ruby/language/predefined_spec.rb1234
-rw-r--r--spec/ruby/language/private_spec.rb67
-rw-r--r--spec/ruby/language/proc_spec.rb220
-rw-r--r--spec/ruby/language/range_spec.rb19
-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.rb53
-rw-r--r--spec/ruby/language/regexp/character_classes_spec.rb631
-rw-r--r--spec/ruby/language/regexp/encoding_spec.rb119
-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.rb115
-rw-r--r--spec/ruby/language/regexp/repetition_spec.rb48
-rw-r--r--spec/ruby/language/regexp_spec.rb177
-rw-r--r--spec/ruby/language/rescue_spec.rb485
-rw-r--r--spec/ruby/language/retry_spec.rb52
-rw-r--r--spec/ruby/language/return_spec.rb511
-rw-r--r--spec/ruby/language/safe_navigator_spec.rb99
-rw-r--r--spec/ruby/language/safe_spec.rb138
-rw-r--r--spec/ruby/language/send_spec.rb562
-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/source_encoding_spec.rb61
-rw-r--r--spec/ruby/language/string_spec.rb289
-rw-r--r--spec/ruby/language/super_spec.rb388
-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.rb788
-rw-r--r--spec/ruby/language/while_spec.rb344
-rw-r--r--spec/ruby/language/yield_spec.rb187
-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.rb25
-rw-r--r--spec/ruby/library/base64/encode64_spec.rb23
-rw-r--r--spec/ruby/library/base64/strict_decode64_spec.rb41
-rw-r--r--spec/ruby/library/base64/strict_encode64_spec.rb19
-rw-r--r--spec/ruby/library/base64/urlsafe_decode64_spec.rb19
-rw-r--r--spec/ruby/library/base64/urlsafe_encode64_spec.rb20
-rw-r--r--spec/ruby/library/bigdecimal/BigDecimal_spec.rb257
-rw-r--r--spec/ruby/library/bigdecimal/abs_spec.rb50
-rw-r--r--spec/ruby/library/bigdecimal/add_spec.rb193
-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/clone_spec.rb6
-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/constants_spec.rb72
-rw-r--r--spec/ruby/library/bigdecimal/div_spec.rb110
-rw-r--r--spec/ruby/library/bigdecimal/divide_spec.rb17
-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/dup_spec.rb6
-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.rb34
-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.rb96
-rw-r--r--spec/ruby/library/bigdecimal/gte_spec.rb100
-rw-r--r--spec/ruby/library/bigdecimal/hash_spec.rb30
-rw-r--r--spec/ruby/library/bigdecimal/infinite_spec.rb32
-rw-r--r--spec/ruby/library/bigdecimal/inspect_spec.rb30
-rw-r--r--spec/ruby/library/bigdecimal/limit_spec.rb55
-rw-r--r--spec/ruby/library/bigdecimal/lt_spec.rb94
-rw-r--r--spec/ruby/library/bigdecimal/lte_spec.rb100
-rw-r--r--spec/ruby/library/bigdecimal/minus_spec.rb66
-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.rb32
-rw-r--r--spec/ruby/library/bigdecimal/multiply_spec.rb41
-rw-r--r--spec/ruby/library/bigdecimal/nan_spec.rb23
-rw-r--r--spec/ruby/library/bigdecimal/nonzero_spec.rb29
-rw-r--r--spec/ruby/library/bigdecimal/plus_spec.rb54
-rw-r--r--spec/ruby/library/bigdecimal/power_spec.rb6
-rw-r--r--spec/ruby/library/bigdecimal/precs_spec.rb48
-rw-r--r--spec/ruby/library/bigdecimal/quo_spec.rb12
-rw-r--r--spec/ruby/library/bigdecimal/remainder_spec.rb92
-rw-r--r--spec/ruby/library/bigdecimal/round_spec.rb234
-rw-r--r--spec/ruby/library/bigdecimal/shared/clone.rb24
-rw-r--r--spec/ruby/library/bigdecimal/shared/eql.rb61
-rw-r--r--spec/ruby/library/bigdecimal/shared/modulo.rb125
-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.rb67
-rw-r--r--spec/ruby/library/bigdecimal/shared/to_int.rb16
-rw-r--r--spec/ruby/library/bigdecimal/sign_spec.rb46
-rw-r--r--spec/ruby/library/bigdecimal/split_spec.rb86
-rw-r--r--spec/ruby/library/bigdecimal/sqrt_spec.rb112
-rw-r--r--spec/ruby/library/bigdecimal/sub_spec.rb70
-rw-r--r--spec/ruby/library/bigdecimal/to_d_spec.rb10
-rw-r--r--spec/ruby/library/bigdecimal/to_f_spec.rb54
-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.rb80
-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.rb17
-rw-r--r--spec/ruby/library/bigdecimal/util_spec.rb42
-rw-r--r--spec/ruby/library/bigdecimal/zero_spec.rb27
-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.rb26
-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/cmath/math/acos_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/acosh_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/asin_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/asinh_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/atan2_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/atan_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/atanh_spec.rb20
-rw-r--r--spec/ruby/library/cmath/math/cos_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/cosh_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/exp_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/fixtures/classes.rb4
-rw-r--r--spec/ruby/library/cmath/math/log10_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/log_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/shared/acos.rb41
-rw-r--r--spec/ruby/library/cmath/math/shared/acosh.rb37
-rw-r--r--spec/ruby/library/cmath/math/shared/asin.rb47
-rw-r--r--spec/ruby/library/cmath/math/shared/asinh.rb32
-rw-r--r--spec/ruby/library/cmath/math/shared/atan.rb32
-rw-r--r--spec/ruby/library/cmath/math/shared/atan2.rb34
-rw-r--r--spec/ruby/library/cmath/math/shared/atanh.rb30
-rw-r--r--spec/ruby/library/cmath/math/shared/cos.rb30
-rw-r--r--spec/ruby/library/cmath/math/shared/cosh.rb28
-rw-r--r--spec/ruby/library/cmath/math/shared/exp.rb28
-rw-r--r--spec/ruby/library/cmath/math/shared/log.rb39
-rw-r--r--spec/ruby/library/cmath/math/shared/log10.rb41
-rw-r--r--spec/ruby/library/cmath/math/shared/sin.rb30
-rw-r--r--spec/ruby/library/cmath/math/shared/sinh.rb28
-rw-r--r--spec/ruby/library/cmath/math/shared/sqrt.rb34
-rw-r--r--spec/ruby/library/cmath/math/shared/tan.rb28
-rw-r--r--spec/ruby/library/cmath/math/shared/tanh.rb32
-rw-r--r--spec/ruby/library/cmath/math/sin_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/sinh_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/sqrt_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/tan_spec.rb18
-rw-r--r--spec/ruby/library/cmath/math/tanh_spec.rb18
-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.rb104
-rw-r--r--spec/ruby/library/conditionvariable/wait_spec.rb132
-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/start_coverage.rb3
-rw-r--r--spec/ruby/library/coverage/peek_result_spec.rb64
-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.rb19
-rw-r--r--spec/ruby/library/csv/open_spec.rb6
-rw-r--r--spec/ruby/library/csv/parse_spec.rb93
-rw-r--r--spec/ruby/library/csv/read_spec.rb6
-rw-r--r--spec/ruby/library/csv/readlines_spec.rb35
-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.rb17
-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.rb15
-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/iso8601_spec.rb44
-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.rb23
-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.rb7
-rw-r--r--spec/ruby/library/date/ordinal_to_jd_spec.rb6
-rw-r--r--spec/ruby/library/date/parse_spec.rb142
-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/rfc3339_spec.rb13
-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.rb32
-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.rb9
-rw-r--r--spec/ruby/library/date/valid_commercial_spec.rb8
-rw-r--r--spec/ruby/library/date/valid_date_spec.rb7
-rw-r--r--spec/ruby/library/date/valid_jd_spec.rb9
-rw-r--r--spec/ruby/library/date/valid_ordinal_spec.rb9
-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/add_spec.rb9
-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/subtract_spec.rb19
-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.rb36
-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.rb25
-rw-r--r--spec/ruby/library/delegate/delegator/tap_spec.rb16
-rw-r--r--spec/ruby/library/delegate/delegator/trust_spec.rb24
-rw-r--r--spec/ruby/library/delegate/delegator/untaint_spec.rb26
-rw-r--r--spec/ruby/library/delegate/delegator/untrust_spec.rb25
-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.rb11
-rw-r--r--spec/ruby/library/digest/md5/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/md5/digest_length_spec.rb11
-rw-r--r--spec/ruby/library/digest/md5/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/md5/equal_spec.rb37
-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.rb11
-rw-r--r--spec/ruby/library/digest/md5/length_spec.rb7
-rw-r--r--spec/ruby/library/digest/md5/reset_spec.rb14
-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.rb7
-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.rb11
-rw-r--r--spec/ruby/library/digest/sha256/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/sha256/digest_length_spec.rb11
-rw-r--r--spec/ruby/library/digest/sha256/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha256/equal_spec.rb36
-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.rb11
-rw-r--r--spec/ruby/library/digest/sha256/length_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha256/reset_spec.rb14
-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.rb7
-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.rb11
-rw-r--r--spec/ruby/library/digest/sha384/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/sha384/digest_length_spec.rb11
-rw-r--r--spec/ruby/library/digest/sha384/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha384/equal_spec.rb36
-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.rb11
-rw-r--r--spec/ruby/library/digest/sha384/length_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha384/reset_spec.rb14
-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.rb7
-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.rb11
-rw-r--r--spec/ruby/library/digest/sha512/digest_bang_spec.rb13
-rw-r--r--spec/ruby/library/digest/sha512/digest_length_spec.rb11
-rw-r--r--spec/ruby/library/digest/sha512/digest_spec.rb32
-rw-r--r--spec/ruby/library/digest/sha512/equal_spec.rb36
-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.rb11
-rw-r--r--spec/ruby/library/digest/sha512/length_spec.rb7
-rw-r--r--spec/ruby/library/digest/sha512/reset_spec.rb14
-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.rb7
-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.rb64
-rw-r--r--spec/ruby/library/erb/filename_spec.rb40
-rw-r--r--spec/ruby/library/erb/fixtures/classes.rb9
-rw-r--r--spec/ruby/library/erb/new_spec.rb148
-rw-r--r--spec/ruby/library/erb/result_spec.rb86
-rw-r--r--spec/ruby/library/erb/run_spec.rb96
-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.rb7
-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.rb7
-rw-r--r--spec/ruby/library/erb/util/url_encode_spec.rb7
-rw-r--r--spec/ruby/library/etc/confstr_spec.rb14
-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.rb76
-rw-r--r--spec/ruby/library/etc/getgrnam_spec.rb30
-rw-r--r--spec/ruby/library/etc/getlogin_spec.rb43
-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.rb27
-rw-r--r--spec/ruby/library/etc/nprocessors_spec.rb9
-rw-r--r--spec/ruby/library/etc/passwd_spec.rb15
-rw-r--r--spec/ruby/library/etc/shared/windows.rb7
-rw-r--r--spec/ruby/library/etc/struct_group_spec.rb35
-rw-r--r--spec/ruby/library/etc/struct_passwd_spec.rb43
-rw-r--r--spec/ruby/library/etc/sysconf_spec.rb22
-rw-r--r--spec/ruby/library/etc/sysconfdir_spec.rb8
-rw-r--r--spec/ruby/library/etc/systmpdir_spec.rb8
-rw-r--r--spec/ruby/library/expect/expect_spec.rb62
-rw-r--r--spec/ruby/library/fiber/alive_spec.rb46
-rw-r--r--spec/ruby/library/fiber/current_spec.rb51
-rw-r--r--spec/ruby/library/fiber/resume_spec.rb12
-rw-r--r--spec/ruby/library/fiber/transfer_spec.rb86
-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.rb44
-rw-r--r--spec/ruby/library/ipaddr/new_spec.rb93
-rw-r--r--spec/ruby/library/ipaddr/operator_spec.rb82
-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.rb31
-rw-r--r--spec/ruby/library/logger/device/new_spec.rb47
-rw-r--r--spec/ruby/library/logger/device/write_spec.rb51
-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.rb118
-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/mathn_spec.rb13
-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/antisymmetric_spec.rb37
-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.rb8
-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.rb54
-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.rb43
-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/mkmf/mkmf_spec.rb7
-rw-r--r--spec/ruby/library/monitor/mon_initialize_spec.rb31
-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.rb8
-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.rb407
-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.rb28
-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.rb67
-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/HTTPClientExcepton_spec.rb14
-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.rb26
-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.rb8
-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.rb24
-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.rb74
-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.rb21
-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.rb8
-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.rb21
-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.rb29
-rw-r--r--spec/ruby/library/net/http/httpresponse/error_type_spec.rb29
-rw-r--r--spec/ruby/library/net/http/httpresponse/exception_type_spec.rb18
-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.rb85
-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.rb29
-rw-r--r--spec/ruby/library/objectspace/memsize_of_spec.rb30
-rw-r--r--spec/ruby/library/objectspace/reachable_objects_from_spec.rb61
-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.rb41
-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.rb49
-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.rb70
-rw-r--r--spec/ruby/library/openstruct/to_s_spec.rb8
-rw-r--r--spec/ruby/library/optionparser/order_spec.rb28
-rw-r--r--spec/ruby/library/optionparser/parse_spec.rb28
-rw-r--r--spec/ruby/library/pathname/absolute_spec.rb22
-rw-r--r--spec/ruby/library/pathname/empty_spec.rb32
-rw-r--r--spec/ruby/library/pathname/equal_value_spec.rb14
-rw-r--r--spec/ruby/library/pathname/hash_spec.rb14
-rw-r--r--spec/ruby/library/pathname/join_spec.rb40
-rw-r--r--spec/ruby/library/pathname/new_spec.rb30
-rw-r--r--spec/ruby/library/pathname/parent_spec.rb18
-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.rb22
-rw-r--r--spec/ruby/library/pathname/root_spec.rb26
-rw-r--r--spec/ruby/library/pathname/sub_spec.rb15
-rw-r--r--spec/ruby/library/pp/pp_spec.rb23
-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/rbconfig/rbconfig_spec.rb48
-rw-r--r--spec/ruby/library/rbconfig/sizeof/limits_spec.rb42
-rw-r--r--spec/ruby/library/rbconfig/sizeof/sizeof_spec.rb30
-rw-r--r--spec/ruby/library/rbconfig/unicode_emoji_version_spec.rb22
-rw-r--r--spec/ruby/library/rbconfig/unicode_version_spec.rb34
-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.rb47
-rw-r--r--spec/ruby/library/readline/history/each_spec.rb31
-rw-r--r--spec/ruby/library/readline/history/element_reference_spec.rb42
-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.rb32
-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.rb32
-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.rb33
-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/fixtures/hosts1
-rw-r--r--spec/ruby/library/resolv/get_address_spec.rb19
-rw-r--r--spec/ruby/library/resolv/get_addresses_spec.rb12
-rw-r--r--spec/ruby/library/resolv/get_name_spec.rb18
-rw-r--r--spec/ruby/library/resolv/get_names_spec.rb11
-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.rb19
-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.rb14
-rw-r--r--spec/ruby/library/rexml/attribute/value_spec.rb14
-rw-r--r--spec/ruby/library/rexml/attribute/write_spec.rb23
-rw-r--r--spec/ruby/library/rexml/attribute/xpath_spec.rb19
-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.rb22
-rw-r--r--spec/ruby/library/rexml/attributes/each_spec.rb23
-rw-r--r--spec/ruby/library/rexml/attributes/element_reference_spec.rb18
-rw-r--r--spec/ruby/library/rexml/attributes/element_set_spec.rb25
-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.rb19
-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.rb23
-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.rb16
-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.rb20
-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.rb20
-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.rb23
-rw-r--r--spec/ruby/library/rexml/text/inspect_spec.rb8
-rw-r--r--spec/ruby/library/rexml/text/new_spec.rb48
-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.rb12
-rw-r--r--spec/ruby/library/rexml/text/to_s_spec.rb17
-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.rb20
-rw-r--r--spec/ruby/library/rexml/text/write_with_substitution_spec.rb33
-rw-r--r--spec/ruby/library/rubygems/gem/bin_path_spec.rb34
-rw-r--r--spec/ruby/library/scanf/io/block_scanf_spec.rb10
-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.rb38
-rw-r--r--spec/ruby/library/scanf/io/shared/block_scanf.rb28
-rw-r--r--spec/ruby/library/scanf/string/block_scanf_spec.rb10
-rw-r--r--spec/ruby/library/scanf/string/scanf_spec.rb56
-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/bytes_spec.rb8
-rw-r--r--spec/ruby/library/securerandom/hex_spec.rb54
-rw-r--r--spec/ruby/library/securerandom/random_bytes_spec.rb53
-rw-r--r--spec/ruby/library/securerandom/random_number_spec.rb97
-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.rb14
-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.rb143
-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/disjoint_spec.rb23
-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.rb33
-rw-r--r--spec/ruby/library/set/exclusion_spec.rb18
-rw-r--r--spec/ruby/library/set/filter_spec.rb8
-rw-r--r--spec/ruby/library/set/fixtures/set_like.rb31
-rw-r--r--spec/ruby/library/set/flatten_merge_spec.rb23
-rw-r--r--spec/ruby/library/set/flatten_spec.rb53
-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.rb48
-rw-r--r--spec/ruby/library/set/inspect_spec.rb7
-rw-r--r--spec/ruby/library/set/intersect_spec.rb23
-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.rb41
-rw-r--r--spec/ruby/library/set/proper_superset_spec.rb41
-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.rb6
-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/select.rb42
-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/filter_spec.rb9
-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.rb7
-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/select.rb35
-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.rb41
-rw-r--r--spec/ruby/library/set/subtract_spec.rb17
-rw-r--r--spec/ruby/library/set/superset_spec.rb41
-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.rb34
-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.rb37
-rw-r--r--spec/ruby/library/socket/addrinfo/bind_spec.rb28
-rw-r--r--spec/ruby/library/socket/addrinfo/canonname_spec.rb27
-rw-r--r--spec/ruby/library/socket/addrinfo/connect_from_spec.rb75
-rw-r--r--spec/ruby/library/socket/addrinfo/connect_spec.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/connect_to_spec.rb75
-rw-r--r--spec/ruby/library/socket/addrinfo/family_addrinfo_spec.rb115
-rw-r--r--spec/ruby/library/socket/addrinfo/foreach_spec.rb9
-rw-r--r--spec/ruby/library/socket/addrinfo/getaddrinfo_spec.rb91
-rw-r--r--spec/ruby/library/socket/addrinfo/getnameinfo_spec.rb40
-rw-r--r--spec/ruby/library/socket/addrinfo/initialize_spec.rb587
-rw-r--r--spec/ruby/library/socket/addrinfo/inspect_sockaddr_spec.rb50
-rw-r--r--spec/ruby/library/socket/addrinfo/inspect_spec.rb65
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_address_spec.rb66
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_port_spec.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_spec.rb64
-rw-r--r--spec/ruby/library/socket/addrinfo/ip_unpack_spec.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_loopback_spec.rb43
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_multicast_spec.rb29
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_private_spec.rb47
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv4_spec.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb23
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_loopback_spec.rb45
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_mc_global_spec.rb20
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_mc_linklocal_spec.rb19
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_mc_nodelocal_spec.rb18
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_mc_orglocal_spec.rb18
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_mc_sitelocal_spec.rb18
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_multicast_spec.rb48
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb23
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_spec.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_to_ipv4_spec.rb71
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_unique_local_spec.rb18
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_unspecified_spec.rb15
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_v4compat_spec.rb20
-rw-r--r--spec/ruby/library/socket/addrinfo/ipv6_v4mapped_spec.rb20
-rw-r--r--spec/ruby/library/socket/addrinfo/listen_spec.rb34
-rw-r--r--spec/ruby/library/socket/addrinfo/marshal_dump_spec.rb84
-rw-r--r--spec/ruby/library/socket/addrinfo/marshal_load_spec.rb35
-rw-r--r--spec/ruby/library/socket/addrinfo/pfamily_spec.rb43
-rw-r--r--spec/ruby/library/socket/addrinfo/protocol_spec.rb24
-rw-r--r--spec/ruby/library/socket/addrinfo/shared/to_sockaddr.rb51
-rw-r--r--spec/ruby/library/socket/addrinfo/socktype_spec.rb23
-rw-r--r--spec/ruby/library/socket/addrinfo/tcp_spec.rb34
-rw-r--r--spec/ruby/library/socket/addrinfo/to_s_spec.rb6
-rw-r--r--spec/ruby/library/socket/addrinfo/to_sockaddr_spec.rb6
-rw-r--r--spec/ruby/library/socket/addrinfo/udp_spec.rb36
-rw-r--r--spec/ruby/library/socket/addrinfo/unix_path_spec.rb37
-rw-r--r--spec/ruby/library/socket/addrinfo/unix_spec.rb71
-rw-r--r--spec/ruby/library/socket/ancillarydata/cmsg_is_spec.rb33
-rw-r--r--spec/ruby/library/socket/ancillarydata/data_spec.rb9
-rw-r--r--spec/ruby/library/socket/ancillarydata/family_spec.rb9
-rw-r--r--spec/ruby/library/socket/ancillarydata/initialize_spec.rb284
-rw-r--r--spec/ruby/library/socket/ancillarydata/int_spec.rb43
-rw-r--r--spec/ruby/library/socket/ancillarydata/ip_pktinfo_spec.rb145
-rw-r--r--spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_addr_spec.rb11
-rw-r--r--spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_ifindex_spec.rb11
-rw-r--r--spec/ruby/library/socket/ancillarydata/ipv6_pktinfo_spec.rb89
-rw-r--r--spec/ruby/library/socket/ancillarydata/level_spec.rb9
-rw-r--r--spec/ruby/library/socket/ancillarydata/type_spec.rb9
-rw-r--r--spec/ruby/library/socket/ancillarydata/unix_rights_spec.rb61
-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/connect_address_spec.rb154
-rw-r--r--spec/ruby/library/socket/basicsocket/do_not_reverse_lookup_spec.rb103
-rw-r--r--spec/ruby/library/socket/basicsocket/for_fd_spec.rb38
-rw-r--r--spec/ruby/library/socket/basicsocket/getpeereid_spec.rb36
-rw-r--r--spec/ruby/library/socket/basicsocket/getpeername_spec.rb25
-rw-r--r--spec/ruby/library/socket/basicsocket/getsockname_spec.rb28
-rw-r--r--spec/ruby/library/socket/basicsocket/getsockopt_spec.rb188
-rw-r--r--spec/ruby/library/socket/basicsocket/ioctl_spec.rb42
-rw-r--r--spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb46
-rw-r--r--spec/ruby/library/socket/basicsocket/recv_nonblock_spec.rb70
-rw-r--r--spec/ruby/library/socket/basicsocket/recv_spec.rb159
-rw-r--r--spec/ruby/library/socket/basicsocket/recvmsg_nonblock_spec.rb209
-rw-r--r--spec/ruby/library/socket/basicsocket/recvmsg_spec.rb197
-rw-r--r--spec/ruby/library/socket/basicsocket/send_spec.rb212
-rw-r--r--spec/ruby/library/socket/basicsocket/sendmsg_nonblock_spec.rb113
-rw-r--r--spec/ruby/library/socket/basicsocket/sendmsg_spec.rb111
-rw-r--r--spec/ruby/library/socket/basicsocket/setsockopt_spec.rb336
-rw-r--r--spec/ruby/library/socket/basicsocket/shutdown_spec.rb155
-rw-r--r--spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb45
-rw-r--r--spec/ruby/library/socket/constants/constants_spec.rb108
-rw-r--r--spec/ruby/library/socket/fixtures/classes.rb164
-rw-r--r--spec/ruby/library/socket/fixtures/send_io.txt1
-rw-r--r--spec/ruby/library/socket/ipsocket/addr_spec.rb105
-rw-r--r--spec/ruby/library/socket/ipsocket/getaddress_spec.rb25
-rw-r--r--spec/ruby/library/socket/ipsocket/peeraddr_spec.rb117
-rw-r--r--spec/ruby/library/socket/ipsocket/recvfrom_spec.rb123
-rw-r--r--spec/ruby/library/socket/option/bool_spec.rb27
-rw-r--r--spec/ruby/library/socket/option/initialize_spec.rb83
-rw-r--r--spec/ruby/library/socket/option/inspect_spec.rb19
-rw-r--r--spec/ruby/library/socket/option/int_spec.rb43
-rw-r--r--spec/ruby/library/socket/option/linger_spec.rb76
-rw-r--r--spec/ruby/library/socket/option/new_spec.rb35
-rw-r--r--spec/ruby/library/socket/shared/pack_sockaddr.rb99
-rw-r--r--spec/ruby/library/socket/shared/partially_closable_sockets.rb13
-rw-r--r--spec/ruby/library/socket/shared/socketpair.rb138
-rw-r--r--spec/ruby/library/socket/socket/accept_loop_spec.rb84
-rw-r--r--spec/ruby/library/socket/socket/accept_nonblock_spec.rb138
-rw-r--r--spec/ruby/library/socket/socket/accept_spec.rb121
-rw-r--r--spec/ruby/library/socket/socket/bind_spec.rb146
-rw-r--r--spec/ruby/library/socket/socket/connect_nonblock_spec.rb149
-rw-r--r--spec/ruby/library/socket/socket/connect_spec.rb56
-rw-r--r--spec/ruby/library/socket/socket/for_fd_spec.rb30
-rw-r--r--spec/ruby/library/socket/socket/getaddrinfo_spec.rb373
-rw-r--r--spec/ruby/library/socket/socket/gethostbyaddr_spec.rb124
-rw-r--r--spec/ruby/library/socket/socket/gethostbyname_spec.rb135
-rw-r--r--spec/ruby/library/socket/socket/gethostname_spec.rb8
-rw-r--r--spec/ruby/library/socket/socket/getifaddrs_spec.rb117
-rw-r--r--spec/ruby/library/socket/socket/getnameinfo_spec.rb147
-rw-r--r--spec/ruby/library/socket/socket/getservbyname_spec.rb32
-rw-r--r--spec/ruby/library/socket/socket/getservbyport_spec.rb23
-rw-r--r--spec/ruby/library/socket/socket/initialize_spec.rb87
-rw-r--r--spec/ruby/library/socket/socket/ip_address_list_spec.rb50
-rw-r--r--spec/ruby/library/socket/socket/ipv6only_bang_spec.rb20
-rw-r--r--spec/ruby/library/socket/socket/listen_spec.rb64
-rw-r--r--spec/ruby/library/socket/socket/local_address_spec.rb43
-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.rb118
-rw-r--r--spec/ruby/library/socket/socket/recvfrom_spec.rb92
-rw-r--r--spec/ruby/library/socket/socket/remote_address_spec.rb54
-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.rb91
-rw-r--r--spec/ruby/library/socket/socket/tcp_server_loop_spec.rb54
-rw-r--r--spec/ruby/library/socket/socket/tcp_server_sockets_spec.rb39
-rw-r--r--spec/ruby/library/socket/socket/tcp_spec.rb70
-rw-r--r--spec/ruby/library/socket/socket/udp_server_loop_on_spec.rb47
-rw-r--r--spec/ruby/library/socket/socket/udp_server_loop_spec.rb57
-rw-r--r--spec/ruby/library/socket/socket/udp_server_recv_spec.rb35
-rw-r--r--spec/ruby/library/socket/socket/udp_server_sockets_spec.rb39
-rw-r--r--spec/ruby/library/socket/socket/unix_server_loop_spec.rb58
-rw-r--r--spec/ruby/library/socket/socket/unix_server_socket_spec.rb48
-rw-r--r--spec/ruby/library/socket/socket/unix_spec.rb45
-rw-r--r--spec/ruby/library/socket/socket/unpack_sockaddr_in_spec.rb46
-rw-r--r--spec/ruby/library/socket/socket/unpack_sockaddr_un_spec.rb26
-rw-r--r--spec/ruby/library/socket/spec_helper.rb13
-rw-r--r--spec/ruby/library/socket/tcpserver/accept_nonblock_spec.rb85
-rw-r--r--spec/ruby/library/socket/tcpserver/accept_spec.rb99
-rw-r--r--spec/ruby/library/socket/tcpserver/gets_spec.rb16
-rw-r--r--spec/ruby/library/socket/tcpserver/initialize_spec.rb101
-rw-r--r--spec/ruby/library/socket/tcpserver/listen_spec.rb22
-rw-r--r--spec/ruby/library/socket/tcpserver/new_spec.rb131
-rw-r--r--spec/ruby/library/socket/tcpserver/sysaccept_spec.rb66
-rw-r--r--spec/ruby/library/socket/tcpsocket/gethostbyname_spec.rb111
-rw-r--r--spec/ruby/library/socket/tcpsocket/initialize_spec.rb61
-rw-r--r--spec/ruby/library/socket/tcpsocket/local_address_spec.rb73
-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.rb34
-rw-r--r--spec/ruby/library/socket/tcpsocket/recv_spec.rb28
-rw-r--r--spec/ruby/library/socket/tcpsocket/remote_address_spec.rb72
-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.rb83
-rw-r--r--spec/ruby/library/socket/udpsocket/connect_spec.rb35
-rw-r--r--spec/ruby/library/socket/udpsocket/initialize_spec.rb40
-rw-r--r--spec/ruby/library/socket/udpsocket/inspect_spec.rb25
-rw-r--r--spec/ruby/library/socket/udpsocket/local_address_spec.rb80
-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/recvfrom_nonblock_spec.rb95
-rw-r--r--spec/ruby/library/socket/udpsocket/remote_address_spec.rb79
-rw-r--r--spec/ruby/library/socket/udpsocket/send_spec.rb154
-rw-r--r--spec/ruby/library/socket/udpsocket/write_spec.rb21
-rw-r--r--spec/ruby/library/socket/unixserver/accept_nonblock_spec.rb92
-rw-r--r--spec/ruby/library/socket/unixserver/accept_spec.rb117
-rw-r--r--spec/ruby/library/socket/unixserver/for_fd_spec.rb23
-rw-r--r--spec/ruby/library/socket/unixserver/initialize_spec.rb28
-rw-r--r--spec/ruby/library/socket/unixserver/listen_spec.rb21
-rw-r--r--spec/ruby/library/socket/unixserver/new_spec.rb6
-rw-r--r--spec/ruby/library/socket/unixserver/open_spec.rb26
-rw-r--r--spec/ruby/library/socket/unixserver/shared/new.rb22
-rw-r--r--spec/ruby/library/socket/unixserver/sysaccept_spec.rb52
-rw-r--r--spec/ruby/library/socket/unixsocket/addr_spec.rb36
-rw-r--r--spec/ruby/library/socket/unixsocket/initialize_spec.rb38
-rw-r--r--spec/ruby/library/socket/unixsocket/inspect_spec.rb17
-rw-r--r--spec/ruby/library/socket/unixsocket/local_address_spec.rb96
-rw-r--r--spec/ruby/library/socket/unixsocket/new_spec.rb6
-rw-r--r--spec/ruby/library/socket/unixsocket/open_spec.rb28
-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.rb87
-rw-r--r--spec/ruby/library/socket/unixsocket/recvfrom_spec.rb98
-rw-r--r--spec/ruby/library/socket/unixsocket/remote_address_spec.rb45
-rw-r--r--spec/ruby/library/socket/unixsocket/send_io_spec.rb58
-rw-r--r--spec/ruby/library/socket/unixsocket/shared/new.rb24
-rw-r--r--spec/ruby/library/socket/unixsocket/socketpair_spec.rb40
-rw-r--r--spec/ruby/library/stringio/append_spec.rb86
-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.rb31
-rw-r--r--spec/ruby/library/stringio/close_spec.rb23
-rw-r--r--spec/ruby/library/stringio/close_write_spec.rb31
-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.rb9
-rw-r--r--spec/ruby/library/stringio/each_line_spec.rb19
-rw-r--r--spec/ruby/library/stringio/each_spec.rb19
-rw-r--r--spec/ruby/library/stringio/eof_spec.rb11
-rw-r--r--spec/ruby/library/stringio/external_encoding_spec.rb25
-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.rb44
-rw-r--r--spec/ruby/library/stringio/gets_spec.rb245
-rw-r--r--spec/ruby/library/stringio/initialize_spec.rb209
-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.rb19
-rw-r--r--spec/ruby/library/stringio/open_spec.rb207
-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.rb70
-rw-r--r--spec/ruby/library/stringio/putc_spec.rb88
-rw-r--r--spec/ruby/library/stringio/puts_spec.rb167
-rw-r--r--spec/ruby/library/stringio/read_nonblock_spec.rb42
-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.rb129
-rw-r--r--spec/ruby/library/stringio/readlines_spec.rb99
-rw-r--r--spec/ruby/library/stringio/readpartial_spec.rb80
-rw-r--r--spec/ruby/library/stringio/reopen_spec.rb292
-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.rb20
-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.rb89
-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.rb8
-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.rb18
-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.rb60
-rw-r--r--spec/ruby/library/stringscanner/empty_spec.rb18
-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.rb21
-rw-r--r--spec/ruby/library/stringscanner/getch_spec.rb35
-rw-r--r--spec/ruby/library/stringscanner/initialize_spec.rb27
-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.rb7
-rw-r--r--spec/ruby/library/stringscanner/peep_spec.rb18
-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.rb18
-rw-r--r--spec/ruby/library/stringscanner/scan_full_spec.rb30
-rw-r--r--spec/ruby/library/stringscanner/scan_spec.rb97
-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.rb24
-rw-r--r--spec/ruby/library/stringscanner/shared/extract_range_matched.rb24
-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.rb49
-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.rb46
-rw-r--r--spec/ruby/library/tempfile/length_spec.rb7
-rw-r--r--spec/ruby/library/tempfile/open_spec.rb97
-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/queue_spec.rb8
-rw-r--r--spec/ruby/library/thread/sizedqueue_spec.rb8
-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.rb15
-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.rb26
-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.rb92
-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.rb27
-rw-r--r--spec/ruby/library/uri/set_component_spec.rb45
-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/allocate_spec.rb8
-rw-r--r--spec/ruby/library/weakref/fixtures/classes.rb24
-rw-r--r--spec/ruby/library/weakref/new_spec.rb13
-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.rb22
-rw-r--r--spec/ruby/library/win32ole/fixtures/event.xml4
-rw-r--r--spec/ruby/library/win32ole/win32ole/_getproperty_spec.rb14
-rw-r--r--spec/ruby/library/win32ole/win32ole/_invoke_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole/codepage_spec.rb13
-rw-r--r--spec/ruby/library/win32ole/win32ole/connect_spec.rb15
-rw-r--r--spec/ruby/library/win32ole/win32ole/const_load_spec.rb32
-rw-r--r--spec/ruby/library/win32ole/win32ole/constants_spec.rb42
-rw-r--r--spec/ruby/library/win32ole/win32ole/create_guid_spec.rb9
-rw-r--r--spec/ruby/library/win32ole/win32ole/invoke_spec.rb14
-rw-r--r--spec/ruby/library/win32ole/win32ole/locale_spec.rb29
-rw-r--r--spec/ruby/library/win32ole/win32ole/new_spec.rb25
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_get_methods_spec.rb16
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_method_help_spec.rb10
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_method_spec.rb10
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_methods_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_obj_help_spec.rb18
-rw-r--r--spec/ruby/library/win32ole/win32ole/ole_put_methods_spec.rb21
-rw-r--r--spec/ruby/library/win32ole/win32ole/setproperty_spec.rb10
-rw-r--r--spec/ruby/library/win32ole/win32ole/shared/ole_method.rb19
-rw-r--r--spec/ruby/library/win32ole/win32ole/shared/setproperty.rb23
-rw-r--r--spec/ruby/library/win32ole/win32ole_event/new_spec.rb33
-rw-r--r--spec/ruby/library/win32ole/win32ole_event/on_event_spec.rb70
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/dispid_spec.rb20
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/event_interface_spec.rb28
-rw-r--r--spec/ruby/library/win32ole/win32ole_method/event_spec.rb22
-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.rb40
-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.rb7
-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.rb8
-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.rb106
-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.rb54
-rw-r--r--spec/ruby/library/zlib/crc_table_spec.rb75
-rw-r--r--spec/ruby/library/zlib/deflate/deflate_spec.rb128
-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.rb14
-rw-r--r--spec/ruby/library/zlib/deflate_spec.rb8
-rw-r--r--spec/ruby/library/zlib/gunzip_spec.rb14
-rw-r--r--spec/ruby/library/zlib/gzip_spec.rb15
-rw-r--r--spec/ruby/library/zlib/gzipfile/close_spec.rb21
-rw-r--r--spec/ruby/library/zlib/gzipfile/closed_spec.rb16
-rw-r--r--spec/ruby/library/zlib/gzipfile/comment_spec.rb26
-rw-r--r--spec/ruby/library/zlib/gzipfile/orig_name_spec.rb26
-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.rb54
-rw-r--r--spec/ruby/library/zlib/gzipreader/getc_spec.rb39
-rw-r--r--spec/ruby/library/zlib/gzipreader/gets_spec.rb22
-rw-r--r--spec/ruby/library/zlib/gzipreader/new_spec.rb1
-rw-r--r--spec/ruby/library/zlib/gzipreader/pos_spec.rb24
-rw-r--r--spec/ruby/library/zlib/gzipreader/read_spec.rb66
-rw-r--r--spec/ruby/library/zlib/gzipreader/readpartial_spec.rb17
-rw-r--r--spec/ruby/library/zlib/gzipreader/rewind_spec.rb47
-rw-r--r--spec/ruby/library/zlib/gzipreader/shared/each.rb49
-rw-r--r--spec/ruby/library/zlib/gzipreader/ungetbyte_spec.rb120
-rw-r--r--spec/ruby/library/zlib/gzipreader/ungetc_spec.rb284
-rw-r--r--spec/ruby/library/zlib/gzipwriter/append_spec.rb15
-rw-r--r--spec/ruby/library/zlib/gzipwriter/mtime_spec.rb38
-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.rb20
-rw-r--r--spec/ruby/library/zlib/inflate_spec.rb8
-rw-r--r--spec/ruby/library/zlib/zlib_version_spec.rb8
-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/data_type_spec.rb9
-rw-r--r--spec/ruby/library/zlib/zstream/flush_next_out_spec.rb14
-rw-r--r--spec/ruby/optional/capi/README16
-rw-r--r--spec/ruby/optional/capi/array_spec.rb471
-rw-r--r--spec/ruby/optional/capi/bignum_spec.rb224
-rw-r--r--spec/ruby/optional/capi/boolean_spec.rb33
-rw-r--r--spec/ruby/optional/capi/class_spec.rb384
-rw-r--r--spec/ruby/optional/capi/complex_spec.rb45
-rw-r--r--spec/ruby/optional/capi/constants_spec.rb258
-rw-r--r--spec/ruby/optional/capi/data_spec.rb45
-rw-r--r--spec/ruby/optional/capi/encoding_spec.rb482
-rw-r--r--spec/ruby/optional/capi/enumerator_spec.rb66
-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.c285
-rw-r--r--spec/ruby/optional/capi/ext/bignum_spec.c106
-rw-r--r--spec/ruby/optional/capi/ext/boolean_spec.c33
-rw-r--r--spec/ruby/optional/capi/ext/class_id_under_autoload_spec.c5
-rw-r--r--spec/ruby/optional/capi/ext/class_spec.c170
-rw-r--r--spec/ruby/optional/capi/ext/class_under_autoload_spec.c5
-rw-r--r--spec/ruby/optional/capi/ext/complex_spec.c45
-rw-r--r--spec/ruby/optional/capi/ext/constants_spec.c339
-rw-r--r--spec/ruby/optional/capi/ext/data_spec.c83
-rw-r--r--spec/ruby/optional/capi/ext/encoding_spec.c249
-rw-r--r--spec/ruby/optional/capi/ext/enumerator_spec.c32
-rw-r--r--spec/ruby/optional/capi/ext/exception_spec.c46
-rw-r--r--spec/ruby/optional/capi/ext/file_spec.c29
-rw-r--r--spec/ruby/optional/capi/ext/fixnum_spec.c26
-rw-r--r--spec/ruby/optional/capi/ext/float_spec.c38
-rw-r--r--spec/ruby/optional/capi/ext/gc_spec.c55
-rw-r--r--spec/ruby/optional/capi/ext/globals_spec.c118
-rw-r--r--spec/ruby/optional/capi/ext/hash_spec.c143
-rw-r--r--spec/ruby/optional/capi/ext/integer_spec.c34
-rw-r--r--spec/ruby/optional/capi/ext/io_spec.c242
-rw-r--r--spec/ruby/optional/capi/ext/kernel_spec.c350
-rw-r--r--spec/ruby/optional/capi/ext/marshal_spec.c24
-rw-r--r--spec/ruby/optional/capi/ext/module_spec.c155
-rw-r--r--spec/ruby/optional/capi/ext/module_under_autoload_spec.c7
-rw-r--r--spec/ruby/optional/capi/ext/mutex_spec.c55
-rw-r--r--spec/ruby/optional/capi/ext/numeric_spec.c125
-rw-r--r--spec/ruby/optional/capi/ext/object_spec.c419
-rw-r--r--spec/ruby/optional/capi/ext/proc_spec.c68
-rw-r--r--spec/ruby/optional/capi/ext/range_spec.c50
-rw-r--r--spec/ruby/optional/capi/ext/rational_spec.c54
-rw-r--r--spec/ruby/optional/capi/ext/regexp_spec.c53
-rw-r--r--spec/ruby/optional/capi/ext/rubyspec.h34
-rw-r--r--spec/ruby/optional/capi/ext/st_spec.c83
-rw-r--r--spec/ruby/optional/capi/ext/string_spec.c507
-rw-r--r--spec/ruby/optional/capi/ext/struct_spec.c89
-rw-r--r--spec/ruby/optional/capi/ext/symbol_spec.c90
-rw-r--r--spec/ruby/optional/capi/ext/thread_spec.c148
-rw-r--r--spec/ruby/optional/capi/ext/time_spec.c81
-rw-r--r--spec/ruby/optional/capi/ext/typed_data_spec.c167
-rw-r--r--spec/ruby/optional/capi/ext/util_spec.c108
-rw-r--r--spec/ruby/optional/capi/file_spec.rb89
-rw-r--r--spec/ruby/optional/capi/fixnum_spec.rb101
-rw-r--r--spec/ruby/optional/capi/fixtures/class.rb91
-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.rb61
-rw-r--r--spec/ruby/optional/capi/globals_spec.rb224
-rw-r--r--spec/ruby/optional/capi/hash_spec.rb257
-rw-r--r--spec/ruby/optional/capi/integer_spec.rb275
-rw-r--r--spec/ruby/optional/capi/io_spec.rb367
-rw-r--r--spec/ruby/optional/capi/kernel_spec.rb599
-rw-r--r--spec/ruby/optional/capi/marshal_spec.rb46
-rw-r--r--spec/ruby/optional/capi/module_spec.rb378
-rw-r--r--spec/ruby/optional/capi/mutex_spec.rb89
-rw-r--r--spec/ruby/optional/capi/numeric_spec.rb485
-rw-r--r--spec/ruby/optional/capi/object_spec.rb890
-rw-r--r--spec/ruby/optional/capi/proc_spec.rb116
-rw-r--r--spec/ruby/optional/capi/rake_helper.rb22
-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.rb132
-rw-r--r--spec/ruby/optional/capi/st_spec.rb41
-rw-r--r--spec/ruby/optional/capi/string_spec.rb1034
-rw-r--r--spec/ruby/optional/capi/struct_spec.rb211
-rw-r--r--spec/ruby/optional/capi/symbol_spec.rb133
-rw-r--r--spec/ruby/optional/capi/thread_spec.rb143
-rw-r--r--spec/ruby/optional/capi/time_spec.rb300
-rw-r--r--spec/ruby/optional/capi/typed_data_spec.rb60
-rw-r--r--spec/ruby/optional/capi/util_spec.rb263
-rw-r--r--spec/ruby/security/cve_2010_1330_spec.rb21
-rw-r--r--spec/ruby/security/cve_2011_4815_spec.rb47
-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/security/cve_2017_17742_spec.rb34
-rw-r--r--spec/ruby/security/cve_2018_16396_spec.rb25
-rw-r--r--spec/ruby/security/cve_2018_6914_spec.rb55
-rw-r--r--spec/ruby/security/cve_2018_8778_spec.rb12
-rw-r--r--spec/ruby/security/cve_2018_8779_spec.rb30
-rw-r--r--spec/ruby/security/cve_2018_8780_spec.rb45
-rw-r--r--spec/ruby/security/cve_2019_8321_spec.rb22
-rw-r--r--spec/ruby/security/cve_2019_8322_spec.rb23
-rw-r--r--spec/ruby/security/cve_2019_8323_spec.rb38
-rw-r--r--spec/ruby/security/cve_2019_8325_spec.rb38
-rw-r--r--spec/ruby/shared/basicobject/method_missing.rb124
-rw-r--r--spec/ruby/shared/basicobject/send.rb128
-rw-r--r--spec/ruby/shared/enumerator/enum_for.rb50
-rw-r--r--spec/ruby/shared/enumerator/with_index.rb33
-rw-r--r--spec/ruby/shared/enumerator/with_object.rb42
-rw-r--r--spec/ruby/shared/fiber/resume.rb79
-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.rb39
-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.rb28
-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/hash/key_error.rb25
-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.rb85
-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/queue/clear.rb12
-rw-r--r--spec/ruby/shared/queue/close.rb14
-rw-r--r--spec/ruby/shared/queue/closed.rb12
-rw-r--r--spec/ruby/shared/queue/deque.rb85
-rw-r--r--spec/ruby/shared/queue/empty.rb12
-rw-r--r--spec/ruby/shared/queue/enque.rb18
-rw-r--r--spec/ruby/shared/queue/length.rb9
-rw-r--r--spec/ruby/shared/queue/num_waiting.rb16
-rw-r--r--spec/ruby/shared/rational/Rational.rb143
-rw-r--r--spec/ruby/shared/rational/abs.rb11
-rw-r--r--spec/ruby/shared/rational/arithmetic_exception_in_coerce.rb33
-rw-r--r--spec/ruby/shared/rational/ceil.rb45
-rw-r--r--spec/ruby/shared/rational/coerce.rb29
-rw-r--r--spec/ruby/shared/rational/comparison.rb117
-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.rb178
-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.rb14
-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.rb106
-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.rb11
-rw-r--r--spec/ruby/shared/rational/to_s.rb14
-rw-r--r--spec/ruby/shared/rational/truncate.rb45
-rw-r--r--spec/ruby/shared/sizedqueue/enque.rb50
-rw-r--r--spec/ruby/shared/sizedqueue/max.rb47
-rw-r--r--spec/ruby/shared/sizedqueue/new.rb18
-rw-r--r--spec/ruby/shared/sizedqueue/num_waiting.rb12
-rw-r--r--spec/ruby/shared/string/times.rb64
-rw-r--r--spec/ruby/shared/time/strftime_for_date.rb273
-rw-r--r--spec/ruby/shared/time/strftime_for_time.rb173
-rw-r--r--spec/ruby/spec_helper.rb32
-rw-r--r--sprintf.c627
-rw-r--r--st.c3050
-rw-r--r--strftime.c292
-rw-r--r--string.c4746
-rw-r--r--struct.c665
-rw-r--r--symbol.c365
-rw-r--r--symbol.h59
-rw-r--r--template/Doxyfile.tmpl80
-rw-r--r--template/GNUmakefile.in7
-rw-r--r--template/Makefile.in683
-rw-r--r--template/configure-ext.mk.tmpl44
-rw-r--r--template/depend.tmpl2
-rw-r--r--template/encdb.h.tmpl31
-rw-r--r--template/extinit.c.tmpl17
-rw-r--r--template/exts.mk.tmpl159
-rw-r--r--template/fake.rb.in68
-rw-r--r--template/id.c.tmpl16
-rw-r--r--template/id.h.tmpl77
-rw-r--r--template/insns.inc.tmpl20
-rw-r--r--template/insns_info.inc.tmpl83
-rw-r--r--template/limits.c.tmpl97
-rw-r--r--template/minsns.inc.tmpl14
-rw-r--r--template/opt_sc.inc.tmpl32
-rw-r--r--template/optinsn.inc.tmpl30
-rw-r--r--template/optunifs.inc.tmpl35
-rw-r--r--template/prelude.c.tmpl158
-rw-r--r--template/ruby-runner.h.in9
-rw-r--r--template/ruby.pc.in5
-rw-r--r--template/sizes.c.tmpl28
-rw-r--r--template/transdb.h.tmpl21
-rw-r--r--template/unicode_norm_gen.tmpl43
-rw-r--r--template/verconf.h.tmpl16
-rw-r--r--template/vm.inc.tmpl29
-rw-r--r--template/vmtc.inc.tmpl18
-rw-r--r--template/yarvarch.en (renamed from doc/yarvarch.en)0
-rw-r--r--template/yarvarch.ja (renamed from doc/yarvarch.ja)0
-rw-r--r--template/yasmdata.rb.tmpl20
-rw-r--r--test/-ext-/arith_seq/test_arith_seq_extract.rb40
-rw-r--r--test/-ext-/array/test_resize.rb3
-rw-r--r--test/-ext-/bignum/test_big2str.rb7
-rw-r--r--test/-ext-/bignum/test_bigzero.rb9
-rw-r--r--test/-ext-/bignum/test_div.rb7
-rw-r--r--test/-ext-/bignum/test_mul.rb15
-rw-r--r--test/-ext-/bignum/test_pack.rb3
-rw-r--r--test/-ext-/bignum/test_str2big.rb7
-rw-r--r--test/-ext-/bug_reporter/test_bug_reporter.rb11
-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.rb3
-rw-r--r--test/-ext-/exception/test_enc_raise.rb3
-rw-r--r--test/-ext-/exception/test_ensured.rb3
-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.rb1
-rw-r--r--test/-ext-/funcall/test_funcall.rb11
-rw-r--r--test/-ext-/funcall/test_passing_block.rb59
-rw-r--r--test/-ext-/gvl/test_last_thread.rb22
-rw-r--r--test/-ext-/gvl/test_ubf_async_safe.rb20
-rw-r--r--test/-ext-/hash/test_delete.rb3
-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.rb102
-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.rb24
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb1
-rw-r--r--test/-ext-/method/test_arity.rb5
-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.rb6
-rw-r--r--test/-ext-/proc/test_bmethod.rb5
-rw-r--r--test/-ext-/rational/test_rat.rb1
-rw-r--r--test/-ext-/st/test_foreach.rb1
-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.rb59
-rw-r--r--test/-ext-/string/test_coderange.rb3
-rw-r--r--test/-ext-/string/test_cstr.rb47
-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.rb58
-rw-r--r--test/-ext-/string/test_modify_expand.rb9
-rw-r--r--test/-ext-/string/test_nofree.rb9
-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.rb4
-rw-r--r--test/-ext-/struct/test_len.rb10
-rw-r--r--test/-ext-/struct/test_member.rb5
-rw-r--r--test/-ext-/symbol/noninterned_name.rb17
-rw-r--r--test/-ext-/symbol/test_inadvertent_creation.rb84
-rw-r--r--test/-ext-/symbol/test_type.rb15
-rw-r--r--test/-ext-/test_bug-14834.rb12
-rw-r--r--test/-ext-/test_bug-3571.rb3
-rw-r--r--test/-ext-/test_bug-3662.rb10
-rw-r--r--test/-ext-/test_bug-5832.rb3
-rw-r--r--test/-ext-/test_enumerator_kw.rb11
-rw-r--r--test/-ext-/test_notimplement.rb37
-rw-r--r--test/-ext-/test_printf.rb16
-rw-r--r--test/-ext-/test_recursion.rb1
-rw-r--r--test/-ext-/test_scan_args.rb324
-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.rb7
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb17
-rw-r--r--test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb36
-rw-r--r--test/-ext-/win32/test_console_attr.rb18
-rw-r--r--test/-ext-/win32/test_dln.rb15
-rw-r--r--test/-ext-/win32/test_fd_setsize.rb1
-rw-r--r--test/base64/test_base64.rb15
-rw-r--r--test/benchmark/test_benchmark.rb9
-rw-r--r--test/bigdecimal/test_bigdecimal.rb897
-rw-r--r--test/bigdecimal/test_bigdecimal_util.rb45
-rw-r--r--test/bigdecimal/test_bigmath.rb1
-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.rb31
-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.rb141
-rw-r--r--test/cgi/update_env.rb9
-rw-r--r--test/coverage/test_coverage.rb736
-rw-r--r--test/csv/base.rb8
-rw-r--r--test/csv/helper.rb18
-rw-r--r--test/csv/interface/test_delegation.rb47
-rw-r--r--test/csv/interface/test_read.rb277
-rw-r--r--test/csv/interface/test_read_write.rb50
-rw-r--r--test/csv/interface/test_write.rb174
-rw-r--r--test/csv/parse/test_column_separator.rb40
-rw-r--r--test/csv/parse/test_convert.rb110
-rw-r--r--test/csv/parse/test_each.rb23
-rw-r--r--test/csv/parse/test_general.rb255
-rw-r--r--test/csv/parse/test_header.rb335
-rw-r--r--test/csv/parse/test_invalid.rb39
-rw-r--r--test/csv/parse/test_liberal_parsing.rb160
-rw-r--r--test/csv/parse/test_quote_char_nil.rb93
-rw-r--r--test/csv/parse/test_rewind.rb40
-rw-r--r--test/csv/parse/test_row_separator.rb16
-rw-r--r--test/csv/parse/test_skip_lines.rb105
-rw-r--r--test/csv/parse/test_strip.rb78
-rw-r--r--test/csv/parse/test_unconverted_fields.rb117
-rwxr-xr-xtest/csv/test_csv_parsing.rb221
-rwxr-xr-xtest/csv/test_csv_writing.rb97
-rwxr-xr-x[-rw-r--r--]test/csv/test_data_converters.rb235
-rwxr-xr-x[-rw-r--r--]test/csv/test_encodings.rb57
-rwxr-xr-x[-rw-r--r--]test/csv/test_features.rb182
-rwxr-xr-xtest/csv/test_headers.rb297
-rwxr-xr-xtest/csv/test_interface.rb368
-rwxr-xr-x[-rw-r--r--]test/csv/test_row.rb115
-rwxr-xr-x[-rw-r--r--]test/csv/test_table.rb286
-rw-r--r--test/csv/ts_all.rb20
-rw-r--r--test/csv/write/test_converters.rb53
-rw-r--r--test/csv/write/test_general.rb258
-rw-r--r--test/csv/write/test_quote_empty.rb70
-rw-r--r--test/date/test_date.rb18
-rw-r--r--test/date/test_date_arith.rb32
-rw-r--r--test/date/test_date_attr.rb24
-rw-r--r--test/date/test_date_base.rb442
-rw-r--r--test/date/test_date_compat.rb1
-rw-r--r--test/date/test_date_conv.rb44
-rw-r--r--test/date/test_date_marshal.rb15
-rw-r--r--test/date/test_date_new.rb117
-rw-r--r--test/date/test_date_parse.rb125
-rw-r--r--test/date/test_date_strftime.rb17
-rw-r--r--test/date/test_date_strptime.rb20
-rw-r--r--test/date/test_switch_hitter.rb81
-rw-r--r--test/dbm/test_dbm.rb11
-rw-r--r--test/did_you_mean/core_ext/test_name_error_extension.rb48
-rw-r--r--test/did_you_mean/edit_distance/test_jaro_winkler.rb36
-rw-r--r--test/did_you_mean/fixtures/book.rb4
-rw-r--r--test/did_you_mean/fixtures/mini_dir.yml15
-rw-r--r--test/did_you_mean/fixtures/rspec_dir.yml112
-rw-r--r--test/did_you_mean/helper.rb29
-rw-r--r--test/did_you_mean/spell_checking/test_class_name_check.rb79
-rw-r--r--test/did_you_mean/spell_checking/test_key_name_check.rb54
-rw-r--r--test/did_you_mean/spell_checking/test_method_name_check.rb140
-rw-r--r--test/did_you_mean/spell_checking/test_uncorrectable_name_check.rb15
-rw-r--r--test/did_you_mean/spell_checking/test_variable_name_check.rb140
-rw-r--r--test/did_you_mean/test_spell_checker.rb77
-rw-r--r--test/did_you_mean/test_tree_spell_checker.rb173
-rw-r--r--test/did_you_mean/test_verbose_formatter.rb21
-rw-r--r--test/did_you_mean/tree_spell/change_word.rb61
-rw-r--r--test/did_you_mean/tree_spell/human_typo.rb89
-rw-r--r--test/did_you_mean/tree_spell/test_change_word.rb38
-rw-r--r--test/did_you_mean/tree_spell/test_human_typo.rb24
-rw-r--r--test/digest/digest/foo.rb1
-rw-r--r--test/digest/test_digest.rb18
-rw-r--r--test/digest/test_digest_extend.rb5
-rw-r--r--test/drb/drbtest.rb184
-rw-r--r--test/drb/ignore_test_drb.rb1
-rw-r--r--test/drb/test_acl.rb102
-rw-r--r--test/drb/test_drb.rb211
-rw-r--r--test/drb/test_drbobject.rb69
-rw-r--r--test/drb/test_drbssl.rb55
-rw-r--r--test/drb/test_drbunix.rb27
-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.rb12
-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.rb43
-rw-r--r--test/dtrace/dummy.rb1
-rw-r--r--test/dtrace/helper.rb131
-rw-r--r--test/dtrace/test_array_create.rb9
-rw-r--r--test/dtrace/test_cmethod.rb1
-rw-r--r--test/dtrace/test_function_entry.rb10
-rw-r--r--test/dtrace/test_gc.rb1
-rw-r--r--test/dtrace/test_hash_create.rb7
-rw-r--r--test/dtrace/test_load.rb1
-rw-r--r--test/dtrace/test_method_cache.rb9
-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.rb7
-rw-r--r--test/dtrace/test_singleton_function.rb10
-rw-r--r--test/dtrace/test_string.rb7
-rw-r--r--test/erb/test_erb.rb345
-rw-r--r--test/erb/test_erb_command.rb19
-rw-r--r--test/erb/test_erb_m17n.rb3
-rw-r--r--test/etc/test_etc.rb17
-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/excludes/_appveyor/TestArray.rb7
-rw-r--r--test/fiddle/helper.rb36
-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.rb184
-rw-r--r--test/fiddle/test_fiddle.rb1
-rw-r--r--test/fiddle/test_func.rb13
-rw-r--r--test/fiddle/test_function.rb55
-rw-r--r--test/fiddle/test_handle.rb99
-rw-r--r--test/fiddle/test_import.rb15
-rw-r--r--test/fiddle/test_pointer.rb10
-rw-r--r--test/fileutils/clobber.rb1
-rw-r--r--test/fileutils/fileasserts.rb1
-rw-r--r--test/fileutils/test_dryrun.rb3
-rw-r--r--test/fileutils/test_fileutils.rb381
-rw-r--r--test/fileutils/test_nowrite.rb3
-rw-r--r--test/fileutils/test_verbose.rb3
-rw-r--r--test/fileutils/visibility_tests.rb5
-rw-r--r--test/gdbm/test_gdbm.rb21
-rw-r--r--test/io/console/test_io_console.rb268
-rw-r--r--test/io/nonblock/test_flush.rb23
-rw-r--r--test/io/wait/test_io_wait.rb81
-rw-r--r--test/io/wait/test_io_wait_uncommon.rb78
-rw-r--r--test/irb/test_color.rb193
-rw-r--r--test/irb/test_completion.rb12
-rw-r--r--test/irb/test_context.rb220
-rw-r--r--test/irb/test_init.rb73
-rw-r--r--test/irb/test_option.rb4
-rw-r--r--test/irb/test_raise_no_backtrace_exception.rb5
-rw-r--r--test/irb/test_workspace.rb104
-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.rb203
-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.rb421
-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.rb17
-rwxr-xr-xtest/json/test_json.rb557
-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.rb322
-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/envutil.rb604
-rw-r--r--test/lib/find_executable.rb21
-rw-r--r--test/lib/jit_support.rb70
-rw-r--r--test/lib/leakchecker.rb167
-rw-r--r--test/lib/memory_status.rb111
-rw-r--r--test/lib/minitest/README.txt (renamed from tool/lib/minitest/README.txt)0
-rw-r--r--test/lib/minitest/autorun.rb13
-rw-r--r--test/lib/minitest/benchmark.rb417
-rw-r--r--test/lib/minitest/mock.rb195
-rw-r--r--test/lib/minitest/unit.rb1419
-rw-r--r--test/lib/profile_test_all.rb90
-rw-r--r--test/lib/test/unit.rb896
-rw-r--r--test/lib/test/unit/assertions.rb501
-rw-r--r--test/lib/test/unit/parallel.rb190
-rw-r--r--test/lib/test/unit/testcase.rb34
-rw-r--r--test/lib/tracepointchecker.rb118
-rw-r--r--test/lib/with_different_ofs.rb5
-rw-r--r--test/logger/helper.rb13
-rw-r--r--test/logger/test_logdevice.rb487
-rw-r--r--test/logger/test_logger.rb145
-rw-r--r--test/logger/test_logperiod.rb80
-rw-r--r--test/logger/test_severity.rb15
-rw-r--r--test/matrix/test_matrix.rb226
-rw-r--r--test/matrix/test_vector.rb120
-rw-r--r--test/minitest/metametameta.rb69
-rw-r--r--test/minitest/test_minitest_benchmark.rb130
-rw-r--r--test/minitest/test_minitest_mock.rb403
-rw-r--r--test/minitest/test_minitest_unit.rb1803
-rw-r--r--test/misc/test_ruby_mode.rb17
-rw-r--r--test/mkmf/base.rb30
-rw-r--r--test/mkmf/test_config.rb1
-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.rb3
-rw-r--r--test/mkmf/test_framework.rb9
-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.rb125
-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.rb1834
-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.rb338
-rw-r--r--test/net/http/test_http_request.rb34
-rw-r--r--test/net/http/test_httpheader.rb110
-rw-r--r--test/net/http/test_httpresponse.rb77
-rw-r--r--test/net/http/test_httpresponses.rb1
-rw-r--r--test/net/http/test_https.rb173
-rw-r--r--test/net/http/test_https_proxy.rb1
-rw-r--r--test/net/http/utils.rb23
-rw-r--r--test/net/imap/Makefile (renamed from test/net/fixtures/Makefile)0
-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.rb316
-rw-r--r--test/net/imap/test_imap_response_parser.rb81
-rw-r--r--test/net/pop/test_pop.rb30
-rw-r--r--test/net/protocol/test_protocol.rb100
-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.rb362
-rw-r--r--test/open-uri/test_open-uri.rb190
-rw-r--r--test/open-uri/test_ssl.rb431
-rw-r--r--test/openssl/fixtures/pkey/dh-1.pem13
-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/rsa-1.pem51
-rw-r--r--test/openssl/fixtures/pkey/rsa-2.pem51
-rw-r--r--test/openssl/fixtures/pkey/rsa-3.pem51
-rw-r--r--test/openssl/fixtures/pkey/rsa1024.pem15
-rw-r--r--test/openssl/fixtures/pkey/rsa2048.pem27
-rw-r--r--test/openssl/test_asn1.rb805
-rw-r--r--test/openssl/test_bn.rb330
-rw-r--r--test/openssl/test_buffering.rb19
-rw-r--r--test/openssl/test_cipher.rb479
-rw-r--r--test/openssl/test_config.rb35
-rw-r--r--test/openssl/test_digest.rb110
-rw-r--r--test/openssl/test_engine.rb116
-rw-r--r--test/openssl/test_fips.rb22
-rw-r--r--test/openssl/test_hmac.rb55
-rw-r--r--test/openssl/test_kdf.rb183
-rw-r--r--test/openssl/test_ns_spki.rb10
-rw-r--r--test/openssl/test_ocsp.rb307
-rw-r--r--test/openssl/test_pair.rb396
-rw-r--r--test/openssl/test_partial_record_read.rb34
-rw-r--r--test/openssl/test_pkcs12.rb168
-rw-r--r--test/openssl/test_pkcs5.rb97
-rw-r--r--test/openssl/test_pkcs7.rb34
-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.rb468
-rw-r--r--test/openssl/test_pkey_rsa.rb397
-rw-r--r--test/openssl/test_random.rb19
-rw-r--r--test/openssl/test_ssl.rb1398
-rw-r--r--test/openssl/test_ssl_session.rb453
-rw-r--r--test/openssl/test_x509attr.rb84
-rw-r--r--test/openssl/test_x509cert.rb155
-rw-r--r--test/openssl/test_x509crl.rb101
-rw-r--r--test/openssl/test_x509ext.rb50
-rw-r--r--test/openssl/test_x509name.rb176
-rw-r--r--test/openssl/test_x509req.rb45
-rw-r--r--test/openssl/test_x509store.rb94
-rw-r--r--test/openssl/ut_eof.rb133
-rw-r--r--test/openssl/utils.rb464
-rw-r--r--test/optparse/test_acceptable.rb56
-rw-r--r--test/optparse/test_autoconf.rb10
-rw-r--r--test/optparse/test_bash_completion.rb6
-rw-r--r--test/optparse/test_did_you_mean.rb52
-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.rb12
-rw-r--r--test/optparse/test_zsh_completion.rb3
-rw-r--r--test/ostruct/test_ostruct.rb99
-rw-r--r--test/pathname/test_pathname.rb209
-rw-r--r--test/psych/handlers/test_recorder.rb1
-rw-r--r--test/psych/helper.rb30
-rw-r--r--test/psych/json/test_stream.rb1
-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.rb21
-rw-r--r--test/psych/test_encoding.rb22
-rw-r--r--test/psych/test_exception.rb60
-rw-r--r--test/psych/test_hash.rb80
-rw-r--r--test/psych/test_json_tree.rb1
-rw-r--r--test/psych/test_marshalable.rb1
-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.rb170
-rw-r--r--test/psych/test_safe_load.rb92
-rw-r--r--test/psych/test_scalar.rb6
-rw-r--r--test/psych/test_scalar_scanner.rb34
-rw-r--r--test/psych/test_serialize_subclasses.rb1
-rw-r--r--test/psych/test_set.rb1
-rw-r--r--test/psych/test_stream.rb17
-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.rb130
-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_yaml_special_cases.rb130
-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/racc/assets/cadenza.y170
-rw-r--r--test/racc/assets/cast.y926
-rw-r--r--test/racc/assets/chk.y126
-rw-r--r--test/racc/assets/conf.y16
-rw-r--r--test/racc/assets/csspool.y729
-rw-r--r--test/racc/assets/digraph.y29
-rw-r--r--test/racc/assets/echk.y118
-rw-r--r--test/racc/assets/edtf.y583
-rw-r--r--test/racc/assets/err.y60
-rw-r--r--test/racc/assets/error_recovery.y35
-rw-r--r--test/racc/assets/expect.y7
-rw-r--r--test/racc/assets/firstline.y4
-rw-r--r--test/racc/assets/huia.y318
-rw-r--r--test/racc/assets/ichk.y102
-rw-r--r--test/racc/assets/intp.y546
-rw-r--r--test/racc/assets/journey.y47
-rw-r--r--test/racc/assets/liquor.y313
-rw-r--r--test/racc/assets/machete.y423
-rw-r--r--test/racc/assets/macruby.y2197
-rw-r--r--test/racc/assets/mailp.y437
-rw-r--r--test/racc/assets/mediacloth.y599
-rw-r--r--test/racc/assets/mof.y649
-rw-r--r--test/racc/assets/namae.y302
-rw-r--r--test/racc/assets/nasl.y626
-rw-r--r--test/racc/assets/newsyn.y25
-rw-r--r--test/racc/assets/noend.y4
-rw-r--r--test/racc/assets/nokogiri-css.y255
-rw-r--r--test/racc/assets/nonass.y41
-rw-r--r--test/racc/assets/normal.y27
-rw-r--r--test/racc/assets/norule.y4
-rw-r--r--test/racc/assets/nullbug1.y25
-rw-r--r--test/racc/assets/nullbug2.y15
-rw-r--r--test/racc/assets/opal.y1807
-rw-r--r--test/racc/assets/opt.y123
-rw-r--r--test/racc/assets/percent.y35
-rw-r--r--test/racc/assets/php_serialization.y98
-rw-r--r--test/racc/assets/recv.y97
-rw-r--r--test/racc/assets/riml.y665
-rw-r--r--test/racc/assets/rrconf.y14
-rw-r--r--test/racc/assets/ruby18.y1943
-rw-r--r--test/racc/assets/ruby19.y2174
-rw-r--r--test/racc/assets/ruby20.y2350
-rw-r--r--test/racc/assets/ruby21.y2359
-rw-r--r--test/racc/assets/ruby22.y2381
-rw-r--r--test/racc/assets/scan.y72
-rw-r--r--test/racc/assets/syntax.y50
-rw-r--r--test/racc/assets/tp_plus.y622
-rw-r--r--test/racc/assets/twowaysql.y278
-rw-r--r--test/racc/assets/unterm.y5
-rw-r--r--test/racc/assets/useless.y12
-rw-r--r--test/racc/assets/yyerr.y46
-rw-r--r--test/racc/bench.y36
-rw-r--r--test/racc/helper.rb115
-rw-r--r--test/racc/infini.y8
-rw-r--r--test/racc/regress/README.txt7
-rw-r--r--test/racc/regress/cadenza796
-rw-r--r--test/racc/regress/cast3425
-rw-r--r--test/racc/regress/csspool2318
-rw-r--r--test/racc/regress/edtf1794
-rw-r--r--test/racc/regress/huia1392
-rw-r--r--test/racc/regress/journey222
-rw-r--r--test/racc/regress/liquor885
-rw-r--r--test/racc/regress/machete833
-rw-r--r--test/racc/regress/mediacloth1463
-rw-r--r--test/racc/regress/mof1368
-rw-r--r--test/racc/regress/namae634
-rw-r--r--test/racc/regress/nasl2058
-rw-r--r--test/racc/regress/nokogiri-css836
-rw-r--r--test/racc/regress/opal6429
-rw-r--r--test/racc/regress/php_serialization336
-rw-r--r--test/racc/regress/riml3297
-rw-r--r--test/racc/regress/ruby186351
-rw-r--r--test/racc/regress/ruby227456
-rw-r--r--test/racc/regress/tp_plus1933
-rw-r--r--test/racc/regress/twowaysql556
-rw-r--r--test/racc/scandata/brace7
-rw-r--r--test/racc/scandata/gvar1
-rw-r--r--test/racc/scandata/normal4
-rw-r--r--test/racc/scandata/percent18
-rw-r--r--test/racc/scandata/slash10
-rw-r--r--test/racc/src.intp34
-rw-r--r--test/racc/start.y20
-rw-r--r--test/racc/test_chk_y.rb52
-rw-r--r--test/racc/test_grammar_file_parser.rb15
-rw-r--r--test/racc/test_racc_command.rb322
-rw-r--r--test/racc/test_scan_y.rb52
-rw-r--r--test/racc/testscanner.rb51
-rw-r--r--test/rake/file_creation.rb34
-rw-r--r--test/rake/helper.rb129
-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.rb68
-rw-r--r--test/rake/test_rake_definitions.rb84
-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.rb197
-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_late_time.rb18
-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.rb146
-rw-r--r--test/rake/test_rake_thread_pool.rb145
-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.text6
-rw-r--r--test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text2
-rw-r--r--test/rdoc/helper.rb5
-rw-r--r--test/rdoc/support/formatter_test_case.rb764
-rw-r--r--test/rdoc/support/test_case.rb216
-rw-r--r--test/rdoc/support/text_formatter_test_case.rb115
-rw-r--r--test/rdoc/test_rdoc_alias.rb1
-rw-r--r--test/rdoc/test_rdoc_any_method.rb67
-rw-r--r--test/rdoc/test_rdoc_attr.rb6
-rw-r--r--test/rdoc/test_rdoc_class_module.rb56
-rw-r--r--test/rdoc/test_rdoc_code_object.rb18
-rw-r--r--test/rdoc/test_rdoc_comment.rb25
-rw-r--r--test/rdoc/test_rdoc_constant.rb9
-rw-r--r--test/rdoc/test_rdoc_context.rb114
-rw-r--r--test/rdoc/test_rdoc_context_section.rb31
-rw-r--r--test/rdoc/test_rdoc_cross_reference.rb33
-rw-r--r--test/rdoc/test_rdoc_encoding.rb101
-rw-r--r--test/rdoc/test_rdoc_extend.rb1
-rw-r--r--test/rdoc/test_rdoc_generator_darkfish.rb37
-rw-r--r--test/rdoc/test_rdoc_generator_json_index.rb47
-rw-r--r--test/rdoc/test_rdoc_generator_markup.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_pot.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_pot_po_entry.rb3
-rw-r--r--test/rdoc/test_rdoc_generator_ri.rb12
-rw-r--r--test/rdoc/test_rdoc_i18n_locale.rb11
-rw-r--r--test/rdoc/test_rdoc_i18n_text.rb5
-rw-r--r--test/rdoc/test_rdoc_include.rb1
-rw-r--r--test/rdoc/test_rdoc_markdown.rb42
-rw-r--r--test/rdoc/test_rdoc_markdown_test.rb13
-rw-r--r--test/rdoc/test_rdoc_markup.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_attribute_manager.rb51
-rw-r--r--test/rdoc/test_rdoc_markup_attributes.rb11
-rw-r--r--test/rdoc/test_rdoc_markup_document.rb5
-rw-r--r--test/rdoc/test_rdoc_markup_formatter.rb60
-rw-r--r--test/rdoc/test_rdoc_markup_hard_break.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_heading.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_include.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_indented_paragraph.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_paragraph.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_parser.rb76
-rw-r--r--test/rdoc/test_rdoc_markup_pre_process.rb24
-rw-r--r--test/rdoc/test_rdoc_markup_raw.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_bs.rb18
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb164
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb103
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_snippet.rb24
-rw-r--r--test/rdoc/test_rdoc_markup_to_joined_paragraph.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_label.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_markdown.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_rdoc.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_table_of_contents.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_to_tt_only.rb3
-rw-r--r--test/rdoc/test_rdoc_markup_verbatim.rb3
-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.rb118
-rw-r--r--test/rdoc/test_rdoc_parser.rb32
-rw-r--r--test/rdoc/test_rdoc_parser_c.rb143
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb7
-rw-r--r--test/rdoc/test_rdoc_parser_markdown.rb3
-rw-r--r--test/rdoc/test_rdoc_parser_rd.rb3
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb1294
-rw-r--r--test/rdoc/test_rdoc_parser_simple.rb3
-rw-r--r--test/rdoc/test_rdoc_rd.rb3
-rw-r--r--test/rdoc/test_rdoc_rd_block_parser.rb5
-rw-r--r--test/rdoc/test_rdoc_rd_inline.rb3
-rw-r--r--test/rdoc/test_rdoc_rd_inline_parser.rb3
-rw-r--r--test/rdoc/test_rdoc_rdoc.rb178
-rw-r--r--test/rdoc/test_rdoc_require.rb7
-rw-r--r--test/rdoc/test_rdoc_ri_driver.rb226
-rw-r--r--test/rdoc/test_rdoc_ri_paths.rb7
-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.rb21
-rw-r--r--test/rdoc/test_rdoc_servlet.rb52
-rw-r--r--test/rdoc/test_rdoc_single_class.rb3
-rw-r--r--test/rdoc/test_rdoc_stats.rb3
-rw-r--r--test/rdoc/test_rdoc_store.rb55
-rw-r--r--test/rdoc/test_rdoc_task.rb20
-rw-r--r--test/rdoc/test_rdoc_text.rb74
-rw-r--r--test/rdoc/test_rdoc_token_stream.rb40
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb67
-rw-r--r--test/rdoc/test_rdoc_top_level.rb3
-rw-r--r--test/rdoc/xref_data.rb59
-rw-r--r--test/rdoc/xref_test_case.rb27
-rw-r--r--test/readline/helper.rb20
-rw-r--r--test/readline/test_readline.rb460
-rw-r--r--test/readline/test_readline_history.rb184
-rw-r--r--test/reline/helper.rb90
-rw-r--r--test/reline/test_config.rb198
-rw-r--r--test/reline/test_history.rb273
-rw-r--r--test/reline/test_key_actor_emacs.rb1861
-rw-r--r--test/reline/test_key_actor_vi.rb1095
-rw-r--r--test/reline/test_key_stroke.rb38
-rw-r--r--test/reline/test_kill_ring.rb256
-rw-r--r--test/reline/test_macro.rb38
-rw-r--r--test/reline/test_reline.rb270
-rw-r--r--test/reline/test_string_processing.rb23
-rw-r--r--test/reline/test_within_pipe.rb57
-rw-r--r--test/resolv/test_addr.rb12
-rw-r--r--test/resolv/test_dns.rb114
-rw-r--r--test/resolv/test_mdns.rb27
-rw-r--r--test/resolv/test_resource.rb5
-rw-r--r--test/rexml/data/t75.xml2
-rw-r--r--test/rexml/formatter/test_default.rb19
-rw-r--r--test/rexml/functions/test_base.rb261
-rw-r--r--test/rexml/functions/test_boolean.rb75
-rw-r--r--test/rexml/functions/test_local_name.rb44
-rw-r--r--test/rexml/functions/test_number.rb38
-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_element.rb51
-rw-r--r--test/rexml/parse/test_notation_declaration.rb1
-rw-r--r--test/rexml/parse/test_processing_instruction.rb25
-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.rb3
-rw-r--r--test/rexml/parser/test_ultra_light.rb3
-rw-r--r--test/rexml/rexml_test_utils.rb6
-rw-r--r--test/rexml/test_attribute.rb14
-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.rb84
-rw-r--r--test/rexml/test_doctype.rb135
-rw-r--r--test/rexml/test_document.rb1
-rw-r--r--test/rexml/test_element.rb18
-rw-r--r--test/rexml/test_elements.rb1
-rw-r--r--test/rexml/test_encoding.rb1
-rw-r--r--test/rexml/test_entity.rb5
-rw-r--r--test/rexml/test_functions.rb224
-rw-r--r--test/rexml/test_functions_number.rb34
-rw-r--r--test/rexml/test_instruction.rb14
-rw-r--r--test/rexml/test_jaxen.rb190
-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.rb3
-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.rb5
-rw-r--r--test/rexml/test_text.rb56
-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.rb19
-rw-r--r--test/rexml/xpath/test_attribute.rb11
-rw-r--r--test/rexml/xpath/test_axis_preceding_sibling.rb1
-rw-r--r--test/rexml/xpath/test_base.rb134
-rw-r--r--test/rexml/xpath/test_compare.rb256
-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.rb179
-rw-r--r--test/rinda/test_tuplebag.rb1
-rw-r--r--test/ripper/assert_parse_files.rb32
-rw-r--r--test/ripper/dummyparser.rb66
-rw-r--r--test/ripper/test_files.rb23
-rw-r--r--test/ripper/test_files_ext.rb8
-rw-r--r--test/ripper/test_files_lib.rb14
-rw-r--r--test/ripper/test_files_sample.rb8
-rw-r--r--test/ripper/test_files_test.rb8
-rw-r--r--test/ripper/test_files_test_1.rb9
-rw-r--r--test/ripper/test_files_test_2.rb9
-rw-r--r--test/ripper/test_filter.rb14
-rw-r--r--test/ripper/test_lexer.rb141
-rw-r--r--test/ripper/test_parser_events.rb401
-rw-r--r--test/ripper/test_ripper.rb84
-rw-r--r--test/ripper/test_scanner_events.rb192
-rw-r--r--test/ripper/test_sexp.rb424
-rw-r--r--test/rss/rss-assertions.rb64
-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.rb13
-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.rb24
-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.rb59
-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.rb25
-rw-r--r--test/rss/test_trackback.rb1
-rw-r--r--test/rss/test_version.rb9
-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.rb307
-rw-r--r--test/ruby/enc/test_case_mapping.rb231
-rw-r--r--test/ruby/enc/test_case_options.rb81
-rw-r--r--test/ruby/enc/test_cesu8.rb109
-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_emoji_breaks.rb122
-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.rb95
-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.rb1
-rw-r--r--test/ruby/endblockwarn_rb12
-rw-r--r--test/ruby/lbtest.rb6
-rw-r--r--test/ruby/marshaltestlib.rb5
-rw-r--r--test/ruby/sentence.rb3
-rw-r--r--test/ruby/test_alias.rb52
-rw-r--r--test/ruby/test_argf.rb781
-rw-r--r--test/ruby/test_arithmetic_sequence.rb489
-rw-r--r--test/ruby/test_arity.rb45
-rw-r--r--test/ruby/test_array.rb940
-rw-r--r--test/ruby/test_assignment.rb58
-rw-r--r--test/ruby/test_ast.rb315
-rw-r--r--test/ruby/test_autoload.rb268
-rw-r--r--test/ruby/test_backtrace.rb114
-rw-r--r--test/ruby/test_basicinstructions.rb34
-rw-r--r--test/ruby/test_beginendblock.rb211
-rw-r--r--test/ruby/test_bignum.rb238
-rw-r--r--test/ruby/test_call.rb68
-rw-r--r--test/ruby/test_case.rb24
-rw-r--r--test/ruby/test_class.rb309
-rw-r--r--test/ruby/test_clone.rb36
-rw-r--r--test/ruby/test_comparable.rb59
-rw-r--r--test/ruby/test_complex.rb433
-rw-r--r--test/ruby/test_complex2.rb1
-rw-r--r--test/ruby/test_complexrational.rb27
-rw-r--r--test/ruby/test_condition.rb1
-rw-r--r--test/ruby/test_const.rb27
-rw-r--r--test/ruby/test_continuation.rb27
-rw-r--r--test/ruby/test_default_gems.rb16
-rw-r--r--test/ruby/test_defined.rb24
-rw-r--r--test/ruby/test_dir.rb215
-rw-r--r--test/ruby/test_dir_m17n.rb118
-rw-r--r--test/ruby/test_econv.rb21
-rw-r--r--test/ruby/test_encoding.rb21
-rw-r--r--test/ruby/test_enum.rb555
-rw-r--r--test/ruby/test_enumerator.rb275
-rw-r--r--test/ruby/test_env.rb224
-rw-r--r--test/ruby/test_eval.rb107
-rw-r--r--test/ruby/test_exception.rb754
-rw-r--r--test/ruby/test_fiber.rb154
-rw-r--r--test/ruby/test_file.rb170
-rw-r--r--test/ruby/test_file_exhaustive.rb1242
-rw-r--r--test/ruby/test_fixnum.rb39
-rw-r--r--test/ruby/test_flip.rb34
-rw-r--r--test/ruby/test_float.rb296
-rw-r--r--test/ruby/test_fnmatch.rb38
-rw-r--r--test/ruby/test_gc.rb119
-rw-r--r--test/ruby/test_gc_compact.rb63
-rw-r--r--test/ruby/test_hash.rb533
-rw-r--r--test/ruby/test_ifunless.rb3
-rw-r--r--test/ruby/test_integer.rb518
-rw-r--r--test/ruby/test_integer_comb.rb99
-rw-r--r--test/ruby/test_io.rb1094
-rw-r--r--test/ruby/test_io_m17n.rb181
-rw-r--r--test/ruby/test_iseq.rb435
-rw-r--r--test/ruby/test_iterator.rb40
-rw-r--r--test/ruby/test_jit.rb1070
-rw-r--r--test/ruby/test_key_error.rb42
-rw-r--r--test/ruby/test_keyword.rb4493
-rw-r--r--test/ruby/test_lambda.rb121
-rw-r--r--test/ruby/test_lazy_enumerator.rb191
-rw-r--r--test/ruby/test_literal.rb163
-rw-r--r--test/ruby/test_m17n.rb132
-rw-r--r--test/ruby/test_m17n_comb.rb24
-rw-r--r--test/ruby/test_marshal.rb234
-rw-r--r--test/ruby/test_math.rb152
-rw-r--r--test/ruby/test_metaclass.rb1
-rw-r--r--test/ruby/test_method.rb463
-rw-r--r--test/ruby/test_mixed_unicode_escapes.rb11
-rw-r--r--test/ruby/test_module.rb622
-rw-r--r--test/ruby/test_not.rb3
-rw-r--r--test/ruby/test_notimp.rb3
-rw-r--r--test/ruby/test_numeric.rb317
-rw-r--r--test/ruby/test_object.rb221
-rw-r--r--test/ruby/test_objectspace.rb114
-rw-r--r--test/ruby/test_optimization.rb609
-rw-r--r--test/ruby/test_pack.rb152
-rw-r--r--test/ruby/test_parse.rb738
-rw-r--r--test/ruby/test_path.rb12
-rw-r--r--test/ruby/test_pattern_matching.rb1314
-rw-r--r--test/ruby/test_pipe.rb20
-rw-r--r--test/ruby/test_primitive.rb3
-rw-r--r--test/ruby/test_proc.rb395
-rw-r--r--test/ruby/test_process.rb616
-rw-r--r--test/ruby/test_rand.rb83
-rw-r--r--test/ruby/test_range.rb514
-rw-r--r--test/ruby/test_rational.rb405
-rw-r--r--test/ruby/test_rational2.rb1
-rw-r--r--test/ruby/test_readpartial.rb5
-rw-r--r--test/ruby/test_refinement.rb1052
-rw-r--r--test/ruby/test_regexp.rb237
-rw-r--r--test/ruby/test_require.rb297
-rw-r--r--test/ruby/test_require_lib.rb28
-rw-r--r--test/ruby/test_rubyoptions.rb577
-rw-r--r--test/ruby/test_rubyvm.rb3
-rw-r--r--test/ruby/test_rubyvm_mjit.rb91
-rw-r--r--test/ruby/test_settracefunc.rb973
-rw-r--r--test/ruby/test_signal.rb137
-rw-r--r--test/ruby/test_sleep.rb1
-rw-r--r--test/ruby/test_sprintf.rb132
-rw-r--r--test/ruby/test_sprintf_comb.rb1
-rw-r--r--test/ruby/test_string.rb1220
-rw-r--r--test/ruby/test_stringchar.rb1
-rw-r--r--test/ruby/test_struct.rb98
-rw-r--r--test/ruby/test_super.rb74
-rw-r--r--test/ruby/test_symbol.rb302
-rw-r--r--test/ruby/test_syntax.rb1039
-rw-r--r--test/ruby/test_system.rb42
-rw-r--r--test/ruby/test_thread.rb614
-rw-r--r--test/ruby/test_thread_cv.rb245
-rw-r--r--test/ruby/test_thread_queue.rb626
-rw-r--r--test/ruby/test_threadgroup.rb2
-rw-r--r--test/ruby/test_time.rb224
-rw-r--r--test/ruby/test_time_tz.rb402
-rw-r--r--test/ruby/test_trace.rb12
-rw-r--r--test/ruby/test_transcode.rb155
-rw-r--r--test/ruby/test_undef.rb3
-rw-r--r--test/ruby/test_unicode_escape.rb20
-rw-r--r--test/ruby/test_variable.rb115
-rw-r--r--test/ruby/test_vm_dump.rb21
-rw-r--r--test/ruby/test_weakmap.rb56
-rw-r--r--test/ruby/test_whileuntil.rb3
-rw-r--r--test/ruby/test_yield.rb24
-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.rb12
-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.rb3
-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.rb6
-rw-r--r--test/rubygems/sff/discover.rb1
-rw-r--r--test/rubygems/simple_gem.rb5
-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.rb19
-rw-r--r--test/rubygems/test_deprecate.rb4
-rw-r--r--test/rubygems/test_gem.rb1007
-rw-r--r--test/rubygems/test_gem_available_set.rb9
-rw-r--r--test/rubygems/test_gem_bundler_version_finder.rb132
-rw-r--r--test/rubygems/test_gem_command.rb140
-rw-r--r--test/rubygems/test_gem_command_manager.rb24
-rw-r--r--test/rubygems/test_gem_commands_build_command.rb404
-rw-r--r--test/rubygems/test_gem_commands_cert_command.rb154
-rw-r--r--test/rubygems/test_gem_commands_check_command.rb3
-rw-r--r--test/rubygems/test_gem_commands_cleanup_command.rb135
-rw-r--r--test/rubygems/test_gem_commands_contents_command.rb4
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb76
-rw-r--r--test/rubygems/test_gem_commands_environment_command.rb16
-rw-r--r--test/rubygems/test_gem_commands_fetch_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_generate_index_command.rb38
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb11
-rw-r--r--test/rubygems/test_gem_commands_info_command.rb45
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb421
-rw-r--r--test/rubygems/test_gem_commands_list_command.rb1
-rw-r--r--test/rubygems/test_gem_commands_lock_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_mirror.rb13
-rw-r--r--test/rubygems/test_gem_commands_open_command.rb62
-rw-r--r--test/rubygems/test_gem_commands_outdated_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_owner_command.rb174
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb227
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb179
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb543
-rw-r--r--test/rubygems/test_gem_commands_search_command.rb2
-rw-r--r--test/rubygems/test_gem_commands_server_command.rb10
-rw-r--r--test/rubygems/test_gem_commands_setup_command.rb288
-rw-r--r--test/rubygems/test_gem_commands_signin_command.rb99
-rw-r--r--test/rubygems/test_gem_commands_signout_command.rb37
-rw-r--r--test/rubygems/test_gem_commands_sources_command.rb154
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb14
-rw-r--r--test/rubygems/test_gem_commands_stale_command.rb8
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb338
-rw-r--r--test/rubygems/test_gem_commands_unpack_command.rb33
-rw-r--r--test/rubygems/test_gem_commands_update_command.rb191
-rw-r--r--test/rubygems/test_gem_commands_which_command.rb9
-rw-r--r--test/rubygems/test_gem_commands_yank_command.rb71
-rw-r--r--test/rubygems/test_gem_config_file.rb46
-rw-r--r--test/rubygems/test_gem_dependency.rb50
-rw-r--r--test/rubygems/test_gem_dependency_installer.rb153
-rw-r--r--test/rubygems/test_gem_dependency_list.rb49
-rw-r--r--test/rubygems/test_gem_dependency_resolution_error.rb2
-rw-r--r--test/rubygems/test_gem_doctor.rb10
-rw-r--r--test/rubygems/test_gem_ext_builder.rb54
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb16
-rw-r--r--test/rubygems/test_gem_ext_configure_builder.rb29
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb97
-rw-r--r--test/rubygems/test_gem_ext_rake_builder.rb69
-rw-r--r--test/rubygems/test_gem_gem_runner.rb6
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb67
-rw-r--r--test/rubygems/test_gem_impossible_dependencies_error.rb2
-rw-r--r--test/rubygems/test_gem_indexer.rb97
-rw-r--r--test/rubygems/test_gem_install_update_options.rb87
-rw-r--r--test/rubygems/test_gem_installer.rb1143
-rw-r--r--test/rubygems/test_gem_local_remote_options.rb7
-rw-r--r--test/rubygems/test_gem_name_tuple.rb2
-rw-r--r--test/rubygems/test_gem_package.rb432
-rw-r--r--test/rubygems/test_gem_package_old.rb113
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb64
-rw-r--r--test/rubygems/test_gem_package_tar_reader.rb2
-rw-r--r--test/rubygems/test_gem_package_tar_reader_entry.rb34
-rw-r--r--test/rubygems/test_gem_package_tar_writer.rb99
-rw-r--r--test/rubygems/test_gem_package_task.rb10
-rw-r--r--test/rubygems/test_gem_path_support.rb90
-rw-r--r--test/rubygems/test_gem_platform.rb27
-rw-r--r--test/rubygems/test_gem_rdoc.rb141
-rw-r--r--test/rubygems/test_gem_remote_fetcher.rb450
-rw-r--r--test/rubygems/test_gem_request.rb179
-rw-r--r--test/rubygems/test_gem_request_connection_pools.rb50
-rw-r--r--test/rubygems/test_gem_request_set.rb83
-rw-r--r--test/rubygems/test_gem_request_set_gem_dependency_api.rb246
-rw-r--r--test/rubygems/test_gem_request_set_lockfile.rb860
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_parser.rb545
-rw-r--r--test/rubygems/test_gem_request_set_lockfile_tokenizer.rb308
-rw-r--r--test/rubygems/test_gem_requirement.rb57
-rw-r--r--test/rubygems/test_gem_resolver.rb182
-rw-r--r--test/rubygems/test_gem_resolver_activation_request.rb37
-rw-r--r--test/rubygems/test_gem_resolver_api_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_api_specification.rb26
-rw-r--r--test/rubygems/test_gem_resolver_best_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_composed_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_conflict.rb8
-rw-r--r--test/rubygems/test_gem_resolver_dependency_request.rb2
-rw-r--r--test/rubygems/test_gem_resolver_git_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_git_specification.rb6
-rw-r--r--test/rubygems/test_gem_resolver_index_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_index_specification.rb11
-rw-r--r--test/rubygems/test_gem_resolver_installed_specification.rb3
-rw-r--r--test/rubygems/test_gem_resolver_installer_set.rb30
-rw-r--r--test/rubygems/test_gem_resolver_local_specification.rb2
-rw-r--r--test/rubygems/test_gem_resolver_lock_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_lock_specification.rb19
-rw-r--r--test/rubygems/test_gem_resolver_requirement_list.rb2
-rw-r--r--test/rubygems/test_gem_resolver_specification.rb6
-rw-r--r--test/rubygems/test_gem_resolver_vendor_set.rb2
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb2
-rw-r--r--test/rubygems/test_gem_security.rb18
-rw-r--r--test/rubygems/test_gem_security_policy.rb66
-rw-r--r--test/rubygems/test_gem_security_signer.rb29
-rw-r--r--test/rubygems/test_gem_security_trust_dir.rb10
-rw-r--r--test/rubygems/test_gem_server.rb234
-rw-r--r--test/rubygems/test_gem_silent_ui.rb2
-rw-r--r--test/rubygems/test_gem_source.rb51
-rw-r--r--test/rubygems/test_gem_source_fetch_problem.rb11
-rw-r--r--test/rubygems/test_gem_source_git.rb17
-rw-r--r--test/rubygems/test_gem_source_installed.rb14
-rw-r--r--test/rubygems/test_gem_source_list.rb8
-rw-r--r--test/rubygems/test_gem_source_local.rb10
-rw-r--r--test/rubygems/test_gem_source_lock.rb26
-rw-r--r--test/rubygems/test_gem_source_specific_file.rb14
-rw-r--r--test/rubygems/test_gem_source_vendor.rb10
-rw-r--r--test/rubygems/test_gem_spec_fetcher.rb22
-rw-r--r--test/rubygems/test_gem_specification.rb1446
-rw-r--r--test/rubygems/test_gem_stream_ui.rb54
-rw-r--r--test/rubygems/test_gem_stub_specification.rb129
-rw-r--r--test/rubygems/test_gem_text.rb24
-rw-r--r--test/rubygems/test_gem_uninstaller.rb94
-rw-r--r--test/rubygems/test_gem_unsatisfiable_dependency_error.rb2
-rw-r--r--test/rubygems/test_gem_uri_formatter.rb2
-rw-r--r--test/rubygems/test_gem_util.rb63
-rw-r--r--test/rubygems/test_gem_validator.rb9
-rw-r--r--test/rubygems/test_gem_version.rb143
-rw-r--r--test/rubygems/test_gem_version_option.rb17
-rw-r--r--test/rubygems/test_kernel.rb39
-rw-r--r--test/rubygems/test_project_sanity.rb15
-rw-r--r--test/rubygems/test_remote_fetch_error.rb21
-rw-r--r--test/rubygems/test_require.rb559
-rw-r--r--test/rubygems/wrong_key_cert.pem19
-rw-r--r--test/rubygems/wrong_key_cert_32.pem19
-rw-r--r--test/runner.rb48
-rw-r--r--test/scanf/data.txt6
-rw-r--r--test/scanf/test_scanf.rb303
-rw-r--r--test/scanf/test_scanfblocks.rb81
-rw-r--r--test/scanf/test_scanfio.rb20
-rw-r--r--test/sdbm/test_sdbm.rb5
-rw-r--r--test/shell/test_command_processor.rb68
-rw-r--r--test/socket/test_addrinfo.rb40
-rw-r--r--test/socket/test_ancdata.rb2
-rw-r--r--test/socket/test_basicsocket.rb125
-rw-r--r--test/socket/test_nonblock.rb108
-rw-r--r--test/socket/test_socket.rb156
-rw-r--r--test/socket/test_sockopt.rb2
-rw-r--r--test/socket/test_tcp.rb21
-rw-r--r--test/socket/test_udp.rb48
-rw-r--r--test/socket/test_unix.rb49
-rw-r--r--test/stringio/test_stringio.rb244
-rw-r--r--test/strscan/test_stringscanner.rb346
-rw-r--r--test/syslog/test_syslog_logger.rb16
-rw-r--r--test/test_abbrev.rb1
-rw-r--r--test/test_cmath.rb16
-rw-r--r--test/test_delegate.rb97
-rw-r--r--test/test_extlibs.rb83
-rw-r--r--test/test_find.rb41
-rw-r--r--test/test_forwardable.rb185
-rw-r--r--test/test_ipaddr.rb128
-rw-r--r--test/test_mathn.rb119
-rw-r--r--test/test_mutex_m.rb4
-rw-r--r--test/test_observer.rb66
-rw-r--r--test/test_open3.rb73
-rw-r--r--test/test_pp.rb71
-rw-r--r--test/test_prettyprint.rb14
-rw-r--r--test/test_prime.rb222
-rw-r--r--test/test_pstore.rb24
-rw-r--r--test/test_pty.rb8
-rw-r--r--test/test_rbconfig.rb1
-rw-r--r--test/test_securerandom.rb106
-rw-r--r--test/test_set.rb347
-rw-r--r--test/test_shellwords.rb100
-rw-r--r--test/test_singleton.rb13
-rw-r--r--test/test_syslog.rb9
-rw-r--r--test/test_tempfile.rb130
-rw-r--r--test/test_time.rb93
-rw-r--r--test/test_timeout.rb24
-rw-r--r--test/test_tmpdir.rb41
-rw-r--r--test/test_tracer.rb186
-rw-r--r--test/test_tsort.rb2
-rw-r--r--test/test_unicode_normalize.rb54
-rw-r--r--test/test_weakref.rb3
-rw-r--r--test/test_win32api.rb4
-rw-r--r--test/testunit/test4test_hideskip.rb9
-rw-r--r--test/testunit/test4test_redefinition.rb13
-rw-r--r--test/testunit/test4test_sorting.rb17
-rw-r--r--test/testunit/test_assertion.rb8
-rw-r--r--test/testunit/test_hideskip.rb16
-rw-r--r--test/testunit/test_parallel.rb191
-rw-r--r--test/testunit/test_rake_integration.rb35
-rw-r--r--test/testunit/test_redefinition.rb15
-rw-r--r--test/testunit/test_sorting.rb17
-rw-r--r--test/testunit/tests_for_parallel/ptest_first.rb7
-rw-r--r--test/testunit/tests_for_parallel/ptest_forth.rb29
-rw-r--r--test/testunit/tests_for_parallel/ptest_second.rb11
-rw-r--r--test/testunit/tests_for_parallel/ptest_third.rb10
-rw-r--r--test/testunit/tests_for_parallel/runner.rb13
-rw-r--r--test/thread/test_cv.rb221
-rw-r--r--test/thread/test_queue.rb280
-rw-r--r--test/thread/test_sync.rb63
-rw-r--r--test/uri/test_common.rb4
-rw-r--r--test/uri/test_file.rb67
-rw-r--r--test/uri/test_ftp.rb1
-rw-r--r--test/uri/test_generic.rb257
-rw-r--r--test/uri/test_http.rb6
-rw-r--r--test/uri/test_ldap.rb1
-rw-r--r--test/uri/test_mailto.rb64
-rw-r--r--test/uri/test_parser.rb14
-rw-r--r--test/webrick/test_cgi.rb15
-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.rb84
-rw-r--r--test/webrick/test_htgroup.rb19
-rw-r--r--test/webrick/test_htmlutils.rb1
-rw-r--r--test/webrick/test_httpauth.rb274
-rw-r--r--test/webrick/test_httpproxy.rb202
-rw-r--r--test/webrick/test_httprequest.rb71
-rw-r--r--test/webrick/test_httpresponse.rb133
-rw-r--r--test/webrick/test_https.rb112
-rw-r--r--test/webrick/test_httpserver.rb133
-rw-r--r--test/webrick/test_httpstatus.rb35
-rw-r--r--test/webrick/test_httputils.rb1
-rw-r--r--test/webrick/test_httpversion.rb1
-rw-r--r--test/webrick/test_server.rb36
-rw-r--r--test/webrick/test_ssl_server.rb67
-rw-r--r--test/webrick/test_utils.rb98
-rw-r--r--test/webrick/utils.rb14
-rw-r--r--test/webrick/webrick.rhtml4
-rw-r--r--test/win32ole/available_ole.rb41
-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.rb3
-rw-r--r--test/win32ole/test_win32ole.rb60
-rw-r--r--test/win32ole/test_win32ole_event.rb103
-rw-r--r--test/win32ole/test_win32ole_method.rb14
-rw-r--r--test/win32ole/test_win32ole_method_event.rb36
-rw-r--r--test/win32ole/test_win32ole_param.rb54
-rw-r--r--test/win32ole/test_win32ole_param_event.rb30
-rw-r--r--test/win32ole/test_win32ole_record.rb128
-rw-r--r--test/win32ole/test_win32ole_type.rb53
-rw-r--r--test/win32ole/test_win32ole_type_event.rb44
-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.rb13
-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.rb322
-rw-r--r--test/xmlrpc/test_cookie.rb96
-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.rb135
-rw-r--r--test/xmlrpc/webrick_testing.rb55
-rw-r--r--test/yaml/test_store.rb180
-rw-r--r--test/zlib/test_zlib.rb179
-rw-r--r--thread.c3311
-rw-r--r--thread_pthread.c2015
-rw-r--r--thread_pthread.h49
-rw-r--r--thread_sync.c1540
-rw-r--r--thread_win32.c229
-rw-r--r--time.c2448
-rw-r--r--timev.h32
-rwxr-xr-xtool/actions-commit-info.sh17
-rw-r--r--tool/asm_parse.rb2
-rwxr-xr-xtool/bisect.sh44
-rwxr-xr-xtool/change_maker.rb34
-rwxr-xr-xtool/checksum.rb72
-rw-r--r--tool/colors3
-rwxr-xr-xtool/darwin-cc6
-rw-r--r--tool/downloader.rb296
-rw-r--r--tool/enc-emoji-citrus-gen.rb4
-rwxr-xr-xtool/enc-unicode.rb344
-rw-r--r--tool/eval.rb5
-rwxr-xr-xtool/expand-config.rb32
-rwxr-xr-xtool/extlibs.rb270
-rw-r--r--tool/fake.rb55
-rwxr-xr-xtool/fetch-bundled_gems.rb31
-rwxr-xr-xtool/file2lastrev.rb112
-rwxr-xr-xtool/format-release245
-rw-r--r--tool/gem-unpack.rb18
-rwxr-xr-xtool/gen-mailmap.rb47
-rwxr-xr-xtool/gen_dummy_probes.rb24
-rwxr-xr-xtool/gen_ruby_tapset.rb14
-rw-r--r--tool/generic_erb.rb41
-rwxr-xr-xtool/git-refresh46
-rw-r--r--tool/gperf.sed22
-rwxr-xr-xtool/id2token.rb6
-rwxr-xr-xtool/ifchange53
-rwxr-xr-xtool/insns2vm.rb18
-rw-r--r--tool/install-sh6
-rwxr-xr-xtool/instruction.rb1343
-rw-r--r--tool/jisx0208.rb84
-rwxr-xr-xtool/leaked-globals40
-rw-r--r--tool/lib/-test-/integer.rb14
-rw-r--r--tool/lib/colorize.rb51
-rw-r--r--tool/lib/envutil.rb342
-rw-r--r--tool/lib/find_executable.rb22
-rw-r--r--tool/lib/gc_compact_checker.rb10
-rw-r--r--tool/lib/iseq_loader_checker.rb81
-rw-r--r--tool/lib/jisx0208.rb86
-rw-r--r--tool/lib/leakchecker.rb240
-rw-r--r--tool/lib/memory_status.rb149
-rw-r--r--tool/lib/minitest/autorun.rb14
-rw-r--r--tool/lib/minitest/benchmark.rb418
-rw-r--r--tool/lib/minitest/mock.rb196
-rw-r--r--tool/lib/minitest/unit.rb1434
-rw-r--r--tool/lib/profile_test_all.rb91
-rw-r--r--tool/lib/test/unit.rb1219
-rw-r--r--tool/lib/test/unit/assertions.rb583
-rw-r--r--tool/lib/test/unit/core_assertions.rb420
-rw-r--r--tool/lib/test/unit/parallel.rb214
-rw-r--r--tool/lib/test/unit/testcase.rb36
-rw-r--r--tool/lib/tracepointchecker.rb126
-rw-r--r--tool/lib/vcs.rb752
-rw-r--r--tool/lib/zombie_hunter.rb10
-rw-r--r--tool/m4/_colorize_result_prepare.m433
-rw-r--r--tool/m4/ac_msg_result.m45
-rw-r--r--tool/m4/colorize_result.m49
-rw-r--r--tool/m4/ruby_append_option.m45
-rw-r--r--tool/m4/ruby_append_options.m47
-rw-r--r--tool/m4/ruby_check_builtin_func.m410
-rw-r--r--tool/m4/ruby_check_builtin_setjmp.m427
-rw-r--r--tool/m4/ruby_check_printf_prefix.m430
-rw-r--r--tool/m4/ruby_check_setjmp.m417
-rw-r--r--tool/m4/ruby_check_signedness.m45
-rw-r--r--tool/m4/ruby_check_sizeof.m4108
-rw-r--r--tool/m4/ruby_check_sysconf.m413
-rw-r--r--tool/m4/ruby_cppoutfile.m418
-rw-r--r--tool/m4/ruby_decl_attribute.m445
-rw-r--r--tool/m4/ruby_default_arch.m411
-rw-r--r--tool/m4/ruby_define_if.m412
-rw-r--r--tool/m4/ruby_defint.m440
-rw-r--r--tool/m4/ruby_dtrace_available.m420
-rw-r--r--tool/m4/ruby_dtrace_postprocess.m430
-rw-r--r--tool/m4/ruby_func_attribute.m47
-rw-r--r--tool/m4/ruby_mingw32.m424
-rw-r--r--tool/m4/ruby_prepend_option.m45
-rw-r--r--tool/m4/ruby_prog_gnu_ld.m410
-rw-r--r--tool/m4/ruby_replace_funcs.m413
-rw-r--r--tool/m4/ruby_replace_type.m458
-rw-r--r--tool/m4/ruby_rm_recursive.m418
-rw-r--r--tool/m4/ruby_setjmp_type.m452
-rw-r--r--tool/m4/ruby_stack_grow_direction.m430
-rw-r--r--tool/m4/ruby_try_cflags.m412
-rw-r--r--tool/m4/ruby_try_ldflags.m415
-rw-r--r--tool/m4/ruby_type_attribute.m48
-rw-r--r--tool/m4/ruby_universal_arch.m487
-rw-r--r--tool/m4/ruby_werror_flag.m418
-rwxr-xr-xtool/make-snapshot502
-rw-r--r--tool/make_hgraph.rb95
-rwxr-xr-xtool/mdoc2man.rb60
-rwxr-xr-xtool/merger.rb444
-rw-r--r--tool/mjit_archflag.sh40
-rw-r--r--tool/mk_builtin_binary.rb44
-rw-r--r--tool/mk_builtin_loader.rb201
-rw-r--r--tool/mk_call_iseq_optimized.rb74
-rwxr-xr-xtool/mkconfig.rb194
-rwxr-xr-xtool/mkrunnable.rb31
-rwxr-xr-xtool/node_name.rb12
-rw-r--r--tool/parse.rb3
-rw-r--r--tool/prereq.status44
-rwxr-xr-xtool/pure_parser.rb20
-rwxr-xr-xtool/rbinstall.rb512
-rwxr-xr-xtool/rbuninstall.rb4
-rwxr-xr-xtool/redmine-backporter.rb359
-rwxr-xr-xtool/release.sh47
-rwxr-xr-xtool/rmdirs3
-rw-r--r--tool/ruby_vm/controllers/application_controller.rb25
-rw-r--r--tool/ruby_vm/helpers/c_escape.rb128
-rw-r--r--tool/ruby_vm/helpers/dumper.rb112
-rw-r--r--tool/ruby_vm/helpers/scanner.rb52
-rw-r--r--tool/ruby_vm/loaders/insns_def.rb96
-rw-r--r--tool/ruby_vm/loaders/opt_insn_unif_def.rb34
-rw-r--r--tool/ruby_vm/loaders/opt_operand_def.rb56
-rw-r--r--tool/ruby_vm/loaders/vm_opts_h.rb37
-rw-r--r--tool/ruby_vm/models/attribute.rb59
-rwxr-xr-xtool/ruby_vm/models/bare_instructions.rb236
-rw-r--r--tool/ruby_vm/models/c_expr.rb41
-rw-r--r--tool/ruby_vm/models/instructions.rb22
-rw-r--r--tool/ruby_vm/models/instructions_unifications.rb43
-rw-r--r--tool/ruby_vm/models/operands_unifications.rb142
-rw-r--r--tool/ruby_vm/models/trace_instructions.rb71
-rw-r--r--tool/ruby_vm/models/typemap.rb63
-rw-r--r--tool/ruby_vm/scripts/converter.rb29
-rw-r--r--tool/ruby_vm/scripts/insns2vm.rb93
-rw-r--r--tool/ruby_vm/tests/.gitkeep0
-rw-r--r--tool/ruby_vm/views/_attributes.erb35
-rw-r--r--tool/ruby_vm/views/_c_expr.erb17
-rw-r--r--tool/ruby_vm/views/_comptime_insn_stack_increase.erb62
-rw-r--r--tool/ruby_vm/views/_copyright.erb31
-rw-r--r--tool/ruby_vm/views/_insn_entry.erb76
-rw-r--r--tool/ruby_vm/views/_insn_len_info.erb21
-rw-r--r--tool/ruby_vm/views/_insn_name_info.erb38
-rw-r--r--tool/ruby_vm/views/_insn_operand_info.erb46
-rw-r--r--tool/ruby_vm/views/_insn_sp_pc_dependency.erb27
-rw-r--r--tool/ruby_vm/views/_insn_type_chars.erb13
-rw-r--r--tool/ruby_vm/views/_leaf_helpers.erb108
-rw-r--r--tool/ruby_vm/views/_mjit_compile_insn.erb87
-rw-r--r--tool/ruby_vm/views/_mjit_compile_insn_body.erb115
-rw-r--r--tool/ruby_vm/views/_mjit_compile_ivar.erb54
-rw-r--r--tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb36
-rw-r--r--tool/ruby_vm/views/_mjit_compile_send.erb107
-rw-r--r--tool/ruby_vm/views/_notice.erb22
-rw-r--r--tool/ruby_vm/views/_sp_inc_helpers.erb37
-rw-r--r--tool/ruby_vm/views/_trace_instruction.erb16
-rw-r--r--tool/ruby_vm/views/insns.inc.erb26
-rw-r--r--tool/ruby_vm/views/insns_info.inc.erb22
-rw-r--r--tool/ruby_vm/views/mjit_compile.inc.erb93
-rw-r--r--tool/ruby_vm/views/opt_sc.inc.erb40
-rw-r--r--tool/ruby_vm/views/optinsn.inc.erb71
-rw-r--r--tool/ruby_vm/views/optunifs.inc.erb21
-rw-r--r--tool/ruby_vm/views/vm.inc.erb30
-rw-r--r--tool/ruby_vm/views/vmtc.inc.erb21
-rwxr-xr-xtool/rubytest.rb30
-rw-r--r--tool/run-gcov.rb54
-rw-r--r--tool/run-lcov.rb164
-rwxr-xr-xtool/runruby.rb107
-rwxr-xr-xtool/strip-rdoc.rb3
-rw-r--r--tool/sync_default_gems.rb407
-rw-r--r--tool/test-bundled-gems.rb28
-rw-r--r--tool/test-coverage.rb118
-rw-r--r--tool/test/minitest/metametameta.rb71
-rw-r--r--tool/test/minitest/test_minitest_benchmark.rb131
-rw-r--r--tool/test/minitest/test_minitest_mock.rb404
-rw-r--r--tool/test/minitest/test_minitest_unit.rb1790
-rw-r--r--tool/test/runner.rb23
-rw-r--r--tool/test/test_jisx0208.rb2
-rw-r--r--tool/test/testunit/test4test_hideskip.rb10
-rw-r--r--tool/test/testunit/test4test_redefinition.rb14
-rw-r--r--tool/test/testunit/test4test_sorting.rb18
-rw-r--r--tool/test/testunit/test_assertion.rb29
-rw-r--r--tool/test/testunit/test_hideskip.rb21
-rw-r--r--tool/test/testunit/test_parallel.rb204
-rw-r--r--tool/test/testunit/test_redefinition.rb16
-rw-r--r--tool/test/testunit/test_sorting.rb18
-rw-r--r--tool/test/testunit/tests_for_parallel/ptest_first.rb8
-rw-r--r--tool/test/testunit/tests_for_parallel/ptest_forth.rb30
-rw-r--r--tool/test/testunit/tests_for_parallel/ptest_second.rb12
-rw-r--r--tool/test/testunit/tests_for_parallel/ptest_third.rb11
-rw-r--r--tool/test/testunit/tests_for_parallel/runner.rb14
-rw-r--r--tool/transcode-tblgen.rb90
-rw-r--r--tool/transform_mjit_header.rb298
-rwxr-xr-xtool/travis_retry.sh13
-rwxr-xr-xtool/update-deps68
-rw-r--r--tool/vcs.rb256
-rw-r--r--tool/vpath.rb (renamed from tool/lib/vpath.rb)0
-rw-r--r--tool/vtlh.rb2
-rwxr-xr-xtool/ytab.sed60
-rw-r--r--trace_point.rb348
-rw-r--r--transcode.c62
-rw-r--r--transcode_data.h30
-rw-r--r--transient_heap.c940
-rw-r--r--transient_heap.h62
-rw-r--r--util.c3510
-rw-r--r--variable.c2512
-rw-r--r--variable.h9
-rw-r--r--version.c79
-rw-r--r--version.h61
-rw-r--r--vm.c2994
-rw-r--r--vm_args.c846
-rw-r--r--vm_backtrace.c329
-rw-r--r--vm_core.h1771
-rw-r--r--vm_debug.h3
-rw-r--r--vm_dump.c541
-rw-r--r--vm_eval.c1956
-rw-r--r--vm_exec.c41
-rw-r--r--vm_exec.h75
-rw-r--r--vm_insnhelper.c5035
-rw-r--r--vm_insnhelper.h258
-rw-r--r--vm_method.c1692
-rw-r--r--vm_opts.h36
-rw-r--r--vm_trace.c1335
-rw-r--r--vsnprintf.c83
-rw-r--r--warning.rb45
-rw-r--r--win32/.document1
-rw-r--r--win32/Makefile.sub548
-rw-r--r--win32/README.win32100
-rwxr-xr-xwin32/configure.bat55
-rw-r--r--win32/dir.h16
-rw-r--r--win32/file.c296
-rw-r--r--win32/file.h48
-rwxr-xr-xwin32/ifchange.bat35
-rwxr-xr-xwin32/mkexports.rb15
-rwxr-xr-xwin32/resource.rb3
-rwxr-xr-xwin32/rm.bat2
-rwxr-xr-xwin32/rmdirs.bat1
-rw-r--r--[-rwxr-xr-x]win32/rtname.cmd33
-rw-r--r--win32/setup.mak135
-rw-r--r--win32/stub.c42
-rw-r--r--win32/win32.c2731
10279 files changed, 455455 insertions, 813549 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
deleted file mode 100644
index 7c32d1f7ee..0000000000
--- a/.dir-locals.el
+++ /dev/null
@@ -1,37 +0,0 @@
-;; Copyright (c) 2018 Urabe, Shyouhei. All rights reserved.
-;;
-;; This file is a part of the programming language Ruby. Permission is hereby
-;; granted, to either redistribute and/or modify this file, provided that the
-;; conditions mentioned in the file COPYING are met. Consult the file for
-;; details.
-
-((nil .
- ((indent-tabs-mode . nil)
- (require-final-newline . t)
- (tab-width . 8)
- (show-trailing-whitespace . t)
- (whitespace-line-column . 80))) ;; See also [Misc #12277]
-
- ;; (bat-mode . ((buffer-file-coding-system . utf-8-dos)))
-
- (ruby-mode . ((ruby-indent-level . 2)))
-
- (rdoc-mode . ((fill-column . 74)))
-
- (yaml-mode . ((yaml-indent-offset . 2)))
-
- (makefile-mode . ((indent-tabs-mode . t)))
-
- (c-mode . ((c-file-style . "ruby")))
-
- (change-log-mode .
- ((buffer-file-coding-system . us-ascii)
- (indent-tabs-mode . t)
- (change-log-indent-text . 2)
- (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)))))))
diff --git a/.document b/.document
index 8a418e5d4a..9a5067bc52 100644
--- a/.document
+++ b/.document
@@ -5,18 +5,9 @@
# Process all the C source files
*.c
-*.y
# prelude
prelude.rb
-rbconfig.rb
-
-ast.rb
-gc.rb
-io.rb
-pack.rb
-trace_point.rb
-warning.rb
# the lib/ directory (which has its own .document file)
lib
@@ -25,18 +16,13 @@ lib
ext
# rdoc files
-NEWS
-
-README.md
-README.ja.md
+ChangeLog
-COPYING
-COPYING.ja
-CONTRIBUTING.md
-
-LEGAL
+NEWS
-# win32/README.win32 linked from README.md
-win32
+README
+README.EXT
+README.EXT.ja
+README.ja
doc
diff --git a/.editorconfig b/.editorconfig
index 4633a7acae..67abf4b978 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -2,29 +2,15 @@ root = true
[*]
end_of_line = lf
-indent_size = 4
-indent_style = space
insert_final_newline = true
-tab_width = 8
trim_trailing_whitespace = true
-
-[*.bat]
-end_of_line = crlf
-
-[*.gemspec]
-indent_size = 2
-
-[*.rb]
-indent_size = 2
-
-[*.yml]
-indent_size = 2
-
-[{*[Mm]akefile*,*.mak,*.mk,depend}]
+tab_width = 8
indent_style = tab
+indent_size = 4
-[enc/*]
-indent_size = 2
+[**.bat]
+end_of_line = crlf
-[reg*.[ch]]
+[**.rb]
+indent_style = space
indent_size = 2
diff --git a/.gdbinit b/.gdbinit
index 0d44622691..d1279ea046 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,5 +1,3 @@
-set startup-with-shell off
-
define hook-run
set $color_type = 0
set $color_highlite = 0
@@ -65,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
@@ -99,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
@@ -128,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
@@ -144,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
@@ -156,27 +145,34 @@ define rp
else
if ($flags & RUBY_T_MASK) == RUBY_T_HASH
printf "%sT_HASH%s: ", $color_type, $color_end,
- if (((struct RHash *)($arg0))->basic->flags & RHASH_ST_TABLE_FLAG)
- printf "st len=%ld ", ((struct RHash *)($arg0))->as.st->num_entries
- else
- printf "li len=%ld bound=%ld ", \
- ((((struct RHash *)($arg0))->basic->flags & RHASH_AR_TABLE_SIZE_MASK) >> RHASH_AR_TABLE_SIZE_SHIFT), \
- ((((struct RHash *)($arg0))->basic->flags & RHASH_AR_TABLE_BOUND_MASK) >> RHASH_AR_TABLE_BOUND_SHIFT)
+ if ((struct RHash *)($arg0))->ntbl
+ printf "len=%ld ", ((struct RHash *)($arg0))->ntbl->num_entries
end
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
@@ -249,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)
@@ -299,7 +289,6 @@ define rp
end
end
end
- end
end
document rp
Print a Ruby's VALUE.
@@ -331,9 +320,6 @@ define rp_id
if $id == idLTLT
printf "(:<<)\n"
else
- if $id == idGTGT
- printf "(:>>)\n"
- else
if $id == idLE
printf "(:<=)\n"
else
@@ -361,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
@@ -404,13 +378,12 @@ define rp_id
end
end
printf "(%ld): ", $id
- print_id $id
- echo \n
- end
- end
- end
- end
- end
+ set $str = lookup_id_str($id)
+ if $str
+ rp_string $str
+ else
+ echo undef\n
+ end
end
end
end
@@ -433,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
@@ -492,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
@@ -704,6 +569,12 @@ define nd_cval
rp ($arg0).u3.value
end
+
+define nd_cnt
+ printf "%su3.cnt%s: ", $color_highlite, $color_end
+ p ($arg0).u3.cnt
+end
+
define nd_tbl
printf "%su1.tbl%s: ", $color_highlite, $color_end
p ($arg0).u1.tbl
@@ -742,6 +613,12 @@ define nd_lit
rp ($arg0).u1.value
end
+
+define nd_frml
+ printf "%su1.node%s: ", $color_highlite, $color_end
+ rp ($arg0).u1.node
+end
+
define nd_rest
printf "%su2.argc%s: ", $color_highlite, $color_end
p ($arg0).u2.argc
@@ -768,6 +645,12 @@ define nd_args
rp ($arg0).u3.node
end
+
+define nd_noex
+ printf "%su1.id%s: ", $color_highlite, $color_end
+ p ($arg0).u1.id
+end
+
define nd_defn
printf "%su3.node%s: ", $color_highlite, $color_end
rp ($arg0).u3.node
@@ -785,6 +668,17 @@ define nd_new
end
+define nd_cfnc
+ printf "%su1.cfunc%s: ", $color_highlite, $color_end
+ p ($arg0).u1.cfunc
+end
+
+define nd_argc
+ printf "%su2.argc%s: ", $color_highlite, $color_end
+ p ($arg0).u2.argc
+end
+
+
define nd_cname
printf "%su1.id%s: ", $color_highlite, $color_end
p ($arg0).u1.id
@@ -846,7 +740,7 @@ 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))
+ call dump_node((VALUE)($buf), rb_str_new(0, 0), 0, ($arg0))
printf "%s\n", $buf->as.heap.ptr
end
@@ -917,7 +811,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
@@ -966,7 +861,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
@@ -974,304 +869,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 $index = 0
- set $size = $iseq->body->insns_info.size
- set $table = $iseq->body->insns_info.body
- set $positions = $iseq->body->insns_info.positions
- #printf "size: %d\n", $size
- if $size == 0
- else
- if $size == 1
- printf "%d", $table[0].line_no
- else
- if $positions
- # get_insn_info_linear_search
- set $index = 1
- while $index < $size
- #printf "table[%d]: position: %d, line: %d, pos: %d\n", $i, $positions[$i], $table[$i].line_no, $pos
- if $positions[$index] > $pos
- loop_break
- end
- set $index = $index + 1
- if $positions[$index] == $pos
- loop_break
- end
- end
- else
- # get_insn_info_succinct_bitvector
- set $sd = $iseq->body->insns_info.succ_index_table
- set $immediate_table_size = sizeof($sd->imm_part) / sizeof(uint64_t) * 9
- if $pos < $immediate_table_size
- set $i = $pos / 9
- set $j = $pos % 9
- set $index = ((int)($sd->imm_part[$i] >> ($j * 7))) & 0x7f
- else
- set $block_index = ($pos - $immediate_table_size) / 512
- set $block = &$sd->succ_part[$block_index]
- set $block_bit_index = ($pos - $immediate_table_size) % 512
- set $small_block_index = $block_bit_index / 64
- set $small_block_popcount = $small_block_index == 0 ? 0 : (((int)($block->small_block_ranks >> (($small_block_index - 1) * 9))) & 0x1ff)
- set $x = $block->bits[$small_block_index] << (63 - $block_bit_index % 64)
- set $x = ($x & 0x5555555555555555) + ($x >> 1 & 0x5555555555555555)
- set $x = ($x & 0x3333333333333333) + ($x >> 2 & 0x3333333333333333)
- set $x = ($x & 0x0707070707070707) + ($x >> 4 & 0x0707070707070707)
- set $x = ($x & 0x001f001f001f001f) + ($x >> 8 & 0x001f001f001f001f)
- set $x = ($x & 0x0000003f0000003f) + ($x >>16 & 0x0000003f0000003f)
- set $popcnt = ($x & 0x7f) + ($x >>32 & 0x7f)
- set $index = $block->rank + $small_block_popcount + $popcnt
- end
- end
- printf "%d", $table[$index-1].line_no
- end
- 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
+ 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
-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 <= ruby_global_symbols.last_id
- set $idx = $serial / ID_ENTRY_UNIT
- set $ids = (struct RArray *)ruby_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
@@ -1290,57 +914,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
-
-define print_flags
- printf "RUBY_FL_WB_PROTECTED: %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_WB_PROTECTED ? "1" : "0"
- printf "RUBY_FL_PROMOTED0 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_PROMOTED0 ? "1" : "0"
- printf "RUBY_FL_PROMOTED1 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_PROMOTED1 ? "1" : "0"
- printf "RUBY_FL_FINALIZE : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_FINALIZE ? "1" : "0"
- printf "RUBY_FL_TAINT : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_TAINT ? "1" : "0"
- printf "RUBY_FL_UNTRUSTED : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_UNTRUSTED ? "1" : "0"
- printf "RUBY_FL_EXIVAR : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_EXIVAR ? "1" : "0"
- printf "RUBY_FL_FREEZE : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_FREEZE ? "1" : "0"
-
- printf "RUBY_FL_USER0 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER0 ? "1" : "0"
- printf "RUBY_FL_USER1 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER1 ? "1" : "0"
- printf "RUBY_FL_USER2 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER2 ? "1" : "0"
- printf "RUBY_FL_USER3 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER3 ? "1" : "0"
- printf "RUBY_FL_USER4 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER4 ? "1" : "0"
- printf "RUBY_FL_USER5 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER5 ? "1" : "0"
- printf "RUBY_FL_USER6 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER6 ? "1" : "0"
- printf "RUBY_FL_USER7 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER7 ? "1" : "0"
- printf "RUBY_FL_USER8 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER8 ? "1" : "0"
- printf "RUBY_FL_USER9 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER9 ? "1" : "0"
- printf "RUBY_FL_USER10 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER10 ? "1" : "0"
- printf "RUBY_FL_USER11 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER11 ? "1" : "0"
- printf "RUBY_FL_USER12 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER12 ? "1" : "0"
- printf "RUBY_FL_USER13 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER13 ? "1" : "0"
- printf "RUBY_FL_USER14 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER14 ? "1" : "0"
- printf "RUBY_FL_USER15 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER15 ? "1" : "0"
- printf "RUBY_FL_USER16 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER16 ? "1" : "0"
- printf "RUBY_FL_USER17 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER17 ? "1" : "0"
- printf "RUBY_FL_USER18 : %s\n", ((struct RBasic*)($arg0))->flags & RUBY_FL_USER18 ? "1" : "0"
-end
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index d0c2d266b4..0000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,8 +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
-tool/format-release diff=ruby
-tool/leaked-globals diff=ruby
diff --git a/.github/SECURITY.md b/.github/SECURITY.md
deleted file mode 100644
index 56baa29942..0000000000
--- a/.github/SECURITY.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Security Policy
-
-## Supported Versions
-
-See <https://www.ruby-lang.org/en/downloads/branches/>.
-
-## Reporting a Vulnerability
-
-See <https://www.ruby-lang.org/en/security/>.
diff --git a/.github/workflows/check_branch.yml b/.github/workflows/check_branch.yml
deleted file mode 100644
index 37cf3a9a8f..0000000000
--- a/.github/workflows/check_branch.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-# We bidirectionally synchronize github.com/ruby/ruby.git's master branch and
-# git.ruby-lang.org/ruby.git's master branch.
-# We can use a pull request's merge button only on the master branch.
-#
-# Therefore, we require to pass this "check_branch" on all protected branches
-# to prevent us from accidentally pushing commits to GitHub directly.
-#
-# Details: https://bugs.ruby-lang.org/issues/16094
-name: Pull Request
-on: [pull_request]
-jobs:
- check_branch:
- runs-on: ubuntu-latest
- steps:
- - name: Check if branch is master
- run: |
- if [ "$BASE_REF" != master ]; then
- echo "Only master branch accepts a pull request, but it's '$BASE_REF'."
- exit 1
- fi
- env:
- BASE_REF: ${{ github.base_ref }}
diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml
deleted file mode 100644
index 515b47e141..0000000000
--- a/.github/workflows/cygwin.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-name: Cygwin
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - '*'
-jobs:
- make:
- strategy:
- matrix:
- test_task: [test]
- os: [windows-2019]
- vs: [2019]
- fail-fast: false
- runs-on: ${{ matrix.os }}
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
- steps:
- - uses: actions/cache@v1
- with:
- path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
- key: ${{ runner.os }}-cygwin-chocolatey-${{ matrix.os }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-cygwin-chocolatey-${{ matrix.os }}-
- ${{ runner.os }}-cygwin-chocolatey-
- - name: Install cygwin base packages with chocolatey
- run: |
- choco install --no-progress cygwin
- - uses: actions/cache@v1
- with:
- path: C:\tools\cygwin\package
- key: ${{ runner.os }}-cygwin-package-${{ matrix.os }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-cygwin-package-${{ matrix.os }}-
- ${{ runner.os }}-cygwin-package-
- - name: Install cygwin additional packages
- run: |
- C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -l C:/tools/cygwin/package -s http://mirrors.kernel.org/sourceware/cygwin/ -P autoconf,bison,gcc-core,git,libffi-devel,libgdbm-devel,libgmp-devel,libreadline-devel,libssl-devel,make,patch,ruby,zlib-devel
- shell: cmd
- - name: Set ENV
- run: |
- echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
- # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- - name: Checkout ruby/ruby
- run: |
- git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
- git -C src reset --hard ${{ github.sha }}
- if: github.event_name == 'push'
- shell: cmd
- - name: Checkout a pull request
- run: |
- git clone --single-branch --shallow-since=yesterday --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src
- git -C src reset --hard ${{ github.event.pull_request.head.sha }}
- if: github.event_name == 'pull_request'
- shell: cmd
- - run: ./src/tool/actions-commit-info.sh
- shell: bash
- id: commit_info
- - name: Autoconf
- run: |
- cd src
- bash /usr/bin/autoconf
- shell: cmd
- - name: Configure
- run: |
- md build
- cd build
- bash ../src/configure
- shell: cmd
- - name: make
- run: |
- make -C build
- shell: cmd
- # TODO: Fix test fail on cygwin environment on GitHub Actions
- # - name: make btest
- # run: |
- # make -C build btest
- # shell: cmd
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
deleted file mode 100644
index 724081d9dc..0000000000
--- a/.github/workflows/macos.yml
+++ /dev/null
@@ -1,81 +0,0 @@
-name: macOS
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - '*'
-jobs:
- make:
- runs-on: macos-latest
- strategy:
- matrix:
- test_task: [ "check", "test-bundler", "test-bundled-gems" ]
- fail-fast: false
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
- steps:
- - name: Disable Firewall
- run: |
- sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
- sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
- # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- - name: Checkout ruby/ruby
- run: |
- git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
- git -C src reset --hard "$GITHUB_SHA"
- if: github.event_name == 'push'
- - name: Checkout a pull request
- run: |
- git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
- git -C src reset --hard "$GITHUB_REV"
- env:
- GITHUB_REV: ${{ github.event.pull_request.head.sha }}
- GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
- GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
- if: github.event_name == 'pull_request'
- - run: ./src/tool/actions-commit-info.sh
- id: commit_info
- - name: Install libraries
- run: |
- export WAITS='5 60'
- cd src
- tool/travis_retry.sh brew update
- tool/travis_retry.sh brew install gdbm gmp libffi openssl@1.1 zlib autoconf automake libtool readline
- - name: Set ENV
- run: |
- echo '::set-env name=JOBS::'-j$((1 + $(sysctl -n hw.activecpu)))
- - name: Autoconf
- run: |
- cd src
- autoconf
- - name: Configure
- run: |
- mkdir build
- cd build
- ../src/configure -C --disable-install-doc --with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline)
- - name: Make
- run: make -C build $JOBS
- - name: Extract gems
- run: make -C build update-gems extract-gems
- if: matrix.test_task == 'check'
- - name: Tests
- run: make -C build $JOBS -s ${{ matrix.test_task }}
- env:
- RUBY_TESTOPTS: "-q --tty=no"
- - name: Leaked Globals
- run: make -C build -s leaked-globals
- - uses: k0kubun/action-slack@v2.0.0
- with:
- payload: |
- {
- "attachments": [{
- "text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
- "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
- "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
- "color": "danger"
- }]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: failure() && github.event_name == 'push'
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
deleted file mode 100644
index d23c136619..0000000000
--- a/.github/workflows/mjit.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-name: MJIT
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - '*'
-jobs:
- test:
- strategy:
- matrix:
- jit_opts: [ "--jit", "--jit-wait" ]
- fail-fast: false
- runs-on: ubuntu-latest
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
- steps:
- - name: Install libraries
- run: |
- set -x
- sudo apt-get update -q || :
- sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
- # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- - name: Checkout ruby/ruby
- run: |
- git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
- git -C src reset --hard "$GITHUB_SHA"
- if: github.event_name == 'push'
- - name: Checkout a pull request
- run: |
- git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
- git -C src reset --hard "$GITHUB_REV"
- env:
- GITHUB_REV: ${{ github.event.pull_request.head.sha }}
- GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
- GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
- if: github.event_name == 'pull_request'
- - run: ./src/tool/actions-commit-info.sh
- id: commit_info
- - name: Fixed world writable dirs
- run: |
- chmod go-w $HOME
- sudo chmod -R go-w /usr/share
- - name: Set ENV
- run: |
- echo '::set-env name=JOBS::'-j$((1 + $(nproc --all)))
- - name: Autoconf
- run: cd src && exec autoconf
- - name: configure
- run: |
- mkdir build
- cd build
- ../src/configure -C --disable-install-doc
- - name: make all
- run: make -C build $JOBS
- - name: make install
- run: sudo make -C build $JOBS install
- - name: make test
- run: "make -C build $JOBS -s test TESTOPTS='-q --tty=no' RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- - name: make test-all
- run: "make -C build $JOBS -s test-all TESTOPTS='-q --tty=no' RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- - name: make test-spec
- run: "make -C build $JOBS -s test-spec RUN_OPTS='--disable-gems --jit-warnings ${{ matrix.jit_opts }}'"
- - name: Leaked Globals
- run: make -C build -s leaked-globals
- - uses: k0kubun/action-slack@v2.0.0
- with:
- payload: |
- {
- "attachments": [{
- "text": "${{ job.status }}: ${{ github.workflow }} / ${{ matrix.jit_opts }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
- "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
- "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
- "color": "danger"
- }]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: failure() && github.event_name == 'push'
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
deleted file mode 100644
index 885f078f07..0000000000
--- a/.github/workflows/ubuntu.yml
+++ /dev/null
@@ -1,115 +0,0 @@
-name: Ubuntu
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - '*'
-jobs:
- make:
- strategy:
- matrix:
- test_task: [ "check", "test-bundler", "test-bundled-gems" ]
- os: [ubuntu-latest, ubuntu-16.04]
- exclude:
- - test_task: test-bundler
- os: ubuntu-16.04
- - test_task: test-bundled-gems
- os: ubuntu-16.04
- fail-fast: false
- runs-on: ${{ matrix.os }}
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
- steps:
- - run: env | sort
- - name: Dump GitHub context
- env:
- GITHUB_CONTEXT: ${{ toJson(github) }}
- run: echo "$GITHUB_CONTEXT"
- - name: Dump job context
- env:
- JOB_CONTEXT: ${{ toJson(job) }}
- run: echo "$JOB_CONTEXT"
- - name: Dump steps context
- env:
- STEPS_CONTEXT: ${{ toJson(steps) }}
- run: echo "$STEPS_CONTEXT"
- - name: Dump runner context
- env:
- RUNNER_CONTEXT: ${{ toJson(runner) }}
- run: echo "$RUNNER_CONTEXT"
- - name: Dump strategy context
- env:
- STRATEGY_CONTEXT: ${{ toJson(strategy) }}
- run: echo "$STRATEGY_CONTEXT"
- - name: Dump matrix context
- env:
- MATRIX_CONTEXT: ${{ toJson(matrix) }}
- run: echo "$MATRIX_CONTEXT"
-
- - name: Install libraries
- run: |
- set -x
- sudo apt-get update -q || :
- sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
- # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- - name: Checkout ruby/ruby
- run: |
- git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
- git -C src reset --hard "$GITHUB_SHA"
- if: github.event_name == 'push'
- - name: Checkout a pull request
- run: |
- git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
- git -C src reset --hard "$GITHUB_REV"
- env:
- GITHUB_REV: ${{ github.event.pull_request.head.sha }}
- GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
- GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
- if: github.event_name == 'pull_request'
- - run: ./src/tool/actions-commit-info.sh
- id: commit_info
- - name: Fixed world writable dirs
- run: |
- chmod go-w $HOME
- sudo chmod -R go-w /usr/share
- - name: Set ENV
- run: |
- echo '::set-env name=JOBS::'-j$((1 + $(nproc --all)))
- - name: Autoconf
- run: cd src && exec autoconf
- - name: configure
- run: |
- mkdir build
- cd build
- ../src/configure -C --disable-install-doc
- - name: Make
- run: make -C build $JOBS
- - name: Extract gems
- run: make -C build update-gems extract-gems
- if: matrix.test_task == 'check'
- - name: Create dummy files in build dir
- run: |
- cd build
- ./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}'
- if: matrix.test_task == 'check'
- - name: Tests
- run: make -C build $JOBS -s ${{ matrix.test_task }}
- env:
- RUBY_TESTOPTS: "-q --tty=no"
- - name: Leaked Globals
- run: make -C build -s leaked-globals
- - uses: k0kubun/action-slack@v2.0.0
- with:
- payload: |
- {
- "attachments": [{
- "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
- "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
- "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
- "color": "danger"
- }]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: failure() && github.event_name == 'push'
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
deleted file mode 100644
index 09e588784c..0000000000
--- a/.github/workflows/windows.yml
+++ /dev/null
@@ -1,90 +0,0 @@
-name: Windows
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - '*'
-jobs:
- make:
- strategy:
- matrix:
- test_task: [test]
- os: [windows-2019]
- vs: [2019]
- fail-fast: false
- runs-on: ${{ matrix.os }}
- if: "!contains(github.event.head_commit.message, '[ci skip]')"
- steps:
- - uses: actions/cache@v1
- with:
- path: C:\vcpkg\downloads
- key: ${{ runner.os }}-vcpkg-download-${{ matrix.os }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-vcpkg-download-${{ matrix.os }}-
- ${{ runner.os }}-vcpkg-download-
- - name: Install libraries with vcpkg
- run: |
- vcpkg --triplet x64-windows install readline zlib
- - uses: actions/cache@v1
- with:
- path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
- key: ${{ runner.os }}-chocolatey-${{ matrix.os }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-chocolatey-${{ matrix.os }}-
- ${{ runner.os }}-chocolatey-
- - name: Install libraries with chocolatey
- run: |
- choco install --no-progress openssl winflexbison3
- # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- - name: Checkout ruby/ruby
- run: |
- git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
- git -C src reset --hard ${{ github.sha }}
- if: github.event_name == 'push'
- - name: Checkout a pull request
- run: |
- git clone --single-branch --shallow-since=yesterday --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src
- git -C src reset --hard ${{ github.event.pull_request.head.sha }}
- if: github.event_name == 'pull_request'
- - run: ./src/tool/actions-commit-info.sh
- shell: bash
- id: commit_info
- - name: Configure
- run: |
- md build
- cd build
- call "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- ../src/win32/configure.bat --disable-install-doc --without-ext=+,dbm,gdbm --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows --with-openssl-dir="C:/Program Files/OpenSSL-Win64"
- shell: cmd
- - name: nmake
- run: |
- call "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- set YACC=win_bison
- cd build
- echo on
- nmake up
- nmake extract-gems
- nmake
- shell: cmd
- - name: nmake test
- run: |
- call "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- cd build
- nmake ${{ matrix.test_task }}
- shell: cmd
- - uses: k0kubun/action-slack@v2.0.0
- with:
- payload: |
- {
- "attachments": [{
- "text": "${{ job.status }}: ${{ matrix.os }} / ${{ matrix.test_task }} <https://github.com/${{ github.repository }}/commit/${{ github.sha }}/checks|${{ steps.commit_info.outputs.COMMIT_DATE }} #${{ steps.commit_info.outputs.COMMIT_NUMBER_OF_DAY }}> " +
- "(<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|" + "${{ github.sha }}".substring(0, 10) + ">) " +
- "of ${{ github.repository }}@" + "${{ github.ref }}".split('/').reverse()[0] + " by ${{ github.event.head_commit.committer.name }}",
- "color": "danger"
- }]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- if: failure() && github.event_name == 'push'
diff --git a/.gitignore b/.gitignore
index 487af950f3..a9104e9ed5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,67 +1,44 @@
*-*-*.def
-*-*-*.exp
-*-*-*.lib
*.a
*.bak
-*.bc
-*.bundle
*.dSYM
*.dmyh
*.dylib
*.elc
-*.i
*.inc
*.log
*.o
-*.obj
-*.old
*.orig
-*.pch
-*.pdb
-*.rbinc
*.rej
-*.s
*.sav
-*.sl
-*.so
*.swp
-*.yarb
*~
.*-*
.*.list
.*.time
.DS_Store
-.bundle
.ccmalloc
.ext
.pc
.ppack
.svn
-.time
Makefile
-cygruby*.def
+Makefile.old
extconf.h
y.output
y.tab.c
-*.gcda
-*.gcno
-*.gcov
-*.vscode
-lcov*.info
# /
/*-fake.rb
-/*.dll
-/*.exe
-/*.res
/*.pc
-/*.rc
/*_prelude.c
-/build*/
/COPYING.LIB
-/ChangeLog
+/ChangeLog-*
+/ChangeLog.pre-alpha
+/ChangeLog.pre1_1
/Doxyfile
/GNUmakefile
+/GNUmakefile.old
/README.atheos
/README.fat-patch
/README.v6
@@ -69,7 +46,6 @@ lcov*.info
/archive
/autom4te*.cache
/automake
-/benchmark/benchmark-driver
/beos
/bmlog-*
/breakpoints.gdb
@@ -80,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
@@ -93,9 +67,6 @@ lcov*.info
/goruby
/id.[ch]
/largefile.h
-/lcov-c-out
-/lcov-rb-out
-/lcov-out
/lex.c
/libruby*.*
/miniprelude.c
@@ -111,7 +82,6 @@ lcov*.info
/ppack
/prelude.c
/preview
-/probes.dmyh
/probes.h
/rbconfig.rb
/rename2.h
@@ -120,63 +90,32 @@ 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
-# /bin/
-
-/bin/*.exe
-/bin/*.dll
-
# /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
-# /coroutine/
-!/coroutine/**/*.s
-
# /enc/trans/
/enc/trans/*.c
-/enc/trans/*.def
-/enc/trans/*.exp
-/enc/trans/*.lib
-
-# /exe/
-/exe/goruby
-/exe/ruby
# /ext/
/ext/extinit.c
-/ext/configure-ext.mk
-/ext/*/exts.mk
-# /ext/-test-/cxxanyargs
-/ext/-test-/cxxanyargs/failure*.failed
-
-# /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
@@ -186,7 +125,6 @@ lcov*.info
# /ext/rbconfig/
/ext/rbconfig/sizeof/sizes.c
-/ext/rbconfig/sizeof/limits.c
# /ext/ripper/
/ext/ripper/eventids1.c
@@ -200,17 +138,15 @@ lcov*.info
/ext/socket/constdefs.h
/ext/socket/constdefs.c
+# /ext/tk/
+/ext/tk/config_list
+
# /gems
/gems/*.gem
-/gems/src
-/gems/*-*
-# /lib/
-/lib/ruby/[1-9]*.*
-/lib/ruby/vendor_ruby
-
-# /spec/bundler
-/.rspec_status
+# /spec/
+/spec/mspec
+/spec/rubyspec
# /tool/
/tool/config.guess
@@ -218,8 +154,4 @@ lcov*.info
# /win32/
/win32/*.ico
-
-# MJIT
-/rb_mjit_header.h
-/mjit_config.h
-/include/ruby-*/*/rb_mjit_min_header-*.h
+/win32/.time
diff --git a/.indent.pro b/.indent.pro
new file mode 100644
index 0000000000..6a207a0554
--- /dev/null
+++ b/.indent.pro
@@ -0,0 +1,21 @@
+-bap
+-nbbb
+-nbc
+-br
+-nbs
+-ncdb
+-ce
+-cli0.5
+-ndj
+-ei
+-nfc1
+-i4
+-l120
+-lp
+-npcs
+-psl
+-sc
+-sob
+
+-TID
+-TVALUE
diff --git a/.rspec_parallel b/.rspec_parallel
deleted file mode 100644
index aaff198a32..0000000000
--- a/.rspec_parallel
+++ /dev/null
@@ -1,2 +0,0 @@
---format progress
---format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log
diff --git a/.travis.yml b/.travis.yml
index 71945e349e..0052fdfc41 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,3 @@
-# -*- YAML -*-
# Copyright (C) 2011 Urabe, Shyouhei. All rights reserved.
#
# This file is a part of the programming language Ruby. Permission is hereby
@@ -17,534 +16,83 @@
#
# is also a good place to look at.
+# Language specification.
language: c
-
-os: linux
-
-dist: xenial
-
-git:
- quiet: true
-
-cache:
- ccache: true
- directories:
- - $HOME/config_2nd
- - $HOME/.downloaded-cache
-
-env:
- global:
- # Reset timestamps early
- - _=$(touch NEWS && find . -type f -exec touch -r NEWS {} +)
- - CONFIGURE_TTY=no
- - CCACHE_COMPILERCHECK=none
- - CCACHE_NOCOMPRESS=1
- - CCACHE_MAXSIZE=512Mi
- - NPROC="`nproc`"
- # JOBS and SETARCH are overridden when necessary; see below.
- - JOBS=-j$((1+${NPROC}))
- - SETARCH=
- - RUBY_PREFIX=/tmp/ruby-prefix
- - GEMS_FOR_TEST='timezone tzinfo'
- - UPDATE_UNICODE="UNICODE_FILES=. UNICODE_PROPERTY_FILES=. UNICODE_AUXILIARY_FILES=. UNICODE_EMOJI_FILES=."
- # https://github.com/travis-ci/travis-build/blob/e411371dda21430a60f61b8f3f57943d2fe4d344/lib/travis/build/bash/travis_apt_get_options.bash#L7
- - travis_apt_get_options='--allow-downgrades --allow-remove-essential --allow-change-held-packages'
- - travis_apt_get_options="-yq --no-install-suggests --no-install-recommends $travis_apt_get_options"
-
-.org.ruby-lang.ci.matrix-definitions:
-
- - &cron-only
- if: (type = cron) AND (branch = master) AND (fork = false)
-
- - &make-test-only
- script:
- - $SETARCH make -s test TESTOPTS="${TESTOPTS=$JOBS -q --tty=no}"
-
- - &gcc-8
- compiler: gcc-8
- # # Not using addon to control retries
- # addons:
- # apt:
- # sources:
- # - ubuntu-toolchain-r-test
- before_install:
- - tool/travis_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- - tool/travis_retry.sh sudo bash -c "rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && exec apt-get update -yq"
- - |-
- ${BEFORE_INSTALL}
- tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
- ccache \
- gcc-8 \
- g++-8 \
- libffi-dev \
- libgdbm-dev \
- libgmp-dev \
- libjemalloc-dev \
- libncurses5-dev \
- libncursesw5-dev \
- libreadline6-dev \
- libssl-dev \
- libyaml-dev \
- openssl \
- valgrind \
- zlib1g-dev
-
- - &clang-8
- compiler: clang-8
- addons:
- apt:
- # Not doing this manually unlike other sources, because it has been stable.
- sources:
- - llvm-toolchain-xenial-8
- config:
- retries: true
- before_install:
- - tool/travis_retry.sh sudo bash -c "rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && exec apt-get update -yq"
- - |-
- tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
- clang-8 \
- llvm-8-tools \
- libffi-dev \
- libgdbm-dev \
- libgmp-dev \
- libjemalloc-dev \
- libncurses5-dev \
- libncursesw5-dev \
- libreadline6-dev \
- libssl-dev \
- libyaml-dev \
- openssl \
- valgrind \
- zlib1g-dev
-
- # --------
-
- - &x86_64-linux
- name: x86_64-linux
- <<: *gcc-8
-
- - &arm64-linux
- name: arm64-linux
- arch: arm64
- <<: *gcc-8
-
- - &s390x-linux
- name: s390x-linux
- arch: s390x
- <<: *gcc-8
-
- - &jemalloc
- name: --with-jemalloc
- <<: *gcc-8
- <<: *cron-only
- env:
- - CONFIG_FLAG='--with-gmp --with-jemalloc --with-valgrind'
-
- - &assertions
- name: RUBY_DEBUG=1
- <<: *gcc-8
- #<<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cppflags='-DRUBY_DEBUG -DVM_CHECK_MODE=1 -DTRANSIENT_HEAP_CHECK_MODE -DRGENGC_CHECK_MODE -DENC_DEBUG'
-
- - &VM_CHECK_MODE
- name: VM_CHECK_MODE=3
- <<: *gcc-8
- <<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cppflags=-DVM_CHECK_MODE=0x0003
-
- - &SUPPORT_JOKE
- name: SUPPORT_JOKE
- <<: *gcc-8
- <<: *cron-only
- <<: *make-test-only
- env:
- - BEFORE_INSTALL="sed vm_opts.h -e 's/OPT_SUPPORT_JOKE *0/OPT_SUPPORT_JOKE 1/' -i"
-
- - &CPDEBUG
- name: CPDEBUG
- <<: *gcc-8
- <<: *cron-only
- <<: *make-test-only
- env:
- - cppflags=-DCPDEBUG
-
- - &WITH_COROUTINE_UCONTEXT
- name: COROUTINE=ucontext
- <<: *gcc-8
- <<: *cron-only
- env:
- - CONFIG_FLAG='--with-coroutine=ucontext'
-
- - &WITH_COROUTINE_COPY
- name: COROUTINE=copy
- <<: *gcc-8
- <<: *cron-only
- env:
- - CONFIG_FLAG='--with-coroutine=copy'
-
- - &TOKEN_THREADED_CODE
- name: TOKEN_THREADED_CODE
- <<: *gcc-8
- <<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cppflags=-DOPT_THREADED_CODE=1
-
- - &CALL_THREADED_CODE
- name: CALL_THREADED_CODE
- <<: *gcc-8
- <<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cppflags=-DOPT_THREADED_CODE=2
-
- - &NO_THREADED_CODE
- name: NO_THREADED_CODE
- <<: *gcc-8
- <<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cppflags=-DOPT_THREADED_CODE=3
-
- - &ASAN
- name: -fsanitize=address
- <<: *clang-8
- #<<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - ASAN_OPTIONS=detect_leaks=0
- - cflags='-U_FORTIFY_SOURCE -march=native -fsanitize=address -fno-omit-frame-pointer -fPIC'
- - debugflags=-ggdb3
- - optflags=-O1
- - LD=clang-8
- - LDFLAGS='-fsanitize=address -fPIC'
- - CONFIG_FLAG='--with-out-ext=openssl --without-gmp --without-jemalloc --without-valgrind'
-
- - &MSAN
- name: -fsanitize=memory
- <<: *clang-8
- #<<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cflags='-U_FORTIFY_SOURCE -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -fPIC'
- - optflags=-O1
- - LD=clang-8
- - LDFLAGS='-fsanitize=memory -fPIC'
- - CONFIG_FLAG='--with-out-ext=openssl --without-gmp --without-jemalloc --without-valgrind'
-
- - &UBSAN
- name: -fsanitize=undefined
- <<: *clang-8
- #<<: *cron-only
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - cflags='-U_FORTIFY_SOURCE -fsanitize=undefined,integer,nullability -fno-sanitize=implicit-integer-sign-change,unsigned-integer-overflow'
- - cppflags=-DUNALIGNED_WORD_ACCESS=0
- - debugflags=-ggdb3
- - optflags='-O1 -march=native'
- - LD=clang-8
- - LDFLAGS='-fsanitize=undefined,integer,nullability -fno-sanitize=implicit-integer-sign-change,unsigned-integer-overflow'
-
- - &i686-linux
- name: i686-linux
- compiler: gcc-8
- env:
- - GCC_FLAGS=-m32
- - CXX='g++-8 -m32'
- - debugflags=-g0
- - SETARCH='setarch i686 --verbose --3gb'
- # # Not using addon to control retries
- # addons:
- # apt:
- # sources:
- # - ubuntu-toolchain-r-test
- before_install:
- - tool/travis_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- - tool/travis_retry.sh sudo bash -c "rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && exec apt-get update -yq"
- - |-
- tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
- gcc-8-multilib \
- g++-8 \
- g++-8-multilib \
- libstdc++-8-dev:i386 \
- libffi-dev:i386 \
- libffi6:i386 \
- libgdbm-dev:i386 \
- libgdbm3:i386 \
- libncurses5-dev:i386 \
- libncurses5:i386 \
- libncursesw5-dev:i386 \
- libreadline6-dev:i386 \
- libreadline6:i386 \
- libssl-dev:i386 \
- libssl1.0.0:i386 \
- linux-libc-dev:i386 \
- zlib1g-dev:i386 \
- zlib1g:i386
-
- - &arm32-linux
- name: arm32-linux
- arch: arm64
- # https://packages.ubuntu.com/xenial/crossbuild-essential-armhf
- compiler: arm-linux-gnueabihf-gcc
- env:
- - debugflags=-g0
- - SETARCH='setarch linux32 --verbose --32bit'
- before_install:
- - sudo dpkg --add-architecture armhf
- - tool/travis_retry.sh sudo bash -c "rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && exec apt-get update -yq"
- - |-
- tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
- ccache \
- crossbuild-essential-armhf \
- libc6:armhf \
- libstdc++-5-dev:armhf \
- libffi-dev:armhf \
- libffi6:armhf \
- libgdbm-dev:armhf \
- libgdbm3:armhf \
- libncurses5-dev:armhf \
- libncurses5:armhf \
- libncursesw5-dev:armhf \
- libreadline6-dev:armhf \
- libreadline6:armhf \
- libssl-dev:armhf \
- libssl1.0.0:armhf \
- linux-libc-dev:armhf \
- zlib1g-dev:armhf \
- zlib1g:armhf
-
- - &pedanticism
- name: -std=c99 -pedantic
- compiler: clang
- <<: *make-test-only
- env:
- - GEMS_FOR_TEST=
- - GCC_FLAGS='-std=c99 -Werror=pedantic -pedantic-errors'
- - CONFIG_FLAG=
- - JOBS=
- - >-
- warnflags='
- -Wall
- -Wextra
- -Werror=deprecated-declarations
- -Werror=division-by-zero
- -Werror=extra-tokens
- -Werror=implicit-function-declaration
- -Werror=implicit-int
- -Werror=pointer-arith
- -Werror=shorten-64-to-32
- -Werror=write-strings
- -Wmissing-noreturn
- -Wno-constant-logical-operand
- -Wno-missing-field-initializers
- -Wno-overlength-strings
- -Wno-parentheses-equality
- -Wno-self-assign
- -Wno-tautological-compare
- -Wno-unused-local-typedef
- -Wno-unused-parameter
- -Wunused-variable'
- - LDFLAGS=-Wno-unused-command-line-argument
-
- - &rubyspec
- name: Check ruby/spec version guards on Ruby 2.4
- language: ruby
- rvm: 2.4.6
- before_install:
- install:
- before_script: chmod -R u+w spec/ruby
- # -j randomly hangs.
- script: ruby -C spec/ruby ../mspec/bin/mspec .
- after_failure:
- - echo "ruby/spec failed on Ruby 2.4. This is likely because of a missing ruby_version_is guard, please add it. See spec/README.md."
-
- - &baseruby
- name: "BASERUBY: Ruby 2.2"
- <<: *gcc-8
- <<: *make-test-only
- language: ruby
- rvm: 2.2
-
- - &dependency
- name: Check dependencies in makefiles
- language: ruby
- before_install:
- install:
- before_script:
- - |-
- ruby -e 'new = []
- Dir.glob("ext/**/extconf.rb") {|ex|
- unless File.exist?(dep = File.dirname(ex)+"/depend")
- puts "Adding "+dep
- File.copy_stream("template/depend.tmpl", dep)
- new << dep
- end
- }
- exec("git", "add", *new) unless new.empty?'
- - git diff --cached
- - "> config.status"
- - "> .rbconfig.time"
- - sed -f tool/prereq.status template/Makefile.in common.mk > Makefile
- - make touch-unicode-files
- - make -s $JOBS $UPDATE_UNICODE up
- - make -s $JOBS srcs
- - rm -f config.status Makefile rbconfig.rb .rbconfig.time
- - $SETARCH ./configure -C --disable-install-doc --prefix=$RUBY_PREFIX --disable-rubygems 'optflags=-O0' 'debugflags=-save-temps=obj -g'
- - ruby tool/update-deps --fix
- script:
- - git diff --no-ext-diff --ignore-submodules --exit-code
- after_failure:
- - echo "Dependencies need to update"
- env:
- - CONFIG_FLAG=
-
-matrix:
- include:
- # Build every commit:
- - <<: *x86_64-linux
- - <<: *arm64-linux
- - <<: *i686-linux
- - <<: *arm32-linux
- - <<: *s390x-linux
- - <<: *pedanticism
- - <<: *assertions
- - <<: *baseruby
- - <<: *rubyspec
- - <<: *dependency
- # Build every commit (Allowed Failures):
- - <<: *ASAN
- - <<: *MSAN
- - <<: *UBSAN
- # Cron only:
- - <<: *jemalloc
- - <<: *VM_CHECK_MODE
- - <<: *SUPPORT_JOKE
- - <<: *CPDEBUG
- - <<: *WITH_COROUTINE_UCONTEXT
- - <<: *WITH_COROUTINE_COPY
- - <<: *TOKEN_THREADED_CODE
- - <<: *CALL_THREADED_CODE
- - <<: *NO_THREADED_CODE
- allow_failures:
- - name: s390x-linux
- - name: -fsanitize=address
- - name: -fsanitize=memory
- - name: -fsanitize=undefined
- fast_finish: true
-
+sudo: false
+
+# Compilers. Several compilers are provided in Travis, so we try them all.
+# The value set here is visible via $CC environment variable.
+compiler:
+ - gcc
+
+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 4'"
+
+# Script is where the test runs. Note we just do "make test", not other tests
+# like test-all, test-rubyspec. This is because they take too much time,
+# enough for Travis to shut down the VM as being stalled.
before_script:
- - date # Debugging "Permission defined" failure on darwin like https://travis-ci.org/ruby/ruby/jobs/508683759
- - dpkg --print-architecture
- - dpkg --print-foreign-architectures
- - setarch --list
- - echo JOBS=${JOBS} SETARCH=${SETARCH}
- - $SETARCH uname -a
- - $SETARCH uname -r
- - rm -fr .ext autom4te.cache
- - echo $TERM
- - |-
- [ -d ~/.downloaded-cache ] ||
- mkdir ~/.downloaded-cache
- - ln -s ~/.downloaded-cache
- - "> config.status"
- - "> .rbconfig.time"
- - sed -f tool/prereq.status template/Makefile.in common.mk > Makefile
- - date; make touch-unicode-files
- - date; make -s $JOBS $UPDATE_UNICODE up
- - date; make -s $JOBS srcs
- - rm -f config.status Makefile rbconfig.rb .rbconfig.time
- - |-
- if [ -d ~/config_2nd ]; then
- cp -pr ~/config_2nd build
- else
- mkdir build
- fi
- - mkdir config_1st config_2nd
- - chmod -R a-w .
- - chmod -R u+w build config_1st config_2nd
- - cd build
- - ccache --show-stats
- - |-
- case "$CC" in
- gcc*) CC="ccache $CC${GCC_FLAGS:+ }$GCC_FLAGS -fno-diagnostics-color";;
- clang*) CC="ccache $CC${GCC_FLAGS:+ }$GCC_FLAGS -fno-color-diagnostics";;
- esac
- - |-
- [ ! -f config.cache ] ||
- [ "$CC" = "`sed -n s/^ac_cv_prog_CC=//p config.cache`" ] ||
- (set -x; exec rm config.cache)
- - $SETARCH ../configure -C --disable-install-doc --prefix=$RUBY_PREFIX $CONFIG_FLAG
- - cp -pr config.cache config.status .ext/include ../config_1st
- - $SETARCH make reconfig
- - cp -pr config.cache config.status .ext/include ../config_2nd
- - (cd .. && exec diff -ru config_1st config_2nd)
- - chmod u+w ..
- - rm -rf ~/config_2nd
- - mv ../config_2nd ~
- - chmod u-w ..
- - $SETARCH make -s $JOBS
- - |-
- date; : # Debugging "Permission defined" failure on darwin like https://travis-ci.org/ruby/ruby/jobs/508683759
- if ! make install; then
- if [ "$(uname)" = Darwin ]; then
- # Debugging "Permission defined" failure on darwin like https://travis-ci.org/ruby/ruby/jobs/508683759
- set -x
- date
- ./miniruby -e 'ARGV.map{|path|[path,File.stat(path)]}.sort_by{|path,st|st.mtime}.each{|path,st|p mtime:st.mtime.to_f, ctime:st.ctime.to_f, path:path}' .ext/.timestamp/.RUBYCOMMONDIR*time .ext/common/bigdecimal/*.rb ../ext/bigdecimal/lib/bigdecimal/*.rb . .. .ext .ext/common .ext/common/bigdecimal ext/bigdecimal ../ext ../ext/bigdecimal ../ext/bigdecimal/lib ../ext/bigdecimal/lib/bigdecimal
- make COPY='cp -f' install
- else
- exit 1
- fi
- fi
- - ccache --show-stats
- - |-
- [ -z "${GEMS_FOR_TEST}" ] ||
- $RUBY_PREFIX/bin/gem install --no-document $GEMS_FOR_TEST
- - echo "raise 'do not load ~/.irbrc in test'" > ~/.irbrc
-
+ - "uname -a"
+ - "uname -r"
+ - "rm -fr .ext autom4te.cache"
+ - "echo $TERM"
+ - "make -f common.mk BASERUBY=ruby MAKEDIRS='mkdir -p' srcdir=. update-config_files"
+ - "autoconf"
+ - "mkdir config_1st config_2nd"
+ - "./configure -C --disable-install-doc --with-gcc=$CC $CONFIG_FLAG"
+ - "cp -pr config.status .ext/include config_1st"
+ - "make reconfig"
+ - "cp -pr config.status .ext/include config_2nd"
+ - "diff -ru config_1st config_2nd"
+ - "make after-update BASERUBY=ruby"
+ - "make -s $JOBS"
+ - "make update-rubyspec"
script:
- - $SETARCH make -s test -o showflags TESTOPTS="${TESTOPTS=$JOBS -q --tty=no}"
- - travis_wait 50 $SETARCH make -s test-all -o exts TESTOPTS="${TESTOPTS} ${TEST_ALL_OPTS}" RUBYOPT="-w"
- - $SETARCH make -s test-spec MSPECOPT=-ff # not using `-j` because sometimes `mspec -j` silently dies
- - $SETARCH make -s -o showflags leaked-globals
+ - "make test TESTOPTS=--color=never"
+ - "make test-all TESTOPTS='-q -j3 --color=never --job-status=normal'"
+ - "make test-rubyspec MSPECOPT=-fm"
# Branch matrix. Not all branches are Travis-ready so we limit branches here.
branches:
only:
- - master
- - ruby_2_4
- - ruby_2_5
- - ruby_2_6
+ - trunk
+ - ruby_2_1
+ - ruby_2_2
+ - ruby_2_3
+ - /^feature\//
+ - /^bug\//
# We want to be notified when something happens.
notifications:
irc:
channels:
- - "chat.freenode.net#ruby-core"
+ - "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
template:
- "%{message} by @%{author}: See %{build_url}"
- slack:
- rooms:
- - 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
+# coding: utf-8-unix
+# indent-tabs-mode: nil
+# tab-width: 4
+# fill-column: 79
+# default-justification: full
+# End:
diff --git a/COPYING b/COPYING
index 48e5a96de7..a1f19ff99d 100644
--- a/COPYING
+++ b/COPYING
@@ -2,55 +2,55 @@ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
You can redistribute it and/or modify it under either the terms of the
2-clause BSDL (see the file BSDL), 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.
+ 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:
+ 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.
+ 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.
+ b) use the modified software only within your corporation or
+ organization.
- c. give non-standard binaries non-standard names, with
- instructions on where to get the original software distribution.
+ c) give non-standard binaries non-standard names, with
+ instructions on where to get the original software distribution.
- d. make other distribution arrangements with the author.
+ d) make other distribution arrangements with the author.
-3. You may distribute the software in object code or binary form,
- provided that you do at least ONE of the following:
+ 3. You may distribute the software in object code or binary form,
+ 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.
+ 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.
- b. accompany the distribution with the machine-readable source of
- the software.
+ b) accompany the distribution with the machine-readable source of
+ the software.
- c. give non-standard binaries non-standard names, with
- instructions on where to get the original software distribution.
+ c) give non-standard binaries non-standard names, with
+ instructions on where to get the original software distribution.
- d. make other distribution arrangements with the author.
+ 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). But some files in the distribution
- are not written by the author, so that they are not under these terms.
+ 4. You may modify and include the part of the software into any other
+ software (possibly commercial). But some files in the distribution
+ are not written by the author, so that they are not under these terms.
- For the list of those files and their copying conditions, see the
- file LEGAL.
+ 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
- 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.
+ 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.
+ 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/COPYING.ja b/COPYING.ja
index 230376bc60..e50d01c8d1 100644
--- a/COPYING.ja
+++ b/COPYING.ja
@@ -2,50 +2,50 @@
ã¾ãŸã¯ä»¥ä¸‹ã«ç¤ºã™æ¡ä»¶ã§æœ¬ãƒ—ログラムをå†é…布ã§ãã¾ã™
2-clause BSDLã«ã¤ã„ã¦ã¯BSDLファイルをå‚ç…§ã—ã¦ä¸‹ã•ã„.
-1. 複製ã¯åˆ¶é™ãªã自由ã§ã™ï¼Ž
+ 1. 複製ã¯åˆ¶é™ãªã自由ã§ã™ï¼Ž
-2. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムã®ã‚½ãƒ¼ã‚¹ã‚’
- 自由ã«å¤‰æ›´ã§ãã¾ã™ï¼Ž
+ 2. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムã®ã‚½ãƒ¼ã‚¹ã‚’
+ 自由ã«å¤‰æ›´ã§ãã¾ã™ï¼Ž
- a. ãƒãƒƒãƒˆãƒ‹ãƒ¥ãƒ¼ã‚ºã«ãƒã‚¹ãƒˆã—ãŸã‚Šï¼Œä½œè€…ã«å¤‰æ›´ã‚’é€ä»˜ã™ã‚‹
- ãªã©ã®æ–¹æ³•ã§ï¼Œå¤‰æ›´ã‚’公開ã™ã‚‹ï¼Ž
+ (a) ãƒãƒƒãƒˆãƒ‹ãƒ¥ãƒ¼ã‚ºã«ãƒã‚¹ãƒˆã—ãŸã‚Šï¼Œä½œè€…ã«å¤‰æ›´ã‚’é€ä»˜ã™ã‚‹
+ ãªã©ã®æ–¹æ³•ã§ï¼Œå¤‰æ›´ã‚’公開ã™ã‚‹ï¼Ž
- b. 変更ã—ãŸæœ¬ãƒ—ãƒ­ã‚°ãƒ©ãƒ ã‚’è‡ªåˆ†ã®æ‰€å±žã™ã‚‹çµ„織内部ã ã‘ã§
- 使ã†ï¼Ž
+ (b) 変更ã—ãŸæœ¬ãƒ—ãƒ­ã‚°ãƒ©ãƒ ã‚’è‡ªåˆ†ã®æ‰€å±žã™ã‚‹çµ„織内部ã ã‘ã§
+ 使ã†ï¼Ž
- c. 変更点を明示ã—ãŸã†ãˆï¼Œã‚½ãƒ•トウェアã®åå‰ã‚’変更ã™ã‚‹ï¼Ž
- ãã®ã‚½ãƒ•トウェアをé…布ã™ã‚‹æ™‚ã«ã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラ
- ãƒ ã‚‚åŒæ™‚ã«é…布ã™ã‚‹ï¼Žã¾ãŸã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラムã®ã‚½ãƒ¼
- スã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
+ (c) 変更点を明示ã—ãŸã†ãˆï¼Œã‚½ãƒ•トウェアã®åå‰ã‚’変更ã™ã‚‹ï¼Ž
+ ãã®ã‚½ãƒ•トウェアをé…布ã™ã‚‹æ™‚ã«ã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラ
+ ãƒ ã‚‚åŒæ™‚ã«é…布ã™ã‚‹ï¼Žã¾ãŸã¯å¤‰æ›´å‰ã®æœ¬ãƒ—ログラムã®ã‚½ãƒ¼
+ スã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- d. ãã®ä»–ã®å¤‰æ›´æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
+ (d) ãã®ä»–ã®å¤‰æ›´æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
-3. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムをコンパイ
- ルã—ãŸã‚ªãƒ–ジェクトコードや実行形å¼ã§ã‚‚é…布ã§ãã¾ã™ï¼Ž
+ 3. ä»¥ä¸‹ã®æ¡ä»¶ã®ã„ãšã‚Œã‹ã‚’満ãŸã™æ™‚ã«æœ¬ãƒ—ログラムをコンパイ
+ ルã—ãŸã‚ªãƒ–ジェクトコードや実行形å¼ã§ã‚‚é…布ã§ãã¾ã™ï¼Ž
- a. ãƒã‚¤ãƒŠãƒªã‚’å—ã‘å–ã£ãŸäººãŒã‚½ãƒ¼ã‚¹ã‚’入手ã§ãるよã†ã«ï¼Œ
- ソースã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
+ (a) ãƒã‚¤ãƒŠãƒªã‚’å—ã‘å–ã£ãŸäººãŒã‚½ãƒ¼ã‚¹ã‚’入手ã§ãるよã†ã«ï¼Œ
+ ソースã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- b. 機械å¯èª­ãªã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’添付ã™ã‚‹ï¼Ž
+ (b) 機械å¯èª­ãªã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’添付ã™ã‚‹ï¼Ž
- c. 変更を行ã£ãŸãƒã‚¤ãƒŠãƒªã¯åå‰ã‚’変更ã—ãŸã†ãˆï¼Œã‚ªãƒªã‚¸ãƒŠ
- ルã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
+ (c) 変更を行ã£ãŸãƒã‚¤ãƒŠãƒªã¯åå‰ã‚’変更ã—ãŸã†ãˆï¼Œã‚ªãƒªã‚¸ãƒŠ
+ ルã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®å…¥æ‰‹æ³•を明示ã™ã‚‹ï¼Ž
- d. ãã®ä»–ã®é…布æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
+ (d) ãã®ä»–ã®é…布æ¡ä»¶ã‚’作者ã¨åˆæ„ã™ã‚‹ï¼Ž
-4. ä»–ã®ãƒ—ログラムã¸ã®å¼•用ã¯ã„ã‹ãªã‚‹ç›®çš„ã§ã‚れ自由ã§ã™ï¼ŽãŸ
- ã ã—,本プログラムã«å«ã¾ã‚Œã‚‹ä»–ã®ä½œè€…ã«ã‚ˆã‚‹ã‚³ãƒ¼ãƒ‰ã¯ï¼Œã
- れãžã‚Œã®ä½œè€…ã®æ„å‘ã«ã‚ˆã‚‹åˆ¶é™ãŒåŠ ãˆã‚‰ã‚Œã‚‹å ´åˆãŒã‚りã¾ã™ï¼Ž
+ 4. ä»–ã®ãƒ—ログラムã¸ã®å¼•用ã¯ã„ã‹ãªã‚‹ç›®çš„ã§ã‚れ自由ã§ã™ï¼ŽãŸ
+ ã ã—,本プログラムã«å«ã¾ã‚Œã‚‹ä»–ã®ä½œè€…ã«ã‚ˆã‚‹ã‚³ãƒ¼ãƒ‰ã¯ï¼Œã
+ れãžã‚Œã®ä½œè€…ã®æ„å‘ã«ã‚ˆã‚‹åˆ¶é™ãŒåŠ ãˆã‚‰ã‚Œã‚‹å ´åˆãŒã‚りã¾ã™ï¼Ž
- ãれらファイルã®ä¸€è¦§ã¨ãれãžã‚Œã®é…布æ¡ä»¶ãªã©ã«ä»˜ã„ã¦ã¯
- LEGALファイルをå‚ç…§ã—ã¦ãã ã•ã„.
+ ãれらファイルã®ä¸€è¦§ã¨ãれãžã‚Œã®é…布æ¡ä»¶ãªã©ã«ä»˜ã„ã¦ã¯
+ LEGALファイルをå‚ç…§ã—ã¦ãã ã•ã„.
-5. 本プログラムã¸ã®å…¥åŠ›ã¨ãªã‚‹ã‚¹ã‚¯ãƒªãƒ—トãŠã‚ˆã³ï¼Œæœ¬ãƒ—ログラ
- ムã‹ã‚‰ã®å‡ºåŠ›ã®æ¨©åˆ©ã¯æœ¬ãƒ—ログラムã®ä½œè€…ã§ã¯ãªã,ãれãž
- れã®å…¥å‡ºåŠ›ã‚’ç”Ÿæˆã—ãŸäººã«å±žã—ã¾ã™ï¼Žã¾ãŸï¼Œæœ¬ãƒ—ログラムã«
- 組ã¿è¾¼ã¾ã‚Œã‚‹ãŸã‚ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¤ã„ã¦ã‚‚åŒæ§˜ã§ã™ï¼Ž
+ 5. 本プログラムã¸ã®å…¥åŠ›ã¨ãªã‚‹ã‚¹ã‚¯ãƒªãƒ—トãŠã‚ˆã³ï¼Œæœ¬ãƒ—ログラ
+ ムã‹ã‚‰ã®å‡ºåŠ›ã®æ¨©åˆ©ã¯æœ¬ãƒ—ログラムã®ä½œè€…ã§ã¯ãªã,ãれãž
+ れã®å…¥å‡ºåŠ›ã‚’ç”Ÿæˆã—ãŸäººã«å±žã—ã¾ã™ï¼Žã¾ãŸï¼Œæœ¬ãƒ—ログラムã«
+ 組ã¿è¾¼ã¾ã‚Œã‚‹ãŸã‚ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¤ã„ã¦ã‚‚åŒæ§˜ã§ã™ï¼Ž
-6. 本プログラムã¯ç„¡ä¿è¨¼ã§ã™ï¼Žä½œè€…ã¯æœ¬ãƒ—ログラムをサãƒãƒ¼ãƒˆ
- ã™ã‚‹æ„å¿—ã¯ã‚りã¾ã™ãŒï¼Œãƒ—ログラム自身ã®ãƒã‚°ã‚ã‚‹ã„ã¯æœ¬ãƒ—
- ログラムã®å®Ÿè¡Œãªã©ã‹ã‚‰ç™ºç”Ÿã™ã‚‹ã„ã‹ãªã‚‹æå®³ã«å¯¾ã—ã¦ã‚‚責
- 任をæŒã¡ã¾ã›ã‚“.
+ 6. 本プログラムã¯ç„¡ä¿è¨¼ã§ã™ï¼Žä½œè€…ã¯æœ¬ãƒ—ログラムをサãƒãƒ¼ãƒˆ
+ ã™ã‚‹æ„å¿—ã¯ã‚りã¾ã™ãŒï¼Œãƒ—ログラム自身ã®ãƒã‚°ã‚ã‚‹ã„ã¯æœ¬ãƒ—
+ ログラムã®å®Ÿè¡Œãªã©ã‹ã‚‰ç™ºç”Ÿã™ã‚‹ã„ã‹ãªã‚‹æå®³ã«å¯¾ã—ã¦ã‚‚責
+ 任をæŒã¡ã¾ã›ã‚“.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000000..f8f303e59c
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,14850 @@
+Tue Nov 15 15:29:36 2016 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]
+
+Tue Nov 15 03:55:45 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/-test/file/fs.c (get_atime_p): Updating of file access times
+ is enabled or not.
+
+Tue Nov 15 03:55:45 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * test/ruby/test_file.rb (TestFile#test_stat): fix noatime case.
+ [ruby-core:77943] [Bug #12903]
+
+Tue Nov 15 03:54:14 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.
+
+Tue Nov 15 03:39:07 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 12 07:48: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]
+
+Sat Nov 12 07:47:19 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 12 07:37:30 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_str_format): format exact number more exactly.
+
+Sat Nov 12 07:34:03 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.
+
+Sat Nov 12 07:32:23 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 Oct 27 16:47:57 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.
+
+Thu Oct 27 16:39:56 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]
+
+Thu Oct 27 16:27:06 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * object.c: Improve documentation for Float conversion.
+ [ruby-core:71661][Bug #11736][ci skip]
+
+Fri Oct 7 02:44:57 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/ssl_certs/GlobalSignRootCA.pem: add for RubyGems.org.
+
+Sat Oct 1 01:02:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_const_search): raise with the actual class/module
+ name which defines the private constant.
+
+Sat Oct 1 00:57:54 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 Oct 1 00:56:19 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
+
+Sat Oct 1 00:55:19 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.
+
+Sat Oct 1 00:53:28 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]
+
+Sat Oct 1 00:52:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * man/irb.1: remove useless -width option.
+ [ruby-dev:49767] [Bug #12692]
+
+Sat Oct 1 00:49:40 2016 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.
+
+Sat Oct 1 00:43:11 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]
+
+Sat Oct 1 00:06:03 2016 Naohisa Goto <ngotogenome@gmail.com>
+
+ * string.c (str_buf_cat): Fix capa size for embed string.
+ Fix bug in r55547. [Bug #12536]
+
+Sat Oct 1 00:06:03 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.
+
+Sat Oct 1 00:06:03 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 Oct 1 00:06:03 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]
+
+Sat Oct 1 00:06:03 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().
+
+Sat Oct 1 00:06:03 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].
+
+Sat Oct 1 00:06:03 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.
+
+Sat Oct 1 00:00:13 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]
+
+Tue Aug 16 21:12:07 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]
+
+Tue Aug 16 21:12:07 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`.
+
+Tue Aug 16 21:01:55 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>
+
+Tue Aug 16 20:59:35 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 Aug 16 20:58:11 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]
+
+Tue Aug 16 20:56:30 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 Aug 16 20:40:36 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
+
+Tue Aug 16 20:34:22 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]
+
+Tue Aug 16 20:30:53 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.
+
+Tue Aug 16 20:28:24 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]
+
+Tue Aug 16 14:58:50 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]
+
+Tue Aug 16 14:54:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_local_constants_i): exclude private constants
+ when excluding inherited constants too. [Bug #12345]
+
+Tue Aug 16 14:43:00 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.
+
+Tue Aug 16 14:07:18 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]
+
+Tue Aug 16 14:06:04 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.
+
+Tue Aug 16 13:59:34 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 16 13:52:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (vm_set_main_stack): remove unnecessary check. toplevel
+ binding must be initialized. [Bug #12611] (N1)
+
+ * string.c (rb_str_split_m): simplify the condition.
+ [Bug #12611](N4)
+
+Tue Aug 16 13:42:42 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]
+
+Tue Aug 16 13:40:26 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]
+
+Tue Aug 16 13:38:36 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!!!
+
+Tue Aug 16 13:36:00 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.
+
+Tue Aug 16 13:29:25 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/rubygems/package.rb: Fixed potential perms issue unpacking of
+ gems on NFS. [Backport #12579]
+
+ * lib/rubygems.rb: bump version.
+
+Fri Aug 12 11:48:27 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 Aug 12 11:45:02 2016 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/http/generic_rquest.rb (write_header): A Request-Line must
+ not contain CR or LF.
+
+Fri Aug 12 11:41:41 2016 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (putline): raise an ArgumentError when
+ CR or LF is included in a line.
+
+Fri Aug 12 11:21:24 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>.
+
+Tue Jul 12 00:17:36 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/fake.rb: don't fake libdir. use libdirname instead.
+
+Thu Jul 7 00:05:00 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * bignum.c (Init_Bignum): revert a part of previous commit (r55598),
+ because the implementation of Object#hash is a little difference from
+ trunk. cf. [Backport #12391]
+
+Wed Jul 6 23:02:03 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 Jun 10 17:48:51 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.
+
+Fri Jun 10 17:44:59 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * re.c (unescape_nonascii): scan hex up to only 3 characters.
+ [Bug #12420] [Bug #12423]
+
+Fri Jun 10 17:44:59 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]
+
+Fri Jun 10 17:34:09 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 Jun 10 16:30:16 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]
+
+Fri Jun 10 16:24:29 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]
+
+Fri Jun 10 16:12:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * variable.c (rb_local_constants_i): exclude hidden constants.
+ [ruby-core:75575] [Bug #12389]
+
+Fri Jun 10 16:10:23 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regcomp.c (compile_length_tree): return error code immediately
+ if compile_length_tree raised error [Bug #12418]
+
+Fri Jun 10 16:06:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * include/ruby/missing.h (isfinite): move from numeric.c.
+
+Fri Jun 10 16:06:25 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (isfinite): get rid of a warning on
+ cygwin. [Bug #12417][ruby-core:75691]
+
+Fri Jun 10 16:06:25 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.
+
+Fri Jun 10 16:06:25 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]
+
+Fri Jun 10 16:00:27 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.
+
+Fri Jun 10 15:56:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_modify_expand): check integer overflow.
+ [ruby-core:75592] [Bug #12390]
+
+Fri Jun 10 15:54:05 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.
+
+Fri Jun 10 15:46:24 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * bignum.c: [DOC] Update result of 123456789 ** -2.
+ [ruby-dev:49606] [Bug #12339]
+
+Fri Jun 10 15:37:25 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+
+ * internal.h (RCOMPLEX_SET_IMAG): undef RCOMPLEX_SET_IMAG
+ instead of duplicated undef RCOMPLEX_SET_REAL.
+
+Fri Jun 10 15:37:25 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>
+
+ * complex.c (rb_complex_set_imag): Fix to properly set imag
+ of complex.
+
+Fri Jun 10 15:05:41 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]
+
+Fri Apr 29 20:11:38 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.
+
+Wed Apr 27 22:16:04 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * compile.c (new_label_body): missed backporting r54548 in r54698.
+ this fixes randomly test failure introduced by r54698.
+ cf. [Bug #12082]
+
+Tue Apr 26 13:38:31 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * README.EXT{,.ja}: `nul` should be uppercase.
+ change 'nul' => 'NUL'. [Fix GH-1172]
+ derived from a patch by craft4coder <yooobuntu@163.com>
+
+ * doc/extension.rdoc: Improvements to english grammers.
+ [Bug #12246][ruby-core:74792][ci skip]
+ derived from a patch by Marcus Stollsteimer <sto.mar@web.de>
+
+Tue Apr 26 13:25:25 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`
+
+Tue Apr 26 13:22:45 2016 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * configure.in: add missing -lm for AIX.
+
+Tue Apr 26 13:22:45 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.
+
+Tue Apr 26 13:18:59 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]
+
+Tue Apr 26 13:16:41 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 18:36:15 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]
+
+Fri Apr 22 18:36:15 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]
+
+Fri Apr 22 18:34:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * doc/regexp.rdoc (comments): [DOC] terminators cannot appear in
+ comments. [ruby-core:74838] [Bug #12256]
+
+Fri Apr 22 18:30:50 2016 NAKAMURA Usaku <usa@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.
+ patches are derived from Marcus Stollsteimer in [ruby-core:74690].
+ [Bug #12228]
+
+Fri Apr 22 18:22:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c (mime_putc): fix typo.
+ [Bug #12202] [ruby-core:74802]
+
+Fri Apr 22 18:22:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/nkf/nkf-utf8/nkf.c: Merge upstream 4f3edf80a0.
+ patched by Anton Sivakov [Bug #12201] [Bug #12202]
+
+Fri Apr 22 18:16:51 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 directory (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
+
+Fri Apr 22 18:13:22 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]
+
+Fri Apr 22 16:37:14 2016 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]
+
+Fri Apr 22 16:24:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (rb_cv_lgamma_r_m0): fix the condition for
+ lgamma_r(-0.0). [Bug #12249]
+
+Fri Apr 22 16:24:00 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.
+
+Fri Apr 22 16:24:00 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]
+
+Fri Apr 22 16:24:00 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * math.c (ruby_lgamma_r): mswin's lgamma_r also seems to be wrong.
+ cf. [Bug #12249]
+
+Fri Apr 22 16:24:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * math.c (ruby_tgamma): fix tgamma(-0.0) on mingw.
+ [ruby-core:74817] [Bug #12249]
+
+Fri Apr 22 16:00:50 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]
+
+Fri Apr 22 15:47:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * struct.c (struct_make_members_list): extract making member name
+ list from char* va_list, with creating symbols without
+ intermediate IDs.
+
+Fri Apr 22 15:19:01 2016 Joe Swatosh <joe.swatosh@gmail.com>
+
+ * ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix
+ API names. [ruby-core:74863] [Bug #12264]
+
+Fri Apr 22 15:13:39 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]
+
+Fri Apr 22 15:08:27 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.
+
+Fri Apr 22 14:56:46 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]
+
+Fri Apr 22 14:48: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]
+
+Fri Apr 22 14:34:27 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]
+
+Fri Apr 22 14:13:28 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.
+
+Fri Apr 22 14:13:28 2016 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.
+
+Fri Apr 22 13:41:38 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]
+
+Thu Mar 31 05:06:02 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * sprintf.c (rb_str_format): fix buffer overflow, length must be
+ greater than precision. reported by William Bowling <will AT
+ wbowling.info>.
+
+Thu Mar 31 04:49:05 2016 Kimura Wataru <kimuraw@i.nifty.jp>
+
+ * test/ruby/test_io.rb: handled rlimit value same as r52277
+ [Bug #11852][ruby-dev:49446]
+
+Wed Mar 30 06:37:56 2016 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 Mar 30 06:11:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread_pthread.c (reserve_stack): fix reserving position where
+ the stack growing bottom to top. [Bug #12118]
+
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * .travis.yml: removed commented-out code.
+
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * .travis.yml: removed osx code. follow up with r53517
+
+Wed Mar 30 06:04:18 2016 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!
+
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: removed Ruby 1.9.3 build on Travis CI
+
+Wed Mar 30 06:04:18 2016 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * .travis.yml: Remove redundant configuration option.
+ [fix GH-809] Patch by @gxworld
+
+Wed Mar 30 05:15:04 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.
+
+Wed Mar 30 05:13:25 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]
+
+Tue Mar 29 02:22:35 2016 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
+
+Tue Mar 29 02:08:40 2016 Koichi Sasada <ko1@atdot.net>
+
+ * signal.c: should also clear ruby_disable_gc.
+ [Bug #11692]
+
+Tue Mar 29 02:04:18 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]
+
+Tue Mar 29 02:02:53 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.
+
+Tue Mar 29 01:56:24 2016 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * lib/rubygems/installer.rb: merge partially r49511.
+ cherry picking https://github.com/rubygems/rubygems/commit/f9232680
+ [Bug #12066]
+
+Tue Mar 29 01:41:10 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]
+
+Tue Mar 29 01:27:52 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]
+
+Tue Mar 29 01:24:55 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * enc/trans/JIS: update Unicode's notice. [Bug #11844]
+
+Tue Mar 29 01:22:39 2016 Eric Hodel <drbrain@segment7.net>
+
+ * marshal.c (r_object0): raise ArgumentError when linking to undefined
+ object.
+
+Tue Mar 29 01:22:39 2016 Eric Hodel <drbrain@segment7.net>
+
+ * marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
+
+Tue Mar 29 01:20:37 2016 Eric Wong <e@80x24.org>
+
+ * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): document as MT-unsafe
+ [ruby-core:73803] [Bug #12069]
+
+Tue Mar 29 01:07:36 2016 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * insns.def (opt_mod): show its method name on ZeroDivisionError.
+ [Bug #12158]
+
+Tue Mar 29 01:05:28 2016 Anthony Dmitriyev <antstorm@gmail.com>
+
+ * net/ftp.rb: add NullSocket#closed? to fix closing not opened
+ connection. [Fix GH-1232]
+
+Tue Mar 29 01:02:49 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 29 00:56:10 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.
+
+Tue Mar 29 00:53:26 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.
+
+Tue Mar 29 00:44:55 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.
+
+Tue Mar 29 00:43:40 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.
+
+Tue Mar 29 00:42:10 2016 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]
+
+Tue Mar 29 00:33:06 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.
+
+Tue Mar 29 00:06:58 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]
+
+Tue Mar 29 00:00:27 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.
+
+
+Mon Mar 28 23:58:27 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.
+
+
+Mon Mar 28 23:57:33 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.
+
+
+Mon Mar 28 23:56:17 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 28 23:20:12 2016 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 Mar 28 23:15:54 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 Mar 24 20:39:58 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 10 00:22:25 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]
+
+Thu Mar 10 00:17:57 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]
+
+Thu Mar 10 00:17:57 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * re.c: Update documentation for Regexp class.
+ [fix GH-937][ci skip] Patch by @davydovanton
+
+Thu Mar 10 00:04:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/socket/socket.c (sock_gethostname): support unlimited size
+ hostname.
+
+Wed Mar 9 22:59:43 2016 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!!!
+
+Wed Mar 9 22:46:56 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
+
+Wed Mar 9 22:26:38 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]
+
+Wed Mar 9 05:14:20 2016 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]
+
+Wed Mar 9 05:14:20 2016 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 Mar 9 04:21:02 2016 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * process.c (rb_execarg_parent_start1): need to convert the encoding to
+ ospath's one.
+
+Wed Mar 9 04:21:02 2016 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.
+
+Wed Mar 9 04:15:20 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]
+
+Wed Mar 9 03:53:37 2016 Tadashi Saito <tad.a.digger@gmail.com>
+
+ * compile.c, cont.c, doc, man: fix common misspelling.
+ [ruby-core:72466] [Bug #11870]
+
+Wed Mar 9 03:51:48 2016 Eric Wong <e@80x24.org>
+
+ * ext/socket/init.c (rsock_init_sock): reject reserved FDs
+ [ruby-core:72445] [Bug #11862]
+
+Wed Mar 9 03:41:27 2016 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]
+
+Wed Mar 9 03:34:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (reg_names_iter): should consider encoding of regexp.
+ [ruby-core:72185] [Bug #11825]
+
+Wed Feb 24 08:18:18 2016 Naohisa Goto <ngotogenome@gmail.com>
+
+ * enc/windows_1250.c: Should not use C++ style comments (C99 feature).
+ [Bug #11843]
+
+Tue Feb 23 03:43:23 2016 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)
+
+Tue Feb 23 03:43:23 2016 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]
+
+Tue Feb 23 03:43:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * enc/iso_8859_13.c: Added three missing lower/upper-case
+ character pairs (from Kimihito Matsui)
+
+Tue Feb 23 03:43:23 2016 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)
+
+Mon Feb 15 02:05:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_scrub): the result should be infected by the
+ original string.
+
+Mon Feb 15 02:05:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * transcode.c (rb_econv_substr_append, econv_primitive_convert):
+ the result should be infected by the original string.
+
+Mon Feb 15 02:05:13 2016 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.
+
+Mon Feb 15 01:20:08 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]
+
+Tue Jan 26 21:52:16 2016 Joseph Tibbertsma <josephtibbertsma@gmail.com>
+
+ * gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name.
+ [Fix GH-1221]
+
+Mon Jan 18 00:34:41 2016 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (vm_call_method): 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 23 06:05:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (parser_yylex): allow here documents in labeled
+ argument. [ruby-core:72396] [Bug #11849]
+
+Wed Dec 23 05:52:06 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
+
+ * test/ruby/test_syntax.rb: fix typo in test
+
+Wed Dec 23 05:52:06 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].
+
+Mon Dec 21 05:05:54 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * cont.c: fix a double word typo.
+ [Bug #11313][ruby-core:69749]
+
+Mon Dec 21 05:04:18 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * ext/tk/lib/multi-tk.rb: fix typos.
+ [Bug #11764][ruby-core:71800]
+
+Wed Dec 16 21:10:19 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 02:38:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (parse_mode_enc): fix buffer overflow.
+
+Sat Dec 12 17:19:27 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]
+
+Fri Dec 11 22:41:15 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]'
+
+Thu Dec 10 00:23:07 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.
+
+Thu Dec 10 00:19:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * common.mk (update-gems): use BASERUBY instead of RUNRUBY.
+
+Wed Dec 9 01:49:13 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]
+
+Wed Dec 9 01:46:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby_atomic.h (ATOMIC_SIZE_CAS): fix the argument order of
+ InterlockedCompareExchange64. new value and then old value is
+ the last.
+
+Wed Dec 9 01:28:54 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 9 01:24:57 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
+
+Fri Dec 4 04:46:33 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]
+
+Fri Dec 4 02:42:37 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]
+
+Wed Dec 2 03:17:01 2015 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/readline/extconf.rb: call dir_config("libedit")
+ if --enable-libedit is spcified. [Bug #11751]
+ patched by John Hein
+
+Wed Dec 2 02:59:42 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.
+
+Tue Dec 1 02:52:17 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * test/ruby/test_gc.rb: merge partially r52391 to get rid of CI error.
+
+Tue Dec 1 02:27:41 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 Nov 29 18:02:44 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]
+
+Sun Nov 29 17:48:39 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]
+
+Sun Nov 29 17:13:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_each_codepoint): read more data when read partially.
+ [ruby-core:70379] [Bug #11444]
+
+Sun Nov 29 16:46:25 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
+
+Sun Nov 29 16:33:30 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]
+
+Sun Nov 29 16:11:32 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]
+
+Sun Nov 29 02:55:56 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]
+
+Sat Nov 28 06:28:55 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]
+
+Sat Nov 28 06:12:32 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>
+
+Sat Nov 28 05:50:58 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]
+
+Sat Nov 28 05:47:27 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]
+
+Sat Nov 28 05:47:27 2015 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * test/ruby/test_symbol.rb: avoid a false positive in AIX.
+
+Sat Nov 28 05:35:28 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]
+
+Sat Nov 28 05:21:06 2015 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def (defined): skip respond_to_missing? when
+ a method is available.
+ [Bug #11211]
+
+ * test/ruby/test_defined.rb: add a test for this fix.
+
+Wed Nov 25 01:05:29 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * ext/digest/sha1/sha1ossl.c: fix defs.h path to catch up changes in
+ r52739.[Bug #3231]
+
+ * ext/digest/rmd160/rmd160ossl.c: ditto.
+
+Wed Nov 25 00:54:15 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]
+
+Wed Nov 25 00:47:07 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]
+
+Wed Nov 25 00:32:44 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 Nov 25 00:14:28 2015 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid
+ includeing 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.
+
+Wed Nov 25 00:03:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * Added missing reference of GitHub
+
+Wed Nov 25 00:03:42 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.
+
+Mon Nov 23 00:19:51 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.
+
+Thu Nov 19 01:06:07 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 Nov 19 01:06:07 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 Nov 19 01:06:07 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.
+
+Thu Nov 19 00:41:09 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]
+
+Thu Nov 19 00:15:23 2015 Zachary Scott <zzak@ruby-lang.org>
+
+ * ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]
+
+Thu Nov 19 00:01:14 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]
+
+Wed Nov 18 23:29:32 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.
+
+Mon Nov 16 03:39:59 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * tool/runruby.rb: rubyspec now requires other FDs not to be closed
+ since 7b6ce1fee.
+
+Sun Nov 8 23:30:56 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
+
+Sun Nov 1 03:52:41 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]
+
+Sun Nov 1 03:40:43 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]
+
+Tue Oct 27 23:58:32 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.
+
+Tue Oct 27 23:38:26 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]
+
+Tue Oct 27 23:32:51 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
+
+Tue Oct 6 01:29:02 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 Oct 6 01:29:02 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 Oct 5 03:29:23 2015 Tanaka Akira <akr@fsij.org>
+
+ * enum.c (nmin_filter): Fix limit value.
+ patch by Helder Pereira.
+ [Bug #11471] [ruby-core:70477]
+
+Wed Sep 30 03:44:36 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]
+
+Wed Sep 30 03:34:25 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 Sep 30 03:24:29 2015 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * thread_pthread.c (reserve_stack): ensure the memory is really
+ allocated. [Bug #11457]
+
+Tue Aug 25 01:01:01 2015 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def (defineclass): introduce an ad-hoc patch to avoid
+ an issue reported on [Bug #10871].
+
+ This patch does not fix completely. For example, method definition
+ in a block (like 1.times{def ...; end}) still causes same issue.
+ To solve all, we need a huge patch and it seems difficult for
+ stable branch.
+
+ Use Ruby 2.3 and later to solve this issue completely.
+ (See [Bug #10943])
+
+Tue Aug 18 22:52:50 2015 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!)
+
+Tue Aug 18 20:10:13 2015 Tanaka Akira <akr@fsij.org>
+
+ * numeric.c (Init_Numeric): Fix document for Float::MIN and
+ Float::EPSILON.
+
+Mon Aug 17 23:07:47 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * lib/rubygems.rb: bump version to 2.4.5.1. this version fixed
+ CVE-2015-3900.
+ * lib/rubygems/remote_fetcher.rb: ditto.
+ * test/rubygems/test_gem_remote_fetcher.rb: added testcase for CVE-2015-3900
+
+Mon Aug 17 23:00:56 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]
+
+Mon Aug 17 23:00:56 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]
+
+Sun Aug 16 03:14:04 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 16 03:00:44 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]
+
+Fri Aug 14 16:30:43 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 Aug 14 15:24:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_any_hash): fix Float hash. rb_dbl_hash() returns a
+ Fixnum, but not a long. [Bug #9381]
+
+Fri Aug 14 15:09:34 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 Aug 14 00:44:34 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]
+
+Thu Aug 13 01:25:26 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.
+
+Thu Aug 13 01:03:13 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.
+
+Thu Aug 13 01:03:13 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]
+
+Thu Aug 13 00:03:24 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!
+
+Thu Aug 13 00:03:24 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
+
+Wed Aug 12 23:57:01 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.
+
+Wed Aug 12 23:53:39 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]
+
+Wed Aug 12 01:05:58 2015 Jeremy Evans <merch-redmine@jeremyevans.net>
+
+ * test/openssl/test_ssl.rb: Fix LocalJumpErrors being raised
+ in OpenSSL tests. [ruby-core:70020][Bug #11368]
+
+Wed Aug 12 00:54:29 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 01:51:53 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * lib/timeout.rb (ExitException): leave Timeout::ExitException as an
+ alias of Timeout::Error for backward compatibility in stable branch.
+ [ruby-dev:49179] [Bug #11344]
+
+Tue Aug 11 01:51:53 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]
+
+Tue Aug 11 01:37:28 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.
+
+Tue Aug 11 01:37:28 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
+
+Tue Aug 11 01:21:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (m_core_hash_merge_ptr): copy the arguments to the machine
+ stack before rewinding the control frame pointer and leaving the
+ arguments outside valid region of the value stack.
+ [ruby-core:69969] [Bug #11352]
+
+ * vm.c (REWIND_CFP): keep the arguments region inside the valid
+ value stack. [ruby-core:69969] [Bug #11352]
+
+Tue Aug 11 01:11:02 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]
+
+Tue Aug 11 00:42:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lambda_body): pop cmdarg stack for lookahead
+ token. [ruby-core:70067] [Bug #11380]
+
+Tue Aug 11 00:21:56 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.
+
+Tue Aug 4 04:11:34 2015 Tanaka Akira <akr@fsij.org>
+
+ * lib/time.rb (strptime): Support %s.%N.
+ [ruby-core:68301] [Bug #10904] Patch by Sadayuki Furuhashi.
+
+Tue Aug 4 03:43:15 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]
+
+Tue Aug 4 03:13:59 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.
+
+Sat Jul 4 23:08:32 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]
+
+Sat Jul 4 05:00:48 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]
+
+Sat Jul 4 04:46:51 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.
+
+Sat Jul 4 04:35:51 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]
+
+Sat Jul 4 04:35:51 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]
+
+Wed Jul 1 04:16:56 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.
+
+Wed Jul 1 04:15:38 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * ext/zlib/zlib.c: Fix indentation for rdoc.
+ [Bug #11221][ruby-core:69465]
+
+Sat Jun 27 22:51:59 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.
+
+
+Wed Jun 17 02:53:59 2015 Koichi Sasada <ko1@atdot.net>
+
+ * test/objspace/test_objspace.rb (test_dump_flags): relax pattern
+ because long_lived flag and marked flag can be false at major GC.
+ [Bug #10852]
+
+Mon Jun 15 03:24:23 2015 Koichi Sasada <ko1@atdot.net>
+
+ * vm_insnhelper.c (lep_svar_set): add WBs.
+
+Fri Jun 12 01:39:49 2015 Eric Wong <e@80x24.org>
+
+ * ext/socket/ancdata.c: use RB_GC_GUARD instead of volatile
+ [ruby-core:69419] [Feature #11198]
+
+Fri Jun 12 01:16:13 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]
+
+Fri Jun 12 01:14:00 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).
+
+Fri Jun 12 01:11:52 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
+
+Sun May 24 03:56:27 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 May 24 03:53:07 2015 Eric Wong <e@80x24.org>
+
+ * ext/socket/ancdata.c (bsock_recvmsg_internal): GC guard
+ [Bug #11123]
+
+Sun May 24 03:44:42 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]
+
+Sun May 24 03:41:45 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]
+
+Sun May 24 03:37:14 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
+
+Sun May 24 03:32:53 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * rational.c: Added documentation for rational literal.
+ [Bug #11075][fix GH-885][ci skip] Patch by @shishir127
+
+Sun May 24 03:06:20 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]
+
+Sun May 24 03:01:17 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]
+
+Sun May 24 02:44:53 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.
+
+Sun May 24 02:21:47 2015 Masahiro Tomita <tommy@tmtm.org>
+
+ * ext/socket/raddrinfo.c (addrinfo_mload): fix memory leak of
+ addrinfo. [ruby-dev:48923] [Bug #11051]
+
+Sun May 24 02:17:05 2015 Kenta Murata <mrkn@cookpad.com>
+
+ * bigdecimal: conform to ruby's license. [ruby-core:68466] [Bug #10952]
+
+Sun May 24 02:06:34 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]
+
+Sun May 24 02:06:34 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]
+
+Sun May 24 02:02:00 2015 Koichi Sasada <ko1@atdot.net>
+
+ * test/ruby/test_symbol.rb: fix syntax error.
+
+Sun May 24 02:02:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * hash.c (rb_any_hash): Symbols are compared by the identities
+ always. [ruby-core:68767] [Bug #11035]
+
+Sun May 24 02:01:07 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]
+
+Thu May 21 01:34:48 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (id2ref): prohibit from accessing internal objects.
+ [ruby-core:68348] [Bug #10918]
+
+Thu May 21 01:32:02 2015 Rei Odaira <Rei.Odaira@gmail.com>
+
+ * ext/pty/pty.c: AIX supports autopush.
+ Patch by Perry Smith [ruby-core:58539] [Bug #9144]
+
+Thu May 21 01:07:41 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]
+
+Thu May 21 00:55:45 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_thead_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.
+
+Thu May 21 00:07:54 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]
+
+Wed May 20 04:33:50 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]
+
+Wed May 20 03:46:11 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]
+
+Wed May 20 03:25:34 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]
+
+Wed May 20 03:25:34 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: use RB_TYPE_P() instead of BUILTIN_TYPE().
+
+Wed May 20 03:10:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * benchmark/bm_hash_aref_flo.rb: make more realistic data.
+ [ruby-core:68632] [[Bug #10999]
+
+Wed May 20 02:49:49 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]
+
+Wed May 20 02:16:05 2015 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * dir.c (replace_real_basename): need to check the return value of
+ GLOB_REALLOC().
+
+Wed May 20 02:16:05 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 May 20 01:58:12 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.
+
+Wed May 20 01:47:23 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]
+
+Fri May 15 05:01:25 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]
+
+Thu May 14 00:50:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (lambda): push and reset cmdarg_stack in lambda body.
+ [ruby-core:69017] [Bug #11107]
+
+Thu May 14 00:39:29 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 frequent
+ reported stale bug reports.
+
+Thu May 14 00:29:44 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]
+
+Thu May 14 00:19:04 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 23:33:39 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.
+
+Mon Apr 13 22:11:21 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.
+
+Mon Apr 13 13:03:33 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * lib/securerandom.rb: skip Win32 libraries in SecureRandom if
+ OpenSSL::Random is available.
+ https://github.com/ruby/ruby/pull/848 [Bug #10948] [Bug #10995]
+
+Mon Apr 13 00:49:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (arg): fix segfault by null caused by syntax error.
+ [ruby-core:68851] [Bug #10957]
+
+Mon Apr 13 00:49:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (primary): empty parentheses at cmdarg can be null.
+ [ruby-core:68477] [Bug #10957]
+
+Mon Apr 13 00:44:12 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
+
+Mon Apr 13 00:16:32 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]
+
+Mon Apr 13 00:09:48 2015 Koichi Sasada <ko1@atdot.net>
+
+ * class.c (rb_prepend_module): need a WB for klass -> origin.
+
+Sun Apr 12 23:53:33 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]
+
+Sun Apr 12 23:53:33 2015 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]
+
+Sun Mar 22 12:39:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * spec/default.mspec: use default configuration file name.
+ https://github.com/ruby/rubyspec/commit/cc69f337b06362e5607ffa3e3ad40ef7494960cf
+
+Sun Mar 22 12:39:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * spec/default.mspec: remove specific version number.
+ https://github.com/ruby/rubyspec/commit/7a909e925c1baa9c700bd44af9241aef6e596714
+
+Sun Mar 22 12:39:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * common.mk: use ruby organization for rubyspec.
+
+Thu Feb 26 15:48:41 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 15:36:26 2015 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * tool/merger.rb: support 2.1+ versioning scheme.
+
+Tue Feb 24 17:41:27 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 17:41:27 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 17:41:27 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.
+
+Tue Feb 24 16:37:26 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]
+
+Tue Feb 24 16:31:53 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]
+
+Tue Feb 24 14:00:46 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.
+
+Tue Feb 24 14:00:46 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.
+
+Tue Feb 24 10:30:59 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 21:20:37 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]
+
+Sun Feb 22 17:11:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (probes.stamp): rebuild dtrace dependent objects
+ only when `dtrace -G` modifies its input files.
+
+Sun Feb 22 17:11:25 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)
+
+Sun Feb 22 02:16:40 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.
+
+Sat Feb 21 13:48:11 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]
+
+Sat Feb 21 13:48:11 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]
+
+Sat Feb 21 12:46:51 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]
+
+Sat Feb 21 12:46:51 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]
+
+Sat Feb 21 12:45:54 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]
+
+Fri Feb 20 17:47:20 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]
+
+Fri Feb 20 15:08:17 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]
+
+Fri Feb 20 15:08:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): obtain real name with FindFirstFile API
+ instead of matchin all entries, on Windows.
+ [ruby-core:67954] [Bug #10819]
+
+Fri Feb 20 14:32:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (dir_initialize): workaround of opendir failure at symlink
+ directories on Windows via CIFS.
+
+Thu Feb 19 17:05:47 2015 Shugo Maeda <shugo@ruby-lang.org>
+
+ * class.c (rb_obj_singleton_methods): should use RTEST() to convert
+ VALUE to int.
+
+Thu Feb 19 16:14:04 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]
+
+Thu Feb 19 16:14:04 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]
+
+Thu Feb 19 16:07:03 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 Feb 19 15:32:26 2015 Dave Stevens <dave@crowdlab.com>
+
+ * string.c (str_make_independent_expand): terminate String when
+ moved from heap to embedded. [Fix GH-821].
+
+Thu Feb 19 13:35:21 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]
+
+Tue Feb 17 18:57:13 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 15:39:01 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]
+
+Tue Feb 17 11:50:06 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.
+
+Sun Feb 15 13:15:46 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 canonnical name.
+
+Sat Feb 14 13:27:41 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]
+
+Sat Feb 14 13:27:41 2015 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * vm_insnhelper.c: Fix symbol leak with +send+ [Bug #10828]
+
+Sat Feb 14 08:53:50 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]
+
+Fri Feb 13 13:59:56 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]
+
+Fri Feb 13 03:13:05 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 Feb 6 12:05:13 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * thread.c: Improve documentation for Thread#value
+ [Bug #10694][ruby-core:67324][ci skip]
+
+Fri Feb 6 12:02:05 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]
+
+Fri Feb 6 01:03:38 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * marshal.c (w_object, marshal_dump): use indetity tables for
+ arbitrary VALUE keys, because of performance of FLONUM.
+ [Bug #10761]
+
+ * marshal.c (obj_alloc_by_klass, marshal_load): ditto.
+
+Fri Feb 6 01:03:38 2015 Eric Wong <e@80x24.org>
+
+ * benchmark/bm_marshal_dump_flo.rb: new benchmark for [Bug #10761]
+
+Fri Feb 6 01:03:38 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]
+
+Thu Feb 5 16:30:09 2015 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]
+
+Mon Jan 26 15:35:16 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]
+
+Thu Jan 22 11:47:31 2015 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]
+
+Thu Jan 22 11:45:32 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.
+
+Tue Jan 20 14:05:08 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]
+
+Mon Jan 19 15:45:33 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]
+
+Mon Jan 19 12:03:59 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]
+
+Mon Jan 19 12:00:51 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]
+
+Mon Jan 19 11:57:14 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]
+
+Mon Jan 19 11:44:52 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]
+
+Sun Jan 18 00:59:41 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
+
+Sun Jan 18 00:53:38 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]
+
+Sat Jan 17 22:25: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.
+
+Sat Jan 17 17:56:45 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_): supprt splatted hash in hash type.
+
+Sat Jan 17 16:49:49 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]
+
+Sat Jan 17 16:47:20 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 17 16:35:59 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]
+
+Sat Jan 17 16:16:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): match in case-folding only if the directory
+ resides on a case-insensitve file system, on OSX.
+ [ruby-core:67364] [Bug #10700]
+
+Sat Jan 17 02:04:01 2015 Eric Wong <e@80x24.org>
+
+ * lib/resolv.rb: consider ENETUNREACH as ResolvTimeout
+ [ruby-core:67411] [Bug #10712]
+
+Sat Jan 17 01:57:57 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 17 01:52:42 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.
+
+Fri Jan 16 21:17:34 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * test/ruby/test_io.rb: added timeout for AIX environment.
+ [ruby-core:62983][Bug #9917]
+
+Fri Jan 16 18:25:57 2015 Tanaka Akira <akr@fsij.org>
+
+ * lib/resolv.rb (Resolv::DNS::Name#==): Compare an array of Label:Str
+ objects. Label#Str#== is case-insensitive.
+
+Fri Jan 16 18:25:57 2015 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]
+
+Fri Jan 16 18:25:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/resolv.rb (Resolv::DNS::Name): names with different dots
+ should be different.
+
+Fri Jan 16 17:34:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (f_label): return tLABEL value as it is.
+ [ruby-core:67315] [Bug #10693]
+
+Fri Jan 16 16:49:04 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 16 16:49:04 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 16 14:56:08 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]
+
+Fri Jan 16 14:20:52 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.
+
+Fri Jan 16 11:06:17 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/unicode_normalize.rb: typo fix. [ci skip]
+ [ruby-dev:48794][misc #10675]
+ included. [ruby-core:67264] [Bug #10685]
+Fri Jan 16 11:04:35 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * re.c (unescape_nonascii): append excape sequence as-is not
+ unescaped character, to get rid of unexpected meta-character.
+ [ruby-core:67193] [Bug #10670]
+
+Sat Jan 3 21:17:58 2015 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]
+
+Thu Jan 1 08:29:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * cygwin/GNUmakefile.in (EXTOBJS): override to add resource files
+ always. [ruby-core:67153] [Bug #10657]
+
+Wed Dec 31 15:26:46 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]
+
+Wed Dec 31 14:11:58 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]
+
+Wed Dec 31 13:26:22 2014 Eric Wong <e@80x24.org>
+
+ * vm_core.h (rb_vm_living_threads_insert): preserve order
+ [Bug #10660] [ruby-core:67154] [ruby-core:67159]
+
+Fri Dec 26 15:42:27 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
+ [Bug #10647] [ruby-dev:48787]
+
+Thu Dec 25 17:42:01 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.
+
+Thu Dec 25 17:37:47 2014 Naohisa Goto <ngotogenome@gmail.com>
+
+ * gc.c (wmap_final_func): fix memory size shortage when realloc wmap.
+ Fix SEGV during finilize of WeakRef on Solaris (though the SEGV
+ could occur on all OS/platforms). [ruby-dev:48779] [Bug #10646]
+
+Thu Dec 25 17:31:51 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: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/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 565c4c9cde..24e36e6231 100644
--- a/LEGAL
+++ b/LEGAL
@@ -1,27 +1,23 @@
-# -*- rdoc -*-
-
-= LEGAL NOTICE INFORMATION
---------------------------
+LEGAL NOTICE INFORMATION
+------------------------
All the files in this distribution are covered under either the Ruby's
license (see the file COPYING) or public-domain except some files
mentioned below.
-ccan/build_assert/build_assert.h::
-ccan/check_type/check_type.h::
-ccan/container_of/container_of.h::
-ccan/str/str.h::
+ccan/build_assert/build_assert.h
+ccan/check_type/check_type.h
+ccan/container_of/container_of.h
+ccan/str/str.h
These files are licensed under the CC0.
- >>>
- https://creativecommons.org/choose/zero/
+ http://creativecommons.org/choose/zero/
-ccan/list/list.h::
+ccan/list/list.h
This file is licensed under the MIT License.
- >>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@@ -40,192 +36,81 @@ 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.c::
-regenc.h::
-regerror.c::
-regexec.c::
-regint.h::
-regparse.c::
-regparse.h::
-enc/ascii.c::
-enc/big5.c::
-enc/cp949.c::
-enc/emacs_mule.c::
-enc/encdb.c::
-enc/euc_jp.c::
-enc/euc_kr.c::
-enc/euc_tw.c::
-enc/gb18030.c::
-enc/gb2312.c::
-enc/gbk.c::
-enc/iso_8859_1.c::
-enc/iso_8859_10.c::
-enc/iso_8859_11.c::
-enc/iso_8859_13.c::
-enc/iso_8859_14.c::
-enc/iso_8859_15.c::
-enc/iso_8859_16.c::
-enc/iso_8859_2.c::
-enc/iso_8859_3.c::
-enc/iso_8859_4.c::
-enc/iso_8859_5.c::
-enc/iso_8859_6.c::
-enc/iso_8859_7.c::
-enc/iso_8859_8.c::
-enc/iso_8859_9.c::
-enc/koi8_r.c::
-enc/koi8_u.c::
-enc/shift_jis.c::
-enc/unicode.c::
-enc/us_ascii.c::
-enc/utf_16be.c::
-enc/utf_16le.c::
-enc/utf_32be.c::
-enc/utf_32le.c::
-enc/utf_8.c::
-enc/windows_1251.c::
-
- Onigmo (Oniguruma-mod) LICENSE
-
- >>>
- 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/
-
- 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::
-
- These files have this explanatory texts.
-
- >>>
- 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::
-
- These files are copyrighted as the following.
-
- >>>
- © 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::
-
- These files are copyrighted as the following.
-
- >>>
- 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::
-
- These files are copyrighted as the following.
-
- >>>
- 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::
+include/ruby/oniguruma.h:
+regcomp.c:
+regenc.[ch]:
+regerror.c:
+regexec.c:
+regint.h:
+regparse.[ch]:
+enc/ascii.c
+enc/big5.c
+enc/cp949.c
+enc/emacs_mule.c
+enc/encdb.c
+enc/euc_jp.c
+enc/euc_kr.c
+enc/euc_tw.c
+enc/gb18030.c
+enc/gb2312.c
+enc/gbk.c
+enc/iso_8859_1.c
+enc/iso_8859_10.c
+enc/iso_8859_11.c
+enc/iso_8859_13.c
+enc/iso_8859_14.c
+enc/iso_8859_15.c
+enc/iso_8859_16.c
+enc/iso_8859_2.c
+enc/iso_8859_3.c
+enc/iso_8859_4.c
+enc/iso_8859_5.c
+enc/iso_8859_6.c
+enc/iso_8859_7.c
+enc/iso_8859_8.c
+enc/iso_8859_9.c
+enc/koi8_r.c
+enc/koi8_u.c
+enc/shift_jis.c
+enc/unicode.c
+enc/us_ascii.c
+enc/utf_16be.c
+enc/utf_16le.c
+enc/utf_32be.c
+enc/utf_32le.c
+enc/utf_8.c
+enc/windows_1251.c
+
+Oniguruma ---- (C) K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+
+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.
+
+configure:
This file is free software.
- >>>
- Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
-tool/config.guess::
-tool/config.sub::
+tool/config.guess:
+tool/config.sub:
As long as you distribute these files with the file configure, they
are covered under the Ruby's license.
- >>>
- Copyright 1992-2018 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+ Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
@@ -234,55 +119,53 @@ tool/config.sub::
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <https://www.gnu.org/licenses/>.
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception to the GNU General Public License, if you
distribute this file as part of a program that contains a
configuration script generated by Autoconf, you may include it under
- the same distribution terms that you use for the rest of that
- program. This Exception is an additional permission under section 7
- of the GNU General Public License, version 3 ("GPLv3").
+ the same distribution terms that you use for the rest of that program.
-parse.c::
+parse.c:
This file is licensed under the GPL, but is incorporated into Ruby and
redistributed under the terms of the Ruby license, as permitted by the
exception to the GPL below.
- >>>
- Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison.
+ /* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-missing/dtoa.c::
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
- This file is under these licenses.
+util.c (partly):
- >>>
Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
Permission to use, copy, modify, and distribute this software for any
@@ -296,49 +179,48 @@ missing/dtoa.c::
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- >>>
- Copyright (c) 2004-2008 David Schultz <das@FreeBSD.ORG>
- 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.
-
-win32/win32.{c,h}::
+win32/win32.[ch]:
You can apply the Artistic License to these files. (or GPL,
alternatively)
- >>>
Copyright (c) 1993, Intergraph Corporation
You may distribute under the terms of either the GNU General Public
License or the Artistic License, as specified in the perl README file.
-missing/mt19937.c::
+util.c (partly):
+
+ Copyright (c) 2004-2008 David Schultz <das@FreeBSD.ORG>
+ 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.
+
+random.c
This file is under the new-style BSD license.
- >>>
A C-program for MT19937, with initialization improved 2002/2/10.
- Coded by Takuji Nishimura and Makoto Matsumoto.
+ Coded by Takuji Nishimura and Makoto Matsumoto.
This is a faster version by taking Shawn Cokus's optimization,
Matthe Bellew's simplification, Isaku Wada's real version.
@@ -352,16 +234,16 @@ missing/mt19937.c::
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.
+ 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.
+ 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 names of its contributors may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
+ 3. The names of its contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -380,47 +262,41 @@ missing/mt19937.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
-
-missing/procstat_vm.c::
-
- This file is under the new-style BSD license.
-
- >>>
- Copyright (c) 2007 Robert N. M. Watson
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- $FreeBSD: head/usr.bin/procstat/procstat_vm.c 261780 2014-02-11 21:57:37Z jhb $
-
-vsnprintf.c::
+vm_dump.c:procstat_vm
+
+ * Copyright (c) 2007 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/usr.bin/procstat/procstat_vm.c 261780 2014-02-11 21:57:37Z jhb $
+
+vsnprintf.c:
This file is under the old-style BSD license. Note that the
paragraph 3 below is now null and void.
- >>>
- Copyright (c) 1990, 1993
- The Regents of the University of California. All rights reserved.
+ Copyright (c) 1990, 1993
+ The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Chris Torek.
@@ -454,40 +330,32 @@ 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::
-missing/alloca.c::
-missing/dup2.c::
-missing/erf.c::
-missing/finite.c::
-missing/hypot.c::
-missing/isinf.c::
-missing/isnan.c::
-missing/lgamma_r.c::
-missing/memcmp.c::
-missing/memmove.c::
-missing/strchr.c::
-missing/strerror.c::
-missing/strstr.c::
-missing/tgamma.c::
-ext/date/date_strftime.c::
-ext/digest/sha1/sha1.c::
-ext/digest/sha1/sha1.h::
-ext/sdbm/_sdbm.c::
-ext/sdbm/sdbm.h::
+st.[ch]:
+missing/alloca.c:
+missing/dup2.c:
+missing/erf.c:
+missing/finite.c:
+missing/hypot.c:
+missing/isinf.c:
+missing/isnan.c:
+missing/lgamma_r.c:
+missing/memcmp.c:
+missing/memmove.c:
+missing/strchr.c:
+missing/strstr.c:
+missing/strtol.c:
+missing/tgamma.c:
+ext/digest/sha1/sha1.[ch]:
These files are all under public domain.
-missing/crypt.c::
+missing/crypt.c:
This file is under the old-style BSD license. Note that the
paragraph 3 below is now null and void.
- >>>
- Copyright (c) 1989, 1993
- The Regents of the University of California. All rights reserved.
+ 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.
@@ -516,16 +384,15 @@ missing/crypt.c::
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-missing/setproctitle.c::
+missing/setproctitle.c
This file is under the old-style BSD license. Note that the
paragraph 3 below is now null and void.
- >>>
- Copyright 2003 Damien Miller
- Copyright (c) 1983, 1995-1997 Eric P. Allman
- Copyright (c) 1988, 1993
- The Regents of the University of California. All rights reserved.
+ Copyright 2003 Damien Miller
+ Copyright (c) 1983, 1995-1997 Eric P. Allman
+ Copyright (c) 1988, 1993
+ The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -551,45 +418,52 @@ missing/setproctitle.c::
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-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>
-
- 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.
+missing/strlcat.c
+missing/strlcpy.c
- 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.
+ These files are under the new-style BSD license.
-missing/langinfo.c::
+ Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+missing/langinfo.c
This file is from http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c.
Ruby uses a modified version. The file contains the following
author/copyright notice:
- >>>
- Markus.Kuhn@cl.cam.ac.uk -- 2002-03-11
- Permission to use, copy, modify, and distribute this software
- for any purpose and without fee is hereby granted. The author
- disclaims all warranties with regard to this software.
+ Markus.Kuhn@cl.cam.ac.uk -- 2002-03-11
+ Permission to use, copy, modify, and distribute this software
+ for any purpose and without fee is hereby granted. The author
+ disclaims all warranties with regard to this software.
-ext/digest/md5/md5.c::
-ext/digest/md5/md5.h::
+ext/digest/md5/md5.[ch]:
These files are under the following license. Ruby uses modified
versions of them.
- >>>
Copyright (C) 1999, 2000 Aladdin Enterprises. All rights reserved.
This software is provided 'as-is', without any express or implied
@@ -611,26 +485,22 @@ ext/digest/md5/md5.h::
L. Peter Deutsch
ghost@aladdin.com
-ext/digest/rmd160/rmd160.c::
-ext/digest/rmd160/rmd160.h::
+ext/digest/rmd160/rmd160.[ch]:
These files have the following copyright information, and by the
author we are allowed to use it under the new-style BSD license.
- >>>
- AUTHOR:: Antoon Bosselaers, ESAT-COSIC
+ AUTHOR: Antoon Bosselaers, ESAT-COSIC
(Arranged for libc by Todd C. Miller)
- DATE:: 1 March 1996
+ DATE: 1 March 1996
Copyright (c) Katholieke Universiteit Leuven
1996, All Rights Reserved
-ext/digest/sha2/sha2.c::
-ext/digest/sha2/sha2.h::
+ext/digest/sha2/sha2.[ch]:
These files are under the new-style BSD license.
- >>>
Copyright 2000 Aaron D. Gifford. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -657,108 +527,28 @@ ext/digest/sha2/sha2.h::
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-ext/json/generator/generator.c::
-
- The file contains the following copyright notice.
-
- >>>
- 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::
+ext/nkf/nkf-utf8/config.h:
+ext/nkf/nkf-utf8/nkf.c:
+ext/nkf/nkf-utf8/utf8tbl.c:
These files are under the following license. So to speak, it is
copyrighted semi-public-domain software.
- >>>
Copyright (C) 1987, Fujitsu LTD. (Itaru ICHIKAWA)
-
- Everyone is permitted to do anything on this program
- including copying, modifying, improving,
- as long as you don't try to pretend that you wrote it.
- i.e., the above copyright notice has to appear in all copies.
- Binary distribution requires original version messages.
- 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::
-
- The files under these directories are under the following license, except for
- ext/psych/yaml.
-
- >>>
- 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::
-
- The files under this directory are under the following license.
-
- >>>
- 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::
+ Everyone is permitted to do anything on this program
+ including copying, modifying, improving,
+ as long as you don't try to pretend that you wrote it.
+ i.e., the above copyright notice has to appear in all copies.
+ Binary distribution requires original version messages.
+ You don't have to ask before copying, redistribution or publishing.
+ THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
+
+ext/socket/addrinfo.h:
+ext/socket/getaddrinfo.c:
+ext/socket/getnameinfo.c:
These files are under the new-style BSD license.
- >>>
Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
All rights reserved.
@@ -786,12 +576,11 @@ ext/socket/getnameinfo.c::
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-ext/win32ole/win32ole.c::
+ext/win32ole/win32ole.c:
You can apply the Artistic License to this file. (or GPL,
alternatively)
- >>>
(c) 1995 Microsoft Corporation. All rights reserved.
Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
@@ -801,135 +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::
-
- The files under these directories are under the following license.
-
- >>>
- 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 under the following license.
-
- >>>
- 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.
-
-lib/bundler::
-lib/bundler.rb::
-lib/bundler.gemspec::
-spec/bundler::
-man/bundle-*,gemfile.*::
-
- Bundler is under the following license.
-
- >>>
- Portions copyright (c) 2010 Andre Arko
- Portions copyright (c) 2009 Engine Yard
-
- MIT License::
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000000..7da2488b46
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,506 @@
+SHELL = /bin/sh
+NULLCMD = @NULLCMD@
+n=$(NULLCMD)
+ECHO1 = $(V:1=$n)
+RUNCMD = $(SHELL)
+CDPATH = .
+CHDIR = @CHDIR@
+exec = exec
+NULL = /dev/null
+PATH_SEPARATOR = @PATH_SEPARATOR@
+
+#### Start of system configuration section. ####
+
+srcdir = @srcdir@
+top_srcdir = $(srcdir)
+hdrdir = $(srcdir)/include
+PLATFORM_DIR = @PLATFORM_DIR@
+
+CC = @CC@
+CPP = @CPP@
+LD = @LD@
+YACC = bison
+PURIFY =
+AUTOCONF = autoconf
+@SET_MAKE@
+MKFILES = @MAKEFILES@
+BASERUBY = @BASERUBY@
+HAVE_BASERUBY = @HAVE_BASERUBY@
+TEST_RUNNABLE = @TEST_RUNNABLE@
+CROSS_COMPILING = @CROSS_COMPILING@
+DOXYGEN = @DOXYGEN@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+datarootdir = @datarootdir@
+datadir = @datadir@
+arch = @arch@
+sitearch = @sitearch@
+sitedir = @sitedir@
+archlibdir = @archlibdir@
+ruby_version = @ruby_version@
+
+TESTUI = console
+TESTS =
+INSTALLDOC = @INSTALLDOC@
+DOCTARGETS = @RDOCTARGET@ @CAPITARGET@
+
+EXTOUT = @EXTOUT@
+arch_hdrdir = $(EXTOUT)/include/$(arch)
+VPATH = $(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir):$(srcdir)/enc:$(srcdir)/missing
+
+empty =
+CC_VERSION = @CC_VERSION@
+OUTFLAG = @OUTFLAG@$(empty)
+COUTFLAG = @COUTFLAG@$(empty)
+ARCH_FLAG = @ARCH_FLAG@
+CFLAGS_NO_ARCH = @CFLAGS@
+CFLAGS = $(CFLAGS_NO_ARCH) $(ARCH_FLAG)
+cflags = @cflags@
+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@
+EXTLDFLAGS = @EXTLDFLAGS@
+XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
+EXTLIBS =
+LIBS = @LIBS@ $(EXTLIBS)
+MISSING = @LIBOBJS@ @ALLOCA@
+LDSHARED = @LIBRUBY_LDSHARED@
+DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
+SOLIBS = @SOLIBS@
+MAINLIBS = @MAINLIBS@
+ARCHMINIOBJS = @MINIOBJS@
+DLNOBJ = @DLNOBJ@
+ENCOBJS = @ENCOBJS@
+EXTOBJS = @EXTOBJS@
+BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
+BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
+BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
+POSTLINK = @POSTLINK@
+
+RUBY_BASE_NAME=@RUBY_BASE_NAME@
+RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
+RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
+RUBY_SO_NAME=@RUBY_SO_NAME@
+EXEEXT = @EXEEXT@
+LIBEXT = @LIBEXT@
+PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
+RUBY = $(RUBY_INSTALL_NAME)
+MINIRUBY = @MINIRUBY@\
+ $(MINIRUBYOPT)
+# RUNRUBY_COMMAND:: runruby.rb or baseruby. do not append options directly
+RUNRUBY_COMMAND = @RUNRUBY_COMMAND@
+# RUNRUBY:: run ruby with RUN_OPTS which is passed to ruby
+RUNRUBY = @RUNRUBY@ $(RUN_OPTS)
+# RUNRUBY_DEBUGGER:: debugging option for runruby.rb
+RUNRUBY_DEBUGGER = --debugger='gdb -x run.gdb --quiet --args'
+XRUBY = @XRUBY@
+BTESTRUBY = @BTESTRUBY@\
+ $(MINIRUBYOPT)
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+XRUBY_LIBDIR = @XRUBY_LIBDIR@
+XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
+XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
+
+#### End of system configuration section. ####
+
+MAJOR= @MAJOR@
+MINOR= @MINOR@
+TEENY= @TEENY@
+
+LIBRUBY_A = @LIBRUBY_A@
+LIBRUBY_SO = @LIBRUBY_SO@
+LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
+LIBRUBY = @LIBRUBY@
+LIBRUBYARG = @LIBRUBYARG@
+LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
+LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
+LIBRUBY_RELATIVE = @LIBRUBY_RELATIVE@
+LIBRUBY_A_OBJS = @LIBRUBY_A_OBJS@
+
+DTRACE_REBUILD_OBJS = $(DTRACE_REBUILD:yes=$(DTRACE_DEPENDENT_OBJS))
+
+DTRACE_DEPENDENT_OBJS = array.$(OBJEXT) \
+ eval.$(OBJEXT) \
+ gc.$(OBJEXT) \
+ hash.$(OBJEXT) \
+ load.$(OBJEXT) \
+ object.$(OBJEXT) \
+ parse.$(OBJEXT) \
+ string.$(OBJEXT) \
+ symbol.$(OBJEXT) \
+ vm.$(OBJEXT)
+
+THREAD_MODEL = @THREAD_MODEL@
+
+PREP = @PREP@
+ARCHFILE = @ARCHFILE@
+SETUP =
+EXTSTATIC = @EXTSTATIC@
+ENCSTATIC = @ENCSTATIC@
+SET_LC_MESSAGES = env LC_MESSAGES=C
+
+MAKEDIRS = @MKDIR_P@
+CP = cp
+MV = mv
+RM = rm -f
+RMDIR = @RMDIR@
+RMDIRS = @RMDIRS@
+RMALL = @RMALL@
+NM = @NM@
+AR = @AR@
+ARFLAGS = rcu
+RANLIB = @RANLIB@
+AS = @AS@
+ASFLAGS = @ASFLAGS@ $(INCFLAGS)
+IFCHANGE = $(srcdir)/tool/ifchange
+SET_LC_MESSAGES = env LC_MESSAGES=C
+OBJDUMP = @OBJDUMP@
+OBJCOPY = @OBJCOPY@
+VCS = @VCS@
+VCSUP = @VCSUP@
+DTRACE = @DTRACE@
+DTRACE_EXT = @DTRACE_EXT@
+DTRACE_OBJ = @DTRACE_OBJ@
+DTRACE_REBUILD= @DTRACE_REBUILD@
+DTRACE_GLOMMED_OBJ = $(DTRACE_REBUILD:yes=ruby-glommed.$(OBJEXT))
+
+OBJEXT = @OBJEXT@
+ASMEXT = S
+DLEXT = @DLEXT@
+MANTYPE = @MANTYPE@
+SYMBOL_PREFIX = @SYMBOL_PREFIX@
+
+INSTALLED_LIST= .installed.list
+
+NEWLINE_C = newline.c
+MINIPRELUDE_C = miniprelude.c
+PRELUDE_C = prelude.c
+RBCONFIG = .rbconfig.time
+
+SRC_FILE = $<
+OS_SRC_FILE = $<
+DEST_FILE = $@
+OS_DEST_FILE = $@
+
+MESSAGE_BEGIN = @for line in
+MESSAGE_END = ; do echo "$$line"; done
+ECHO_BEGIN = @sep=''; for word in
+ECHO_END = ; do echo @ECHO_N@ "$$sep'$$word'@ECHO_C@"; sep=' '; done; echo
+
+DESTDIR = @DESTDIR@
+
+configure_args = @configure_args@
+#### End of variables
+
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
+
+all:
+
+# Prevent GNU make v3 from overflowing arg limit on SysV.
+.NOEXPORT:
+
+miniruby$(EXEEXT):
+ @-if test -f $@; then $(MV) -f $@ $@.old; $(RM) $@.old; fi
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS) $(MAINLIBS) $(LIBS) $(OUTFLAG)$@
+
+$(PROGRAM):
+ @$(RM) $@
+ $(ECHO) linking $@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(MAINLIBS) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(POSTLINK)
+
+# We must `rm' the library each time this rule is invoked because "updating" a
+# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
+# supported.
+$(LIBRUBY_A):
+ @$(RM) $@
+ $(ECHO) linking static-library $@
+ $(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(INITOBJS)
+ @-$(RANLIB) $@ 2> /dev/null || true
+ $(ECHO) verifying static-library $@
+ @$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
+ @$(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)*_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
+
+install-cross: $(arch)-fake.rb $(RBCONFIG) rbconfig.rb $(arch_hdrdir)/ruby/config.h \
+ $(LIBRUBY_A) $(LIBRUBY_SO) $(ARCHFILE)
+ $(ECHO) installing cross-compiling stuff
+ $(Q) $(MAKEDIRS) $(XRUBY_RUBYLIBDIR)/$(arch) $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
+ $(Q) sed '/^\$$:\.unshift/q' $(arch)-fake.rb > fake.rb
+ $(Q) $(BASERUBY) -p \
+ -e '~/^\s*CONFIG\["LDFLAGS"\]/ and' \
+ -e '$$_[/(?=\s*"$$)/] = %q[ #{(CONFIG["LIBPATHFLAG"]%File.dirname(__FILE__)).strip}]' \
+ rbconfig.rb > fake-rbconfig.rb
+ $(INSTALL_SCRIPT) fake.rb $(XRUBY_RUBYLIBDIR)/$(arch)/fake.rb
+ $(INSTALL_SCRIPT) fake-rbconfig.rb $(XRUBY_RUBYLIBDIR)/$(arch)/rbconfig.rb
+ @$(RM) fake.rb fake-rbconfig.rb
+ $(INSTALL_DATA) $(arch_hdrdir)/ruby/config.h $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
+ $(INSTALL_DATA) $(top_srcdir)/include/ruby/win32.h $(XRUBY_RUBYHDRDIR)/ruby
+ $(INSTALL_DATA) $(LIBRUBY) $(LIBRUBY_A) $(XRUBY_RUBYLIBDIR)/$(arch)
+ $(INSTALL_PROGRAM) $(LIBRUBY_SO) $(XRUBY_RUBYLIBDIR)/$(arch)
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
+
+$(MKFILES): config.status $(srcdir)/version.h
+ @[ -f $@ ] && mv $@ $@.old
+ MAKE=$(MAKE) $(SHELL) ./config.status $@
+ @cmp $@ $@.old > /dev/null 2>&1 && echo $@ unchanged && exit 0; \
+ { \
+ echo "all:; -@rm -f conftest.mk"; \
+ echo "conftest.mk: .force; @echo AUTO_REMAKE"; \
+ echo ".force:"; \
+ } > conftest.mk || exit 1; \
+ $(MAKE) -f conftest.mk | grep '^AUTO_REMAKE$$' >/dev/null 2>&1 || \
+ { echo "$@ updated, restart."; exit 1; }
+
+uncommon.mk: $(srcdir)/common.mk
+ sed 's/{\$$([^(){}]*)[^{}]*}//g' $< > $@
+
+.PHONY: reconfig
+reconfig-args = $(srcdir)/configure $(configure_args)
+config.status-args = ./config.status --recheck
+reconfig-exec-0 = exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3`
+reconfig-exec-1 = set -x; "$$@"
+
+reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in \
+ $(srcdir)/include/ruby/version.h
+ @PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \
+ set $(SHELL) $($@-args); $(reconfig-exec-$(V))
+
+$(srcdir)/configure: $(srcdir)/configure.in
+ $(CHDIR) $(srcdir) && exec $(AUTOCONF)
+
+incs: id.h
+all-incs: probes.h
+
+# Things which should be considered:
+# * with gperf v.s. without gperf
+# * committers may have various versions of gperf
+# * ./configure v.s. ../ruby/configure
+# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime.
+# * svn checkout generate a file with mtime as current time
+# * ext4 and XFS has a mtime with fractional part
+lex.c: defs/keywords
+ @\
+ if cmp -s $(srcdir)/defs/lex.c.src $?; then \
+ [ $(Q) ] && echo copying $@ || set -x; \
+ $(CP) $(srcdir)/lex.c.blt $@; \
+ else \
+ [ $(Q) ] && echo generating $@ || set -x; \
+ gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
+ $(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
+
+enc/jis/props.h: enc/jis/props.kwd
+ $(MAKEDIRS) $(@D)
+ @set +e; \
+ if cmp -s $(?:.kwd=.src) $?; then \
+ set -x; \
+ $(CP) $(?:.kwd=.h.blt) $@; \
+ else \
+ set -x; \
+ gperf $(JIS_PROPS_OPTIONS) $? | \
+ sed 's/(int)(long)&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\1, \2),/g' > $@ && \
+ $(CP) $? $(?:.kwd=.src) && \
+ $(CP) $@ $(?:.kwd=.h.blt); \
+ fi
+
+.c.@OBJEXT@:
+ @$(ECHO) compiling $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $<
+
+.s.@OBJEXT@:
+ @$(ECHO) assembling $<
+ $(Q) $(AS) $(ASFLAGS) -o $@ $<
+
+.c.S:
+ @$(ECHO) translating $<
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -S $<
+
+.c.i:
+ @$(ECHO) preprocessing $<
+ $(Q) $(CPP) $(warnflags) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
+
+.d.h:
+ @$(ECHO) translating probes $<
+ $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $<
+ $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
+ $(Q) $(RM) $@.tmp
+
+.dmyh.h:
+ @$(ECHO) copying dummy $(DEST_FILE)
+ $(Q) $(CP) $(OS_SRC_FILE) $(OS_DEST_FILE)
+
+probes.stamp: $(DTRACE_REBUILD_OBJS)
+ $(Q) if test -f $@ -o -f probes.$(OBJEXT); then \
+ $(RM) $(DTRACE_REBUILD_OBJS) $@; \
+ $(ECHO0) "rebuilding objects which were modified by \"dtrace -G\""; \
+ $(MAKE) $(DTRACE_REBUILD_OBJS); \
+ fi
+ $(Q) touch $@
+
+probes.@OBJEXT@: $(srcdir)/probes.d probes.stamp
+ @$(ECHO) processing probes in object files
+ $(Q) $(RM) $@
+ $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_REBUILD_OBJS)
+
+# DTrace static library hacks described here:
+# http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
+ruby-glommed.$(OBJEXT):
+ @$(ECHO) generating a glommed object with DTrace probes for static library
+ $(Q) $(LD) -r -o $@ $(OBJS)
+
+clean-local::
+ $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
+ enc/encinit.c enc/encinit.$(OBJEXT)
+ -$(Q)$(RM) $(pkgconfig_DATA)
+
+distclean-local::
+ $(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
+ -$(Q)$(RM) run.gdb
+ -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h
+ -$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true
+
+clean-ext distclean-ext realclean-ext::
+ @cd ext 2>/dev/null || exit 0; set dummy `echo "${EXTS}" | tr , ' '`; shift; \
+ test "$$#" = 0 && set .; \
+ set dummy `\
+ find "$$@" -name Makefile -print | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \
+ `; shift; \
+ cd ..; \
+ for dir do \
+ 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) -f $(ENC_MK) $(MFLAGS) $(@:-enc=)
+
+ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
+ $(ECHO) compiling $@
+ $(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+
+enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
+
+up::
+ @$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
+
+after-update:: update-config_files common-srcs
+
+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-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
+
+test-rubyspec-precheck:
+ @if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi
+
+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
+
+$(INSNS): $(srcdir)/insns.def vm_opts.h \
+ $(srcdir)/defs/opt_operand.def $(srcdir)/defs/opt_insn_unif.def \
+ $(srcdir)/tool/instruction.rb $(srcdir)/tool/insns2vm.rb
+ $(ECHO) generating $@
+ $(Q) $(BASERUBY) -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'
diff --git a/NEWS b/NEWS
index e1adb5115d..5ac07db507 100644
--- a/NEWS
+++ b/NEWS
@@ -1,826 +1,363 @@
# -*- rdoc -*-
-= NEWS for Ruby 2.7.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>).
+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.6.0 release
+== Changes since the 2.1.0 release
=== Language changes
-==== Pattern matching
+* nil/true/false
+ * nil/true/false objects are frozen. [Feature #8923]
-* Pattern matching is introduced as an experimental feature. [Feature #14912]
+* Hash literal
+ * Symbol key followed by a colon can be quoted. [Feature #4276]
- case [0, [1, 2, 3]]
- in [a, [b, *c]]
- p a #=> 0
- p b #=> 1
- p c #=> [2, 3]
- end
-
- case {a: 0, b: 1}
- in {a: 0, x: 1}
- :unreachable
- in {a: 0, b: var}
- p var #=> 1
- end
-
- case -1
- in 0 then :unreachable
- in 1 then :unreachable
- end #=> NoMatchingPatternError
-
- json = <<END
- {
- "name": "Alice",
- "age": 30,
- "children": [{ "name": "Bob", "age": 2 }]
- }
- END
-
- JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: name, age: age}]}
-
- p name #=> "Bob"
- p age #=> 2
-
- JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: "Charlie", age: age}]}
- #=> NoMatchingPatternError
-
-* See the following slides for more details:
- * https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7
- * Note that the slides are slightly obsolete.
-
-* The warning against pattern matching can be suppressed with
- {-W:no-experimental option}[#label-Warning+option].
-
-==== The spec of keyword arguments is changed towards 3.0
-
-* Automatic conversion of keyword arguments and positional arguments is
- deprecated, and conversion will be removed in Ruby 3. [Feature #14183]
-
- * When a method call passes a Hash at the last argument, and when it
- passes no keywords, and when the called method accepts keywords,
- a warning is emitted. To continue treating the hash as keywords,
- add a double splat operator to avoid the warning and ensure
- correct behavior in Ruby 3.
-
- def foo(key: 42); end; foo({key: 42}) # warned
- def foo(**kw); end; foo({key: 42}) # warned
- def foo(key: 42); end; foo(**{key: 42}) # OK
- def foo(**kw); end; foo(**{key: 42}) # OK
-
- * When a method call passes keywords to a method that accepts keywords,
- but it does not pass enough required positional arguments, the
- keywords are treated as a final required positional argument, and a
- warning is emitted. Pass the argument as a hash instead of keywords
- to avoid the warning and ensure correct behavior in Ruby 3.
-
- def foo(h, **kw); end; foo(key: 42) # warned
- def foo(h, key: 42); end; foo(key: 42) # warned
- def foo(h, **kw); end; foo({key: 42}) # OK
- def foo(h, key: 42); end; foo({key: 42}) # OK
-
- * When a method accepts specific keywords but not a keyword splat, and
- a hash or keywords splat is passed to the method that includes both
- Symbol and non-Symbol keys, the hash will continue to be split, and
- a warning will be emitted. You will need to update the calling code
- to pass separate hashes to ensure correct behavior in Ruby 3.
-
- def foo(h={}, key: 42); end; foo("key" => 43, key: 42) # warned
- def foo(h={}, key: 42); end; foo({"key" => 43, key: 42}) # warned
- def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK
-
- * If a method does not accept keywords, and is called with keywords,
- the keywords are still treated as a positional hash, with no warning.
- This behavior will continue to work in Ruby 3.
-
- def foo(opt={}); end; foo( key: 42 ) # OK
-
-* Non-symbols are allowed as keyword argument keys if the method accepts
- arbitrary keywords. [Feature #14183]
-
- * Non-Symbol keys in a keyword arguments hash were prohibited in 2.6.0,
- but are now allowed again. [Bug #15658]
-
- def foo(**kw); p kw; end; foo("str" => 1) #=> {"str"=>1}
-
-* <code>**nil</code> is allowed in method definitions to explicitly mark
- that the method accepts no keywords. Calling such a method with keywords
- will result in an ArgumentError. [Feature #14183]
-
- def foo(h, **nil); end; foo(key: 1) # ArgumentError
- def foo(h, **nil); end; foo(**{key: 1}) # ArgumentError
- def foo(h, **nil); end; foo("str" => 1) # ArgumentError
- def foo(h, **nil); end; foo({key: 1}) # OK
- def foo(h, **nil); end; foo({"str" => 1}) # OK
-
-* Passing an empty keyword splat to a method that does not accept keywords
- no longer passes an empty hash, unless the empty hash is necessary for
- a required parameter, in which case a warning will be emitted. Remove
- the double splat to continue passing a positional hash. [Feature #14183]
-
- h = {}; def foo(*a) a end; foo(**h) # []
- h = {}; def foo(a) a end; foo(**h) # {} and warning
- h = {}; def foo(*a) a end; foo(h) # [{}]
- h = {}; def foo(a) a end; foo(h) # {}
-
-* Above warnings can be suppressed also with {-W:no-deprecated option}[#label-Warning+option].
-
-==== Numbered parameters
-
-* Numbered parameters as default block parameters are introduced.
- [Feature #4475]
-
- [1, 2, 10].map { _1.to_s(16) } #=> ["1", "2", "a"]
- [[1, 2], [3, 4]].map { _1 + _2 } #=> [3, 7]
-
- You can still define a local variable named +_1+ and so on,
- and that is honored when present, but renders a warning.
-
- _1 = 0 #=> warning: `_1' is reserved for numbered parameter; consider another name
- [1].each { p _1 } # prints 0 instead of 1
-
-==== proc/lambda without block is deprecated
-
-* Proc.new and Kernel#proc with no block in a method called with a block is
- warned now.
-
- def foo
- proc
- end
- foo { puts "Hello" } #=> warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead
-
- This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option].
-
-* Kernel#lambda with no block in a method called with a block raises an exception.
-
- def bar
- lambda
- end
- bar { puts "Hello" } #=> tried to create Proc object without a block (ArgumentError)
-
-==== Other miscellaneous changes
-
-* A beginless range is experimentally introduced. It might be useful
- in +case+, new call-sequence of the <code>Comparable#clamp</code>,
- constants and DSLs. [Feature #14799]
-
- ary[..3] # identical to ary[0..3]
-
- case RUBY_VERSION
- when ..."2.4" then puts "EOL"
- # ...
- end
-
- age.clamp(..100)
-
- where(sales: ..100)
-
-* Setting <code>$;</code> to a non-nil value is warned now. [Feature #14240]
- Use of it in String#split is warned too.
- This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option].
-
-* Setting <code>$,</code> to a non-nil value is warned now. [Feature #14240]
- Use of it in Array#join is warned too.
- This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option].
-
-* Quoted here-document identifiers must end within the same line.
-
- <<"EOS
- " # This had been warned since 2.4; Now it raises a SyntaxError
- EOS
-
-* The flip-flop syntax deprecation is reverted. [Feature #5400]
-
-* Comment lines can be placed between fluent dot now.
-
- foo
- # .bar
- .baz # => foo.baz
-
-* Calling a private method with a literal +self+ as the receiver
- is now allowed. [Feature #11297] [Feature #16123]
-
-* Modifier rescue now operates the same for multiple assignment as single
- assignment. [Bug #8279]
-
- a, b = raise rescue [1, 2]
- # Previously parsed as: (a, b = raise) rescue [1, 2]
- # Now parsed as: a, b = (raise rescue [1, 2])
-
-* +yield+ in singleton class syntax is warned and will be deprecated later. [Feature #15575].
-
- def foo
- class << Object.new
- yield #=> warning: `yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575]
- end
- end
- foo { p :ok }
-
- This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option].
-
-* Argument forwarding by <code>(...)</code> is introduced. [Feature #16253]
-
- def foo(...)
- bar(...)
- end
-
- All arguments to +foo+ are forwarded to +bar+, including keyword and
- block arguments.
- Note that the parentheses are mandatory. <code>bar ...</code> is parsed
- as an endless range.
-
-* Access and setting of <code>$SAFE</code> is now always warned. <code>$SAFE</code>
- will become a normal global variable in Ruby 3.0. [Feature #16131]
-
-* <code>Object#{taint,untaint,trust,untrust}</code> and related functions in the C-API
- no longer have an effect (all objects are always considered untainted), and are now
- warned in verbose mode. This warning will be disabled even in non-verbose mode in
- Ruby 3.0, and the methods and C functions will be removed in Ruby 3.2. [Feature #16131]
-
-* Refinements take place at Object#method and Module#instance_method. [Feature #15373]
-
-=== Command line options
-
-==== Warning option
-
-The +-W+ option has been extended with a following +:+, to manage categorized
-warnings. [Feature #16345] [Feature #16420]
-
-* To suppress deprecation warnings:
-
- $ ruby -e '$; = ""'
- -e:1: warning: `$;' is deprecated
-
- $ ruby -W:no-deprecated -e '$; = //'
-
-* It works with the +RUBYOPT+ environment variable:
-
- $ RUBYOPT=-W:no-deprecated ruby -e '$; = //'
-
-* To suppress experimental feature warnings:
-
- $ ruby -e '0 in a'
- -e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
-
- $ ruby -W:no-experimental -e '0 in a'
-
-* To suppress both by using +RUBYOPT+, set space separated values:
-
- $ RUBYOPT='-W:no-deprecated -W:no-experimental' ruby -e '($; = "") in a'
-
-See also Warning in {Core classes updates}[#label-Core+classes+updates+-28outstanding+ones+only-29].
+* 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)
-Array::
-
- New methods::
-
- * Added Array#intersection. [Feature #16155]
-
- * Added Array#minmax, with a faster implementation than Enumerable#minmax. [Bug #15929]
-
-Comparable::
-
- Modified method::
-
- * Comparable#clamp now accepts a Range argument. [Feature #14784]
-
- -1.clamp(0..2) #=> 0
- 1.clamp(0..2) #=> 1
- 3.clamp(0..2) #=> 2
- # With beginless and endless ranges:
- -1.clamp(0..) #=> 0
- 3.clamp(..2) #=> 2
-
-
-Complex::
-
- New method::
-
- * Added Complex#<=>.
- So <code>0 <=> 0i</code> will not raise NoMethodError. [Bug #15857]
-
-Dir::
-
- Modified methods::
-
- * Dir.glob and Dir.[] no longer allow NUL-separated glob pattern.
- Use Array instead. [Feature #14643]
-
-Encoding::
-
- New encoding::
-
- * Added new encoding CESU-8. [Feature #15931]
-
-Enumerable::
-
- New methods::
-
- * Added Enumerable#filter_map. [Feature #15323]
-
- [1, 2, 3].filter_map {|x| x.odd? ? x.to_s : nil } #=> ["1", "3"]
-
- * Added Enumerable#tally. [Feature #11076]
-
- ["A", "B", "C", "B", "A"].tally #=> {"A"=>2, "B"=>2, "C"=>1}
-
-Enumerator::
-
- New methods::
-
- * Added Enumerator.produce to generate an Enumerator from any custom
- data transformation. [Feature #14781]
-
- require "date"
- dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates
- dates.detect(&:tuesday?) #=> next Tuesday
-
- * Added Enumerator::Lazy#eager that generates a non-lazy enumerator
- from a lazy enumerator. [Feature #15901]
-
- a = %w(foo bar baz)
- e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager
- p e.class #=> Enumerator
- p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"]
-
- * Added Enumerator::Yielder#to_proc so that a Yielder object
- can be directly passed to another method as a block
- argument. [Feature #15618]
-
-Fiber::
-
- New method::
-
- * Added Fiber#raise that behaves like Fiber#resume but raises an
- exception on the resumed fiber. [Feature #10344]
-
-File::
-
- Modified method::
-
- * File.extname now returns a dot string for names ending with a dot on
- non-Windows platforms. [Bug #15267]
-
- File.extname("foo.") #=> "."
-
-FrozenError::
-
- New method::
-
- * Added FrozenError#receiver to return the frozen object on which
- modification was attempted. To set this object when raising
- FrozenError in Ruby code, FrozenError.new accepts a +:receiver+
- option. [Feature #15751]
-
-GC::
-
- New method::
-
- * Added GC.compact method for compacting the heap.
- This function compacts live objects in the heap so that fewer pages may
- be used, and the heap may be more CoW (copy-on-write) friendly. [Feature #15626]
-
- Details on the algorithm and caveats can be found here:
- https://bugs.ruby-lang.org/issues/15626
-
-IO::
-
- New method::
-
- * Added IO#set_encoding_by_bom to check the BOM and set the external
- encoding. [Bug #15210]
-
-Integer::
-
- Modified method::
-
- * Integer#[] now supports range operations. [Feature #8842]
-
- 0b01001101[2, 4] #=> 0b0011
- 0b01001100[2..5] #=> 0b0011
- 0b01001100[2...6] #=> 0b0011
- # ^^^^
-
-Method::
-
- Modified method::
-
- * Method#inspect shows more information. [Feature #14145]
-
-Module::
-
- New methods::
-
- * Added Module#const_source_location to retrieve the location where a
- constant is defined. [Feature #10771]
-
- * Added Module#ruby2_keywords for marking a method as passing keyword
- arguments through a regular argument splat, useful when delegating
- all arguments to another method in a way that can be backwards
- compatible with older Ruby versions. [Bug #16154]
-
- Modified methods::
-
- * Module#autoload? now takes an +inherit+ optional argument, like
- Module#const_defined?. [Feature #15777]
-
- * Module#name now always returns a frozen String. The returned String is
- always the same for a given Module. This change is
- experimental. [Feature #16150]
-
-NilClass / TrueClass / FalseClass::
-
- Modified methods::
-
- * NilClass#to_s, TrueClass#to_s, and FalseClass#to_s now always return a
- frozen String. The returned String is always the same for each of these
- values. This change is experimental. [Feature #16150]
-
-ObjectSpace::WeakMap::
-
- Modified method::
-
- * ObjectSpace::WeakMap#[]= now accepts special objects as either key or
- values. [Feature #16035]
-
-Proc::
-
- New method::
-
- * Added Proc#ruby2_keywords for marking the proc as passing keyword
- arguments through a regular argument splat, useful when delegating
- all arguments to another method or proc in a way that can be backwards
- compatible with older Ruby versions. [Feature #16404]
-
-Range::
-
- New method::
-
- * Added Range#minmax, with a faster implementation than Enumerable#minmax.
- It returns a maximum that now corresponds to Range#max. [Bug #15807]
-
- Modified method::
-
- * Range#=== now uses Range#cover? for String arguments, too (in Ruby 2.6, it was
- changed from Range#include? for all types except strings). [Bug #15449]
-
-
-RubyVM::
-
- Removed method::
-
- * +RubyVM.resolve_feature_path+ moved to
- <code>$LOAD_PATH.resolve_feature_path</code>. [Feature #15903] [Feature #15230]
-
-String::
-
- Unicode::
-
- * Update Unicode version and Emoji version from 11.0.0 to
- 12.0.0. [Feature #15321]
-
- * Update Unicode version to 12.1.0, adding support for
- U+32FF SQUARE ERA NAME REIWA. [Feature #15195]
-
- * Update Unicode Emoji version to 12.1. [Feature #16272]
-
-Symbol::
-
- New methods::
-
- * Added Symbol#start_with? and Symbol#end_with? methods. [Feature #16348]
-
-Time::
-
- New methods::
-
- * Added Time#ceil method. [Feature #15772]
-
- * Added Time#floor method. [Feature #15653]
-
- Modified method::
-
- * Time#inspect is separated from Time#to_s and it shows
- the time's sub second. [Feature #15958]
-
-UnboundMethod::
-
- New method::
-
- * Added UnboundMethod#bind_call method. [Feature #15955]
-
- <code>umethod.bind_call(obj, ...)</code> is semantically equivalent
- to <code>umethod.bind(obj).call(...)</code>. This idiom is used in
- some libraries to call a method that is overridden. The added
- method does the same without allocation of an intermediate Method
- object.
-
- class Foo
- def add_1(x)
- x + 1
- end
- end
- class Bar < Foo
- def add_1(x) # override
- x + 2
- end
- end
-
- obj = Bar.new
- p obj.add_1(1) #=> 3
- p Foo.instance_method(:add_1).bind(obj).call(1) #=> 2
- p Foo.instance_method(:add_1).bind_call(obj, 1) #=> 2
-
-Warning::
-
- New methods::
-
- * Added Warning.[] and Warning.[]= to manage emitting/suppressing
- some categories of warnings. [Feature #16345] [Feature #16420]
-
-$LOAD_PATH::
-
- New method::
-
- * Added <code>$LOAD_PATH.resolve_feature_path</code>. [Feature #15903] [Feature #15230]
+* Binding
+ * New methods:
+ * Binding#local_variables
+ * Binding#receiver
+
+* Dir
+ * New methods:
+ * Dir#fileno
+
+* Enumerable
+ * New methods:
+ * Enumerable#slice_after
+ * Enumerable#slice_when
+ * Extended methods:
+ * min, min_by, max and max_by supports optional argument to return
+ multiple elements.
+
+* Float
+ * New methods:
+ * Float#next_float
+ * Float#prev_float
+
+* File
+ * New methods:
+ * File.birthtime
+ * File#birthtime
+
+* File::Stat
+ * New methods:
+ * File::Stat#birthtime
+
+* GC
+ * GC.latest_gc_info returns :state to represent current GC status.
+ * Improvements
+ * Introduce incremental marking for major GC. [Feature #10137]
+
+* IO
+ * Improvements
+ * IO#nonblock_read and IO#nonblock_write for pipes on Windows are supported.
+
+* Kernel
+ * New methods:
+ * Kernel#itself
+ * Improvements
+ * Kernel#throw raises UncaughtThrowError, subclass of ArgumentError when
+ there is no corresponding catch block, instead of ArgumentError.
+
+* Process
+ * Extended method:
+ * Process execution methods such as Process.spawn opens the file in write
+ mode for redirect from [:out, :err].
+
+* String
+ * New methods:
+ * String#unicode_normalize
+ * String#unicode_normalize!
+ * String#unicode_normalized?
+
+* Symbol
+ * Improvements
+ * Most symbols which are returned by String#to_sym and
+ String#intern are GC-able.
+
+* Method
+ * New methods:
+ * Method#curry([arity]) returns a curried Proc.
+ * Method#super_method returns a Method of superclass, which would be called
+ when super is used.
+
+=== Core classes compatibility issues (excluding feature bug fixes)
+
+* Enumerable
+ * Enumerable#slice_before's state management deprecated.
+ * Enumerable#chunk's state management deprecated.
+
+* GC
+ * incompatible changes:
+ * Rename GC.stat entries. [Feature #9924]
+ See https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
+
+* Hash
+ * incompatible changes:
+ * Change overriding policy for duplicated key. [Bug #10315]
+ { **hash1, **hash2 } contains values of hash2 for duplicated keys.
+
+* IO
+ * incompatible changes:
+ * When flushing file IO with IO#flush, you cannot assume that the metadata
+ of the file is updated immediately. On some platforms (especially
+ Windows), it is delayed until the filesystem load is decreased.
+ Use IO#fsync if you want to guarantee updating metadata.
+ * IO#each_codepoint raises an exception at incomplete character
+ before EOF when conversion takes place. [Bug #11444]
+
+* 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)
-Bundler::
-
- * Upgrade to Bundler 2.1.2.
- See https://github.com/bundler/bundler/releases/tag/v2.1.2
-
-CGI::
-
- * CGI.escapeHTML becomes 2~5x faster when there is at least one escaped character.
- See https://github.com/ruby/ruby/pull/2226
-
-CSV::
-
- * Upgrade to 3.1.2.
- See https://github.com/ruby/csv/blob/master/NEWS.md.
-
-Date::
-
- * Date.jisx0301, Date#jisx0301, and Date.parse support the new Japanese
- era. [Feature #15742]
-
-Delegator::
-
- * Object#DelegateClass accepts a block and module_evals it in the context
- of the returned class, similar to Class.new and Struct.new.
-
-ERB::
-
- * Prohibit marshaling ERB instance.
-
-IRB::
-
- * Introduce syntax highlighting inspired by the Pry gem to Binding#irb
- source lines, REPL input, and inspect output of some core-class objects.
-
- * Introduce multiline editing mode provided by Reline.
-
- * Show documentation when completion.
-
- * Enable auto indent and save/load history by default.
-
-JSON::
-
- * Upgrade to 2.3.0.
-
-Net::FTP::
-
- * Add Net::FTP#features to check available features, and Net::FTP#option to
- enable/disable each of them. [Feature #15964]
-
-Net::HTTP::
-
- * Add +ipaddr+ optional parameter to Net::HTTP#start to replace the address for
- the TCP/IP connection. [Feature #5180]
-
-Net::IMAP::
-
- * Add Server Name Indication (SNI) support. [Feature #15594]
-
-open-uri::
-
- * Warn open-uri's "open" method at Kernel.
- Use URI.open instead. [Misc #15893]
-
- * The default charset of "text/*" media type is UTF-8 instead of
- ISO-8859-1. [Bug #15933]
-
-OptionParser::
-
- * Now show "Did you mean?" for unknown options. [Feature #16256]
-
- test.rb:
-
- require "optparse"
- OptionParser.new do |opts|
- opts.on("-f", "--foo", "foo") {|v| }
- opts.on("-b", "--bar", "bar") {|v| }
- opts.on("-c", "--baz", "baz") {|v| }
- end.parse!
-
- example:
-
- $ ruby test.rb --baa
- Traceback (most recent call last):
- test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption)
- Did you mean? baz
- bar
-
-Pathname::
-
- * Pathname.glob now delegates 3 arguments to Dir.glob
- to accept +base+ keyword. [Feature #14405]
-
-Racc::
-
- * Merge 1.4.15 from upstream repository and added cli of racc.
-
-Reline::
-
- * New stdlib that is compatible with the readline stdlib but is
- implemented in pure Ruby. It also provides a multiline editing mode.
-
-REXML::
-
- * Upgrade to 3.2.3.
- See https://github.com/ruby/rexml/blob/master/NEWS.md.
-
-RSS::
-
- * Upgrade to RSS 0.2.8.
- See https://github.com/ruby/rss/blob/master/NEWS.md.
-
-RubyGems::
-
- * Upgrade to RubyGems 3.1.2.
- * https://github.com/rubygems/rubygems/releases/tag/v3.1.0
- * https://github.com/rubygems/rubygems/releases/tag/v3.1.1
- * https://github.com/rubygems/rubygems/releases/tag/v3.1.2
-
-StringScanner::
-
- * Upgrade to 1.0.3.
- See https://github.com/ruby/strscan/blob/master/NEWS.md.
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* The following libraries are no longer bundled gems.
- Install corresponding gems to use these features.
- * CMath (cmath gem)
- * Scanf (scanf gem)
- * Shell (shell gem)
- * Synchronizer (sync gem)
- * ThreadsWait (thwait gem)
- * E2MM (e2mmap gem)
-
-Proc::
- * The Proc#to_s format was changed. [Feature #16101]
-
-Range::
- * Range#minmax used to iterate on the range to determine the maximum.
- It now uses the same algorithm as Range#max. In rare cases (e.g.
- ranges of Floats or Strings), this may yield different results. [Bug #15807]
+* 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)
-* Promote stdlib to default gems
- * The following default gems were published on rubygems.org
- * benchmark
- * cgi
- * delegate
- * getoptlong
- * net-pop
- * net-smtp
- * open3
- * pstore
- * readline
- * readline-ext
- * singleton
- * The following default gems were only promoted at ruby-core,
- but not yet published on rubygems.org.
- * monitor
- * observer
- * timeout
- * tracer
- * uri
- * yaml
-* The <tt>did_you_mean</tt> gem has been promoted up to a default gem from a bundled gem
-
-pathname::
-
- * Kernel#Pathname when called with a Pathname argument now returns
- the argument instead of creating a new Pathname. This is more
- similar to other Kernel methods, but can break code that modifies
- the return value and expects the argument not to be modified.
-
-profile.rb, Profiler__::
-
- * Removed from standard library. It was unmaintained since Ruby 2.0.0.
-
-=== C API updates
-
-* Many <code>*_kw</code> functions have been added for setting whether
- the final argument being passed should be treated as keywords. You
- may need to switch to these functions to avoid keyword argument
- separation warnings, and to ensure correct behavior in Ruby 3.
+* lib/mathn.rb
+ * Show deprecated warning [Feature #10169]
-* The <code>:</code> character in rb_scan_args format string is now
- treated as keyword arguments. Passing a positional hash instead of
- keyword arguments will emit a deprecation warning.
+* ext/date/lib/date/format.rb
+ * Removed because it's empty file.
-* C API declarations with +ANYARGS+ are changed not to use +ANYARGS+.
- See https://github.com/ruby/ruby/pull/2404
+* Digest
+ * Digest::HMAC has finally ceased to exist. Use OpenSSL::HMAC or an external gem instead.
-=== Implementation improvements
+* 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.
-Fiber::
+* lib/rational.rb
+ * Removed because it is deprecated from 2009.
- * Allow selecting different coroutine implementations by using
- +--with-coroutine=+, e.g.
+* lib/complex.rb
+ * Removed because it is deprecated from 2009.
- $ ./configure --with-coroutine=ucontext
- $ ./configure --with-coroutine=copy
+* lib/prettyprint.rb
+ * Removed PrettyPrint#first?
- * Replace previous stack cache with fiber pool cache. The fiber pool
- allocates many stacks in a single memory region. Stack allocation
- becomes O(log N) and fiber creation is amortized O(1). Around 10x
- performance improvement was measured in micro-benchmarks.
- https://github.com/ruby/ruby/pull/2224
+* lib/minitest/*.rb
+ * Removed because it conflicts to minitest 5. [Feature #9711]
-File::
- * File.realpath now uses realpath(3) on many platforms, which can
- significantly improve performance. [Feature #15797]
+* lib/test/**/*.rb
+ * Removed because it conflicts to minitest 5, and it was just an wrapper
+ of minitest 4. [Feature #9711]
-Hash::
- * Change data structure of small Hash objects. [Feature #15602]
+* lib/uri
+ * support RFC 3986. [Feature #2542]
-Monitor::
- * Monitor class is written in C-extension. [Feature #16255]
+* GServer
+ * GServer is extracted to gserver gem. It's unmaintain code.
-Thread::
+* Logger
+ * Logger::Application is extracted to logger-application gem. It's unmaintain code.
- * VM stack memory allocation is now combined with native thread stack,
- improving thread allocation performance and reducing allocation related
- failures. Around 10x performance improvement was measured in micro-benchmarks.
+* ObjectSpace (after requiring "objspace")
+ * ObjectSpace.memsize_of(obj) returns a size includes sizeof(RVALUE).
+ [Bug #8984]
-JIT::
+* 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]
- * JIT-ed code is recompiled to less-optimized code when an optimization assumption is invalidated.
+* Psych
+ * Removed Psych::EngineManager [Bug #8344]
- * Method inlining is performed when a method is considered as pure.
- This optimization is still experimental and many methods are NOT considered as pure yet.
+=== Built-in global variables compatibility issues
- * The default value of +--jit-max-cache+ is changed from 1,000 to 100.
-
- * The default value of +--jit-min-calls+ is changed from 5 to 10,000.
-
-RubyVM::
-
- * Per-call-site method cache, which has been there since around 1.9, was
- improved: cache hit rate raised from 89% to 94%.
- See https://github.com/ruby/ruby/pull/2583
-
-RubyVM::InstructionSequence::
-
- * RubyVM::InstructionSequence#to_binary method generates compiled binary.
- The binary size is reduced. [Feature #16163]
-
-=== Miscellaneous changes
-
-* Support for IA64 architecture has been removed. Hardware for testing was
- difficult to find, native fiber code is difficult to implement, and it added
- non-trivial complexity to the interpreter. [Feature #15894]
-
-* Require compilers to support C99. [Misc #15347]
-
- * Details of our dialect: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99
-
-* Ruby's upstream repository is changed from Subversion to Git.
-
- * https://git.ruby-lang.org/ruby.git
-
- * RUBY_REVISION class is changed from Integer to String.
-
- * RUBY_DESCRIPTION includes Git revision instead of Subversion's one.
-
-* Support built-in methods in Ruby with the <code>_\_builtin_</code> syntax. [Feature #16254]
+=== C API updates
- Some methods are defined in *.rb (such as trace_point.rb).
- For example, it is easy to define a method which accepts keyword arguments.
+* 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/README.EXT b/README.EXT
index 48b8d964c4..3e010c3002 100644
--- a/README.EXT
+++ b/README.EXT
@@ -1 +1,1731 @@
-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 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 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 structures are complex.
+Use corresponding rb_xxx() functions to access the internal struct.
+For example, to access an entry of array, use rb_ary_entry(ary, offset)
+and rb_ary_store(ary, offset, obj).
+
+There are some accessing macros for structure members, for example
+`RSTRING_LEN(str)' to get the size of the Ruby String object. The
+allocated region can be accessed by `RSTRING_PTR(str)'.
+
+Notice: Do not change the value of the structure directly, unless you
+are responsible for the result. This ends up being the cause of
+interesting bugs.
+
+== Convert C Data into VALUE
+
+To convert C data to Ruby values:
+
+FIXNUM ::
+
+ left shift 1 bit, and turn on its least significant bit (LSB).
+
+Other pointer values::
+
+ cast to VALUE.
+
+You can determine whether a VALUE is a pointer or not by checking its LSB.
+
+Notice: Ruby does not allow arbitrary pointer values to be a VALUE. They
+should be pointers to the structures which Ruby knows about. The known
+structures are defined in <ruby.h>.
+
+To convert C numbers to Ruby values, use these macros:
+
+INT2FIX() :: for integers within 31bits.
+INT2NUM() :: for arbitrary sized integers.
+
+INT2NUM() converts an integer into a Bignum if it is out of the FIXNUM
+range, but is a bit slower.
+
+== Manipulating Ruby Data
+
+As I already mentioned, it is not recommended to modify an object's
+internal structure. To manipulate objects, use the functions supplied
+by the Ruby interpreter. Some (not all) of the useful functions are
+listed below:
+
+=== String Functions
+
+rb_str_new(const char *ptr, long len) ::
+
+ Creates a new Ruby string.
+
+rb_str_new2(const char *ptr) ::
+rb_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string from a C string. This is equivalent to
+ rb_str_new(ptr, strlen(ptr)).
+
+rb_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal.
+
+rb_tainted_str_new(const char *ptr, long len) ::
+
+ Creates a new tainted Ruby string. Strings from external data
+ sources should be tainted.
+
+rb_tainted_str_new2(const char *ptr) ::
+rb_tainted_str_new_cstr(const char *ptr) ::
+
+ Creates a new tainted Ruby string from a C string.
+
+rb_sprintf(const char *format, ...) ::
+rb_vsprintf(const char *format, va_list ap) ::
+
+ Creates a new Ruby string with printf(3) format.
+
+ Note: In the format string, "%"PRIsVALUE can be used for Object#to_s
+ (or Object#inspect if '+' flag is set) output (and related argument
+ must be a VALUE). Since it conflicts with "%i", for integers in
+ format strings, use "%d".
+
+rb_str_cat(VALUE str, const char *ptr, long len) ::
+
+ Appends len bytes of data from ptr to the Ruby string.
+
+rb_str_cat2(VALUE str, const char* ptr) ::
+rb_str_cat_cstr(VALUE str, const char* ptr) ::
+
+ Appends C string ptr to Ruby string str. This function is
+ equivalent to rb_str_cat(str, ptr, strlen(ptr)).
+
+rb_str_catf(VALUE str, const char* format, ...) ::
+rb_str_vcatf(VALUE str, const char* format, va_list ap) ::
+
+ Appends C string format and successive arguments to Ruby string
+ str according to a printf-like format. These functions are
+ equivalent to rb_str_cat2(str, rb_sprintf(format, ...)) and
+ rb_str_cat2(str, rb_vsprintf(format, ap)), respectively.
+
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc) ::
+rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc) ::
+
+ Creates a new Ruby string with the specified encoding.
+
+rb_enc_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal with the specified
+ encoding.
+
+rb_usascii_str_new(const char *ptr, long len) ::
+rb_usascii_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string with encoding US-ASCII.
+
+rb_usascii_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal with encoding
+ US-ASCII.
+
+rb_utf8_str_new(const char *ptr, long len) ::
+rb_utf8_str_new_cstr(const char *ptr) ::
+
+ Creates a new Ruby string with encoding UTF-8.
+
+rb_utf8_str_new_literal(const char *ptr) ::
+
+ Creates a new Ruby string from a C string literal with encoding
+ UTF-8.
+
+rb_str_resize(VALUE str, long len) ::
+
+ Resizes a Ruby string to len bytes. If str is not modifiable, this
+ function raises an exception. The length of str must be set in
+ advance. If len is less than the old length the content beyond
+ len bytes is discarded, else if len is greater than the old length
+ the content beyond the old length bytes will not be preserved but
+ will be garbage. Note that RSTRING_PTR(str) may change by calling
+ this function.
+
+rb_str_set_len(VALUE str, long len) ::
+
+ Sets the length of a Ruby string. If str is not modifiable, this
+ function raises an exception. This function preserves the content
+ up to len bytes, regardless RSTRING_LEN(str). len must not exceed
+ the capacity of str.
+
+=== Array Functions
+
+rb_ary_new() ::
+
+ Creates an array with no elements.
+
+rb_ary_new2(long len) ::
+rb_ary_new_capa(long len) ::
+
+ Creates an array with no elements, allocating internal buffer
+ for len elements.
+
+rb_ary_new3(long n, ...) ::
+rb_ary_new_from_args(long n, ...) ::
+
+ Creates an n-element array from the arguments.
+
+rb_ary_new4(long n, VALUE *elts) ::
+rb_ary_new_from_values(long n, VALUE *elts) ::
+
+ Creates an n-element array from a C array.
+
+rb_ary_to_ary(VALUE obj) ::
+
+ Converts the object into an array.
+ Equivalent to Object#to_ary.
+
+There are many functions to operate an array. They may dump core if other
+types are given.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary) ::
+
+ Equivalent to Array#[].
+
+rb_ary_entry(VALUE ary, long offset) ::
+
+ ary[offset]
+
+rb_ary_store(VALUE ary, long offset, VALUE obj) ::
+
+ ary[offset] = obj
+
+rb_ary_subseq(VALUE ary, long beg, long len) ::
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val) ::
+rb_ary_pop(VALUE ary) ::
+rb_ary_shift(VALUE ary) ::
+rb_ary_unshift(VALUE ary, VALUE val) ::
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len) ::
+
+ Appends len elements of objects from ptr to the array.
+
+= Extending Ruby with C
+
+== Adding New Features to Ruby
+
+You can add new features (classes, methods, etc.) to the Ruby
+interpreter. Ruby provides APIs for defining the following things:
+
+* Classes, Modules
+* Methods, Singleton Methods
+* Constants
+
+=== Class and Module Definition
+
+To define a class or module, use the functions below:
+
+ VALUE rb_define_class(const char *name, VALUE super)
+ VALUE rb_define_module(const char *name)
+
+These functions return the newly created class or module. You may
+want to save this reference into a variable to use later.
+
+To define nested classes or modules, use the functions below:
+
+ VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
+ VALUE rb_define_module_under(VALUE outer, const char *name)
+
+=== Method and Singleton Method Definition
+
+To define methods or singleton methods, use these functions:
+
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ void rb_define_singleton_method(VALUE object, const char *name,
+ VALUE (*func)(), int argc)
+
+The `argc' represents the number of the arguments to the C function,
+which must be less than 17. But I doubt you'll need that many.
+
+If `argc' is negative, it specifies the calling sequence, not number of
+the arguments.
+
+If argc is -1, the function will be called as:
+
+ VALUE func(int argc, VALUE *argv, VALUE obj)
+
+where argc is the actual number of arguments, argv is the C array of
+the arguments, and obj is the receiver.
+
+If argc is -2, the arguments are passed in a Ruby array. The function
+will be called like:
+
+ VALUE func(VALUE obj, VALUE args)
+
+where obj is the receiver, and args is the Ruby array containing
+actual arguments.
+
+There are some more functions to define methods. One takes an ID
+as the name of method to be defined. See also ID or Symbol below.
+
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
+
+There are two functions to define private/protected methods:
+
+ void rb_define_private_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+At last, rb_define_module_function defines a module function,
+which are private AND singleton methods of the module.
+For example, sqrt is a module function defined in the Math module.
+It can be called in the following way:
+
+ Math.sqrt(4)
+
+or
+
+ include Math
+ sqrt(4)
+
+To define module functions, use:
+
+ void rb_define_module_function(VALUE module, const char *name,
+ VALUE (*func)(), int argc)
+
+In addition, function-like methods, which are private methods defined
+in the Kernel module, can be defined using:
+
+ void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
+
+To define an alias for the method,
+
+ void rb_define_alias(VALUE module, const char* new, const char* old);
+
+To define a reader/writer for an attribute,
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
+To define and undefine the `allocate' class method,
+
+ void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
+ void rb_undef_alloc_func(VALUE klass);
+
+func has to take the klass as the argument and return a newly
+allocated instance. This instance should be as empty as possible,
+without any expensive (including external) resources.
+
+If you are overriding an existing method of any ancestor of your class,
+you may rely on:
+
+ VALUE rb_call_super(int argc, const VALUE *argv)
+
+To achieve the receiver of the current scope (if no other way is
+available), you can use:
+
+ VALUE rb_current_receiver(void)
+
+=== Constant Definition
+
+We have 2 functions to define constants:
+
+ void rb_define_const(VALUE klass, const char *name, VALUE val)
+ void rb_define_global_const(const char *name, VALUE val)
+
+The former is to define a constant under specified class/module. The
+latter is to define a global constant.
+
+== Use Ruby Features from C
+
+There are several ways to invoke Ruby's features from C code.
+
+=== Evaluate Ruby Programs in a String
+
+The easiest way to use Ruby's functionality from a C program is to
+evaluate the string as Ruby program. This function will do the job:
+
+ VALUE rb_eval_string(const char *str)
+
+Evaluation is done under the current context, thus current local variables
+of the innermost method (which is defined by Ruby) can be accessed.
+
+Note that the evaluation can raise an exception. There is a safer
+function:
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
+
+It returns nil when an error occurred. Moreover, *state is zero if str was
+successfully evaluated, or nonzero otherwise.
+
+=== ID or Symbol
+
+You can invoke methods directly, without parsing the string. First I
+need to explain about ID. ID is the integer number to represent
+Ruby's identifiers such as variable names. The Ruby data type
+corresponding to ID is Symbol. It can be accessed from Ruby in the
+form:
+
+ :Identifier
+
+or
+
+ :"any kind of string"
+
+You can get the ID value from a string within C code by using
+
+ rb_intern(const char *name)
+ rb_intern_str(VALUE name)
+
+You can retrieve ID from Ruby object (Symbol or String) given as an
+argument by using
+
+ rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+These functions try to convert the argument to a String if it was not
+a Symbol nor a String. The second function stores the converted
+result into *name, and returns 0 if the string is not a known symbol.
+After this function returned a non-zero value, *name is always a
+Symbol or a String, otherwise it is a String if the result is 0.
+The third function takes NUL-terminated C string, not Ruby VALUE.
+
+You can retrieve Symbol from Ruby object (Symbol or String) given as
+an argument by using
+
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
+
+These functions are similar to above functions except that these
+return a Symbol instead of an ID.
+
+You can convert C ID to Ruby Symbol by using
+
+ VALUE ID2SYM(ID id)
+
+and to convert Ruby Symbol object to ID, use
+
+ ID SYM2ID(VALUE symbol)
+
+=== Invoke Ruby Method from C
+
+To invoke methods directly, you can use the function below
+
+ VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
+
+This function invokes a method on the recv, with the method name
+specified by the symbol mid.
+
+=== Accessing the Variables and Constants
+
+You can access class variables and instance variables using access
+functions. Also, global variables can be shared between both
+environments. There's no way to access Ruby's local variables.
+
+The functions to access/modify instance variables are below:
+
+ VALUE rb_ivar_get(VALUE obj, ID id)
+ VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
+
+id must be the symbol, which can be retrieved by rb_intern().
+
+To access the constants of the class/module:
+
+ VALUE rb_const_get(VALUE obj, ID id)
+
+See also Constant Definition above.
+
+= Information Sharing Between Ruby and C
+
+=== Ruby Constants That Can Be Accessed From C
+
+As stated in section 1.3,
+the following Ruby constants can be referred from C.
+
+ Qtrue
+ Qfalse
+
+Boolean values. Qfalse is false in C also (i.e. 0).
+
+ Qnil
+
+Ruby nil in C scope.
+
+== Global Variables Shared Between C and Ruby
+
+Information can be shared between the two environments using shared global
+variables. To define them, you can use functions listed below:
+
+ void rb_define_variable(const char *name, VALUE *var)
+
+This function defines the variable which is shared by both environments.
+The value of the global variable pointed to by `var' can be accessed
+through Ruby's global variable named `name'.
+
+You can define read-only (from Ruby, of course) variables using the
+function below.
+
+ void rb_define_readonly_variable(const char *name, VALUE *var)
+
+You can defined hooked variables. The accessor functions (getter and
+setter) are called on access to the hooked variables.
+
+ void rb_define_hooked_variable(const char *name, VALUE *var,
+ VALUE (*getter)(), void (*setter)())
+
+If you need to supply either setter or getter, just supply 0 for the
+hook you don't need. If both hooks are 0, rb_define_hooked_variable()
+works just like rb_define_variable().
+
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
+
+
+Also you can define a Ruby global variable without a corresponding C
+variable. The value of the variable will be set/get only by hooks.
+
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
+The prototypes of the getter and setter functions are as follows:
+
+ VALUE (*getter)(ID id);
+ void (*setter)(VALUE val, ID id);
+
+
+== Encapsulate C Data into a Ruby Object
+
+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 the dbm Extension
+
+OK, here's the example of making an extension library. This is the
+extension to access DBMs. The full source is included in the ext/
+directory in the Ruby's source tree.
+
+== Make the Directory
+
+ % mkdir ext/dbm
+
+Make a directory for the extension library under ext directory.
+
+== Design the Library
+
+You need to design the library features, before making it.
+
+== Write the C Code
+
+You need to write C code for your extension library. If your library
+has only one source file, choosing ``LIBRARY.c'' as a file name is
+preferred. On the other hand, in case your library has multiple source
+files, avoid choosing ``LIBRARY.c'' for a file name. It may conflict
+with an intermediate file ``LIBRARY.o'' on some platforms.
+Note that some functions in mkmf library described below generate
+a file ``conftest.c'' for checking with compilation. You shouldn't
+choose ``conftest.c'' as a name of a source file.
+
+Ruby will execute the initializing function named ``Init_LIBRARY'' in
+the library. For example, ``Init_dbm()'' will be executed when loading
+the library.
+
+Here's the example of an initializing function.
+
+ void
+ Init_dbm(void)
+ {
+ /* define DBM class */
+ VALUE cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBM includes Enumerable module */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBM has class method open(): arguments are received as C array */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBM instance method close(): no args */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBM instance method []: 1 argument */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* ID for a instance variable to store DBM data */
+ id_dbm = rb_intern("dbm");
+ }
+
+The dbm extension wraps the dbm struct in the C environment using
+Data_Make_Struct.
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+ 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) == 0) closed_dbm();\
+ if ((dbmp)->di_dbm == 0) closed_dbm();\
+ } while (0)
+
+This sort of complicated macro does the retrieving and close checking for
+the DBM.
+
+There are three kinds of way to receive method arguments. First,
+methods with a fixed number of arguments receive arguments like this:
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+The first argument of the C function is the self, the rest are the
+arguments to the method.
+
+Second, methods with an arbitrary number of arguments receive
+arguments like this:
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+ /* ... */
+ }
+
+The first argument is the number of method arguments, the second
+argument is the C array of the method arguments, and the third
+argument is the receiver of the method.
+
+You can use the function rb_scan_args() to check and retrieve the
+arguments. The third argument is a string that specifies how to
+capture method arguments and assign them to the following VALUE
+references.
+
+
+The following is an example of a method that takes arguments by Ruby's
+array:
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+The first argument is the receiver, the second one is the Ruby array
+which contains the arguments to the method.
+
+*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 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)
+
+ 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(rb_cObject, name, val)
+
+== Method Definition
+
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a method for the class. func is the function pointer. argc
+ is the number of arguments. if argc is -1, the function will receive
+ 3 arguments: argc, argv, and self. if argc is -2, the function will
+ receive 2 arguments, self and args, where args is a Ruby array of
+ the method arguments.
+
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a private method for the class. Arguments are same as
+ rb_define_method().
+
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ Defines a singleton method. Arguments are same as rb_define_method().
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ Retrieve argument from argc and argv to given VALUE references
+ according to the format string. The format can be described in ABNF
+ as follows:
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
+
+ num-of-leading-mandatory-args := DIGIT ; The number of leading
+ ; mandatory arguments
+ num-of-optional-args := DIGIT ; The number of optional
+ ; arguments
+ sym-for-variable-length-args := "*" ; Indicates that variable
+ ; length arguments are
+ ; captured as a ruby array
+ num-of-trailing-mandatory-args := DIGIT ; The number of trailing
+ ; mandatory arguments
+ sym-for-option-hash-arg := ":" ; Indicates that an option
+ ; hash is captured if the last
+ ; argument is a hash or can be
+ ; converted to a hash with
+ ; #to_hash. When the last
+ ; argument is nil, it is
+ ; captured if it is not
+ ; ambiguous to take it as
+ ; empty option hash; i.e. '*'
+ ; is not specified and
+ ; arguments are given more
+ ; than sufficient.
+ sym-for-block-arg := "&" ; Indicates that an iterator
+ ; block should be captured if
+ ; given
+
+ For example, "12" means that the method requires at least one
+ argument, and at most receives three (1+2) arguments. So, the format
+ string must be followed by three variable references, which are to be
+ assigned to captured arguments. For omitted arguments, variables are
+ set to Qnil. NULL can be put in place of a variable reference, which
+ means the corresponding captured argument(s) should be just dropped.
+
+ The number of given arguments, excluding an option hash or iterator
+ block, is returned.
+
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
+
+ Retrieves argument VALUEs bound to keywords, which directed by +table+
+ into +values+. 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 not changed.
+ If +optional+ is negative, rest of +keyword_hash+ are stored in the
+ next to optional +values+ as a new Hash, otherwise raises "unknown
+ keyword" +ArgumentError+.
+
+VALUE rb_extract_keywords(VALUE *original_hash)
+
+ Extracts pairs whose key is a symbol into a new hash from a hash
+ object referred by +original_hash+. If the original hash contains
+ non-symbol keys, then they are copied to another hash and the new hash
+ is stored through +original_hash+, else 0 is stored.
+
+== Invoking Ruby method
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ Invokes a method. To retrieve mid from a method name, use rb_intern().
+ Able to call even private/protected methods.
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments as an array of values.
+ Able to call even private/protected methods.
+
+VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ Invokes a method, passing arguments as an array of values.
+ Able to call only public methods.
+
+VALUE rb_eval_string(const char *str) ::
+
+ Compiles and executes the string as a Ruby program.
+
+ID rb_intern(const char *name) ::
+
+ Returns ID corresponding to the name.
+
+char *rb_id2name(ID id) ::
+
+ Returns the name corresponding ID.
+
+char *rb_class2name(VALUE klass) ::
+
+ Returns the name of the class.
+
+int rb_respond_to(VALUE obj, ID id) ::
+
+ Returns true if the object responds to the message specified by id.
+
+== Instance Variables
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ Retrieve the value of the instance variable. If the name is not
+ prefixed by `@', that variable shall be inaccessible from Ruby.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ Sets the value of the instance variable.
+
+== Control Structure
+
+VALUE rb_block_call(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ Calls a method on the recv, with the method name specified by the
+ symbol mid, with argc arguments in argv, supplying func as the
+ block. When func is called as the block, it will receive the value
+ from yield as the first argument, and data2 as the second argument.
+ When yielded with multiple values (in C, rb_yield_values(),
+ rb_yield_values2() and rb_yield_splat()), data2 is packed as an Array,
+ whereas yielded values can be gotten via argc/argv of the third/fourth
+ arguments.
+
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1, supplying func2 as the block. func1 will be
+ called with the argument arg1. func2 receives the value from yield as
+ the first argument, arg2 as the second argument.
+
+ When rb_iterate is used in 1.9, func1 has to call some Ruby-level method.
+ This function is obsolete since 1.9; use rb_block_call instead.
+
+VALUE rb_yield(VALUE val) ::
+
+ Evaluates the block with value val.
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1, with arg1 as the argument. If an exception
+ occurs during func1, it calls func2 with arg2 as the argument. The
+ return value of rb_rescue() is the return value from func1 if no
+ exception occurs, from func2 otherwise.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ Calls the function func1 with arg1 as the argument, then calls func2
+ with arg2 if execution terminated. The return value from
+ rb_ensure() is that of func1 when no exception occurred.
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ Calls the function func with arg as the argument. If no exception
+ occurred during func, it returns the result of func and *state is zero.
+ Otherwise, it returns Qnil and sets *state to nonzero. If state is
+ NULL, it is not set in both cases.
+ You have to clear the error info with rb_set_errinfo(Qnil) when
+ ignoring the caught exception.
+
+void rb_jump_tag(int state) ::
+
+ Continues the exception caught by rb_protect() and rb_eval_string_protect().
+ state must be the returned value from those functions. This function
+ never return to the caller.
+
+void rb_iter_break() ::
+
+ Exits from the current innermost block. This function never return to
+ the caller.
+
+void rb_iter_break_value(VALUE value) ::
+
+ Exits from the current innermost block with the value. The block will
+ return the given argument value. This function never return to the
+ caller.
+
+== Exceptions and Errors
+
+void rb_warn(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format.
+
+void rb_warning(const char *fmt, ...) ::
+
+ Prints a warning message according to a printf-like format, if
+ $VERBOSE is true.
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ Raises RuntimeError. The fmt is a format string just like printf().
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ Raises a class exception. The fmt is a format string just like printf().
+
+void rb_fatal(const char *fmt, ...) ::
+
+ Raises a fatal error, terminates the interpreter. No exception handling
+ will be done for fatal errors, but ensure blocks will be executed.
+
+void rb_bug(const char *fmt, ...) ::
+
+ Terminates the interpreter immediately. This function should be
+ called under the situation caused by the bug in the interpreter. No
+ exception handling nor ensure execution will be done.
+
+Note: In the format string, "%"PRIsVALUE can be used for Object#to_s
+(or Object#inspect if '+' flag is set) output (and related argument
+must be a VALUE). Since it conflicts with "%i", for integers in
+format strings, use "%d".
+
+== Initialize and Start the Interpreter
+
+The embedding API functions are below (not needed for extension libraries):
+
+void ruby_init() ::
+
+ Initializes the interpreter.
+
+void *ruby_options(int argc, char **argv) ::
+
+ Process command line arguments for the interpreter.
+ And compiles the Ruby source to execute.
+ It returns an opaque pointer to the compiled source
+ or an internal special value.
+
+int ruby_run_node(void *n) ::
+
+ Runs the given compiled source and exits this process.
+ It returns EXIT_SUCCESS if successfully runs the source.
+ Otherwise, it returns other value.
+
+void ruby_script(char *name) ::
+
+ Specifies the name of the script ($0).
+
+== Hooks for the Interpreter Events
+
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
+
+Adds a hook function for the specified interpreter events.
+events should be OR'ed value of:
+
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
+
+The definition of rb_event_hook_func_t is below:
+
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
+
+The third argument `data' to rb_add_event_hook() is passed to the hook
+function as the second argument, which was the pointer to the current
+NODE in 1.8. See RB_EVENT_HOOKS_HAVE_CALLBACK_DATA below.
+
+ int rb_remove_event_hook(rb_event_hook_func_t func)
+
+Removes the specified hook function.
+
+== Macros for Compatibility
+
+Some macros to check API compatibilities are available by default.
+
+NORETURN_STYLE_NEW ::
+
+ Means that NORETURN macro is functional style instead of prefix.
+
+HAVE_RB_DEFINE_ALLOC_FUNC ::
+
+ Means that function rb_define_alloc_func() is provided, that means the
+ allocation framework is used. This is same as the result of
+ have_func("rb_define_alloc_func", "ruby.h").
+
+HAVE_RB_REG_NEW_STR ::
+
+ Means that function rb_reg_new_str() is provided, that creates Regexp
+ object from String object. This is same as the result of
+ have_func("rb_reg_new_str", "ruby.h").
+
+HAVE_RB_IO_T ::
+
+ Means that type rb_io_t is provided.
+
+USE_SYMBOL_AS_METHOD_NAME ::
+
+ Means that Symbols will be returned as method names, e.g.,
+ Module#methods, #singleton_methods and so on.
+
+HAVE_RUBY_*_H ::
+
+ Defined in ruby.h and means corresponding header is available. For
+ instance, when HAVE_RUBY_ST_H is defined you should use ruby/st.h not
+ mere st.h.
+
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+
+ Means that rb_add_event_hook() takes the third argument `data', to be
+ passed to the given event hook function.
+
+= Appendix C. Functions available for use in extconf.rb
+
+See documentation for {mkmf}[rdoc-ref:MakeMakefile].
+
+= Appendix D. Generational GC
+
+Ruby 2.1 introduced a generational garbage collector (called RGenGC).
+RGenGC (mostly) keeps compatibility.
+
+Generally, the use of the technique called write barriers is required in
+extension libraries for generational GC
+(http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29).
+RGenGC works fine without write barriers in extension libraries.
+
+If your library adheres to the following tips, performance can
+be further improved. Especially, the "Don't touch pointers directly" section is
+important.
+
+== Incompatibility
+
+You can't write RBASIC(obj)->klass field directly because it is const
+value now.
+
+Basically you should not write this field because MRI expects it to be
+an immutable field, but if you want to do it in your extension you can
+use the following functions:
+
+VALUE rb_obj_hide(VALUE obj) ::
+
+ Clear RBasic::klass field. The object will be an internal object.
+ ObjectSpace::each_object can't find this object.
+
+VALUE rb_obj_reveal(VALUE obj, VALUE klass) ::
+
+ Reset RBasic::klass to be klass.
+ We expect the `klass' is hidden class by rb_obj_hide().
+
+== Write barriers
+
+RGenGC doesn't require write barriers to support generational GC.
+However, caring about write barrier can improve the performance of
+RGenGC. Please check the following tips.
+
+=== Don't touch pointers directly
+
+In MRI (include/ruby/ruby.h), some macros to acquire pointers to the
+internal data structures are supported such as RARRAY_PTR(),
+RSTRUCT_PTR() and so on.
+
+DO NOT USE THESE MACROS and instead use the corresponding C-APIs such as
+rb_ary_aref(), rb_ary_store() and so on.
+
+=== Consider whether to insert write barriers
+
+You don't need to care about write barriers if you only use built-in
+types.
+
+If you support T_DATA objects, you may consider using write barriers.
+
+Inserting write barriers into T_DATA objects only works with the
+following type objects: (a) long-lived objects, (b) when a huge number
+of objects are generated and (c) container-type objects that have
+references to other objects. If your extension provides such a type of
+T_DATA objects, consider inserting write barriers.
+
+(a): short-lived objects don't become old generation objects.
+(b): only a few oldgen objects don't have performance impact.
+(c): only a few references don't have performance impact.
+
+Inserting write barriers is a very difficult hack, it is easy to
+introduce critical bugs. And inserting write barriers has several areas
+of overhead. Basically we don't recommend you insert write barriers.
+Please carefully consider the risks.
+
+=== Combine with built-in types
+
+Please consider utilizing built-in types. Most built-in types support
+write barrier, so you can use them to avoid manually inserting write
+barriers.
+
+For example, if your T_DATA has references to other objects, then you
+can move these references to Array. A T_DATA object only has a reference
+to an array object. Or you can also use a Struct object to gather a
+T_DATA object (without any references) and an that Array contains
+references.
+
+With use of such techniques, you don't need to insert write barriers
+anymore.
+
+=== Insert write barriers
+
+[AGAIN] Inserting write barriers is a very difficult hack, and it is
+easy to introduce critical bugs. And inserting write barriers has
+several areas of overhead. Basically we don't recommend you insert write
+barriers. Please carefully consider the risks.
+
+Before inserting write barriers, you need to know about RGenGC algorithm
+(gc.c will help you). Macros and functions to insert write barriers are
+available in 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..b662d4dfdb 100644
--- a/README.EXT.ja
+++ b/README.EXT.ja
@@ -1 +1,1720 @@
-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_str_new_literal(const char *ptr)
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_tainted_str_new(const char *ptr, long len)
+
+ 汚染マークãŒä»˜åŠ ã•ã‚ŒãŸæ–°ã—ã„Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Žå¤–部
+ ã‹ã‚‰ã®ãƒ‡ãƒ¼ã‚¿ã«åŸºã¥ã文字列ã«ã¯æ±šæŸ“マークãŒä»˜åŠ ã•れるã¹ã
+ ã§ã‚る.
+
+rb_tainted_str_new2(const char *ptr)
+rb_tainted_str_new_cstr(const char *ptr)
+
+ Cã®æ–‡å­—列ã‹ã‚‰æ±šæŸ“マークãŒä»˜åŠ ã•れãŸRubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_sprintf(const char *format, ...)
+rb_vsprintf(const char *format, va_list ap)
+
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+ 注æ„: "%"PRIsVALUEãŒObject#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹
+ ã¨ãã¯Object#inspect)を使ã£ãŸVALUEã®å‡ºåŠ›ã«åˆ©ç”¨ã§ãる.ã“れ
+ ã¯"%i"ã¨è¡çªã™ã‚‹ãŸã‚,整数ã«ã¯"%d"を使用ã™ã‚‹ã“ã¨ï¼Ž
+
+rb_str_cat(VALUE str, const char *ptr, long len)
+
+ Rubyã®æ–‡å­—列strã«lenãƒã‚¤ãƒˆã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Ž
+
+rb_str_cat2(VALUE str, const char* ptr)
+rb_str_cat_cstr(VALUE str, const char* ptr)
+
+ Rubyã®æ–‡å­—列strã«Cã®æ–‡å­—列ptrを追加ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯
+ rb_str_cat(str, ptr, strlen(ptr))ã¨åŒç­‰ã§ã‚る.
+
+rb_str_catf(VALUE str, const char* format, ...)
+rb_str_vcatf(VALUE str, const char* format, va_list ap)
+
+ Cã®æ–‡å­—列formatã¨ç¶šã引数をprintf(3)ã®ãƒ•ォーマットã«ã—ãŸãŒã£ã¦
+ æ•´å½¢ã—,Rubyã®æ–‡å­—列strã«è¿½åŠ ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã®æ©Ÿèƒ½ã¯ï¼Œãれãžã‚Œ
+ rb_str_cat2(str, rb_sprintf(format, ...)) ã‚„
+ rb_str_cat2(str, rb_vsprintf(format, ap)) ã¨åŒç­‰ã§ã‚る.
+
+rb_enc_str_new(const char *ptr, long len, rb_encoding *enc)
+rb_enc_str_new_cstr(const char *ptr, rb_encoding *enc)
+
+ 指定ã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
+
+rb_enc_str_new_literal(const char *ptr)
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰æŒ‡å®šã•れãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã§Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_usascii_str_new(const char *ptr, long len)
+rb_usascii_str_new_cstr(const char *ptr)
+
+ エンコーディングãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
+
+rb_usascii_str_new_literal(const char *ptr)
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒUS-ASCIIã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_utf8_str_new(const char *ptr, long len)
+rb_utf8_str_new_cstr(const char *ptr)
+
+ エンコーディングãŒUTF-8ã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹.
+
+rb_utf8_str_new_literal(const char *ptr)
+
+ Cã®ãƒªãƒ†ãƒ©ãƒ«æ–‡å­—列ã‹ã‚‰ã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ãŒUTF-8ã®Rubyã®æ–‡å­—列を生æˆã™ã‚‹ï¼Ž
+
+rb_str_resize(VALUE str, long len)
+
+ Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«å¤‰æ›´ã™ã‚‹ï¼Žstrã®é•·ã•ã¯å‰
+ 以ã¦ã‚»ãƒƒãƒˆã•れã¦ã„ãªã‘れã°ãªã‚‰ãªã„.lenãŒå…ƒã®é•·ã•よりも短
+ ã„æ™‚ã¯ï¼Œlenãƒã‚¤ãƒˆã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…å®¹ã¯æ¨ã¦ã‚‰ã‚Œã‚‹ï¼ŽlenãŒå…ƒ
+ ã®é•·ã•ã‚ˆã‚Šã‚‚é•·ã„æ™‚ã¯ï¼Œå…ƒã®é•·ã•ã‚’è¶ŠãˆãŸéƒ¨åˆ†ã®å†…容ã¯ä¿å­˜ã•
+ れãªã„ã§ã‚´ãƒŸã«ãªã‚‹ã ã‚ã†ï¼Žã“ã®é–¢æ•°ã®å‘¼ã³å‡ºã—ã«ã‚ˆã£ã¦
+ RSTRING_PTR(str)ãŒå¤‰æ›´ã•れるã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„.
+
+rb_str_set_len(VALUE str, long len)
+
+ Rubyã®æ–‡å­—列ã®ã‚µã‚¤ã‚ºã‚’lenãƒã‚¤ãƒˆã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼ŽstrãŒå¤‰æ›´å¯
+ 能ã§ãªã‘れã°ä¾‹å¤–ãŒç™ºç”Ÿã™ã‚‹ï¼ŽRSTRING_LEN(str)ã¨ã¯ç„¡é–¢ä¿‚ã«ï¼Œ
+ lenãƒã‚¤ãƒˆã¾ã§ã®å†…容ã¯ä¿å­˜ã•れる.lenã¯strã®å®¹é‡ã‚’è¶Šãˆã¦ã„
+ ã¦ã¯ãªã‚‰ãªã„.
+
+
+== é…列ã«å¯¾ã™ã‚‹é–¢æ•°
+
+rb_ary_new()
+
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_new2(long len)
+rb_ary_new_capa(long len)
+
+ è¦ç´ ãŒ0ã®é…列を生æˆã™ã‚‹ï¼Žlenè¦ç´ åˆ†ã®é ˜åŸŸã‚’ã‚らã‹ã˜ã‚割り
+ 当ã¦ã¦ãŠã.
+
+rb_ary_new3(long n, ...)
+rb_ary_new_from_args(long n, ...)
+
+ å¼•æ•°ã§æŒ‡å®šã—ãŸnè¦ç´ ã‚’å«ã‚€é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_new4(long n, VALUE *elts)
+rb_ary_new_from_values(long n, VALUE *elts)
+
+ é…列ã§ä¸ŽãˆãŸnè¦ç´ ã®é…列を生æˆã™ã‚‹ï¼Ž
+
+rb_ary_to_ary(VALUE obj)
+
+ オブジェクトをé…列ã«å¤‰æ›ã™ã‚‹.
+ Object#to_aryã¨åŒç­‰ã§ã‚ã‚‹.
+
+ä»–ã«ã‚‚é…列をæ“作ã™ã‚‹é–¢æ•°ãŒå¤šæ•°ã‚ã‚‹. ã“れらã¯
+引数aryã«é…列を渡ã•ãªã‘れã°ãªã‚‰ãªã„. ã•ã‚‚ãªã„ã¨
+コアをåã.
+
+rb_ary_aref(argc, VALUE *argv, VALUE ary)
+
+ Array#[]ã¨åŒç­‰.
+
+rb_ary_entry(VALUE ary, long offset)
+
+ ary[offset]
+
+rb_ary_store(VALUE ary, long offset, VALUE obj) ::
+
+ ary[offset] = obj
+
+rb_ary_subseq(VALUE ary, long beg, long len)
+
+ ary[beg, len]
+
+rb_ary_push(VALUE ary, VALUE val)
+rb_ary_pop(VALUE ary)
+rb_ary_shift(VALUE ary)
+rb_ary_unshift(VALUE ary, VALUE val)
+
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ é…列aryã«ptrã‹ã‚‰len個ã®ã‚ªãƒ–ジェクトを追加ã™ã‚‹ï¼Ž
+
+= Rubyã®æ©Ÿèƒ½ã‚’使ã†
+
+原ç†çš„ã«Rubyã§æ›¸ã‘ã‚‹ã“ã¨ã¯Cã§ã‚‚書ã‘ã¾ã™ï¼ŽRubyãã®ã‚‚ã®ãŒCã§è¨˜
+è¿°ã•れã¦ã„ã‚‹ã‚“ã§ã™ã‹ã‚‰ï¼Œå½“ç„¶ã¨ã„ãˆã°å½“ç„¶ãªã‚“ã§ã™ã‘ã©ï¼Žã“ã“ã§
+ã¯Rubyã®æ‹¡å¼µã«ä½¿ã†ã“ã¨ãŒå¤šã„ã ã‚ã†ã¨äºˆæ¸¬ã•れる機能を中心ã«ç´¹
+介ã—ã¾ã™ï¼Ž
+
+== Rubyã«æ©Ÿèƒ½ã‚’追加ã™ã‚‹
+
+Rubyã§æä¾›ã•れã¦ã„る関数を使ãˆã°Rubyã‚¤ãƒ³ã‚¿ãƒ—ãƒªã‚¿ã«æ–°ã—ã„æ©Ÿèƒ½
+を追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼ŽRubyã§ã¯ä»¥ä¸‹ã®æ©Ÿèƒ½ã‚’追加ã™ã‚‹é–¢æ•°ãŒ
+æä¾›ã•れã¦ã„ã¾ã™ï¼Ž
+
+* クラス,モジュール
+* メソッド,特異メソッドãªã©
+* 定数
+
+ã§ã¯é †ã«ç´¹ä»‹ã—ã¾ã™ï¼Ž
+
+=== クラス/モジュール定義
+
+クラスやモジュールを定義ã™ã‚‹ãŸã‚ã«ã¯ï¼Œä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ VALUE rb_define_class(const char *name, VALUE super)
+ VALUE rb_define_module(const char *name)
+
+ã“れらã®é–¢æ•°ã¯æ–°ã—ã定義ã•れãŸã‚¯ãƒ©ã‚¹ã‚„モジュールを返ã—ã¾ã™ï¼Ž
+メソッドや定数ã®å®šç¾©ã«ã“れらã®å€¤ãŒå¿…è¦ãªã®ã§ï¼Œã»ã¨ã‚“ã©ã®å ´åˆ
+ã¯æˆ»ã‚Šå€¤ã‚’å¤‰æ•°ã«æ ¼ç´ã—ã¦ãŠãå¿…è¦ãŒã‚ã‚‹ã§ã—ょã†ï¼Ž
+
+クラスやモジュールを他ã®ã‚¯ãƒ©ã‚¹ã®å†…部ã«ãƒã‚¹ãƒˆã—ã¦å®šç¾©ã™ã‚‹æ™‚ã«
+ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
+ VALUE rb_define_module_under(VALUE outer, const char *name)
+
+=== メソッド/特異メソッド定義
+
+メソッドや特異メソッドを定義ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ void rb_define_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+ void rb_define_singleton_method(VALUE object, const char *name,
+ VALUE (*func)(), int argc)
+
+
+念ã®ãŸã‚説明ã™ã‚‹ã¨ã€Œç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã€ã¨ã¯ï¼Œãã®ç‰¹å®šã®ã‚ªãƒ–ジェク
+トã«å¯¾ã—ã¦ã ã‘有効ãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã™ï¼ŽRubyã§ã¯ã‚ˆãSmalltalkã«ãŠ
+ã‘るクラスメソッドã¨ã—ã¦ï¼Œã‚¯ãƒ©ã‚¹ã«å¯¾ã™ã‚‹ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ãŒä½¿ã‚れ
+ã¾ã™ï¼Ž
+
+ã“れらã®é–¢æ•°ã® argcã¨ã„ã†å¼•æ•°ã¯Cã®é–¢æ•°ã¸æ¸¡ã•ã‚Œã‚‹å¼•æ•°ã®æ•°(ã¨
+å½¢å¼)を決ã‚ã¾ã™ï¼ŽargcãŒ0ä»¥ä¸Šã®æ™‚ã¯é–¢æ•°ã«å¼•ãæ¸¡ã™å¼•æ•°ã®æ•°ã‚’æ„
+味ã—ã¾ã™ï¼Ž16個以上ã®å¼•æ•°ã¯ä½¿ãˆã¾ã›ã‚“(ãŒï¼Œè¦ã‚Šã¾ã›ã‚“よã­ï¼Œã
+ã‚“ãªã«).実際ã®é–¢æ•°ã«ã¯å…ˆé ­ã®å¼•æ•°ã¨ã—ã¦selfãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã®
+ã§ï¼ŒæŒ‡å®šã—ãŸæ•°ã‚ˆã‚Š1多ã„引数をæŒã¤ã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+
+argcãŒè² ã®æ™‚ã¯å¼•æ•°ã®æ•°ã§ã¯ãªã,形å¼ã‚’指定ã—ãŸã“ã¨ã«ãªã‚Šã¾ã™ï¼Ž
+argcãŒ-1ã®æ™‚ã¯å¼•æ•°ã‚’é…列ã«å…¥ã‚Œã¦æ¸¡ã•れã¾ã™ï¼ŽargcãŒ-2ã®æ™‚ã¯å¼•
+æ•°ã¯Rubyã®é…列ã¨ã—ã¦æ¸¡ã•れã¾ã™ï¼Ž
+
+メソッドを定義ã™ã‚‹é–¢æ•°ã¯ã¾ã ã„ãã¤ã‹ã‚りã¾ã™. ã²ã¨ã¤ã¯ãƒ¡ã‚½ãƒƒãƒ‰
+åã¨ã—ã¦IDã‚’å–りã¾ã™. IDã«ã¤ã„ã¦ã¯2.2.2ã‚’å‚ç…§.
+
+ void rb_define_method_id(VALUE klass, ID name,
+ VALUE (*func)(ANYARGS), int argc)
+
+private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã‚’定義ã™ã‚‹ãµãŸã¤ã®é–¢æ•°ãŒã‚りã¾ã™.
+
+ void rb_define_private_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+ void rb_define_protected_method(VALUE klass, const char *name,
+ VALUE (*func)(), int argc)
+
+privateメソッドã¨ã¯é–¢æ•°å½¢å¼ã§ã—ã‹å‘¼ã³å‡ºã™ã“ã¨ã®å‡ºæ¥ãªã„メソッ
+ドã§ã™ï¼Ž
+
+最後ã«ï¼Œ rb_define_module関数ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã—ã¾ã™ï¼Ž
+モジュール関数ã¨ã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®ç‰¹ç•°ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚Šï¼ŒåŒæ™‚ã«
+privateメソッドã§ã‚‚ã‚ã‚‹ã‚‚ã®ã§ã™ï¼Žä¾‹ã‚’ã‚ã’ã‚‹ã¨Mathモジュール
+ã®sqrt()ãªã©ãŒã‚ã’られã¾ã™ï¼Žã“ã®ãƒ¡ã‚½ãƒƒãƒ‰ã¯
+
+ Math.sqrt(4)
+
+ã¨ã„ã†å½¢å¼ã§ã‚‚
+
+ include Math
+ sqrt(4)
+
+ã¨ã„ã†å½¢å¼ã§ã‚‚使ãˆã¾ã™ï¼Žãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«é–¢æ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®
+通りã§ã™ï¼Ž
+
+ void rb_define_module_function(VALUE module, const char *name,
+ VALUE (*func)(), int argc)
+
+関数的メソッド(Kernelモジュールã®private method)を定義ã™ã‚‹ãŸ
+ã‚ã®é–¢æ•°ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
+
+ void rb_define_global_function(const char *name, VALUE (*func)(), int argc)
+
+
+メソッドã®åˆ¥åを定義ã™ã‚‹ãŸã‚ã®é–¢æ•°ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
+
+ void rb_define_alias(VALUE module, const char* new, const char* old);
+
+属性ã®å–得・設定メソッドを定義ã™ã‚‹ã«ã¯
+
+ void rb_define_attr(VALUE klass, const char *name, int read, int write)
+
+クラスメソッドallocateを定義ã—ãŸã‚Šå‰Šé™¤ã—ãŸã‚Šã™ã‚‹ãŸã‚ã®é–¢æ•°ã¯
+以下ã®é€šã‚Šã§ã™ï¼Ž
+
+ void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
+ void rb_undef_alloc_func(VALUE klass);
+
+funcã¯ã‚¯ãƒ©ã‚¹ã‚’引数ã¨ã—ã¦å—ã‘å–ã£ã¦ï¼Œæ–°ã—ã割り当ã¦ã‚‰ã‚ŒãŸã‚¤ãƒ³
+スタンスを返ã•ãªãã¦ã¯ãªã‚Šã¾ã›ã‚“.ã“ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã¯ï¼Œå¤–部リ
+ソースãªã©ã‚’å«ã¾ãªã„,ã§ãã‚‹ã ã‘「空ã€ã®ã¾ã¾ã«ã—ã¦ãŠã„ãŸã»ã†
+ãŒã‚ˆã„ã§ã—ょã†ï¼Ž
+
+継承ã—ãŸã‚¯ãƒ©ã‚¹ã«ã‚る既存ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã—ã¦ã„ã‚‹ãª
+ら,オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã•れãŸãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使
+ã„ã¾ã™ï¼Ž
+
+ VALUE rb_call_super(int argc, const VALUE *argv)
+
+ç¾åœ¨ã®ã‚¹ã‚³ãƒ¼ãƒ—ã®ãƒ¬ã‚·ãƒ¼ãƒã¯(ä»–ã«æ–¹æ³•ãŒãªã‘れã°),以下ã®é–¢æ•°ã§
+å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã™ï¼Ž
+
+ VALUE rb_current_receiver(void)
+
+=== 定数定義
+
+拡張ライブラリãŒå¿…è¦ãªå®šæ•°ã¯ã‚らã‹ã˜ã‚定義ã—ã¦ãŠã„ãŸæ–¹ãŒè‰¯ã„
+ã§ã—ょã†ï¼Žå®šæ•°ã‚’定義ã™ã‚‹é–¢æ•°ã¯äºŒã¤ã‚りã¾ã™ï¼Ž
+
+ void rb_define_const(VALUE klass, const char *name, VALUE val)
+ void rb_define_global_const(const char *name, VALUE val)
+
+å‰è€…ã¯ç‰¹å®šã®ã‚¯ãƒ©ã‚¹/モジュールã«å±žã™ã‚‹å®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ï¼Œå¾Œ
+者ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«ãªå®šæ•°ã‚’定義ã™ã‚‹ã‚‚ã®ã§ã™ï¼Ž
+
+== Rubyã®æ©Ÿèƒ½ã‚’Cã‹ã‚‰å‘¼ã³å‡ºã™
+
+æ—¢ã«ã€Ž1.5 Rubyã®ãƒ‡ãƒ¼ã‚¿ã‚’æ“作ã™ã‚‹ã€ã§ä¸€éƒ¨ç´¹ä»‹ã—ãŸã‚ˆã†ãªé–¢æ•°ã‚’
+使ãˆã°ï¼ŒRubyã®æ©Ÿèƒ½ã‚’実ç¾ã—ã¦ã„る関数を直接呼ã³å‡ºã™ã“ã¨ãŒå‡ºæ¥
+ã¾ã™ï¼Ž
+
+# ã“ã®ã‚ˆã†ãªé–¢æ•°ã®ä¸€è¦§è¡¨ã¯ã„ã¾ã®ã¨ã“ã‚ã‚りã¾ã›ã‚“.ソースを見
+# ã‚‹ã—ã‹ãªã„ã§ã™ã­ï¼Ž
+
+ãれ以外ã«ã‚‚Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™æ–¹æ³•ã¯ã„ãã¤ã‹ã‚りã¾ã™ï¼Ž
+
+=== Rubyã®ãƒ—ログラムをevalã™ã‚‹
+
+Cã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’呼ã³å‡ºã™ã‚‚ã£ã¨ã‚‚ç°¡å˜ãªæ–¹æ³•ã¨ã—ã¦ï¼Œæ–‡å­—列ã§
+与ãˆã‚‰ã‚ŒãŸRubyã®ãƒ—ログラムを評価ã™ã‚‹ä»¥ä¸‹ã®é–¢æ•°ãŒã‚りã¾ã™ï¼Ž
+
+ VALUE rb_eval_string(const char *str)
+
+ã“ã®è©•価ã¯ç¾åœ¨ã®ç’°å¢ƒã§è¡Œã‚れã¾ã™ï¼Žã¤ã¾ã‚Šï¼Œç¾åœ¨ã®ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°
+ãªã©ã‚’å—ã‘ç¶™ãŽã¾ã™ï¼Ž
+
+評価ã¯ä¾‹å¤–を発生ã™ã‚‹ã‹ã‚‚ã—れãªã„ã“ã¨ã«æ³¨æ„ã—ã¾ã—ょã†. より安全
+ãªé–¢æ•°ã‚‚ã‚りã¾ã™.
+
+ VALUE rb_eval_string_protect(const char *str, int *state)
+
+ã“ã®é–¢æ•°ã¯ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã™ã‚‹ã¨nilã‚’è¿”ã—ã¾ã™ï¼Žãã—ã¦ï¼ŒæˆåŠŸæ™‚ã«ã¯
+*stateã¯ã‚¼ãƒ­ã«ï¼Œã•ã‚‚ãªãã°éžã‚¼ãƒ­ã«ãªã‚Šã¾ã™ï¼Ž
+
+=== IDã¾ãŸã¯ã‚·ãƒ³ãƒœãƒ«
+
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ã“ã¨ã‚‚ã§ãã¾
+ã™ï¼Žãã®å‰ã«ï¼ŒRubyインタプリタ内ã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚„変数åを指定ã™ã‚‹
+時ã«ä½¿ã‚れã¦ã„ã‚‹IDã«ã¤ã„ã¦èª¬æ˜Žã—ã¦ãŠãã¾ã—ょã†ï¼Ž
+
+IDã¨ã¯å¤‰æ•°å,メソッドåã‚’è¡¨ã™æ•´æ•°ã§ã™ï¼ŽRubyã®ä¸­ã§ã¯
+
+ :識別å­
+
+ã¾ãŸã¯
+
+ :"ä»»æ„ã®æ–‡å­—列"
+
+ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã™ï¼ŽCã‹ã‚‰ã“ã®æ•´æ•°ã‚’å¾—ã‚‹ãŸã‚ã«ã¯é–¢æ•°
+
+ rb_intern(const char *name)
+ rb_intern_str(VALUE name)
+
+を使ã„ã¾ã™ï¼ŽRubyã‹ã‚‰å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸã‚·ãƒ³ãƒœãƒ«(ã¾ãŸã¯æ–‡å­—
+列)ã‚’IDã«å¤‰æ›ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ rb_to_id(VALUE symbol)
+ rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
+
+ã‚‚ã—引数ãŒã‚·ãƒ³ãƒœãƒ«ã§ã‚‚文字列ã§ã‚‚ãªã‘れã°ï¼Œto_strãƒ¡ã‚½ãƒƒãƒ‰ã§æ–‡
+字列ã«å¤‰æ›ã—よã†ã¨ã—ã¾ã™ï¼Žç¬¬äºŒã®é–¢æ•°ã¯ãã®å¤‰æ›çµæžœã‚’*nameã«ä¿
+å­˜ã—,ãã®åå‰ãŒæ—¢çŸ¥ã®ã‚·ãƒ³ãƒœãƒ«ã§ãªã„å ´åˆã¯0ã‚’è¿”ã—ã¾ã™ï¼Žã“ã®é–¢
+æ•°ãŒ0以外を返ã—ãŸå ´åˆã¯*nameã¯å¸¸ã«ã‚·ãƒ³ãƒœãƒ«ã‹æ–‡å­—列ã§ã‚り,0ã‚’
+è¿”ã—ãŸå ´åˆã¯å¸¸ã«æ–‡å­—列ã§ã™ï¼Žç¬¬ä¸‰ã®é–¢æ•°ã¯Rubyã®æ–‡å­—列ã§ã¯ãªã
+NUL終端ã•れãŸCã®æ–‡å­—列を使ã„ã¾ã™ï¼Ž
+
+Rubyã‹ã‚‰å¼•æ•°ã¨ã—ã¦ä¸Žãˆã‚‰ã‚ŒãŸã‚·ãƒ³ãƒœãƒ«(ã¾ãŸã¯æ–‡å­—列)をシンボル
+ã«å¤‰æ›ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ rb_to_symbol(VALUE name)
+ rb_check_symbol(volatile VALUE *namep)
+ rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc)
+
+ã“れらã®é–¢æ•°ã¯ï¼ŒIDã®ä»£ã‚りã«ã‚·ãƒ³ãƒœãƒ«ã‚’è¿”ã™ã“ã¨ã‚’除ã‘ã°ä¸Šè¨˜ã®
+関数ã¨åŒã˜ã§ã™ï¼Ž
+
+=== Cã‹ã‚‰Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™
+
+Cã‹ã‚‰æ–‡å­—列を経由ã›ãšã«Rubyã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’呼ã³å‡ºã™ãŸã‚ã«ã¯ä»¥ä¸‹
+ã®é–¢æ•°ã‚’使ã„ã¾ã™ï¼Ž
+
+ VALUE rb_funcall(VALUE recv, ID mid, int argc, ...)
+
+ã“ã®é–¢æ•°ã¯ã‚ªãƒ–ジェクトrecvã®midã§æŒ‡å®šã•れるメソッドを呼ã³å‡º
+ã—ã¾ã™ï¼Žãã®ä»–ã«å¼•æ•°ã®æŒ‡å®šã®ä»•æ–¹ãŒé•ã†ä»¥ä¸‹ã®é–¢æ•°ã‚‚ã‚りã¾ã™ï¼Ž
+
+ VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv)
+ VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv)
+ VALUE rb_apply(VALUE recv, ID mid, VALUE args)
+
+applyã«ã¯å¼•æ•°ã¨ã—ã¦Rubyã®é…列を与ãˆã¾ã™ï¼Ž
+
+=== 変数/定数をå‚ç…§/æ›´æ–°ã™ã‚‹
+
+Cã‹ã‚‰é–¢æ•°ã‚’使ã£ã¦å‚照・更新ã§ãã‚‹ã®ã¯ï¼Œå®šæ•°ï¼Œã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰
+æ•°ã§ã™ï¼Žå¤§åŸŸå¤‰æ•°ã¯ä¸€éƒ¨ã®ã‚‚ã®ã¯Cã®å¤§åŸŸå¤‰æ•°ã¨ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã§ã
+ã¾ã™ï¼Žãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã‚’å‚ç…§ã™ã‚‹æ–¹æ³•ã¯å…¬é–‹ã—ã¦ã„ã¾ã›ã‚“.
+
+オブジェクトã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’å‚照・更新ã™ã‚‹é–¢æ•°ã¯ä»¥ä¸‹ã®é€š
+りã§ã™ï¼Ž
+
+ VALUE rb_ivar_get(VALUE obj, ID id)
+ VALUE rb_ivar_set(VALUE obj, ID id, VALUE val)
+
+idã¯rb_intern()ã§å¾—られるもã®ã‚’使ã£ã¦ãã ã•ã„.
+
+定数をå‚ç…§ã™ã‚‹ã«ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦ãã ã•ã„.
+
+ VALUE rb_const_get(VALUE obj, ID id)
+
+定数を新ã—ã定義ã™ã‚‹ãŸã‚ã«ã¯ã€Ž2.1.3 定数定義ã€ã§ç´¹ä»‹ã•
+れã¦ã„る関数を使ã£ã¦ãã ã•ã„.
+
+= Rubyã¨Cã¨ã®æƒ…報共有
+
+C言語ã¨Rubyã®é–“ã§æƒ…報を共有ã™ã‚‹æ–¹æ³•ã«ã¤ã„ã¦è§£èª¬ã—ã¾ã™ï¼Ž
+
+== Cã‹ã‚‰å‚ç…§ã§ãã‚‹Rubyã®å®šæ•°
+
+以下ã®Rubyã®å®šæ•°ã¯Cã®ãƒ¬ãƒ™ãƒ«ã‹ã‚‰å‚ç…§ã§ãã¾ã™ï¼Ž
+
+ Qtrue
+ Qfalse
+
+真å½å€¤ï¼ŽQfalseã¯C言語ã§ã‚‚å½ã¨ã¿ãªã•れã¾ã™(ã¤ã¾ã‚Š0).
+
+ Qnil
+
+C言語ã‹ã‚‰è¦‹ãŸã€Œnilã€ï¼Ž
+
+== Cã¨Rubyã§å…±æœ‰ã•れる大域変数
+
+Cã¨Rubyã§å¤§åŸŸå¤‰æ•°ã‚’使ã£ã¦æƒ…報を共有ã§ãã¾ã™ï¼Žå…±æœ‰ã§ãる大域
+変数ã«ã¯ã„ãã¤ã‹ã®ç¨®é¡žãŒã‚りã¾ã™ï¼Žãã®ãªã‹ã§ã‚‚ã£ã¨ã‚‚良ã使ã‚
+ã‚Œã‚‹ã¨æ€ã‚れるã®ã¯rb_define_variable()ã§ã™ï¼Ž
+
+ void rb_define_variable(const char *name, VALUE *var)
+
+ã“ã®é–¢æ•°ã¯Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹å¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾ã™ï¼Žå¤‰æ•°åãŒ
+`$'ã§å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れã¾ã™ï¼Žã“ã®å¤‰æ•°ã®å€¤ã‚’変
+æ›´ã™ã‚‹ã¨è‡ªå‹•çš„ã«Rubyã®å¯¾å¿œã™ã‚‹å¤‰æ•°ã®å€¤ã‚‚変ã‚りã¾ã™ï¼Ž
+
+ã¾ãŸRubyå´ã‹ã‚‰ã¯æ›´æ–°ã§ããªã„変数もã‚りã¾ã™ï¼Žã“ã®read onlyã®
+変数ã¯ä»¥ä¸‹ã®é–¢æ•°ã§å®šç¾©ã—ã¾ã™ï¼Ž
+
+ void rb_define_readonly_variable(const char *name, VALUE *var)
+
+ã“れら変数ã®ä»–ã«hookã‚’ã¤ã‘ãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã§ãã¾ã™ï¼Žhook付ã
+ã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’用ã„ã¦å®šç¾©ã—ã¾ã™ï¼Žhook付ã大域変数ã®
+値ã®å‚照や設定ã¯hookã§è¡Œã†å¿…è¦ãŒã‚りã¾ã™ï¼Ž
+
+ void rb_define_hooked_variable(const char *name, VALUE *var,
+ VALUE (*getter)(), void (*setter)())
+
+ã“ã®é–¢æ•°ã¯Cã®é–¢æ•°ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸå¤§åŸŸå¤‰æ•°ã‚’定義ã—ã¾
+ã™ï¼Žå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯é–¢æ•°getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•れ
+ãŸæ™‚ã«ã¯é–¢æ•°setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žhookを指定ã—ãªã„å ´åˆã¯getterã‚„
+setterã«0を指定ã—ã¾ã™ï¼Ž
+# getterã‚‚setterã‚‚0ãªã‚‰ã°rb_define_variable()ã¨åŒã˜ã«ãªã‚‹ï¼Ž
+
+getterã¨setterã®ä»•æ§˜ã¯æ¬¡ã®é€šã‚Šã§ã™ï¼Ž
+
+ VALUE (*getter)(ID id, VALUE *var);
+ void (*setter)(VALUE val, ID id, VALUE *var);
+
+
+ãれã‹ã‚‰ï¼Œå¯¾å¿œã™ã‚‹Cã®å¤‰æ•°ã‚’æŒãŸãªã„Rubyã®å¤§åŸŸå¤‰æ•°ã‚’定義ã™ã‚‹
+ã“ã¨ã‚‚ã§ãã¾ã™. ãã®å¤‰æ•°ã®å€¤ã¯ãƒ•ック関数ã®ã¿ã«ã‚ˆã£ã¦å–得・設定
+ã•れã¾ã™.
+
+ void rb_define_virtual_variable(const char *name,
+ VALUE (*getter)(), void (*setter)())
+
+ã“ã®é–¢æ•°ã«ã‚ˆã£ã¦å®šç¾©ã•れãŸRubyã®å¤§åŸŸå¤‰æ•°ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯
+getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œã¾ã™ï¼Ž
+
+getterã¨setterã®ä»•様ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
+
+ (*getter)(ID id);
+ (*setter)(VALUE val, ID id);
+
+== Cã®ãƒ‡ãƒ¼ã‚¿ã‚’Rubyオブジェクトã«ã™ã‚‹
+
+Cã®ä¸–界ã§å®šç¾©ã•れãŸãƒ‡ãƒ¼ã‚¿(構造体)ã‚’Rubyã®ã‚ªãƒ–ジェクトã¨ã—ã¦
+å–り扱ã„ãŸã„å ´åˆãŒã‚りãˆã¾ã™ï¼Žã“ã®ã‚ˆã†ãªå ´åˆã«ã¯ï¼Œ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クラスを定義ã™ã‚‹ */
+ VALUE cDBM = rb_define_class("DBM", rb_cObject);
+ /* DBMã¯Enumerableモジュールをインクルードã™ã‚‹ */
+ rb_include_module(cDBM, rb_mEnumerable);
+
+ /* DBMクラスã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰open(): 引数ã¯Cã®é…列ã§å—ã‘ã‚‹ */
+ rb_define_singleton_method(cDBM, "open", fdbm_s_open, -1);
+
+ /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰close(): 引数ã¯ãªã— */
+ rb_define_method(cDBM, "close", fdbm_close, 0);
+ /* DBMクラスã®ãƒ¡ã‚½ãƒƒãƒ‰[]: 引数ã¯1個 */
+ rb_define_method(cDBM, "[]", fdbm_fetch, 1);
+
+ /* ... */
+
+ /* DBMデータを格ç´ã™ã‚‹ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°åã®ãŸã‚ã®ID */
+ id_dbm = rb_intern("dbm");
+ }
+
+DBMライブラリã¯dbmã®ãƒ‡ãƒ¼ã‚¿ã¨å¯¾å¿œã™ã‚‹ã‚ªãƒ–ジェクトã«ãªã‚‹ã¯ãšã§
+ã™ã‹ã‚‰ï¼ŒCã®ä¸–界ã®dbmã‚’Rubyã®ä¸–界ã«å–り込む必è¦ãŒã‚りã¾ã™ï¼Ž
+
+dbm.cã§ã¯Data_Make_Structを以下ã®ã‚ˆã†ã«ä½¿ã£ã¦ã„ã¾ã™ï¼Ž
+
+ struct dbmdata {
+ int di_size;
+ DBM *di_dbm;
+ };
+
+
+ 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) == 0) closed_dbm();\
+ if ((dbmp)->di_dbm == 0) closed_dbm();\
+ } while (0)
+
+ã¡ã‚‡ã£ã¨è¤‡é›‘ãªãƒžã‚¯ãƒ­ã§ã™ãŒï¼Œè¦ã™ã‚‹ã«dbmdata構造体ã®ãƒã‚¤ãƒ³ã‚¿
+ã®å–り出ã—ã¨ï¼Œcloseã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ã®ãƒã‚§ãƒƒã‚¯ã‚’ã¾ã¨ã‚ã¦ã„
+ã‚‹ã ã‘ã§ã™ï¼Ž
+
+DBMクラスã«ã¯ãŸãã•んメソッドãŒã‚りã¾ã™ãŒï¼Œåˆ†é¡žã™ã‚‹ã¨3種類ã®
+引数ã®å—ã‘æ–¹ãŒã‚りã¾ã™ï¼Žã²ã¨ã¤ã¯å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚‚ã®ã§ï¼Œä¾‹ã¨
+ã—ã¦ã¯deleteメソッドãŒã‚りã¾ã™ï¼Ždeleteメソッドを実装ã—ã¦ã„ã‚‹
+fdbm_delete()ã¯ã“ã®ã‚ˆã†ã«ãªã£ã¦ã„ã¾ã™ï¼Ž
+
+ static VALUE
+ fdbm_delete(VALUE obj, VALUE keystr)
+ {
+ /* ... */
+ }
+
+å¼•æ•°ã®æ•°ãŒå›ºå®šã®ã‚¿ã‚¤ãƒ—ã¯ç¬¬1引数ãŒself,第2引数以é™ãŒãƒ¡ã‚½ãƒƒãƒ‰
+ã®å¼•æ•°ã¨ãªã‚Šã¾ã™ï¼Ž
+
+å¼•æ•°ã®æ•°ãŒä¸å®šã®ã‚‚ã®ã¯Cã®é…列ã§å—ã‘ã‚‹ã‚‚ã®ã¨Rubyã®é…列ã§å—ã‘
+ã‚‹ã‚‚ã®ã¨ãŒã‚りã¾ã™ï¼Ždbmライブラリã®ä¸­ã§ï¼ŒCã®é…列ã§å—ã‘ã‚‹ã‚‚ã®
+ã¯DBMã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚‹open()ã§ã™ï¼Žã“れを実装ã—ã¦ã„ã‚‹é–¢
+æ•°fdbm_s_open()ã¯ã“ã†ãªã£ã¦ã„ã¾ã™ï¼Ž
+
+ static VALUE
+ fdbm_s_open(int argc, VALUE *argv, VALUE klass)
+ {
+ /* ... */
+
+ if (rb_scan_args(argc, argv, "11", &file, &vmode) == 1) {
+ mode = 0666; /* default value */
+ }
+
+ /* ... */
+ }
+
+ã“ã®ã‚¿ã‚¤ãƒ—ã®é–¢æ•°ã¯ç¬¬1引数ãŒä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ï¼Œç¬¬2引数ãŒä¸Žãˆ
+られãŸå¼•æ•°ã®å…¥ã£ã¦ã„ã‚‹é…列ã«ãªã‚Šã¾ã™ï¼Žselfã¯ç¬¬3引数ã¨ã—ã¦ä¸Ž
+ãˆã‚‰ã‚Œã¾ã™ï¼Ž
+
+ã“ã®é…列ã§ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã‚’è§£æžã™ã‚‹ãŸã‚ã®é–¢æ•°ãŒopen()ã§ã‚‚使ã‚
+れã¦ã„ã‚‹rb_scan_args()ã§ã™ï¼Žç¬¬3å¼•æ•°ã«æŒ‡å®šã—ãŸãƒ•ォーマットã«å¾“
+ã„,第4変数以é™ã«æŒ‡å®šã—ãŸVALUEã¸ã®å‚ç…§ã«å€¤ã‚’代入ã—ã¦ãれã¾
+ã™ï¼Ž
+
+
+引数をRubyã®é…列ã¨ã—ã¦å—ã‘å–るメソッドã®ä¾‹ã«ã¯
+Thread#initializeãŒã‚りã¾ã™ï¼Žå®Ÿè£…ã¯ã“ã†ã§ã™ï¼Ž
+
+ static VALUE
+ thread_initialize(VALUE thread, VALUE args)
+ {
+ /* ... */
+ }
+
+第1引数ã¯self,第2引数ã¯Rubyã®é…列ã§ã™ï¼Ž
+
+*注æ„事項*
+
+Rubyã¨å…±æœ‰ã¯ã—ãªã„ãŒRubyã®ã‚ªãƒ–ジェクトを格ç´ã™ã‚‹å¯èƒ½æ€§ã®ã‚ã‚‹
+Cã®å¤§åŸŸå¤‰æ•°ã¯ä»¥ä¸‹ã®é–¢æ•°ã‚’使ã£ã¦Rubyインタプリタã«å¤‰æ•°ã®å­˜åœ¨
+ã‚’æ•™ãˆã¦ã‚ã’ã¦ãã ã•ã„.ã§ãªã„ã¨GCã§ãƒˆãƒ©ãƒ–ルを起ã“ã—ã¾ã™ï¼Ž
+
+ void rb_global_variable(VALUE *var)
+
+== extconf.rbを用æ„ã™ã‚‹
+
+Makefileを作る場åˆã®é››åž‹ã«ãªã‚‹extconf.rbã¨ã„ã†ãƒ•ァイルを作り
+ã¾ã™ï¼Žextconf.rbã¯ãƒ©ã‚¤ãƒ–ラリã®ã‚³ãƒ³ãƒ‘イルã«å¿…è¦ãªæ¡ä»¶ã®ãƒã‚§ãƒƒ
+クãªã©ã‚’行ã†ã“ã¨ãŒç›®çš„ã§ã™ï¼Žã¾ãšï¼Œ
+
+ require 'mkmf'
+
+ã‚’extconf.rbã®å…ˆé ­ã«ç½®ãã¾ã™ï¼Žextconf.rbã®ä¸­ã§ã¯ä»¥ä¸‹ã®Rubyé–¢
+数を使ã†ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Ž
+
+ have_library(lib, func): ライブラリã®å­˜åœ¨ãƒã‚§ãƒƒã‚¯
+ have_func(func, header): 関数ã®å­˜åœ¨ãƒã‚§ãƒƒã‚¯
+ have_header(header): ヘッダファイルã®å­˜åœ¨ãƒã‚§ãƒƒã‚¯
+ create_makefile(target[, target_prefix]): Makefileã®ç”Ÿæˆ
+
+以下ã®å¤‰æ•°ã‚’使ã†ã“ã¨ãŒã§ãã¾ã™ï¼Ž
+
+ $CFLAGS: コンパイル時ã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Oãªã©)
+ $CPPFLAGS: プリプロセッサã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Iã‚„-Dãªã©)
+ $LDFLAGS: リンク時ã«è¿½åŠ çš„ã«æŒ‡å®šã™ã‚‹ãƒ•ラグ(-Lãªã©)
+ $objs: リンクã•れるオブジェクトファイルåã®ãƒªã‚¹ãƒˆ
+
+オブジェクトファイルã®ãƒªã‚¹ãƒˆã¯ï¼Œé€šå¸¸ã¯ã‚½ãƒ¼ã‚¹ãƒ•ァイルを検索ã—
+ã¦è‡ªå‹•çš„ã«ç”Ÿæˆã•れã¾ã™ãŒï¼Œmakeã®é€”中ã§ã‚½ãƒ¼ã‚¹ã‚’生æˆã™ã‚‹ã‚ˆã†ãª
+å ´åˆã¯æ˜Žç¤ºçš„ã«æŒ‡å®šã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ï¼Ž
+
+ライブラリをコンパイルã™ã‚‹æ¡ä»¶ãŒæƒã‚ãšï¼Œãã®ãƒ©ã‚¤ãƒ–ラリをコン
+パイルã—ãªã„時ã«ã¯create_makefileを呼ã°ãªã‘れã°Makefileã¯ç”Ÿ
+æˆã•れãšï¼Œã‚³ãƒ³ãƒ‘イルも行ã‚れã¾ã›ã‚“.
+
+== dependを用æ„ã™ã‚‹
+
+ã‚‚ã—,ディレクトリã«dependã¨ã„ã†ãƒ•ァイルãŒå­˜åœ¨ã™ã‚Œã°ï¼Œ
+MakefileãŒä¾å­˜é–¢ä¿‚ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦ãれã¾ã™ï¼Ž
+
+ % gcc -MM *.c > depend
+
+ãªã©ã§ä½œã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã‚ã£ã¦æã¯ç„¡ã„ã§ã—ょã†ï¼Ž
+
+== Makefileを生æˆã™ã‚‹
+
+Makefileを実際ã«ç”Ÿæˆã™ã‚‹ãŸã‚ã«ã¯
+
+ ruby extconf.rb
+
+ã¨ã—ã¾ã™ï¼Žextconf.rbã« require 'mkmf' ã®è¡ŒãŒãªã„å ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼
+ã«ãªã‚Šã¾ã™ã®ã§ï¼Œå¼•数を追加ã—ã¦
+
+ ruby -r mkmf extconf.rb
+
+ã¨ã—ã¦ãã ã•ã„.
+
+site_ruby ディレクトリã§ãªã,
+vendor_ruby ディレクトリã«ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã™ã‚‹å ´åˆã«ã¯
+以下ã®ã‚ˆã†ã« --vendor オプションを加ãˆã¦ãã ã•ã„.
+
+ ruby extconf.rb --vendor
+
+ディレクトリをext以下ã«ç”¨æ„ã—ãŸå ´åˆã«ã¯Ruby全体ã®makeã®æ™‚ã«
+自動的ã«MakefileãŒç”Ÿæˆã•れã¾ã™ã®ã§ï¼Œã“ã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ä¸è¦ã§ã™ï¼Ž
+
+== makeã™ã‚‹
+
+動的リンクライブラリを生æˆã™ã‚‹å ´åˆã«ã¯ãã®å ´ã§makeã—ã¦ãã ã•
+ã„.必è¦ã§ã‚れ㰠make install ã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¾ã™ï¼Ž
+
+ext以下ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’用æ„ã—ãŸå ´åˆã¯ï¼ŒRubyã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§
+makeを実行ã™ã‚‹ã¨Makefileを生æˆã‹ã‚‰make,必è¦ã«ã‚ˆã£ã¦ã¯ãã®ãƒ¢
+ジュールã®Rubyã¸ã®ãƒªãƒ³ã‚¯ã¾ã§è‡ªå‹•çš„ã«å®Ÿè¡Œã—ã¦ãれã¾ã™ï¼Ž
+extconf.rbã‚’æ›¸ãæ›ãˆã‚‹ãªã©ã—ã¦Makefileã®å†ç”ŸæˆãŒå¿…è¦ãªæ™‚ã¯ã¾
+ãŸRubyディレクトリã§makeã—ã¦ãã ã•ã„.
+
+拡張ライブラリã¯make installã§Rubyライブラリã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®
+下ã«ã‚³ãƒ”ーã•れã¾ã™ï¼Žã‚‚ã—æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨å”調ã—ã¦ä½¿ã†Rubyã§è¨˜
+è¿°ã•れãŸãƒ—ログラムãŒã‚り,Rubyライブラリã«ç½®ããŸã„å ´åˆã«ã¯ï¼Œ
+拡張ライブラリ用ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸‹ã« lib ã¨ã„ã†ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª
+を作り,ãã“ã« æ‹¡å¼µå­ .rb ã®ãƒ•ァイルを置ã„ã¦ãŠã‘ã°åŒæ™‚ã«ã‚¤ãƒ³
+ストールã•れã¾ã™ï¼Ž
+
+== デãƒãƒƒã‚°
+
+ã¾ã‚,デãƒãƒƒã‚°ã—ãªã„ã¨å‹•ã‹ãªã„ã§ã—ょã†ã­ï¼Žext/Setupã«ãƒ‡ã‚£ãƒ¬
+クトリåを書ãã¨é™çš„ã«ãƒªãƒ³ã‚¯ã™ã‚‹ã®ã§ãƒ‡ãƒãƒƒã‚¬ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãª
+りã¾ã™ï¼Žãã®åˆ†ã‚³ãƒ³ãƒ‘イルãŒé…ããªã‚Šã¾ã™ã‘ã©ï¼Ž
+
+== ã§ãã‚ãŒã‚Š
+
+後ã¯ã“ã£ãり使ã†ãªã‚Šï¼Œåºƒã公開ã™ã‚‹ãªã‚Šï¼Œå£²ã‚‹ãªã‚Šï¼Œã”自由ã«ãŠ
+使ã„ãã ã•ã„.Rubyã®ä½œè€…ã¯æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«é–¢ã—ã¦ä¸€åˆ‡ã®æ¨©åˆ©ã‚’
+主張ã—ã¾ã›ã‚“.
+
+= Appendix A. Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã®åˆ†é¡ž
+
+Rubyã®ã‚½ãƒ¼ã‚¹ã¯ã„ãã¤ã‹ã«åˆ†é¡žã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ï¼Žã“ã®ã†ã¡ã‚¯ãƒ©
+スライブラリã®éƒ¨åˆ†ã¯åŸºæœ¬çš„ã«æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã¨åŒã˜ä½œã‚Šæ–¹ã«ãªã£
+ã¦ã„ã¾ã™ï¼Žã“れらã®ã‚½ãƒ¼ã‚¹ã¯ä»Šã¾ã§ã®èª¬æ˜Žã§ã»ã¨ã‚“ã©ç†è§£ã§ãã‚‹ã¨
+æ€ã„ã¾ã™ï¼Ž
+
+== Ruby言語ã®ã‚³ã‚¢
+
+class.c :: クラスã¨ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«
+error.c :: 例外クラスã¨ä¾‹å¤–機構
+gc.c :: 記憶領域管ç†
+load.c :: ライブラリã®ãƒ­ãƒ¼ãƒ‰
+object.c :: オブジェクト
+variable.c :: 変数ã¨å®šæ•°
+
+== Rubyã®æ§‹æ–‡è§£æžå™¨
+
+ parse.y : å­—å¥è§£æžå™¨ã¨æ§‹æ–‡å®šç¾©
+ -> parse.c : 自動生æˆ
+ defs/keywords : 予約語
+ -> lex.c : 自動生æˆ
+
+== Rubyã®è©•価器 (通称YARV)
+ compile.c
+ eval.c
+ eval_error.c
+ eval_jump.c
+ eval_safe.c
+ insns.def : 仮想機械語ã®å®šç¾©
+ iseq.c : VM::ISeqã®å®Ÿè£…
+ thread.c : スレッド管ç†ã¨ã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆåˆ‡ã‚Šæ›¿ãˆ
+ thread_win32.c : スレッド実装
+ thread_pthread.c : åŒä¸Š
+ vm.c
+ vm_dump.c
+ vm_eval.c
+ vm_exec.c
+ vm_insnhelper.c
+ vm_method.c
+
+ defs/opt_insns_unif.def : 命令èžåˆ
+ defs/opt_operand.def : 最é©åŒ–ã®ãŸã‚ã®å®šç¾©
+
+ -> insn*.inc : 自動生æˆ
+ -> opt*.inc : 自動生æˆ
+ -> vm.inc : 自動生æˆ
+
+== æ­£è¦è¡¨ç¾ã‚¨ãƒ³ã‚¸ãƒ³ (鬼車)
+
+ regex.c
+ regcomp.c
+ regenc.c
+ regerror.c
+ regexec.c
+ regparse.c
+ regsyntax.c
+
+== ユーティリティ関数
+
+debug.c :: Cデãƒãƒƒã‚¬ç”¨ã®ãƒ‡ãƒãƒƒã‚°ã‚·ãƒ³ãƒœãƒ«
+dln.c :: 動的ローディング
+st.c :: 汎用ãƒãƒƒã‚·ãƒ¥è¡¨
+strftime.c :: 時刻整形
+util.c :: ãã®ä»–ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£
+
+== Rubyコマンドã®å®Ÿè£…
+
+ dmyext.c
+ dmydln.c
+ dmyencoding.c
+ id.c
+ inits.c
+ main.c
+ ruby.c
+ version.c
+
+ gem_prelude.rb
+ prelude.rb
+
+== クラスライブラリ
+
+array.c :: Array
+bignum.c :: Bignum
+compar.c :: Comparable
+complex.c :: Complex
+cont.c :: Fiber, Continuation
+dir.c :: Dir
+enum.c :: Enumerable
+enumerator.c :: Enumerator
+file.c :: File
+hash.c :: Hash
+io.c :: IO
+marshal.c :: Marshal
+math.c :: Math
+numeric.c :: Numeric, Integer, Fixnum, Float
+pack.c :: Array#pack, String#unpack
+proc.c :: Binding, Proc
+process.c :: Process
+random.c :: 乱数
+range.c :: Range
+rational.c :: Rational
+re.c :: Regexp, MatchData
+signal.c :: Signal
+sprintf.c :: String#sprintf
+string.c :: String
+struct.c :: Struct
+time.c :: Time
+defs/known_errors.def :: 例外クラス Errno::*
+-> known_errors.inc :: 自動生æˆ
+
+== 多言語化
+
+encoding.c :: Encoding
+transcode.c :: Encoding::Converter
+enc/*.c :: エンコーディングクラス群
+enc/trans/* :: コードãƒã‚¤ãƒ³ãƒˆå¯¾å¿œè¡¨
+
+== gorubyコマンドã®å®Ÿè£…
+
+ goruby.c
+ golf_prelude.rb : goruby固有ã®ãƒ©ã‚¤ãƒ–ラリ
+ -> golf_prelude.c : 自動生æˆ
+
+= Appendix B. 拡張用関数リファレンス
+
+C言語ã‹ã‚‰Rubyã®æ©Ÿèƒ½ã‚’利用ã™ã‚‹APIã¯ä»¥ä¸‹ã®é€šã‚Šã§ã‚る.
+
+== åž‹
+
+VALUE ::
+
+ Rubyオブジェクトを表ç¾ã™ã‚‹åž‹ï¼Žå¿…è¦ã«å¿œã˜ã¦ã‚­ãƒ£ã‚¹ãƒˆã—ã¦ç”¨ã„る.
+ 組ã¿è¾¼ã¿åž‹ã‚’表ç¾ã™ã‚‹Cã®åž‹ã¯ruby.hã«è¨˜è¿°ã—ã¦ã‚ã‚‹Rã§å§‹ã¾ã‚‹æ§‹é€ 
+ 体ã§ã‚る.VALUE型をã“れらã«ã‚­ãƒ£ã‚¹ãƒˆã™ã‚‹ãŸã‚ã«Rã§å§‹ã¾ã‚‹æ§‹é€ ä½“
+ åã‚’å…¨ã¦å¤§æ–‡å­—ã«ã—ãŸåå‰ã®ãƒžã‚¯ãƒ­ãŒç”¨æ„ã•れã¦ã„る.
+
+== 変数・定数
+
+Qnil ::
+
+ 定数: nilオブジェクト
+
+Qtrue ::
+
+ 定数: trueオブジェクト(真ã®ãƒ‡ãƒ•ォルト値)
+
+Qfalse ::
+
+ 定数: falseオブジェクト
+
+== Cデータã®ã‚«ãƒ—セル化
+
+Data_Wrap_Struct(VALUE klass, void (*mark)(), void (*free)(), void *sval) ::
+
+ Cã®ä»»æ„ã®ãƒã‚¤ãƒ³ã‚¿ã‚’カプセル化ã—ãŸRubyオブジェクトを返ã™ï¼Žã“
+ ã®ãƒã‚¤ãƒ³ã‚¿ãŒRubyã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã•れãªããªã£ãŸæ™‚,freeã§æŒ‡å®šã—ãŸ
+ 関数ãŒå‘¼ã°ã‚Œã‚‹ï¼Žã¾ãŸï¼Œã“ã®ãƒã‚¤ãƒ³ã‚¿ã®æŒ‡ã™ãƒ‡ãƒ¼ã‚¿ãŒä»–ã®Rubyオブ
+ ジェクトを指ã—ã¦ã„ã‚‹å ´åˆï¼Œmarkã«æŒ‡å®šã™ã‚‹é–¢æ•°ã§ãƒžãƒ¼ã‚¯ã™ã‚‹å¿…è¦
+ ãŒã‚る.
+
+Data_Make_Struct(klass, type, mark, free, sval) ::
+
+ typeåž‹ã®ãƒ¡ãƒ¢ãƒªã‚’mallocã—,変数svalã«ä»£å…¥ã—ãŸå¾Œï¼Œãれをカプセ
+ ル化ã—ãŸãƒ‡ãƒ¼ã‚¿ã‚’è¿”ã™ãƒžã‚¯ãƒ­ï¼Ž
+
+Data_Get_Struct(data, type, sval) ::
+
+ dataã‹ã‚‰typeåž‹ã®ãƒã‚¤ãƒ³ã‚¿ã‚’å–り出ã—変数svalã«ä»£å…¥ã™ã‚‹ãƒžã‚¯ãƒ­ï¼Ž
+
+== åž‹ãƒã‚§ãƒƒã‚¯
+
+ TYPE(value)
+ FIXNUM_P(value)
+ NIL_P(value)
+ void Check_Type(VALUE value, int type)
+ SafeStringValue(value)
+
+== 型変æ›
+
+ FIX2INT(value), INT2FIX(i)
+ FIX2LONG(value), LONG2FIX(l)
+ NUM2INT(value), INT2NUM(i)
+ NUM2UINT(value), UINT2NUM(ui)
+ NUM2LONG(value), LONG2NUM(l)
+ NUM2ULONG(value), ULONG2NUM(ul)
+ NUM2LL(value), LL2NUM(ll)
+ NUM2ULL(value), ULL2NUM(ull)
+ NUM2OFFT(value), OFFT2NUM(off)
+ NUM2SIZET(value), SIZET2NUM(size)
+ NUM2SSIZET(value), SSIZET2NUM(ssize)
+ rb_integer_pack(value, words, numwords, wordsize, nails, flags), rb_integer_unpack(words, numwords, wordsize, nails, flags)
+ NUM2DBL(value)
+ rb_float_new(f)
+ RSTRING_LEN(str)
+ RSTRING_PTR(str)
+ StringValue(value)
+ StringValuePtr(value)
+ StringValueCStr(value)
+ rb_str_new2(s)
+
+== クラス/モジュール定義
+
+VALUE rb_define_class(const char *name, VALUE super) ::
+
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã™ã‚‹ï¼Ž
+
+VALUE rb_define_class_under(VALUE module, const char *name, VALUE super) ::
+
+ superã®ã‚µãƒ–クラスã¨ã—ã¦æ–°ã—ã„Rubyクラスを定義ã—,moduleã®
+ 定数ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
+
+VALUE rb_define_module(const char *name) ::
+
+ æ–°ã—ã„Rubyモジュールを定義ã™ã‚‹ï¼Ž
+
+VALUE rb_define_module_under(VALUE module, const char *name) ::
+
+ æ–°ã—ã„Rubyモジュールを定義ã—,moduleã®å®šæ•°ã¨ã—ã¦å®šç¾©ã™ã‚‹ï¼Ž
+
+void rb_include_module(VALUE klass, VALUE module) ::
+
+ モジュールをインクルードã™ã‚‹ï¼ŽclassãŒã™ã§ã«moduleをインク
+ ルードã—ã¦ã„る時ã«ã¯ä½•ã‚‚ã—ãªã„(多é‡ã‚¤ãƒ³ã‚¯ãƒ«ãƒ¼ãƒ‰ã®ç¦æ­¢).
+
+void rb_extend_object(VALUE object, VALUE module) ::
+
+ オブジェクトをモジュール(ã§å®šç¾©ã•れã¦ã„るメソッド)ã§æ‹¡å¼µã™ã‚‹ï¼Ž
+
+== 大域変数定義
+
+void rb_define_variable(const char *name, VALUE *var) ::
+
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°åãŒ`$'ã§
+ å§‹ã¾ã‚‰ãªã„時ã«ã¯è‡ªå‹•çš„ã«è¿½åŠ ã•れる.nameã¨ã—ã¦Rubyã®è­˜åˆ¥å­
+ ã¨ã—ã¦è¨±ã•れãªã„文字(例ãˆã°` ')ã‚’å«ã‚€å ´åˆã«ã¯Rubyプログラ
+ ムã‹ã‚‰ã¯è¦‹ãˆãªããªã‚‹ï¼Ž
+
+void rb_define_readonly_variable(const char *name, VALUE *var) ::
+
+ Rubyã¨Cã¨ã§å…±æœ‰ã™ã‚‹read onlyã®ã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Ž
+ read onlyã§ã‚ã‚‹ã“ã¨ä»¥å¤–ã¯rb_define_variable()ã¨åŒã˜ï¼Ž
+
+void rb_define_virtual_variable(const char *name, VALUE (*getter)(), void (*setter)()) ::
+
+ 関数ã«ã‚ˆã£ã¦å®Ÿç¾ã•れるRuby変数を定義ã™ã‚‹ï¼Žå¤‰æ•°ãŒå‚ç…§ã•れãŸ
+ 時ã«ã¯getterãŒï¼Œå¤‰æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯setterãŒå‘¼ã°ã‚Œ
+ る.
+
+void rb_define_hooked_variable(const char *name, VALUE *var, VALUE (*getter)(), void (*setter)()) ::
+
+ 関数ã«ã‚ˆã£ã¦hookã®ã¤ã‘られãŸã‚°ãƒ­ãƒ¼ãƒãƒ«å¤‰æ•°ã‚’定義ã™ã‚‹ï¼Žå¤‰æ•°
+ ãŒå‚ç…§ã•ã‚ŒãŸæ™‚ã«ã¯getterãŒï¼Œé–¢æ•°ã«å€¤ãŒã‚»ãƒƒãƒˆã•ã‚ŒãŸæ™‚ã«ã¯
+ setterãŒå‘¼ã°ã‚Œã‚‹ï¼Žgetterã‚„setterã«0を指定ã—ãŸæ™‚ã«ã¯hookã‚’
+ 指定ã—ãªã„ã®ã¨åŒã˜äº‹ã«ãªã‚‹ï¼Ž
+
+void rb_global_variable(VALUE *var)
+
+ GCã®ãŸã‚,Rubyプログラムã‹ã‚‰ã¯ã‚¢ã‚¯ã‚»ã‚¹ã•れãªã„ãŒ, Rubyオブ
+ ジェクトをå«ã‚€å¤§åŸŸå¤‰æ•°ã‚’マークã™ã‚‹ï¼Ž
+
+== 定数
+
+void rb_define_const(VALUE klass, const char *name, VALUE val) ::
+
+ 定数を定義ã™ã‚‹ï¼Ž
+
+void rb_define_global_const(const char *name, VALUE val) ::
+
+ 大域定数を定義ã™ã‚‹ï¼Ž
+
+ rb_define_const(rb_cObject, name, val)
+
+ ã¨åŒã˜æ„味.
+
+== メソッド定義
+
+rb_define_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ メソッドを定義ã™ã‚‹ï¼Žargcã¯selfを除ãå¼•æ•°ã®æ•°ï¼ŽargcãŒ-1ã®æ™‚,
+ 関数ã«ã¯å¼•æ•°ã®æ•°(selfã‚’å«ã¾ãªã„)を第1引数, 引数ã®é…列を第2
+ 引数ã¨ã™ã‚‹å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹(第3引数ã¯self).argcãŒ-2ã®æ™‚,
+ 第1引数ãŒself, 第2引数ãŒargs(argsã¯å¼•æ•°ã‚’å«ã‚€Rubyã®é…列)ã¨
+ ã„ã†å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹ï¼Ž
+
+rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ privateメソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
+
+rb_define_singleton_method(VALUE klass, const char *name, VALUE (*func)(), int argc) ::
+
+ 特異メソッドを定義ã™ã‚‹ï¼Žå¼•æ•°ã¯rb_define_method()ã¨åŒã˜ï¼Ž
+
+rb_scan_args(int argc, VALUE *argv, const char *fmt, ...) ::
+
+ argc, argvå½¢å¼ã§ä¸Žãˆã‚‰ã‚ŒãŸæŒ‡å®šã•れãŸãƒ•ォーマットã«å¾“ã£ã¦å¼•
+ 数を分解ã—,続ãVALUEã¸ã®å‚ç…§ã«ã‚»ãƒƒãƒˆã—ã¾ã™ï¼Žã“ã®ãƒ•ォーマッ
+ トã¯ï¼ŒABNFã§è¨˜è¿°ã™ã‚‹ã¨ä»¥ä¸‹ã®é€šã‚Šã§ã™ï¼Ž
+
+ scan-arg-spec := param-arg-spec [option-hash-arg-spec] [block-arg-spec]
+
+ param-arg-spec := pre-arg-spec [post-arg-spec] / post-arg-spec /
+ pre-opt-post-arg-spec
+ pre-arg-spec := num-of-leading-mandatory-args [num-of-optional-args]
+ post-arg-spec := sym-for-variable-length-args
+ [num-of-trailing-mandatory-args]
+ pre-opt-post-arg-spec := num-of-leading-mandatory-args num-of-optional-args
+ num-of-trailing-mandatory-args
+ option-hash-arg-spec := sym-for-option-hash-arg
+ block-arg-spec := sym-for-block-arg
+
+ num-of-leading-mandatory-args := DIGIT ; 先頭ã«ç½®ã‹ã‚Œã‚‹çœç•¥ä¸èƒ½ãªå¼•æ•°ã®æ•°
+ num-of-optional-args := DIGIT ; ç¶šã„ã¦ç½®ã‹ã‚Œã‚‹çœç•¥å¯èƒ½ãªå¼•æ•°ã®æ•°
+ sym-for-variable-length-args := "*" ; ç¶šã„ã¦ç½®ã‹ã‚Œã‚‹å¯å¤‰é•·å¼•æ•°ã‚’
+ ; Rubyã®é…列ã§å–å¾—ã™ã‚‹ãŸã‚ã®æŒ‡å®š
+ num-of-trailing-mandatory-args := DIGIT ; 終端ã«ç½®ã‹ã‚Œã‚‹çœç•¥ä¸èƒ½ãªå¼•æ•°ã®æ•°
+ sym-for-option-hash-arg := ":" ; オプションãƒãƒƒã‚·ãƒ¥ã‚’å–å¾—ã™ã‚‹
+ ; ãŸã‚ã®æŒ‡å®š; çœç•¥ä¸èƒ½ãªå¼•æ•°ã®
+ ; 数よりも多ãã®å¼•æ•°ãŒæŒ‡å®šã•れ,
+ ; 最後ã®å¼•æ•°ãŒãƒãƒƒã‚·ãƒ¥ï¼ˆã¾ãŸã¯
+ ; #to_hashã§å¤‰æ›å¯èƒ½ï¼‰ã®å ´åˆã«
+ ; å–å¾—ã•れる.最後ã®å¼•æ•°ãŒnilã®
+ ; å ´åˆï¼Œå¯å¤‰é•·å¼•数指定ãŒãªã,
+ ; çœç•¥ä¸èƒ½å¼•æ•°ã®æ•°ã‚ˆã‚Šã‚‚多ãã®
+ ; å¼•æ•°ãŒæŒ‡å®šã•れãŸå ´åˆã«å–å¾—ã•れる
+ sym-for-block-arg := "&" ; イテレータブロックをå–å¾—ã™ã‚‹ãŸã‚ã®
+ ; 指定
+
+ フォーマットãŒ"12"ã®å ´åˆï¼Œå¼•æ•°ã¯æœ€ä½Ž1ã¤ã§ï¼Œ3ã¤(1+2)ã¾ã§è¨±ã•
+ れるã¨ã„ã†æ„味ã«ãªã‚Šã¾ã™ï¼Žå¾“ã£ã¦ï¼Œãƒ•ォーマット文字列ã«ç¶šã„
+ ã¦3ã¤ã®VALUEã¸ã®å‚ç…§ã‚’ç½®ãå¿…è¦ãŒã‚りã¾ã™ï¼Žãれらã«ã¯å–å¾—ã—ãŸ
+ 変数ãŒã‚»ãƒƒãƒˆã•れã¾ã™ï¼Žå¤‰æ•°ã¸ã®å‚ç…§ã®ä»£ã‚りã«NULLを指定ã™ã‚‹
+ ã“ã¨ã‚‚ã§ã,ãã®å ´åˆã¯å–å¾—ã—ãŸå¼•æ•°ã®å€¤ã¯æ¨ã¦ã‚‰ã‚Œã¾ã™ï¼ŽãªãŠï¼Œ
+ çœç•¥å¯èƒ½å¼•æ•°ãŒçœç•¥ã•ã‚ŒãŸæ™‚ã®å¤‰æ•°ã®å€¤ã¯nil(C言語ã®ãƒ¬ãƒ™ãƒ«ã§ã¯
+ Qnil)ã«ãªã‚Šã¾ã™ï¼Ž
+
+ 返り値ã¯ä¸Žãˆã‚‰ã‚ŒãŸå¼•æ•°ã®æ•°ã§ã™ï¼Žã‚ªãƒ—ションãƒãƒƒã‚·ãƒ¥ãŠã‚ˆã³ã‚¤
+ ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ãƒ­ãƒƒã‚¯ã¯æ•°ãˆã¾ã›ã‚“.
+
+int rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, VALUE *values)
+
+ ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã§æŒ‡å®šã•れãŸå€¤ã‚’tableã«ã—ãŸãŒã£ã¦å–り出ã—ã¾ã™ï¼Ž
+ tableã®æœ€åˆã®required個ã®IDã¯å¿…須キーワードを表ã—,続ã
+ optional (optionalãŒè² ã®å ´åˆã¯-optional-1) 個ã®IDã¯çœç•¥å¯èƒ½
+ キーワードã§ã™ï¼Žå¿…須キーワードãŒkeyword_hash中ã«ãªã„å ´åˆï¼Œ
+ "missing keyword"ArgumentErrorãŒç™ºç”Ÿã—ã¾ã™ï¼Žçœç•¥å¯èƒ½ã‚­ãƒ¼ãƒ¯ãƒ¼
+ ドãŒãªã„å ´åˆã¯ï¼Œvalues中ã®å¯¾å¿œã™ã‚‹è¦ç´ ã¯å¤‰æ›´ã•れã¾ã›ã‚“.
+ keyword_hashã«ä½¿ç”¨ã•れãªã„è¦ç´ ãŒã‚ã‚‹å ´åˆã¯ï¼ŒoptionalãŒè² ãªã‚‰
+ æ–°ã—ã„Hashã¨ã—ã¦çœç•¥å¯èƒ½å¼•æ•°ã®æ¬¡ã«ä¿å­˜ã•れã¾ã™ãŒï¼Œãã†ã§ãªã‘
+ れã°"unknown keyword"ArgumentErrorãŒç™ºç”Ÿã—ã¾ã™ï¼Ž
+
+VALUE rb_extract_keywords(VALUE *original_hash)
+
+ original_hashã§å‚ç…§ã•れるHashオブジェクトã‹ã‚‰ï¼ŒSymbolã§ã‚ã‚‹
+ キーã¨ãã®å€¤ã‚’æ–°ã—ã„Hashã«å–り出ã—ã¾ã™ï¼Žoriginal_hashã®æŒ‡ã™
+ å…ˆã«ã¯ï¼Œå…ƒã®HashãŒSymbol以外ã®ã‚­ãƒ¼ã‚’å«ã‚“ã§ã„ãŸå ´åˆã¯ãれらãŒ
+ コピーã•れãŸåˆ¥ã®æ–°ã—ã„Hash,ãã†ã§ãªã‘れã°0ãŒä¿å­˜ã•れã¾ã™ï¼Ž
+
+== Rubyメソッド呼ã³å‡ºã—
+
+VALUE rb_funcall(VALUE recv, ID mid, int narg, ...) ::
+
+ メソッド呼ã³å‡ºã—.文字列ã‹ã‚‰midã‚’å¾—ã‚‹ãŸã‚ã«ã¯rb_intern()ã‚’
+ 使ã†ï¼Ž
+ private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
+
+VALUE rb_funcall2(VALUE recv, ID mid, int argc, VALUE *argv) ::
+VALUE rb_funcallv(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.引数をargc, argvå½¢å¼ã§æ¸¡ã™ï¼Ž
+ private/protectedãªãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚‚呼ã³å‡ºã›ã‚‹ï¼Ž
+
+VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, VALUE *argv) ::
+
+ メソッド呼ã³å‡ºã—.
+ publicãªãƒ¡ã‚½ãƒƒãƒ‰ã—ã‹å‘¼ã¹ãªã„.
+
+VALUE rb_eval_string(const char *str)
+
+ 文字列をRubyスクリプトã¨ã—ã¦ã‚³ãƒ³ãƒ‘イル・実行ã™ã‚‹ï¼Ž
+
+ID rb_intern(const char *name) ::
+
+ 文字列ã«å¯¾å¿œã™ã‚‹IDã‚’è¿”ã™ï¼Ž
+
+char *rb_id2name(ID id) ::
+
+ IDã«å¯¾å¿œã™ã‚‹æ–‡å­—列を返ã™(デãƒãƒƒã‚°ç”¨).
+
+char *rb_class2name(VALUE klass) ::
+
+ クラスã®åå‰ã‚’è¿”ã™(デãƒãƒƒã‚°ç”¨).クラスãŒåå‰ã‚’æŒãŸãªã„時ã«
+ ã¯, 祖先をé¡ã£ã¦åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹ã®åå‰ã‚’è¿”ã™ï¼Ž
+
+int rb_respond_to(VALUE obj, ID id) ::
+
+ objãŒidã§ç¤ºã•れるメソッドをæŒã¤ã‹ã©ã†ã‹ã‚’è¿”ã™ï¼Ž
+
+== インスタンス変数
+
+VALUE rb_iv_get(VALUE obj, const char *name) ::
+
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã®å€¤ã‚’得る.`@'ã§å§‹ã¾ã‚‰ãªã„インスタン
+ ス変数㯠Rubyプログラムã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„「隠れãŸã€ã‚¤ãƒ³
+ スタンス変数ã«ãªã‚‹ï¼Žå®šæ•°ã¯å¤§æ–‡å­—ã®åå‰ã‚’æŒã¤ã‚¯ãƒ©ã‚¹(ã¾ãŸã¯
+ モジュール)ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã¨ã—ã¦å®Ÿè£…ã•れã¦ã„る.
+
+VALUE rb_iv_set(VALUE obj, const char *name, VALUE val) ::
+
+ objã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’valã«ã‚»ãƒƒãƒˆã™ã‚‹ï¼Ž
+
+== 制御構造
+
+VALUE rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2) ::
+
+ funcをブロックã¨ã—ã¦è¨­å®šã—,objをレシーãƒï¼Œargcã¨argvを引数
+ ã¨ã—ã¦midメソッドを呼ã³å‡ºã™ï¼Žfuncã¯ç¬¬ä¸€å¼•æ•°ã«yieldã•れãŸå€¤ï¼Œ
+ 第二引数ã«data2ã‚’å—ã‘å–る.複数ã®å€¤ãŒyieldã•れãŸå ´åˆ(Cã§ã¯
+ rb_yield_values()ã¨rb_yield_values2(), rb_yield_splat()),
+ data2ã¯Arrayã¨ã—ã¦ãƒ‘ックã•れã¦ã„る.第三, 第四引数ã®argcã¨
+ argvã«ã‚ˆã£ã¦yieldã•れãŸå€¤ã‚’å–り出ã™ã“ã¨ãŒã§ãる.
+
+[OBSOLETE] VALUE rb_iterate(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ func2をブロックã¨ã—ã¦è¨­å®šã—, func1をイテレータã¨ã—ã¦å‘¼ã¶ï¼Ž
+ func1ã«ã¯ arg1ãŒå¼•æ•°ã¨ã—ã¦æ¸¡ã•れ, func2ã«ã¯ç¬¬1引数ã«ã‚¤ãƒ†ãƒ¬ãƒ¼
+ ã‚¿ã‹ã‚‰ä¸Žãˆã‚‰ã‚ŒãŸå€¤, 第2引数ã«arg2ãŒæ¸¡ã•れる.
+
+ 1.9ã§rb_iterateを使ã†å ´åˆã¯, func1ã®ä¸­ã§Rubyレベルã®ãƒ¡ã‚½ãƒƒãƒ‰
+ を呼ã³å‡ºã•ãªã‘れã°ãªã‚‰ãªã„.
+ 1.9ã§obsoleteã¨ãªã£ãŸ. 代ã‚りã«rb_block_callãŒç”¨æ„ã•れãŸ.
+
+VALUE rb_yield(VALUE val) ::
+
+ valを値ã¨ã—ã¦ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ãƒ–ロックを呼ã³å‡ºã™ï¼Ž
+
+VALUE rb_rescue(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1ã‚’arg1を引数ã«å‘¼ã³å‡ºã™ï¼Žfunc1ã®å®Ÿè¡Œä¸­ã«ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãŸæ™‚ã«ã¯ func2ã‚’arg2を引数ã¨ã—ã¦å‘¼ã¶ï¼Žæˆ»ã‚Šå€¤ã¯ä¾‹å¤–ãŒç™ºç”Ÿ
+ ã—ãªã‹ã£ãŸæ™‚ã¯func1ã®æˆ»ã‚Šå€¤, 例外ãŒç™ºç”Ÿã—ãŸæ™‚ã«ã¯func2ã®æˆ»
+ り値ã§ã‚る.
+
+VALUE rb_ensure(VALUE (*func1)(), VALUE arg1, VALUE (*func2)(), VALUE arg2) ::
+
+ 関数func1ã‚’arg1を引数ã¨ã—ã¦å®Ÿè¡Œã—, 実行終了後(ãŸã¨ãˆä¾‹å¤–ãŒ
+ 発生ã—ã¦ã‚‚) func2ã‚’arg2を引数ã¨ã—ã¦å®Ÿè¡Œã™ã‚‹ï¼Žæˆ»ã‚Šå€¤ã¯func1
+ ã®æˆ»ã‚Šå€¤ã§ã‚ã‚‹(例外ãŒç™ºç”Ÿã—ãŸæ™‚ã¯æˆ»ã‚‰ãªã„).
+
+VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state) ::
+
+ 関数funcã‚’argを引数ã¨ã—ã¦å®Ÿè¡Œã—, 例外ãŒç™ºç”Ÿã—ãªã‘れã°ãã®æˆ»
+ り値を返ã™ï¼Žä¾‹å¤–ãŒç™ºç”Ÿã—ãŸå ´åˆã¯, *stateã«éž0をセットã—ã¦
+ Qnilã‚’è¿”ã™ï¼Ž
+ rb_jump_tag()を呼ã°ãšã«æ•æ‰ã—ãŸä¾‹å¤–を無視ã™ã‚‹å ´åˆã«ã¯ï¼Œ
+ rb_set_errinfo(Qnil)ã§ã‚¨ãƒ©ãƒ¼æƒ…報をクリアã—ãªã‘れã°ãªã‚‰ãªã„.
+
+void rb_jump_tag(int state) ::
+
+ rb_protect()ã‚„rb_eval_string_protect()ã§æ•æ‰ã•れãŸä¾‹å¤–ã‚’å†
+ é€ã™ã‚‹ï¼Žstateã¯ãれらã®é–¢æ•°ã‹ã‚‰è¿”ã•れãŸå€¤ã§ãªã‘れã°ãªã‚‰ãªã„.
+ ã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+void rb_iter_break() ::
+
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックを終了ã™ã‚‹ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡º
+ ã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+void rb_iter_break_value(VALUE value) ::
+
+ ç¾åœ¨ã®æœ€ã‚‚内å´ã®ãƒ–ロックをvalueã§çµ‚了ã™ã‚‹ï¼Žãƒ–ロックã¯å¼•æ•°ã§
+ 与ãˆã‚‰ã‚ŒãŸvalueã‚’è¿”ã™ï¼Žã“ã®é–¢æ•°ã¯ç›´æŽ¥ã®å‘¼ã³å‡ºã—å…ƒã«æˆ»ã‚‰ãªã„.
+
+== 例外・エラー
+
+void rb_warning(const char *fmt, ...) ::
+
+ rb_verboseæ™‚ã«æ¨™æº–エラー出力ã«è­¦å‘Šæƒ…報を表示ã™ã‚‹ï¼Žå¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
+
+void rb_raise(rb_eRuntimeError, const char *fmt, ...) ::
+
+ RuntimeError例外を発生ã•ã›ã‚‹ï¼Žå¼•æ•°ã¯printf()ã¨åŒã˜ï¼Ž
+
+void rb_raise(VALUE exception, const char *fmt, ...) ::
+
+ exceptionã§æŒ‡å®šã—ãŸä¾‹å¤–を発生ã•ã›ã‚‹ï¼Žfmt以下ã®å¼•æ•°ã¯
+ printf()ã¨åŒã˜ï¼Ž
+
+void rb_fatal(const char *fmt, ...) ::
+
+ 致命的例外を発生ã•ã›ã‚‹ï¼Žé€šå¸¸ã®ä¾‹å¤–処ç†ã¯è¡Œãªã‚れãš, インター
+ プリタãŒçµ‚了ã™ã‚‹(ãŸã ã—ensureã§æŒ‡å®šã•れãŸã‚³ãƒ¼ãƒ‰ã¯çµ‚了å‰ã«
+ 実行ã•れる).
+
+void rb_bug(const char *fmt, ...) ::
+
+ インタープリタãªã©ãƒ—ログラムã®ãƒã‚°ã§ã—ã‹ç™ºç”Ÿã™ã‚‹ã¯ãšã®ãªã„
+ 状æ³ã®æ™‚呼ã¶ï¼Žã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã¯ã‚³ã‚¢ãƒ€ãƒ³ãƒ—ã—ç›´ã¡ã«çµ‚了ã™ã‚‹ï¼Ž
+ 例外処ç†ã¯ä¸€åˆ‡è¡Œãªã‚れãªã„.
+
+注æ„: "%"PRIsVALUEãŒObject#to_s('+'ãƒ•ãƒ©ã‚°ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã¨
+ãã¯Object#inspect)を使ã£ãŸVALUEã®å‡ºåŠ›ã«åˆ©ç”¨ã§ãる.ã“れã¯
+"%i"ã¨è¡çªã™ã‚‹ãŸã‚,整数ã«ã¯"%d"を使用ã™ã‚‹ã“ã¨ï¼Ž
+
+== Rubyã®åˆæœŸåŒ–・実行
+
+Rubyをアプリケーションã«åŸ‹ã‚込む場åˆã«ã¯ä»¥ä¸‹ã®ã‚¤ãƒ³ã‚¿ãƒ•ェース
+を使ã†ï¼Žé€šå¸¸ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ã¯å¿…è¦ãªã„.
+
+void ruby_init() ::
+
+ Rubyインタプリタã®åˆæœŸåŒ–を行ãªã†ï¼Ž
+
+void *ruby_options(int argc, char **argv) ::
+
+ Rubyインタプリタã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³å¼•æ•°ã®å‡¦ç†ã‚’行ãªã„,
+ Rubyã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’コンパイルã™ã‚‹ï¼Ž
+ コンパイルã•れãŸã‚½ãƒ¼ã‚¹ã¸ã®ãƒã‚¤ãƒ³ã‚¿ï¼Œã‚‚ã—ãã¯ç‰¹æ®Šå€¤ã‚’è¿”ã™.
+
+int ruby_run_node(void *n) ::
+
+ コンパイルã•れãŸã‚³ãƒ¼ãƒ‰ã‚’実行ã™ã‚‹ï¼Ž
+ å®Ÿè¡Œã«æˆåŠŸã—ãŸå ´åˆã¯EXIT_SUCCESSを,エラーãŒèµ·ã“ã£ãŸã¨ãã¯ãれ以外を返ã™ï¼Ž
+
+void ruby_script(char *name) ::
+
+ Rubyã®ã‚¹ã‚¯ãƒªãƒ—トå($0)を設定ã™ã‚‹ï¼Ž
+
+== インタプリタã®ã‚¤ãƒ™ãƒ³ãƒˆã®ãƒ•ック
+
+ void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
+ VALUE data)
+
+指定ã•れãŸã‚¤ãƒ³ã‚¿ãƒ—リタã®ã‚¤ãƒ™ãƒ³ãƒˆã«å¯¾ã™ã‚‹ãƒ•ック関数を追加ã—ã¾ã™ï¼Ž
+eventsã¯ä»¥ä¸‹ã®å€¤ã®orã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“:
+
+ RUBY_EVENT_LINE
+ RUBY_EVENT_CLASS
+ RUBY_EVENT_END
+ RUBY_EVENT_CALL
+ RUBY_EVENT_RETURN
+ RUBY_EVENT_C_CALL
+ RUBY_EVENT_C_RETURN
+ RUBY_EVENT_RAISE
+ RUBY_EVENT_ALL
+
+rb_event_hook_func_tã®å®šç¾©ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™:
+
+ typedef void (*rb_event_hook_func_t)(rb_event_t event, VALUE data,
+ VALUE self, ID id, VALUE klass)
+
+rb_add_event_hook() ã®ç¬¬3引数 data ã¯ï¼Œãƒ•ック関数ã®ç¬¬2引数ã¨
+ã—ã¦æ¸¡ã•れã¾ã™ï¼Žã“れã¯1.8ã§ã¯ç¾åœ¨ã®NODEã¸ã®ãƒã‚¤ãƒ³ã‚¿ã§ã—ãŸï¼Žä»¥
+下㮠RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ã‚‚å‚ç…§ã—ã¦ãã ã•ã„.
+
+ int rb_remove_event_hook(rb_event_hook_func_t func)
+
+指定ã•れãŸãƒ•ック関数を削除ã—ã¾ã™ï¼Ž
+
+== äº’æ›æ€§ã®ãŸã‚ã®ãƒžã‚¯ãƒ­
+
+APIã®äº’æ›æ€§ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ãŸã‚ã«ä»¥ä¸‹ã®ãƒžã‚¯ãƒ­ãŒãƒ‡ãƒ•ォルトã§å®šç¾©ã•れã¦ã„ã¾ã™ï¼Ž
+
+NORETURN_STYLE_NEW ::
+
+ NORETURN マクロãŒé–¢æ•°åž‹ãƒžã‚¯ãƒ­ã¨ã—ã¦å®šç¾©ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+HAVE_RB_DEFINE_ALLOC_FUNC ::
+
+ rb_define_alloc_func() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ï¼Œã¤ã¾ã‚Š
+ allocation framework ãŒä½¿ã‚れるã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_define_alloc_func", "ruby.h")
+ ã®çµæžœã¨åŒã˜ï¼Ž
+
+HAVE_RB_REG_NEW_STR ::
+
+ Stringオブジェクトã‹ã‚‰Regexpオブジェクトを作る
+ rb_reg_new_str() é–¢æ•°ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+ have_func("rb_reg_new_str", "ruby.h").
+ ã®çµæžœã¨åŒã˜ï¼Ž
+
+HAVE_RB_IO_T ::
+
+ rb_io_t åž‹ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+USE_SYMBOL_AS_METHOD_NAME ::
+
+ メソッドåã‚’è¿”ã™ãƒ¡ã‚½ãƒƒãƒ‰ï¼ŒModule#methods, #singleton_methods
+ ãªã©ãŒSymbolã‚’è¿”ã™ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+HAVE_RUBY_*_H ::
+
+ ruby.h ã§å®šç¾©ã•れã¦ã„る.対応ã™ã‚‹ãƒ˜ãƒƒãƒ€ãŒæä¾›ã•れã¦ã„ã‚‹ã“ã¨
+ ã‚’æ„味ã™ã‚‹ï¼ŽãŸã¨ãˆã°ï¼ŒHAVE_RUBY_ST_H ãŒå®šç¾©ã•れã¦ã„ã‚‹å ´åˆã¯
+ å˜ãªã‚‹ st.h ã§ã¯ãªã ruby/st.h を使用ã™ã‚‹ï¼Ž
+
+RB_EVENT_HOOKS_HAVE_CALLBACK_DATA ::
+
+ rb_add_event_hook() ãŒãƒ•ãƒƒã‚¯é–¢æ•°ã«æ¸¡ã™ data を第3引数ã¨ã—ã¦
+ å—ã‘å–ã‚‹ã“ã¨ã‚’æ„味ã™ã‚‹ï¼Ž
+
+= Appendix C. extconf.rbã§ä½¿ãˆã‚‹é–¢æ•°ãŸã¡
+
+extconf.rbã®ä¸­ã§ã¯åˆ©ç”¨å¯èƒ½ãªã‚³ãƒ³ãƒ‘イルæ¡ä»¶ãƒã‚§ãƒƒã‚¯ã®é–¢æ•°ã¯ä»¥
+下ã®é€šã‚Šã§ã‚る.
+
+have_macro(macro, headers) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦ãƒžã‚¯ãƒ­macroãŒå®šç¾©ã•
+ れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒžã‚¯ãƒ­ãŒå®šç¾©ã•れã¦ã„る時true
+ ã‚’è¿”ã™ï¼Ž
+
+have_library(lib, func) ::
+
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Ž
+ ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«è¿½åŠ ã—,trueã‚’è¿”ã™ï¼Ž
+
+find_library(lib, func, path...) ::
+
+ 関数funcを定義ã—ã¦ã„るライブラリlibã®å­˜åœ¨ã‚’ -Lpath を追加
+ ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ-llibã‚’$libsã«
+ 追加ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_func(func, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦é–¢æ•°funcã®å­˜åœ¨ã‚’ãƒã‚§
+ ックã™ã‚‹ï¼ŽfuncãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§
+ ã‚る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠ
+ ã事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{FUNC}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_var(var, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦å¤‰æ•°varã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒ
+ クã™ã‚‹ï¼ŽvarãŒæ¨™æº–ã§ã¯ãƒªãƒ³ã‚¯ã•れãªã„ライブラリ内ã®ã‚‚ã®ã§ã‚
+ る時ã«ã¯å…ˆã«have_libraryã§ãã®ãƒ©ã‚¤ãƒ–ラリをãƒã‚§ãƒƒã‚¯ã—ã¦ãŠã
+ 事.ãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{VAR}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_header(header) ::
+
+ ヘッダファイルã®å­˜åœ¨ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œ
+ プリプロセッサマクロ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+ (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
+
+find_header(header, path...) ::
+
+ ヘッダファイルheaderã®å­˜åœ¨ã‚’ -Ipath を追加ã—ãªãŒã‚‰ãƒã‚§ãƒƒã‚¯
+ ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_{HEADER_H}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+ (スラッシュやドットã¯ã‚¢ãƒ³ãƒ€ãƒ¼ã‚¹ã‚³ã‚¢ã«ç½®æ›ã•れる)
+
+have_struct_member(type, member[, header[, opt]]) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå®šç¾©ã•れ,
+ ãªãŠã‹ã¤ãƒ¡ãƒ³ãƒmemberãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«
+ æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ `HAVE_{TYPE}_{MEMBER}` ã‚’
+ 定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+have_type(type, header, opt) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’
+ ãƒã‚§ãƒƒã‚¯ã™ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `HAVE_TYPE_{TYPE}` を定義ã—,trueã‚’è¿”ã™ï¼Ž
+
+check_sizeof(type, header) ::
+
+ ヘッダファイルheaderをインクルードã—ã¦åž‹typeã®charå˜ä½ã‚µã‚¤
+ ズを調ã¹ã‚‹ï¼Žãƒã‚§ãƒƒã‚¯ã«æˆåŠŸã™ã‚‹ã¨ï¼Œãƒ—リプロセッサマクロ
+ `SIZEOF_{TYPE}` を定義ã—,ãã®ã‚µã‚¤ã‚ºã‚’è¿”ã™ï¼Žå®šç¾©ã•れã¦ã„ãª
+ ã„ã¨ãã¯nilã‚’è¿”ã™ï¼Ž
+
+create_makefile(target[, target_prefix]) ::
+
+ 拡張ライブラリ用ã®Makefileを生æˆã™ã‚‹ï¼Žã“ã®é–¢æ•°ã‚’呼ã°ãªã‘れ
+ ã°ãã®ãƒ©ã‚¤ãƒ–ラリã¯ã‚³ãƒ³ãƒ‘イルã•れãªã„.targetã¯ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«å
+ を表ã™ï¼Ž
+
+find_executable(command, path) ::
+
+ コマンドcommandã‚’File::PATH_SEPARATORã§åŒºåˆ‡ã‚‰ã‚ŒãŸãƒ‘スåã®
+ リストpathã‹ã‚‰æŽ¢ã™ï¼ŽpathãŒnilã¾ãŸã¯çœç•¥ã•れãŸå ´åˆã¯ï¼Œç’°å¢ƒ
+ 変数PATHã®å€¤ã‚’使用ã™ã‚‹ï¼Žå®Ÿè¡Œå¯èƒ½ãªã‚³ãƒžãƒ³ãƒ‰ãŒè¦‹ã¤ã‹ã£ãŸå ´åˆ
+ ã¯ãƒ‘スをå«ã‚€ãƒ•ァイルå,見ã¤ã‹ã‚‰ãªã‹ã£ãŸå ´åˆã¯nilã‚’è¿”ã™ï¼Ž
+
+with_config(withval[, default=nil]) ::
+
+ コマンドライン上ã®--with-<withval>ã§æŒ‡å®šã•れãŸã‚ªãƒ—ション値
+ を得る.
+
+enable_config(config, *defaults) ::
+disable_config(config, *defaults) ::
+
+ コマンドライン上ã®--enable-<config>ã¾ãŸã¯
+ --disable-<config>ã§æŒ‡å®šã•れãŸçœŸå½å€¤ã‚’得る.
+ --enable-<config>ãŒæŒ‡å®šã•れã¦ã„ãŸå ´åˆã¯true,
+ --disable-<config>ãŒæŒ‡å®šã•れã¦ã„ãŸå ´åˆã¯falseã‚’è¿”ã™ï¼Ž
+ ã©ã¡ã‚‰ã‚‚指定ã•れã¦ã„ãªã„å ´åˆã¯ï¼Œãƒ–ロックã¤ãã§å‘¼ã³å‡ºã•れã¦
+ ã„ã‚‹å ´åˆã¯*defaultsã‚’yieldã—ãŸçµæžœï¼Œãƒ–ロックãªã—ãªã‚‰
+ *defaultsã‚’è¿”ã™ï¼Ž
+
+dir_config(target[, default_dir]) ::
+dir_config(target[, default_include, default_lib]) ::
+
+ コマンドライン上ã®--with-<target>-dir, --with-<target>-include,
+ --with-<target>-libã®ã„ãšã‚Œã‹ã§æŒ‡å®šã•れるディレクトリを
+ $CFLAGS ã‚„ $LDFLAGS ã«è¿½åŠ ã™ã‚‹ï¼Ž--with-<target>-dir=/pathã¯
+ --with-<target>-include=/path/include --with-<target>-lib=/path/lib
+ ã¨ç­‰ä¾¡ã§ã‚る.追加ã•れ㟠include ディレクトリ㨠lib ディレ
+ クトリã®é…列を返ã™ï¼Ž ([include_dir, lib_dir])
+
+pkg_config(pkg, option=nil) ::
+
+ pkg-configコマンドã‹ã‚‰ãƒ‘ッケージpkgã®æƒ…報を [cflags, ldflags, libs]
+ ã®é…列ã¨ã—ã¦å¾—る.$CFLAGS, $LDFLAGS, $libs ã«ã¯ãれãžã‚Œã®å€¤ãŒ
+ 追加ã•れる.
+
+ pkg-configã®å®Ÿéš›ã®ã‚³ãƒžãƒ³ãƒ‰ã¯ï¼Œä»¥ä¸‹ã®é †ã§è©¦ã•れる.
+
+ 1. コマンドラインã§--with-{pkg}-config={command}オプションãŒ
+ 指定ã•れãŸå ´åˆ: {command} {option}
+ 2. {pkg}-config {option}
+ 3. pkg-config {option} {pkg}
+
+ optionãŒæŒ‡å®šã•れãŸå ´åˆã¯ï¼Œä¸Šè¨˜ã®é…列ã®ä»£ã‚りã«ãã®ã‚ªãƒ—ションを
+ 指定ã—ã¦å¾—られãŸå‡ºåŠ›ã‚’stripã—ãŸã‚‚ã®ã‚’è¿”ã™ï¼Ž
+
+= Appendix D. 世代別GC
+
+Ruby 2.1ã‹ã‚‰ä¸–代別GCã«å¯¾å¿œã—ã¾ã—ãŸï¼Žæˆ‘々ã¯ã“れをRGenGCã¨å‘¼ã‚“ã§ã„ã¾ã™ï¼Ž
+RGenGCã¯ï¼ŒéŽåŽ»ã®æ‹¡å¼µãƒ©ã‚¤ãƒ–ラリã«ï¼ˆã»ã¼ï¼‰äº’æ›æ€§ã‚’ä¿ã¤ã‚ˆã†ã«é–‹ç™ºã•れã¦ã„ã‚‹
+ãŸã‚,拡張ライブラリå´ã®å¯¾å¿œã¯ã»ã¼ä¸è¦ã§ã™ï¼Ž
+
+ãŸã ã—,対応をã™ã‚‹ã“ã¨ã§æ€§èƒ½ã‚’å‘上ã™ã‚‹ã“ã¨ãŒã§ãã‚‹å¯èƒ½æ€§ãŒã‚りã¾ã™ï¼Žã‚‚ã—
+拡張ライブラリã«é«˜ã„性能ãŒå¿…è¦ã§ã‚ã‚‹å ´åˆã¯å¯¾å¿œã‚’検討ã—ã¦ä¸‹ã•ã„.
+
+ã¨ãã«RARRAY_PTR()/RHASH_TBL()ã®ã‚ˆã†ãªãƒžã‚¯ãƒ­ã‚’用ã„ã¦ãƒã‚¤ãƒ³ã‚¿ã«ç›´æŽ¥ã‚¢ã‚¯ã‚»
+スã™ã‚‹ã‚ˆã†ãªã‚³ãƒ¼ãƒ‰ã¯æ›¸ã‹ãªã„よã†ã«ã—ã¦ä¸‹ã•ã„.代ã‚りã«ï¼Œrb_ary_aref(),
+rb_ary_store() ãªã©ã®ï¼Œé©åˆ‡ãª API 関数を利用ã™ã‚‹ã‚ˆã†ã«ã—ã¦ä¸‹ã•ã„.
+
+ãã®ã»ã‹ï¼Œå¯¾å¿œã«ã¤ã„ã¦ã®è©³ç´°ã¯ README.EXT ã®ã€ŒAppendix D. Generational
+GCã€ã‚’å‚ç…§ã—ã¦ä¸‹ã•ã„.
+
+/*
+ * Local variables:
+ * fill-column: 60
+ * end:
+ */
diff --git a/README.ja.md b/README.ja.md
index 4e1e6b9d87..1e9bae7e0c 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -1,11 +1,3 @@
-[![Build Status](https://travis-ci.org/ruby/ruby.svg?branch=master)](https://travis-ci.org/ruby/ruby)
-[![Build status](https://ci.appveyor.com/api/projects/status/0sy8rrxut4o0k960/branch/master?svg=true)](https://ci.appveyor.com/project/ruby/ruby/branch/master)
-![](https://github.com/ruby/ruby/workflows/Cygwin/badge.svg)
-![](https://github.com/ruby/ruby/workflows/macOS/badge.svg)
-![](https://github.com/ruby/ruby/workflows/MJIT/badge.svg)
-![](https://github.com/ruby/ruby/workflows/Ubuntu/badge.svg)
-![](https://github.com/ruby/ruby/workflows/Windows/badge.svg)
-
# Rubyã¨ã¯
Rubyã¯ã‚·ãƒ³ãƒ—ルã‹ã¤å¼·åŠ›ãªã‚ªãƒ–ジェクト指å‘スクリプト言語ã§ã™ï¼Ž Rubyã¯ç´”粋ãªã‚ªãƒ–ジェクト指å‘言語ã¨ã—ã¦è¨­è¨ˆã•れã¦ã„ã‚‹ã®ã§ï¼Œ
@@ -18,60 +10,52 @@ Rubyã¯ãƒ†ã‚­ã‚¹ãƒˆå‡¦ç†é–¢ä¿‚ã®èƒ½åŠ›ãªã©ã«å„ªã‚Œï¼ŒPerlã¨åŒã˜ãらã„
* ã‚·ãƒ³ãƒ—ãƒ«ãªæ–‡æ³•
* 普通ã®ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(クラス,メソッドコールãªã©)
-* 特殊ãªã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(Mixin,特異メソッドãªã©)
+* 特殊ãªã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆæŒ‡å‘æ©Ÿèƒ½(Mixin, 特異メソッドãªã©)
* 演算å­ã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰
* ä¾‹å¤–å‡¦ç†æ©Ÿèƒ½
* イテレータã¨ã‚¯ãƒ­ãƒ¼ã‚¸ãƒ£
* ガーベージコレクタ
* ダイナミックローディング (アーキテクãƒãƒ£ã«ã‚ˆã‚‹)
-* ç§»æ¤æ€§ãŒé«˜ã„.多ãã®Unix-like/POSIX互æ›ãƒ—ラットフォーム上ã§å‹•ãã ã‘ã§ãªã,Windows, macOS,
- Haikuãªã©ã®ä¸Šã§ã‚‚å‹•ã cf.
- https://github.com/ruby/ruby/blob/master/doc/contributing.rdoc#platform-maintainers
+* ç§»æ¤æ€§ãŒé«˜ã„.多ãã®Unix-like/POSIX互æ›ãƒ—ラットフォーム上ã§å‹•ãã ã‘ã§ãªã,Windows, Mac OS
+ X,BeOSãªã©ã®ä¸Šã§ã‚‚å‹•ã cf.
+ http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
## 入手法
-サードパーティーツールを使ã£ãŸæ–¹æ³•ã‚’å«ã‚€Rubyã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«æ–¹æ³•ã®ä¸€è¦§ã¯
-
-https://www.ruby-lang.org/ja/downloads/
-
-ã‚’å‚ç…§ã—ã¦ãã ã•ã„.
+### FTPã§
-### Git
+以下ã®å ´æ‰€ã«ãŠã„ã¦ã‚りã¾ã™ï¼Ž
-ミラーをGitHubã«å…¬é–‹ã—ã¦ã„ã¾ã™ï¼Ž 以下ã®ã‚³ãƒžãƒ³ãƒ‰ã§ãƒªãƒã‚¸ãƒˆãƒªã‚’å–å¾—ã§ãã¾ã™ï¼Ž
+ftp://ftp.ruby-lang.org/pub/ruby/
- $ git clone https://github.com/ruby/ruby.git
+### Subversionã§
-ä»–ã®ãƒ–ランãƒã®ä¸€è¦§ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§è¦‹ã‚‰ã‚Œã¾ã™ï¼Ž
+開発先端ã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§å–å¾—ã§ãã¾ã™ï¼Ž
- $ git ls-remote https://github.com/ruby/ruby.git
+ $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-Rubyリãƒã‚¸ãƒˆãƒªã®æœ¬æ¥ã®master㯠https://git.ruby-lang.org/ruby.git ã«ã‚りã¾ã™ï¼Ž
-コミッタã¯ã“ã¡ã‚‰ã‚’使ã„ã¾ã™ï¼Ž
-
-### Subversion
-
-å¤ã„Rubyã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§å–å¾—ã§ãã¾ã™ï¼Ž
+ä»–ã«é–‹ç™ºä¸­ã®ãƒ–ランãƒã®ä¸€è¦§ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§è¦‹ã‚‰ã‚Œã¾ã™ï¼Ž
- $ svn co https://svn.ruby-lang.org/repos/ruby/branches/ruby_2_6/ ruby
+ $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
-ä»–ã«é–‹ç™ºä¸­ã®ãƒ–ランãƒã®ä¸€è¦§ã¯æ¬¡ã®ã‚³ãƒžãƒ³ãƒ‰ã§è¦‹ã‚‰ã‚Œã¾ã™ï¼Ž
+### Gitã§
- $ svn ls https://svn.ruby-lang.org/repos/ruby/branches/
+Subversionã®ãƒŸãƒ©ãƒ¼ã‚’GitHubã«å…¬é–‹ã—ã¦ã„ã¾ã™ï¼Ž 以下ã®ã‚³ãƒžãƒ³ãƒ‰ã§ãƒªãƒã‚¸ãƒˆãƒªã‚’å–å¾—ã§ãã¾ã™ï¼Ž
+ $ git clone git://github.com/ruby/ruby.git
## ホームページ
Rubyã®ãƒ›ãƒ¼ãƒ ãƒšãƒ¼ã‚¸ã®URLã¯
-https://www.ruby-lang.org/
+http://www.ruby-lang.org/
ã§ã™ï¼Ž
## メーリングリスト
-Rubyã®ãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆãŒã‚りã¾ã™ï¼Žå‚åŠ å¸Œæœ›ã®æ–¹ã¯
+Rubyã®ãƒ¡ãƒ¼ãƒªãƒ³ã‚°ãƒªã‚¹ãƒˆãŒã‚りã¾ã™ã€‚å‚åŠ å¸Œæœ›ã®æ–¹ã¯
mailto:ruby-list-request@ruby-lang.org
@@ -79,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` ãªã©ã‚’生æˆã™ã‚‹
@@ -111,8 +95,7 @@ Ruby拡張モジュールã«ã¤ã„ã¦è©±ã—åˆã†ruby-extメーリングリスãƒ
`ext/Setup` ã«è¨˜è¿°ã—ãŸãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯é™çš„ã«ãƒªãƒ³ã‚¯ã•れã¾ã™ï¼Ž
ダイナミックローディングをサãƒãƒ¼ãƒˆã—ã¦ã„ãªã„アーキテクãƒãƒ£ã§ã¯ `Setup` ã®1行目ã®ã€Œ`option nodynamic`ã€ã¨ã„ã†è¡Œã®ã‚³
- メントを外ã™å¿…è¦ãŒã‚りã¾ã™ï¼Ž
- ã¾ãŸï¼Œã“ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã§æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’利用ã™ã‚‹ãŸã‚ã«ã¯ï¼Œã‚らã‹ã˜ã‚é™çš„ã«ãƒªãƒ³ã‚¯ã‚’ã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ï¼Ž
+ メントを外ã™å¿…è¦ãŒã‚りã¾ã™ï¼Žã¾ãŸï¼Œã“ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã§æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã‚’利用ã™ã‚‹ãŸã‚ã«ã¯ï¼Œã‚らã‹ã˜ã‚é™çš„ã«ãƒªãƒ³ã‚¯ã‚’ã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ï¼Ž
5. `make` を実行ã—ã¦ã‚³ãƒ³ãƒ‘イルã™ã‚‹
@@ -126,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`
@@ -161,25 +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 1e935095c6..c6498a8cca 100644
--- a/README.md
+++ b/README.md
@@ -1,91 +1,84 @@
-[![Build Status](https://travis-ci.org/ruby/ruby.svg?branch=master)](https://travis-ci.org/ruby/ruby)
-[![Build status](https://ci.appveyor.com/api/projects/status/0sy8rrxut4o0k960/branch/master?svg=true)](https://ci.appveyor.com/project/ruby/ruby/branch/master)
-![](https://github.com/ruby/ruby/workflows/Cygwin/badge.svg)
-![](https://github.com/ruby/ruby/workflows/macOS/badge.svg)
-![](https://github.com/ruby/ruby/workflows/MJIT/badge.svg)
-![](https://github.com/ruby/ruby/workflows/Ubuntu/badge.svg)
-![](https://github.com/ruby/ruby/workflows/Windows/badge.svg)
-
# What's Ruby
-Ruby is an interpreted object-oriented programming language often
-used for web development. It also offers many scripting features
-to process plain text and serialized files, or manage system tasks.
-It is simple, straightforward, and extensible.
+Ruby is the interpreted scripting language for quick and easy object-oriented
+programming. It has many features to process text files and to do system
+management tasks (as in Perl). It is simple, straight-forward, and
+extensible.
## Features of Ruby
* Simple Syntax
-* **Normal** Object-oriented Features (e.g. class, method calls)
-* **Advanced** Object-oriented Features (e.g. mix-in, singleton-method)
+* **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://github.com/ruby/ruby/blob/master/doc/contributing.rdoc#platform-maintainers
+ 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/
-
-### Git
+http://www.ruby-lang.org/en/downloads/
-The mirror of the Ruby source tree can be checked out with the following command:
+The Ruby distribution files can be found in the following FTP site:
- $ git clone https://github.com/ruby/ruby.git
+ftp://ftp.ruby-lang.org/pub/ruby/
-There are some other branches under development. Try the following command
-to see the list of branches:
+The trunk of the Ruby source tree can be checked out with the following
+command:
- $ git ls-remote https://github.com/ruby/ruby.git
+ $ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
-You may also want to use https://git.ruby-lang.org/ruby.git (actual master of Ruby source)
-if you are a committer.
+Or if you are using git then use the following command:
-### Subversion
+ $ git clone git://github.com/ruby/ruby.git
-Stable branches for older Ruby versions can be checked out with the following command:
+There are some other branches under development. Try the following command
+and see the list of branches:
- $ svn co https://svn.ruby-lang.org/repos/ruby/branches/ruby_2_6/ ruby
+ $ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
-Try the following command to see the list of branches:
+Or if you are using git then use the following command:
- $ svn ls https://svn.ruby-lang.org/repos/ruby/branches/
+ $ git ls-remote git://github.com/ruby/ruby.git
+## Ruby home-page
-## Ruby home page
+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 discuss 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
in the mail body (not subject) to the address
-[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org?subject=Join%20Ruby%20Mailing%20List&body=subscribe).
+<mailto:ruby-talk-request@ruby-lang.org>.
## How to compile and install
-1. If you want to use Microsoft Visual C++ to compile Ruby, read
- [win32/README.win32](win32/README.win32) instead of this document.
+This is what you need to do to compile and install Ruby:
+
+1. If you want to use Microsoft Visual C++ to compile ruby, read
+ win32/README.win32 instead of this document.
-2. If `./configure` does not exist or is older than `configure.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.
@@ -101,36 +94,31 @@ in the mail body (not subject) to the address
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`.
+ ruby works as it should (hopefully).
- If you want to install bundled gems, run `make update-gems` and
- `make extract-gems` before running `make install`.
+8. Run '`make install`'
-9. 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`
@@ -142,35 +130,32 @@ in the mail body (not subject) to the address
**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).
-
-Bugs should be reported at https://bugs.ruby-lang.org. Read [HowToReport] for more information.
-
-[HowToReport]: https://bugs.ruby-lang.org/projects/ruby/wiki/HowToReport
-
-## Contributing
+(http://www.ruby-lang.org/en/community/mailing-lists) or on websites like
+(http://stackoverflow.com).
-See the file [CONTRIBUTING.md](CONTRIBUTING.md)
+Bug reports should be filed at http://bugs.ruby-lang.org
## The Author
-Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.
+Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in
+1995.
-<matz@ruby-lang.org>
+<mailto:matz@ruby-lang.org>
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index ed7d14ef63..0000000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,47 +0,0 @@
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
-
-# Copyright (C) 1996-2018 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([tool/m4/_colorize_result_prepare.m4])
-m4_include([tool/m4/ac_msg_result.m4])
-m4_include([tool/m4/colorize_result.m4])
-m4_include([tool/m4/ruby_append_option.m4])
-m4_include([tool/m4/ruby_append_options.m4])
-m4_include([tool/m4/ruby_check_builtin_func.m4])
-m4_include([tool/m4/ruby_check_builtin_setjmp.m4])
-m4_include([tool/m4/ruby_check_printf_prefix.m4])
-m4_include([tool/m4/ruby_check_setjmp.m4])
-m4_include([tool/m4/ruby_check_signedness.m4])
-m4_include([tool/m4/ruby_check_sizeof.m4])
-m4_include([tool/m4/ruby_check_sysconf.m4])
-m4_include([tool/m4/ruby_cppoutfile.m4])
-m4_include([tool/m4/ruby_decl_attribute.m4])
-m4_include([tool/m4/ruby_default_arch.m4])
-m4_include([tool/m4/ruby_define_if.m4])
-m4_include([tool/m4/ruby_defint.m4])
-m4_include([tool/m4/ruby_dtrace_available.m4])
-m4_include([tool/m4/ruby_dtrace_postprocess.m4])
-m4_include([tool/m4/ruby_func_attribute.m4])
-m4_include([tool/m4/ruby_mingw32.m4])
-m4_include([tool/m4/ruby_prepend_option.m4])
-m4_include([tool/m4/ruby_prog_gnu_ld.m4])
-m4_include([tool/m4/ruby_replace_funcs.m4])
-m4_include([tool/m4/ruby_replace_type.m4])
-m4_include([tool/m4/ruby_rm_recursive.m4])
-m4_include([tool/m4/ruby_setjmp_type.m4])
-m4_include([tool/m4/ruby_stack_grow_direction.m4])
-m4_include([tool/m4/ruby_try_cflags.m4])
-m4_include([tool/m4/ruby_try_ldflags.m4])
-m4_include([tool/m4/ruby_type_attribute.m4])
-m4_include([tool/m4/ruby_universal_arch.m4])
-m4_include([tool/m4/ruby_werror_flag.m4])
diff --git a/addr2line.c b/addr2line.c
index 635194b96b..c8faf48d62 100644
--- a/addr2line.c
+++ b/addr2line.c
@@ -8,30 +8,14 @@
**********************************************************************/
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wgnu-empty-initializer"
-#pragma clang diagnostic ignored "-Wgcc-compat"
-#endif
-
#include "ruby/config.h"
-#include "ruby/defines.h"
#include "ruby/missing.h"
#include "addr2line.h"
#include <stdio.h>
#include <errno.h>
-#ifdef HAVE_LIBPROC_H
-#include <libproc.h>
-#endif
-
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#else
-#include "missing/stdbool.h"
-#endif
-
-#if defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H)
+#ifdef USE_ELF
#include <fcntl.h>
#include <limits.h>
@@ -44,11 +28,19 @@
#include <sys/stat.h>
#include <unistd.h>
+#ifdef __OpenBSD__
+#include <elf_abi.h>
+#else
+#include <elf.h>
+#endif
+
/* 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>
@@ -67,20 +59,24 @@ void *alloca();
# include <dlfcn.h>
#endif
-#ifdef HAVE_MACH_O_LOADER_H
-# include <crt_externs.h>
-# include <mach-o/fat.h>
-# include <mach-o/loader.h>
-# include <mach-o/nlist.h>
-# include <mach-o/stab.h>
-#endif
+#define DW_LNS_copy 0x01
+#define DW_LNS_advance_pc 0x02
+#define DW_LNS_advance_line 0x03
+#define DW_LNS_set_file 0x04
+#define DW_LNS_set_column 0x05
+#define DW_LNS_negate_stmt 0x06
+#define DW_LNS_set_basic_block 0x07
+#define DW_LNS_const_add_pc 0x08
+#define DW_LNS_fixed_advance_pc 0x09
+#define DW_LNS_set_prologue_end 0x0a /* DWARF3 */
+#define DW_LNS_set_epilogue_begin 0x0b /* DWARF3 */
+#define DW_LNS_set_isa 0x0c /* DWARF3 */
-#ifdef USE_ELF
-# ifdef __OpenBSD__
-# include <elf_abi.h>
-# else
-# include <elf.h>
-# endif
+/* Line number extended opcode name. */
+#define DW_LNE_end_sequence 0x01
+#define DW_LNE_set_address 0x02
+#define DW_LNE_define_file 0x03
+#define DW_LNE_set_discriminator 0x04 /* DWARF4 */
#ifndef ElfW
# if SIZEOF_VOIDP == 8
@@ -96,44 +92,13 @@ void *alloca();
# define ELF_ST_TYPE ELF32_ST_TYPE
# endif
#endif
-#endif
-
-#ifdef SHF_COMPRESSED
-# if defined(ELFCOMPRESS_ZLIB) && defined(HAVE_LIBZ)
- /* FreeBSD 11.0 lacks ELFCOMPRESS_ZLIB */
-# include <zlib.h>
-# define SUPPORT_COMPRESSED_DEBUG_LINE
-# endif
-#else /* compatibility with glibc < 2.22 */
-# define SHF_COMPRESSED 0
-#endif
-
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
-#define DW_LNS_copy 0x01
-#define DW_LNS_advance_pc 0x02
-#define DW_LNS_advance_line 0x03
-#define DW_LNS_set_file 0x04
-#define DW_LNS_set_column 0x05
-#define DW_LNS_negate_stmt 0x06
-#define DW_LNS_set_basic_block 0x07
-#define DW_LNS_const_add_pc 0x08
-#define DW_LNS_fixed_advance_pc 0x09
-#define DW_LNS_set_prologue_end 0x0a /* DWARF3 */
-#define DW_LNS_set_epilogue_begin 0x0b /* DWARF3 */
-#define DW_LNS_set_isa 0x0c /* DWARF3 */
+int kprintf(const char *fmt, ...);
-/* Line number extended opcode name. */
-#define DW_LNE_end_sequence 0x01
-#define DW_LNE_set_address 0x02
-#define DW_LNE_define_file 0x03
-#define DW_LNE_set_discriminator 0x04 /* DWARF4 */
-
-PRINTF_ARGS(static int kprintf(const char *fmt, ...), 1, 2);
-
-typedef struct line_info {
+typedef struct {
const char *dirname;
const char *filename;
const char *path; /* object path */
@@ -142,56 +107,19 @@ typedef struct line_info {
uintptr_t base_addr;
uintptr_t saddr;
const char *sname; /* function name */
-
- struct line_info *next;
} line_info_t;
-
-struct dwarf_section {
- char *ptr;
- size_t size;
- uint64_t flags;
-};
-
-typedef struct obj_info {
+typedef struct obj_info obj_info_t;
+struct obj_info {
const char *path; /* object path */
- char *mapped;
+ int fd;
+ void *mapped;
size_t mapped_size;
- void *uncompressed;
uintptr_t base_addr;
- uintptr_t vmaddr;
- struct dwarf_section debug_abbrev;
- struct dwarf_section debug_info;
- struct dwarf_section debug_line;
- struct dwarf_section debug_ranges;
- struct dwarf_section debug_str;
- struct obj_info *next;
-} obj_info_t;
-
-#define DWARF_SECTION_COUNT 5
-
-static struct dwarf_section *
-obj_dwarf_section_at(obj_info_t *obj, int n)
-{
- struct dwarf_section *ary[] = {
- &obj->debug_abbrev,
- &obj->debug_info,
- &obj->debug_line,
- &obj->debug_ranges,
- &obj->debug_str
- };
- if (n < 0 || DWARF_SECTION_COUNT <= n) {
- abort();
- }
- return ary[n];
-}
-
-struct debug_section_definition {
- const char *name;
- struct dwarf_section *dwarf;
+ obj_info_t *next;
};
/* Avoid consuming stack as this module may be used from signal handler */
-static char binary_filename[PATH_MAX + 1];
+static char binary_filename[PATH_MAX];
static unsigned long
uleb128(char **p)
@@ -251,7 +179,8 @@ get_nth_dirname(unsigned long dir, char *p)
}
static void
-fill_filename(int file, char *include_directories, char *filenames, line_info_t *line, obj_info_t *obj)
+fill_filename(int file, char *include_directories, char *filenames,
+ line_info_t *line)
{
int i;
char *p = filenames;
@@ -261,8 +190,8 @@ fill_filename(int file, char *include_directories, char *filenames, line_info_t
filename = p;
if (!*p) {
/* Need to output binary file name? */
- kprintf("Unexpected file number %d in %s at %tx\n",
- file, binary_filename, filenames - obj->mapped);
+ kprintf("Unexpected file number %d in %s\n",
+ file, binary_filename);
return;
}
while (*p) p++;
@@ -286,128 +215,100 @@ fill_line(int num_traces, void **traces, uintptr_t addr, int file, int line,
obj_info_t *obj, line_info_t *lines, int offset)
{
int i;
- addr += obj->base_addr - obj->vmaddr;
+ addr += obj->base_addr;
for (i = offset; i < num_traces; i++) {
uintptr_t a = (uintptr_t)traces[i];
/* We assume one line code doesn't result >100 bytes of native code.
We may want more reliable way eventually... */
if (addr < a && a < addr + 100) {
- fill_filename(file, include_directories, filenames, &lines[i], obj);
+ fill_filename(file, include_directories, filenames, &lines[i]);
lines[i].line = line;
}
}
}
-struct LineNumberProgramHeader {
- uint64_t unit_length;
- uint16_t version;
- uint8_t format; /* 4 or 8 */
- uint64_t header_length;
- uint8_t minimum_instruction_length;
- uint8_t maximum_operations_per_instruction;
- uint8_t default_is_stmt;
- int8_t line_base;
- uint8_t line_range;
- uint8_t opcode_base;
- /* uint8_t standard_opcode_lengths[opcode_base-1]; */
- const char *include_directories;
- const char *filenames;
- const char *cu_start;
- const char *cu_end;
-};
-
-static int
-parse_debug_line_header(const char **pp, struct LineNumberProgramHeader *header)
+static void
+parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
+ obj_info_t *obj, line_info_t *lines, int offset)
{
- const char *p = *pp;
- header->unit_length = *(uint32_t *)p;
- p += sizeof(uint32_t);
-
- header->format = 4;
- if (header->unit_length == 0xffffffff) {
- header->unit_length = *(uint64_t *)p;
- p += sizeof(uint64_t);
- header->format = 8;
+ char *p, *cu_end, *cu_start, *include_directories, *filenames;
+ unsigned long unit_length;
+ int default_is_stmt, line_base;
+ unsigned int header_length, minimum_instruction_length, line_range,
+ opcode_base;
+ /* unsigned char *standard_opcode_lengths; */
+
+ /* The registers. */
+ unsigned long addr = 0;
+ unsigned int file = 1;
+ unsigned int line = 1;
+ /* unsigned int column = 0; */
+ int is_stmt;
+ /* int basic_block = 0; */
+ /* int end_sequence = 0; */
+ /* int prologue_end = 0; */
+ /* int epilogue_begin = 0; */
+ /* unsigned int isa = 0; */
+
+ p = *debug_line;
+
+ unit_length = *(unsigned int *)p;
+ p += sizeof(unsigned int);
+ if (unit_length == 0xffffffff) {
+ unit_length = *(unsigned long *)p;
+ p += sizeof(unsigned long);
}
- header->cu_end = p + header->unit_length;
+ cu_end = p + unit_length;
- header->version = *(uint16_t *)p;
- p += sizeof(uint16_t);
- if (header->version > 4) return -1;
+ /*dwarf_version = *(unsigned short *)p;*/
+ p += 2;
- header->header_length = header->format == 4 ? *(uint32_t *)p : *(uint64_t *)p;
- p += header->format;
- header->cu_start = p + header->header_length;
+ header_length = *(unsigned int *)p;
+ p += sizeof(unsigned int);
- header->minimum_instruction_length = *(uint8_t *)p++;
+ cu_start = p + header_length;
- if (header->version >= 4) {
- /* maximum_operations_per_instruction = *(uint8_t *)p; */
- if (*p != 1) return -1; /* For non-VLIW architectures, this field is 1 */
- p++;
- }
+ minimum_instruction_length = *(unsigned char *)p;
+ p++;
- header->default_is_stmt = *(uint8_t *)p++;
- header->line_base = *(int8_t *)p++;
- header->line_range = *(uint8_t *)p++;
- header->opcode_base = *(uint8_t *)p++;
- /* header->standard_opcode_lengths = (uint8_t *)p - 1; */
- p += header->opcode_base - 1;
+ is_stmt = default_is_stmt = *(unsigned char *)p;
+ p++;
- header->include_directories = p;
+ line_base = *(signed char *)p;
+ p++;
+
+ line_range = *(unsigned char *)p;
+ p++;
+
+ opcode_base = *(unsigned char *)p;
+ p++;
+
+ /* standard_opcode_lengths = (unsigned char *)p - 1; */
+ p += opcode_base - 1;
- /* temporary measure for compress-debug-sections */
- if (p >= header->cu_end) return -1;
+ include_directories = p;
/* skip include directories */
while (*p) {
- p = memchr(p, '\0', header->cu_end - p);
- if (!p) return -1;
+ while (*p) p++;
p++;
}
p++;
- header->filenames = p;
-
- *pp = header->cu_start;
-
- return 0;
-}
-
-static int
-parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
- obj_info_t *obj, line_info_t *lines, int offset)
-{
- const char *p = (const char *)*debug_line;
- struct LineNumberProgramHeader header;
-
- /* The registers. */
- unsigned long addr = 0;
- unsigned int file = 1;
- unsigned int line = 1;
- /* unsigned int column = 0; */
- int is_stmt;
- /* int basic_block = 0; */
- /* int end_sequence = 0; */
- /* int prologue_end = 0; */
- /* int epilogue_begin = 0; */
- /* unsigned int isa = 0; */
+ filenames = p;
- if (parse_debug_line_header(&p, &header))
- return -1;
- is_stmt = header.default_is_stmt;
+ p = cu_start;
#define FILL_LINE() \
do { \
fill_line(num_traces, traces, addr, file, line, \
- (char *)header.include_directories, \
- (char *)header.filenames, \
+ include_directories, filenames, \
obj, lines, offset); \
/*basic_block = prologue_end = epilogue_begin = 0;*/ \
} while (0)
- while (p < header.cu_end) {
+ while (p < cu_end) {
unsigned long a;
unsigned char op = *p++;
switch (op) {
@@ -415,19 +316,19 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
FILL_LINE();
break;
case DW_LNS_advance_pc:
- a = uleb128((char **)&p);
+ a = uleb128(&p);
addr += a;
break;
case DW_LNS_advance_line: {
- long a = sleb128((char **)&p);
+ long a = sleb128(&p);
line += a;
break;
}
case DW_LNS_set_file:
- file = (unsigned int)uleb128((char **)&p);
+ file = (unsigned int)uleb128(&p);
break;
case DW_LNS_set_column:
- /*column = (unsigned int)*/(void)uleb128((char **)&p);
+ /*column = (unsigned int)*/(void)uleb128(&p);
break;
case DW_LNS_negate_stmt:
is_stmt = !is_stmt;
@@ -436,8 +337,8 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
/*basic_block = 1; */
break;
case DW_LNS_const_add_pc:
- a = ((255UL - header.opcode_base) / header.line_range) *
- header.minimum_instruction_length;
+ a = ((255 - opcode_base) / line_range) *
+ minimum_instruction_length;
addr += a;
break;
case DW_LNS_fixed_advance_pc:
@@ -451,7 +352,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
/* epilogue_begin = 1; */
break;
case DW_LNS_set_isa:
- /* isa = (unsigned int)*/(void)uleb128((char **)&p);
+ /* isa = (unsigned int)*/(void)uleb128(&p);
break;
case 0:
a = *(unsigned char *)p++;
@@ -464,7 +365,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
file = 1;
line = 1;
/* column = 0; */
- is_stmt = header.default_is_stmt;
+ is_stmt = default_is_stmt;
/* end_sequence = 0; */
/* isa = 0; */
break;
@@ -478,7 +379,7 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
break;
case DW_LNE_set_discriminator:
/* TODO:currently ignore */
- uleb128((char **)&p);
+ uleb128(&p);
break;
default:
kprintf("Unknown extended opcode: %d in %s\n",
@@ -486,34 +387,33 @@ parse_debug_line_cu(int num_traces, void **traces, char **debug_line,
}
break;
default: {
- uint8_t adjusted_opcode = op - header.opcode_base;
- uint8_t operation_advance = adjusted_opcode / header.line_range;
- /* NOTE: this code doesn't support VLIW */
- addr += operation_advance * header.minimum_instruction_length;
- line += header.line_base + (adjusted_opcode % header.line_range);
+ unsigned long addr_incr;
+ unsigned long line_incr;
+ a = op - opcode_base;
+ addr_incr = (a / line_range) * minimum_instruction_length;
+ line_incr = line_base + (a % line_range);
+ addr += (unsigned int)addr_incr;
+ line += (unsigned int)line_incr;
FILL_LINE();
}
}
}
- *debug_line = (char *)p;
- return 0;
+ *debug_line = p;
}
-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 */
@@ -522,26 +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;
}
-#ifdef USE_ELF
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) {
@@ -549,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;
@@ -563,1051 +457,6 @@ follow_debuglink(const char *debuglink, int num_traces, void **traces,
o2->path = o1->path;
fill_lines(num_traces, traces, 0, objp, lines, offset);
}
-#endif
-
-enum
-{
- DW_TAG_compile_unit = 0x11,
- DW_TAG_inlined_subroutine = 0x1d,
- DW_TAG_subprogram = 0x2e,
-};
-
-/* Attributes encodings */
-enum
-{
- DW_AT_sibling = 0x01,
- DW_AT_location = 0x02,
- DW_AT_name = 0x03,
- /* Reserved 0x04 */
- /* Reserved 0x05 */
- /* Reserved 0x06 */
- /* Reserved 0x07 */
- /* Reserved 0x08 */
- DW_AT_ordering = 0x09,
- /* Reserved 0x0a */
- DW_AT_byte_size = 0x0b,
- /* Reserved 0x0c */
- DW_AT_bit_size = 0x0d,
- /* Reserved 0x0e */
- /* Reserved 0x0f */
- DW_AT_stmt_list = 0x10,
- DW_AT_low_pc = 0x11,
- DW_AT_high_pc = 0x12,
- DW_AT_language = 0x13,
- /* Reserved 0x14 */
- DW_AT_discr = 0x15,
- DW_AT_discr_value = 0x16,
- DW_AT_visibility = 0x17,
- DW_AT_import = 0x18,
- DW_AT_string_length = 0x19,
- DW_AT_common_reference = 0x1a,
- DW_AT_comp_dir = 0x1b,
- DW_AT_const_value = 0x1c,
- DW_AT_containing_type = 0x1d,
- DW_AT_default_value = 0x1e,
- /* Reserved 0x1f */
- DW_AT_inline = 0x20,
- DW_AT_is_optional = 0x21,
- DW_AT_lower_bound = 0x22,
- /* Reserved 0x23 */
- /* Reserved 0x24 */
- DW_AT_producer = 0x25,
- /* Reserved 0x26 */
- DW_AT_prototyped = 0x27,
- /* Reserved 0x28 */
- /* Reserved 0x29 */
- DW_AT_return_addr = 0x2a,
- /* Reserved 0x2b */
- DW_AT_start_scope = 0x2c,
- /* Reserved 0x2d */
- DW_AT_bit_stride = 0x2e,
- DW_AT_upper_bound = 0x2f,
- /* Reserved 0x30 */
- DW_AT_abstract_origin = 0x31,
- DW_AT_accessibility = 0x32,
- DW_AT_address_class = 0x33,
- DW_AT_artificial = 0x34,
- DW_AT_base_types = 0x35,
- DW_AT_calling_convention = 0x36,
- DW_AT_count = 0x37,
- DW_AT_data_member_location = 0x38,
- DW_AT_decl_column = 0x39,
- DW_AT_decl_file = 0x3a,
- DW_AT_decl_line = 0x3b,
- DW_AT_declaration = 0x3c,
- DW_AT_discr_list = 0x3d,
- DW_AT_encoding = 0x3e,
- DW_AT_external = 0x3f,
- DW_AT_frame_base = 0x40,
- DW_AT_friend = 0x41,
- DW_AT_identifier_case = 0x42,
- /* Reserved 0x43 */
- DW_AT_namelist_item = 0x44,
- DW_AT_priority = 0x45,
- DW_AT_segment = 0x46,
- DW_AT_specification = 0x47,
- DW_AT_static_link = 0x48,
- DW_AT_type = 0x49,
- DW_AT_use_location = 0x4a,
- DW_AT_variable_parameter = 0x4b,
- DW_AT_virtuality = 0x4c,
- DW_AT_vtable_elem_location = 0x4d,
- DW_AT_allocated = 0x4e,
- DW_AT_associated = 0x4f,
- DW_AT_data_location = 0x50,
- DW_AT_byte_stride = 0x51,
- DW_AT_entry_pc = 0x52,
- DW_AT_use_UTF8 = 0x53,
- DW_AT_extension = 0x54,
- DW_AT_ranges = 0x55,
- DW_AT_trampoline = 0x56,
- DW_AT_call_column = 0x57,
- DW_AT_call_file = 0x58,
- DW_AT_call_line = 0x59,
- DW_AT_description = 0x5a,
- DW_AT_binary_scale = 0x5b,
- DW_AT_decimal_scale = 0x5c,
- DW_AT_small = 0x5d,
- DW_AT_decimal_sign = 0x5e,
- DW_AT_digit_count = 0x5f,
- DW_AT_picture_string = 0x60,
- DW_AT_mutable = 0x61,
- DW_AT_threads_scaled = 0x62,
- DW_AT_explicit = 0x63,
- DW_AT_object_pointer = 0x64,
- DW_AT_endianity = 0x65,
- DW_AT_elemental = 0x66,
- DW_AT_pure = 0x67,
- DW_AT_recursive = 0x68,
- DW_AT_signature = 0x69,
- DW_AT_main_subprogram = 0x6a,
- DW_AT_data_bit_offset = 0x6b,
- DW_AT_const_expr = 0x6c,
- DW_AT_enum_class = 0x6d,
- DW_AT_linkage_name = 0x6e,
- DW_AT_string_length_bit_size = 0x6f,
- DW_AT_string_length_byte_size = 0x70,
- DW_AT_rank = 0x71,
- DW_AT_str_offsets_base = 0x72,
- DW_AT_addr_base = 0x73,
- DW_AT_rnglists_base = 0x74,
- /* Reserved 0x75 */
- DW_AT_dwo_name = 0x76,
- DW_AT_reference = 0x77,
- DW_AT_rvalue_reference = 0x78,
- DW_AT_macros = 0x79,
- DW_AT_call_all_calls = 0x7a,
- DW_AT_call_all_source_calls = 0x7b,
- DW_AT_call_all_tail_calls = 0x7c,
- DW_AT_call_return_pc = 0x7d,
- DW_AT_call_value = 0x7e,
- DW_AT_call_origin = 0x7f,
- DW_AT_call_parameter = 0x80,
- DW_AT_call_pc = 0x81,
- DW_AT_call_tail_call = 0x82,
- DW_AT_call_target = 0x83,
- DW_AT_call_target_clobbered = 0x84,
- DW_AT_call_data_location = 0x85,
- DW_AT_call_data_value = 0x86,
- DW_AT_noreturn = 0x87,
- DW_AT_alignment = 0x88,
- DW_AT_export_symbols = 0x89,
- DW_AT_deleted = 0x8a,
- DW_AT_defaulted = 0x8b,
- DW_AT_loclists_base = 0x8c,
- DW_AT_lo_user = 0x2000,
- DW_AT_hi_user = 0x3fff
-};
-
-/* Attribute form encodings */
-enum
-{
- DW_FORM_addr = 0x01,
- /* Reserved 0x02 */
- DW_FORM_block2 = 0x03,
- DW_FORM_block4 = 0x04,
- DW_FORM_data2 = 0x05,
- DW_FORM_data4 = 0x06,
- DW_FORM_data8 = 0x07,
- DW_FORM_string = 0x08,
- DW_FORM_block = 0x09,
- DW_FORM_block1 = 0x0a,
- DW_FORM_data1 = 0x0b,
- DW_FORM_flag = 0x0c,
- DW_FORM_sdata = 0x0d,
- DW_FORM_strp = 0x0e,
- DW_FORM_udata = 0x0f,
- DW_FORM_ref_addr = 0x10,
- DW_FORM_ref1 = 0x11,
- DW_FORM_ref2 = 0x12,
- DW_FORM_ref4 = 0x13,
- DW_FORM_ref8 = 0x14,
- DW_FORM_ref_udata = 0x15,
- DW_FORM_indirect = 0x16,
- DW_FORM_sec_offset = 0x17,
- DW_FORM_exprloc = 0x18,
- DW_FORM_flag_present = 0x19,
- DW_FORM_strx = 0x1a,
- DW_FORM_addrx = 0x1b,
- DW_FORM_ref_sup4 = 0x1c,
- DW_FORM_strp_sup = 0x1d,
- DW_FORM_data16 = 0x1e,
- DW_FORM_line_strp = 0x1f,
- DW_FORM_ref_sig8 = 0x20,
- DW_FORM_implicit_const = 0x21,
- DW_FORM_loclistx = 0x22,
- DW_FORM_rnglistx = 0x23,
- DW_FORM_ref_sup8 = 0x24,
- DW_FORM_strx1 = 0x25,
- DW_FORM_strx2 = 0x26,
- DW_FORM_strx3 = 0x27,
- DW_FORM_strx4 = 0x28,
- DW_FORM_addrx1 = 0x29,
- DW_FORM_addrx2 = 0x2a,
- DW_FORM_addrx3 = 0x2b,
- DW_FORM_addrx4 = 0x2c
-};
-
-enum {
- VAL_none = 0,
- VAL_cstr = 1,
- VAL_data = 2,
- VAL_uint = 3,
- VAL_int = 4
-};
-
-# define ABBREV_TABLE_SIZE 256
-typedef struct {
- obj_info_t *obj;
- char *file;
- char *current_cu;
- uint64_t current_low_pc;
- char *debug_line_cu_end;
- char *debug_line_files;
- char *debug_line_directories;
- char *p;
- char *cu_end;
- char *pend;
- char *q0;
- char *q;
- int format; // 4 or 8
- uint8_t address_size;
- int level;
- char *abbrev_table[ABBREV_TABLE_SIZE];
-} DebugInfoReader;
-
-typedef struct {
- ptrdiff_t pos;
- int tag;
- int has_children;
-} DIE;
-
-typedef struct {
- union {
- char *ptr;
- uint64_t uint64;
- int64_t int64;
- } as;
- uint64_t off;
- uint64_t at;
- uint64_t form;
- size_t size;
- int type;
-} DebugInfoValue;
-
-/* TODO: Big Endian */
-#define MERGE_2INTS(a,b,sz) (((uint64_t)(b)<<sz)|(a))
-
-static uint16_t
-get_uint16(const uint8_t *p)
-{
- return (uint16_t)MERGE_2INTS(p[0],p[1],8);
-}
-
-static uint32_t
-get_uint32(const uint8_t *p)
-{
- return (uint32_t)MERGE_2INTS(get_uint16(p),get_uint16(p+2),16);
-}
-
-static uint64_t
-get_uint64(const uint8_t *p)
-{
- return MERGE_2INTS(get_uint32(p),get_uint32(p+4),32);
-}
-
-static uint8_t
-read_uint8(char **ptr)
-{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 1);
- return *p;
-}
-
-static uint16_t
-read_uint16(char **ptr)
-{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 2);
- return get_uint16(p);
-}
-
-static uint32_t
-read_uint24(char **ptr)
-{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 3);
- return (*p << 16) | get_uint16(p+1);
-}
-
-static uint32_t
-read_uint32(char **ptr)
-{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 4);
- return get_uint32(p);
-}
-
-static uint64_t
-read_uint64(char **ptr)
-{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + 8);
- return get_uint64(p);
-}
-
-static uintptr_t
-read_uintptr(char **ptr)
-{
- const unsigned char *p = (const unsigned char *)*ptr;
- *ptr = (char *)(p + SIZEOF_VOIDP);
-#if SIZEOF_VOIDP == 8
- return get_uint64(p);
-#else
- return get_uint32(p);
-#endif
-}
-
-static uint64_t
-read_uint(DebugInfoReader *reader)
-{
- if (reader->format == 4) {
- return read_uint32(&reader->p);
- } else { /* 64 bit */
- return read_uint64(&reader->p);
- }
-}
-
-static uint64_t
-read_uleb128(DebugInfoReader *reader)
-{
- return uleb128(&reader->p);
-}
-
-static int64_t
-read_sleb128(DebugInfoReader *reader)
-{
- return sleb128(&reader->p);
-}
-
-static void
-debug_info_reader_init(DebugInfoReader *reader, obj_info_t *obj)
-{
- reader->file = obj->mapped;
- reader->obj = obj;
- reader->p = obj->debug_info.ptr;
- reader->pend = obj->debug_info.ptr + obj->debug_info.size;
- reader->debug_line_cu_end = obj->debug_line.ptr;
-}
-
-static void
-di_read_debug_abbrev_cu(DebugInfoReader *reader)
-{
- uint64_t prev = 0;
- char *p = reader->q0;
- for (;;) {
- uint64_t abbrev_number = uleb128(&p);
- if (abbrev_number <= prev) break;
- if (abbrev_number < ABBREV_TABLE_SIZE) {
- reader->abbrev_table[abbrev_number] = p;
- }
- prev = abbrev_number;
- uleb128(&p); /* tag */
- p++; /* has_children */
- /* skip content */
- for (;;) {
- uint64_t at = uleb128(&p);
- uint64_t form = uleb128(&p);
- if (!at && !form) break;
- }
- }
-}
-
-static int
-di_read_debug_line_cu(DebugInfoReader *reader)
-{
- const char *p;
- struct LineNumberProgramHeader header;
-
- p = (const char *)reader->debug_line_cu_end;
- if (parse_debug_line_header(&p, &header))
- return -1;
-
- reader->debug_line_cu_end = (char *)header.cu_end;
- reader->debug_line_directories = (char *)header.include_directories;
- reader->debug_line_files = (char *)header.filenames;
-
- return 0;
-}
-
-static void
-set_uint_value(DebugInfoValue *v, uint64_t n)
-{
- v->as.uint64 = n;
- v->type = VAL_uint;
-}
-
-static void
-set_int_value(DebugInfoValue *v, int64_t n)
-{
- v->as.int64 = n;
- v->type = VAL_int;
-}
-
-static void
-set_cstr_value(DebugInfoValue *v, char *s)
-{
- v->as.ptr = s;
- v->off = 0;
- v->type = VAL_cstr;
-}
-
-static void
-set_cstrp_value(DebugInfoValue *v, char *s, uint64_t off)
-{
- v->as.ptr = s;
- v->off = off;
- v->type = VAL_cstr;
-}
-
-static void
-set_data_value(DebugInfoValue *v, char *s)
-{
- v->as.ptr = s;
- v->type = VAL_data;
-}
-
-static const char *
-get_cstr_value(DebugInfoValue *v)
-{
- if (v->as.ptr) {
- return v->as.ptr + v->off;
- } else {
- return NULL;
- }
-}
-
-static void
-debug_info_reader_read_value(DebugInfoReader *reader, uint64_t form, DebugInfoValue *v)
-{
- switch (form) {
- case DW_FORM_addr:
- if (reader->address_size == 4) {
- set_uint_value(v, read_uint32(&reader->p));
- } else if (reader->address_size == 8) {
- set_uint_value(v, read_uint64(&reader->p));
- } else {
- fprintf(stderr,"unknown address_size:%d", reader->address_size);
- abort();
- }
- break;
- case DW_FORM_block2:
- v->size = read_uint16(&reader->p);
- set_data_value(v, reader->p);
- reader->p += v->size;
- break;
- case DW_FORM_block4:
- v->size = read_uint32(&reader->p);
- set_data_value(v, reader->p);
- reader->p += v->size;
- break;
- case DW_FORM_data2:
- set_uint_value(v, read_uint16(&reader->p));
- break;
- case DW_FORM_data4:
- set_uint_value(v, read_uint32(&reader->p));
- break;
- case DW_FORM_data8:
- set_uint_value(v, read_uint64(&reader->p));
- break;
- case DW_FORM_string:
- v->size = strlen(reader->p);
- set_cstr_value(v, reader->p);
- reader->p += v->size + 1;
- break;
- case DW_FORM_block:
- v->size = uleb128(&reader->p);
- set_data_value(v, reader->p);
- reader->p += v->size;
- break;
- case DW_FORM_block1:
- v->size = read_uint8(&reader->p);
- set_data_value(v, reader->p);
- reader->p += v->size;
- break;
- case DW_FORM_data1:
- set_uint_value(v, read_uint8(&reader->p));
- break;
- case DW_FORM_flag:
- set_uint_value(v, read_uint8(&reader->p));
- break;
- case DW_FORM_sdata:
- set_int_value(v, read_sleb128(reader));
- break;
- case DW_FORM_strp:
- set_cstrp_value(v, reader->obj->debug_str.ptr, read_uint(reader));
- break;
- case DW_FORM_udata:
- set_uint_value(v, read_uleb128(reader));
- break;
- case DW_FORM_ref_addr:
- if (reader->address_size == 4) {
- set_uint_value(v, read_uint32(&reader->p));
- } else if (reader->address_size == 8) {
- set_uint_value(v, read_uint64(&reader->p));
- } else {
- fprintf(stderr,"unknown address_size:%d", reader->address_size);
- abort();
- }
- break;
- case DW_FORM_ref1:
- set_uint_value(v, read_uint8(&reader->p));
- break;
- case DW_FORM_ref2:
- set_uint_value(v, read_uint16(&reader->p));
- break;
- case DW_FORM_ref4:
- set_uint_value(v, read_uint32(&reader->p));
- break;
- case DW_FORM_ref8:
- set_uint_value(v, read_uint64(&reader->p));
- break;
- case DW_FORM_ref_udata:
- set_uint_value(v, uleb128(&reader->p));
- break;
- case DW_FORM_indirect:
- /* TODO: read the referred value */
- set_uint_value(v, uleb128(&reader->p));
- break;
- case DW_FORM_sec_offset:
- set_uint_value(v, read_uint(reader)); /* offset */
- /* addrptr: debug_addr */
- /* lineptr: debug_line */
- /* loclist: debug_loclists */
- /* loclistptr: debug_loclists */
- /* macptr: debug_macro */
- /* rnglist: debug_rnglists */
- /* rnglistptr: debug_rnglists */
- /* stroffsetsptr: debug_str_offsets */
- break;
- case DW_FORM_exprloc:
- v->size = (size_t)read_uleb128(reader);
- set_data_value(v, reader->p);
- reader->p += v->size;
- break;
- case DW_FORM_flag_present:
- set_uint_value(v, 1);
- break;
- case DW_FORM_strx:
- set_uint_value(v, uleb128(&reader->p));
- break;
- case DW_FORM_addrx:
- /* TODO: read .debug_addr */
- set_uint_value(v, uleb128(&reader->p));
- break;
- case DW_FORM_ref_sup4:
- set_uint_value(v, read_uint32(&reader->p));
- break;
- case DW_FORM_strp_sup:
- set_uint_value(v, read_uint(reader));
- /* *p = reader->sup_file + reader->sup_str->sh_offset + ret; */
- break;
- case DW_FORM_data16:
- v->size = 16;
- set_data_value(v, reader->p);
- reader->p += v->size;
- break;
- case DW_FORM_line_strp:
- set_uint_value(v, read_uint(reader));
- /* *p = reader->file + reader->line->sh_offset + ret; */
- break;
- case DW_FORM_ref_sig8:
- set_uint_value(v, read_uint64(&reader->p));
- break;
- case DW_FORM_implicit_const:
- set_int_value(v, sleb128(&reader->q));
- break;
- case DW_FORM_loclistx:
- set_uint_value(v, read_uleb128(reader));
- break;
- case DW_FORM_rnglistx:
- set_uint_value(v, read_uleb128(reader));
- break;
- case DW_FORM_ref_sup8:
- set_uint_value(v, read_uint64(&reader->p));
- break;
- case DW_FORM_strx1:
- set_uint_value(v, read_uint8(&reader->p));
- break;
- case DW_FORM_strx2:
- set_uint_value(v, read_uint16(&reader->p));
- break;
- case DW_FORM_strx3:
- set_uint_value(v, read_uint24(&reader->p));
- break;
- case DW_FORM_strx4:
- set_uint_value(v, read_uint32(&reader->p));
- break;
- case DW_FORM_addrx1:
- set_uint_value(v, read_uint8(&reader->p));
- break;
- case DW_FORM_addrx2:
- set_uint_value(v, read_uint16(&reader->p));
- break;
- case DW_FORM_addrx3:
- set_uint_value(v, read_uint24(&reader->p));
- break;
- case DW_FORM_addrx4:
- set_uint_value(v, read_uint32(&reader->p));
- break;
- case 0:
- goto fail;
- break;
- }
- return;
-
- fail:
- fprintf(stderr, "%d: unsupported form: %#"PRIx64"\n", __LINE__, form);
- exit(1);
-}
-
-/* find abbrev in current compilation unit */
-static char *
-di_find_abbrev(DebugInfoReader *reader, uint64_t abbrev_number)
-{
- char *p;
- if (abbrev_number < ABBREV_TABLE_SIZE) {
- return reader->abbrev_table[abbrev_number];
- }
- p = reader->abbrev_table[ABBREV_TABLE_SIZE-1];
- /* skip 255th record */
- uleb128(&p); /* tag */
- p++; /* has_children */
- /* skip content */
- for (;;) {
- uint64_t at = uleb128(&p);
- uint64_t form = uleb128(&p);
- if (!at && !form) break;
- }
- for (uint64_t n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
- if (n == 0) {
- fprintf(stderr,"%d: Abbrev Number %"PRId64" not found\n",__LINE__, abbrev_number);
- exit(1);
- }
- uleb128(&p); /* tag */
- p++; /* has_children */
- /* skip content */
- for (;;) {
- uint64_t at = uleb128(&p);
- uint64_t form = uleb128(&p);
- if (!at && !form) break;
- }
- }
- return p;
-}
-
-#if 0
-static void
-hexdump0(const unsigned char *p, size_t n)
-{
- size_t i;
- fprintf(stderr, " 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
- for (i=0; i < n; i++){
- switch (i & 15) {
- case 0:
- fprintf(stderr, "%02zd: %02X ", i/16, p[i]);
- break;
- case 15:
- fprintf(stderr, "%02X\n", p[i]);
- break;
- default:
- fprintf(stderr, "%02X ", p[i]);
- break;
- }
- }
- if ((i & 15) != 15) {
- fprintf(stderr, "\n");
- }
-}
-#define hexdump(p,n) hexdump0((const unsigned char *)p, n)
-
-static void
-div_inspect(DebugInfoValue *v)
-{
- switch (v->type) {
- case VAL_uint:
- fprintf(stderr,"%d: type:%d size:%zx v:%lx\n",__LINE__,v->type,v->size,v->as.uint64);
- break;
- case VAL_int:
- fprintf(stderr,"%d: type:%d size:%zx v:%ld\n",__LINE__,v->type,v->size,(int64_t)v->as.uint64);
- break;
- case VAL_cstr:
- fprintf(stderr,"%d: type:%d size:%zx v:'%s'\n",__LINE__,v->type,v->size,v->as.ptr);
- break;
- case VAL_data:
- fprintf(stderr,"%d: type:%d size:%zx v:\n",__LINE__,v->type,v->size);
- hexdump(v->as.ptr, 16);
- break;
- }
-}
-#endif
-
-static DIE *
-di_read_die(DebugInfoReader *reader, DIE *die)
-{
- uint64_t abbrev_number = uleb128(&reader->p);
- if (abbrev_number == 0) {
- reader->level--;
- return NULL;
- }
-
- reader->q = di_find_abbrev(reader, abbrev_number);
-
- die->pos = reader->p - reader->obj->debug_info.ptr - 1;
- die->tag = (int)uleb128(&reader->q); /* tag */
- die->has_children = *reader->q++; /* has_children */
- if (die->has_children) {
- reader->level++;
- }
- return die;
-}
-
-static DebugInfoValue *
-di_read_record(DebugInfoReader *reader, DebugInfoValue *vp)
-{
- uint64_t at = uleb128(&reader->q);
- uint64_t form = uleb128(&reader->q);
- if (!at || !form) return NULL;
- vp->at = at;
- vp->form = form;
- debug_info_reader_read_value(reader, form, vp);
- return vp;
-}
-
-static void
-di_skip_records(DebugInfoReader *reader)
-{
- for (;;) {
- DebugInfoValue v = {{}};
- uint64_t at = uleb128(&reader->q);
- uint64_t form = uleb128(&reader->q);
- if (!at || !form) return;
- debug_info_reader_read_value(reader, form, &v);
- }
-}
-
-typedef struct {
- uint64_t low_pc;
- uint64_t high_pc;
- uint64_t ranges;
- bool low_pc_set;
- bool high_pc_set;
- bool ranges_set;
-} ranges_t;
-
-static void
-ranges_set(ranges_t *ptr, DebugInfoValue *v)
-{
- switch (v->at) {
- case DW_AT_low_pc:
- ptr->low_pc = v->as.uint64;
- ptr->low_pc_set = true;
- break;
- case DW_AT_high_pc:
- if (v->form == DW_FORM_addr) {
- ptr->high_pc = v->as.uint64;
- }
- else {
- ptr->high_pc = ptr->low_pc + v->as.uint64;
- }
- ptr->high_pc_set = true;
- break;
- case DW_AT_ranges:
- ptr->ranges = v->as.uint64;
- ptr->ranges_set = true;
- break;
- }
-}
-
-static uintptr_t
-ranges_include(DebugInfoReader *reader, ranges_t *ptr, uint64_t addr)
-{
- if (ptr->high_pc_set) {
- if (ptr->ranges_set || !ptr->low_pc_set) {
- exit(1);
- }
- if (ptr->low_pc <= addr && addr <= ptr->high_pc) {
- return (uintptr_t)ptr->low_pc;
- }
- }
- else if (ptr->ranges_set) {
- /* TODO: support base address selection entry */
- char *p = reader->obj->debug_ranges.ptr + ptr->ranges;
- uint64_t base = ptr->low_pc_set ? ptr->low_pc : reader->current_low_pc;
- for (;;) {
- uintptr_t from = read_uintptr(&p);
- uintptr_t to = read_uintptr(&p);
- if (!from && !to) break;
- if (from == UINTPTR_MAX) {
- /* base address selection entry */
- base = to;
- }
- else if (base + from <= addr && addr < base + to) {
- return from;
- }
- }
- }
- else if (ptr->low_pc_set) {
- if (ptr->low_pc == addr) {
- return (uintptr_t)ptr->low_pc;
- }
- }
- return false;
-}
-
-#if 0
-static void
-ranges_inspect(DebugInfoReader *reader, ranges_t *ptr)
-{
- if (ptr->high_pc_set) {
- if (ptr->ranges_set || !ptr->low_pc_set) {
- fprintf(stderr,"low_pc_set:%d high_pc_set:%d ranges_set:%d\n",ptr->low_pc_set,ptr->high_pc_set,ptr->ranges_set);
- exit(1);
- }
- fprintf(stderr,"low_pc:%"PRIx64" high_pc:%"PRIx64"\n",ptr->low_pc,ptr->high_pc);
- }
- else if (ptr->ranges_set) {
- char *p = reader->obj->debug_ranges.ptr + ptr->ranges;
- fprintf(stderr,"low_pc:%"PRIx64" ranges:%"PRIx64" %lx ",ptr->low_pc,ptr->ranges, p-reader->obj->mapped);
- for (;;) {
- uintptr_t from = read_uintptr(&p);
- uintptr_t to = read_uintptr(&p);
- if (!from && !to) break;
- fprintf(stderr,"%"PRIx64"-%"PRIx64" ",ptr->low_pc+from,ptr->low_pc+to);
- }
- fprintf(stderr,"\n");
- }
- else if (ptr->low_pc_set) {
- fprintf(stderr,"low_pc:%"PRIx64"\n",ptr->low_pc);
- }
- else {
- fprintf(stderr,"empty\n");
- }
-}
-#endif
-
-static int
-di_read_cu(DebugInfoReader *reader)
-{
- uint64_t unit_length;
- uint16_t version;
- uint64_t debug_abbrev_offset;
- reader->format = 4;
- reader->current_cu = reader->p;
- unit_length = read_uint32(&reader->p);
- if (unit_length == 0xffffffff) {
- unit_length = read_uint64(&reader->p);
- reader->format = 8;
- }
- reader->cu_end = reader->p + unit_length;
- version = read_uint16(&reader->p);
- if (version > 5) {
- return -1;
- }
- else if (version == 5) {
- /* unit_type = */ read_uint8(&reader->p);
- reader->address_size = read_uint8(&reader->p);
- debug_abbrev_offset = read_uint(reader);
- }
- else {
- debug_abbrev_offset = read_uint(reader);
- reader->address_size = read_uint8(&reader->p);
- }
- reader->q0 = reader->obj->debug_abbrev.ptr + debug_abbrev_offset;
-
- reader->level = 0;
- di_read_debug_abbrev_cu(reader);
- if (di_read_debug_line_cu(reader)) return -1;
-
-#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER_BUILD_DATE)
- /* Though DWARF specifies "the applicable base address defaults to the base
- address of the compilation unit", but GCC seems to use zero as default */
-#else
- do {
- DIE die;
-
- if (!di_read_die(reader, &die)) continue;
-
- if (die.tag != DW_TAG_compile_unit) {
- di_skip_records(reader);
- break;
- }
-
- /* enumerate abbrev */
- for (;;) {
- DebugInfoValue v = {{}};
- if (!di_read_record(reader, &v)) break;
- switch (v.at) {
- case DW_AT_low_pc:
- reader->current_low_pc = v.as.uint64;
- break;
- }
- }
- } while (0);
-#endif
- return 0;
-}
-
-static void
-read_abstract_origin(DebugInfoReader *reader, uint64_t abstract_origin, line_info_t *line)
-{
- char *p = reader->p;
- char *q = reader->q;
- int level = reader->level;
- DIE die;
-
- reader->p = reader->current_cu + abstract_origin;
- if (!di_read_die(reader, &die)) goto finish;
-
- /* enumerate abbrev */
- for (;;) {
- DebugInfoValue v = {{}};
- if (!di_read_record(reader, &v)) break;
- switch (v.at) {
- case DW_AT_name:
- line->sname = get_cstr_value(&v);
- break;
- }
- }
-
- finish:
- reader->p = p;
- reader->q = q;
- reader->level = level;
-}
-
-static void
-debug_info_read(DebugInfoReader *reader, int num_traces, void **traces,
- line_info_t *lines, int offset) {
- while (reader->p < reader->cu_end) {
- DIE die;
- ranges_t ranges = {};
- line_info_t line = {};
-
- if (!di_read_die(reader, &die)) continue;
- /* fprintf(stderr,"%d:%tx: <%d>\n",__LINE__,die.pos,reader->level,die.tag); */
-
- if (die.tag != DW_TAG_subprogram && die.tag != DW_TAG_inlined_subroutine) {
- skip_die:
- di_skip_records(reader);
- continue;
- }
-
- /* enumerate abbrev */
- for (;;) {
- DebugInfoValue v = {{}};
- /* ptrdiff_t pos = reader->p - reader->p0; */
- if (!di_read_record(reader, &v)) break;
- /* fprintf(stderr,"\n%d:%tx: AT:%lx FORM:%lx\n",__LINE__,pos,v.at,v.form); */
- /* div_inspect(&v); */
- switch (v.at) {
- case DW_AT_name:
- line.sname = get_cstr_value(&v);
- break;
- case DW_AT_call_file:
- fill_filename((int)v.as.uint64, reader->debug_line_directories, reader->debug_line_files, &line, reader->obj);
- break;
- case DW_AT_call_line:
- line.line = (int)v.as.uint64;
- break;
- case DW_AT_low_pc:
- case DW_AT_high_pc:
- case DW_AT_ranges:
- ranges_set(&ranges, &v);
- break;
- case DW_AT_declaration:
- goto skip_die;
- case DW_AT_inline:
- /* 1 or 3 */
- break; /* goto skip_die; */
- case DW_AT_abstract_origin:
- read_abstract_origin(reader, v.as.uint64, &line);
- break; /* goto skip_die; */
- }
- }
- /* ranges_inspect(reader, &ranges); */
- /* fprintf(stderr,"%d:%tx: %x ",__LINE__,diepos,die.tag); */
- for (int i=offset; i < num_traces; i++) {
- uintptr_t addr = (uintptr_t)traces[i];
- uintptr_t offset = addr - reader->obj->base_addr + reader->obj->vmaddr;
- uintptr_t saddr = ranges_include(reader, &ranges, offset);
- if (saddr) {
- /* fprintf(stderr, "%d:%tx: %d %lx->%lx %x %s: %s/%s %d %s %s %s\n",__LINE__,die.pos, i,addr,offset, die.tag,line.sname,line.dirname,line.filename,line.line,reader->obj->path,line.sname,lines[i].sname); */
- if (lines[i].sname) {
- line_info_t *lp = malloc(sizeof(line_info_t));
- memcpy(lp, &lines[i], sizeof(line_info_t));
- lines[i].next = lp;
- lp->dirname = line.dirname;
- lp->filename = line.filename;
- lp->line = line.line;
- lp->saddr = 0;
- }
- lines[i].path = reader->obj->path;
- lines[i].base_addr = line.base_addr;
- lines[i].sname = line.sname;
- lines[i].saddr = saddr + reader->obj->base_addr - reader->obj->vmaddr;
- }
- }
- }
-}
-
-#ifdef USE_ELF
-static unsigned long
-uncompress_debug_section(ElfW(Shdr) *shdr, char *file, char **ptr)
-{
-#ifdef SUPPORT_COMPRESSED_DEBUG_LINE
- ElfW(Chdr) *chdr = (ElfW(Chdr) *)(file + shdr->sh_offset);
- unsigned long destsize = chdr->ch_size;
- int ret = 0;
-
- if (chdr->ch_type != ELFCOMPRESS_ZLIB) {
- /* unsupported compression type */
- return 0;
- }
-
- *ptr = malloc(destsize);
- if (!*ptr) return 0;
- ret = uncompress((Bytef *)*ptr, &destsize,
- (const Bytef*)chdr + sizeof(ElfW(Chdr)),
- shdr->sh_size - sizeof(ElfW(Chdr)));
- if (ret != Z_OK) goto fail;
- return destsize;
-
-fail:
- free(*ptr);
-#endif
- return 0;
-}
/* read file and fill lines */
static uintptr_t
@@ -1616,9 +465,10 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
{
int i, j;
char *shstr;
+ char *section_name;
ElfW(Ehdr) *ehdr;
ElfW(Shdr) *shdr, *shstr_shdr;
- ElfW(Shdr) *gnu_debuglink_shdr = NULL;
+ ElfW(Shdr) *debug_line_shdr = NULL, *gnu_debuglink_shdr = NULL;
int fd;
off_t filesize;
char *file;
@@ -1654,7 +504,6 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
kprintf("mmap: %s\n", strerror(e));
goto fail;
}
- close(fd);
ehdr = (ElfW(Ehdr) *)file;
if (memcmp(ehdr->e_ident, "\177ELF", 4) != 0) {
@@ -1662,8 +511,11 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
* Huh? Maybe filename was overridden by setproctitle() and
* it match non-elf file.
*/
+ close(fd);
goto fail;
}
+
+ obj->fd = fd;
obj->mapped = file;
obj->mapped_size = (size_t)filesize;
@@ -1673,7 +525,7 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
shstr = file + shstr_shdr->sh_offset;
for (i = 0; i < ehdr->e_shnum; i++) {
- char *section_name = shstr + shdr[i].sh_name;
+ section_name = shstr + shdr[i].sh_name;
switch (shdr[i].sh_type) {
case SHT_STRTAB:
if (!strcmp(section_name, ".strtab")) {
@@ -1692,34 +544,12 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
dynsym_shdr = shdr + i;
break;
case SHT_PROGBITS:
- if (!strcmp(section_name, ".gnu_debuglink")) {
+ if (!strcmp(section_name, ".debug_line")) {
+ debug_line_shdr = shdr + i;
+ }
+ else if (!strcmp(section_name, ".gnu_debuglink")) {
gnu_debuglink_shdr = shdr + i;
}
- else {
- const char *debug_section_names[] = {
- ".debug_abbrev",
- ".debug_info",
- ".debug_line",
- ".debug_ranges",
- ".debug_str"
- };
-
- for (j=0; j < DWARF_SECTION_COUNT; j++) {
- struct dwarf_section *s = obj_dwarf_section_at(obj, j);
-
- if (strcmp(section_name, debug_section_names[j]) != 0)
- continue;
-
- s->ptr = file + shdr[i].sh_offset;
- s->size = shdr[i].sh_size;
- s->flags = shdr[i].sh_flags;
- if (s->flags & SHF_COMPRESSED) {
- s->size = uncompress_debug_section(&shdr[i], file, &s->ptr);
- if (!s->size) goto fail;
- }
- break;
- }
- }
break;
}
}
@@ -1731,22 +561,20 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
char *strtab = file + dynstr_shdr->sh_offset;
ElfW(Sym) *symtab = (ElfW(Sym) *)(file + dynsym_shdr->sh_offset);
int symtab_count = (int)(dynsym_shdr->sh_size / sizeof(ElfW(Sym)));
- void *handle = dlopen(NULL, RTLD_NOW|RTLD_LOCAL);
- if (handle) {
- for (j = 0; j < symtab_count; j++) {
- ElfW(Sym) *sym = &symtab[j];
- Dl_info info;
- void *s;
- if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size == 0) continue;
- s = dlsym(handle, strtab + sym->st_name);
- if (s && dladdr(s, &info)) {
- obj->base_addr = dladdr_fbase;
- dladdr_fbase = (uintptr_t)info.dli_fbase;
- break;
- }
- }
- dlclose(handle);
- }
+ for (j = 0; j < symtab_count; j++) {
+ ElfW(Sym) *sym = &symtab[j];
+ Dl_info info;
+ void *h, *s;
+ if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size <= 0) continue;
+ h = dlopen(NULL, RTLD_NOW|RTLD_LOCAL);
+ if (!h) continue;
+ s = dlsym(h, strtab + sym->st_name);
+ if (!s) continue;
+ if (dladdr(s, &info)) {
+ dladdr_fbase = (uintptr_t)info.dli_fbase;
+ break;
+ }
+ }
if (ehdr->e_type == ET_EXEC) {
obj->base_addr = 0;
}
@@ -1757,48 +585,33 @@ fill_lines(int num_traces, void **traces, int check_debuglink,
}
}
- if (obj->debug_info.ptr && obj->debug_abbrev.ptr) {
- DebugInfoReader reader;
- debug_info_reader_init(&reader, obj);
- i = 0;
- while (reader.p < reader.pend) {
- /* fprintf(stderr, "%d:%tx: CU[%d]\n", __LINE__, reader.p - reader.obj->debug_info.ptr, i++); */
- if (di_read_cu(&reader)) goto use_symtab;
- debug_info_read(&reader, num_traces, traces, lines, offset);
- }
- }
- else {
- /* This file doesn't have dwarf, use symtab or dynsym */
-use_symtab:
- if (!symtab_shdr) {
- /* This file doesn't have symtab, use dynsym instead */
- symtab_shdr = dynsym_shdr;
- strtab_shdr = dynstr_shdr;
- }
-
- if (symtab_shdr && strtab_shdr) {
- char *strtab = file + strtab_shdr->sh_offset;
- ElfW(Sym) *symtab = (ElfW(Sym) *)(file + symtab_shdr->sh_offset);
- int symtab_count = (int)(symtab_shdr->sh_size / sizeof(ElfW(Sym)));
- for (j = 0; j < symtab_count; j++) {
- ElfW(Sym) *sym = &symtab[j];
- uintptr_t saddr = (uintptr_t)sym->st_value + obj->base_addr;
- if (ELF_ST_TYPE(sym->st_info) != STT_FUNC) continue;
- for (i = offset; i < num_traces; i++) {
- uintptr_t d = (uintptr_t)traces[i] - saddr;
- if (lines[i].line > 0 || d > (uintptr_t)sym->st_size)
- continue;
- /* fill symbol name and addr from .symtab */
- if (!lines[i].sname) lines[i].sname = strtab + sym->st_name;
- lines[i].saddr = saddr;
- lines[i].path = obj->path;
- lines[i].base_addr = obj->base_addr;
- }
- }
- }
+ if (!symtab_shdr) {
+ symtab_shdr = dynsym_shdr;
+ strtab_shdr = dynstr_shdr;
+ }
+
+ if (symtab_shdr && strtab_shdr) {
+ char *strtab = file + strtab_shdr->sh_offset;
+ ElfW(Sym) *symtab = (ElfW(Sym) *)(file + symtab_shdr->sh_offset);
+ int symtab_count = (int)(symtab_shdr->sh_size / sizeof(ElfW(Sym)));
+ for (j = 0; j < symtab_count; j++) {
+ ElfW(Sym) *sym = &symtab[j];
+ uintptr_t saddr = (uintptr_t)sym->st_value + obj->base_addr;
+ if (ELF_ST_TYPE(sym->st_info) != STT_FUNC || sym->st_size <= 0) continue;
+ for (i = offset; i < num_traces; i++) {
+ uintptr_t d = (uintptr_t)traces[i] - saddr;
+ if (lines[i].line > 0 || d <= 0 || d > (uintptr_t)sym->st_size)
+ continue;
+ /* fill symbol name and addr from .symtab */
+ lines[i].sname = strtab + sym->st_name;
+ lines[i].saddr = saddr;
+ lines[i].path = obj->path;
+ lines[i].base_addr = obj->base_addr;
+ }
+ }
}
- if (!obj->debug_line.ptr) {
+ if (!debug_line_shdr) {
/* This file doesn't have .debug_line section,
let's check .gnu_debuglink section instead. */
if (gnu_debuglink_shdr && check_debuglink) {
@@ -1809,234 +622,15 @@ use_symtab:
goto finish;
}
- if (parse_debug_line(num_traces, traces,
- obj->debug_line.ptr,
- obj->debug_line.size,
- obj, lines, offset) == -1)
- 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:
return (uintptr_t)-1;
}
-#else /* Mach-O */
-/* read file and fill lines */
-static uintptr_t
-fill_lines(int num_traces, void **traces, int check_debuglink,
- obj_info_t **objp, line_info_t *lines, int offset)
-{
-# ifdef __LP64__
-# define LP(x) x##_64
-# else
-# define LP(x) x
-# endif
- int fd;
- off_t filesize;
- char *file, *p = NULL;
- obj_info_t *obj = *objp;
- struct LP(mach_header) *header;
- uintptr_t dladdr_fbase = 0;
-
- {
- char *s = binary_filename;
- char *base = strrchr(binary_filename, '/')+1;
- size_t max = PATH_MAX;
- size_t size = strlen(binary_filename);
- size_t basesize = size - (base - binary_filename);
- s += size;
- max -= size;
- p = s;
- size = strlcpy(s, ".dSYM/Contents/Resources/DWARF/", max);
- if (size == 0) goto fail;
- s += size;
- max -= size;
- if (max <= basesize) goto fail;
- memcpy(s, base, basesize);
- s[basesize] = 0;
-
- fd = open(binary_filename, O_RDONLY);
- if (fd < 0) {
- *p = 0; /* binary_filename becomes original file name */
- fd = open(binary_filename, O_RDONLY);
- if (fd < 0) {
- goto fail;
- }
- }
- }
-
- filesize = lseek(fd, 0, SEEK_END);
- if (filesize < 0) {
- int e = errno;
- close(fd);
- kprintf("lseek: %s\n", strerror(e));
- goto fail;
- }
-#if SIZEOF_OFF_T > SIZEOF_SIZE_T
- if (filesize > (off_t)SIZE_MAX) {
- close(fd);
- kprintf("Too large file %s\n", binary_filename);
- goto fail;
- }
-#endif
- lseek(fd, 0, SEEK_SET);
- /* async-signal unsafe */
- file = (char *)mmap(NULL, (size_t)filesize, PROT_READ, MAP_SHARED, fd, 0);
- if (file == MAP_FAILED) {
- int e = errno;
- close(fd);
- kprintf("mmap: %s\n", strerror(e));
- goto fail;
- }
- close(fd);
-
- obj->mapped = file;
- obj->mapped_size = (size_t)filesize;
-
- header = (struct LP(mach_header) *)file;
- if (header->magic == LP(MH_MAGIC)) {
- /* non universal binary */
- p = file;
- }
- else if (header->magic == FAT_CIGAM) {
- struct LP(mach_header) *mhp = _NSGetMachExecuteHeader();
- struct fat_header *fat = (struct fat_header *)file;
- char *q = file + sizeof(*fat);
- uint32_t nfat_arch = __builtin_bswap32(fat->nfat_arch);
- /* fprintf(stderr,"%d: fat:%s %d\n",__LINE__, binary_filename,nfat_arch); */
- for (uint32_t i = 0; i < nfat_arch; i++) {
- struct fat_arch *arch = (struct fat_arch *)q;
- cpu_type_t cputype = __builtin_bswap32(arch->cputype);
- cpu_subtype_t cpusubtype = __builtin_bswap32(arch->cpusubtype);
- uint32_t offset = __builtin_bswap32(arch->offset);
- /* fprintf(stderr,"%d: fat %d %x/%x %x/%x\n",__LINE__, i, mhp->cputype,mhp->cpusubtype, cputype,cpusubtype); */
- if (mhp->cputype == cputype &&
- (cpu_subtype_t)(mhp->cpusubtype & ~CPU_SUBTYPE_MASK) == cpusubtype) {
- p = file + offset;
- file = p;
- header = (struct LP(mach_header) *)p;
- if (header->magic == LP(MH_MAGIC)) {
- goto found_mach_header;
- }
- break;
- }
- q += sizeof(*arch);
- }
- kprintf("'%s' is not a Mach-O universal binary file!\n",binary_filename);
- close(fd);
- goto fail;
- }
- else {
- kprintf("'%s' is not a "
-# ifdef __LP64__
- "64"
-# else
- "32"
-# endif
- "-bit Mach-O file!\n",binary_filename);
- close(fd);
- goto fail;
- }
-found_mach_header:
- p += sizeof(*header);
-
- for (uint32_t i = 0; i < (uint32_t)header->ncmds; i++) {
- struct load_command *lcmd = (struct load_command *)p;
- switch (lcmd->cmd) {
- case LP(LC_SEGMENT):
- {
- static const char *debug_section_names[] = {
- "__debug_abbrev",
- "__debug_info",
- "__debug_line",
- "__debug_ranges",
- "__debug_str"
- };
- struct LP(segment_command) *scmd = (struct LP(segment_command) *)lcmd;
- if (strcmp(scmd->segname, "__TEXT") == 0) {
- obj->vmaddr = scmd->vmaddr;
- }
- else if (strcmp(scmd->segname, "__DWARF") == 0) {
- p += sizeof(struct LP(segment_command));
- for (uint64_t i = 0; i < scmd->nsects; i++) {
- struct LP(section) *sect = (struct LP(section) *)p;
- p += sizeof(struct LP(section));
- for (int j=0; j < DWARF_SECTION_COUNT; j++) {
- struct dwarf_section *s = obj_dwarf_section_at(obj, j);
-
- if (strcmp(sect->sectname, debug_section_names[j]) != 0)
- continue;
-
- s->ptr = file + sect->offset;
- s->size = sect->size;
- s->flags = sect->flags;
- if (s->flags & SHF_COMPRESSED) {
- goto fail;
- }
- break;
- }
- }
- }
- }
- break;
-
- case LC_SYMTAB:
- {
- struct symtab_command *cmd = (struct symtab_command *)lcmd;
- struct LP(nlist) *nl = (struct LP(nlist) *)(file + cmd->symoff);
- char *strtab = file + cmd->stroff, *sname = 0;
- uint32_t j;
- uintptr_t saddr = 0;
- /* kprintf("[%2d]: %x/symtab %p\n", i, cmd->cmd, p); */
- for (j = 0; j < cmd->nsyms; j++) {
- uintptr_t symsize, d;
- struct LP(nlist) *e = &nl[j];
- /* kprintf("[%2d][%4d]: %02x/%x/%x: %s %llx\n", i, j, e->n_type,e->n_sect,e->n_desc,strtab+e->n_un.n_strx,e->n_value); */
- if (e->n_type != N_FUN) continue;
- if (e->n_sect) {
- saddr = (uintptr_t)e->n_value + obj->base_addr - obj->vmaddr;
- sname = strtab + e->n_un.n_strx;
- /* kprintf("[%2d][%4d]: %02x/%x/%x: %s %llx\n", i, j, e->n_type,e->n_sect,e->n_desc,strtab+e->n_un.n_strx,e->n_value); */
- continue;
- }
- for (int k = offset; k < num_traces; k++) {
- d = (uintptr_t)traces[k] - saddr;
- symsize = e->n_value;
- /* kprintf("%lx %lx %lx\n",saddr,symsize,traces[k]); */
- if (lines[k].line > 0 || d > (uintptr_t)symsize)
- continue;
- /* fill symbol name and addr from .symtab */
- if (!lines[k].sname) lines[k].sname = sname;
- lines[k].saddr = saddr;
- lines[k].path = obj->path;
- lines[k].base_addr = obj->base_addr;
- }
- }
- }
- }
- p += lcmd->cmdsize;
- }
-
- if (obj->debug_info.ptr && obj->debug_abbrev.ptr) {
- DebugInfoReader reader;
- debug_info_reader_init(&reader, obj);
- while (reader.p < reader.pend) {
- if (di_read_cu(&reader)) goto fail;
- debug_info_read(&reader, num_traces, traces, lines, offset);
- }
- }
-
- if (parse_debug_line(num_traces, traces,
- obj->debug_line.ptr,
- obj->debug_line.size,
- obj, lines, offset) == -1)
- goto fail;
-
- return dladdr_fbase;
-fail:
- return (uintptr_t)-1;
-}
-#endif
#define HAVE_MAIN_EXE_PATH
#if defined(__FreeBSD__)
@@ -2049,17 +643,16 @@ fail:
* it is NUL terminated.
*/
#if defined(__linux__)
-static ssize_t
+ssize_t
main_exe_path(void)
{
# define PROC_SELF_EXE "/proc/self/exe"
ssize_t len = readlink(PROC_SELF_EXE, binary_filename, PATH_MAX);
- if (len < 0) return 0;
binary_filename[len] = 0;
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};
@@ -2072,66 +665,10 @@ main_exe_path(void)
len--; /* sysctl sets strlen+1 */
return len;
}
-#elif defined(HAVE_LIBPROC_H)
-static ssize_t
-main_exe_path(void)
-{
- int len = proc_pidpath(getpid(), binary_filename, PATH_MAX);
- if (len == 0) return 0;
- binary_filename[len] = 0;
- return len;
-}
#else
#undef HAVE_MAIN_EXE_PATH
#endif
-static void
-print_line0(line_info_t *line, void *address)
-{
- uintptr_t addr = (uintptr_t)address;
- uintptr_t d = addr - line->saddr;
- if (!address) {
- /* inlined */
- if (line->dirname && line->dirname[0]) {
- kprintf("%s(%s) %s/%s:%d\n", line->path, line->sname, line->dirname, line->filename, line->line);
- }
- else {
- kprintf("%s(%s) %s:%d\n", line->path, line->sname, line->filename, line->line);
- }
- }
- else if (!line->path) {
- kprintf("[0x%"PRIxPTR"]\n", addr);
- }
- else if (!line->saddr || !line->sname) {
- kprintf("%s(0x%"PRIxPTR") [0x%"PRIxPTR"]\n", line->path, addr-line->base_addr, addr);
- }
- else if (line->line <= 0) {
- kprintf("%s(%s+0x%"PRIxPTR") [0x%"PRIxPTR"]\n", line->path, line->sname,
- d, addr);
- }
- else if (!line->filename) {
- kprintf("%s(%s+0x%"PRIxPTR") [0x%"PRIxPTR"] ???:%d\n", line->path, line->sname,
- d, addr, line->line);
- }
- else if (line->dirname && line->dirname[0]) {
- kprintf("%s(%s+0x%"PRIxPTR") [0x%"PRIxPTR"] %s/%s:%d\n", line->path, line->sname,
- d, addr, line->dirname, line->filename, line->line);
- }
- else {
- kprintf("%s(%s+0x%"PRIxPTR") [0x%"PRIxPTR"] %s:%d\n", line->path, line->sname,
- d, addr, line->filename, line->line);
- }
-}
-
-static void
-print_line(line_info_t *line, void *address)
-{
- print_line0(line, address);
- if (line->next) {
- print_line(line->next, NULL);
- }
-}
-
void
rb_dump_backtrace_with_lines(int num_traces, void **traces)
{
@@ -2183,11 +720,8 @@ rb_dump_backtrace_with_lines(int num_traces, void **traces)
path = info.dli_fname;
obj->path = path;
lines[i].path = path;
- lines[i].sname = info.dli_sname;
- lines[i].saddr = (uintptr_t)info.dli_saddr;
- 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;
@@ -2195,36 +729,46 @@ next_line:
/* output */
for (i = 0; i < num_traces; i++) {
- print_line(&lines[i], traces[i]);
-
+ line_info_t *line = &lines[i];
+ uintptr_t addr = (uintptr_t)traces[i];
+ uintptr_t d = addr - line->saddr;
+ if (!line->path) {
+ kprintf("[0x%lx]\n", addr);
+ }
+ else if (!line->saddr || !line->sname) {
+ kprintf("%s [0x%lx]\n", line->path, addr);
+ }
+ else if (line->line <= 0) {
+ kprintf("%s(%s+0x%lx) [0x%lx]\n", line->path, line->sname,
+ d, addr);
+ }
+ else if (!line->filename) {
+ kprintf("%s(%s+0x%lx) [0x%lx] ???:%d\n", line->path, line->sname,
+ d, addr, line->line);
+ }
+ else if (line->dirname && line->dirname[0]) {
+ kprintf("%s(%s+0x%lx) [0x%lx] %s/%s:%d\n", line->path, line->sname,
+ d, addr, line->dirname, line->filename, line->line);
+ }
+ else {
+ kprintf("%s(%s+0x%lx) [0x%lx] %s:%d\n", line->path, line->sname,
+ d, addr, line->filename, line->line);
+ }
/* FreeBSD's backtrace may show _start and so on */
- if (lines[i].sname && strcmp("main", lines[i].sname) == 0)
+ if (line->sname && strcmp("main", line->sname) == 0)
break;
}
/* free */
while (obj) {
obj_info_t *o = obj;
- for (i=0; i < DWARF_SECTION_COUNT; i++) {
- struct dwarf_section *s = obj_dwarf_section_at(obj, i);
- if (s->flags & SHF_COMPRESSED) {
- free(s->ptr);
- }
- }
- if (obj->mapped_size) {
- munmap(obj->mapped, obj->mapped_size);
- }
obj = o->next;
+ if (o->fd) {
+ munmap(o->mapped, o->mapped_size);
+ close(o->fd);
+ }
free(o);
}
- for (i = 0; i < num_traces; i++) {
- line_info_t *line = lines[i].next;
- while (line) {
- line_info_t *l = line;
- line = line->next;
- free(l);
- }
- }
free(lines);
free(dladdr_fbases);
}
@@ -2268,9 +812,10 @@ 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])
-static const char hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz";
static inline int imax(int a, int b) { return (a > b ? a : b); }
static int kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap);
@@ -2284,7 +829,7 @@ static void putce(int c)
(void)ret;
}
-static int
+int
kprintf(const char *fmt, ...)
{
va_list ap;
diff --git a/addr2line.h b/addr2line.h
index 4f6cf179ef..d99f010934 100644
--- a/addr2line.h
+++ b/addr2line.h
@@ -11,7 +11,7 @@
#ifndef RUBY_ADDR2LINE_H
#define RUBY_ADDR2LINE_H
-#if (defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H))
+#ifdef USE_ELF
void
rb_dump_backtrace_with_lines(int num_traces, void **traces);
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index bf10c97222..0000000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,147 +0,0 @@
----
-version: '{build}'
-shallow_clone: true
-platform:
- - x64
-branches:
- except:
- - trunk # mirrored from trunk. avoid doubly building on it
-environment:
- ruby_version: "24-%Platform%"
- zlib_version: "1.2.11"
- matrix:
- # to reduce time for finishing all jobs, run the slowest msys2 build first.
- - build: msys2
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- GEMS_FOR_TEST: "timezone tzinfo"
- - build: vs
- vs: 120
- ssl: OpenSSL
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- GEMS_FOR_TEST: ""
- - build: vs
- vs: 140
- ssl: OpenSSL-v111
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- GEMS_FOR_TEST: ""
- RELINE_TEST_ENCODING: "Windows-31J"
- UPDATE_UNICODE: "UNICODE_FILES=. UNICODE_PROPERTY_FILES=. UNICODE_AUXILIARY_FILES=. UNICODE_EMOJI_FILES=."
-for:
--
- matrix:
- only:
- - build: vs
- install:
- - ver
- - chcp
- - SET BITS=%Platform:x86=32%
- - SET BITS=%BITS:x=%
- - SET OPENSSL_DIR=C:\%ssl%-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'
- - 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% %UPDATE_UNICODE% up incs
- - del Makefile
- - mkdir \usr\local\bin
- - mkdir \usr\local\include
- - mkdir \usr\local\lib
- - curl -fsSL -o zlib%zlib_version:.=%.zip --retry 10 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
- - attrib +r /s /d
- - mkdir %Platform%-mswin_%vs%
- 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')"
- - if not "%GEMS_FOR_TEST%" == "" \usr\bin\gem install --no-document %GEMS_FOR_TEST%
- - \usr\bin\ruby -ropenssl -e "puts 'Build ' + OpenSSL::OPENSSL_VERSION, 'Runtime ' + OpenSSL::OPENSSL_LIBRARY_VERSION"
- test_script:
- - set /a JOBS=%NUMBER_OF_PROCESSORS%
- - nmake -l "TESTOPTS=-v -q" btest
- - nmake -l "TESTOPTS=-v -q" test-basic
- - nmake -l "TESTOPTS=-v --timeout-scale=3.0 --excludes=../test/excludes/_appveyor -j%JOBS% --exclude readline --exclude win32ole --exclude test_bignum --exclude test_syntax --exclude test_open-uri --exclude test_bundled_ca" test-all
- # separately execute tests without -j which may crash worker with -j.
- - nmake -l "TESTOPTS=-v --timeout-scale=3.0 --excludes=../test/excludes/_appveyor" test-all TESTS="../test/win32ole ../test/ruby/test_bignum.rb ../test/ruby/test_syntax.rb ../test/open-uri/test_open-uri.rb ../test/rubygems/test_bundled_ca.rb"
- - nmake -l test-spec MSPECOPT=-fs # not using `-j` because sometimes `mspec -j` silently dies on Windows
--
- matrix:
- only:
- - build: msys2
- install:
- - ver
- - chcp
- - set /a JOBS=%NUMBER_OF_PROCESSORS%
- - set MSYS_NO_PATHCONV=1
- - SET MSYSTEM=%Platform:x86=32%
- - SET MSYSTEM=%MSYSTEM:x=MINGW%
- - SET MSYS2_ARCH=%Platform:x86=i686%
- - SET MSYS2_ARCH=%MSYS2_ARCH:x64=x86_64%
- - set MSYSTEM_PREFIX=/mingw64
- - set MINGW_CHOST=%MSYS2_ARCH%-w64-mingw32
- - SET ruby_path=C:\Ruby%ruby_version:-x86=%
- - cd ..
- - mkdir build
- - mkdir install
- - SET PATH=%ruby_path%\bin;C:\msys64\%MSYSTEM%\bin;C:\msys64\usr\bin;%PATH%
- - ruby --version
- build_script:
- - pacman -Syd --noconfirm --noprogressbar --needed mingw-w64-x86_64-binutils mingw-w64-x86_64-isl mingw-w64-x86_64-libiconv mingw-w64-x86_64-mpc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-windows-default-manifest mingw-w64-x86_64-winpthreads mingw-w64-x86_64-gcc
- # when fixed in MSYS2 / Mingw-w64, remove above and use normal code below
- #- pacman -Sy --noconfirm --noprogressbar --needed mingw-w64-x86_64-toolchain
- - pacman -S --noconfirm --noprogressbar --needed mingw-w64-x86_64-gdbm mingw-w64-x86_64-gmp mingw-w64-x86_64-libffi mingw-w64-x86_64-libyaml mingw-w64-x86_64-openssl mingw-w64-x86_64-ragel mingw-w64-x86_64-readline mingw-w64-x86_64-zlib
- - cd %APPVEYOR_BUILD_FOLDER%
- - set CFLAGS=-march=%MSYS2_ARCH:_=-% -mtune=generic -O3 -pipe
- - set CXXFLAGS=%CFLAGS%
- - set CPPFLAGS=-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048
- - set LDFLAGS=-pipe
- - sh -c "autoreconf -fi"
- - cd ..\build
- - sh ../ruby/configure --disable-install-doc --prefix=/. --build=%MINGW_CHOST% --host=%MINGW_CHOST% --target=%MINGW_CHOST%
- - mingw32-make %mflags% touch-unicode-files
- - mingw32-make -j%JOBS% %UPDATE_UNICODE% up incs
- - mingw32-make -j%JOBS% V=1
- - mingw32-make DESTDIR=../install install-nodoc
- - if not "%GEMS_FOR_TEST%" == "" ..\install\bin\gem install --no-document %GEMS_FOR_TEST%
- - ..\install\bin\ruby.exe -v -ropenssl -e "puts 'Build ' + OpenSSL::OPENSSL_VERSION, 'Runtime ' + OpenSSL::OPENSSL_LIBRARY_VERSION"
- test_script:
- - mingw32-make test
- - mingw32-make test-all TESTOPTS="--retry --job-status=normal --show-skip --timeout-scale=1.5 --excludes=../ruby/test/excludes/_appveyor -j %JOBS% --exclude win32ole --exclude test_open-uri"
- # separately execute tests without -j which may crash worker with -j.
- - mingw32-make test-all TESTOPTS="--retry --job-status=normal --show-skip --timeout-scale=1.5 --excludes=../ruby/test/excludes/_appveyor" TESTS="../ruby/test/win32ole ../ruby/test/open-uri/test_open-uri.rb"
- - mingw32-make test-spec MSPECOPT=-fs # not using `-j` because sometimes `mspec -j` silently dies on Windows
-notifications:
- # Using "Webhook" with templated body to skip notification on Pull Request
- - provider: Webhook
- method: POST
- url:
- secure: iMINHMS0nZabaDsxN9omRDsekxzVvAAzEq5ev7lN6vb+gUETT+rbDKLGxBxBpEpxlnPlLdzroIJ+DTKlwfJA8VkGawTn9EXNsucH0OkSf2M= # AppVeyor CI
- body: >-
- {{^isPullRequest}}
- {
- "attachments": [
- {
- "text": "Build <{{buildUrl}}|#{{buildVersion}}> (<{{commitUrl}}|{{commitId}}>) of {{repositoryName}}@{{branch}} by {{commitAuthor}} {{status}}",
- "color": "{{#passed}}good{{/passed}}{{#failed}}danger{{/failed}}"
- }
- ],
- "channel": "#alerts"
- }
- {{/isPullRequest}}
- on_build_success: false
- on_build_failure: true
- on_build_status_changed: true
diff --git a/array.c b/array.c
index 28bd8c866b..28e43c68c0 100644
--- a/array.c
+++ b/array.c
@@ -10,73 +10,46 @@
Copyright (C) 2000 Information-technology Promotion Agency, Japan
**********************************************************************/
-#include "ruby/encoding.h"
+
+#include "internal.h"
#include "ruby/util.h"
#include "ruby/st.h"
#include "probes.h"
#include "id.h"
-#include "debug_counter.h"
-#include "transient_heap.h"
-#include "internal.h"
-#if !ARRAY_DEBUG
+#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
-static int
-should_be_T_ARRAY(VALUE ary)
-{
- return RB_TYPE_P(ary, T_ARRAY);
-}
-
-static int
-should_not_be_shared_and_embedded(VALUE ary)
-{
- return !FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG);
-}
-
-#define ARY_SHARED_P(ary) \
- (assert(should_be_T_ARRAY((VALUE)(ary))), \
- assert(should_not_be_shared_and_embedded((VALUE)ary)), \
- FL_TEST_RAW((ary),ELTS_SHARED)!=0)
-
-#define ARY_EMBED_P(ary) \
- (assert(should_be_T_ARRAY((VALUE)(ary))), \
- assert(should_not_be_shared_and_embedded((VALUE)ary)), \
- FL_TEST_RAW((ary), RARRAY_EMBED_FLAG) != 0)
+# define ARY_SHARED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary),ELTS_SHARED)!=0)
+# define ARY_EMBED_P(ary) \
+ (assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)), \
+ FL_TEST((ary), RARRAY_EMBED_FLAG)!=0)
#define ARY_HEAP_PTR(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.ptr)
#define ARY_HEAP_LEN(a) (assert(!ARY_EMBED_P(a)), RARRAY(a)->as.heap.len)
-#define ARY_HEAP_CAPA(a) (assert(!ARY_EMBED_P(a)), assert(!ARY_SHARED_ROOT_P(a)), \
- RARRAY(a)->as.heap.aux.capa)
-
#define ARY_EMBED_PTR(a) (assert(ARY_EMBED_P(a)), RARRAY(a)->as.ary)
#define ARY_EMBED_LEN(a) \
(assert(ARY_EMBED_P(a)), \
(long)((RBASIC(a)->flags >> RARRAY_EMBED_LEN_SHIFT) & \
(RARRAY_EMBED_LEN_MASK >> RARRAY_EMBED_LEN_SHIFT)))
-#define ARY_HEAP_SIZE(a) (assert(!ARY_EMBED_P(a)), assert(ARY_OWNS_HEAP_P(a)), ARY_CAPA(a) * sizeof(VALUE))
-
-#define ARY_OWNS_HEAP_P(a) (assert(should_be_T_ARRAY((VALUE)(a))), \
- !FL_TEST_RAW((a), ELTS_SHARED|RARRAY_EMBED_FLAG))
+#define ARY_HEAP_SIZE(a) (assert(!ARY_EMBED_P(a)), assert(ARY_OWNS_HEAP_P(a)), RARRAY(a)->as.heap.aux.capa * sizeof(VALUE))
+#define ARY_OWNS_HEAP_P(a) (!FL_TEST((a), ELTS_SHARED|RARRAY_EMBED_FLAG))
#define FL_SET_EMBED(a) do { \
assert(!ARY_SHARED_P(a)); \
FL_SET((a), RARRAY_EMBED_FLAG); \
- RARY_TRANSIENT_UNSET(a); \
- ary_verify(a); \
} while (0)
-
#define FL_UNSET_EMBED(ary) FL_UNSET((ary), RARRAY_EMBED_FLAG|RARRAY_EMBED_LEN_MASK)
#define FL_SET_SHARED(ary) do { \
assert(!ARY_EMBED_P(ary)); \
@@ -125,7 +98,7 @@ should_not_be_shared_and_embedded(VALUE ary)
} while (0)
#define ARY_CAPA(ary) (ARY_EMBED_P(ary) ? RARRAY_EMBED_LEN_MAX : \
- ARY_SHARED_ROOT_P(ary) ? RARRAY_LEN(ary) : ARY_HEAP_CAPA(ary))
+ ARY_SHARED_ROOT_P(ary) ? RARRAY_LEN(ary) : RARRAY(ary)->as.heap.aux.capa)
#define ARY_SET_CAPA(ary, n) do { \
assert(!ARY_EMBED_P(ary)); \
assert(!ARY_SHARED_P(ary)); \
@@ -133,114 +106,33 @@ should_not_be_shared_and_embedded(VALUE ary)
RARRAY(ary)->as.heap.aux.capa = (n); \
} while (0)
-#define ARY_SHARED_ROOT(ary) (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared_root)
+#define ARY_SHARED(ary) (assert(ARY_SHARED_P(ary)), RARRAY(ary)->as.heap.aux.shared)
#define ARY_SET_SHARED(ary, value) do { \
const VALUE _ary_ = (ary); \
const VALUE _value_ = (value); \
assert(!ARY_EMBED_P(_ary_)); \
assert(ARY_SHARED_P(_ary_)); \
assert(ARY_SHARED_ROOT_P(_value_)); \
- RB_OBJ_WRITE(_ary_, &RARRAY(_ary_)->as.heap.aux.shared_root, _value_); \
+ RB_OBJ_WRITE(_ary_, &RARRAY(_ary_)->as.heap.aux.shared, _value_); \
} while (0)
#define RARRAY_SHARED_ROOT_FLAG FL_USER5
-#define ARY_SHARED_ROOT_P(ary) (assert(should_be_T_ARRAY((VALUE)(ary))), \
- FL_TEST_RAW((ary), RARRAY_SHARED_ROOT_FLAG))
-#define ARY_SHARED_ROOT_REFCNT(ary) \
+#define ARY_SHARED_ROOT_P(ary) (FL_TEST((ary), RARRAY_SHARED_ROOT_FLAG))
+#define ARY_SHARED_NUM(ary) \
(assert(ARY_SHARED_ROOT_P(ary)), RARRAY(ary)->as.heap.aux.capa)
-#define ARY_SHARED_ROOT_OCCUPIED(ary) (ARY_SHARED_ROOT_REFCNT(ary) == 1)
-#define ARY_SET_SHARED_ROOT_REFCNT(ary, value) do { \
+#define ARY_SHARED_OCCUPIED(ary) (ARY_SHARED_NUM(ary) == 1)
+#define ARY_SET_SHARED_NUM(ary, value) do { \
assert(ARY_SHARED_ROOT_P(ary)); \
RARRAY(ary)->as.heap.aux.capa = (value); \
} while (0)
#define FL_SET_SHARED_ROOT(ary) do { \
assert(!ARY_EMBED_P(ary)); \
- assert(!RARRAY_TRANSIENT_P(ary)); \
FL_SET((ary), RARRAY_SHARED_ROOT_FLAG); \
} while (0)
-static inline void
-ARY_SET(VALUE a, long i, VALUE v)
-{
- assert(!ARY_SHARED_P(a));
- assert(!OBJ_FROZEN(a));
-
- RARRAY_ASET(a, i, v);
-}
-#undef RARRAY_ASET
-
-
-#if ARRAY_DEBUG
-#define ary_verify(ary) ary_verify_(ary, __FILE__, __LINE__)
-
-static VALUE
-ary_verify_(VALUE ary, const char *file, int line)
-{
- assert(RB_TYPE_P(ary, T_ARRAY));
-
- if (FL_TEST(ary, ELTS_SHARED)) {
- VALUE root = RARRAY(ary)->as.heap.aux.shared_root;
- const VALUE *ptr = ARY_HEAP_PTR(ary);
- const VALUE *root_ptr = RARRAY_CONST_PTR_TRANSIENT(root);
- long len = ARY_HEAP_LEN(ary), root_len = RARRAY_LEN(root);
- assert(FL_TEST(root, RARRAY_SHARED_ROOT_FLAG));
- assert(root_ptr <= ptr && ptr + len <= root_ptr + root_len);
- ary_verify(root);
- }
- else if (ARY_EMBED_P(ary)) {
- assert(!RARRAY_TRANSIENT_P(ary));
- assert(!ARY_SHARED_P(ary));
- assert(RARRAY_LEN(ary) <= RARRAY_EMBED_LEN_MAX);
- }
- else {
-#if 1
- const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
- long i, len = RARRAY_LEN(ary);
- volatile VALUE v;
- if (len > 1) len = 1; /* check only HEAD */
- for (i=0; i<len; i++) {
- v = ptr[i]; /* access check */
- }
- v = v;
-#endif
- }
-
- if (RARRAY_TRANSIENT_P(ary)) {
- assert(rb_transient_heap_managed_ptr_p(RARRAY_CONST_PTR_TRANSIENT(ary)));
- }
-
- rb_transient_heap_verify();
-
- return ary;
-}
+#define ARY_SET(a, i, v) RARRAY_ASET((assert(!ARY_SHARED_P(a)), (a)), (i), (v))
void
-rb_ary_verify(VALUE ary)
-{
- ary_verify(ary);
-}
-#else
-#define ary_verify(ary) ((void)0)
-#endif
-
-VALUE *
-rb_ary_ptr_use_start(VALUE ary)
-{
-#if ARRAY_DEBUG
- FL_SET_RAW(ary, RARRAY_PTR_IN_USE_FLAG);
-#endif
- return (VALUE *)RARRAY_CONST_PTR_TRANSIENT(ary);
-}
-
-void
-rb_ary_ptr_use_end(VALUE ary)
-{
-#if ARRAY_DEBUG
- FL_UNSET_RAW(ary, RARRAY_PTR_IN_USE_FLAG);
-#endif
-}
-
-void
-rb_mem_clear(VALUE *mem, long size)
+rb_mem_clear(register VALUE *mem, register long size)
{
while (size--) {
*mem++ = Qnil;
@@ -250,7 +142,7 @@ rb_mem_clear(VALUE *mem, long size)
static void
ary_mem_clear(VALUE ary, long beg, long size)
{
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
+ RARRAY_PTR_USE(ary, ptr, {
rb_mem_clear(ptr + beg, size);
});
}
@@ -266,7 +158,7 @@ memfill(register VALUE *mem, register long size, register VALUE val)
static void
ary_memfill(VALUE ary, long beg, long size, VALUE val)
{
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
+ RARRAY_PTR_USE(ary, ptr, {
memfill(ptr + beg, size, val);
RB_OBJ_WRITTEN(ary, Qundef, val);
});
@@ -275,22 +167,28 @@ ary_memfill(VALUE ary, long beg, long size, VALUE val)
static void
ary_memcpy0(VALUE ary, long beg, long argc, const VALUE *argv, VALUE buff_owner_ary)
{
+#if 1
assert(!ARY_SHARED_P(buff_owner_ary));
if (argc > (int)(128/sizeof(VALUE)) /* is magic number (cache line size) */) {
- rb_gc_writebarrier_remember(buff_owner_ary);
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
- MEMCPY(ptr+beg, argv, VALUE, argc);
- });
+ rb_gc_writebarrier_remember(buff_owner_ary);
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMCPY(ptr+beg, argv, VALUE, argc);
+ });
}
else {
- int i;
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
- for (i=0; i<argc; i++) {
- RB_OBJ_WRITE(buff_owner_ary, &ptr[i+beg], argv[i]);
- }
- });
+ int i;
+ RARRAY_PTR_USE(ary, ptr, {
+ for (i=0; i<argc; i++) {
+ RB_OBJ_WRITE(buff_owner_ary, &ptr[i+beg], argv[i]);
+ }
+ });
}
+#else
+ /* giveup write barrier (traditional way) */
+ RARRAY_PTR(buff_owner_ary);
+ MEMCPY(RARRAY_PTR(ary)+beg, argv, VALUE, argc);
+#endif
}
static void
@@ -299,175 +197,49 @@ ary_memcpy(VALUE ary, long beg, long argc, const VALUE *argv)
ary_memcpy0(ary, beg, argc, argv, ary);
}
-static VALUE *
-ary_heap_alloc(VALUE ary, size_t capa)
-{
- VALUE *ptr = rb_transient_heap_alloc(ary, sizeof(VALUE) * capa);
-
- if (ptr != NULL) {
- RARY_TRANSIENT_SET(ary);
- }
- else {
- RARY_TRANSIENT_UNSET(ary);
- ptr = ALLOC_N(VALUE, capa);
- }
-
- return ptr;
-}
-
-static void
-ary_heap_free_ptr(VALUE ary, const VALUE *ptr, long size)
-{
- if (RARRAY_TRANSIENT_P(ary)) {
- /* ignore it */
- }
- else {
- ruby_sized_xfree((void *)ptr, size);
- }
-}
-
-static void
-ary_heap_free(VALUE ary)
-{
- if (RARRAY_TRANSIENT_P(ary)) {
- RARY_TRANSIENT_UNSET(ary);
- }
- else {
- ary_heap_free_ptr(ary, ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
- }
-}
-
-static void
-ary_heap_realloc(VALUE ary, size_t new_capa)
-{
- size_t old_capa = ARY_HEAP_CAPA(ary);
-
- if (RARRAY_TRANSIENT_P(ary)) {
- if (new_capa <= old_capa) {
- /* do nothing */
- }
- else {
- VALUE *new_ptr = rb_transient_heap_alloc(ary, sizeof(VALUE) * new_capa);
-
- if (new_ptr == NULL) {
- new_ptr = ALLOC_N(VALUE, new_capa);
- RARY_TRANSIENT_UNSET(ary);
- }
-
- MEMCPY(new_ptr, ARY_HEAP_PTR(ary), VALUE, old_capa);
- ARY_SET_PTR(ary, new_ptr);
- }
- }
- else {
- SIZED_REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, new_capa, old_capa);
- }
- ary_verify(ary);
-}
-
-#if USE_TRANSIENT_HEAP
-static inline void
-rb_ary_transient_heap_evacuate_(VALUE ary, int transient, int promote)
-{
- if (transient) {
- VALUE *new_ptr;
- const VALUE *old_ptr = ARY_HEAP_PTR(ary);
- long capa = ARY_HEAP_CAPA(ary);
- long len = ARY_HEAP_LEN(ary);
-
- if (ARY_SHARED_ROOT_P(ary)) {
- capa = len;
- }
-
- assert(ARY_OWNS_HEAP_P(ary));
- assert(RARRAY_TRANSIENT_P(ary));
- assert(!ARY_PTR_USING_P(ary));
-
- if (promote) {
- new_ptr = ALLOC_N(VALUE, capa);
- RARY_TRANSIENT_UNSET(ary);
- }
- else {
- new_ptr = ary_heap_alloc(ary, capa);
- }
-
- MEMCPY(new_ptr, old_ptr, VALUE, capa);
- /* do not use ARY_SET_PTR() because they assert !frozen */
- RARRAY(ary)->as.heap.ptr = new_ptr;
- }
-
- ary_verify(ary);
-}
-
-void
-rb_ary_transient_heap_evacuate(VALUE ary, int promote)
-{
- rb_ary_transient_heap_evacuate_(ary, RARRAY_TRANSIENT_P(ary), promote);
-}
-
-void
-rb_ary_detransient(VALUE ary)
-{
- assert(RARRAY_TRANSIENT_P(ary));
- rb_ary_transient_heap_evacuate_(ary, TRUE, TRUE);
-}
-#else
-void
-rb_ary_detransient(VALUE ary)
-{
- /* do nothing */
-}
-#endif
-
static void
ary_resize_capa(VALUE ary, long capacity)
{
assert(RARRAY_LEN(ary) <= capacity);
assert(!OBJ_FROZEN(ary));
assert(!ARY_SHARED_P(ary));
-
if (capacity > RARRAY_EMBED_LEN_MAX) {
if (ARY_EMBED_P(ary)) {
long len = ARY_EMBED_LEN(ary);
- VALUE *ptr = ary_heap_alloc(ary, capacity);
-
+ VALUE *ptr = ALLOC_N(VALUE, (capacity));
MEMCPY(ptr, ARY_EMBED_PTR(ary), VALUE, len);
FL_UNSET_EMBED(ary);
ARY_SET_PTR(ary, ptr);
ARY_SET_HEAP_LEN(ary, len);
}
else {
- ary_heap_realloc(ary, capacity);
+ SIZED_REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, capacity, RARRAY(ary)->as.heap.aux.capa);
}
- ARY_SET_CAPA(ary, capacity);
+ ARY_SET_CAPA(ary, (capacity));
}
else {
if (!ARY_EMBED_P(ary)) {
- long len = ARY_HEAP_LEN(ary);
- long old_capa = ARY_HEAP_CAPA(ary);
- const VALUE *ptr = ARY_HEAP_PTR(ary);
+ long len = RARRAY_LEN(ary);
+ const VALUE *ptr = RARRAY_CONST_PTR(ary);
- if (len > capacity) len = capacity;
+ if (len > capacity) len = capacity;
MEMCPY((VALUE *)RARRAY(ary)->as.ary, ptr, VALUE, len);
- ary_heap_free_ptr(ary, ptr, old_capa);
-
FL_SET_EMBED(ary);
ARY_SET_LEN(ary, len);
+ ruby_xfree((VALUE *)ptr);
}
}
-
- ary_verify(ary);
}
static inline void
ary_shrink_capa(VALUE ary)
{
long capacity = ARY_HEAP_LEN(ary);
- long old_capa = ARY_HEAP_CAPA(ary);
+ long old_capa = RARRAY(ary)->as.heap.aux.capa;
assert(!ARY_SHARED_P(ary));
assert(old_capa >= capacity);
- if (old_capa > capacity) ary_heap_realloc(ary, capacity);
-
- ary_verify(ary);
+ if (old_capa > capacity)
+ REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, capacity);
}
static void
@@ -483,21 +255,19 @@ ary_double_capa(VALUE ary, long min)
}
new_capa += min;
ary_resize_capa(ary, new_capa);
-
- ary_verify(ary);
}
static void
-rb_ary_decrement_share(VALUE shared_root)
+rb_ary_decrement_share(VALUE shared)
{
- if (shared_root) {
- long num = ARY_SHARED_ROOT_REFCNT(shared_root) - 1;
+ if (shared) {
+ long num = ARY_SHARED_NUM(shared) - 1;
if (num == 0) {
- rb_ary_free(shared_root);
- rb_gc_force_recycle(shared_root);
+ rb_ary_free(shared);
+ rb_gc_force_recycle(shared);
}
else if (num > 0) {
- ARY_SET_SHARED_ROOT_REFCNT(shared_root, num);
+ ARY_SET_SHARED_NUM(shared, num);
}
}
}
@@ -505,8 +275,8 @@ rb_ary_decrement_share(VALUE shared_root)
static void
rb_ary_unshare(VALUE ary)
{
- VALUE shared_root = RARRAY(ary)->as.heap.aux.shared_root;
- rb_ary_decrement_share(shared_root);
+ VALUE shared = RARRAY(ary)->as.heap.aux.shared;
+ rb_ary_decrement_share(shared);
FL_UNSET_SHARED(ary);
}
@@ -519,29 +289,27 @@ rb_ary_unshare_safe(VALUE ary)
}
static VALUE
-rb_ary_increment_share(VALUE shared_root)
+rb_ary_increment_share(VALUE shared)
{
- long num = ARY_SHARED_ROOT_REFCNT(shared_root);
+ long num = ARY_SHARED_NUM(shared);
if (num >= 0) {
- ARY_SET_SHARED_ROOT_REFCNT(shared_root, num + 1);
+ ARY_SET_SHARED_NUM(shared, num + 1);
}
- return shared_root;
+ return shared;
}
static void
-rb_ary_set_shared(VALUE ary, VALUE shared_root)
+rb_ary_set_shared(VALUE ary, VALUE shared)
{
- rb_ary_increment_share(shared_root);
+ rb_ary_increment_share(shared);
FL_SET_SHARED(ary);
- RB_DEBUG_COUNTER_INC(obj_ary_shared_create);
- ARY_SET_SHARED(ary, shared_root);
+ ARY_SET_SHARED(ary, shared);
}
static inline void
rb_ary_modify_check(VALUE ary)
{
rb_check_frozen(ary);
- ary_verify(ary);
}
void
@@ -550,32 +318,29 @@ rb_ary_modify(VALUE ary)
rb_ary_modify_check(ary);
if (ARY_SHARED_P(ary)) {
long shared_len, len = RARRAY_LEN(ary);
- VALUE shared_root = ARY_SHARED_ROOT(ary);
-
- ary_verify(shared_root);
-
+ VALUE shared = ARY_SHARED(ary);
if (len <= RARRAY_EMBED_LEN_MAX) {
const VALUE *ptr = ARY_HEAP_PTR(ary);
FL_UNSET_SHARED(ary);
FL_SET_EMBED(ary);
MEMCPY((VALUE *)ARY_EMBED_PTR(ary), ptr, VALUE, len);
- rb_ary_decrement_share(shared_root);
+ rb_ary_decrement_share(shared);
ARY_SET_EMBED_LEN(ary, len);
}
- else if (ARY_SHARED_ROOT_OCCUPIED(shared_root) && len > ((shared_len = RARRAY_LEN(shared_root))>>1)) {
- long shift = RARRAY_CONST_PTR_TRANSIENT(ary) - RARRAY_CONST_PTR_TRANSIENT(shared_root);
+ else if (ARY_SHARED_OCCUPIED(shared) && len > ((shared_len = RARRAY_LEN(shared))>>1)) {
+ long shift = RARRAY_CONST_PTR(ary) - RARRAY_CONST_PTR(shared);
FL_UNSET_SHARED(ary);
- ARY_SET_PTR(ary, RARRAY_CONST_PTR_TRANSIENT(shared_root));
+ ARY_SET_PTR(ary, RARRAY_CONST_PTR(shared));
ARY_SET_CAPA(ary, shared_len);
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
+ RARRAY_PTR_USE(ary, ptr, {
MEMMOVE(ptr, ptr+shift, VALUE, len);
});
- FL_SET_EMBED(shared_root);
- rb_ary_decrement_share(shared_root);
+ FL_SET_EMBED(shared);
+ rb_ary_decrement_share(shared);
}
else {
- VALUE *ptr = ary_heap_alloc(ary, len);
- MEMCPY(ptr, ARY_HEAP_PTR(ary), VALUE, len);
+ VALUE *ptr = ALLOC_N(VALUE, len);
+ MEMCPY(ptr, RARRAY_CONST_PTR(ary), VALUE, len);
rb_ary_unshare(ary);
ARY_SET_CAPA(ary, len);
ARY_SET_PTR(ary, ptr);
@@ -583,7 +348,6 @@ rb_ary_modify(VALUE ary)
rb_gc_writebarrier_remember(ary);
}
- ary_verify(ary);
}
static VALUE
@@ -598,14 +362,11 @@ ary_ensure_room_for_push(VALUE ary, long add_len)
}
if (ARY_SHARED_P(ary)) {
if (new_len > RARRAY_EMBED_LEN_MAX) {
- VALUE shared_root = ARY_SHARED_ROOT(ary);
- if (ARY_SHARED_ROOT_OCCUPIED(shared_root)) {
- if (ARY_HEAP_PTR(ary) - RARRAY_CONST_PTR_TRANSIENT(shared_root) + new_len <= RARRAY_LEN(shared_root)) {
+ VALUE shared = ARY_SHARED(ary);
+ if (ARY_SHARED_OCCUPIED(shared)) {
+ if (RARRAY_CONST_PTR(ary) - RARRAY_CONST_PTR(shared) + new_len <= RARRAY_LEN(shared)) {
rb_ary_modify_check(ary);
-
- ary_verify(ary);
- ary_verify(shared_root);
- return shared_root;
+ return shared;
}
else {
/* if array is shared, then it is likely it participate in push/shift pattern */
@@ -614,23 +375,17 @@ ary_ensure_room_for_push(VALUE ary, long add_len)
if (new_len > capa - (capa >> 6)) {
ary_double_capa(ary, new_len);
}
- ary_verify(ary);
return ary;
}
}
}
- ary_verify(ary);
- 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);
}
- ary_verify(ary);
return ary;
}
@@ -650,6 +405,21 @@ rb_ary_freeze(VALUE ary)
return rb_obj_freeze(ary);
}
+/*
+ * call-seq:
+ * ary.frozen? -> true or false
+ *
+ * Return +true+ if this array is frozen (or temporarily frozen
+ * while being sorted). See also Object#frozen?
+ */
+
+static VALUE
+rb_ary_frozen_p(VALUE ary)
+{
+ if (OBJ_FROZEN(ary)) return Qtrue;
+ return Qfalse;
+}
+
/* This can be used to take a snapshot of an array (with
e.g. rb_ary_replace) and check later whether the array has been
modified from the snapshot. The snapshot is cheap, though if
@@ -662,7 +432,7 @@ rb_ary_shared_with_p(VALUE ary1, VALUE ary2)
{
if (!ARY_EMBED_P(ary1) && ARY_SHARED_P(ary1) &&
!ARY_EMBED_P(ary2) && ARY_SHARED_P(ary2) &&
- RARRAY(ary1)->as.heap.aux.shared_root == RARRAY(ary2)->as.heap.aux.shared_root &&
+ RARRAY(ary1)->as.heap.aux.shared == RARRAY(ary2)->as.heap.aux.shared &&
RARRAY(ary1)->as.heap.len == RARRAY(ary2)->as.heap.len) {
return Qtrue;
}
@@ -683,7 +453,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);
}
@@ -699,11 +472,13 @@ 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 = ary_heap_alloc(ary, capa);
+ ptr = ALLOC_N(VALUE, capa);
FL_UNSET_EMBED(ary);
ARY_SET_PTR(ary, ptr);
ARY_SET_CAPA(ary, capa);
@@ -744,12 +519,12 @@ VALUE
return ary;
}
-MJIT_FUNC_EXPORTED VALUE
-rb_ary_tmp_new_from_values(VALUE klass, long n, const VALUE *elts)
+VALUE
+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);
@@ -759,17 +534,9 @@ 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)
{
- VALUE ary = ary_new(0, capa);
- rb_ary_transient_heap_evacuate(ary, TRUE);
- return ary;
+ return ary_new(0, capa);
}
VALUE
@@ -778,7 +545,6 @@ rb_ary_tmp_new_fill(long capa)
VALUE ary = ary_new(0, capa);
ary_memfill(ary, 0, capa, Qnil);
ARY_SET_LEN(ary, capa);
- rb_ary_transient_heap_evacuate(ary, TRUE);
return ary;
}
@@ -786,29 +552,7 @@ void
rb_ary_free(VALUE ary)
{
if (ARY_OWNS_HEAP_P(ary)) {
- if (USE_DEBUG_COUNTER &&
- !ARY_SHARED_ROOT_P(ary) &&
- ARY_HEAP_CAPA(ary) > RARRAY_LEN(ary)) {
- RB_DEBUG_COUNTER_INC(obj_ary_extracapa);
- }
-
- if (RARRAY_TRANSIENT_P(ary)) {
- RB_DEBUG_COUNTER_INC(obj_ary_transient);
- }
- else {
- RB_DEBUG_COUNTER_INC(obj_ary_ptr);
- ary_heap_free(ary);
- }
- }
- else {
- RB_DEBUG_COUNTER_INC(obj_ary_embed);
- }
-
- if (ARY_SHARED_P(ary)) {
- RB_DEBUG_COUNTER_INC(obj_ary_shared);
- }
- if (ARY_SHARED_ROOT_P(ary) && ARY_SHARED_ROOT_OCCUPIED(ary)) {
- RB_DEBUG_COUNTER_INC(obj_ary_shared_root_occupied);
+ ruby_sized_xfree((void *)ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
}
}
@@ -816,7 +560,7 @@ 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;
@@ -828,51 +572,39 @@ ary_discard(VALUE ary)
{
rb_ary_free(ary);
RBASIC(ary)->flags |= RARRAY_EMBED_FLAG;
- RBASIC(ary)->flags &= ~(RARRAY_EMBED_LEN_MASK | RARRAY_TRANSIENT_FLAG);
+ RBASIC(ary)->flags &= ~RARRAY_EMBED_LEN_MASK;
}
static VALUE
ary_make_shared(VALUE ary)
{
assert(!ARY_EMBED_P(ary));
- ary_verify(ary);
-
if (ARY_SHARED_P(ary)) {
- return ARY_SHARED_ROOT(ary);
+ return ARY_SHARED(ary);
}
else if (ARY_SHARED_ROOT_P(ary)) {
return ary;
}
else if (OBJ_FROZEN(ary)) {
- rb_ary_transient_heap_evacuate(ary, TRUE);
ary_shrink_capa(ary);
FL_SET_SHARED_ROOT(ary);
- ARY_SET_SHARED_ROOT_REFCNT(ary, 1);
+ ARY_SET_SHARED_NUM(ary, 1);
return ary;
}
else {
long capa = ARY_CAPA(ary), len = RARRAY_LEN(ary);
- const VALUE *ptr;
NEWOBJ_OF(shared, struct RArray, 0, T_ARRAY | (RGENGC_WB_PROTECTED_ARRAY ? FL_WB_PROTECTED : 0));
-
- rb_ary_transient_heap_evacuate(ary, TRUE);
- ptr = ARY_HEAP_PTR(ary);
-
FL_UNSET_EMBED(shared);
+
ARY_SET_LEN((VALUE)shared, capa);
- ARY_SET_PTR((VALUE)shared, ptr);
- ary_mem_clear((VALUE)shared, len, capa - len);
+ ARY_SET_PTR((VALUE)shared, RARRAY_CONST_PTR(ary));
+ ary_mem_clear((VALUE)shared, len, capa - len);
FL_SET_SHARED_ROOT(shared);
- ARY_SET_SHARED_ROOT_REFCNT((VALUE)shared, 1);
+ ARY_SET_SHARED_NUM((VALUE)shared, 1);
FL_SET_SHARED(ary);
- RB_DEBUG_COUNTER_INC(obj_ary_shared_create);
ARY_SET_SHARED(ary, (VALUE)shared);
OBJ_FREEZE(shared);
-
- ary_verify((VALUE)shared);
- ary_verify(ary);
-
- return (VALUE)shared;
+ return (VALUE)shared;
}
}
@@ -883,7 +615,7 @@ ary_make_substitution(VALUE ary)
if (len <= RARRAY_EMBED_LEN_MAX) {
VALUE subst = rb_ary_new2(len);
- ary_memcpy(subst, 0, len, RARRAY_CONST_PTR_TRANSIENT(ary));
+ ary_memcpy(subst, 0, len, RARRAY_CONST_PTR(ary));
ARY_SET_EMBED_LEN(subst, len);
return subst;
}
@@ -898,31 +630,24 @@ 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);
-}
-
-MJIT_FUNC_EXPORTED VALUE
-rb_check_to_array(VALUE ary)
-{
- return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a);
+ return rb_check_convert_type(ary, T_ARRAY, "Array", "to_ary");
}
/*
* call-seq:
* Array.try_convert(obj) -> array or nil
*
- * Tries to convert +obj+ into an array, using the +to_ary+ method. Returns
- * the converted array or +nil+ if +obj+ cannot be converted.
+ * Tries to convert +obj+ into an array, using +to_ary+ method. Returns the
+ * converted array or +nil+ if +obj+ cannot be converted for any reason.
* This method can be used to check if an argument is an array.
*
* Array.try_convert([1]) #=> [1]
@@ -968,7 +693,7 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
* this array is created by passing the element's index to the given block
* and storing the return value.
*
- * Array.new(3) {|index| index ** 2}
+ * Array.new(3){ |index| index ** 2 }
* # => [0, 1, 4]
*
* == Common gotchas
@@ -992,7 +717,7 @@ rb_ary_s_try_convert(VALUE dummy, VALUE ary)
* version which uses the result of that block each time an element
* of the array needs to be initialized:
*
- * a = Array.new(2) {Hash.new}
+ * a = Array.new(2) { Hash.new }
* a[0]['cat'] = 'feline'
* a # => [{"cat"=>"feline"}, {}]
*
@@ -1006,8 +731,8 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
rb_ary_modify(ary);
if (argc == 0) {
- if (ARY_OWNS_HEAP_P(ary) && ARY_HEAP_PTR(ary) != NULL) {
- ary_heap_free(ary);
+ if (ARY_OWNS_HEAP_P(ary) && RARRAY_CONST_PTR(ary) != 0) {
+ ruby_sized_xfree((void *)RARRAY_CONST_PTR(ary), ARY_HEAP_SIZE(ary));
}
rb_ary_unshare_safe(ary);
FL_SET_EMBED(ary);
@@ -1058,7 +783,7 @@ rb_ary_initialize(int argc, VALUE *argv, VALUE ary)
/*
* Returns a new array populated with the given objects.
*
- * Array.[]( 1, 'a', /^A/) # => [1, "a", /^A/]
+ * Array.[]( 1, 'a', /^A/ ) # => [1, "a", /^A/]
* Array[ 1, 'a', /^A/ ] # => [1, "a", /^A/]
* [ 1, 'a', /^A/ ] # => [1, "a", /^A/]
*/
@@ -1114,7 +839,7 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
if (len <= RARRAY_EMBED_LEN_MAX) {
VALUE result = ary_alloc(klass);
- ary_memcpy(result, 0, len, RARRAY_CONST_PTR_TRANSIENT(ary) + offset);
+ ary_memcpy(result, 0, len, RARRAY_CONST_PTR(ary) + offset);
ARY_SET_EMBED_LEN(result, len);
return result;
}
@@ -1123,15 +848,12 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
FL_UNSET_EMBED(result);
shared = ary_make_shared(ary);
- ARY_SET_PTR(result, RARRAY_CONST_PTR_TRANSIENT(ary));
+ ARY_SET_PTR(result, RARRAY_CONST_PTR(ary));
ARY_SET_LEN(result, RARRAY_LEN(ary));
rb_ary_set_shared(result, shared);
ARY_INCREASE_PTR(result, offset);
ARY_SET_LEN(result, len);
-
- ary_verify(shared);
- ary_verify(result);
return result;
}
}
@@ -1151,17 +873,13 @@ enum ary_take_pos_flags
static VALUE
ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos_flags last)
{
+ VALUE nv;
long n;
long len;
long offset = 0;
- argc = rb_check_arity(argc, 0, 1);
- /* the case optional argument is omitted should be handled in
- * callers of this function. if another arity case is added,
- * this arity check needs to rewrite. */
- RUBY_ASSERT_ALWAYS(argc == 1);
-
- n = NUM2LONG(argv[0]);
+ rb_scan_args(argc, argv, "1", &nv);
+ n = NUM2LONG(nv);
len = RARRAY_LEN(ary);
if (n > len) {
n = len;
@@ -1183,10 +901,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 ] ]
*
*/
@@ -1194,13 +909,12 @@ ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos
VALUE
rb_ary_push(VALUE ary, VALUE item)
{
- long idx = RARRAY_LEN((ary_verify(ary), ary));
+ long idx = RARRAY_LEN(ary);
VALUE target_ary = ary_ensure_room_for_push(ary, 1);
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
+ RARRAY_PTR_USE(ary, ptr, {
RB_OBJ_WRITE(target_ary, &ptr[idx], item);
});
ARY_SET_LEN(ary, idx + 1);
- ary_verify(ary);
return ary;
}
@@ -1216,8 +930,7 @@ rb_ary_cat(VALUE ary, const VALUE *argv, long len)
/*
* call-seq:
- * ary.push(obj, ...) -> ary
- * ary.append(obj, ...) -> ary
+ * ary.push(obj, ... ) -> ary
*
* Append --- Pushes the given object(s) on to the end of this array. This
* expression returns the array itself, so several appends
@@ -1227,7 +940,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]
*/
@@ -1252,7 +965,6 @@ rb_ary_pop(VALUE ary)
}
--n;
ARY_SET_LEN(ary, n);
- ary_verify(ary);
return RARRAY_AREF(ary, n);
}
@@ -1286,7 +998,6 @@ rb_ary_pop_m(int argc, VALUE *argv, VALUE ary)
rb_ary_modify_check(ary);
result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_LAST);
ARY_INCREASE_LEN(ary, -RARRAY_LEN(result));
- ary_verify(ary);
return result;
}
@@ -1301,11 +1012,10 @@ rb_ary_shift(VALUE ary)
top = RARRAY_AREF(ary, 0);
if (!ARY_SHARED_P(ary)) {
if (len < ARY_DEFAULT_SIZE) {
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
+ RARRAY_PTR_USE(ary, ptr, {
MEMMOVE(ptr, ptr+1, VALUE, len-1);
}); /* WB: no new reference */
ARY_INCREASE_LEN(ary, -1);
- ary_verify(ary);
return top;
}
assert(!ARY_EMBED_P(ary)); /* ARY_EMBED_LEN_MAX < ARY_DEFAULT_SIZE */
@@ -1313,14 +1023,12 @@ rb_ary_shift(VALUE ary)
ARY_SET(ary, 0, Qnil);
ary_make_shared(ary);
}
- else if (ARY_SHARED_ROOT_OCCUPIED(ARY_SHARED_ROOT(ary))) {
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, ptr[0] = Qnil);
+ else if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
+ RARRAY_PTR_USE(ary, ptr, ptr[0] = Qnil);
}
ARY_INCREASE_PTR(ary, 1); /* shift ptr */
ARY_INCREASE_LEN(ary, -1);
- ary_verify(ary);
-
return top;
}
@@ -1360,39 +1068,20 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
rb_ary_modify_check(ary);
result = ary_take_first_or_last(argc, argv, ary, ARY_TAKE_FIRST);
n = RARRAY_LEN(result);
- rb_ary_behead(ary,n);
-
- return result;
-}
-
-MJIT_FUNC_EXPORTED VALUE
-rb_ary_behead(VALUE ary, long n)
-{
- if (n<=0) return ary;
-
- rb_ary_modify_check(ary);
if (ARY_SHARED_P(ary)) {
- if (ARY_SHARED_ROOT_OCCUPIED(ARY_SHARED_ROOT(ary))) {
- setup_occupied_shared:
+ if (ARY_SHARED_OCCUPIED(ARY_SHARED(ary))) {
ary_mem_clear(ary, 0, n);
}
ARY_INCREASE_PTR(ary, n);
}
else {
- if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
- RARRAY_PTR_USE_TRANSIENT(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);
- ary_verify(ary);
- return ary;
+ return result;
}
static VALUE
@@ -1408,12 +1097,11 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
}
if (ARY_SHARED_P(ary)) {
- VALUE shared_root = ARY_SHARED_ROOT(ary);
- capa = RARRAY_LEN(shared_root);
- if (ARY_SHARED_ROOT_OCCUPIED(shared_root) && capa > new_len) {
- rb_ary_modify_check(ary);
- head = RARRAY_CONST_PTR_TRANSIENT(ary);
- sharedp = RARRAY_CONST_PTR_TRANSIENT(shared_root);
+ VALUE shared = ARY_SHARED(ary);
+ capa = RARRAY_LEN(shared);
+ if (ARY_SHARED_OCCUPIED(shared) && capa > new_len) {
+ head = RARRAY_CONST_PTR(ary);
+ sharedp = RARRAY_CONST_PTR(shared);
goto makeroom_if_need;
}
}
@@ -1426,13 +1114,11 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
/* use shared array for big "queues" */
if (new_len > ARY_DEFAULT_SIZE * 4) {
- ary_verify(ary);
-
- /* make a room for unshifted items */
+ /* make a room for unshifted items */
capa = ARY_CAPA(ary);
ary_make_shared(ary);
- head = sharedp = RARRAY_CONST_PTR_TRANSIENT(ary);
+ head = sharedp = RARRAY_CONST_PTR(ary);
goto makeroom;
makeroom_if_need:
if (head - sharedp < argc) {
@@ -1444,18 +1130,15 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
head = sharedp + argc + room;
}
ARY_SET_PTR(ary, head - argc);
- assert(ARY_SHARED_ROOT_OCCUPIED(ARY_SHARED_ROOT(ary)));
-
- ary_verify(ary);
- return ARY_SHARED_ROOT(ary);
+ assert(ARY_SHARED_OCCUPIED(ARY_SHARED(ary)));
+ return ARY_SHARED(ary);
}
else {
/* sliding items */
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
+ RARRAY_PTR_USE(ary, ptr, {
MEMMOVE(ptr + argc, ptr, VALUE, len);
});
- ary_verify(ary);
return ary;
}
}
@@ -1463,7 +1146,6 @@ ary_ensure_room_for_unshift(VALUE ary, int argc)
/*
* call-seq:
* ary.unshift(obj, ...) -> ary
- * ary.prepend(obj, ...) -> ary
*
* Prepends objects to the front of +self+, moving other elements upwards.
* See also Array#shift for the opposite effect.
@@ -1511,7 +1193,10 @@ rb_ary_elt(VALUE ary, long offset)
VALUE
rb_ary_entry(VALUE ary, long offset)
{
- return rb_ary_entry_internal(ary, offset);
+ if (offset < 0) {
+ offset += RARRAY_LEN(ary);
+ }
+ return rb_ary_elt(ary, offset);
}
VALUE
@@ -1532,8 +1217,6 @@ rb_ary_subseq(VALUE ary, long beg, long len)
return ary_make_partial(ary, klass, beg, len);
}
-static VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e);
-
/*
* call-seq:
* ary[index] -> obj or nil
@@ -1573,29 +1256,21 @@ static VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e);
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);
-}
-
-MJIT_FUNC_EXPORTED 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));
@@ -1625,7 +1300,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));
@@ -1690,7 +1365,7 @@ rb_ary_last(int argc, const VALUE *argv, VALUE ary)
* call-seq:
* ary.fetch(index) -> obj
* ary.fetch(index, default) -> obj
- * ary.fetch(index) {|index| block} -> obj
+ * ary.fetch(index) { |index| block } -> obj
*
* Tries to return the element at position +index+, but throws an IndexError
* exception if the referenced +index+ lies outside of the array bounds. This
@@ -1698,15 +1373,14 @@ 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
* a.fetch(-1) #=> 44
* a.fetch(4, 'cat') #=> "cat"
- * a.fetch(100) {|i| puts "#{i} is out of bounds"}
+ * a.fetch(100) { |i| puts "#{i} is out of bounds" }
* #=> "100 is out of bounds"
*/
@@ -1741,10 +1415,10 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* ary.find_index(obj) -> int or nil
- * ary.find_index {|item| block} -> int or nil
+ * ary.find_index { |item| block } -> int or nil
* ary.find_index -> Enumerator
* ary.index(obj) -> int or nil
- * ary.index {|item| block} -> int or nil
+ * ary.index { |item| block } -> int or nil
* ary.index -> Enumerator
*
* Returns the _index_ of the first object in +ary+ such that the object is
@@ -1761,14 +1435,15 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
* a = [ "a", "b", "c" ]
* a.index("b") #=> 1
* a.index("z") #=> nil
- * a.index {|x| x == "b"} #=> 1
+ * a.index { |x| x == "b" } #=> 1
*/
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);
@@ -1783,11 +1458,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;
}
@@ -1795,7 +1479,7 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
/*
* call-seq:
* ary.rindex(obj) -> int or nil
- * ary.rindex {|item| block} -> int or nil
+ * ary.rindex { |item| block } -> int or nil
* ary.rindex -> Enumerator
*
* Returns the _index_ of the last object in +self+ <code>==</code> to +obj+.
@@ -1813,12 +1497,13 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
* a = [ "a", "b", "b", "b", "c" ]
* a.rindex("b") #=> 3
* a.rindex("z") #=> nil
- * a.rindex {|x| x == "b"} #=> 3
+ * a.rindex { |x| x == "b" } #=> 3
*/
static VALUE
rb_ary_rindex(int argc, VALUE *argv, VALUE ary)
{
+ const VALUE *ptr;
VALUE val;
long i = RARRAY_LEN(ary), len;
@@ -1837,14 +1522,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 > RARRAY_LEN(ary)) {
- break;
- }
+ if (i > (len = RARRAY_LEN(ary))) {
+ i = len;
+ }
+ ptr = RARRAY_CONST_PTR(ary);
}
return Qnil;
}
@@ -1859,10 +1551,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);
@@ -1877,11 +1569,14 @@ rb_ary_splice(VALUE ary, long beg, long len, const VALUE *rptr, long rlen)
len = olen - beg;
}
- {
- const VALUE *optr = RARRAY_CONST_PTR_TRANSIENT(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) {
@@ -1891,8 +1586,7 @@ 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_TRANSIENT(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);
}
@@ -1909,23 +1603,16 @@ rb_ary_splice(VALUE ary, long beg, long len, const VALUE *rptr, long rlen)
}
if (len != rlen) {
- RARRAY_PTR_USE_TRANSIENT(ary, ptr,
- MEMMOVE(ptr + beg + rlen, ptr + beg + len,
- VALUE, olen - (beg + len)));
+ RARRAY_PTR_USE(ary, ptr,
+ MEMMOVE(ptr + beg + rlen, ptr + beg + len,
+ VALUE, olen - (beg + len)));
ARY_SET_LEN(ary, alen);
}
if (rlen > 0) {
- if (rofs != -1) rptr = RARRAY_CONST_PTR_TRANSIENT(ary) + rofs;
- /* give up wb-protected ary */
- RB_OBJ_WB_UNPROTECT_FOR(ARRAY, ary);
-
- /* do not use RARRAY_PTR() because it can causes GC.
- * ary can contain T_NONE object because it is not cleared.
- */
- RARRAY_PTR_USE_TRANSIENT(ary, ptr,
- MEMMOVE(ptr + beg, rptr, VALUE, rlen));
+ MEMMOVE(RARRAY_PTR(ary) + beg, RARRAY_CONST_PTR(rpl), VALUE, rlen);
}
}
+ RB_GC_GUARD(rpl);
}
void
@@ -1981,12 +1668,11 @@ rb_ary_resize(VALUE ary, long len)
}
else {
if (olen > len + ARY_DEFAULT_SIZE) {
- ary_heap_realloc(ary, len);
+ SIZED_REALLOC_N(RARRAY(ary)->as.heap.ptr, VALUE, len, RARRAY(ary)->as.heap.aux.capa);
ARY_SET_CAPA(ary, len);
}
ARY_SET_HEAP_LEN(ary, len);
}
- ary_verify(ary);
return ary;
}
@@ -2029,13 +1715,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);
@@ -2045,11 +1731,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_TRANSIENT(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]);
@@ -2081,20 +1764,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;
}
@@ -2109,13 +1787,13 @@ ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
/*
* call-seq:
- * ary.each {|item| block} -> ary
+ * ary.each { |item| block } -> ary
* 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, " -- " }
@@ -2126,10 +1804,11 @@ ary_enum_length(VALUE ary, VALUE args, VALUE eobj)
*/
VALUE
-rb_ary_each(VALUE ary)
+rb_ary_each(VALUE array)
{
long i;
- ary_verify(ary);
+ volatile VALUE ary = array;
+
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_AREF(ary, i));
@@ -2139,7 +1818,7 @@ rb_ary_each(VALUE ary)
/*
* call-seq:
- * ary.each_index {|index| block} -> ary
+ * ary.each_index { |index| block } -> ary
* ary.each_index -> Enumerator
*
* Same as Array#each, but passes the +index+ of the element instead of the
@@ -2169,7 +1848,7 @@ rb_ary_each_index(VALUE ary)
/*
* call-seq:
- * ary.reverse_each {|item| block} -> ary
+ * ary.reverse_each { |item| block } -> ary
* ary.reverse_each -> Enumerator
*
* Same as Array#each, but traverses +self+ in reverse order.
@@ -2239,18 +1918,15 @@ rb_ary_dup(VALUE ary)
{
long len = RARRAY_LEN(ary);
VALUE dup = rb_ary_new2(len);
- ary_memcpy(dup, 0, len, RARRAY_CONST_PTR_TRANSIENT(ary));
+ ary_memcpy(dup, 0, len, RARRAY_CONST_PTR(ary));
ARY_SET_LEN(dup, len);
-
- ary_verify(ary);
- ary_verify(dup);
return dup;
}
VALUE
rb_ary_resurrect(VALUE ary)
{
- return ary_make_partial(ary, rb_cArray, 0, RARRAY_LEN(ary));
+ return rb_ary_new4(RARRAY_LEN(ary), RARRAY_CONST_PTR(ary));
}
extern VALUE rb_output_fs;
@@ -2287,6 +1963,7 @@ ary_join_0(VALUE ary, VALUE sep, long max, VALUE result)
if (i > 0 && !NIL_P(sep))
rb_str_buf_append(result, sep);
rb_str_buf_append(result, val);
+ if (OBJ_TAINTED(val)) OBJ_TAINT(result);
}
}
@@ -2303,10 +1980,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;
@@ -2317,7 +1991,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;
@@ -2331,13 +2004,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;
}
}
@@ -2347,9 +2024,11 @@ VALUE
rb_ary_join(VALUE ary, VALUE sep)
{
long len = 1, i;
+ int taint = FALSE;
VALUE val, tmp, result;
if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new(0, 0);
+ if (OBJ_TAINTED(ary)) taint = TRUE;
if (!NIL_P(sep)) {
StringValue(sep);
@@ -2363,6 +2042,7 @@ rb_ary_join(VALUE ary, VALUE sep)
int first;
result = rb_str_buf_new(len + (RARRAY_LEN(ary)-i)*10);
rb_enc_associate(result, rb_usascii_encoding());
+ if (taint) OBJ_TAINT(result);
ary_join_0(ary, sep, i, result);
first = i == 0;
ary_join_1(ary, ary, sep, i, result, &first);
@@ -2372,9 +2052,8 @@ rb_ary_join(VALUE ary, VALUE sep)
len += RSTRING_LEN(tmp);
}
- result = rb_str_new(0, len);
- rb_str_set_len(result, 0);
-
+ result = rb_str_buf_new(len);
+ if (taint) OBJ_TAINT(result);
ary_join_0(ary, sep, RARRAY_LEN(ary), result);
return result;
@@ -2386,16 +2065,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
@@ -2403,12 +2077,8 @@ rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
{
VALUE sep;
- if (rb_check_arity(argc, 0, 1) == 0 || NIL_P(sep = argv[0])) {
- sep = rb_output_fs;
- if (!NIL_P(sep)) {
- rb_warn("$, is set to non-nil value");
- }
- }
+ rb_scan_args(argc, argv, "01", &sep);
+ if (NIL_P(sep)) sep = rb_output_fs;
return rb_ary_join(ary, sep);
}
@@ -2416,6 +2086,7 @@ rb_ary_join_m(int argc, VALUE *argv, VALUE ary)
static VALUE
inspect_ary(VALUE ary, VALUE dummy, int recur)
{
+ int tainted = OBJ_TAINTED(ary);
long i;
VALUE s, str;
@@ -2423,11 +2094,13 @@ inspect_ary(VALUE ary, VALUE dummy, int recur)
str = rb_str_buf_new2("[");
for (i=0; i<RARRAY_LEN(ary); i++) {
s = rb_inspect(RARRAY_AREF(ary, i));
+ if (OBJ_TAINTED(s)) tainted = TRUE;
if (i > 0) rb_str_buf_cat2(str, ", ");
else rb_enc_copy(str, s);
rb_str_buf_append(str, s);
}
rb_str_buf_cat2(str, "]");
+ if (tainted) OBJ_TAINT(str);
return str;
}
@@ -2436,8 +2109,7 @@ inspect_ary(VALUE ary, VALUE dummy, int recur)
* ary.inspect -> string
* ary.to_s -> string
*
- * Creates a string representation of +self+, by calling #inspect
- * on each element.
+ * Creates a string representation of +self+.
*
* [ "a", "b", "c" ].to_s #=> "[\"a\", \"b\", \"c\"]"
*/
@@ -2477,36 +2149,25 @@ rb_ary_to_a(VALUE ary)
/*
* call-seq:
- * ary.to_h -> hash
- * ary.to_h {|item| block } -> hash
+ * ary.to_h -> hash
*
* Returns the result of interpreting <i>ary</i> as an array of
* <tt>[key, value]</tt> pairs.
*
* [[:foo, :bar], [1, 2]].to_h
* # => {:foo => :bar, 1 => 2}
- *
- * If a block is given, the results of the block on each element of
- * the array will be used as pairs.
- *
- * ["foo", "bar"].to_h {|s| [s.ord, s]}
- * # => {102=>"foo", 98=>"bar"}
*/
static VALUE
rb_ary_to_h(VALUE ary)
{
long i;
- VALUE hash = rb_hash_new_with_size(RARRAY_LEN(ary));
- int block_given = rb_block_given_p();
-
+ VALUE hash = rb_hash_new();
for (i=0; i<RARRAY_LEN(ary); i++) {
- const VALUE e = rb_ary_elt(ary, i);
- const VALUE elt = block_given ? rb_yield_force_blockarg(e) : e;
- 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)",
@@ -2548,9 +2209,9 @@ rb_ary_reverse(VALUE ary)
rb_ary_modify(ary);
if (len > 1) {
- RARRAY_PTR_USE_TRANSIENT(ary, p1, {
- p2 = p1 + len - 1; /* points last item */
- ary_reverse(p1, p2);
+ RARRAY_PTR_USE(ary, p1, {
+ p2 = p1 + len - 1; /* points last item */
+ ary_reverse(p1, p2);
}); /* WB: no new reference */
}
return ary;
@@ -2590,8 +2251,8 @@ rb_ary_reverse_m(VALUE ary)
VALUE dup = rb_ary_new2(len);
if (len > 0) {
- const VALUE *p1 = RARRAY_CONST_PTR_TRANSIENT(ary);
- VALUE *p2 = (VALUE *)RARRAY_CONST_PTR_TRANSIENT(dup) + len - 1;
+ const VALUE *p1 = RARRAY_CONST_PTR(ary);
+ VALUE *p2 = (VALUE *)RARRAY_CONST_PTR(dup) + len - 1;
do *p2-- = *p1++; while (--len > 0);
}
ARY_SET_LEN(dup, RARRAY_LEN(ary));
@@ -2604,27 +2265,24 @@ rotate_count(long cnt, long len)
return (cnt < 0) ? (len - (~cnt % len) - 1) : (cnt % len);
}
-static void
-ary_rotate_ptr(VALUE *ptr, long len, long cnt)
-{
- --len;
- if (cnt < len) ary_reverse(ptr + cnt, ptr + len);
- if (--cnt > 0) ary_reverse(ptr, ptr + cnt);
- if (len > 0) ary_reverse(ptr, ptr + len);
-}
-
VALUE
rb_ary_rotate(VALUE ary, long cnt)
{
rb_ary_modify(ary);
if (cnt != 0) {
- long len = RARRAY_LEN(ary);
- if (len > 0 && (cnt = rotate_count(cnt, len)) > 0) {
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, ary_rotate_ptr(ptr, len, cnt));
- return ary;
- }
+ VALUE *ptr = RARRAY_PTR(ary);
+ long len = RARRAY_LEN(ary);
+
+ if (len > 0 && (cnt = rotate_count(cnt, len)) > 0) {
+ --len;
+ if (cnt < len) ary_reverse(ptr + cnt, ptr + len);
+ if (--cnt > 0) ary_reverse(ptr, ptr + cnt);
+ if (len > 0) ary_reverse(ptr, ptr + len);
+ return ary;
+ }
}
+
return Qnil;
}
@@ -2648,7 +2306,13 @@ rb_ary_rotate(VALUE ary, long cnt)
static VALUE
rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary)
{
- long n = (rb_check_arity(argc, 0, 1) ? NUM2LONG(argv[0]) : 1);
+ long n = 1;
+
+ switch (argc) {
+ case 1: n = NUM2LONG(argv[0]);
+ case 0: break;
+ default: rb_scan_args(argc, argv, "01", NULL);
+ }
rb_ary_rotate(ary, n);
return ary;
}
@@ -2675,14 +2339,19 @@ rb_ary_rotate_m(int argc, VALUE *argv, VALUE ary)
{
VALUE rotated;
const VALUE *ptr;
- long len;
- long cnt = (rb_check_arity(argc, 0, 1) ? NUM2LONG(argv[0]) : 1);
+ long len, cnt = 1;
+
+ switch (argc) {
+ case 1: cnt = NUM2LONG(argv[0]);
+ case 0: break;
+ default: rb_scan_args(argc, argv, "01", NULL);
+ }
len = RARRAY_LEN(ary);
rotated = rb_ary_new2(len);
if (len > 0) {
cnt = rotate_count(cnt, len);
- ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
+ ptr = RARRAY_CONST_PTR(ary);
len -= cnt;
ary_memcpy(rotated, 0, len, ptr + cnt);
ary_memcpy(rotated, len, cnt, ptr);
@@ -2693,9 +2362,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)
{
@@ -2711,12 +2397,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;
@@ -2730,17 +2413,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);
@@ -2752,25 +2432,22 @@ sort_2(const void *ap, const void *bp, void *dummy)
/*
* call-seq:
* ary.sort! -> ary
- * ary.sort! {|a, b| block} -> ary
+ * ary.sort! { |a, b| block } -> ary
*
* Sorts +self+ in place.
*
* 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
@@ -2782,20 +2459,21 @@ rb_ary_sort_bang(VALUE ary)
VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */
struct ary_sort_data data;
long len = RARRAY_LEN(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);
+ ruby_qsort(ptr, len, sizeof(VALUE),
+ rb_block_given_p()?sort_1:sort_2, &data);
}); /* WB: no new reference */
rb_ary_modify(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));
}
@@ -2814,52 +2492,44 @@ rb_ary_sort_bang(VALUE ary)
rb_ary_unshare(ary);
}
else {
- ary_heap_free(ary);
+ ruby_sized_xfree((void *)ARY_HEAP_PTR(ary), ARY_HEAP_SIZE(ary));
}
- ARY_SET_PTR(ary, ARY_HEAP_PTR(tmp));
+ ARY_SET_PTR(ary, RARRAY_CONST_PTR(tmp));
ARY_SET_HEAP_LEN(ary, len);
- ARY_SET_CAPA(ary, ARY_HEAP_LEN(tmp));
+ ARY_SET_CAPA(ary, RARRAY_LEN(tmp));
}
/* tmp was lost ownership for the ptr */
FL_UNSET(tmp, FL_FREEZE);
FL_SET_EMBED(tmp);
ARY_SET_EMBED_LEN(tmp, 0);
FL_SET(tmp, FL_FREEZE);
- }
+ }
/* tmp will be GC'ed. */
RBASIC_SET_CLASS_RAW(tmp, rb_cArray); /* rb_cArray must be marked */
}
- ary_verify(ary);
return ary;
}
/*
* call-seq:
* ary.sort -> new_ary
- * ary.sort {|a, b| block} -> new_ary
+ * ary.sort { |a, b| block } -> new_ary
*
* Returns a new array created by sorting +self+.
*
* Comparisons for the sort will be done using the <code><=></code> operator
* or using an optional code block.
*
- * The block must implement a comparison between +a+ and +b+ and return
- * 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"]
- *
- * To produce the reverse order, the following can also be used
- * (and may be faster):
- *
- * ary.sort.reverse! #=> ["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
@@ -2870,8 +2540,6 @@ rb_ary_sort(VALUE ary)
return ary;
}
-static VALUE rb_ary_bsearch_index(VALUE ary);
-
/*
* call-seq:
* ary.bsearch {|x| block } -> elem
@@ -2879,12 +2547,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
@@ -2902,7 +2570,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,
@@ -2928,30 +2596,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;
@@ -2962,8 +2606,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;
@@ -2974,16 +2618,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;
@@ -2992,8 +2636,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);
}
@@ -3005,18 +2650,14 @@ sort_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, dummy))
/*
* call-seq:
- * ary.sort_by! {|obj| block} -> ary
+ * ary.sort_by! { |obj| block } -> ary
* ary.sort_by! -> Enumerator
*
* Sorts +self+ in place using a set of keys generated by mapping the
* values in +self+ through the given block.
*
- * 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
@@ -3034,8 +2675,8 @@ rb_ary_sort_by_bang(VALUE ary)
/*
* call-seq:
- * ary.collect {|item| block} -> new_ary
- * ary.map {|item| block} -> new_ary
+ * ary.collect { |item| block } -> new_ary
+ * ary.map { |item| block } -> new_ary
* ary.collect -> Enumerator
* ary.map -> Enumerator
*
@@ -3048,9 +2689,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
@@ -3062,7 +2703,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(RARRAY_AREF(ary, i)));
+ rb_ary_push(collect, rb_yield(RARRAY_AREF(ary, i)));
}
return collect;
}
@@ -3128,34 +2769,6 @@ rb_get_values_at(VALUE obj, long olen, int argc, const VALUE *argv, VALUE (*func
return result;
}
-static VALUE
-append_values_at_single(VALUE result, VALUE ary, long olen, VALUE idx)
-{
- long beg, len;
- if (FIXNUM_P(idx)) {
- beg = FIX2LONG(idx);
- }
- /* check if idx is Range */
- else if (rb_range_beg_len(idx, &beg, &len, olen, 1)) {
- if (len > 0) {
- const VALUE *const src = RARRAY_CONST_PTR_TRANSIENT(ary);
- const long end = beg + len;
- const long prevlen = RARRAY_LEN(result);
- if (beg < olen) {
- rb_ary_cat(result, src + beg, end > olen ? olen-beg : len);
- }
- if (end > olen) {
- rb_ary_store(result, prevlen + len - 1, Qnil);
- }
- }
- return result;
- }
- else {
- beg = NUM2LONG(idx);
- }
- return rb_ary_push(result, rb_ary_entry(ary, beg));
-}
-
/*
* call-seq:
* ary.values_at(selector, ...) -> new_ary
@@ -3177,36 +2790,26 @@ append_values_at_single(VALUE result, VALUE ary, long olen, VALUE idx)
static VALUE
rb_ary_values_at(int argc, VALUE *argv, VALUE ary)
{
- long i, olen = RARRAY_LEN(ary);
- VALUE result = rb_ary_new_capa(argc);
- for (i = 0; i < argc; ++i) {
- append_values_at_single(result, ary, olen, argv[i]);
- }
- RB_GC_GUARD(ary);
- return result;
+ return rb_get_values_at(ary, RARRAY_LEN(ary), argc, argv, rb_ary_entry);
}
/*
* call-seq:
- * ary.select {|item| block} -> new_ary
+ * ary.select { |item| block } -> new_ary
* ary.select -> Enumerator
- * ary.filter {|item| block} -> new_ary
- * ary.filter -> Enumerator
*
* Returns a new array containing all elements of +ary+
* for which the given +block+ returns a true value.
*
* If no block is given, an Enumerator is returned instead.
*
- * [1,2,3,4,5].select {|num| num.even? } #=> [2, 4]
+ * [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
*
- * a = %w[ a b c d e f ]
- * a.select {|v| v =~ /[aeiou]/ } #=> ["a", "e"]
+ * a = %w{ a b c d e f }
+ * a.select { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
*
* See also Enumerable#select.
- *
- * Array#filter is an alias for Array#select.
*/
static VALUE
@@ -3225,99 +2828,58 @@ 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_TRANSIENT(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
- * ary.select! -> Enumerator
- * ary.filter! {|item| block } -> ary or nil
- * ary.filter! -> Enumerator
+ * ary.select! {|item| block } -> ary or nil
+ * ary.select! -> Enumerator
*
* Invokes the given block passing in successive elements from +self+,
* deleting elements for which the block returns a +false+ value.
*
- * 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+.
*
- * If no block is given, an Enumerator is returned instead.
+ * See also Array#keep_if
*
- * See also Array#keep_if.
+ * If no block is given, an Enumerator is returned instead.
*
- * Array#filter! is an alias for Array#select!.
*/
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;
}
/*
* call-seq:
- * ary.keep_if {|item| block} -> ary
+ * ary.keep_if { |item| block } -> ary
* ary.keep_if -> Enumerator
*
* Deletes every element of +self+ for which the given block evaluates to
- * +false+, and returns +self+.
+ * +false+.
*
- * If no block is given, an Enumerator is returned instead.
+ * See also Array#select!
*
- * a = %w[ a b c d e f ]
- * a.keep_if {|v| v =~ /[aeiou]/ } #=> ["a", "e"]
- * a #=> ["a", "e"]
+ * If no block is given, an Enumerator is returned instead.
*
- * See also Array#select!.
+ * a = %w{ a b c d e f }
+ * a.keep_if { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
*/
static VALUE
@@ -3344,7 +2906,7 @@ ary_resize_smaller(VALUE ary, long len)
/*
* call-seq:
* ary.delete(obj) -> item or nil
- * ary.delete(obj) {block} -> item or result of block
+ * ary.delete(obj) { block } -> item or result of block
*
* Deletes all items from +self+ that are equal to +obj+.
*
@@ -3358,7 +2920,7 @@ ary_resize_smaller(VALUE ary, long len)
* a.delete("b") #=> "b"
* a #=> ["a", "c"]
* a.delete("z") #=> nil
- * a.delete("z") {"not found"} #=> "not found"
+ * a.delete("z") { "not found" } #=> "not found"
*/
VALUE
@@ -3388,7 +2950,6 @@ rb_ary_delete(VALUE ary, VALUE item)
ary_resize_smaller(ary, i2);
- ary_verify(ary);
return v;
}
@@ -3429,11 +2990,11 @@ rb_ary_delete_at(VALUE ary, long pos)
rb_ary_modify(ary);
del = RARRAY_AREF(ary, pos);
- RARRAY_PTR_USE_TRANSIENT(ary, ptr, {
- MEMMOVE(ptr+pos, ptr+pos+1, VALUE, len-pos-1);
+ RARRAY_PTR_USE(ary, ptr, {
+ MEMMOVE(ptr+pos, ptr+pos+1, VALUE, len-pos-1);
});
ARY_INCREASE_LEN(ary, -1);
- ary_verify(ary);
+
return del;
}
@@ -3501,13 +3062,16 @@ rb_ary_slice_bang(int argc, VALUE *argv, VALUE ary)
len = orig_len - pos;
}
if (len == 0) return rb_ary_new2(0);
- arg2 = rb_ary_new4(len, RARRAY_CONST_PTR_TRANSIENT(ary)+pos);
+ 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;
}
- rb_check_arity(argc, 1, 2);
+ if (argc != 1) {
+ /* error report */
+ rb_scan_args(argc, argv, "11", NULL, NULL);
+ }
arg1 = argv[0];
if (!FIXNUM_P(arg1)) {
@@ -3534,8 +3098,7 @@ ary_reject(VALUE orig, VALUE result)
for (i = 0; i < RARRAY_LEN(orig); i++) {
VALUE v = RARRAY_AREF(orig, i);
-
- if (!RTEST(rb_yield(v))) {
+ if (!RTEST(rb_yield(v))) {
rb_ary_push(result, v);
}
}
@@ -3543,42 +3106,35 @@ ary_reject(VALUE orig, VALUE result)
}
static VALUE
-reject_bang_i(VALUE a)
+ary_reject_bang(VALUE ary)
{
- volatile struct select_bang_arg *arg = (void *)a;
- VALUE ary = arg->ary;
- long i1, i2;
+ long i;
+ VALUE result = Qnil;
- 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);
+ rb_ary_modify_check(ary);
+ for (i = 0; i < RARRAY_LEN(ary); ) {
+ VALUE v = RARRAY_AREF(ary, i);
+ if (RTEST(rb_yield(v))) {
+ rb_ary_delete_at(ary, i);
+ result = ary;
+ }
+ else {
+ i++;
}
- arg->len[1] = ++i2;
}
- return (i1 == i2) ? Qnil : ary;
-}
-
-static VALUE
-ary_reject_bang(VALUE ary)
-{
- struct select_bang_arg args;
- rb_ary_modify_check(ary);
- args.ary = ary;
- args.len[0] = args.len[1] = 0;
- return rb_ensure(reject_bang_i, (VALUE)&args, select_bang_ensure, (VALUE)&args);
+ return result;
}
/*
* call-seq:
- * ary.reject! {|item| block} -> ary or nil
+ * 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.
*
@@ -3589,7 +3145,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);
}
@@ -3599,7 +3154,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
*
@@ -3619,7 +3174,7 @@ rb_ary_reject(VALUE ary)
/*
* call-seq:
- * ary.delete_if {|item| block} -> ary
+ * ary.delete_if { |item| block } -> ary
* ary.delete_if -> Enumerator
*
* Deletes every element of +self+ for which block evaluates to +true+.
@@ -3638,7 +3193,6 @@ rb_ary_reject(VALUE ary)
static VALUE
rb_ary_delete_if(VALUE ary)
{
- ary_verify(ary);
RETURN_SIZED_ENUMERATOR(ary, 0, 0, ary_enum_length);
ary_reject_bang(ary);
return ary;
@@ -3648,8 +3202,7 @@ static VALUE
take_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, cbarg))
{
VALUE *args = (VALUE *)cbarg;
- if (args[1] == 0) rb_iter_break();
- else args[1]--;
+ if (args[1]-- == 0) rb_iter_break();
if (argc > 1) val = rb_ary_new4(argc, argv);
rb_ary_push(args[0], val);
return Qnil;
@@ -3674,7 +3227,7 @@ take_items(VALUE obj, long n)
/*
* call-seq:
* ary.zip(arg, ...) -> new_ary
- * ary.zip(arg, ...) {|arr| block} -> nil
+ * ary.zip(arg, ...) { |arr| block } -> nil
*
* Converts any arguments to arrays, then merges elements of +self+ with
* corresponding elements from each argument.
@@ -3815,36 +3368,35 @@ rb_ary_replace(VALUE copy, VALUE orig)
if (copy == orig) return copy;
if (RARRAY_LEN(orig) <= RARRAY_EMBED_LEN_MAX) {
- VALUE shared_root = 0;
+ VALUE shared = 0;
if (ARY_OWNS_HEAP_P(copy)) {
- ary_heap_free(copy);
+ RARRAY_PTR_USE(copy, ptr, ruby_sized_xfree(ptr, ARY_HEAP_SIZE(copy)));
}
else if (ARY_SHARED_P(copy)) {
- shared_root = ARY_SHARED_ROOT(copy);
+ shared = ARY_SHARED(copy);
FL_UNSET_SHARED(copy);
}
FL_SET_EMBED(copy);
- ary_memcpy(copy, 0, RARRAY_LEN(orig), RARRAY_CONST_PTR_TRANSIENT(orig));
- if (shared_root) {
- rb_ary_decrement_share(shared_root);
+ ary_memcpy(copy, 0, RARRAY_LEN(orig), RARRAY_CONST_PTR(orig));
+ if (shared) {
+ rb_ary_decrement_share(shared);
}
ARY_SET_LEN(copy, RARRAY_LEN(orig));
}
else {
- VALUE shared_root = ary_make_shared(orig);
+ VALUE shared = ary_make_shared(orig);
if (ARY_OWNS_HEAP_P(copy)) {
- ary_heap_free(copy);
+ RARRAY_PTR_USE(copy, ptr, ruby_sized_xfree(ptr, ARY_HEAP_SIZE(copy)));
}
else {
rb_ary_unshare_safe(copy);
}
FL_UNSET_EMBED(copy);
- ARY_SET_PTR(copy, ARY_HEAP_PTR(orig));
- ARY_SET_LEN(copy, ARY_HEAP_LEN(orig));
- rb_ary_set_shared(copy, shared_root);
+ ARY_SET_PTR(copy, RARRAY_CONST_PTR(orig));
+ ARY_SET_LEN(copy, RARRAY_LEN(orig));
+ rb_ary_set_shared(copy, shared);
}
- ary_verify(copy);
return copy;
}
@@ -3862,20 +3414,16 @@ VALUE
rb_ary_clear(VALUE ary)
{
rb_ary_modify_check(ary);
+ ARY_SET_LEN(ary, 0);
if (ARY_SHARED_P(ary)) {
if (!ARY_EMBED_P(ary)) {
rb_ary_unshare(ary);
FL_SET_EMBED(ary);
- ARY_SET_EMBED_LEN(ary, 0);
}
}
- else {
- ARY_SET_LEN(ary, 0);
- if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
- ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2);
- }
+ else if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) {
+ ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2);
}
- ary_verify(ary);
return ary;
}
@@ -3883,10 +3431,10 @@ rb_ary_clear(VALUE ary)
* call-seq:
* ary.fill(obj) -> ary
* ary.fill(obj, start [, length]) -> ary
- * ary.fill(obj, range) -> ary
- * ary.fill {|index| block} -> ary
- * ary.fill(start [, length]) {|index| block} -> ary
- * ary.fill(range) {|index| block} -> ary
+ * ary.fill(obj, range ) -> ary
+ * ary.fill { |index| block } -> ary
+ * ary.fill(start [, length] ) { |index| block } -> ary
+ * ary.fill(range) { |index| block } -> ary
*
* The first three forms set the selected elements of +self+ (which
* may be the entire array) to +obj+.
@@ -3905,17 +3453,19 @@ rb_ary_clear(VALUE ary)
* a.fill("x") #=> ["x", "x", "x", "x"]
* a.fill("z", 2, 2) #=> ["x", "x", "z", "z"]
* a.fill("y", 0..1) #=> ["y", "y", "z", "z"]
- * a.fill {|i| i*i} #=> [0, 1, 4, 9]
- * a.fill(-2) {|i| i*i*i} #=> [0, 1, 8, 27]
+ * a.fill { |i| i*i } #=> [0, 1, 4, 9]
+ * a.fill(-2) { |i| i*i*i } #=> [0, 1, 8, 27]
*/
static VALUE
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 */
}
@@ -3957,7 +3507,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;
@@ -4008,69 +3558,38 @@ rb_ary_plus(VALUE x, VALUE y)
len = xlen + ylen;
z = rb_ary_new2(len);
- ary_memcpy(z, 0, xlen, RARRAY_CONST_PTR_TRANSIENT(x));
- ary_memcpy(z, xlen, ylen, RARRAY_CONST_PTR_TRANSIENT(y));
+ ary_memcpy(z, 0, xlen, RARRAY_CONST_PTR(x));
+ ary_memcpy(z, xlen, ylen, RARRAY_CONST_PTR(y));
ARY_SET_LEN(z, len);
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_TRANSIENT(y), n);
- }
- return x;
-}
-
/*
* call-seq:
- * ary.concat(other_ary1, other_ary2, ...) -> ary
- *
- * Appends the elements of <code>other_ary</code>s to +self+.
+ * ary.concat(other_ary) -> ary
*
- * [ "a", "b" ].concat( ["c", "d"]) #=> [ "a", "b", "c", "d" ]
- * [ "a" ].concat( ["b"], ["c", "d"]) #=> [ "a", "b", "c", "d" ]
- * [ "a" ].concat #=> [ "a" ]
+ * Appends the elements of +other_ary+ to +self+.
*
+ * [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
* a = [ 1, 2, 3 ]
- * a.concat( [ 4, 5 ])
+ * a.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);
- }
-
- ary_verify(ary);
- 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
@@ -4116,25 +3635,27 @@ rb_ary_times(VALUE ary, VALUE times)
ary2 = ary_new(rb_obj_class(ary), len);
ARY_SET_LEN(ary2, len);
- ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
+ ptr = RARRAY_CONST_PTR(ary);
t = RARRAY_LEN(ary);
if (0 < t) {
ary_memcpy(ary2, 0, t, ptr);
while (t <= len/2) {
- ary_memcpy(ary2, t, t, RARRAY_CONST_PTR_TRANSIENT(ary2));
+ ary_memcpy(ary2, t, t, RARRAY_CONST_PTR(ary2));
t *= 2;
}
if (t < len) {
- ary_memcpy(ary2, t, len-t, RARRAY_CONST_PTR_TRANSIENT(ary2));
+ ary_memcpy(ary2, t, len-t, RARRAY_CONST_PTR(ary2));
}
}
out:
+ OBJ_INFECT(ary2, ary);
+
return ary2;
}
/*
* 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>.
@@ -4169,7 +3690,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.
*
@@ -4209,7 +3730,6 @@ recursive_equal(VALUE ary1, VALUE ary2, int recur)
if (recur) return Qtrue; /* Subtle! */
- /* rb_equal() can evacuate ptrs */
p1 = RARRAY_CONST_PTR(ary1);
p2 = RARRAY_CONST_PTR(ary2);
len1 = RARRAY_LEN(ary1);
@@ -4222,8 +3742,8 @@ recursive_equal(VALUE ary1, VALUE ary2, int recur)
return Qfalse;
if (len1 < i)
return Qtrue;
- p1 = RARRAY_CONST_PTR(ary1) + i;
- p2 = RARRAY_CONST_PTR(ary2) + i;
+ p1 = RARRAY_CONST_PTR(ary1) + i;
+ p2 = RARRAY_CONST_PTR(ary2) + i;
}
else {
return Qfalse;
@@ -4260,7 +3780,7 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
return rb_equal(ary2, ary1);
}
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
- if (RARRAY_CONST_PTR_TRANSIENT(ary1) == RARRAY_CONST_PTR_TRANSIENT(ary2)) return Qtrue;
+ if (RARRAY_CONST_PTR(ary1) == RARRAY_CONST_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_equal, ary1, ary2, ary2);
}
@@ -4291,13 +3811,13 @@ rb_ary_eql(VALUE ary1, VALUE ary2)
if (ary1 == ary2) return Qtrue;
if (!RB_TYPE_P(ary2, T_ARRAY)) return Qfalse;
if (RARRAY_LEN(ary1) != RARRAY_LEN(ary2)) return Qfalse;
- if (RARRAY_CONST_PTR_TRANSIENT(ary1) == RARRAY_CONST_PTR_TRANSIENT(ary2)) return Qtrue;
+ if (RARRAY_CONST_PTR(ary1) == RARRAY_CONST_PTR(ary2)) return Qtrue;
return rb_exec_recursive_paired(recursive_eql, ary1, ary2, ary2);
}
/*
* call-seq:
- * ary.hash -> integer
+ * ary.hash -> fixnum
*
* Compute a hash-code for this array.
*
@@ -4321,7 +3841,7 @@ rb_ary_hash(VALUE ary)
h = rb_hash_uint(h, NUM2LONG(n));
}
h = rb_hash_end(h);
- return ST2FIX(h);
+ return LONG2FIX(h);
}
/*
@@ -4344,27 +3864,17 @@ rb_ary_includes(VALUE ary, VALUE item)
for (i=0; i<RARRAY_LEN(ary); i++) {
e = RARRAY_AREF(ary, i);
- if (rb_equal(e, item)) {
+ switch (rb_equal_opt(e, item)) {
+ case Qundef:
+ if (rb_equal(e, item)) return Qtrue;
+ break;
+ case Qtrue:
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)
@@ -4440,16 +3950,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;
@@ -4458,7 +3969,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);
}
@@ -4469,7 +3980,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;
}
@@ -4477,19 +3990,19 @@ 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_ST_TABLE_P(hash)) {
- st_table *tbl = RHASH_ST_TABLE(hash);
+ if (RHASH(hash)->ntbl) {
+ st_table *tbl = RHASH(hash)->ntbl;
+ RHASH(hash)->ntbl = 0;
st_free_table(tbl);
- RHASH_ST_CLEAR(hash);
}
+ RB_GC_GUARD(hash);
}
/*
@@ -4498,21 +4011,15 @@ ary_recycle_hash(VALUE hash)
*
* Array Difference
*
- * Returns a new array that is a copy of the original array, removing all
- * occurrences of any item that also appear in +other_ary+. The order is
- * preserved from the original array.
+ * Returns a new array that is a copy of the original array, removing any
+ * items that also appear in +other_ary+. The order is preserved from the
+ * original array.
*
* It compares elements using their #hash and #eql? methods for efficiency.
*
* [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
*
- * Note that while 1 and 2 were only present once in the array argument, and
- * were present twice in the receiver array, all occurrences of each Integer are
- * removed in the returned array.
- *
* If you need set-like behavior, see the library class Set.
- *
- * See also Array#difference.
*/
static VALUE
@@ -4522,21 +4029,11 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
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 (rb_hash_stlike_lookup(hash, RARRAY_AREF(ary1, i), NULL)) continue;
+ if (st_lookup(rb_hash_tbl_raw(hash), RARRAY_AREF(ary1, i), 0)) continue;
rb_ary_push(ary3, rb_ary_elt(ary1, i));
}
ary_recycle_hash(hash);
@@ -4545,80 +4042,15 @@ rb_ary_diff(VALUE ary1, VALUE ary2)
/*
* call-seq:
- * ary.difference(other_ary1, other_ary2, ...) -> new_ary
- *
- * Array Difference
- *
- * Returns a new array that is a copy of the original array, removing all
- * occurrences of any item that also appear in +other_ary+. The order is
- * preserved from the original array.
- *
- * It compares elements using their #hash and #eql? methods for efficiency.
- *
- * [ 1, 1, 2, 2, 3, 3, 4, 5 ].difference([ 1, 2, 4 ]) #=> [ 3, 3, 5 ]
- *
- * Note that while 1 and 2 were only present once in the array argument, and
- * were present twice in the receiver array, all occurrences of each Integer are
- * removed in the returned array.
- *
- * Multiple array arguments can be supplied and all occurrences of any element
- * in those supplied arrays that match the receiver will be removed from the
- * returned array.
- *
- * [ 1, 'c', :s, 'yep' ].difference([ 1 ], [ 'a', 'c' ]) #=> [ :s, "yep" ]
- *
- * If you need set-like behavior, see the library class Set.
- *
- * See also Array#-.
- */
-
-static VALUE
-rb_ary_difference_multi(int argc, VALUE *argv, VALUE ary)
-{
- VALUE ary_diff;
- long i, length;
- volatile VALUE t0;
- bool *is_hash = ALLOCV_N(bool, t0, argc);
- ary_diff = rb_ary_new();
- length = RARRAY_LEN(ary);
-
- for (i = 0; i < argc; i++) {
- argv[i] = to_ary(argv[i]);
- is_hash[i] = (length > SMALL_ARRAY_LEN && RARRAY_LEN(argv[i]) > SMALL_ARRAY_LEN);
- if (is_hash[i]) argv[i] = ary_make_hash(argv[i]);
- }
-
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- int j;
- VALUE elt = rb_ary_elt(ary, i);
- for (j = 0; j < argc; j++) {
- if (is_hash[j]) {
- if (rb_hash_stlike_lookup(argv[j], RARRAY_AREF(ary, i), NULL))
- break;
- }
- else {
- if (rb_ary_includes_by_eql(argv[j], elt)) break;
- }
- }
- if (j == argc) rb_ary_push(ary_diff, elt);
- }
-
- ALLOCV_END(t0);
-
- return ary_diff;
-}
-
-
-/*
- * 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.
@@ -4629,29 +4061,20 @@ static VALUE
rb_ary_and(VALUE ary1, VALUE ary2)
{
VALUE hash, ary3, v;
+ st_table *table;
st_data_t vv;
long i;
ary2 = to_ary(ary2);
ary3 = rb_ary_new();
- if (RARRAY_LEN(ary1) == 0 || 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;
- }
-
+ if (RARRAY_LEN(ary2) == 0) return ary3;
hash = ary_make_hash(ary2);
+ table = rb_hash_tbl_raw(hash);
for (i=0; i<RARRAY_LEN(ary1); i++) {
v = RARRAY_AREF(ary1, i);
vv = (st_data_t)v;
- if (rb_hash_stlike_delete(hash, &vv, 0)) {
+ if (st_delete(table, &vv, 0)) {
rb_ary_push(ary3, v);
}
}
@@ -4660,36 +4083,6 @@ rb_ary_and(VALUE ary1, VALUE ary2)
return ary3;
}
-/*
- * call-seq:
- * ary.intersection(other_ary1, other_ary2, ...) -> new_ary
- *
- * Set Intersection --- Returns a new array containing unique elements common
- * to +self+ and <code>other_ary</code>s. Order is preserved from the original
- * array.
- *
- * It compares elements using their #hash and #eql? methods for efficiency.
- *
- * [ 1, 1, 3, 5 ].intersection([ 3, 2, 1 ]) # => [ 1, 3 ]
- * [ "a", "b", "z" ].intersection([ "a", "b", "c" ], [ "b" ]) # => [ "b" ]
- * [ "a" ].intersection #=> [ "a" ]
- *
- * See also Array#&.
- */
-
-static VALUE
-rb_ary_intersection_multi(int argc, VALUE *argv, VALUE ary)
-{
- VALUE result = rb_ary_dup(ary);
- int i;
-
- for (i = 0; i < argc; i++) {
- result = rb_ary_and(result, argv[i]);
- }
-
- return result;
-}
-
static int
ary_hash_orset(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
{
@@ -4698,237 +4091,40 @@ ary_hash_orset(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
return ST_CONTINUE;
}
-static void
-rb_ary_union(VALUE ary_union, VALUE ary)
-{
- long i;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE elt = rb_ary_elt(ary, i);
- if (rb_ary_includes_by_eql(ary_union, elt)) continue;
- rb_ary_push(ary_union, elt);
- }
-}
-
-static void
-rb_ary_union_hash(VALUE hash, VALUE ary2)
-{
- long i;
- for (i = 0; i < RARRAY_LEN(ary2); i++) {
- VALUE elt = RARRAY_AREF(ary2, i);
- if (!rb_hash_stlike_update(hash, (st_data_t)elt, ary_hash_orset, (st_data_t)elt)) {
- RB_OBJ_WRITTEN(hash, Qundef, elt);
- }
- }
-}
-
/*
* call-seq:
* 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#union.
+ * See also Array#uniq.
*/
static VALUE
rb_ary_or(VALUE ary1, VALUE ary2)
{
VALUE hash, ary3;
+ long i;
ary2 = to_ary(ary2);
- if (RARRAY_LEN(ary1) + RARRAY_LEN(ary2) <= SMALL_ARRAY_LEN) {
- ary3 = rb_ary_new();
- rb_ary_union(ary3, ary1);
- rb_ary_union(ary3, ary2);
- return ary3;
- }
-
hash = ary_make_hash(ary1);
- rb_ary_union_hash(hash, ary2);
+ 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)) {
+ RB_OBJ_WRITTEN(hash, Qundef, elt);
+ }
+ }
ary3 = rb_hash_values(hash);
ary_recycle_hash(hash);
return ary3;
}
-/*
- * call-seq:
- * ary.union(other_ary1, other_ary2, ...) -> new_ary
- *
- * Set Union --- Returns a new array by joining <code>other_ary</code>s with +self+,
- * excluding any duplicates and preserving the order from the given arrays.
- *
- * It compares elements using their #hash and #eql? methods for efficiency.
- *
- * [ "a", "b", "c" ].union( [ "c", "d", "a" ] ) #=> [ "a", "b", "c", "d" ]
- * [ "a" ].union( ["e", "b"], ["a", "c", "b"] ) #=> [ "a", "e", "b", "c" ]
- * [ "a" ].union #=> [ "a" ]
- *
- * See also Array#|.
- */
-
-static VALUE
-rb_ary_union_multi(int argc, VALUE *argv, VALUE ary)
-{
- int i;
- long sum;
- VALUE hash, ary_union;
-
- sum = RARRAY_LEN(ary);
- for (i = 0; i < argc; i++) {
- argv[i] = to_ary(argv[i]);
- sum += RARRAY_LEN(argv[i]);
- }
-
- if (sum <= SMALL_ARRAY_LEN) {
- ary_union = rb_ary_new();
-
- rb_ary_union(ary_union, ary);
- for (i = 0; i < argc; i++) rb_ary_union(ary_union, argv[i]);
-
- return ary_union;
- }
-
- hash = ary_make_hash(ary);
- for (i = 0; i < argc; i++) rb_ary_union_hash(hash, argv[i]);
-
- ary_union = rb_hash_values(hash);
- ary_recycle_hash(hash);
- return ary_union;
-}
-
-/*
- * 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 Comparable;
- * 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;
-
- if (rb_check_arity(argc, 0, 1) && !NIL_P(num = argv[0]))
- 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 Comparable;
- * 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;
-
- if (rb_check_arity(argc, 0, 1) && !NIL_P(num = argv[0]))
- 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;
-}
-
-/*
- * call-seq:
- * ary.minmax -> [obj, obj]
- * ary.minmax {| a,b | block } -> [obj, obj]
- *
- * Returns a two element array which contains the minimum and the
- * maximum value in the array.
- *
- * Can be given an optional block to override the default comparison
- * method <code>a <=> b</code>.
- */
-static VALUE
-rb_ary_minmax(VALUE ary)
-{
- if (rb_block_given_p()) {
- return rb_call_super(0, NULL);
- }
- return rb_assoc_new(rb_ary_min(0, 0, ary), rb_ary_max(0, 0, ary));
-}
-
static int
push_value(st_data_t key, st_data_t val, st_data_t ary)
{
@@ -4939,7 +4135,7 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
/*
* call-seq:
* ary.uniq! -> ary or nil
- * ary.uniq! {|item| ...} -> ary or nil
+ * ary.uniq! { |item| ... } -> ary or nil
*
* Removes duplicate elements from +self+.
*
@@ -4948,8 +4144,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" ]
@@ -4959,7 +4153,7 @@ push_value(st_data_t key, st_data_t val, st_data_t ary)
* b.uniq! # => nil
*
* c = [["student","sam"], ["student","george"], ["teacher","matz"]]
- * c.uniq! {|s| s.first} # => [["student", "sam"], ["teacher", "matz"]]
+ * c.uniq! { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
*
*/
@@ -4988,7 +4182,7 @@ rb_ary_uniq_bang(VALUE ary)
FL_SET_EMBED(ary);
}
ary_resize_capa(ary, hash_size);
- rb_hash_foreach(hash, push_value, ary);
+ st_foreach(rb_hash_tbl_raw(hash), push_value, ary);
ary_recycle_hash(hash);
return ary;
@@ -4997,7 +4191,7 @@ rb_ary_uniq_bang(VALUE ary)
/*
* call-seq:
* ary.uniq -> new_ary
- * ary.uniq {|item| ...} -> new_ary
+ * ary.uniq { |item| ... } -> new_ary
*
* Returns a new array by removing duplicate values in +self+.
*
@@ -5005,13 +4199,11 @@ 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"]
*
* b = [["student","sam"], ["student","george"], ["teacher","matz"]]
- * b.uniq {|s| s.first} # => [["student", "sam"], ["teacher", "matz"]]
+ * b.uniq { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
*
*/
@@ -5020,11 +4212,9 @@ rb_ary_uniq(VALUE ary)
{
VALUE hash, uniq;
- if (RARRAY_LEN(ary) <= 1) {
- hash = 0;
- uniq = rb_ary_dup(ary);
- }
- else if (rb_block_given_p()) {
+ if (RARRAY_LEN(ary) <= 1)
+ return rb_ary_dup(ary);
+ if (rb_block_given_p()) {
hash = ary_make_hash_by(ary);
uniq = rb_hash_values(hash);
}
@@ -5033,9 +4223,7 @@ rb_ary_uniq(VALUE ary)
uniq = rb_hash_values(hash);
}
RBASIC_SET_CLASS(uniq, rb_obj_class(ary));
- if (hash) {
- ary_recycle_hash(hash);
- }
+ ary_recycle_hash(hash);
return uniq;
}
@@ -5059,14 +4247,14 @@ rb_ary_compact_bang(VALUE ary)
long n;
rb_ary_modify(ary);
- p = t = (VALUE *)RARRAY_CONST_PTR_TRANSIENT(ary); /* WB: no new reference */
+ p = t = (VALUE *)RARRAY_CONST_PTR(ary); /* WB: no new reference */
end = p + RARRAY_LEN(ary);
while (t < end) {
if (NIL_P(*t)) t++;
else *p++ = *t++;
}
- n = p - RARRAY_CONST_PTR_TRANSIENT(ary);
+ n = p - RARRAY_CONST_PTR(ary);
if (RARRAY_LEN(ary) == n) {
return Qnil;
}
@@ -5097,7 +4285,7 @@ rb_ary_compact(VALUE ary)
* call-seq:
* ary.count -> int
* ary.count(obj) -> int
- * ary.count {|item| block} -> int
+ * ary.count { |item| block } -> int
*
* Returns the number of elements.
*
@@ -5110,7 +4298,7 @@ rb_ary_compact(VALUE ary)
* ary = [1, 2, 4, 2]
* ary.count #=> 4
* ary.count(2) #=> 2
- * ary.count {|x| x%2 == 0} #=> 3
+ * ary.count { |x| x%2 == 0 } #=> 3
*
*/
@@ -5119,7 +4307,7 @@ rb_ary_count(int argc, VALUE *argv, VALUE ary)
{
long i, n = 0;
- if (rb_check_arity(argc, 0, 1) == 0) {
+ if (argc == 0) {
VALUE v;
if (!rb_block_given_p())
@@ -5131,8 +4319,9 @@ rb_ary_count(int argc, VALUE *argv, VALUE ary)
}
}
else {
- VALUE obj = argv[0];
+ VALUE obj;
+ rb_scan_args(argc, argv, "1", &obj);
if (rb_block_given_p()) {
rb_warn("given block not used");
}
@@ -5145,64 +4334,34 @@ rb_ary_count(int argc, VALUE *argv, VALUE ary)
}
static VALUE
-flatten(VALUE ary, int level)
+flatten(VALUE ary, int level, int *modified)
{
- long i;
- VALUE stack, result, tmp, elt, vmemo;
+ long i = 0;
+ VALUE stack, result, tmp, elt;
st_table *memo;
st_data_t id;
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- elt = RARRAY_AREF(ary, i);
- tmp = rb_check_array_type(elt);
- if (!NIL_P(tmp)) {
- break;
- }
- }
- if (i == RARRAY_LEN(ary)) {
- return ary;
- } else if (tmp == ary) {
- rb_raise(rb_eArgError, "tried to flatten recursive array");
- }
-
- result = ary_new(0, RARRAY_LEN(ary));
- ary_memcpy(result, 0, i, RARRAY_CONST_PTR_TRANSIENT(ary));
- ARY_SET_LEN(result, i);
-
stack = ary_new(0, ARY_DEFAULT_SIZE);
- rb_ary_push(stack, ary);
- rb_ary_push(stack, LONG2NUM(i + 1));
-
- vmemo = rb_hash_new();
- RBASIC_CLEAR_CLASS(vmemo);
+ result = ary_new(0, RARRAY_LEN(ary));
memo = st_init_numtable();
- rb_hash_st_table_set(vmemo, memo);
st_insert(memo, (st_data_t)ary, (st_data_t)Qtrue);
- st_insert(memo, (st_data_t)tmp, (st_data_t)Qtrue);
-
- ary = tmp;
- i = 0;
+ *modified = 0;
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_GC_GUARD(vmemo);
- st_clear(memo);
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 {
+ *modified = 1;
id = (st_data_t)tmp;
- if (st_is_member(memo, id)) {
- st_clear(memo);
+ if (st_lookup(memo, id, 0)) {
+ st_free_table(memo);
rb_raise(rb_eArgError, "tried to flatten recursive array");
}
st_insert(memo, id, (st_data_t)Qtrue);
@@ -5222,7 +4381,7 @@ flatten(VALUE ary, int level)
ary = rb_ary_pop(stack);
}
- st_clear(memo);
+ st_free_table(memo);
RBASIC_SET_CLASS(result, rb_obj_class(ary));
return result;
@@ -5254,13 +4413,14 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
int mod = 0, level = -1;
VALUE result, lv;
- lv = (rb_check_arity(argc, 0, 1) ? argv[0] : Qnil);
+ rb_scan_args(argc, argv, "01", &lv);
rb_ary_modify_check(ary);
if (!NIL_P(lv)) level = NUM2INT(lv);
if (level == 0) return Qnil;
- result = flatten(ary, level);
- if (result == ary) {
+ result = flatten(ary, level, &mod);
+ if (mod == 0) {
+ ary_discard(result);
return Qnil;
}
if (!(mod = ARY_EMBED_P(result))) rb_obj_freeze(result);
@@ -5295,18 +4455,15 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
static VALUE
rb_ary_flatten(int argc, VALUE *argv, VALUE ary)
{
- int level = -1;
- VALUE result;
+ int mod = 0, level = -1;
+ VALUE result, lv;
- if (rb_check_arity(argc, 0, 1) && !NIL_P(argv[0])) {
- level = NUM2INT(argv[0]);
- if (level == 0) return ary_make_shared_copy(ary);
- }
+ rb_scan_args(argc, argv, "01", &lv);
+ if (!NIL_P(lv)) level = NUM2INT(lv);
+ if (level == 0) return ary_make_shared_copy(ary);
- result = flatten(ary, level);
- if (result == ary) {
- result = ary_make_shared_copy(ary);
- }
+ result = flatten(ary, level, &mod);
+ OBJ_INFECT(result, ary);
return result;
}
@@ -5356,8 +4513,8 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
while (i) {
long j = RAND_UPTO(i);
VALUE tmp;
- if (len != RARRAY_LEN(ary) || ptr != RARRAY_CONST_PTR_TRANSIENT(ary)) {
- rb_raise(rb_eRuntimeError, "modified during shuffle");
+ if (len != RARRAY_LEN(ary) || ptr != RARRAY_CONST_PTR(ary)) {
+ rb_raise(rb_eRuntimeError, "modified during shuffle");
}
tmp = ptr[--i];
ptr[i] = ptr[j];
@@ -5409,14 +4566,11 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
* If the array is empty the first form returns +nil+ and the second form
* returns an empty array.
*
+ * The optional +rng+ argument will be used as the random number generator.
+ *
* a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
* a.sample #=> 7
* a.sample(4) #=> [6, 4, 2, 5]
- *
- * The optional +rng+ argument will be used as the random number generator.
- *
- * a.sample(random: Random.new(1)) #=> 6
- * a.sample(4, random: Random.new(1)) #=> [6, 10, 9, 2]
*/
@@ -5427,7 +4581,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;
@@ -5440,7 +4593,7 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
}
}
len = RARRAY_LEN(ary);
- if (rb_check_arity(argc, 0, 1) == 0) {
+ if (argc == 0) {
if (len < 2)
i = 0;
else
@@ -5448,7 +4601,7 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
return rb_ary_elt(ary, i);
}
- nv = argv[0];
+ rb_scan_args(argc, argv, "1", &nv);
n = NUM2LONG(nv);
if (n < 0) rb_raise(rb_eArgError, "negative sample number");
if (n > len) n = len;
@@ -5487,11 +4640,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];
@@ -5505,43 +4653,11 @@ rb_ary_sample(int argc, VALUE *argv, VALUE ary)
sorted[j] = idx[i] = k;
}
result = rb_ary_new_capa(n);
- RARRAY_PTR_USE_TRANSIENT(result, ptr_result, {
- for (i=0; i<n; i++) {
- ptr_result[i] = RARRAY_AREF(ary, idx[i]);
- }
- });
- }
- 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;
+ ptr_result[i] = RARRAY_AREF(ary, idx[i]);
}
- len = RARRAY_LEN(ary);
- if (len <= max_idx) n = 0;
- else if (n > len) n = len;
- RARRAY_PTR_USE_TRANSIENT(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);
@@ -5571,16 +4687,16 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
n = RARRAY_AREF(args, 0);
}
if (RARRAY_LEN(self) == 0) return INT2FIX(0);
- if (n == Qnil) return DBL2NUM(HUGE_VAL);
+ if (n == Qnil) return DBL2NUM(INFINITY);
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);
}
/*
* call-seq:
- * ary.cycle(n=nil) {|obj| block} -> nil
+ * ary.cycle(n=nil) { |obj| block } -> nil
* ary.cycle(n=nil) -> Enumerator
*
* Calls the given block for each element +n+ times or forever if +nil+ is
@@ -5593,8 +4709,8 @@ rb_ary_cycle_size(VALUE self, VALUE args, VALUE eobj)
* If no block is given, an Enumerator is returned instead.
*
* a = ["a", "b", "c"]
- * a.cycle {|x| puts x} # print, a, b, c, a, b, c,.. forever.
- * a.cycle(2) {|x| puts x} # print, a, b, c, a, b, c.
+ * a.cycle { |x| puts x } # print, a, b, c, a, b, c,.. forever.
+ * a.cycle(2) { |x| puts x } # print, a, b, c, a, b, c.
*
*/
@@ -5602,15 +4718,16 @@ static VALUE
rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
{
long n, i;
+ VALUE nv = Qnil;
- rb_check_arity(argc, 0, 1);
+ rb_scan_args(argc, argv, "01", &nv);
RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_cycle_size);
- if (argc == 0 || NIL_P(argv[0])) {
+ if (NIL_P(nv)) {
n = -1;
}
else {
- n = NUM2LONG(argv[0]);
+ n = NUM2LONG(nv);
if (n <= 0) return Qnil;
}
@@ -5622,6 +4739,8 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
return Qnil;
}
+#define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
+#define tmpbuf_discard(s) (rb_str_resize((s), 0L), RBASIC_SET_CLASS_RAW(s, rb_cString))
#define tmpary(n) rb_ary_tmp_new(n)
#define tmpary_discard(a) (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray))
@@ -5634,9 +4753,11 @@ static int
yield_indexed_values(const VALUE values, const long r, const long *const p)
{
const VALUE result = rb_ary_new2(r);
+ VALUE *const result_array = RARRAY_PTR(result);
+ const VALUE *const values_array = RARRAY_CONST_PTR(values);
long i;
- for (i = 0; i < r; i++) ARY_SET(result, i, RARRAY_AREF(values, p[i]));
+ for (i = 0; i < r; i++) result_array[i] = values_array[p[i]];
ARY_SET_LEN(result, r);
rb_yield(result);
return !RBASIC(values)->klass;
@@ -5645,8 +4766,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
@@ -5696,16 +4817,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;
}
@@ -5713,23 +4828,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
@@ -5743,9 +4851,9 @@ rb_ary_permutation_size(VALUE ary, VALUE args, VALUE eobj)
/*
* call-seq:
- * ary.permutation {|p| block} -> ary
+ * ary.permutation { |p| block } -> ary
* ary.permutation -> Enumerator
- * ary.permutation(n) {|p| block} -> ary
+ * ary.permutation(n) { |p| block } -> ary
* ary.permutation(n) -> Enumerator
*
* When invoked with a block, yield all permutations of length +n+ of the
@@ -5772,13 +4880,13 @@ rb_ary_permutation_size(VALUE ary, VALUE args, VALUE eobj)
static VALUE
rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
{
+ VALUE num;
long r, n, i;
n = RARRAY_LEN(ary); /* Array length */
RETURN_SIZED_ENUMERATOR(ary, argc, argv, rb_ary_permutation_size); /* Return enumerator if no block */
- r = n;
- if (rb_check_arity(argc, 0, 1) && !NIL_P(argv[0]))
- r = NUM2LONG(argv[0]); /* Permutation size from argument */
+ rb_scan_args(argc, argv, "01", &num);
+ r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
if (r < 0 || n < r) {
/* no permutations: yield nothing */
@@ -5793,7 +4901,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);
@@ -5839,7 +4947,7 @@ rb_ary_combination_size(VALUE ary, VALUE args, VALUE eobj)
/*
* call-seq:
- * ary.combination(n) {|c| block} -> ary
+ * ary.combination(n) { |c| block } -> ary
* ary.combination(n) -> Enumerator
*
* When invoked with a block, yields all combinations of length +n+ of elements
@@ -5877,7 +4985,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)));
}
}
@@ -5898,8 +5006,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
@@ -5934,19 +5042,19 @@ 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);
}
/*
* call-seq:
- * ary.repeated_permutation(n) {|p| block} -> ary
+ * ary.repeated_permutation(n) { |p| block } -> ary
* ary.repeated_permutation(n) -> Enumerator
*
* When invoked with a block, yield all repeated permutations of length +n+ of
@@ -6036,7 +5144,7 @@ rb_ary_repeated_combination_size(VALUE ary, VALUE args, VALUE eobj)
/*
* call-seq:
- * ary.repeated_combination(n) {|c| block} -> ary
+ * ary.repeated_combination(n) { |c| block } -> ary
* ary.repeated_combination(n) -> Enumerator
*
* When invoked with a block, yields all repeated combinations of length +n+ of
@@ -6076,7 +5184,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)));
}
}
@@ -6099,7 +5207,7 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
/*
* call-seq:
* ary.product(other_ary, ...) -> new_ary
- * ary.product(other_ary, ...) {|p| block} -> ary
+ * ary.product(other_ary, ...) { |p| block } -> ary
*
* Returns an array of all combinations of elements from all arrays.
*
@@ -6122,14 +5230,15 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
{
int n = argc+1; /* How many arrays we're operating on */
volatile VALUE t0 = tmpary(n);
- volatile VALUE t1 = Qundef;
+ volatile VALUE t1 = tmpbuf(n, sizeof(int));
VALUE *arrays = RARRAY_PTR(t0); /* The arrays we're computing the product of */
- int *counters = ALLOCV_N(int, t1, n); /* The current position in each one */
+ int *counters = (int*)RSTRING_PTR(t1); /* The current position in each one */
VALUE result = Qnil; /* The array we'll be returning, when no block given */
long i,j;
long resultlen = 1;
RBASIC_CLEAR_CLASS(t0);
+ RBASIC_CLEAR_CLASS(t1);
/* initialize the arrays of arrays */
ARY_SET_LEN(t0, n);
@@ -6200,7 +5309,7 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
}
done:
tmpary_discard(t0);
- ALLOCV_END(t1);
+ tmpbuf_discard(t1);
return NIL_P(result) ? ary : result;
}
@@ -6232,7 +5341,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
@@ -6243,7 +5352,7 @@ rb_ary_take(VALUE obj, VALUE n)
* See also Array#drop_while
*
* a = [1, 2, 3, 4, 5, 0]
- * a.take_while {|i| i < 3} #=> [1, 2]
+ * a.take_while { |i| i < 3 } #=> [1, 2]
*
*/
@@ -6291,7 +5400,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
@@ -6321,31 +5430,20 @@ rb_ary_drop_while(VALUE ary)
/*
* call-seq:
- * ary.any? [{|obj| block} ] -> true or false
- * ary.any?(pattern) -> true or false
+ * ary.any? [{ |obj| block }] -> true or false
*
* See also Enumerable#any?
*/
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) {
- if (rb_block_given_p()) {
- rb_warn("given block not used");
- }
- 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()) {
- for (i = 0; i < len; ++i) {
- if (RTEST(RARRAY_AREF(ary, i))) return Qtrue;
- }
+ if (!rb_block_given_p()) {
+ for (i = 0; i < len; ++i) if (RTEST(ptr[i])) return Qtrue;
}
else {
for (i = 0; i < RARRAY_LEN(ary); ++i) {
@@ -6356,328 +5454,6 @@ rb_ary_any_p(int argc, VALUE *argv, VALUE ary)
}
/*
- * call-seq:
- * ary.all? [{|obj| block} ] -> true or false
- * ary.all?(pattern) -> true or false
- *
- * See also Enumerable#all?
- */
-
-static VALUE
-rb_ary_all_p(int argc, VALUE *argv, VALUE ary)
-{
- long i, len = RARRAY_LEN(ary);
-
- rb_check_arity(argc, 0, 1);
- if (!len) return Qtrue;
- if (argc) {
- if (rb_block_given_p()) {
- rb_warn("given block not used");
- }
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (!RTEST(rb_funcall(argv[0], idEqq, 1, RARRAY_AREF(ary, i)))) return Qfalse;
- }
- }
- else if (!rb_block_given_p()) {
- for (i = 0; i < len; ++i) {
- if (!RTEST(RARRAY_AREF(ary, i))) return Qfalse;
- }
- }
- else {
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (!RTEST(rb_yield(RARRAY_AREF(ary, i)))) return Qfalse;
- }
- }
- return Qtrue;
-}
-
-/*
- * call-seq:
- * ary.none? [{|obj| block} ] -> true or false
- * ary.none?(pattern) -> true or false
- *
- * See also Enumerable#none?
- */
-
-static VALUE
-rb_ary_none_p(int argc, VALUE *argv, VALUE ary)
-{
- long i, len = RARRAY_LEN(ary);
-
- rb_check_arity(argc, 0, 1);
- if (!len) return Qtrue;
- if (argc) {
- if (rb_block_given_p()) {
- rb_warn("given block not used");
- }
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (RTEST(rb_funcall(argv[0], idEqq, 1, RARRAY_AREF(ary, i)))) return Qfalse;
- }
- }
- else if (!rb_block_given_p()) {
- for (i = 0; i < len; ++i) {
- if (RTEST(RARRAY_AREF(ary, i))) return Qfalse;
- }
- }
- else {
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) return Qfalse;
- }
- }
- return Qtrue;
-}
-
-/*
- * call-seq:
- * ary.one? [{|obj| block} ] -> true or false
- * ary.one?(pattern) -> true or false
- *
- * See also Enumerable#one?
- */
-
-static VALUE
-rb_ary_one_p(int argc, VALUE *argv, VALUE ary)
-{
- long i, len = RARRAY_LEN(ary);
- VALUE result = Qfalse;
-
- rb_check_arity(argc, 0, 1);
- if (!len) return Qfalse;
- if (argc) {
- if (rb_block_given_p()) {
- rb_warn("given block not used");
- }
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (RTEST(rb_funcall(argv[0], idEqq, 1, RARRAY_AREF(ary, i)))) {
- if (result) return Qfalse;
- result = Qtrue;
- }
- }
- }
- else if (!rb_block_given_p()) {
- for (i = 0; i < len; ++i) {
- if (RTEST(RARRAY_AREF(ary, i))) {
- if (result) return Qfalse;
- result = Qtrue;
- }
- }
- }
- else {
- for (i = 0; i < RARRAY_LEN(ary); ++i) {
- if (RTEST(rb_yield(RARRAY_AREF(ary, i)))) {
- if (result) return Qfalse;
- result = Qtrue;
- }
- }
- }
- return result;
-}
-
-/*
- * 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
- */
-
-static 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;
-
- v = (rb_check_arity(argc, 0, 1) ? argv[0] : 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;
- double x, t;
-
- f = NUM2DBL(v);
- c = 0.0;
- goto has_float_value;
- for (; i < RARRAY_LEN(ary); i++) {
- 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;
-}
-
-static VALUE
-rb_ary_deconstruct(VALUE ary)
-{
- return ary;
-}
-
-/*
* Arrays are ordered, integer-indexed collections of any object.
*
* Array indexing starts at 0, as in C or Java. A negative index is assumed
@@ -6710,12 +5486,11 @@ rb_ary_deconstruct(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:
*
- * empty_table = Array.new(3) {Array.new(3)}
+ * empty_table = Array.new(3) { Array.new(3) }
* #=> [[nil, nil, nil], [nil, nil, nil], [nil, nil, nil]]
*
* An array can also be created by using the Array() method, provided by
@@ -6862,7 +5637,7 @@ rb_ary_deconstruct(VALUE ary)
* Note that this operation leaves the array unchanged.
*
* arr = [1, 2, 3, 4, 5]
- * arr.each {|a| print a -= 10, " "}
+ * arr.each { |a| print a -= 10, " " }
* # prints: -9 -8 -7 -6 -5
* #=> [1, 2, 3, 4, 5]
*
@@ -6871,15 +5646,15 @@ rb_ary_deconstruct(VALUE ary)
*
* words = %w[first second third fourth fifth sixth]
* str = ""
- * words.reverse_each {|word| str += "#{word} "}
+ * words.reverse_each { |word| str += "#{word} " }
* p str #=> "sixth fifth fourth third second first "
*
* The #map method can be used to create a new array based on the original
* array, but with the values modified by the supplied block:
*
- * arr.map {|a| 2*a} #=> [2, 4, 6, 8, 10]
+ * arr.map { |a| 2*a } #=> [2, 4, 6, 8, 10]
* arr #=> [1, 2, 3, 4, 5]
- * arr.map! {|a| a**2} #=> [1, 4, 9, 16, 25]
+ * arr.map! { |a| a**2 } #=> [1, 4, 9, 16, 25]
* arr #=> [1, 4, 9, 16, 25]
*
* == Selecting Items from an Array
@@ -6893,9 +5668,9 @@ rb_ary_deconstruct(VALUE ary)
* === Non-destructive Selection
*
* arr = [1, 2, 3, 4, 5, 6]
- * arr.select {|a| a > 3} #=> [4, 5, 6]
- * arr.reject {|a| a < 3} #=> [3, 4, 5, 6]
- * arr.drop_while {|a| a < 4} #=> [4, 5, 6]
+ * arr.select { |a| a > 3 } #=> [4, 5, 6]
+ * arr.reject { |a| a < 3 } #=> [3, 4, 5, 6]
+ * arr.drop_while { |a| a < 4 } #=> [4, 5, 6]
* arr #=> [1, 2, 3, 4, 5, 6]
*
* === Destructive Selection
@@ -6906,11 +5681,11 @@ rb_ary_deconstruct(VALUE ary)
* Similar to #select vs. #reject, #delete_if and #keep_if have the exact
* opposite result when supplied with the same block:
*
- * arr.delete_if {|a| a < 4} #=> [4, 5, 6]
+ * arr.delete_if { |a| a < 4 } #=> [4, 5, 6]
* arr #=> [4, 5, 6]
*
* arr = [1, 2, 3, 4, 5, 6]
- * arr.keep_if {|a| a < 4} #=> [1, 2, 3]
+ * arr.keep_if { |a| a < 4 } #=> [1, 2, 3]
* arr #=> [1, 2, 3]
*
*/
@@ -6935,6 +5710,7 @@ Init_Array(void)
rb_define_method(rb_cArray, "to_a", rb_ary_to_a, 0);
rb_define_method(rb_cArray, "to_h", rb_ary_to_h, 0);
rb_define_method(rb_cArray, "to_ary", rb_ary_to_ary_m, 0);
+ rb_define_method(rb_cArray, "frozen?", rb_ary_frozen_p, 0);
rb_define_method(rb_cArray, "==", rb_ary_equal, 1);
rb_define_method(rb_cArray, "eql?", rb_ary_eql, 1);
@@ -6946,17 +5722,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, "union", rb_ary_union_multi, -1);
- rb_define_method(rb_cArray, "difference", rb_ary_difference_multi, -1);
- rb_define_method(rb_cArray, "intersection", rb_ary_intersection_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);
@@ -6981,8 +5752,6 @@ Init_Array(void)
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "select", rb_ary_select, 0);
rb_define_method(rb_cArray, "select!", rb_ary_select_bang, 0);
- rb_define_method(rb_cArray, "filter", rb_ary_select, 0);
- rb_define_method(rb_cArray, "filter!", rb_ary_select_bang, 0);
rb_define_method(rb_cArray, "keep_if", rb_ary_keep_if, 0);
rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1);
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
@@ -7011,10 +5780,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, "minmax", rb_ary_minmax, 0);
-
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);
@@ -7037,15 +5802,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, "all?", rb_ary_all_p, -1);
- rb_define_method(rb_cArray, "none?", rb_ary_none_p, -1);
- rb_define_method(rb_cArray, "one?", rb_ary_one_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, "deconstruct", rb_ary_deconstruct, 0);
+ 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/ast.c b/ast.c
deleted file mode 100644
index 1133fb8a10..0000000000
--- a/ast.c
+++ /dev/null
@@ -1,691 +0,0 @@
-/* indent-tabs-mode: nil */
-#include "ruby.h"
-#include "ruby/encoding.h"
-#include "ruby/util.h"
-#include "internal.h"
-#include "node.h"
-#include "vm_core.h"
-#include "iseq.h"
-#include "builtin.h"
-
-static VALUE rb_mAST;
-static VALUE rb_cNode;
-
-struct ASTNodeData {
- rb_ast_t *ast;
- NODE *node;
-};
-
-static void
-node_gc_mark(void *ptr)
-{
- struct ASTNodeData *data = (struct ASTNodeData *)ptr;
- rb_gc_mark((VALUE)data->ast);
-}
-
-static size_t
-node_memsize(const void *ptr)
-{
- struct ASTNodeData *data = (struct ASTNodeData *)ptr;
- return rb_ast_memsize(data->ast);
-}
-
-static const rb_data_type_t rb_node_type = {
- "AST/node",
- {node_gc_mark, RUBY_TYPED_DEFAULT_FREE, node_memsize,},
- 0, 0,
- RUBY_TYPED_FREE_IMMEDIATELY,
-};
-
-static VALUE rb_ast_node_alloc(VALUE klass);
-
-static void
-setup_node(VALUE obj, rb_ast_t *ast, NODE *node)
-{
- struct ASTNodeData *data;
-
- TypedData_Get_Struct(obj, struct ASTNodeData, &rb_node_type, data);
- data->ast = ast;
- data->node = node;
-}
-
-static VALUE
-ast_new_internal(rb_ast_t *ast, NODE *node)
-{
- VALUE obj;
-
- obj = rb_ast_node_alloc(rb_cNode);
- setup_node(obj, ast, node);
-
- return obj;
-}
-
-static VALUE rb_ast_parse_str(VALUE str);
-static VALUE rb_ast_parse_file(VALUE path);
-static VALUE rb_ast_parse_array(VALUE array);
-
-static VALUE
-ast_parse_new(void)
-{
- return rb_parser_set_context(rb_parser_new(), NULL, 0);
-}
-
-static VALUE
-ast_parse_done(rb_ast_t *ast)
-{
- if (!ast->body.root) {
- rb_ast_dispose(ast);
- rb_exc_raise(GET_EC()->errinfo);
- }
-
- return ast_new_internal(ast, (NODE *)ast->body.root);
-}
-
-static VALUE
-ast_s_parse(rb_execution_context_t *ec, VALUE module, VALUE str)
-{
- return rb_ast_parse_str(str);
-}
-
-static VALUE
-rb_ast_parse_str(VALUE str)
-{
- rb_ast_t *ast = 0;
-
- StringValue(str);
- ast = rb_parser_compile_string_path(ast_parse_new(), Qnil, str, 1);
- return ast_parse_done(ast);
-}
-
-static VALUE
-ast_s_parse_file(rb_execution_context_t *ec, VALUE module, VALUE path)
-{
- return rb_ast_parse_file(path);
-}
-
-static VALUE
-rb_ast_parse_file(VALUE path)
-{
- VALUE f;
- rb_ast_t *ast = 0;
- rb_encoding *enc = rb_utf8_encoding();
-
- FilePathValue(path);
- f = rb_file_open_str(path, "r");
- rb_funcall(f, rb_intern("set_encoding"), 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
- ast = rb_parser_compile_file_path(ast_parse_new(), Qnil, f, 1);
- rb_io_close(f);
- return ast_parse_done(ast);
-}
-
-static VALUE
-lex_array(VALUE array, int index)
-{
- VALUE str = rb_ary_entry(array, index);
- if (!NIL_P(str)) {
- StringValue(str);
- if (!rb_enc_asciicompat(rb_enc_get(str))) {
- rb_raise(rb_eArgError, "invalid source encoding");
- }
- }
- return str;
-}
-
-static VALUE
-rb_ast_parse_array(VALUE array)
-{
- rb_ast_t *ast = 0;
-
- array = rb_check_array_type(array);
- ast = rb_parser_compile_generic(ast_parse_new(), lex_array, Qnil, array, 1);
- return ast_parse_done(ast);
-}
-
-static VALUE node_children(rb_ast_t*, NODE*);
-
-static VALUE
-node_find(VALUE self, const int node_id)
-{
- VALUE ary;
- long i;
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- if (nd_node_id(data->node) == node_id) return self;
-
- ary = node_children(data->ast, data->node);
-
- for (i = 0; i < RARRAY_LEN(ary); i++) {
- VALUE child = RARRAY_AREF(ary, i);
-
- if (CLASS_OF(child) == rb_cNode) {
- VALUE result = node_find(child, node_id);
- if (RTEST(result)) return result;
- }
- }
-
- return Qnil;
-}
-
-extern VALUE rb_e_script;
-
-static VALUE
-script_lines(VALUE path)
-{
- VALUE hash, lines;
- ID script_lines;
- CONST_ID(script_lines, "SCRIPT_LINES__");
- if (!rb_const_defined_at(rb_cObject, script_lines)) return Qnil;
- hash = rb_const_get_at(rb_cObject, script_lines);
- if (!RB_TYPE_P(hash, T_HASH)) return Qnil;
- lines = rb_hash_lookup(hash, path);
- if (!RB_TYPE_P(lines, T_ARRAY)) return Qnil;
- return lines;
-}
-
-static VALUE
-ast_s_of(rb_execution_context_t *ec, VALUE module, VALUE body)
-{
- VALUE path, node, lines;
- int node_id;
- const rb_iseq_t *iseq = NULL;
-
- if (rb_obj_is_proc(body)) {
- iseq = vm_proc_iseq(body);
-
- if (!rb_obj_is_iseq((VALUE)iseq)) {
- iseq = NULL;
- }
- }
- else {
- iseq = rb_method_iseq(body);
- }
-
- if (!iseq) return Qnil;
-
- path = rb_iseq_path(iseq);
- node_id = iseq->body->location.node_id;
- if (!NIL_P(lines = script_lines(path))) {
- node = rb_ast_parse_array(lines);
- }
- else if (RSTRING_LEN(path) == 2 && memcmp(RSTRING_PTR(path), "-e", 2) == 0) {
- node = rb_ast_parse_str(rb_e_script);
- }
- else {
- node = rb_ast_parse_file(path);
- }
-
- return node_find(node, node_id);
-}
-
-static VALUE
-rb_ast_node_alloc(VALUE klass)
-{
- struct ASTNodeData *data;
- VALUE obj = TypedData_Make_Struct(klass, struct ASTNodeData, &rb_node_type, data);
-
- return obj;
-}
-
-static const char*
-node_type_to_str(const NODE *node)
-{
- return (ruby_node_name(nd_type(node)) + rb_strlen_lit("NODE_"));
-}
-
-static VALUE
-ast_node_type(rb_execution_context_t *ec, VALUE self)
-{
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- return rb_sym_intern_ascii_cstr(node_type_to_str(data->node));
-}
-
-#define NEW_CHILD(ast, node) node ? ast_new_internal(ast, node) : Qnil
-
-static VALUE
-rb_ary_new_from_node_args(rb_ast_t *ast, long n, ...)
-{
- va_list ar;
- VALUE ary;
- long i;
-
- ary = rb_ary_new2(n);
-
- va_start(ar, n);
- for (i=0; i<n; i++) {
- NODE *node;
- node = va_arg(ar, NODE *);
- rb_ary_push(ary, NEW_CHILD(ast, node));
- }
- va_end(ar);
- return ary;
-}
-
-static VALUE
-dump_block(rb_ast_t *ast, NODE *node)
-{
- VALUE ary = rb_ary_new();
- do {
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_head));
- } while (node->nd_next &&
- nd_type(node->nd_next) == NODE_BLOCK &&
- (node = node->nd_next, 1));
- if (node->nd_next) {
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_next));
- }
-
- return ary;
-}
-
-static VALUE
-dump_array(rb_ast_t *ast, NODE *node)
-{
- VALUE ary = rb_ary_new();
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_head));
-
- while (node->nd_next && nd_type(node->nd_next) == NODE_LIST) {
- node = node->nd_next;
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_head));
- }
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_next));
-
- return ary;
-}
-
-static VALUE
-var_name(ID id)
-{
- if (!id) return Qnil;
- if (!rb_id2str(id)) return Qnil;
- return ID2SYM(id);
-}
-
-static VALUE
-node_children(rb_ast_t *ast, NODE *node)
-{
- char name[DECIMAL_SIZE_OF_BITS(sizeof(long) * CHAR_BIT) + 2]; /* including '$' */
-
- enum node_type type = nd_type(node);
- switch (type) {
- case NODE_BLOCK:
- return dump_block(ast, node);
- case NODE_IF:
- return rb_ary_new_from_node_args(ast, 3, node->nd_cond, node->nd_body, node->nd_else);
- case NODE_UNLESS:
- return rb_ary_new_from_node_args(ast, 3, node->nd_cond, node->nd_body, node->nd_else);
- case NODE_CASE:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_body);
- case NODE_CASE2:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_body);
- case NODE_CASE3:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_body);
- case NODE_WHEN:
- return rb_ary_new_from_node_args(ast, 3, node->nd_head, node->nd_body, node->nd_next);
- case NODE_IN:
- return rb_ary_new_from_node_args(ast, 3, node->nd_head, node->nd_body, node->nd_next);
- case NODE_WHILE:
- goto loop;
- case NODE_UNTIL:
- loop:
- return rb_ary_push(rb_ary_new_from_node_args(ast, 2, node->nd_cond, node->nd_body),
- (node->nd_state ? Qtrue : Qfalse));
- case NODE_ITER:
- case NODE_FOR:
- return rb_ary_new_from_node_args(ast, 2, node->nd_iter, node->nd_body);
- case NODE_FOR_MASGN:
- return rb_ary_new_from_node_args(ast, 1, node->nd_var);
- case NODE_BREAK:
- goto jump;
- case NODE_NEXT:
- goto jump;
- case NODE_RETURN:
- jump:
- return rb_ary_new_from_node_args(ast, 1, node->nd_stts);
- case NODE_REDO:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_RETRY:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_BEGIN:
- return rb_ary_new_from_node_args(ast, 1, node->nd_body);
- case NODE_RESCUE:
- return rb_ary_new_from_node_args(ast, 3, node->nd_head, node->nd_resq, node->nd_else);
- case NODE_RESBODY:
- return rb_ary_new_from_node_args(ast, 3, node->nd_args, node->nd_body, node->nd_head);
- case NODE_ENSURE:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_ensr);
- case NODE_AND:
- goto andor;
- case NODE_OR:
- andor:
- {
- VALUE ary = rb_ary_new();
-
- while (1) {
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_1st));
- if (!node->nd_2nd || nd_type(node->nd_2nd) != (int)type)
- break;
- node = node->nd_2nd;
- }
- rb_ary_push(ary, NEW_CHILD(ast, node->nd_2nd));
- return ary;
- }
- case NODE_MASGN:
- if (NODE_NAMED_REST_P(node->nd_args)) {
- return rb_ary_new_from_node_args(ast, 3, node->nd_value, node->nd_head, node->nd_args);
- }
- else {
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_value),
- NEW_CHILD(ast, node->nd_head),
- ID2SYM(rb_intern("NODE_SPECIAL_NO_NAME_REST")));
- }
- case NODE_LASGN:
- goto asgn;
- case NODE_DASGN:
- goto asgn;
- case NODE_DASGN_CURR:
- goto asgn;
- case NODE_IASGN:
- goto asgn;
- case NODE_CVASGN:
- asgn:
- if (NODE_REQUIRED_KEYWORD_P(node)) {
- return rb_ary_new_from_args(2, var_name(node->nd_vid), ID2SYM(rb_intern("NODE_SPECIAL_REQUIRED_KEYWORD")));
- }
- return rb_ary_new_from_args(2, var_name(node->nd_vid), NEW_CHILD(ast, node->nd_value));
- case NODE_GASGN:
- goto asgn;
- case NODE_CDECL:
- if (node->nd_vid) {
- return rb_ary_new_from_args(2, ID2SYM(node->nd_vid), NEW_CHILD(ast, node->nd_value));
- }
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_else), ID2SYM(node->nd_else->nd_mid), NEW_CHILD(ast, node->nd_value));
- case NODE_OP_ASGN1:
- return rb_ary_new_from_args(4, NEW_CHILD(ast, node->nd_recv),
- ID2SYM(node->nd_mid),
- NEW_CHILD(ast, node->nd_args->nd_head),
- NEW_CHILD(ast, node->nd_args->nd_body));
- case NODE_OP_ASGN2:
- return rb_ary_new_from_args(4, NEW_CHILD(ast, node->nd_recv),
- node->nd_next->nd_aid ? Qtrue : Qfalse,
- ID2SYM(node->nd_next->nd_vid),
- NEW_CHILD(ast, node->nd_value));
- case NODE_OP_ASGN_AND:
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_head), ID2SYM(idANDOP),
- NEW_CHILD(ast, node->nd_value));
- case NODE_OP_ASGN_OR:
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_head), ID2SYM(idOROP),
- NEW_CHILD(ast, node->nd_value));
- case NODE_OP_CDECL:
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_head),
- ID2SYM(node->nd_aid),
- NEW_CHILD(ast, node->nd_value));
- case NODE_CALL:
- case NODE_OPCALL:
- case NODE_QCALL:
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_recv),
- ID2SYM(node->nd_mid),
- NEW_CHILD(ast, node->nd_args));
- case NODE_FCALL:
- return rb_ary_new_from_args(2, ID2SYM(node->nd_mid),
- NEW_CHILD(ast, node->nd_args));
- case NODE_VCALL:
- return rb_ary_new_from_args(1, ID2SYM(node->nd_mid));
- case NODE_SUPER:
- return rb_ary_new_from_node_args(ast, 1, node->nd_args);
- case NODE_ZSUPER:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_LIST:
- goto ary;
- case NODE_VALUES:
- ary:
- return dump_array(ast, node);
- case NODE_ZLIST:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_HASH:
- return rb_ary_new_from_node_args(ast, 1, node->nd_head);
- case NODE_YIELD:
- return rb_ary_new_from_node_args(ast, 1, node->nd_head);
- case NODE_LVAR:
- case NODE_DVAR:
- return rb_ary_new_from_args(1, var_name(node->nd_vid));
- case NODE_IVAR:
- case NODE_CONST:
- case NODE_CVAR:
- case NODE_GVAR:
- return rb_ary_new_from_args(1, ID2SYM(node->nd_vid));
- case NODE_NTH_REF:
- snprintf(name, sizeof(name), "$%ld", node->nd_nth);
- return rb_ary_new_from_args(1, ID2SYM(rb_intern(name)));
- case NODE_BACK_REF:
- name[0] = '$';
- name[1] = (char)node->nd_nth;
- name[2] = '\0';
- return rb_ary_new_from_args(1, ID2SYM(rb_intern(name)));
- case NODE_MATCH:
- goto lit;
- case NODE_MATCH2:
- if (node->nd_args) {
- return rb_ary_new_from_node_args(ast, 3, node->nd_recv, node->nd_value, node->nd_args);
- }
- return rb_ary_new_from_node_args(ast, 2, node->nd_recv, node->nd_value);
- case NODE_MATCH3:
- return rb_ary_new_from_node_args(ast, 2, node->nd_recv, node->nd_value);
- case NODE_LIT:
- goto lit;
- case NODE_STR:
- goto lit;
- case NODE_XSTR:
- lit:
- return rb_ary_new_from_args(1, node->nd_lit);
- case NODE_ONCE:
- return rb_ary_new_from_node_args(ast, 1, node->nd_body);
- case NODE_DSTR:
- goto dlit;
- case NODE_DXSTR:
- goto dlit;
- case NODE_DREGX:
- goto dlit;
- case NODE_DSYM:
- dlit:
- return rb_ary_new_from_args(3, node->nd_lit,
- NEW_CHILD(ast, node->nd_next->nd_head),
- NEW_CHILD(ast, node->nd_next->nd_next));
- case NODE_EVSTR:
- return rb_ary_new_from_node_args(ast, 1, node->nd_body);
- case NODE_ARGSCAT:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_body);
- case NODE_ARGSPUSH:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_body);
- case NODE_SPLAT:
- return rb_ary_new_from_node_args(ast, 1, node->nd_head);
- case NODE_BLOCK_PASS:
- return rb_ary_new_from_node_args(ast, 2, node->nd_head, node->nd_body);
- case NODE_DEFN:
- return rb_ary_new_from_args(2, ID2SYM(node->nd_mid), NEW_CHILD(ast, node->nd_defn));
- case NODE_DEFS:
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_recv), ID2SYM(node->nd_mid), NEW_CHILD(ast, node->nd_defn));
- case NODE_ALIAS:
- return rb_ary_new_from_node_args(ast, 2, node->nd_1st, node->nd_2nd);
- case NODE_VALIAS:
- return rb_ary_new_from_args(2, ID2SYM(node->nd_alias), ID2SYM(node->nd_orig));
- case NODE_UNDEF:
- return rb_ary_new_from_node_args(ast, 1, node->nd_undef);
- case NODE_CLASS:
- return rb_ary_new_from_node_args(ast, 3, node->nd_cpath, node->nd_super, node->nd_body);
- case NODE_MODULE:
- return rb_ary_new_from_node_args(ast, 2, node->nd_cpath, node->nd_body);
- case NODE_SCLASS:
- return rb_ary_new_from_node_args(ast, 2, node->nd_recv, node->nd_body);
- case NODE_COLON2:
- return rb_ary_new_from_args(2, NEW_CHILD(ast, node->nd_head), ID2SYM(node->nd_mid));
- case NODE_COLON3:
- return rb_ary_new_from_args(1, ID2SYM(node->nd_mid));
- case NODE_DOT2:
- goto dot;
- case NODE_DOT3:
- goto dot;
- case NODE_FLIP2:
- goto dot;
- case NODE_FLIP3:
- dot:
- return rb_ary_new_from_node_args(ast, 2, node->nd_beg, node->nd_end);
- case NODE_SELF:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_NIL:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_TRUE:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_FALSE:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_ERRINFO:
- return rb_ary_new_from_node_args(ast, 0);
- case NODE_DEFINED:
- return rb_ary_new_from_node_args(ast, 1, node->nd_head);
- case NODE_POSTEXE:
- return rb_ary_new_from_node_args(ast, 1, node->nd_body);
- case NODE_ATTRASGN:
- return rb_ary_new_from_args(3, NEW_CHILD(ast, node->nd_recv), ID2SYM(node->nd_mid), NEW_CHILD(ast, node->nd_args));
- case NODE_LAMBDA:
- return rb_ary_new_from_node_args(ast, 1, node->nd_body);
- case NODE_OPT_ARG:
- return rb_ary_new_from_node_args(ast, 2, node->nd_body, node->nd_next);
- case NODE_KW_ARG:
- return rb_ary_new_from_node_args(ast, 2, node->nd_body, node->nd_next);
- case NODE_POSTARG:
- if (NODE_NAMED_REST_P(node->nd_1st)) {
- return rb_ary_new_from_node_args(ast, 2, node->nd_1st, node->nd_2nd);
- }
- return rb_ary_new_from_args(2, ID2SYM(rb_intern("NODE_SPECIAL_NO_NAME_REST")),
- NEW_CHILD(ast, node->nd_2nd));
- case NODE_ARGS:
- {
- struct rb_args_info *ainfo = node->nd_ainfo;
- return rb_ary_new_from_args(10,
- INT2NUM(ainfo->pre_args_num),
- NEW_CHILD(ast, ainfo->pre_init),
- NEW_CHILD(ast, ainfo->opt_args),
- var_name(ainfo->first_post_arg),
- INT2NUM(ainfo->post_args_num),
- NEW_CHILD(ast, ainfo->post_init),
- var_name(ainfo->rest_arg),
- (ainfo->no_kwarg ? Qfalse : NEW_CHILD(ast, ainfo->kw_args)),
- (ainfo->no_kwarg ? Qfalse : NEW_CHILD(ast, ainfo->kw_rest_arg)),
- var_name(ainfo->block_arg));
- }
- case NODE_SCOPE:
- {
- ID *tbl = node->nd_tbl;
- int i, size = tbl ? (int)*tbl++ : 0;
- VALUE locals = rb_ary_new_capa(size);
- for (i = 0; i < size; i++) {
- rb_ary_push(locals, var_name(tbl[i]));
- }
- return rb_ary_new_from_args(3, locals, NEW_CHILD(ast, node->nd_args), NEW_CHILD(ast, node->nd_body));
- }
- case NODE_ARYPTN:
- {
- struct rb_ary_pattern_info *apinfo = node->nd_apinfo;
- VALUE rest = NODE_NAMED_REST_P(apinfo->rest_arg) ? NEW_CHILD(ast, apinfo->rest_arg) :
- ID2SYM(rb_intern("NODE_SPECIAL_NO_NAME_REST"));
- return rb_ary_new_from_args(4,
- NEW_CHILD(ast, node->nd_pconst),
- NEW_CHILD(ast, apinfo->pre_args),
- rest,
- NEW_CHILD(ast, apinfo->post_args));
- }
- case NODE_HSHPTN:
- {
- VALUE kwrest = node->nd_pkwrestarg == NODE_SPECIAL_NO_REST_KEYWORD ? ID2SYM(rb_intern("NODE_SPECIAL_NO_REST_KEYWORD")) :
- NEW_CHILD(ast, node->nd_pkwrestarg);
-
- return rb_ary_new_from_args(3,
- NEW_CHILD(ast, node->nd_pconst),
- NEW_CHILD(ast, node->nd_pkwargs),
- kwrest);
- }
- case NODE_ARGS_AUX:
- case NODE_LAST:
- break;
- }
-
- rb_bug("node_children: unknown node: %s", ruby_node_name(type));
-}
-
-static VALUE
-ast_node_children(rb_execution_context_t *ec, VALUE self)
-{
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- return node_children(data->ast, data->node);
-}
-
-static VALUE
-ast_node_first_lineno(rb_execution_context_t *ec, VALUE self)
-{
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- return INT2NUM(nd_first_lineno(data->node));
-}
-
-static VALUE
-ast_node_first_column(rb_execution_context_t *ec, VALUE self)
-{
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- return INT2NUM(nd_first_column(data->node));
-}
-
-static VALUE
-ast_node_last_lineno(rb_execution_context_t *ec, VALUE self)
-{
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- return INT2NUM(nd_last_lineno(data->node));
-}
-
-static VALUE
-ast_node_last_column(rb_execution_context_t *ec, VALUE self)
-{
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- return INT2NUM(nd_last_column(data->node));
-}
-
-static VALUE
-ast_node_inspect(rb_execution_context_t *ec, VALUE self)
-{
- VALUE str;
- VALUE cname;
- struct ASTNodeData *data;
- TypedData_Get_Struct(self, struct ASTNodeData, &rb_node_type, data);
-
- cname = rb_class_path(rb_obj_class(self));
- str = rb_str_new2("#<");
-
- rb_str_append(str, cname);
- rb_str_catf(str, ":%s@%d:%d-%d:%d>",
- node_type_to_str(data->node),
- nd_first_lineno(data->node), nd_first_column(data->node),
- nd_last_lineno(data->node), nd_last_column(data->node));
-
- return str;
-}
-
-#include "ast.rbinc"
-
-void
-Init_ast(void)
-{
- rb_mAST = rb_define_module_under(rb_cRubyVM, "AbstractSyntaxTree");
- rb_cNode = rb_define_class_under(rb_mAST, "Node", rb_cObject);
- rb_undef_alloc_func(rb_cNode);
-
- load_ast();
-}
diff --git a/ast.rb b/ast.rb
deleted file mode 100644
index 1fedf76649..0000000000
--- a/ast.rb
+++ /dev/null
@@ -1,144 +0,0 @@
-# for ast.c
-
-class RubyVM
-
- # AbstractSyntaxTree provides methods to parse Ruby code into
- # abstract syntax trees. The nodes in the tree
- # are instances of RubyVM::AbstractSyntaxTree::Node.
- #
- # This class is MRI specific as it exposes implementation details
- # of the MRI abstract syntax tree.
- #
- # This class is experimental and its API is not stable, therefore it might
- # change without notice. As examples, the order of children nodes is not
- # guaranteed, the number of children nodes might change, there is no way to
- # access children nodes by name, etc.
- #
- # If you are looking for a stable API or an API working under multiple Ruby
- # implementations, consider using the _parser_ gem or Ripper. If you would
- # like to make RubyVM::AbstractSyntaxTree stable, please join the discussion
- # at https://bugs.ruby-lang.org/issues/14844.
- #
- module AbstractSyntaxTree
-
- # call-seq:
- # RubyVM::AbstractSyntaxTree.parse(string) -> RubyVM::AbstractSyntaxTree::Node
- #
- # Parses the given _string_ into an abstract syntax tree,
- # returning the root node of that tree.
- #
- # SyntaxError is raised if the given _string_ is invalid syntax.
- #
- # RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
- # # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>
- def self.parse string
- __builtin_ast_s_parse string
- end
-
- # call-seq:
- # RubyVM::AbstractSyntaxTree.parse_file(pathname) -> RubyVM::AbstractSyntaxTree::Node
- #
- # Reads the file from _pathname_, then parses it like ::parse,
- # returning the root node of the abstract syntax tree.
- #
- # SyntaxError is raised if _pathname_'s contents are not
- # valid Ruby syntax.
- #
- # RubyVM::AbstractSyntaxTree.parse_file("my-app/app.rb")
- # # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-31:3>
- def self.parse_file pathname
- __builtin_ast_s_parse_file pathname
- end
-
- # call-seq:
- # RubyVM::AbstractSyntaxTree.of(proc) -> RubyVM::AbstractSyntaxTree::Node
- # RubyVM::AbstractSyntaxTree.of(method) -> RubyVM::AbstractSyntaxTree::Node
- #
- # Returns AST nodes of the given _proc_ or _method_.
- #
- # RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
- # # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:35-1:42>
- #
- # def hello
- # puts "hello, world"
- # end
- #
- # RubyVM::AbstractSyntaxTree.of(method(:hello))
- # # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-3:3>
- def self.of body
- __builtin_ast_s_of body
- end
-
- # RubyVM::AbstractSyntaxTree::Node instances are created by parse methods in
- # RubyVM::AbstractSyntaxTree.
- #
- # This class is MRI specific.
- #
- class Node
-
- # call-seq:
- # node.type -> symbol
- #
- # Returns the type of this node as a symbol.
- #
- # root = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
- # root.type # => :SCOPE
- # call = root.children[2]
- # call.type # => :OPCALL
- def type
- __builtin_ast_node_type
- end
-
- # call-seq:
- # node.first_lineno -> integer
- #
- # The line number in the source code where this AST's text began.
- def first_lineno
- __builtin_ast_node_first_lineno
- end
-
- # call-seq:
- # node.first_column -> integer
- #
- # The column number in the source code where this AST's text began.
- def first_column
- __builtin_ast_node_first_column
- end
-
- # call-seq:
- # node.last_lineno -> integer
- #
- # The line number in the source code where this AST's text ended.
- def last_lineno
- __builtin_ast_node_last_lineno
- end
-
- # call-seq:
- # node.last_column -> integer
- #
- # The column number in the source code where this AST's text ended.
- def last_column
- __builtin_ast_node_last_column
- end
-
- # call-seq:
- # node.children -> array
- #
- # Returns AST nodes under this one. Each kind of node
- # has different children, depending on what kind of node it is.
- #
- # The returned array may contain other nodes or <code>nil</code>.
- def children
- __builtin_ast_node_children
- end
-
- # call-seq:
- # node.inspect -> string
- #
- # Returns debugging information about this node as a string.
- def inspect
- __builtin_ast_node_inspect
- end
- end
- end
-end
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 25a4298234..0000000000
--- a/basictest/test.rb
+++ /dev/null
@@ -1,2360 +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__, "../tool/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"
-
-# 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 assignment
-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/README.md b/benchmark/README.md
deleted file mode 100644
index 24a2669143..0000000000
--- a/benchmark/README.md
+++ /dev/null
@@ -1,72 +0,0 @@
-# ruby/benchmark
-
-This directory has benchmark definitions to be run with
-[benchmark\_driver.gem](https://github.com/benchmark-driver/benchmark-driver).
-
-## Normal usage
-
-Execute `gem install benchmark_driver` and run a command like:
-
-```bash
-# Run a benchmark script with the ruby in the $PATH
-benchmark-driver benchmark/app_fib.rb
-
-# Run benchmark scripts with multiple Ruby executables or options
-benchmark-driver benchmark/*.rb -e /path/to/ruby -e '/path/to/ruby --jit'
-
-# Or compare Ruby versions managed by rbenv
-benchmark-driver benchmark/*.rb --rbenv '2.5.1;2.6.0-preview2 --jit'
-
-# You can collect many metrics in many ways
-benchmark-driver benchmark/*.rb --runner memory --output markdown
-
-# Some are defined with YAML for complex setup or accurate measurement
-benchmark-driver benchmark/*.yml
-```
-
-See also:
-
-```console
-Usage: benchmark-driver [options] RUBY|YAML...
- -r, --runner TYPE Specify runner type: ips, time, memory, once (default: ips)
- -o, --output TYPE Specify output type: compare, simple, markdown, record (default: compare)
- -e, --executables EXECS Ruby executables (e1::path1 arg1; e2::path2 arg2;...)
- --rbenv VERSIONS Ruby executables in rbenv (x.x.x arg1;y.y.y arg2;...)
- --repeat-count NUM Try benchmark NUM times and use the fastest result or the worst memory usage
- --repeat-result TYPE Yield "best", "average" or "worst" result with --repeat-count (default: best)
- --bundler Install and use gems specified in Gemfile
- --filter REGEXP Filter out benchmarks with given regexp
- --run-duration SECONDS Warmup estimates loop_count to run for this duration (default: 3)
- -v, --verbose Verbose mode. Multiple -v options increase visilibity (max: 2)
-```
-
-## make benchmark
-
-Using `make benchmark`, `make update-benchmark-driver` automatically downloads
-the supported version of benchmark\_driver, and it runs benchmarks with the downloaded
-benchmark\_driver.
-
-```bash
-# Run all benchmarks with the ruby in the $PATH and the built ruby
-make benchmark
-
-# Or compare with specific ruby binary
-make benchmark COMPARE_RUBY="/path/to/ruby --jit"
-
-# Run vm1 benchmarks
-make benchmark ITEM=vm1
-
-# Run some limited benchmarks in ITEM-matched files
-make benchmark ITEM=vm1 OPTS=--filter=block
-
-# You can specify the benchmark by an exact filename instead of using the default argument:
-# ARGS = $$(find $(srcdir)/benchmark -maxdepth 1 -name '*$(ITEM)*.yml' -o -name '*$(ITEM)*.rb')
-make benchmark ARGS=../benchmark/erb_render.yml
-
-# You can specify any option via $OPTS
-make benchmark OPTS="--help"
-
-# With `make benchmark`, some special runner plugins are available:
-# -r peak, -r size, -r total, -r utime, -r stime, -r cutime, -r cstime
-make benchmark ITEM=vm2_bigarray OPTS="-r peak"
-```
diff --git a/benchmark/app_aobench.rb b/benchmark/app_aobench.rb
deleted file mode 100644
index 16296af12b..0000000000
--- a/benchmark/app_aobench.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-# coding: US-ASCII
-
-# AO render benchmark
-# Original program (C) Syoyo Fujita in Javascript (and other languages)
-# https://code.google.com/p/aobench/
-# Ruby(yarv2llvm) version by Hideki Miura
-#
-
-IMAGE_WIDTH = 256
-IMAGE_HEIGHT = 256
-NSUBSAMPLES = 2
-NAO_SAMPLES = 8
-
-srand(0)
-
-class Vec
- def initialize(x, y, z)
- @x = x
- @y = y
- @z = z
- end
-
- attr_accessor :x, :y, :z
-
- def vadd(b)
- Vec.new(@x + b.x, @y + b.y, @z + b.z)
- end
-
- def vsub(b)
- Vec.new(@x - b.x, @y - b.y, @z - b.z)
- end
-
- def vcross(b)
- Vec.new(@y * b.z - @z * b.y,
- @z * b.x - @x * b.z,
- @x * b.y - @y * b.x)
- end
-
- def vdot(b)
- @x * b.x + @y * b.y + @z * b.z
- end
-
- def vlength
- Math.sqrt(@x * @x + @y * @y + @z * @z)
- end
-
- def vnormalize
- len = vlength
- v = Vec.new(@x, @y, @z)
- if len > 1.0e-17 then
- v.x = v.x / len
- v.y = v.y / len
- v.z = v.z / len
- end
- v
- end
-end
-
-
-class Sphere
- def initialize(center, radius)
- @center = center
- @radius = radius
- end
-
- attr_reader :center, :radius
-
- def intersect(ray, isect)
- rs = ray.org.vsub(@center)
- b = rs.vdot(ray.dir)
- c = rs.vdot(rs) - (@radius * @radius)
- d = b * b - c
- if d > 0.0 then
- t = - b - Math.sqrt(d)
-
- if t > 0.0 and t < isect.t then
- isect.t = t
- isect.hit = true
- isect.pl = Vec.new(ray.org.x + ray.dir.x * t,
- ray.org.y + ray.dir.y * t,
- ray.org.z + ray.dir.z * t)
- n = isect.pl.vsub(@center)
- isect.n = n.vnormalize
- else
- 0.0
- end
- end
- nil
- end
-end
-
-class Plane
- def initialize(p, n)
- @p = p
- @n = n
- end
-
- def intersect(ray, isect)
- d = -@p.vdot(@n)
- v = ray.dir.vdot(@n)
- v0 = v
- if v < 0.0 then
- v0 = -v
- end
- if v0 < 1.0e-17 then
- return
- end
-
- t = -(ray.org.vdot(@n) + d) / v
-
- if t > 0.0 and t < isect.t then
- isect.hit = true
- isect.t = t
- isect.n = @n
- isect.pl = Vec.new(ray.org.x + t * ray.dir.x,
- ray.org.y + t * ray.dir.y,
- ray.org.z + t * ray.dir.z)
- end
- nil
- end
-end
-
-class Ray
- def initialize(org, dir)
- @org = org
- @dir = dir
- end
-
- attr_accessor :org, :dir
-end
-
-class Isect
- def initialize
- @t = 10000000.0
- @hit = false
- @pl = Vec.new(0.0, 0.0, 0.0)
- @n = Vec.new(0.0, 0.0, 0.0)
- end
-
- attr_accessor :t, :hit, :pl, :n
-end
-
-def clamp(f)
- i = f * 255.5
- if i > 255.0 then
- i = 255.0
- end
- if i < 0.0 then
- i = 0.0
- end
- i.to_i
-end
-
-def otherBasis(basis, n)
- basis[2] = Vec.new(n.x, n.y, n.z)
- basis[1] = Vec.new(0.0, 0.0, 0.0)
-
- if n.x < 0.6 and n.x > -0.6 then
- basis[1].x = 1.0
- elsif n.y < 0.6 and n.y > -0.6 then
- basis[1].y = 1.0
- elsif n.z < 0.6 and n.z > -0.6 then
- basis[1].z = 1.0
- else
- basis[1].x = 1.0
- end
-
- basis[0] = basis[1].vcross(basis[2])
- basis[0] = basis[0].vnormalize
-
- basis[1] = basis[2].vcross(basis[0])
- basis[1] = basis[1].vnormalize
-end
-
-class Scene
- def initialize
- @spheres = Array.new
- @spheres[0] = Sphere.new(Vec.new(-2.0, 0.0, -3.5), 0.5)
- @spheres[1] = Sphere.new(Vec.new(-0.5, 0.0, -3.0), 0.5)
- @spheres[2] = Sphere.new(Vec.new(1.0, 0.0, -2.2), 0.5)
- @plane = Plane.new(Vec.new(0.0, -0.5, 0.0), Vec.new(0.0, 1.0, 0.0))
- end
-
- def ambient_occlusion(isect)
- basis = Array.new
- otherBasis(basis, isect.n)
-
- ntheta = NAO_SAMPLES
- nphi = NAO_SAMPLES
- eps = 0.0001
- occlusion = 0.0
-
- p0 = Vec.new(isect.pl.x + eps * isect.n.x,
- isect.pl.y + eps * isect.n.y,
- isect.pl.z + eps * isect.n.z)
- nphi.times do |j|
- ntheta.times do |i|
- r = rand
- phi = 2.0 * 3.14159265 * rand
- x = Math.cos(phi) * Math.sqrt(1.0 - r)
- y = Math.sin(phi) * Math.sqrt(1.0 - r)
- z = Math.sqrt(r)
-
- rx = x * basis[0].x + y * basis[1].x + z * basis[2].x
- ry = x * basis[0].y + y * basis[1].y + z * basis[2].y
- rz = x * basis[0].z + y * basis[1].z + z * basis[2].z
-
- raydir = Vec.new(rx, ry, rz)
- ray = Ray.new(p0, raydir)
-
- occisect = Isect.new
- @spheres[0].intersect(ray, occisect)
- @spheres[1].intersect(ray, occisect)
- @spheres[2].intersect(ray, occisect)
- @plane.intersect(ray, occisect)
- if occisect.hit then
- occlusion = occlusion + 1.0
- else
- 0.0
- end
- end
- end
-
- occlusion = (ntheta.to_f * nphi.to_f - occlusion) / (ntheta.to_f * nphi.to_f)
-
- Vec.new(occlusion, occlusion, occlusion)
- end
-
- def render(w, h, nsubsamples)
- cnt = 0
- nsf = nsubsamples.to_f
- h.times do |y|
- w.times do |x|
- rad = Vec.new(0.0, 0.0, 0.0)
-
- # Subsampling
- nsubsamples.times do |v|
- nsubsamples.times do |u|
-
- cnt = cnt + 1
- wf = w.to_f
- hf = h.to_f
- xf = x.to_f
- yf = y.to_f
- uf = u.to_f
- vf = v.to_f
-
- px = (xf + (uf / nsf) - (wf / 2.0)) / (wf / 2.0)
- py = -(yf + (vf / nsf) - (hf / 2.0)) / (hf / 2.0)
-
- eye = Vec.new(px, py, -1.0).vnormalize
-
- ray = Ray.new(Vec.new(0.0, 0.0, 0.0), eye)
-
- isect = Isect.new
- @spheres[0].intersect(ray, isect)
- @spheres[1].intersect(ray, isect)
- @spheres[2].intersect(ray, isect)
- @plane.intersect(ray, isect)
- if isect.hit then
- col = ambient_occlusion(isect)
- rad.x = rad.x + col.x
- rad.y = rad.y + col.y
- rad.z = rad.z + col.z
- end
- end
- end
-
- r = rad.x / (nsf * nsf)
- g = rad.y / (nsf * nsf)
- b = rad.z / (nsf * nsf)
- printf("%c", clamp(r))
- printf("%c", clamp(g))
- printf("%c", clamp(b))
- end
- nil
- end
-
- nil
- end
-end
-
-alias printf_orig printf
-def printf *args
- # $fp.printf(*args)
-end
-
-# File.open("ao.ppm", "w") do |fp|
- # $fp = fp
- printf("P6\n")
- printf("%d %d\n", IMAGE_WIDTH, IMAGE_HEIGHT)
- printf("255\n")
- Scene.new.render(IMAGE_WIDTH, IMAGE_HEIGHT, NSUBSAMPLES)
-# end
-
-undef printf
-alias printf printf_orig
diff --git a/benchmark/app_erb.yml b/benchmark/app_erb.yml
deleted file mode 100644
index 31e29b7644..0000000000
--- a/benchmark/app_erb.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Create many HTML strings with ERB.
-#
-prelude: |
- require 'erb'
-
- data = <<erb
- <html>
- <head> <%= title %> </head>
- <body>
- <h1> <%= title %> </h1>
- <p>
- <%= content %>
- </p>
- </body>
- </html>
- erb
-
- title = "hello world!"
- content = "hello world!\n" * 10
-benchmark:
- app_erb: ERB.new(data).result(binding)
-loop_count: 15000
diff --git a/benchmark/app_pentomino.rb b/benchmark/app_pentomino.rb
deleted file mode 100644
index 47be7b203f..0000000000
--- a/benchmark/app_pentomino.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/local/bin/ruby
-# This program is contributed by Shin Nishiyama
-
-
-# modified by K.Sasada
-
-NP = 5
-ROW = 8 + NP
-COL = 8
-
-$p = []
-$b = []
-$no = 0
-
-def piece(n, a, nb)
- nb.each{|x|
- a[n] = x
- if n == NP-1
- $p << [a.sort]
- else
- nbc=nb.dup
- [-ROW, -1, 1, ROW].each{|d|
- if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
- nbc << x+d
- end
- }
- nbc.delete x
- piece(n+1,a[0..n],nbc)
- end
- }
-end
-
-def kikaku(a)
- a.collect {|x| x - a[0]}
-end
-def ud(a)
- kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
-end
-def rl(a)
- kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
-end
-def xy(a)
- kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
-end
-
-def mkpieces
- piece(0,[],[0])
- $p.each do |a|
- a0 = a[0]
- a[1] = ud(a0)
- a[2] = rl(a0)
- a[3] = ud(rl(a0))
- a[4] = xy(a0)
- a[5] = ud(xy(a0))
- a[6] = rl(xy(a0))
- a[7] = ud(rl(xy(a0)))
- a.sort!
- a.uniq!
- end
- $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
-end
-
-def mkboard
- (0...ROW*COL).each{|i|
- if i % ROW >= ROW-NP
- $b[i] = -2
- else
- $b[i] = -1
- end
- $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
- }
-end
-
-def pboard
- return # skip print
- print "No. #$no\n"
- (0...COL).each{|i|
- print "|"
- (0...ROW-NP).each{|j|
- x = $b[i*ROW+j]
- if x < 0
- print "..|"
- else
- printf "%2d|",x+1
- end
- }
- print "\n"
- }
- print "\n"
-end
-
-$pnum=[]
-def setpiece(a,pos)
- if a.length == $p.length then
- $no += 1
- pboard
- return
- end
- while $b[pos] != -1
- pos += 1
- end
- ($pnum - a).each do |i|
- $p[i].each do |x|
- f = 0
- x.each{|s|
- if $b[pos+s] != -1
- f=1
- break
- end
- }
- if f == 0 then
- x.each{|s|
- $b[pos+s] = i
- }
- a << i
- setpiece(a.dup, pos)
- a.pop
- x.each{|s|
- $b[pos+s] = -1
- }
- end
- end
- end
-end
-
-mkpieces
-mkboard
-$p[4] = [$p[4][0]]
-$pnum = (0...$p.length).to_a
-setpiece([],0)
diff --git a/benchmark/array_flatten.yml b/benchmark/array_flatten.yml
deleted file mode 100644
index 88ef544ba0..0000000000
--- a/benchmark/array_flatten.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-prelude: |
- small_flat_ary = 5.times.to_a
- large_flat_ary = 100.times.to_a
- small_pairs_ary = [[1, 2]] * 5
- large_pairs_ary = [[1, 2]] * 100
- mostly_flat_ary = 100.times.to_a.push([101, 102])
-
-benchmark:
- small_flat_ary.flatten: small_flat_ary.flatten
- small_flat_ary.flatten!: small_flat_ary.flatten!
- large_flat_ary.flatten: large_flat_ary.flatten
- large_flat_ary.flatten!: large_flat_ary.flatten!
- small_pairs_ary.flatten: small_pairs_ary.flatten
- small_pairs_ary.flatten!: small_pairs_ary.dup.flatten!
- large_pairs_ary.flatten: large_pairs_ary.flatten
- large_pairs_ary.flatten!: large_pairs_ary.dup.flatten!
- mostly_flat_ary.flatten: mostly_flat_ary.flatten
- mostly_flat_ary.flatten!: mostly_flat_ary.dup.flatten!
-loop_count: 10000
diff --git a/benchmark/array_intersection.yml b/benchmark/array_intersection.yml
deleted file mode 100644
index 26705323fd..0000000000
--- a/benchmark/array_intersection.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-prelude: |
- small1 = [1, 2, 3]
- small2 = [1, 2, 3, 4, 5]
- small3 = [2, 3, 4, 5]
- small4 = [2]
- big1 = [1, 2, 3, 4] * 64
- big2 = [1, 2, 3] * 64
- big3 = [1, 2] * 64
-
-benchmark:
- small-&: small1 & small2 & small3 & small4
- small-intersection: small1.intersection(small2, small3, small4)
- big-&: big1 & big2 & big3
- big-intersection: big1.intersection(big2, big3)
diff --git a/benchmark/array_sample_100k_10.rb b/benchmark/array_sample_100k_10.rb
deleted file mode 100644
index 5f41ecc32b..0000000000
--- a/benchmark/array_sample_100k_10.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 10}
diff --git a/benchmark/array_sample_100k_11.rb b/benchmark/array_sample_100k_11.rb
deleted file mode 100644
index 18b1715319..0000000000
--- a/benchmark/array_sample_100k_11.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 11}
diff --git a/benchmark/array_sample_100k__100.rb b/benchmark/array_sample_100k__100.rb
deleted file mode 100644
index 22863afe89..0000000000
--- a/benchmark/array_sample_100k__100.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 100}
diff --git a/benchmark/array_sample_100k__1k.rb b/benchmark/array_sample_100k__1k.rb
deleted file mode 100644
index 4cd79e6c67..0000000000
--- a/benchmark/array_sample_100k__1k.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 1000}
diff --git a/benchmark/array_sample_100k__6k.rb b/benchmark/array_sample_100k__6k.rb
deleted file mode 100644
index b3d264249e..0000000000
--- a/benchmark/array_sample_100k__6k.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = [*0...100000]
-10_000.times {arr.sample 6000}
diff --git a/benchmark/array_sample_100k___10k.rb b/benchmark/array_sample_100k___10k.rb
deleted file mode 100644
index 5dd55ec058..0000000000
--- a/benchmark/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/array_sample_100k___50k.rb b/benchmark/array_sample_100k___50k.rb
deleted file mode 100644
index 1506732c3c..0000000000
--- a/benchmark/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/array_shift.rb b/benchmark/array_shift.rb
deleted file mode 100644
index 798bb9e3f4..0000000000
--- a/benchmark/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/array_small_and.rb b/benchmark/array_small_and.rb
deleted file mode 100644
index e53a6edae6..0000000000
--- a/benchmark/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/array_small_diff.rb b/benchmark/array_small_diff.rb
deleted file mode 100644
index 9661ee48db..0000000000
--- a/benchmark/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/array_small_or.rb b/benchmark/array_small_or.rb
deleted file mode 100644
index c58b5fd1ff..0000000000
--- a/benchmark/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/array_sort_block.rb b/benchmark/array_sort_block.rb
deleted file mode 100644
index 3579786056..0000000000
--- a/benchmark/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/array_sort_float.rb b/benchmark/array_sort_float.rb
deleted file mode 100644
index 9a6e2f8bd2..0000000000
--- a/benchmark/array_sort_float.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-arr = Array.new(1000) { rand }
-10000.times { arr.sort }
diff --git a/benchmark/array_values_at_int.rb b/benchmark/array_values_at_int.rb
deleted file mode 100644
index 6cb394cb9f..0000000000
--- a/benchmark/array_values_at_int.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-ary = Array.new(10000) {|i| i}
-100000.times { ary.values_at(500) }
diff --git a/benchmark/array_values_at_range.rb b/benchmark/array_values_at_range.rb
deleted file mode 100644
index 5b53806d1c..0000000000
--- a/benchmark/array_values_at_range.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-ary = Array.new(10000) {|i| i}
-100000.times { ary.values_at(1..2000) }
diff --git a/benchmark/bighash.rb b/benchmark/bighash.rb
deleted file mode 100644
index e2ad5a5c94..0000000000
--- a/benchmark/bighash.rb
+++ /dev/null
@@ -1 +0,0 @@
-h = {}; 5000000.times {|n| h[n] = n }
diff --git a/benchmark/app_answer.rb b/benchmark/bm_app_answer.rb
index 3cd8a8fd37..3cd8a8fd37 100644
--- a/benchmark/app_answer.rb
+++ b/benchmark/bm_app_answer.rb
diff --git a/benchmark/bm_app_aobench.rb b/benchmark/bm_app_aobench.rb
new file mode 100644
index 0000000000..ffab116fcd
--- /dev/null
+++ b/benchmark/bm_app_aobench.rb
@@ -0,0 +1,291 @@
+# AO render benchmark
+# Original program (C) Syoyo Fujita in Javascript (and other languages)
+# https://code.google.com/p/aobench/
+# Ruby(yarv2llvm) version by Hideki Miura
+#
+
+IMAGE_WIDTH = 256
+IMAGE_HEIGHT = 256
+NSUBSAMPLES = 2
+NAO_SAMPLES = 8
+
+class Vec
+ def initialize(x, y, z)
+ @x = x
+ @y = y
+ @z = z
+ end
+
+ attr_accessor :x, :y, :z
+
+ def vadd(b)
+ Vec.new(@x + b.x, @y + b.y, @z + b.z)
+ end
+
+ def vsub(b)
+ Vec.new(@x - b.x, @y - b.y, @z - b.z)
+ end
+
+ def vcross(b)
+ Vec.new(@y * b.z - @z * b.y,
+ @z * b.x - @x * b.z,
+ @x * b.y - @y * b.x)
+ end
+
+ def vdot(b)
+ @x * b.x + @y * b.y + @z * b.z
+ end
+
+ def vlength
+ Math.sqrt(@x * @x + @y * @y + @z * @z)
+ end
+
+ def vnormalize
+ len = vlength
+ v = Vec.new(@x, @y, @z)
+ if len > 1.0e-17 then
+ v.x = v.x / len
+ v.y = v.y / len
+ v.z = v.z / len
+ end
+ v
+ end
+end
+
+
+class Sphere
+ def initialize(center, radius)
+ @center = center
+ @radius = radius
+ end
+
+ attr_reader :center, :radius
+
+ def intersect(ray, isect)
+ rs = ray.org.vsub(@center)
+ b = rs.vdot(ray.dir)
+ c = rs.vdot(rs) - (@radius * @radius)
+ d = b * b - c
+ if d > 0.0 then
+ t = - b - Math.sqrt(d)
+
+ if t > 0.0 and t < isect.t then
+ isect.t = t
+ isect.hit = true
+ isect.pl = Vec.new(ray.org.x + ray.dir.x * t,
+ ray.org.y + ray.dir.y * t,
+ ray.org.z + ray.dir.z * t)
+ n = isect.pl.vsub(@center)
+ isect.n = n.vnormalize
+ else
+ 0.0
+ end
+ end
+ nil
+ end
+end
+
+class Plane
+ def initialize(p, n)
+ @p = p
+ @n = n
+ end
+
+ def intersect(ray, isect)
+ d = -@p.vdot(@n)
+ v = ray.dir.vdot(@n)
+ v0 = v
+ if v < 0.0 then
+ v0 = -v
+ end
+ if v0 < 1.0e-17 then
+ return
+ end
+
+ t = -(ray.org.vdot(@n) + d) / v
+
+ if t > 0.0 and t < isect.t then
+ isect.hit = true
+ isect.t = t
+ isect.n = @n
+ isect.pl = Vec.new(ray.org.x + t * ray.dir.x,
+ ray.org.y + t * ray.dir.y,
+ ray.org.z + t * ray.dir.z)
+ end
+ nil
+ end
+end
+
+class Ray
+ def initialize(org, dir)
+ @org = org
+ @dir = dir
+ end
+
+ attr_accessor :org, :dir
+end
+
+class Isect
+ def initialize
+ @t = 10000000.0
+ @hit = false
+ @pl = Vec.new(0.0, 0.0, 0.0)
+ @n = Vec.new(0.0, 0.0, 0.0)
+ end
+
+ attr_accessor :t, :hit, :pl, :n
+end
+
+def clamp(f)
+ i = f * 255.5
+ if i > 255.0 then
+ i = 255.0
+ end
+ if i < 0.0 then
+ i = 0.0
+ end
+ i.to_i
+end
+
+def otherBasis(basis, n)
+ basis[2] = Vec.new(n.x, n.y, n.z)
+ basis[1] = Vec.new(0.0, 0.0, 0.0)
+
+ if n.x < 0.6 and n.x > -0.6 then
+ basis[1].x = 1.0
+ elsif n.y < 0.6 and n.y > -0.6 then
+ basis[1].y = 1.0
+ elsif n.z < 0.6 and n.z > -0.6 then
+ basis[1].z = 1.0
+ else
+ basis[1].x = 1.0
+ end
+
+ basis[0] = basis[1].vcross(basis[2])
+ basis[0] = basis[0].vnormalize
+
+ basis[1] = basis[2].vcross(basis[0])
+ basis[1] = basis[1].vnormalize
+end
+
+class Scene
+ def initialize
+ @spheres = Array.new
+ @spheres[0] = Sphere.new(Vec.new(-2.0, 0.0, -3.5), 0.5)
+ @spheres[1] = Sphere.new(Vec.new(-0.5, 0.0, -3.0), 0.5)
+ @spheres[2] = Sphere.new(Vec.new(1.0, 0.0, -2.2), 0.5)
+ @plane = Plane.new(Vec.new(0.0, -0.5, 0.0), Vec.new(0.0, 1.0, 0.0))
+ end
+
+ def ambient_occlusion(isect)
+ basis = Array.new
+ otherBasis(basis, isect.n)
+
+ ntheta = NAO_SAMPLES
+ nphi = NAO_SAMPLES
+ eps = 0.0001
+ occlusion = 0.0
+
+ p0 = Vec.new(isect.pl.x + eps * isect.n.x,
+ isect.pl.y + eps * isect.n.y,
+ isect.pl.z + eps * isect.n.z)
+ nphi.times do |j|
+ ntheta.times do |i|
+ r = rand
+ phi = 2.0 * 3.14159265 * rand
+ x = Math.cos(phi) * Math.sqrt(1.0 - r)
+ y = Math.sin(phi) * Math.sqrt(1.0 - r)
+ z = Math.sqrt(r)
+
+ rx = x * basis[0].x + y * basis[1].x + z * basis[2].x
+ ry = x * basis[0].y + y * basis[1].y + z * basis[2].y
+ rz = x * basis[0].z + y * basis[1].z + z * basis[2].z
+
+ raydir = Vec.new(rx, ry, rz)
+ ray = Ray.new(p0, raydir)
+
+ occisect = Isect.new
+ @spheres[0].intersect(ray, occisect)
+ @spheres[1].intersect(ray, occisect)
+ @spheres[2].intersect(ray, occisect)
+ @plane.intersect(ray, occisect)
+ if occisect.hit then
+ occlusion = occlusion + 1.0
+ else
+ 0.0
+ end
+ end
+ end
+
+ occlusion = (ntheta.to_f * nphi.to_f - occlusion) / (ntheta.to_f * nphi.to_f)
+
+ Vec.new(occlusion, occlusion, occlusion)
+ end
+
+ def render(w, h, nsubsamples)
+ cnt = 0
+ nsf = nsubsamples.to_f
+ h.times do |y|
+ w.times do |x|
+ rad = Vec.new(0.0, 0.0, 0.0)
+
+ # Subsmpling
+ nsubsamples.times do |v|
+ nsubsamples.times do |u|
+
+ cnt = cnt + 1
+ wf = w.to_f
+ hf = h.to_f
+ xf = x.to_f
+ yf = y.to_f
+ uf = u.to_f
+ vf = v.to_f
+
+ px = (xf + (uf / nsf) - (wf / 2.0)) / (wf / 2.0)
+ py = -(yf + (vf / nsf) - (hf / 2.0)) / (hf / 2.0)
+
+ eye = Vec.new(px, py, -1.0).vnormalize
+
+ ray = Ray.new(Vec.new(0.0, 0.0, 0.0), eye)
+
+ isect = Isect.new
+ @spheres[0].intersect(ray, isect)
+ @spheres[1].intersect(ray, isect)
+ @spheres[2].intersect(ray, isect)
+ @plane.intersect(ray, isect)
+ if isect.hit then
+ col = ambient_occlusion(isect)
+ rad.x = rad.x + col.x
+ rad.y = rad.y + col.y
+ rad.z = rad.z + col.z
+ end
+ end
+ end
+
+ r = rad.x / (nsf * nsf)
+ g = rad.y / (nsf * nsf)
+ b = rad.z / (nsf * nsf)
+ printf("%c", clamp(r))
+ printf("%c", clamp(g))
+ printf("%c", clamp(b))
+ end
+ nil
+ end
+
+ nil
+ end
+end
+
+alias printf_orig printf
+def printf *args
+end
+
+# File.open("ao.ppm", "w") do |fp|
+ printf("P6\n")
+ printf("%d %d\n", IMAGE_WIDTH, IMAGE_HEIGHT)
+ printf("255\n", IMAGE_WIDTH, IMAGE_HEIGHT)
+ Scene.new.render(IMAGE_WIDTH, IMAGE_HEIGHT, NSUBSAMPLES)
+# end
+
+undef printf
+alias printf printf_orig
diff --git a/benchmark/bm_app_erb.rb b/benchmark/bm_app_erb.rb
new file mode 100644
index 0000000000..77c66a7949
--- /dev/null
+++ b/benchmark/bm_app_erb.rb
@@ -0,0 +1,26 @@
+#
+# Create many HTML strings with ERB.
+#
+
+require 'erb'
+
+data = DATA.read
+max = 15_000
+title = "hello world!"
+content = "hello world!\n" * 10
+
+max.times{
+ ERB.new(data).result(binding)
+}
+
+__END__
+
+<html>
+ <head> <%= title %> </head>
+ <body>
+ <h1> <%= title %> </h1>
+ <p>
+ <%= content %>
+ </p>
+ </body>
+</html>
diff --git a/benchmark/app_factorial.rb b/benchmark/bm_app_factorial.rb
index 45f471dfdb..45f471dfdb 100644
--- a/benchmark/app_factorial.rb
+++ b/benchmark/bm_app_factorial.rb
diff --git a/benchmark/app_fib.rb b/benchmark/bm_app_fib.rb
index 34a7b2e725..34a7b2e725 100644
--- a/benchmark/app_fib.rb
+++ b/benchmark/bm_app_fib.rb
diff --git a/benchmark/app_lc_fizzbuzz.rb b/benchmark/bm_app_lc_fizzbuzz.rb
index f09574bbeb..f09574bbeb 100644
--- a/benchmark/app_lc_fizzbuzz.rb
+++ b/benchmark/bm_app_lc_fizzbuzz.rb
diff --git a/benchmark/app_mandelbrot.rb b/benchmark/bm_app_mandelbrot.rb
index 801b75e8e2..801b75e8e2 100644
--- a/benchmark/app_mandelbrot.rb
+++ b/benchmark/bm_app_mandelbrot.rb
diff --git a/benchmark/bm_app_pentomino.rb b/benchmark/bm_app_pentomino.rb
new file mode 100644
index 0000000000..59c63f358e
--- /dev/null
+++ b/benchmark/bm_app_pentomino.rb
@@ -0,0 +1,259 @@
+#!/usr/local/bin/ruby
+# This program is contributed by Shin Nishiyama
+
+
+# modified by K.Sasada
+
+NP = 5
+ROW = 8 + NP
+COL = 8
+
+$p = []
+$b = []
+$no = 0
+
+def piece(n, a, nb)
+ nb.each{|x|
+ a[n] = x
+ if n == NP-1
+ $p << [a.sort]
+ else
+ nbc=nb.dup
+ [-ROW, -1, 1, ROW].each{|d|
+ if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
+ nbc << x+d
+ end
+ }
+ nbc.delete x
+ piece(n+1,a[0..n],nbc)
+ end
+ }
+end
+
+def kikaku(a)
+ a.collect {|x| x - a[0]}
+end
+def ud(a)
+ kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
+end
+def rl(a)
+ kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
+end
+def xy(a)
+ kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
+end
+
+def mkpieces
+ piece(0,[],[0])
+ $p.each do |a|
+ a0 = a[0]
+ a[1] = ud(a0)
+ a[2] = rl(a0)
+ a[3] = ud(rl(a0))
+ a[4] = xy(a0)
+ a[5] = ud(xy(a0))
+ a[6] = rl(xy(a0))
+ a[7] = ud(rl(xy(a0)))
+ a.sort!
+ a.uniq!
+ end
+ $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
+end
+
+def mkboard
+ (0...ROW*COL).each{|i|
+ if i % ROW >= ROW-NP
+ $b[i] = -2
+ else
+ $b[i] = -1
+ end
+ $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
+ }
+end
+
+def pboard
+ return # skip print
+ print "No. #$no\n"
+ (0...COL).each{|i|
+ print "|"
+ (0...ROW-NP).each{|j|
+ x = $b[i*ROW+j]
+ if x < 0
+ print "..|"
+ else
+ printf "%2d|",x+1
+ end
+ }
+ print "\n"
+ }
+ print "\n"
+end
+
+$pnum=[]
+def setpiece(a,pos)
+ if a.length == $p.length then
+ $no += 1
+ pboard
+ return
+ end
+ while $b[pos] != -1
+ pos += 1
+ end
+ ($pnum - a).each do |i|
+ $p[i].each do |x|
+ f = 0
+ x.each{|s|
+ if $b[pos+s] != -1
+ f=1
+ break
+ end
+ }
+ if f == 0 then
+ x.each{|s|
+ $b[pos+s] = i
+ }
+ a << i
+ setpiece(a.dup, pos)
+ a.pop
+ x.each{|s|
+ $b[pos+s] = -1
+ }
+ end
+ end
+ end
+end
+
+mkpieces
+mkboard
+$p[4] = [$p[4][0]]
+$pnum = (0...$p.length).to_a
+setpiece([],0)
+
+
+__END__
+
+# original
+
+NP = 5
+ROW = 8 + NP
+COL = 8
+
+$p = []
+$b = []
+$no = 0
+
+def piece(n,a,nb)
+ for x in nb
+ a[n] = x
+ if n == NP-1
+ $p << [a.sort]
+ else
+ nbc=nb.dup
+ for d in [-ROW, -1, 1, ROW]
+ if x+d > 0 and not a.include?(x+d) and not nbc.include?(x+d)
+ nbc << x+d
+ end
+ end
+ nbc.delete x
+ piece(n+1,a[0..n],nbc)
+ end
+ end
+end
+
+def kikaku(a)
+ a.collect {|x| x - a[0]}
+end
+def ud(a)
+ kikaku(a.collect {|x| ((x+NP)%ROW)-ROW*((x+NP)/ROW) }.sort)
+end
+def rl(a)
+ kikaku(a.collect {|x| ROW*((x+NP)/ROW)+ROW-((x+NP)%ROW)}.sort)
+end
+def xy(a)
+ kikaku(a.collect {|x| ROW*((x+NP)%ROW) + (x+NP)/ROW }.sort)
+end
+
+def mkpieces
+ piece(0,[],[0])
+ $p.each do |a|
+ a0 = a[0]
+ a[1] = ud(a0)
+ a[2] = rl(a0)
+ a[3] = ud(rl(a0))
+ a[4] = xy(a0)
+ a[5] = ud(xy(a0))
+ a[6] = rl(xy(a0))
+ a[7] = ud(rl(xy(a0)))
+ a.sort!
+ a.uniq!
+ end
+ $p.uniq!.sort! {|x,y| x[0] <=> y[0] }
+end
+
+def mkboard
+ for i in 0...ROW*COL
+ if i % ROW >= ROW-NP
+ $b[i] = -2
+ else
+ $b[i] = -1
+ end
+ $b[3*ROW+3]=$b[3*ROW+4]=$b[4*ROW+3]=$b[4*ROW+4]=-2
+ end
+end
+
+def pboard
+ print "No. #$no\n"
+ for i in 0...COL
+ print "|"
+ for j in 0...ROW-NP
+ x = $b[i*ROW+j]
+ if x < 0
+ print "..|"
+ else
+ printf "%2d|",x+1
+ end
+ end
+ print "\n"
+ end
+ print "\n"
+end
+
+$pnum=[]
+def setpiece(a,pos)
+ if a.length == $p.length then
+ $no += 1
+ pboard
+ return
+ end
+ while $b[pos] != -1
+ pos += 1
+ end
+ ($pnum - a).each do |i|
+ $p[i].each do |x|
+ f = 0
+ for s in x do
+ if $b[pos+s] != -1
+ f=1
+ break
+ end
+ end
+ if f == 0 then
+ for s in x do
+ $b[pos+s] = i
+ end
+ a << i
+ setpiece(a.dup, pos)
+ a.pop
+ for s in x do
+ $b[pos+s] = -1
+ end
+ end
+ end
+ end
+end
+
+mkpieces
+mkboard
+$p[4] = [$p[4][0]]
+$pnum = (0...$p.length).to_a
+setpiece([],0)
diff --git a/benchmark/app_raise.rb b/benchmark/bm_app_raise.rb
index 5db8f95d50..5db8f95d50 100644
--- a/benchmark/app_raise.rb
+++ b/benchmark/bm_app_raise.rb
diff --git a/benchmark/app_strconcat.rb b/benchmark/bm_app_strconcat.rb
index 7eed7c1aed..7eed7c1aed 100644
--- a/benchmark/app_strconcat.rb
+++ b/benchmark/bm_app_strconcat.rb
diff --git a/benchmark/app_tak.rb b/benchmark/bm_app_tak.rb
index efe5380f4e..efe5380f4e 100644
--- a/benchmark/app_tak.rb
+++ b/benchmark/bm_app_tak.rb
diff --git a/benchmark/app_tarai.rb b/benchmark/bm_app_tarai.rb
index 4c146f5ccf..4c146f5ccf 100644
--- a/benchmark/app_tarai.rb
+++ b/benchmark/bm_app_tarai.rb
diff --git a/benchmark/app_uri.rb b/benchmark/bm_app_uri.rb
index 586edfd5dc..586edfd5dc 100644
--- a/benchmark/app_uri.rb
+++ b/benchmark/bm_app_uri.rb
diff --git a/benchmark/hash_aref_flo.rb b/benchmark/bm_hash_aref_flo.rb
index 2217274c82..2217274c82 100644
--- a/benchmark/hash_aref_flo.rb
+++ b/benchmark/bm_hash_aref_flo.rb
diff --git a/benchmark/hash_aref_miss.rb b/benchmark/bm_hash_aref_miss.rb
index b0913dd4bb..b0913dd4bb 100644
--- a/benchmark/hash_aref_miss.rb
+++ b/benchmark/bm_hash_aref_miss.rb
diff --git a/benchmark/hash_aref_str.rb b/benchmark/bm_hash_aref_str.rb
index 19439b061b..19439b061b 100644
--- a/benchmark/hash_aref_str.rb
+++ b/benchmark/bm_hash_aref_str.rb
diff --git a/benchmark/hash_aref_sym.rb b/benchmark/bm_hash_aref_sym.rb
index f75d163fe6..f75d163fe6 100644
--- a/benchmark/hash_aref_sym.rb
+++ b/benchmark/bm_hash_aref_sym.rb
diff --git a/benchmark/hash_aref_sym_long.rb b/benchmark/bm_hash_aref_sym_long.rb
index 9dab8df7be..9dab8df7be 100644
--- a/benchmark/hash_aref_sym_long.rb
+++ b/benchmark/bm_hash_aref_sym_long.rb
diff --git a/benchmark/hash_flatten.rb b/benchmark/bm_hash_flatten.rb
index e944aae9f2..e944aae9f2 100644
--- a/benchmark/hash_flatten.rb
+++ b/benchmark/bm_hash_flatten.rb
diff --git a/benchmark/hash_ident_flo.rb b/benchmark/bm_hash_ident_flo.rb
index 0c7edfed3e..0c7edfed3e 100644
--- a/benchmark/hash_ident_flo.rb
+++ b/benchmark/bm_hash_ident_flo.rb
diff --git a/benchmark/hash_ident_num.rb b/benchmark/bm_hash_ident_num.rb
index b226736c6f..b226736c6f 100644
--- a/benchmark/hash_ident_num.rb
+++ b/benchmark/bm_hash_ident_num.rb
diff --git a/benchmark/hash_ident_obj.rb b/benchmark/bm_hash_ident_obj.rb
index 4b3b58edec..4b3b58edec 100644
--- a/benchmark/hash_ident_obj.rb
+++ b/benchmark/bm_hash_ident_obj.rb
diff --git a/benchmark/hash_ident_str.rb b/benchmark/bm_hash_ident_str.rb
index 8582b38e31..8582b38e31 100644
--- a/benchmark/hash_ident_str.rb
+++ b/benchmark/bm_hash_ident_str.rb
diff --git a/benchmark/hash_ident_sym.rb b/benchmark/bm_hash_ident_sym.rb
index 4c81e3d28e..4c81e3d28e 100644
--- a/benchmark/hash_ident_sym.rb
+++ b/benchmark/bm_hash_ident_sym.rb
diff --git a/benchmark/hash_keys.rb b/benchmark/bm_hash_keys.rb
index 6863cd01f9..6863cd01f9 100644
--- a/benchmark/hash_keys.rb
+++ b/benchmark/bm_hash_keys.rb
diff --git a/benchmark/hash_shift.rb b/benchmark/bm_hash_shift.rb
index a645671a5b..a645671a5b 100644
--- a/benchmark/hash_shift.rb
+++ b/benchmark/bm_hash_shift.rb
diff --git a/benchmark/hash_values.rb b/benchmark/bm_hash_values.rb
index 069441302f..069441302f 100644
--- a/benchmark/hash_values.rb
+++ b/benchmark/bm_hash_values.rb
diff --git a/benchmark/io_file_create.rb b/benchmark/bm_io_file_create.rb
index 2f205c1333..2f205c1333 100644
--- a/benchmark/io_file_create.rb
+++ b/benchmark/bm_io_file_create.rb
diff --git a/benchmark/io_file_read.rb b/benchmark/bm_io_file_read.rb
index b9e796ed30..b9e796ed30 100644
--- a/benchmark/io_file_read.rb
+++ b/benchmark/bm_io_file_read.rb
diff --git a/benchmark/io_file_write.rb b/benchmark/bm_io_file_write.rb
index aa1be0e5fe..aa1be0e5fe 100644
--- a/benchmark/io_file_write.rb
+++ b/benchmark/bm_io_file_write.rb
diff --git a/benchmark/io_select.rb b/benchmark/bm_io_select.rb
index 19248daeb1..19248daeb1 100644
--- a/benchmark/io_select.rb
+++ b/benchmark/bm_io_select.rb
diff --git a/benchmark/io_select2.rb b/benchmark/bm_io_select2.rb
index 10e37d71b2..10e37d71b2 100644
--- a/benchmark/io_select2.rb
+++ b/benchmark/bm_io_select2.rb
diff --git a/benchmark/io_select3.rb b/benchmark/bm_io_select3.rb
index 7d0ba1f092..7d0ba1f092 100644
--- a/benchmark/io_select3.rb
+++ b/benchmark/bm_io_select3.rb
diff --git a/benchmark/loop_for.rb b/benchmark/bm_loop_for.rb
index 0fc4cc1511..0fc4cc1511 100644
--- a/benchmark/loop_for.rb
+++ b/benchmark/bm_loop_for.rb
diff --git a/benchmark/loop_generator.rb b/benchmark/bm_loop_generator.rb
index d3375c744c..d3375c744c 100644
--- a/benchmark/loop_generator.rb
+++ b/benchmark/bm_loop_generator.rb
diff --git a/benchmark/loop_times.rb b/benchmark/bm_loop_times.rb
index 521f72ad1a..521f72ad1a 100644
--- a/benchmark/loop_times.rb
+++ b/benchmark/bm_loop_times.rb
diff --git a/benchmark/loop_whileloop.rb b/benchmark/bm_loop_whileloop.rb
index 0072822c06..0072822c06 100644
--- a/benchmark/loop_whileloop.rb
+++ b/benchmark/bm_loop_whileloop.rb
diff --git a/benchmark/loop_whileloop2.rb b/benchmark/bm_loop_whileloop2.rb
index 47d02dffc4..47d02dffc4 100644
--- a/benchmark/loop_whileloop2.rb
+++ b/benchmark/bm_loop_whileloop2.rb
diff --git a/benchmark/marshal_dump_flo.rb b/benchmark/bm_marshal_dump_flo.rb
index 9b8d0c6afb..9b8d0c6afb 100644
--- a/benchmark/marshal_dump_flo.rb
+++ b/benchmark/bm_marshal_dump_flo.rb
diff --git a/benchmark/securerandom.rb b/benchmark/bm_securerandom.rb
index a082ea6d5b..a082ea6d5b 100644
--- a/benchmark/securerandom.rb
+++ b/benchmark/bm_securerandom.rb
diff --git a/benchmark/bm_so_ackermann.rb b/benchmark/bm_so_ackermann.rb
new file mode 100644
index 0000000000..7db5be9050
--- /dev/null
+++ b/benchmark/bm_so_ackermann.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: ackermann-ruby.code,v 1.4 2004/11/13 07:40:41 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+def ack(m, n)
+ if m == 0 then
+ n + 1
+ elsif n == 0 then
+ ack(m - 1, 1)
+ else
+ ack(m - 1, ack(m, n - 1))
+ end
+end
+
+NUM = 9
+ack(3, NUM)
+
+
diff --git a/benchmark/bm_so_array.rb b/benchmark/bm_so_array.rb
new file mode 100644
index 0000000000..2b8fce8f99
--- /dev/null
+++ b/benchmark/bm_so_array.rb
@@ -0,0 +1,23 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: ary-ruby.code,v 1.4 2004/11/13 07:41:27 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Paul Brannan and Mark Hubbart
+
+n = 9000 # Integer(ARGV.shift || 1)
+
+x = Array.new(n)
+y = Array.new(n, 0)
+
+n.times{|bi|
+ x[bi] = bi + 1
+}
+
+(0 .. 999).each do |e|
+ (n-1).step(0,-1) do |bi|
+ y[bi] += x.at(bi)
+ end
+end
+# puts "#{y.first} #{y.last}"
+
+
diff --git a/benchmark/so_binary_trees.rb b/benchmark/bm_so_binary_trees.rb
index b1693e4109..b1693e4109 100644
--- a/benchmark/so_binary_trees.rb
+++ b/benchmark/bm_so_binary_trees.rb
diff --git a/benchmark/bm_so_concatenate.rb b/benchmark/bm_so_concatenate.rb
new file mode 100644
index 0000000000..873214de7c
--- /dev/null
+++ b/benchmark/bm_so_concatenate.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: strcat-ruby.code,v 1.4 2004/11/13 07:43:28 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# based on code from Aristarkh A Zagorodnikov and Dat Nguyen
+
+STUFF = "hello\n"
+i = 0
+while i<10
+ i += 1
+ hello = ''
+ 4_000_000.times do |e|
+ hello << STUFF
+ end
+end
+# puts hello.length
+
+
diff --git a/benchmark/bm_so_count_words.rb b/benchmark/bm_so_count_words.rb
new file mode 100644
index 0000000000..65f6337a4a
--- /dev/null
+++ b/benchmark/bm_so_count_words.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: wc-ruby.code,v 1.4 2004/11/13 07:43:32 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Paul Brannan
+
+input = open(File.join(File.dirname($0), 'wc.input'), 'rb')
+
+nl = nw = nc = 0
+while true
+ tmp = input.read(4096) or break
+ data = tmp << (input.gets || "")
+ nc += data.length
+ nl += data.count("\n")
+ ((data.strip! || data).tr!("\n", " ") || data).squeeze!
+ nw += data.count(" ") + 1
+end
+# STDERR.puts "#{nl} #{nw} #{nc}"
+
diff --git a/benchmark/bm_so_exception.rb b/benchmark/bm_so_exception.rb
new file mode 100644
index 0000000000..deb003a594
--- /dev/null
+++ b/benchmark/bm_so_exception.rb
@@ -0,0 +1,61 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: except-ruby.code,v 1.4 2004/11/13 07:41:33 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+$HI = 0
+$LO = 0
+NUM = 250000 # Integer(ARGV[0] || 1)
+
+
+class Lo_Exception < Exception
+ def initialize(num)
+ @value = num
+ end
+end
+
+class Hi_Exception < Exception
+ def initialize(num)
+ @value = num
+ end
+end
+
+def some_function(num)
+ begin
+ hi_function(num)
+ rescue
+ print "We shouldn't get here, exception is: #{$!.type}\n"
+ end
+end
+
+def hi_function(num)
+ begin
+ lo_function(num)
+ rescue Hi_Exception
+ $HI = $HI + 1
+ end
+end
+
+def lo_function(num)
+ begin
+ blowup(num)
+ rescue Lo_Exception
+ $LO = $LO + 1
+ end
+end
+
+def blowup(num)
+ if num % 2 == 0
+ raise Lo_Exception.new(num)
+ else
+ raise Hi_Exception.new(num)
+ end
+end
+
+
+i = 1
+max = NUM+1
+while i < max
+ i += 1
+ some_function(i+1)
+end
diff --git a/benchmark/so_fannkuch.rb b/benchmark/bm_so_fannkuch.rb
index bac5ecd44c..bac5ecd44c 100644
--- a/benchmark/so_fannkuch.rb
+++ b/benchmark/bm_so_fannkuch.rb
diff --git a/benchmark/bm_so_fasta.rb b/benchmark/bm_so_fasta.rb
new file mode 100644
index 0000000000..3f759ba7ae
--- /dev/null
+++ b/benchmark/bm_so_fasta.rb
@@ -0,0 +1,81 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org/
+# Contributed by Sokolov Yura
+
+$last = 42.0
+def gen_random (max,im=139968,ia=3877,ic=29573)
+ (max * ($last = ($last * ia + ic) % im)) / im
+end
+
+alu =
+ "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG"+
+ "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA"+
+ "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT"+
+ "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA"+
+ "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG"+
+ "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC"+
+ "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
+
+iub = [
+ ["a", 0.27],
+ ["c", 0.12],
+ ["g", 0.12],
+ ["t", 0.27],
+
+ ["B", 0.02],
+ ["D", 0.02],
+ ["H", 0.02],
+ ["K", 0.02],
+ ["M", 0.02],
+ ["N", 0.02],
+ ["R", 0.02],
+ ["S", 0.02],
+ ["V", 0.02],
+ ["W", 0.02],
+ ["Y", 0.02],
+]
+homosapiens = [
+ ["a", 0.3029549426680],
+ ["c", 0.1979883004921],
+ ["g", 0.1975473066391],
+ ["t", 0.3015094502008],
+]
+
+def make_repeat_fasta(id, desc, src, n)
+ puts ">#{id} #{desc}"
+ v = nil
+ width = 60
+ l = src.length
+ s = src * ((n / l) + 1)
+ s.slice!(n, l)
+ puts(s.scan(/.{1,#{width}}/).join("\n"))
+end
+
+def make_random_fasta(id, desc, table, n)
+ puts ">#{id} #{desc}"
+ rand, v = nil,nil
+ width = 60
+ chunk = 1 * width
+ prob = 0.0
+ table.each{|v| v[1]= (prob += v[1])}
+ for i in 1..(n/width)
+ puts((1..width).collect{
+ rand = gen_random(1.0)
+ table.find{|v| v[1]>rand}[0]
+ }.join)
+ end
+ if n%width != 0
+ puts((1..(n%width)).collect{
+ rand = gen_random(1.0)
+ table.find{|v| v[1]>rand}[0]
+ }.join)
+ end
+end
+
+
+n = (ARGV[0] or 250_000).to_i
+
+make_repeat_fasta('ONE', 'Homo sapiens alu', alu, n*2)
+make_random_fasta('TWO', 'IUB ambiguity codes', iub, n*3)
+make_random_fasta('THREE', 'Homo sapiens frequency', homosapiens, n*5)
+
diff --git a/benchmark/bm_so_k_nucleotide.rb b/benchmark/bm_so_k_nucleotide.rb
new file mode 100644
index 0000000000..dadab3e79c
--- /dev/null
+++ b/benchmark/bm_so_k_nucleotide.rb
@@ -0,0 +1,48 @@
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+#
+# contributed by jose fco. gonzalez
+# modified by Sokolov Yura
+
+seq = String.new
+
+def frecuency( seq,length )
+ n, table = seq.length - length + 1, Hash.new(0)
+ f, i = nil, nil
+ (0 ... length).each do |f|
+ (f ... n).step(length) do |i|
+ table[seq[i,length]] += 1
+ end
+ end
+ [n,table]
+
+end
+
+def sort_by_freq( seq,length )
+ n,table = frecuency( seq,length )
+ a, b, v = nil, nil, nil
+ table.sort{|a,b| b[1] <=> a[1]}.each do |v|
+ puts "%s %.3f" % [v[0].upcase,((v[1]*100).to_f/n)]
+ end
+ puts
+end
+
+def find_seq( seq,s )
+ n,table = frecuency( seq,s.length )
+ puts "#{table[s].to_s}\t#{s.upcase}"
+end
+
+input = open(File.join(File.dirname($0), 'fasta.output.100000'), 'rb')
+
+line = input.gets while line !~ /^>THREE/
+line = input.gets
+
+while (line !~ /^>/) & line do
+ seq << line.chomp
+ line = input.gets
+end
+
+[1,2].each {|i| sort_by_freq( seq,i ) }
+
+%w(ggt ggta ggtatt ggtattttaatt ggtattttaatttatagt).each{|s| find_seq( seq,s) }
+
diff --git a/benchmark/so_lists.rb b/benchmark/bm_so_lists.rb
index e8f4a2a5f7..e8f4a2a5f7 100644
--- a/benchmark/so_lists.rb
+++ b/benchmark/bm_so_lists.rb
diff --git a/benchmark/so_mandelbrot.rb b/benchmark/bm_so_mandelbrot.rb
index 76331c64b8..76331c64b8 100644
--- a/benchmark/so_mandelbrot.rb
+++ b/benchmark/bm_so_mandelbrot.rb
diff --git a/benchmark/bm_so_matrix.rb b/benchmark/bm_so_matrix.rb
new file mode 100644
index 0000000000..e2c5c8e559
--- /dev/null
+++ b/benchmark/bm_so_matrix.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: matrix-ruby.code,v 1.4 2004/11/13 07:42:14 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+
+n = 60 #Integer(ARGV.shift || 1)
+
+size = 40
+
+def mkmatrix(rows, cols)
+ count = 1
+ mx = Array.new(rows)
+ (0 .. (rows - 1)).each do |bi|
+ row = Array.new(cols, 0)
+ (0 .. (cols - 1)).each do |j|
+ row[j] = count
+ count += 1
+ end
+ mx[bi] = row
+ end
+ mx
+end
+
+def mmult(rows, cols, m1, m2)
+ m3 = Array.new(rows)
+ (0 .. (rows - 1)).each do |bi|
+ row = Array.new(cols, 0)
+ (0 .. (cols - 1)).each do |j|
+ val = 0
+ (0 .. (cols - 1)).each do |k|
+ val += m1.at(bi).at(k) * m2.at(k).at(j)
+ end
+ row[j] = val
+ end
+ m3[bi] = row
+ end
+ m3
+end
+
+m1 = mkmatrix(size, size)
+m2 = mkmatrix(size, size)
+mm = Array.new
+n.times do
+ mm = mmult(size, size, m1, m2)
+end
+# puts "#{mm[0][0]} #{mm[2][3]} #{mm[3][2]} #{mm[4][4]}"
+
+
diff --git a/benchmark/bm_so_meteor_contest.rb b/benchmark/bm_so_meteor_contest.rb
new file mode 100644
index 0000000000..b8e93bd150
--- /dev/null
+++ b/benchmark/bm_so_meteor_contest.rb
@@ -0,0 +1,564 @@
+#!/usr/bin/env ruby
+#
+# The Computer Language Shootout
+# http://shootout.alioth.debian.org
+# contributed by Kevin Barnes (Ruby novice)
+
+# PROGRAM: the main body is at the bottom.
+# 1) read about the problem here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
+# 2) see how I represent a board as a bitmask by reading the blank_board comments
+# 3) read as your mental paths take you
+
+def print *args
+end
+
+# class to represent all information about a particular rotation of a particular piece
+class Rotation
+ # an array (by location) containing a bit mask for how the piece maps at the given location.
+ # if the rotation is invalid at that location the mask will contain false
+ attr_reader :start_masks
+
+ # maps a direction to a relative location. these differ depending on whether it is an even or
+ # odd row being mapped from
+ @@rotation_even_adder = { :west => -1, :east => 1, :nw => -7, :ne => -6, :sw => 5, :se => 6 }
+ @@rotation_odd_adder = { :west => -1, :east => 1, :nw => -6, :ne => -5, :sw => 6, :se => 7 }
+
+ def initialize( directions )
+ @even_offsets, @odd_offsets = normalize_offsets( get_values( directions ))
+
+ @even_mask = mask_for_offsets( @even_offsets)
+ @odd_mask = mask_for_offsets( @odd_offsets)
+
+ @start_masks = Array.new(60)
+
+ # create the rotational masks by placing the base mask at the location and seeing if
+ # 1) it overlaps the boundaries and 2) it produces a prunable board. if either of these
+ # is true the piece cannot be placed
+ 0.upto(59) do | offset |
+ mask = is_even(offset) ? (@even_mask << offset) : (@odd_mask << offset)
+ if (blank_board & mask == 0 && !prunable(blank_board | mask, 0, true)) then
+ imask = compute_required( mask, offset)
+ @start_masks[offset] = [ mask, imask, imask | mask ]
+ else
+ @start_masks[offset] = false
+ end
+ end
+ end
+
+ def compute_required( mask, offset )
+ board = blank_board
+ 0.upto(offset) { | i | board |= 1 << i }
+ board |= mask
+ return 0 if (!prunable(board | mask, offset))
+ board = flood_fill(board,58)
+ count = 0
+ imask = 0
+ 0.upto(59) do | i |
+ if (board[i] == 0) then
+ imask |= (1 << i)
+ count += 1
+ end
+ end
+ (count > 0 && count < 5) ? imask : 0
+ end
+
+ def flood_fill( board, location)
+ return board if (board[location] == 1)
+ board |= 1 << location
+ row, col = location.divmod(6)
+ board = flood_fill( board, location - 1) if (col > 0)
+ board = flood_fill( board, location + 1) if (col < 4)
+ if (row % 2 == 0) then
+ board = flood_fill( board, location - 7) if (col > 0 && row > 0)
+ board = flood_fill( board, location - 6) if (row > 0)
+ board = flood_fill( board, location + 6) if (row < 9)
+ board = flood_fill( board, location + 5) if (col > 0 && row < 9)
+ else
+ board = flood_fill( board, location - 5) if (col < 4 && row > 0)
+ board = flood_fill( board, location - 6) if (row > 0)
+ board = flood_fill( board, location + 6) if (row < 9)
+ board = flood_fill( board, location + 7) if (col < 4 && row < 9)
+ end
+ board
+ end
+
+ # given a location, produces a list of relative locations covered by the piece at this rotation
+ def offsets( location)
+ if is_even( location) then
+ @even_offsets.collect { | value | value + location }
+ else
+ @odd_offsets.collect { | value | value + location }
+ end
+ end
+
+ # returns a set of offsets relative to the top-left most piece of the rotation (by even or odd rows)
+ # this is hard to explain. imagine we have this partial board:
+ # 0 0 0 0 0 x [positions 0-5]
+ # 0 0 1 1 0 x [positions 6-11]
+ # 0 0 1 0 0 x [positions 12-17]
+ # 0 1 0 0 0 x [positions 18-23]
+ # 0 1 0 0 0 x [positions 24-29]
+ # 0 0 0 0 0 x [positions 30-35]
+ # ...
+ # The top-left of the piece is at position 8, the
+ # board would be passed as a set of positions (values array) containing [8,9,14,19,25] not necessarily in that
+ # sorted order. Since that array starts on an odd row, the offsets for an odd row are: [0,1,6,11,17] obtained
+ # by subtracting 8 from everything. Now imagine the piece shifted up and to the right so it's on an even row:
+ # 0 0 0 1 1 x [positions 0-5]
+ # 0 0 1 0 0 x [positions 6-11]
+ # 0 0 1 0 0 x [positions 12-17]
+ # 0 1 0 0 0 x [positions 18-23]
+ # 0 0 0 0 0 x [positions 24-29]
+ # 0 0 0 0 0 x [positions 30-35]
+ # ...
+ # Now the positions are [3,4,8,14,19] which after subtracting the lowest value (3) gives [0,1,5,11,16] thus, the
+ # offsets for this particular piece are (in even, odd order) [0,1,5,11,16],[0,1,6,11,17] which is what
+ # this function would return
+ def normalize_offsets( values)
+ min = values.min
+ even_min = is_even(min)
+ other_min = even_min ? min + 6 : min + 7
+ other_values = values.collect do | value |
+ if is_even(value) then
+ value + 6 - other_min
+ else
+ value + 7 - other_min
+ end
+ end
+ values.collect! { | value | value - min }
+
+ if even_min then
+ [values, other_values]
+ else
+ [other_values, values]
+ end
+ end
+
+ # produce a bitmask representation of an array of offset locations
+ def mask_for_offsets( offsets )
+ mask = 0
+ offsets.each { | value | mask = mask + ( 1 << value ) }
+ mask
+ end
+
+ # finds a "safe" position that a position as described by a list of directions can be placed
+ # without falling off any edge of the board. the values returned a location to place the first piece
+ # at so it will fit after making the described moves
+ def start_adjust( directions )
+ south = east = 0;
+ directions.each do | direction |
+ east += 1 if ( direction == :sw || direction == :nw || direction == :west )
+ south += 1 if ( direction == :nw || direction == :ne )
+ end
+ south * 6 + east
+ end
+
+ # 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 )
+ start = start_adjust(directions)
+ values = [ start ]
+ directions.each do | direction |
+ if (start % 12 >= 6) then
+ start += @@rotation_odd_adder[direction]
+ else
+ start += @@rotation_even_adder[direction]
+ end
+ values += [ start ]
+ end
+
+ # some moves take you back to an existing location, we'll strip duplicates
+ values.uniq
+ end
+end
+
+# describes a piece and caches information about its rotations to as to be efficient for iteration
+# ATTRIBUTES:
+# rotations -- all the rotations of the piece
+# type -- a numeic "name" of the piece
+# masks -- an array by location of all legal rotational masks (a n inner array) for that location
+# placed -- the mask that this piece was last placed at (not a location, but the actual mask used)
+class Piece
+ attr_reader :rotations, :type, :masks
+ attr_accessor :placed
+
+ # transform hashes that change one direction into another when you either flip or rotate a set of directions
+ @@flip_converter = { :west => :west, :east => :east, :nw => :sw, :ne => :se, :sw => :nw, :se => :ne }
+ @@rotate_converter = { :west => :nw, :east => :se, :nw => :ne, :ne => :east, :sw => :west, :se => :sw }
+
+ def initialize( directions, type )
+ @type = type
+ @rotations = Array.new();
+ @map = {}
+
+ generate_rotations( directions )
+ directions.collect! { | value | @@flip_converter[value] }
+ generate_rotations( directions )
+
+ # creates the masks AND a map that returns [location, rotation] for any given mask
+ # this is used when a board is found and we want to draw it, otherwise the map is unused
+ @masks = Array.new();
+ 0.upto(59) do | i |
+ even = true
+ @masks[i] = @rotations.collect do | rotation |
+ mask = rotation.start_masks[i]
+ @map[mask[0]] = [ i, rotation ] if (mask)
+ mask || nil
+ end
+ @masks[i].compact!
+ end
+ end
+
+ # rotates a set of directions through all six angles and adds a Rotation to the list for each one
+ def generate_rotations( directions )
+ 6.times do
+ rotations.push( Rotation.new(directions))
+ directions.collect! { | value | @@rotate_converter[value] }
+ end
+ end
+
+ # given a board string, adds this piece to the board at whatever location/rotation
+ # important: the outbound board string is 5 wide, the normal location notation is six wide (padded)
+ def fill_string( board_string)
+ location, rotation = @map[@placed]
+ rotation.offsets(location).each do | offset |
+ row, col = offset.divmod(6)
+ board_string[ row*5 + col, 1 ] = @type.to_s
+ end
+ end
+end
+
+# a blank bit board having this form:
+#
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 0 0 0 0 0 1
+# 1 1 1 1 1 1
+#
+# where left lest significant bit is the top left and the most significant is the lower right
+# the actual board only consists of the 0 places, the 1 places are blockers to keep things from running
+# off the edges or bottom
+def blank_board
+ 0b111111100000100000100000100000100000100000100000100000100000100000
+end
+
+def full_board
+ 0b111111111111111111111111111111111111111111111111111111111111111111
+end
+
+# determines if a location (bit position) is in an even row
+def is_even( location)
+ (location % 12) < 6
+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 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,
+# the second is the count of those bits and the third is identical to the first
+# examples:
+# 0b10010 => [ 0b01100, 2, 0b01100 ], [ 0b00001, 1, 0b00001]
+# 0b01010 => [ 0b10000, 1, 0b10000 ], [ 0b00100, 1, 0b00100 ], [ 0b00001, 1, 0b00001]
+# 0b10001 => [ 0b01110, 3, 0b01110 ]
+def create_collector_support
+ odd_map = [0b11, 0b110, 0b1100, 0b11000, 0b10000]
+ even_map = [0b1, 0b11, 0b110, 0b1100, 0b11000]
+
+ all_odds = Array.new(0b100000)
+ all_evens = Array.new(0b100000)
+ bit_counts = Array.new(0b100000)
+ new_regions = Array.new(0b100000)
+ 0.upto(0b11111) do | i |
+ bit_count = odd = even = 0
+ 0.upto(4) do | bit |
+ if (i[bit] == 1) then
+ bit_count += 1
+ odd |= odd_map[bit]
+ even |= even_map[bit]
+ end
+ end
+ all_odds[i] = odd
+ all_evens[i] = even
+ bit_counts[i] = bit_count
+ new_regions[i] = create_regions( i)
+ end
+
+ $converter = []
+ 10.times { | row | $converter.push((row % 2 == 0) ? all_evens : all_odds) }
+ $bit_counts = bit_counts
+ $regions = new_regions.collect { | set | set.collect { | value | [ value, bit_counts[value], value] } }
+end
+
+# determines if a board is punable, meaning that there is no possibility that it
+# can be filled up with pieces. A board is prunable if there is a grouping of unfilled spaces
+# that are not a multiple of five. The following board is an example of a prunable board:
+# 0 0 1 0 0
+# 0 1 0 0 0
+# 1 1 0 0 0
+# 0 1 0 0 0
+# 0 0 0 0 0
+# ...
+#
+# This board is prunable because the top left corner is only 3 bits in area, no piece will ever fit it
+# parameters:
+# board -- an initial bit board (6 bit padded rows, see blank_board for format)
+# location -- starting location, everything above and to the left is already full
+# slotting -- set to true only when testing initial pieces, when filling normally
+# additional assumptions are possible
+#
+# Algorithm:
+# The algorithm starts at the top row (as determined by location) and iterates a row at a time
+# maintainng counts of active open areas (kept in the collector array) each collector contains
+# three values at the start of an iteration:
+# 0: mask of bits that would be adjacent to the collector in this row
+# 1: the number of bits collected so far
+# 2: a scratch space starting as zero, but used during the computation to represent
+# the empty bits in the new row that are adjacent (position 0)
+# The exact procedure is described in-code
+def prunable( board, location, slotting = false)
+ collectors = []
+ # loop across the rows
+ (location / 6).to_i.upto(9) do | row_on |
+ # obtain a set of regions representing the bits of the current row.
+ regions = $regions[(board >> (row_on * 6)) & 0b11111]
+ converter = $converter[row_on]
+
+ # track the number of collectors at the start of the cycle so that
+ # we don't compute against newly created collectors, only existing collectors
+ initial_collector_count = collectors.length
+
+ # loop against the regions. For each region of the row
+ # we will see if it connects to one or more existing collectors.
+ # if it connects to 1 collector, the bits from the region are added to the
+ # bits of the collector and the mask is placed in collector[2]
+ # If the region overlaps more than one collector then all the collectors
+ # it overlaps with are merged into the first one (the others are set to nil in the array)
+ # if NO collectors are found then the region is copied as a new collector
+ regions.each do | region |
+ collector_found = nil
+ region_mask = region[2]
+ initial_collector_count.times do | collector_num |
+ collector = collectors[collector_num]
+ if (collector) then
+ collector_mask = collector[0]
+ if (collector_mask & region_mask != 0) then
+ if (collector_found) then
+ collector_found[0] |= collector_mask
+ collector_found[1] += collector[1]
+ collector_found[2] |= collector[2]
+ collectors[collector_num] = nil
+ else
+ collector_found = collector
+ collector[1] += region[1]
+ collector[2] |= region_mask
+ end
+ end
+ end
+ end
+ if (collector_found == nil) then
+ collectors.push(Array.new(region))
+ end
+ end
+
+ # check the existing collectors, if any collector overlapped no bits in the region its [2] value will
+ # be zero. The size of any such reaason is tested if it is not a multiple of five true is returned since
+ # the board is prunable. if it is a multiple of five it is removed.
+ # Collector that are still active have a new adjacent value [0] set based n the matched bits
+ # and have [2] cleared out for the next cycle.
+ collectors.length.times do | collector_num |
+ collector = collectors[collector_num]
+ if (collector) then
+ if (collector[2] == 0) then
+ return true if (collector[1] % 5 != 0)
+ collectors[collector_num] = nil
+ else
+ # if a collector matches all bits in the row then we can return unprunable early for the
+ # following reasons:
+ # 1) there can be no more unavailable bits bince we fill from the top left downward
+ # 2) all previous regions have been closed or joined so only this region can fail
+ # 3) this region must be good since there can never be only 1 region that is nuot
+ # a multiple of five
+ # this rule only applies when filling normally, so we ignore the rule if we are "slotting"
+ # in pieces to see what configurations work for them (the only other time this algorithm is used).
+ return false if (collector[2] == 0b11111 && !slotting)
+ collector[0] = converter[collector[2]]
+ collector[2] = 0
+ end
+ end
+ end
+
+ # get rid of all the empty converters for the next round
+ collectors.compact!
+ end
+ return false if (collectors.length <= 1) # 1 collector or less and the region is fine
+ collectors.any? { | collector | (collector[1] % 5) != 0 } # more than 1 and we test them all for bad size
+end
+
+# creates a region given a row mask. see prunable for what a "region" is
+def create_regions( value )
+ regions = []
+ cur_region = 0
+ 5.times do | bit |
+ if (value[bit] == 0) then
+ cur_region |= 1 << bit
+ else
+ if (cur_region != 0 ) then
+ regions.push( cur_region)
+ cur_region = 0;
+ end
+ end
+ end
+ regions.push(cur_region) if (cur_region != 0)
+ regions
+end
+
+# find up to the counted number of solutions (or all solutions) and prints the final result
+def find_all
+ find_top( 1)
+ find_top( 0)
+ print_results
+end
+
+# show the board
+def print_results
+ print "#{@boards_found} solutions found\n\n"
+ print_full_board( @min_board)
+ print "\n"
+ print_full_board( @max_board)
+ print "\n"
+end
+
+# finds solutions. This special version of the main function is only used for the top level
+# the reason for it is basically to force a particular ordering on how the rotations are tested for
+# the first piece. It is called twice, first looking for placements of the odd rotations and then
+# looking for placements of the even locations.
+#
+# WHY?
+# Since any found solution has an inverse we want to maximize finding solutions that are not already found
+# as an inverse. The inverse will ALWAYS be 3 one of the piece configurations that is exactly 3 rotations away
+# (an odd number). Checking even vs odd then produces a higher probability of finding more pieces earlier
+# in the cycle. We still need to keep checking all the permutations, but our probability of finding one will
+# diminsh over time. Since we are TOLD how many to search for this lets us exit before checking all pieces
+# this bennifit is very great when seeking small numbers of solutions and is 0 when looking for more than the
+# maximum number
+def find_top( rotation_skip)
+ board = blank_board
+ (@pieces.length-1).times do
+ piece = @pieces.shift
+ piece.masks[0].each do | mask, imask, cmask |
+ if ((rotation_skip += 1) % 2 == 0) then
+ piece.placed = mask
+ find( 1, 1, board | mask)
+ end
+ end
+ @pieces.push(piece)
+ end
+ piece = @pieces.shift
+ @pieces.push(piece)
+end
+
+# the normail find routine, iterates through the available pieces, checks all rotations at the current location
+# and adds any boards found. depth is acheived via recursion. the overall approach is described
+# 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
+# placed -- number of pieces placed
+# board -- current state of the board
+#
+# see in-code comments
+def find( start_location, placed, board)
+ # find the next location to place a piece by looking for an empty bit
+ while board[start_location] == 1
+ start_location += 1
+ end
+
+ @pieces.length.times do
+ piece = @pieces.shift
+ piece.masks[start_location].each do | mask, imask, cmask |
+ if ( board & cmask == imask) then
+ piece.placed = mask
+ if (placed == 9) then
+ add_board
+ else
+ find( start_location + 1, placed + 1, board | mask)
+ end
+ end
+ end
+ @pieces.push(piece)
+ end
+end
+
+# print the board
+def print_full_board( board_string)
+ 10.times do | row |
+ print " " if (row % 2 == 1)
+ 5.times do | col |
+ print "#{board_string[row*5 + col,1]} "
+ end
+ print "\n"
+ end
+end
+
+# when a board is found we "draw it" into a string and then flip that string, adding both to
+# the list (hash) of solutions if they are unique.
+def add_board
+ board_string = "99999999999999999999999999999999999999999999999999"
+ @all_pieces.each { | piece | piece.fill_string( board_string ) }
+ save( board_string)
+ save( board_string.reverse)
+end
+
+# adds a board string to the list (if new) and updates the current best/worst board
+def save( board_string)
+ if (@all_boards[board_string] == nil) then
+ @min_board = board_string if (board_string < @min_board)
+ @max_board = board_string if (board_string > @max_board)
+ @all_boards.store(board_string,true)
+ @boards_found += 1
+
+ # the exit motif is a time saver. Ideally the function should return, but those tests
+ # take noticeable time (performance).
+ if (@boards_found == @stop_count) then
+ print_results
+ exit(0)
+ end
+ end
+end
+
+
+##
+## MAIN BODY :)
+##
+create_collector_support
+@pieces = [
+ Piece.new( [ :nw, :ne, :east, :east ], 2),
+ Piece.new( [ :ne, :se, :east, :ne ], 7),
+ Piece.new( [ :ne, :east, :ne, :nw ], 1),
+ Piece.new( [ :east, :sw, :sw, :se ], 6),
+ Piece.new( [ :east, :ne, :se, :ne ], 5),
+ Piece.new( [ :east, :east, :east, :se ], 0),
+ Piece.new( [ :ne, :nw, :se, :east, :se ], 4),
+ Piece.new( [ :se, :se, :se, :west ], 9),
+ Piece.new( [ :se, :se, :east, :se ], 8),
+ Piece.new( [ :east, :east, :sw, :se ], 3)
+ ];
+
+@all_pieces = Array.new( @pieces)
+
+@min_board = "99999999999999999999999999999999999999999999999999"
+@max_board = "00000000000000000000000000000000000000000000000000"
+@stop_count = ARGV[0].to_i || 2089
+@all_boards = {}
+@boards_found = 0
+
+find_all ######## DO IT!!!
+
diff --git a/benchmark/so_nbody.rb b/benchmark/bm_so_nbody.rb
index d6c5bb9e61..d6c5bb9e61 100644
--- a/benchmark/so_nbody.rb
+++ b/benchmark/bm_so_nbody.rb
diff --git a/benchmark/bm_so_nested_loop.rb b/benchmark/bm_so_nested_loop.rb
new file mode 100644
index 0000000000..a0513f8c47
--- /dev/null
+++ b/benchmark/bm_so_nested_loop.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: nestedloop-ruby.code,v 1.4 2004/11/13 07:42:22 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# from Avi Bryant
+
+n = 16 # Integer(ARGV.shift || 1)
+x = 0
+n.times do
+ n.times do
+ n.times do
+ n.times do
+ n.times do
+ n.times do
+ x += 1
+ end
+ end
+ end
+ end
+ end
+end
+# puts x
+
+
diff --git a/benchmark/so_nsieve.rb b/benchmark/bm_so_nsieve.rb
index a65cc78233..a65cc78233 100644
--- a/benchmark/so_nsieve.rb
+++ b/benchmark/bm_so_nsieve.rb
diff --git a/benchmark/so_nsieve_bits.rb b/benchmark/bm_so_nsieve_bits.rb
index 6f958ee44e..6f958ee44e 100644
--- a/benchmark/so_nsieve_bits.rb
+++ b/benchmark/bm_so_nsieve_bits.rb
diff --git a/benchmark/bm_so_object.rb b/benchmark/bm_so_object.rb
new file mode 100644
index 0000000000..e8607c7199
--- /dev/null
+++ b/benchmark/bm_so_object.rb
@@ -0,0 +1,56 @@
+#!/usr/bin/ruby
+# -*- mode: ruby -*-
+# $Id: objinst-ruby.code,v 1.4 2004/11/13 07:42:25 bfulgham Exp $
+# http://www.bagley.org/~doug/shootout/
+# with help from Aristarkh Zagorodnikov
+
+class Toggle
+ def initialize(start_state)
+ @bool = start_state
+ end
+
+ def value
+ @bool
+ end
+
+ def activate
+ @bool = !@bool
+ self
+ end
+end
+
+class NthToggle < Toggle
+ def initialize(start_state, max_counter)
+ super start_state
+ @count_max = max_counter
+ @counter = 0
+ end
+
+ def activate
+ @counter += 1
+ if @counter >= @count_max
+ @bool = !@bool
+ @counter = 0
+ end
+ self
+ end
+end
+
+n = 1500000 # (ARGV.shift || 1).to_i
+
+toggle = Toggle.new 1
+5.times do
+ toggle.activate.value ? 'true' : 'false'
+end
+n.times do
+ toggle = Toggle.new 1
+end
+
+ntoggle = NthToggle.new 1, 3
+8.times do
+ ntoggle.activate.value ? 'true' : 'false'
+end
+n.times do
+ ntoggle = NthToggle.new 1, 3
+end
+
diff --git a/benchmark/so_partial_sums.rb b/benchmark/bm_so_partial_sums.rb
index 630b45cb8d..630b45cb8d 100644
--- a/benchmark/so_partial_sums.rb
+++ b/benchmark/bm_so_partial_sums.rb
diff --git a/benchmark/bm_so_pidigits.rb b/benchmark/bm_so_pidigits.rb
new file mode 100644
index 0000000000..c7d6fbfb4d
--- /dev/null
+++ b/benchmark/bm_so_pidigits.rb
@@ -0,0 +1,92 @@
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# contributed by Gabriele Renzi
+
+class PiDigitSpigot
+
+ def initialize()
+ @z = Transformation.new 1,0,0,1
+ @x = Transformation.new 0,0,0,0
+ @inverse = Transformation.new 0,0,0,0
+ end
+
+ def next!
+ @y = @z.extract(3)
+ if safe? @y
+ @z = produce(@y)
+ @y
+ else
+ @z = consume @x.next!()
+ next!()
+ end
+ end
+
+ def safe?(digit)
+ digit == @z.extract(4)
+ end
+
+ def produce(i)
+ @inverse.qrst(10,-10*i,0,1).compose(@z)
+ end
+
+ def consume(a)
+ @z.compose(a)
+ end
+end
+
+
+class Transformation
+ attr_reader :q, :r, :s, :t
+ def initialize (q, r, s, t)
+ @q,@r,@s,@t,@k = q,r,s,t,0
+ end
+
+ def next!()
+ @q = @k = @k + 1
+ @r = 4 * @k + 2
+ @s = 0
+ @t = 2 * @k + 1
+ self
+ end
+
+ def extract(j)
+ (@q * j + @r) / (@s * j + @t)
+ end
+
+ def compose(a)
+ self.class.new( @q * a.q,
+ @q * a.r + r * a.t,
+ @s * a.q + t * a.s,
+ @s * a.r + t * a.t
+ )
+ end
+
+ def qrst *args
+ initialize *args
+ self
+ end
+
+
+end
+
+
+WIDTH = 10
+n = 2_500 # Integer(ARGV[0])
+j = 0
+
+digits = PiDigitSpigot.new
+
+while n > 0
+ if n >= WIDTH
+ WIDTH.times {print digits.next!}
+ j += WIDTH
+ else
+ n.times {print digits.next!}
+ (WIDTH-n).times {print " "}
+ j += n
+ end
+ puts "\t:"+j.to_s
+ n -= WIDTH
+end
+
diff --git a/benchmark/so_random.rb b/benchmark/bm_so_random.rb
index a66b9e8e63..a66b9e8e63 100644
--- a/benchmark/so_random.rb
+++ b/benchmark/bm_so_random.rb
diff --git a/benchmark/bm_so_reverse_complement.rb b/benchmark/bm_so_reverse_complement.rb
new file mode 100644
index 0000000000..82ea666994
--- /dev/null
+++ b/benchmark/bm_so_reverse_complement.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/ruby
+# The Great Computer Language Shootout
+# http://shootout.alioth.debian.org/
+#
+# Contributed by Peter Bjarke Olsen
+# Modified by Doug King
+
+seq=Array.new
+
+def revcomp(seq)
+ seq.reverse!.tr!('wsatugcyrkmbdhvnATUGCYRKMBDHVN','WSTAACGRYMKVHDBNTAACGRYMKVHDBN')
+ stringlen=seq.length
+ 0.step(stringlen-1,60) {|x| print seq.slice(x,60) , "\n"}
+end
+
+input = open(File.join(File.dirname($0), 'fasta.output.2500000'), 'rb')
+
+while input.gets
+ if $_ =~ />/
+ if seq.length != 0
+ revcomp(seq.join)
+ seq=Array.new
+ end
+ puts $_
+ else
+ $_.sub(/\n/,'')
+ seq.push $_
+ end
+end
+revcomp(seq.join)
diff --git a/benchmark/so_sieve.rb b/benchmark/bm_so_sieve.rb
index 43dc302648..43dc302648 100644
--- a/benchmark/so_sieve.rb
+++ b/benchmark/bm_so_sieve.rb
diff --git a/benchmark/so_spectralnorm.rb b/benchmark/bm_so_spectralnorm.rb
index 6b97206689..6b97206689 100644
--- a/benchmark/so_spectralnorm.rb
+++ b/benchmark/bm_so_spectralnorm.rb
diff --git a/benchmark/bm_vm1_attr_ivar.rb b/benchmark/bm_vm1_attr_ivar.rb
new file mode 100644
index 0000000000..16906f3605
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar.rb
@@ -0,0 +1,14 @@
+class C
+ attr_reader :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = obj.a
+ k = obj.b
+end
diff --git a/benchmark/bm_vm1_attr_ivar_set.rb b/benchmark/bm_vm1_attr_ivar_set.rb
new file mode 100644
index 0000000000..7e7a6b48c0
--- /dev/null
+++ b/benchmark/bm_vm1_attr_ivar_set.rb
@@ -0,0 +1,14 @@
+class C
+ attr_accessor :a, :b
+ def initialize
+ @a = nil
+ @b = nil
+ end
+end
+obj = C.new
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ obj.a = 1
+ obj.b = 2
+end
diff --git a/benchmark/bm_vm1_block.rb b/benchmark/bm_vm1_block.rb
new file mode 100644
index 0000000000..a9f56b15ea
--- /dev/null
+++ b/benchmark/bm_vm1_block.rb
@@ -0,0 +1,10 @@
+def m
+ yield
+end
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ m{
+ }
+end
diff --git a/benchmark/bm_vm1_const.rb b/benchmark/bm_vm1_const.rb
new file mode 100644
index 0000000000..ac59ebccf1
--- /dev/null
+++ b/benchmark/bm_vm1_const.rb
@@ -0,0 +1,8 @@
+Const = 1
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = Const
+ k = Const
+end
diff --git a/benchmark/bm_vm1_ensure.rb b/benchmark/bm_vm1_ensure.rb
new file mode 100644
index 0000000000..a1596145f2
--- /dev/null
+++ b/benchmark/bm_vm1_ensure.rb
@@ -0,0 +1,11 @@
+i = 0
+while i<30_000_000 # benchmark loop 1
+ i += 1
+ begin
+ begin
+ ensure
+ end
+ ensure
+ end
+end
+
diff --git a/benchmark/bm_vm1_float_simple.rb b/benchmark/bm_vm1_float_simple.rb
new file mode 100644
index 0000000000..d4581439ff
--- /dev/null
+++ b/benchmark/bm_vm1_float_simple.rb
@@ -0,0 +1,7 @@
+i = 0.0; f = 0.0
+while i<30_000_000
+ i += 1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+ f += 0.1; f -= 0.1
+end
diff --git a/benchmark/bm_vm1_gc_short_lived.rb b/benchmark/bm_vm1_gc_short_lived.rb
new file mode 100644
index 0000000000..e78bca5668
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_lived.rb
@@ -0,0 +1,10 @@
+i = 0
+while i<30_000_000 # while loop 1
+ a = '' # short-lived String
+ b = ''
+ c = ''
+ d = ''
+ e = ''
+ f = ''
+ i+=1
+end
diff --git a/benchmark/bm_vm1_gc_short_with_complex_long.rb b/benchmark/bm_vm1_gc_short_with_complex_long.rb
new file mode 100644
index 0000000000..b66052dee0
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_with_complex_long.rb
@@ -0,0 +1,27 @@
+def nested_hash h, n
+ if n == 0
+ ''
+ else
+ 10.times{
+ h[Object.new] = nested_hash(h, n-1)
+ }
+ end
+end
+
+long_lived = Hash.new
+nested_hash long_lived, 6
+
+GC.start
+GC.start
+
+i = 0
+while i<30_000_000 # while loop 1
+ a = '' # short-lived String
+ b = ''
+ c = ''
+ d = ''
+ e = ''
+ f = ''
+ i+=1
+end
+
diff --git a/benchmark/bm_vm1_gc_short_with_long.rb b/benchmark/bm_vm1_gc_short_with_long.rb
new file mode 100644
index 0000000000..298dbc845b
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_with_long.rb
@@ -0,0 +1,13 @@
+long_lived = Array.new(1_000_000){|i| "#{i}"}
+GC.start
+GC.start
+i = 0
+while i<30_000_000 # while loop 1
+ a = '' # short-lived String
+ b = ''
+ c = ''
+ d = ''
+ e = ''
+ f = ''
+ i+=1
+end
diff --git a/benchmark/bm_vm1_gc_short_with_symbol.rb b/benchmark/bm_vm1_gc_short_with_symbol.rb
new file mode 100644
index 0000000000..6b15c1b7bf
--- /dev/null
+++ b/benchmark/bm_vm1_gc_short_with_symbol.rb
@@ -0,0 +1,15 @@
+# make many symbols
+50_000.times{|i| sym = "sym#{i}".to_sym}
+GC.start
+GC.start
+
+i = 0
+while i<30_000_000 # while loop 1
+ a = '' # short-lived String
+ b = ''
+ c = ''
+ d = ''
+ e = ''
+ f = ''
+ i+=1
+end
diff --git a/benchmark/bm_vm1_gc_wb_ary.rb b/benchmark/bm_vm1_gc_wb_ary.rb
new file mode 100644
index 0000000000..ecfab51dbf
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_ary.rb
@@ -0,0 +1,10 @@
+long_lived = []
+GC.start
+GC.start
+
+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
new file mode 100644
index 0000000000..017eff4f94
--- /dev/null
+++ b/benchmark/bm_vm1_gc_wb_obj.rb
@@ -0,0 +1,13 @@
+class C
+ attr_accessor :foo
+end
+long_lived = C.new
+GC.start
+GC.start
+
+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_vm1_ivar.rb b/benchmark/bm_vm1_ivar.rb
new file mode 100644
index 0000000000..68a73cf92f
--- /dev/null
+++ b/benchmark/bm_vm1_ivar.rb
@@ -0,0 +1,8 @@
+@a = 1
+
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ j = @a
+ k = @a
+end
diff --git a/benchmark/bm_vm1_ivar_set.rb b/benchmark/bm_vm1_ivar_set.rb
new file mode 100644
index 0000000000..bd81b06c34
--- /dev/null
+++ b/benchmark/bm_vm1_ivar_set.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ @a = 1
+ @b = 2
+end
diff --git a/benchmark/bm_vm1_length.rb b/benchmark/bm_vm1_length.rb
new file mode 100644
index 0000000000..353de3ab0e
--- /dev/null
+++ b/benchmark/bm_vm1_length.rb
@@ -0,0 +1,9 @@
+a = 'abc'
+b = [1, 2, 3]
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a.length
+ b.length
+end
+
diff --git a/benchmark/bm_vm1_lvar_init.rb b/benchmark/bm_vm1_lvar_init.rb
new file mode 100644
index 0000000000..36f2068811
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_init.rb
@@ -0,0 +1,18 @@
+def m v
+ unless v
+ # unreachable code
+ v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 =
+ v11 = v12 = v13 = v14 = v15 = v16 = v17 = v18 = v19 = v20 =
+ v21 = v22 = v23 = v24 = v25 = v26 = v27 = v28 = v29 = v30 =
+ v31 = v32 = v33 = v34 = v35 = v36 = v37 = v38 = v39 = v40 =
+ v41 = v42 = v43 = v44 = v45 = v46 = v47 = v48 = v49 = v50 = 1
+ end
+end
+
+i = 0
+
+while i<30_000_000 # while loop 1
+ i += 1
+ m i
+end
+
diff --git a/benchmark/bm_vm1_lvar_set.rb b/benchmark/bm_vm1_lvar_set.rb
new file mode 100644
index 0000000000..222e864134
--- /dev/null
+++ b/benchmark/bm_vm1_lvar_set.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a = b = c = d = e = f = g = h = j = k = l = m = n = o = p = q = r = 1
+end
diff --git a/benchmark/bm_vm1_neq.rb b/benchmark/bm_vm1_neq.rb
new file mode 100644
index 0000000000..bbb4ae07a4
--- /dev/null
+++ b/benchmark/bm_vm1_neq.rb
@@ -0,0 +1,8 @@
+i = 0
+obj1 = Object.new
+obj2 = Object.new
+
+while i<30_000_000 # while loop 1
+ i += 1
+ obj1 != obj2
+end
diff --git a/benchmark/bm_vm1_not.rb b/benchmark/bm_vm1_not.rb
new file mode 100644
index 0000000000..b09ecdcc21
--- /dev/null
+++ b/benchmark/bm_vm1_not.rb
@@ -0,0 +1,7 @@
+i = 0
+obj = Object.new
+
+while i<30_000_000 # while loop 1
+ i += 1
+ !obj
+end
diff --git a/benchmark/bm_vm1_rescue.rb b/benchmark/bm_vm1_rescue.rb
new file mode 100644
index 0000000000..b0d3e2bdfa
--- /dev/null
+++ b/benchmark/bm_vm1_rescue.rb
@@ -0,0 +1,7 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ begin
+ rescue
+ end
+end
diff --git a/benchmark/bm_vm1_simplereturn.rb b/benchmark/bm_vm1_simplereturn.rb
new file mode 100644
index 0000000000..63f9f21675
--- /dev/null
+++ b/benchmark/bm_vm1_simplereturn.rb
@@ -0,0 +1,9 @@
+def m
+ return 1
+end
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ m
+end
+
diff --git a/benchmark/bm_vm1_swap.rb b/benchmark/bm_vm1_swap.rb
new file mode 100644
index 0000000000..918f8b2112
--- /dev/null
+++ b/benchmark/bm_vm1_swap.rb
@@ -0,0 +1,8 @@
+a = 1
+b = 2
+i = 0
+while i<30_000_000 # while loop 1
+ i += 1
+ a, b = b, a
+end
+
diff --git a/benchmark/bm_vm1_yield.rb b/benchmark/bm_vm1_yield.rb
new file mode 100644
index 0000000000..775597cea6
--- /dev/null
+++ b/benchmark/bm_vm1_yield.rb
@@ -0,0 +1,10 @@
+def m
+ i = 0
+ while i<30_000_000 # while loop 1
+ i += 1
+ yield
+ end
+end
+
+m{}
+
diff --git a/benchmark/bm_vm2_array.rb b/benchmark/bm_vm2_array.rb
new file mode 100644
index 0000000000..df9037c83c
--- /dev/null
+++ b/benchmark/bm_vm2_array.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [1,2,3,4,5,6,7,8,9,10]
+end
diff --git a/benchmark/bm_vm2_bigarray.rb b/benchmark/bm_vm2_bigarray.rb
new file mode 100644
index 0000000000..b02509d6a2
--- /dev/null
+++ b/benchmark/bm_vm2_bigarray.rb
@@ -0,0 +1,106 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ a = [
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4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,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ ]
+end
diff --git a/benchmark/bm_vm2_bighash.rb b/benchmark/bm_vm2_bighash.rb
new file mode 100644
index 0000000000..5e3f437bb8
--- /dev/null
+++ b/benchmark/bm_vm2_bighash.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<60_000 # benchmark loop 2
+ i += 1
+ a = {0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20, 21=>21, 22=>22, 23=>23, 24=>24, 25=>25, 26=>26, 27=>27, 28=>28, 29=>29, 30=>30, 31=>31, 32=>32, 33=>33, 34=>34, 35=>35, 36=>36, 37=>37, 38=>38, 39=>39, 40=>40, 41=>41, 42=>42, 43=>43, 44=>44, 45=>45, 46=>46, 47=>47, 48=>48, 49=>49, 50=>50, 51=>51, 52=>52, 53=>53, 54=>54, 55=>55, 56=>56, 57=>57, 58=>58, 59=>59, 60=>60, 61=>61, 62=>62, 63=>63, 64=>64, 65=>65, 66=>66, 67=>67, 68=>68, 69=>69, 70=>70, 71=>71, 72=>72, 73=>73, 74=>74, 75=>75, 76=>76, 77=>77, 78=>78, 79=>79, 80=>80, 81=>81, 82=>82, 83=>83, 84=>84, 85=>85, 86=>86, 87=>87, 88=>88, 89=>89, 90=>90, 91=>91, 92=>92, 93=>93, 94=>94, 95=>95, 96=>96, 97=>97, 98=>98, 99=>99, 100=>100, 101=>101, 102=>102, 103=>103, 104=>104, 105=>105, 106=>106, 107=>107, 108=>108, 109=>109, 110=>110, 111=>111, 112=>112, 113=>113, 114=>114, 115=>115, 116=>116, 117=>117, 118=>118, 119=>119, 120=>120, 121=>121, 122=>122, 123=>123, 124=>124, 125=>125, 126=>126, 127=>127, 128=>128, 129=>129, 130=>130, 131=>131, 132=>132, 133=>133, 134=>134, 135=>135, 136=>136, 137=>137, 138=>138, 139=>139, 140=>140, 141=>141, 142=>142, 143=>143, 144=>144, 145=>145, 146=>146, 147=>147, 148=>148, 149=>149, 150=>150, 151=>151, 152=>152, 153=>153, 154=>154, 155=>155, 156=>156, 157=>157, 158=>158, 159=>159, 160=>160, 161=>161, 162=>162, 163=>163, 164=>164, 165=>165, 166=>166, 167=>167, 168=>168, 169=>169, 170=>170, 171=>171, 172=>172, 173=>173, 174=>174, 175=>175, 176=>176, 177=>177, 178=>178, 179=>179, 180=>180, 181=>181, 182=>182, 183=>183, 184=>184, 185=>185, 186=>186, 187=>187, 188=>188, 189=>189, 190=>190, 191=>191, 192=>192, 193=>193, 194=>194, 195=>195, 196=>196, 197=>197, 198=>198, 199=>199, 200=>200, 201=>201, 202=>202, 203=>203, 204=>204, 205=>205, 206=>206, 207=>207, 208=>208, 209=>209, 210=>210, 211=>211, 212=>212, 213=>213, 214=>214, 215=>215, 216=>216, 217=>217, 218=>218, 219=>219, 220=>220, 221=>221, 222=>222, 223=>223, 224=>224, 225=>225, 226=>226, 227=>227, 228=>228, 229=>229, 230=>230, 231=>231, 232=>232, 233=>233, 234=>234, 235=>235, 236=>236, 237=>237, 238=>238, 239=>239, 240=>240, 241=>241, 242=>242, 243=>243, 244=>244, 245=>245, 246=>246, 247=>247, 248=>248, 249=>249, 250=>250, 251=>251, 252=>252, 253=>253, 254=>254, 255=>255, 256=>256, 257=>257, 258=>258, 259=>259, 260=>260, 261=>261, 262=>262, 263=>263, 264=>264, 265=>265, 266=>266, 267=>267, 268=>268, 269=>269, 270=>270, 271=>271, 272=>272, 273=>273, 274=>274, 275=>275, 276=>276, 277=>277, 278=>278, 279=>279, 280=>280, 281=>281, 282=>282, 283=>283, 284=>284, 285=>285, 286=>286, 287=>287, 288=>288, 289=>289, 290=>290, 291=>291, 292=>292, 293=>293, 294=>294, 295=>295, 296=>296, 297=>297, 298=>298, 299=>299, 300=>300, 301=>301, 302=>302, 303=>303, 304=>304, 305=>305, 306=>306, 307=>307, 308=>308, 309=>309, 310=>310, 311=>311, 312=>312, 313=>313, 314=>314, 315=>315, 316=>316, 317=>317, 318=>318, 319=>319, 320=>320, 321=>321, 322=>322, 323=>323, 324=>324, 325=>325, 326=>326, 327=>327, 328=>328, 329=>329, 330=>330, 331=>331, 332=>332, 333=>333, 334=>334, 335=>335, 336=>336, 337=>337, 338=>338, 339=>339, 340=>340, 341=>341, 342=>342, 343=>343, 344=>344, 345=>345, 346=>346, 347=>347, 348=>348, 349=>349, 350=>350, 351=>351, 352=>352, 353=>353, 354=>354, 355=>355, 356=>356, 357=>357, 358=>358, 359=>359, 360=>360, 361=>361, 362=>362, 363=>363, 364=>364, 365=>365, 366=>366, 367=>367, 368=>368, 369=>369, 370=>370, 371=>371, 372=>372, 373=>373, 374=>374, 375=>375, 376=>376, 377=>377, 378=>378, 379=>379, 380=>380, 381=>381, 382=>382, 383=>383, 384=>384, 385=>385, 386=>386, 387=>387, 388=>388, 389=>389, 390=>390, 391=>391, 392=>392, 393=>393, 394=>394, 395=>395, 396=>396, 397=>397, 398=>398, 399=>399, 400=>400, 401=>401, 402=>402, 403=>403, 404=>404, 405=>405, 406=>406, 407=>407, 408=>408, 409=>409, 410=>410, 411=>411, 412=>412, 413=>413, 414=>414, 415=>415, 416=>416, 417=>417, 418=>418, 419=>419, 420=>420, 421=>421, 422=>422, 423=>423, 424=>424, 425=>425, 426=>426, 427=>427, 428=>428, 429=>429, 430=>430, 431=>431, 432=>432, 433=>433, 434=>434, 435=>435, 436=>436, 437=>437, 438=>438, 439=>439, 440=>440, 441=>441, 442=>442, 443=>443, 444=>444, 445=>445, 446=>446, 447=>447, 448=>448, 449=>449, 450=>450, 451=>451, 452=>452, 453=>453, 454=>454, 455=>455, 456=>456, 457=>457, 458=>458, 459=>459, 460=>460, 461=>461, 462=>462, 463=>463, 464=>464, 465=>465, 466=>466, 467=>467, 468=>468, 469=>469, 470=>470, 471=>471, 472=>472, 473=>473, 474=>474, 475=>475, 476=>476, 477=>477, 478=>478, 479=>479, 480=>480, 481=>481, 482=>482, 483=>483, 484=>484, 485=>485, 486=>486, 487=>487, 488=>488, 489=>489, 490=>490, 491=>491, 492=>492, 493=>493, 494=>494, 495=>495, 496=>496, 497=>497, 498=>498, 499=>499, 500=>500,}
+end
diff --git a/benchmark/bm_vm2_case.rb b/benchmark/bm_vm2_case.rb
new file mode 100644
index 0000000000..adc6e4df0a
--- /dev/null
+++ b/benchmark/bm_vm2_case.rb
@@ -0,0 +1,14 @@
+i = 0
+while i<6_000_000 # while loop 2
+ case :foo
+ when :bar
+ raise
+ when :baz
+ raise
+ when :boo
+ raise
+ when :foo
+ i += 1
+ end
+end
+
diff --git a/benchmark/bm_vm2_defined_method.rb b/benchmark/bm_vm2_defined_method.rb
new file mode 100644
index 0000000000..053ed6c912
--- /dev/null
+++ b/benchmark/bm_vm2_defined_method.rb
@@ -0,0 +1,9 @@
+class Object
+ define_method(:m){}
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m; m; m; m; m; m; m; m;
+end
diff --git a/benchmark/bm_vm2_dstr.rb b/benchmark/bm_vm2_dstr.rb
new file mode 100644
index 0000000000..58c0f7bbc3
--- /dev/null
+++ b/benchmark/bm_vm2_dstr.rb
@@ -0,0 +1,6 @@
+i = 0
+x = y = 'z'
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ str = "foo#{x}bar#{y}baz"
+end
diff --git a/benchmark/bm_vm2_eval.rb b/benchmark/bm_vm2_eval.rb
new file mode 100644
index 0000000000..307cfc28ef
--- /dev/null
+++ b/benchmark/bm_vm2_eval.rb
@@ -0,0 +1,6 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ eval("1")
+end
+
diff --git a/benchmark/bm_vm2_method.rb b/benchmark/bm_vm2_method.rb
new file mode 100644
index 0000000000..a8ccff7138
--- /dev/null
+++ b/benchmark/bm_vm2_method.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m; m; m; m; m; m; m; m;
+end
diff --git a/benchmark/bm_vm2_method_missing.rb b/benchmark/bm_vm2_method_missing.rb
new file mode 100644
index 0000000000..2badc73101
--- /dev/null
+++ b/benchmark/bm_vm2_method_missing.rb
@@ -0,0 +1,12 @@
+class C
+ def method_missing mid
+ end
+end
+
+obj = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m;
+end
diff --git a/benchmark/bm_vm2_method_with_block.rb b/benchmark/bm_vm2_method_with_block.rb
new file mode 100644
index 0000000000..b4efb4f520
--- /dev/null
+++ b/benchmark/bm_vm2_method_with_block.rb
@@ -0,0 +1,9 @@
+def m
+ nil
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{};
+end
diff --git a/benchmark/bm_vm2_mutex.rb b/benchmark/bm_vm2_mutex.rb
new file mode 100644
index 0000000000..7362f738c5
--- /dev/null
+++ b/benchmark/bm_vm2_mutex.rb
@@ -0,0 +1,9 @@
+require 'thread'
+
+m = Mutex.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m.synchronize{}
+end
diff --git a/benchmark/bm_vm2_newlambda.rb b/benchmark/bm_vm2_newlambda.rb
new file mode 100644
index 0000000000..6422c9b0d0
--- /dev/null
+++ b/benchmark/bm_vm2_newlambda.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ lambda {}
+end
diff --git a/benchmark/bm_vm2_poly_method.rb b/benchmark/bm_vm2_poly_method.rb
new file mode 100644
index 0000000000..c82c0e4bce
--- /dev/null
+++ b/benchmark/bm_vm2_poly_method.rb
@@ -0,0 +1,20 @@
+class C1
+ def m
+ 1
+ end
+end
+class C2
+ def m
+ 2
+ end
+end
+
+o1 = C1.new
+o2 = C2.new
+
+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_poly_method_ov.rb b/benchmark/bm_vm2_poly_method_ov.rb
new file mode 100644
index 0000000000..aa5fd1dd38
--- /dev/null
+++ b/benchmark/bm_vm2_poly_method_ov.rb
@@ -0,0 +1,20 @@
+class C1
+ def m
+ 1
+ end
+end
+class C2
+ def m
+ 2
+ end
+end
+
+o1 = C1.new
+o2 = C2.new
+
+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_proc.rb b/benchmark/bm_vm2_proc.rb
new file mode 100644
index 0000000000..65e5217371
--- /dev/null
+++ b/benchmark/bm_vm2_proc.rb
@@ -0,0 +1,14 @@
+def m &b
+ b
+end
+
+pr = m{
+ a = 1
+}
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ pr.call
+end
+
diff --git a/benchmark/bm_vm2_raise1.rb b/benchmark/bm_vm2_raise1.rb
new file mode 100644
index 0000000000..aa5387987f
--- /dev/null
+++ b/benchmark/bm_vm2_raise1.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 1
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_raise2.rb b/benchmark/bm_vm2_raise2.rb
new file mode 100644
index 0000000000..1f61c63157
--- /dev/null
+++ b/benchmark/bm_vm2_raise2.rb
@@ -0,0 +1,18 @@
+def rec n
+ if n > 0
+ rec n-1
+ else
+ raise
+ end
+end
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+
+ begin
+ rec 10
+ rescue
+ # ignore
+ end
+end
diff --git a/benchmark/bm_vm2_regexp.rb b/benchmark/bm_vm2_regexp.rb
new file mode 100644
index 0000000000..55f9e957a3
--- /dev/null
+++ b/benchmark/bm_vm2_regexp.rb
@@ -0,0 +1,6 @@
+i = 0
+str = 'xxxhogexxx'
+while i<6_000_000 # benchmark loop 2
+ /hoge/ =~ str
+ i += 1
+end
diff --git a/benchmark/bm_vm2_send.rb b/benchmark/bm_vm2_send.rb
new file mode 100644
index 0000000000..6a3ab6fdab
--- /dev/null
+++ b/benchmark/bm_vm2_send.rb
@@ -0,0 +1,12 @@
+class C
+ def m
+ end
+end
+
+o = C.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ o.__send__ :m
+end
diff --git a/benchmark/bm_vm2_struct_big_aref_hi.rb b/benchmark/bm_vm2_struct_big_aref_hi.rb
new file mode 100644
index 0000000000..22cb26b0a5
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aref_hi.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.z # x[25]
+end
diff --git a/benchmark/bm_vm2_struct_big_aref_lo.rb b/benchmark/bm_vm2_struct_big_aref_lo.rb
new file mode 100644
index 0000000000..5e61a7087e
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aref_lo.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.k # x[10]
+end
diff --git a/benchmark/bm_vm2_struct_big_aset.rb b/benchmark/bm_vm2_struct_big_aset.rb
new file mode 100644
index 0000000000..5a1c3d16f3
--- /dev/null
+++ b/benchmark/bm_vm2_struct_big_aset.rb
@@ -0,0 +1,7 @@
+s = Struct.new(*('a'..'z').map { |x| x.to_sym })
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.k = i # x[10] = i
+end
diff --git a/benchmark/bm_vm2_struct_small_aref.rb b/benchmark/bm_vm2_struct_small_aref.rb
new file mode 100644
index 0000000000..8eaa555b41
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_aref.rb
@@ -0,0 +1,7 @@
+s = Struct.new(:a, :b, :c)
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.a
+end
diff --git a/benchmark/bm_vm2_struct_small_aset.rb b/benchmark/bm_vm2_struct_small_aset.rb
new file mode 100644
index 0000000000..ecd0f95669
--- /dev/null
+++ b/benchmark/bm_vm2_struct_small_aset.rb
@@ -0,0 +1,7 @@
+s = Struct.new(:a, :b, :c)
+x = s.new
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ x.a = i
+end
diff --git a/benchmark/bm_vm2_super.rb b/benchmark/bm_vm2_super.rb
new file mode 100644
index 0000000000..afd8579e7b
--- /dev/null
+++ b/benchmark/bm_vm2_super.rb
@@ -0,0 +1,20 @@
+
+class C
+ def m
+ 1
+ end
+end
+
+class CC < C
+ def m
+ super()
+ end
+end
+
+obj = CC.new
+
+i = 0
+while i<6_000_000 # benchmark loop 2
+ obj.m
+ i += 1
+end
diff --git a/benchmark/bm_vm2_unif1.rb b/benchmark/bm_vm2_unif1.rb
new file mode 100644
index 0000000000..1774625942
--- /dev/null
+++ b/benchmark/bm_vm2_unif1.rb
@@ -0,0 +1,8 @@
+i = 0
+def m a, b
+end
+
+while i<6_000_000 # benchmark loop 2
+ i += 1
+ m 100, 200
+end
diff --git a/benchmark/bm_vm2_zsuper.rb b/benchmark/bm_vm2_zsuper.rb
new file mode 100644
index 0000000000..2a43e62217
--- /dev/null
+++ b/benchmark/bm_vm2_zsuper.rb
@@ -0,0 +1,20 @@
+i = 0
+
+class C
+ def m a
+ 1
+ end
+end
+
+class CC < C
+ def m a
+ super
+ end
+end
+
+obj = CC.new
+
+while i<6_000_000 # benchmark loop 2
+ obj.m 10
+ i += 1
+end
diff --git a/benchmark/vm3_backtrace.rb b/benchmark/bm_vm3_backtrace.rb
index 0fbf73e1ca..0fbf73e1ca 100644
--- a/benchmark/vm3_backtrace.rb
+++ b/benchmark/bm_vm3_backtrace.rb
diff --git a/benchmark/vm3_clearmethodcache.rb b/benchmark/bm_vm3_clearmethodcache.rb
index 9661323cd2..9661323cd2 100644
--- a/benchmark/vm3_clearmethodcache.rb
+++ b/benchmark/bm_vm3_clearmethodcache.rb
diff --git a/benchmark/bm_vm3_gc.rb b/benchmark/bm_vm3_gc.rb
new file mode 100755
index 0000000000..7db9829d44
--- /dev/null
+++ b/benchmark/bm_vm3_gc.rb
@@ -0,0 +1,7 @@
+#! /usr/bin/ruby
+5000.times do
+ 100.times do
+ {"xxxx"=>"yyyy"}
+ end
+ GC.start
+end
diff --git a/benchmark/bm_vm_thread_alive_check1.rb b/benchmark/bm_vm_thread_alive_check1.rb
new file mode 100644
index 0000000000..c993accdda
--- /dev/null
+++ b/benchmark/bm_vm_thread_alive_check1.rb
@@ -0,0 +1,6 @@
+5_000.times{
+ t = Thread.new{}
+ while t.alive?
+ Thread.pass
+ end
+}
diff --git a/benchmark/vm_thread_close.rb b/benchmark/bm_vm_thread_close.rb
index 3e9a265ce8..3e9a265ce8 100644
--- a/benchmark/vm_thread_close.rb
+++ b/benchmark/bm_vm_thread_close.rb
diff --git a/benchmark/vm_thread_create_join.rb b/benchmark/bm_vm_thread_create_join.rb
index 393cd45df9..393cd45df9 100644
--- a/benchmark/vm_thread_create_join.rb
+++ b/benchmark/bm_vm_thread_create_join.rb
diff --git a/benchmark/bm_vm_thread_mutex1.rb b/benchmark/bm_vm_thread_mutex1.rb
new file mode 100644
index 0000000000..5c9f85dfb7
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex1.rb
@@ -0,0 +1,21 @@
+# one thread, one mutex (no contention)
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+lmax = max * max
+(1..1).map{
+ Thread.new{
+ i = 0
+ while i<lmax
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_mutex2.rb b/benchmark/bm_vm_thread_mutex2.rb
new file mode 100644
index 0000000000..10de59054f
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex2.rb
@@ -0,0 +1,21 @@
+# two threads, one mutex
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+lmax = (max * max)/2
+(1..2).map{
+ Thread.new{
+ i = 0
+ while i<lmax
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_mutex3.rb b/benchmark/bm_vm_thread_mutex3.rb
new file mode 100644
index 0000000000..7f9a44b39d
--- /dev/null
+++ b/benchmark/bm_vm_thread_mutex3.rb
@@ -0,0 +1,20 @@
+# 1000 threads, one mutex
+
+require 'thread'
+m = Mutex.new
+r = 0
+max = 2000
+(1..max).map{
+ Thread.new{
+ i = 0
+ while i<max
+ i += 1
+ m.synchronize{
+ r += 1
+ }
+ end
+ }
+}.each{|e|
+ e.join
+}
+raise r.to_s if r != max * max
diff --git a/benchmark/bm_vm_thread_pass.rb b/benchmark/bm_vm_thread_pass.rb
new file mode 100644
index 0000000000..b5b3c0bc85
--- /dev/null
+++ b/benchmark/bm_vm_thread_pass.rb
@@ -0,0 +1,15 @@
+# Plenty Thtread.pass
+# A performance may depend on GVL implementation.
+
+tmax = (ARGV.shift || 2).to_i
+lmax = 200_000 / tmax
+
+(1..tmax).map{
+ Thread.new{
+ lmax.times{
+ Thread.pass
+ }
+ }
+}.each{|t| t.join}
+
+
diff --git a/benchmark/bm_vm_thread_pass_flood.rb b/benchmark/bm_vm_thread_pass_flood.rb
new file mode 100644
index 0000000000..27157d1a6f
--- /dev/null
+++ b/benchmark/bm_vm_thread_pass_flood.rb
@@ -0,0 +1,8 @@
+1000.times{
+ Thread.new{loop{Thread.pass}}
+}
+
+i = 0
+while i<10000
+ i += 1
+end
diff --git a/benchmark/bm_vm_thread_pipe.rb b/benchmark/bm_vm_thread_pipe.rb
new file mode 100644
index 0000000000..272d231eba
--- /dev/null
+++ b/benchmark/bm_vm_thread_pipe.rb
@@ -0,0 +1,17 @@
+# Mesure small and plenty pipe read/write.
+# A performance may depend on GVL implementation.
+
+lmax = 100_000
+r, w = IO.pipe
+[Thread.new{
+ lmax.times{
+ w.write('a')
+ }
+ p "w:exit"
+}, Thread.new{
+ lmax.times{
+ r.read(1)
+ }
+ p "r:exit"
+}].each{|t| t.join}
+
diff --git a/benchmark/bm_vm_thread_queue.rb b/benchmark/bm_vm_thread_queue.rb
new file mode 100644
index 0000000000..37381ae62b
--- /dev/null
+++ b/benchmark/bm_vm_thread_queue.rb
@@ -0,0 +1,18 @@
+require 'thread'
+
+n = 1_000_000
+q = Queue.new
+consumer = Thread.new{
+ while q.pop
+ # consuming
+ end
+}
+
+producer = Thread.new{
+ n.times{
+ q.push true
+ }
+ q.push nil
+}
+
+consumer.join
diff --git a/benchmark/cgi_escape_html.yml b/benchmark/cgi_escape_html.yml
deleted file mode 100644
index af6abd08ac..0000000000
--- a/benchmark/cgi_escape_html.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-prelude: require 'cgi/escape'
-benchmark:
- - name: escape_html_blank
- prelude: str = ""
- script: CGI.escapeHTML(str)
- loop_count: 20000000
- - name: escape_html_short_none
- prelude: str = "abcde"
- script: CGI.escapeHTML(str)
- loop_count: 20000000
- - name: escape_html_short_one
- prelude: str = "abcd<"
- script: CGI.escapeHTML(str)
- loop_count: 20000000
- - name: escape_html_short_all
- prelude: str = "'&\"<>"
- script: CGI.escapeHTML(str)
- loop_count: 5000000
- - name: escape_html_long_none
- prelude: str = "abcde" * 300
- script: CGI.escapeHTML(str)
- loop_count: 1000000
- - name: escape_html_long_all
- prelude: str = "'&\"<>" * 10
- script: CGI.escapeHTML(str)
- loop_count: 1000000
- - name: escape_html_real
- prelude: | # http://example.com/
- str = <<~HTML
- <body>
- <div>
- <h1>Example Domain</h1>
- <p>This domain is established to be used for illustrative examples in documents. You may use this
- domain in examples without prior coordination or asking for permission.</p>
- <p><a href="http://www.iana.org/domains/example">More information...</a></p>
- </div>
- </body>
- HTML
- script: CGI.escapeHTML(str)
- loop_count: 1000000
diff --git a/benchmark/complex_float_add.yml b/benchmark/complex_float_add.yml
deleted file mode 100644
index d0150c5e5b..0000000000
--- a/benchmark/complex_float_add.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- max, min = 1000.0, -1000.0
- a = Complex(rand(max)+min, rand(max)+min)
- b = Complex(rand(max)+min, rand(max)+min)
-benchmark:
- complex_float_add: c = a + b
-loop_count: 1000000
diff --git a/benchmark/complex_float_div.yml b/benchmark/complex_float_div.yml
deleted file mode 100644
index b9f5e1d51c..0000000000
--- a/benchmark/complex_float_div.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- max, min = 1000.0, -1000.0
- a = Complex(rand(max)+min, rand(max)+min)
- b = Complex(rand(max)+min, rand(max)+min)
-benchmark:
- complex_float_div: c = a / b
-loop_count: 1000000
diff --git a/benchmark/complex_float_mul.yml b/benchmark/complex_float_mul.yml
deleted file mode 100644
index 59b096a6dc..0000000000
--- a/benchmark/complex_float_mul.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- max, min = 1000.0, -1000.0
- a = Complex(rand(max)+min, rand(max)+min)
- b = Complex(rand(max)+min, rand(max)+min)
-benchmark:
- complex_float_mul: c = a * b
-loop_count: 1000000
diff --git a/benchmark/complex_float_new.yml b/benchmark/complex_float_new.yml
deleted file mode 100644
index 6fcde3125b..0000000000
--- a/benchmark/complex_float_new.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- max, min = 1000.0, -1000.0
- a = Complex(rand(max)+min, rand(max)+min)
- b = Complex(rand(max)+min, rand(max)+min)
-benchmark:
- complex_float_new: c = Complex(a, b)
-loop_count: 1000000
diff --git a/benchmark/complex_float_power.yml b/benchmark/complex_float_power.yml
deleted file mode 100644
index c40a31ab55..0000000000
--- a/benchmark/complex_float_power.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- max, min = 1000.0, -1000.0
- a = Complex(rand(max)+min, rand(max)+min)
- b = Complex(rand(max)+min, rand(max)+min)
-benchmark:
- complex_float_power: c = a ** b
-loop_count: 1000000
diff --git a/benchmark/complex_float_sub.yml b/benchmark/complex_float_sub.yml
deleted file mode 100644
index 3fafe7cdbe..0000000000
--- a/benchmark/complex_float_sub.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- max, min = 1000.0, -1000.0
- a = Complex(rand(max)+min, rand(max)+min)
- b = Complex(rand(max)+min, rand(max)+min)
-benchmark:
- complex_float_sub: c = a - b
-loop_count: 1000000
diff --git a/benchmark/dir_empty_p.rb b/benchmark/dir_empty_p.rb
deleted file mode 100644
index 8329c757cf..0000000000
--- a/benchmark/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/driver.rb b/benchmark/driver.rb
new file mode 100644
index 0000000000..3904e25503
--- /dev/null
+++ b/benchmark/driver.rb
@@ -0,0 +1,321 @@
+#
+# Ruby Benchmark driver
+#
+
+first = true
+
+begin
+ require 'optparse'
+rescue LoadError
+ if first
+ first = false
+ $:.unshift File.join(File.dirname(__FILE__), '../lib')
+ retry
+ else
+ raise
+ end
+end
+
+require 'benchmark'
+require 'pp'
+
+class BenchmarkDriver
+ def self.benchmark(opt)
+ driver = self.new(opt[:execs], opt[:dir], opt)
+ begin
+ driver.run
+ ensure
+ driver.show_results
+ end
+ end
+
+ def output *args
+ puts(*args)
+ @output and @output.puts(*args)
+ end
+
+ def message *args
+ output(*args) if @verbose
+ end
+
+ def message_print *args
+ if @verbose
+ print(*args)
+ STDOUT.flush
+ @output and @output.print(*args)
+ end
+ end
+
+ def progress_message *args
+ unless STDOUT.tty?
+ STDERR.print(*args)
+ STDERR.flush
+ end
+ end
+
+ def initialize execs, dir, opt = {}
+ @execs = execs.map{|e|
+ e.strip!
+ next if e.empty?
+
+ if /(.+)::(.+)/ =~ e
+ # ex) ruby-a::/path/to/ruby-a
+ label = $1.strip
+ path = $2
+ version = `#{path} -v`.chomp
+ else
+ path = e
+ version = label = `#{path} -v`.chomp
+ end
+ [path, label, version]
+ }.compact
+
+ @dir = dir
+ @repeat = opt[:repeat] || 1
+ @repeat = 1 if @repeat < 1
+ @pattern = opt[:pattern] || nil
+ @exclude = opt[:exclude] || nil
+ @verbose = opt[:quiet] ? false : (opt[:verbose] || false)
+ @output = opt[:output] ? open(opt[:output], 'w') : nil
+ @rawdata_output = opt[:rawdata_output] ? open(opt[:rawdata_output], 'w') : nil
+ @loop_wl1 = @loop_wl2 = nil
+ @ruby_arg = opt[:ruby_arg] || nil
+ @opt = opt
+
+ # [[name, [[r-1-1, r-1-2, ...], [r-2-1, r-2-2, ...]]], ...]
+ @results = []
+
+ if @verbose
+ @start_time = Time.now
+ message @start_time
+ @execs.each_with_index{|(path, label, version), i|
+ message "target #{i}: " + (label == version ? "#{label}" : "#{label} (#{version})") + " at \"#{path}\""
+ }
+ end
+ end
+
+ def adjusted_results name, results
+ s = nil
+ results.each_with_index{|e, i|
+ r = e.min
+ case name
+ when /^vm1_/
+ if @loop_wl1
+ r -= @loop_wl1[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ when /^vm2_/
+ if @loop_wl2
+ r -= @loop_wl2[i]
+ r = 0 if r < 0
+ s = '*'
+ end
+ end
+ yield r
+ }
+ s
+ end
+
+ def show_results
+ output
+
+ if @verbose
+ message '-----------------------------------------------------------'
+ message 'raw data:'
+ message
+ message PP.pp(@results, "", 79)
+ message
+ message "Elapsed time: #{Time.now - @start_time} (sec)"
+ end
+
+ if @rawdata_output
+ h = {}
+ h[:cpuinfo] = File.read('/proc/cpuinfo') if File.exist?('/proc/cpuinfo')
+ h[:executables] = @execs
+ h[:results] = @results
+ @rawdata_output.puts h.inspect
+ end
+
+ output '-----------------------------------------------------------'
+ output 'benchmark results:'
+
+ if @verbose and @repeat > 1
+ output "minimum results in each #{@repeat} measurements."
+ end
+
+ 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("%.3f", r)
+ }
+ output "#{v}#{s}\t#{rets.join("\t")}"
+ }
+
+ if @execs.size > 1
+ output
+ output "Speedup ratio: compare with the result of `#{@execs[0][1]}' (greater is better)"
+ output "name\t#{@execs[1..-1].map{|(_, v)| v}.join("\t")}"
+ @results.each{|v, result|
+ rets = []
+ first_value = nil
+ s = adjusted_results(v, result){|r|
+ if first_value
+ if r == 0
+ rets << "Error"
+ else
+ rets << sprintf("%.3f", first_value/r)
+ end
+ else
+ first_value = r
+ end
+ }
+ output "#{v}#{s}\t#{rets.join("\t")}"
+ }
+ end
+
+ if @opt[:output]
+ output
+ output "Log file: #{@opt[:output]}"
+ end
+ end
+
+ def files
+ flag = {}
+ @files = Dir.glob(File.join(@dir, 'bm*.rb')).map{|file|
+ next if @pattern && /#{@pattern}/ !~ File.basename(file)
+ next if @exclude && /#{@exclude}/ =~ File.basename(file)
+ case file
+ when /bm_(vm[12])_/, /bm_loop_(whileloop2?).rb/
+ flag[$1] = true
+ end
+ file
+ }.compact
+
+ if flag['vm1'] && !flag['whileloop']
+ @files << File.join(@dir, 'bm_loop_whileloop.rb')
+ elsif flag['vm2'] && !flag['whileloop2']
+ @files << File.join(@dir, 'bm_loop_whileloop2.rb')
+ end
+
+ @files.sort!
+ progress_message "total: #{@files.size * @repeat} trial(s) (#{@repeat} trial(s) for #{@files.size} benchmark(s))\n"
+ @files
+ end
+
+ def run
+ files.each_with_index{|file, i|
+ @i = i
+ r = measure_file(file)
+
+ if /bm_loop_whileloop.rb/ =~ file
+ @loop_wl1 = r[1].map{|e| e.min}
+ elsif /bm_loop_whileloop2.rb/ =~ file
+ @loop_wl2 = r[1].map{|e| e.min}
+ end
+ }
+ end
+
+ def measure_file file
+ name = File.basename(file, '.rb').sub(/^bm_/, '')
+ prepare_file = File.join(File.dirname(file), "prepare_#{name}.rb")
+ load prepare_file if FileTest.exist?(prepare_file)
+
+ if @verbose
+ output
+ output '-----------------------------------------------------------'
+ output name
+ output
+ output File.read(file)
+ output
+ end
+
+ result = [name]
+ result << @execs.map{|(e, v)|
+ (0...@repeat).map{
+ message_print "#{v}\t"
+ progress_message '.'
+
+ m = measure(e, file)
+ message "#{m}"
+ m
+ }
+ }
+ @results << result
+ result
+ end
+
+ unless defined?(File::NULL)
+ if File.exist?('/dev/null')
+ File::NULL = '/dev/null'
+ end
+ end
+
+ def measure executable, file
+ cmd = "#{executable} #{@ruby_arg} #{file}"
+
+ m = Benchmark.measure{
+ system(cmd, out: File::NULL)
+ }
+
+ if $? != 0
+ output "\`#{cmd}\' exited with abnormal status (#{$?})"
+ 0
+ else
+ m.real
+ end
+ end
+end
+
+if __FILE__ == $0
+ opt = {
+ :execs => [],
+ :dir => File.dirname(__FILE__),
+ :repeat => 1,
+ :output => "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}",
+ :raw_output => nil
+ }
+
+ parser = OptionParser.new{|o|
+ o.on('-e', '--executables [EXECS]',
+ "Specify benchmark one or more targets (e1::path1; e2::path2; e3::path3;...)"){|e|
+ e.split(/;/).each{|path|
+ opt[:execs] << path
+ }
+ }
+ o.on('-d', '--directory [DIRECTORY]', "Benchmark suites directory"){|d|
+ opt[:dir] = d
+ }
+ o.on('-p', '--pattern [PATTERN]', "Benchmark name pattern"){|p|
+ opt[:pattern] = p
+ }
+ o.on('-x', '--exclude [PATTERN]', "Benchmark exclude pattern"){|e|
+ opt[:exclude] = e
+ }
+ o.on('-r', '--repeat-count [NUM]', "Repeat count"){|n|
+ opt[:repeat] = n.to_i
+ }
+ o.on('-o', '--output-file [FILE]', "Output file"){|f|
+ opt[:output] = f
+ }
+ o.on('--ruby-arg [ARG]', "Optional argument for ruby"){|a|
+ opt[:ruby_arg] = a
+ }
+ o.on('--rawdata-output [FILE]', 'output rawdata'){|r|
+ opt[:rawdata_output] = r
+ }
+ o.on('-v', '--verbose'){|v|
+ opt[:verbose] = v
+ }
+ o.on('-q', '--quiet', "Run without notify information except result table."){|q|
+ opt[:quiet] = q
+ opt[:verbose] = false
+ }
+ }
+
+ parser.parse!(ARGV)
+ BenchmarkDriver.benchmark(opt)
+end
+
diff --git a/benchmark/enum_lazy_grep_v_100.rb b/benchmark/enum_lazy_grep_v_100.rb
deleted file mode 100644
index 8832392e65..0000000000
--- a/benchmark/enum_lazy_grep_v_100.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-grep_data = (1..10).to_a * 1000
-N = 100
-enum = grep_data.lazy.grep_v(->(i){i == 0}).grep_v(->(i){i == 0})
-N.times {enum.each {}}
diff --git a/benchmark/enum_lazy_grep_v_20.rb b/benchmark/enum_lazy_grep_v_20.rb
deleted file mode 100644
index 329509fa8f..0000000000
--- a/benchmark/enum_lazy_grep_v_20.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-grep_data = (1..10).to_a * 1000
-N = 100
-enum = grep_data.lazy.grep_v(->(i){i > 2}).grep_v(->(i){i > 2})
-N.times {enum.each {}}
diff --git a/benchmark/enum_lazy_grep_v_50.rb b/benchmark/enum_lazy_grep_v_50.rb
deleted file mode 100644
index 02ea4d4e71..0000000000
--- a/benchmark/enum_lazy_grep_v_50.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-grep_data = (1..10).to_a * 1000
-N = 100
-enum = grep_data.lazy.grep_v(->(i){i > 5}).grep_v(->(i){i > 5})
-N.times {enum.each {}}
diff --git a/benchmark/enum_lazy_uniq_100.rb b/benchmark/enum_lazy_uniq_100.rb
deleted file mode 100644
index 2e6434d9c4..0000000000
--- a/benchmark/enum_lazy_uniq_100.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-uniq_data = (1..10_000).to_a
-N = 100
-enum = uniq_data.lazy.uniq {|i| i % 10000}.uniq {|i| i % 10000}
-N.times {enum.each {}}
diff --git a/benchmark/enum_lazy_uniq_20.rb b/benchmark/enum_lazy_uniq_20.rb
deleted file mode 100644
index 75e6398fee..0000000000
--- a/benchmark/enum_lazy_uniq_20.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-uniq_data = (1..10_000).to_a
-N = 100
-enum = uniq_data.lazy.uniq {|i| i % 2000}.uniq {|i| i % 2000}
-N.times {enum.each {}}
diff --git a/benchmark/enum_lazy_uniq_50.rb b/benchmark/enum_lazy_uniq_50.rb
deleted file mode 100644
index 59a39b78ff..0000000000
--- a/benchmark/enum_lazy_uniq_50.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-uniq_data = (1..10_000).to_a
-N = 100
-enum = uniq_data.lazy.uniq {|i| i % 5000}.uniq {|i| i % 5000}
-N.times {enum.each {}}
diff --git a/benchmark/erb_render.yml b/benchmark/erb_render.yml
deleted file mode 100644
index 15f6c3880b..0000000000
--- a/benchmark/erb_render.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-prelude: |
- require 'erb'
-
- data = <<erb
- <html>
- <head> <%= title %> </head>
- <body>
- <h1> <%= title %> </h1>
- <p>
- <%= content %>
- </p>
- </body>
- </html>
- erb
-
- 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)")
-benchmark:
- erb_render: mod.render(title, content)
-loop_count: 1500000
diff --git a/benchmark/fiber_chain.yml b/benchmark/fiber_chain.yml
deleted file mode 100755
index a36c759f8e..0000000000
--- a/benchmark/fiber_chain.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-prelude: |
- def make_link(previous)
- Fiber.new do
- while message = previous.resume
- Fiber.yield(message)
- end
- end
- end
-
- def make_chain(length = 1000, &block)
- chain = Fiber.new(&block)
-
- (length - 1).times do
- chain = make_link(chain)
- end
-
- return chain
- end
-
- message = "Hello World!"
-
- chain = make_chain do
- while true
- Fiber.yield(message)
- end
- end
-benchmark:
- make_chain: |
- make_chain(100) do
- while true
- Fiber.yield(message)
- end
- end
- resume_chain: |
- chain.resume
-loop_count: 5000
diff --git a/benchmark/file_chmod.rb b/benchmark/file_chmod.rb
deleted file mode 100644
index 1cd4760c9d..0000000000
--- a/benchmark/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/file_rename.rb b/benchmark/file_rename.rb
deleted file mode 100644
index bbb44aebac..0000000000
--- a/benchmark/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 }
-tmp.each { |t| t.close } # Windows can't rename files without closing them
-max.times do
- File.rename(a, b)
- File.rename(b, a)
-end
diff --git a/benchmark/gc/aobench.rb b/benchmark/gc/aobench.rb
index 275f58b924..2eed7abc83 100644
--- a/benchmark/gc/aobench.rb
+++ b/benchmark/gc/aobench.rb
@@ -1 +1 @@
-require_relative '../app_aobench'
+require_relative '../bm_app_aobench.rb'
diff --git a/benchmark/gc/binary_trees.rb b/benchmark/gc/binary_trees.rb
index 83347cdd20..af8ea722aa 100644
--- a/benchmark/gc/binary_trees.rb
+++ b/benchmark/gc/binary_trees.rb
@@ -1 +1 @@
-require_relative '../so_binary_trees'
+require_relative '../bm_so_binary_trees.rb'
diff --git a/benchmark/gc/gcbench.rb b/benchmark/gc/gcbench.rb
index 23d0b91c6c..09a404466a 100644
--- a/benchmark/gc/gcbench.rb
+++ b/benchmark/gc/gcbench.rb
@@ -3,12 +3,11 @@ require 'pp'
require 'optparse'
$list = true
-$gcprof = false
+$gcprof = true
opt = OptionParser.new
opt.on('-q'){$list = false}
opt.on('-d'){$gcprof = false}
-opt.on('-p'){$gcprof = true}
opt.parse!(ARGV)
script = File.join(File.dirname(__FILE__), ARGV.shift)
diff --git a/benchmark/gc/pentomino.rb b/benchmark/gc/pentomino.rb
index 8ebdff7d1d..94ba74be89 100644
--- a/benchmark/gc/pentomino.rb
+++ b/benchmark/gc/pentomino.rb
@@ -1 +1 @@
-require_relative '../app_pentomino'
+require_relative '../bm_app_pentomino.rb'
diff --git a/benchmark/hash_aref_dsym.rb b/benchmark/hash_aref_dsym.rb
deleted file mode 100644
index af4f8c36d4..0000000000
--- a/benchmark/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/hash_aref_dsym_long.rb b/benchmark/hash_aref_dsym_long.rb
deleted file mode 100644
index 9d7759379e..0000000000
--- a/benchmark/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/hash_aref_fix.rb b/benchmark/hash_aref_fix.rb
deleted file mode 100644
index 1346890582..0000000000
--- a/benchmark/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/hash_dup.yml b/benchmark/hash_dup.yml
deleted file mode 100644
index 65f521ec94..0000000000
--- a/benchmark/hash_dup.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- small_hash = { a: 1 }
- larger_hash = 20.times.map { |i| [('a'.ord + i).chr.to_sym, i] }.to_h
-
-benchmark:
- dup_small: small_hash.dup
- dup_larger: larger_hash.dup
-loop_count: 10000
diff --git a/benchmark/hash_literal_small2.rb b/benchmark/hash_literal_small2.rb
deleted file mode 100644
index c188529260..0000000000
--- a/benchmark/hash_literal_small2.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-1_000_000.times.map { { "foo" => "bar", "bar" => "baz" } }
diff --git a/benchmark/hash_literal_small4.rb b/benchmark/hash_literal_small4.rb
deleted file mode 100644
index 739f71b5b0..0000000000
--- a/benchmark/hash_literal_small4.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-1_000_000.times.map { { "foo" => "bar", "bar" => "baz", "baz" => "lol", "lol" => "lgtm" } }
diff --git a/benchmark/hash_literal_small8.rb b/benchmark/hash_literal_small8.rb
deleted file mode 100644
index 53d80af535..0000000000
--- a/benchmark/hash_literal_small8.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-1_000_000.times.map { { "foo" => "bar", "bar" => "baz", "baz" => "lol", "lol" => "lgtm", "lgtm" => "nope", "nope" => "ok", "ok" => "again", "again" => "wait" } }
diff --git a/benchmark/hash_long.rb b/benchmark/hash_long.rb
deleted file mode 100644
index 03d9109602..0000000000
--- a/benchmark/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/hash_shift_u16.rb b/benchmark/hash_shift_u16.rb
deleted file mode 100644
index ec800d0342..0000000000
--- a/benchmark/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/hash_shift_u24.rb b/benchmark/hash_shift_u24.rb
deleted file mode 100644
index de4e0fa696..0000000000
--- a/benchmark/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/hash_shift_u32.rb b/benchmark/hash_shift_u32.rb
deleted file mode 100644
index 656aa55583..0000000000
--- a/benchmark/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/hash_small2.rb b/benchmark/hash_small2.rb
deleted file mode 100644
index 45485d9c71..0000000000
--- a/benchmark/hash_small2.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times.map{|i| a={}; 2.times{|j| a[j]=j}; a}
diff --git a/benchmark/hash_small4.rb b/benchmark/hash_small4.rb
deleted file mode 100644
index acd4084334..0000000000
--- a/benchmark/hash_small4.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times.map{|i| a={}; 4.times{|j| a[j]=j}; a}
diff --git a/benchmark/hash_small8.rb b/benchmark/hash_small8.rb
deleted file mode 100644
index 9cffcc91b6..0000000000
--- a/benchmark/hash_small8.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times.map{|i| a={}; 8.times{|j| a[j]=j}; a}
diff --git a/benchmark/hash_to_proc.rb b/benchmark/hash_to_proc.rb
deleted file mode 100644
index 2b675bf509..0000000000
--- a/benchmark/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/int_quo.rb b/benchmark/int_quo.rb
deleted file mode 100644
index e22a3f8c30..0000000000
--- a/benchmark/int_quo.rb
+++ /dev/null
@@ -1 +0,0 @@
-5000000.times { 42.quo(3) }
diff --git a/benchmark/io_copy_stream_write.rb b/benchmark/io_copy_stream_write.rb
deleted file mode 100644
index 3fd87250a4..0000000000
--- a/benchmark/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/io_copy_stream_write_socket.rb b/benchmark/io_copy_stream_write_socket.rb
deleted file mode 100644
index 11f369bd0d..0000000000
--- a/benchmark/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/io_nonblock_noex.rb b/benchmark/io_nonblock_noex.rb
deleted file mode 100644
index da9357fdc6..0000000000
--- a/benchmark/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/io_nonblock_noex2.rb b/benchmark/io_nonblock_noex2.rb
deleted file mode 100644
index 56819d049b..0000000000
--- a/benchmark/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/io_pipe_rw.rb b/benchmark/io_pipe_rw.rb
deleted file mode 100644
index 6862a8ae61..0000000000
--- a/benchmark/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/irb_color.yml b/benchmark/irb_color.yml
deleted file mode 100644
index ebdc8d7e8b..0000000000
--- a/benchmark/irb_color.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-prelude: |
- require 'irb/color'
- code = <<~'CODE'
- def self.foo # bar
- :"erb #{ERB.new("<%= self %>", trim_mode: ?-).result}"
- end
- CODE
-benchmark:
- irb_color_complete: |
- IRB::Color.colorize_code(code, complete: true)
- irb_color_incomplete: |
- IRB::Color.colorize_code(code, complete: false)
-loop_count: 2000000
diff --git a/benchmark/irb_exec.yml b/benchmark/irb_exec.yml
deleted file mode 100644
index 28933f8b38..0000000000
--- a/benchmark/irb_exec.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-prelude: |
- # frozen_string_literal: true
- require 'rbconfig'
- irb_f = [File.join(File.dirname(RbConfig.ruby), 'irb'), '-f']
-benchmark:
- irb_exec: |
- IO.popen(irb_f, 'w') do |io|
- io.write('exit')
- end
-loop_count: 30
diff --git a/benchmark/lib/benchmark_driver/output/driver.rb b/benchmark/lib/benchmark_driver/output/driver.rb
deleted file mode 100644
index d22236e9fb..0000000000
--- a/benchmark/lib/benchmark_driver/output/driver.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require 'benchmark_driver/output/simple'
-
-# This replicates the legacy benchmark/driver.rb behavior.
-class BenchmarkDriver::Output::Driver < BenchmarkDriver::Output::Simple
- def initialize(*)
- super
- @stdout = $stdout
- @strio = StringIO.new
- $stdout = IOMultiplexer.new(@stdout, @strio)
- end
-
- def with_benchmark(*)
- super
- ensure
- logfile = "bmlog-#{Time.now.strftime('%Y%m%d-%H%M%S')}.#{$$}.log"
- puts "\nLog file: #{logfile}"
-
- $stdout = @stdout
- File.write(logfile, @strio.tap(&:rewind).read)
- end
-
- class IOMultiplexer
- def initialize(io1, io2)
- @io1 = io1
- @io2 = io2
- end
-
- [:write, :sync, :sync=, :puts, :print, :flush].each do |method|
- define_method(method) do |*args|
- @io1.send(method, *args)
- @io2.send(method, *args)
- end
- end
- end
- private_constant :IOMultiplexer
-end
diff --git a/benchmark/lib/benchmark_driver/runner/cstime.rb b/benchmark/lib/benchmark_driver/runner/cstime.rb
deleted file mode 100644
index 3c3453e527..0000000000
--- a/benchmark/lib/benchmark_driver/runner/cstime.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'benchmark_driver/runner/total'
-
-class BenchmarkDriver::Runner::Cstime < BenchmarkDriver::Runner::Total
- METRIC = BenchmarkDriver::Metric.new(name: 'cstime', unit: 's', larger_better: false)
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- private
-
- # Overriding BenchmarkDriver::Runner::Total#metric
- def metric
- METRIC
- end
-
- # Overriding BenchmarkDriver::Runner::Total#target
- def target
- :cstime
- end
-end
diff --git a/benchmark/lib/benchmark_driver/runner/cutime.rb b/benchmark/lib/benchmark_driver/runner/cutime.rb
deleted file mode 100644
index e139962ef2..0000000000
--- a/benchmark/lib/benchmark_driver/runner/cutime.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'benchmark_driver/runner/total'
-
-class BenchmarkDriver::Runner::Cutime < BenchmarkDriver::Runner::Total
- METRIC = BenchmarkDriver::Metric.new(name: 'cutime', unit: 's', larger_better: false)
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- private
-
- # Overriding BenchmarkDriver::Runner::Total#metric
- def metric
- METRIC
- end
-
- # Overriding BenchmarkDriver::Runner::Total#target
- def target
- :cutime
- end
-end
diff --git a/benchmark/lib/benchmark_driver/runner/mjit_exec.rb b/benchmark/lib/benchmark_driver/runner/mjit_exec.rb
deleted file mode 100644
index 9f7c8c8af3..0000000000
--- a/benchmark/lib/benchmark_driver/runner/mjit_exec.rb
+++ /dev/null
@@ -1,237 +0,0 @@
-require 'benchmark_driver/struct'
-require 'benchmark_driver/metric'
-require 'erb'
-
-# A special runner dedicated for measuring mjit_exec overhead.
-class BenchmarkDriver::Runner::MjitExec
- METRIC = BenchmarkDriver::Metric.new(name: 'Iteration per second', unit: 'i/s')
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = ::BenchmarkDriver::Struct.new(
- :name, # @param [String] name - This is mandatory for all runner
- :metrics, # @param [Array<BenchmarkDriver::Metric>]
- :num_methods, # @param [Integer] num_methods - The number of methods to be defined
- :loop_count, # @param [Integer] loop_count
- :from_jit, # @param [TrueClass,FalseClass] from_jit - Whether the mjit_exec() is from JIT or not
- :to_jit, # @param [TrueClass,FalseClass] to_jit - Whether the mjit_exec() is to JIT or not
- )
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- class << JobParser = Module.new
- # @param [Array,String] num_methods
- # @param [Integer] loop_count
- # @param [TrueClass,FalseClass] from_jit
- # @param [TrueClass,FalseClass] to_jit
- def parse(num_methods:, loop_count:, from_jit:, to_jit:)
- if num_methods.is_a?(String)
- num_methods = eval(num_methods)
- end
-
- num_methods.map do |num|
- if num_methods.size > 1
- suffix = "[#{'%4d' % num}]"
- else
- suffix = "_#{num}"
- end
- Job.new(
- name: "mjit_exec_#{from_jit ? 'JT' : 'VM'}2#{to_jit ? 'JT' : 'VM'}#{suffix}",
- metrics: [METRIC],
- num_methods: num,
- loop_count: loop_count,
- from_jit: from_jit,
- to_jit: to_jit,
- )
- end
- end
- end
-
- # @param [BenchmarkDriver::Config::RunnerConfig] config
- # @param [BenchmarkDriver::Output] output
- # @param [BenchmarkDriver::Context] contexts
- def initialize(config:, output:, contexts:)
- @config = config
- @output = output
- @contexts = contexts
- end
-
- # This method is dynamically called by `BenchmarkDriver::JobRunner.run`
- # @param [Array<BenchmarkDriver::Runner::Peak::Job>] jobs
- def run(jobs)
- @output.with_benchmark do
- jobs.each do |job|
- @output.with_job(name: job.name) do
- @contexts.each do |context|
- result = BenchmarkDriver::Repeater.with_repeat(config: @config, larger_better: true, rest_on_average: :average) do
- run_benchmark(job, context: context)
- end
- value, duration = result.value
- @output.with_context(name: context.name, executable: context.executable, gems: context.gems, prelude: context.prelude) do
- @output.report(values: { METRIC => value }, duration: duration, loop_count: job.loop_count)
- end
- end
- end
- end
- end
- end
-
- private
-
- # @param [BenchmarkDriver::Runner::Ips::Job] job - loop_count is not nil
- # @param [BenchmarkDriver::Context] context
- # @return [BenchmarkDriver::Metrics]
- def run_benchmark(job, context:)
- if job.from_jit
- if job.to_jit
- benchmark = BenchmarkJT2JT.new(num_methods: job.num_methods, loop_count: job.loop_count)
- else
- raise NotImplementedError, "JT2VM is not implemented yet"
- end
- else
- if job.to_jit
- benchmark = BenchmarkVM2JT.new(num_methods: job.num_methods, loop_count: job.loop_count)
- else
- benchmark = BenchmarkVM2VM.new(num_methods: job.num_methods, loop_count: job.loop_count)
- end
- end
-
- duration = Tempfile.open(['benchmark_driver-result', '.txt']) do |f|
- with_script(benchmark.render(result: f.path)) do |path|
- opt = []
- if context.executable.command.any? { |c| c.start_with?('--jit') }
- opt << '--jit-min-calls=2'
- end
- IO.popen([*context.executable.command, '--disable-gems', *opt, path], &:read)
- if $?.success?
- Float(f.read)
- else
- BenchmarkDriver::Result::ERROR
- end
- end
- end
-
- [job.loop_count.to_f / duration, duration]
- end
-
- def with_script(script)
- if @config.verbose >= 2
- sep = '-' * 30
- $stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
- end
-
- Tempfile.open(['benchmark_driver-', '.rb']) do |f|
- f.puts script
- f.close
- return yield(f.path)
- end
- end
-
- # @param [Integer] num_methods
- # @param [Integer] loop_count
- BenchmarkVM2VM = ::BenchmarkDriver::Struct.new(:num_methods, :loop_count) do
- # @param [String] result - A file to write result
- def render(result:)
- ERB.new(<<~EOS, trim_mode: '%').result(binding)
- % num_methods.times do |i|
- def a<%= i %>
- nil
- end
- % end
- RubyVM::MJIT.pause if RubyVM::MJIT.enabled?
-
- def vm
- t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
- i = 0
- while i < <%= loop_count / 1000 %>
- % 1000.times do |i|
- a<%= i % num_methods %>
- % end
- i += 1
- end
- % (loop_count % 1000).times do |i|
- a<%= i % num_methods %>
- % end
- Process.clock_gettime(Process::CLOCK_MONOTONIC) - t
- end
-
- vm # warmup call cache
- File.write(<%= result.dump %>, vm)
- EOS
- end
- end
- private_constant :BenchmarkVM2VM
-
- # @param [Integer] num_methods
- # @param [Integer] loop_count
- BenchmarkVM2JT = ::BenchmarkDriver::Struct.new(:num_methods, :loop_count) do
- # @param [String] result - A file to write result
- def render(result:)
- ERB.new(<<~EOS, trim_mode: '%').result(binding)
- % num_methods.times do |i|
- def a<%= i %>
- nil
- end
- a<%= i %>
- a<%= i %> # --jit-min-calls=2
- % end
- RubyVM::MJIT.pause if RubyVM::MJIT.enabled?
-
- def vm
- t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
- i = 0
- while i < <%= loop_count / 1000 %>
- % 1000.times do |i|
- a<%= i % num_methods %>
- % end
- i += 1
- end
- % (loop_count % 1000).times do |i|
- a<%= i % num_methods %>
- % end
- Process.clock_gettime(Process::CLOCK_MONOTONIC) - t
- end
-
- vm # warmup call cache
- File.write(<%= result.dump %>, vm)
- EOS
- end
- end
- private_constant :BenchmarkVM2JT
-
- # @param [Integer] num_methods
- # @param [Integer] loop_count
- BenchmarkJT2JT = ::BenchmarkDriver::Struct.new(:num_methods, :loop_count) do
- # @param [String] result - A file to write result
- def render(result:)
- ERB.new(<<~EOS, trim_mode: '%').result(binding)
- % num_methods.times do |i|
- def a<%= i %>
- nil
- end
- % end
-
- # You may need to:
- # * Increase `JIT_ISEQ_SIZE_THRESHOLD` to 10000000 in mjit.h
- # * Always return false in `inlinable_iseq_p()` of mjit_compile.c
- def jit
- t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
- i = 0
- while i < <%= loop_count / 1000 %>
- % 1000.times do |i|
- a<%= i % num_methods %>
- % end
- i += 1
- end
- % (loop_count % 1000).times do |i|
- a<%= i % num_methods %>
- % end
- Process.clock_gettime(Process::CLOCK_MONOTONIC) - t
- end
-
- jit
- jit
- RubyVM::MJIT.pause if RubyVM::MJIT.enabled?
- File.write(<%= result.dump %>, jit)
- EOS
- end
- end
- private_constant :BenchmarkJT2JT
-end
diff --git a/benchmark/lib/benchmark_driver/runner/peak.rb b/benchmark/lib/benchmark_driver/runner/peak.rb
deleted file mode 100644
index d04f2e51ff..0000000000
--- a/benchmark/lib/benchmark_driver/runner/peak.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-require 'benchmark_driver/struct'
-require 'benchmark_driver/metric'
-require 'benchmark_driver/default_job'
-require 'benchmark_driver/default_job_parser'
-require 'tempfile'
-
-class BenchmarkDriver::Runner::Peak
- METRIC = BenchmarkDriver::Metric.new(
- name: 'Peak memory usage', unit: 'bytes', larger_better: false, worse_word: 'larger',
- )
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- # @param [BenchmarkDriver::Config::RunnerConfig] config
- # @param [BenchmarkDriver::Output] output
- # @param [BenchmarkDriver::Context] contexts
- def initialize(config:, output:, contexts:)
- @config = config
- @output = output
- @contexts = contexts
- end
-
- # This method is dynamically called by `BenchmarkDriver::JobRunner.run`
- # @param [Array<BenchmarkDriver::Runner::Peak::Job>] jobs
- def run(jobs)
- if jobs.any? { |job| job.loop_count.nil? }
- jobs = jobs.map do |job|
- job.loop_count ? job : Job.new(job.to_h.merge(loop_count: 1))
- end
- end
-
- @output.with_benchmark do
- jobs.each do |job|
- @output.with_job(name: job.name) do
- job.runnable_contexts(@contexts).each do |context|
- value = BenchmarkDriver::Repeater.with_repeat(config: @config, larger_better: false) do
- run_benchmark(job, context: context)
- end
- @output.with_context(name: context.name, executable: context.executable, gems: context.gems, prelude: context.prelude) do
- @output.report(values: { metric => value }, loop_count: job.loop_count)
- end
- end
- end
- end
- end
- end
-
- private
-
- # @param [BenchmarkDriver::Runner::Ips::Job] job - loop_count is not nil
- # @param [BenchmarkDriver::Context] context
- # @return [BenchmarkDriver::Metrics]
- def run_benchmark(job, context:)
- benchmark = BenchmarkScript.new(
- preludes: [context.prelude, job.prelude],
- script: job.script,
- teardown: job.teardown,
- loop_count: job.loop_count,
- )
-
- memory_status = File.expand_path('../../../../tool/lib/memory_status', __dir__)
- Tempfile.open(['benchmark_driver-', '.rb']) do |f|
- with_script(benchmark.render) do |path|
- output = IO.popen([*context.executable.command, path, f.path, target, memory_status], &:read)
- if $?.success?
- Integer(f.read)
- else
- $stdout.print(output)
- BenchmarkDriver::Result::ERROR
- end
- end
- end
- end
-
- # Overridden by BenchmarkDriver::Runner::Size
- def target
- 'peak'
- end
-
- # Overridden by BenchmarkDriver::Runner::Size
- def metric
- METRIC
- end
-
- def with_script(script)
- if @config.verbose >= 2
- sep = '-' * 30
- $stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
- end
-
- Tempfile.open(['benchmark_driver-', '.rb']) do |f|
- f.puts script
- f.close
- return yield(f.path)
- end
- end
-
- # @param [String] prelude
- # @param [String] script
- # @param [String] teardown
- # @param [Integer] loop_count
- BenchmarkScript = ::BenchmarkDriver::Struct.new(:preludes, :script, :teardown, :loop_count) do
- def render
- prelude = preludes.reject(&:nil?).reject(&:empty?).join("\n")
- <<-RUBY
-#{prelude}
-#{while_loop(script, loop_count)}
-#{teardown}
-
-result_file, target, memory_status = ARGV
-require_relative memory_status
-
-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
-else
- raise('unexpected target: ' + target)
-end
-
-File.write(result_file, ms[key])
- RUBY
- end
-
- private
-
- def while_loop(content, times)
- if !times.is_a?(Integer) || times <= 0
- raise ArgumentError.new("Unexpected times: #{times.inspect}")
- end
-
- if times > 1
- <<-RUBY
-__bmdv_i = 0
-while __bmdv_i < #{times}
- #{content}
- __bmdv_i += 1
-end
- RUBY
- else
- content
- end
- end
- end
- private_constant :BenchmarkScript
-end
diff --git a/benchmark/lib/benchmark_driver/runner/size.rb b/benchmark/lib/benchmark_driver/runner/size.rb
deleted file mode 100644
index 1b31f901c7..0000000000
--- a/benchmark/lib/benchmark_driver/runner/size.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'benchmark_driver/runner/peak'
-
-# Actually the same as BenchmarkDriver::Runner::Memory
-class BenchmarkDriver::Runner::Size < BenchmarkDriver::Runner::Peak
- METRIC = BenchmarkDriver::Metric.new(
- name: 'Max resident set size', unit: 'bytes', larger_better: false, worse_word: 'larger',
- )
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- private
-
- # Overriding BenchmarkDriver::Runner::Peak#metric
- def metric
- METRIC
- end
-
- # Overriding BenchmarkDriver::Runner::Peak#target
- def target
- 'size'
- end
-end
diff --git a/benchmark/lib/benchmark_driver/runner/stime.rb b/benchmark/lib/benchmark_driver/runner/stime.rb
deleted file mode 100644
index 4577fb0bf8..0000000000
--- a/benchmark/lib/benchmark_driver/runner/stime.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'benchmark_driver/runner/total'
-
-class BenchmarkDriver::Runner::Stime < BenchmarkDriver::Runner::Total
- METRIC = BenchmarkDriver::Metric.new(name: 'stime', unit: 's', larger_better: false)
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- private
-
- # Overriding BenchmarkDriver::Runner::Total#metric
- def metric
- METRIC
- end
-
- # Overriding BenchmarkDriver::Runner::Total#target
- def target
- :stime
- end
-end
diff --git a/benchmark/lib/benchmark_driver/runner/total.rb b/benchmark/lib/benchmark_driver/runner/total.rb
deleted file mode 100644
index 64dc14f84e..0000000000
--- a/benchmark/lib/benchmark_driver/runner/total.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-require 'benchmark_driver/struct'
-require 'benchmark_driver/metric'
-require 'benchmark_driver/default_job'
-require 'benchmark_driver/default_job_parser'
-require 'tempfile'
-
-class BenchmarkDriver::Runner::Total
- METRIC = BenchmarkDriver::Metric.new(name: 'Total time', unit: 's', larger_better: false)
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- # @param [BenchmarkDriver::Config::RunnerConfig] config
- # @param [BenchmarkDriver::Output] output
- # @param [BenchmarkDriver::Context] contexts
- def initialize(config:, output:, contexts:)
- @config = config
- @output = output
- @contexts = contexts
- end
-
- # This method is dynamically called by `BenchmarkDriver::JobRunner.run`
- # @param [Array<BenchmarkDriver::Runner::Total::Job>] jobs
- def run(jobs)
- if jobs.any? { |job| job.loop_count.nil? }
- raise 'missing loop_count is not supported in Ruby repository'
- end
-
- @output.with_benchmark do
- jobs.each do |job|
- @output.with_job(name: job.name) do
- job.runnable_contexts(@contexts).each do |context|
- duration = BenchmarkDriver::Repeater.with_repeat(config: @config, larger_better: false) do
- run_benchmark(job, context: context)
- end
- @output.with_context(name: context.name, executable: context.executable, gems: context.gems, prelude: context.prelude) do
- @output.report(values: { metric => duration }, duration: duration, loop_count: job.loop_count)
- end
- end
- end
- end
- end
- end
-
- private
-
- # @param [BenchmarkDriver::Runner::Ips::Job] job - loop_count is not nil
- # @param [BenchmarkDriver::Context] context
- # @return [BenchmarkDriver::Metrics]
- def run_benchmark(job, context:)
- benchmark = BenchmarkScript.new(
- preludes: [context.prelude, job.prelude],
- script: job.script,
- teardown: job.teardown,
- loop_count: job.loop_count,
- )
-
- Tempfile.open(['benchmark_driver-', '.rb']) do |f|
- with_script(benchmark.render(result: f.path, target: target)) do |path|
- IO.popen([*context.executable.command, path], &:read) # TODO: print stdout if verbose=2
- if $?.success?
- Float(f.read)
- else
- BenchmarkDriver::Result::ERROR
- end
- end
- end
- end
-
- # This method is overridden by some subclasses
- def metric
- METRIC
- end
-
- # This method is overridden by some subclasses
- def target
- :total
- end
-
- def with_script(script)
- if @config.verbose >= 2
- sep = '-' * 30
- $stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
- end
-
- Tempfile.open(['benchmark_driver-', '.rb']) do |f|
- f.puts script
- f.close
- return yield(f.path)
- end
- end
-
- # @param [String] prelude
- # @param [String] script
- # @param [String] teardown
- # @param [Integer] loop_count
- BenchmarkScript = ::BenchmarkDriver::Struct.new(:preludes, :script, :teardown, :loop_count) do
- # @param [String] result - A file to write result
- def render(result:, target:)
- prelude = preludes.reject(&:nil?).reject(&:empty?).join("\n")
- <<-RUBY
-#{prelude}
-
-require 'benchmark'
-__bmdv_result = Benchmark.measure {
- #{while_loop(script, loop_count)}
-}
-
-#{teardown}
-
-File.write(#{result.dump}, __bmdv_result.#{target})
- RUBY
- end
-
- private
-
- def while_loop(content, times)
- if !times.is_a?(Integer) || times <= 0
- raise ArgumentError.new("Unexpected times: #{times.inspect}")
- elsif times == 1
- return content
- end
-
- # TODO: execute in batch
- <<-RUBY
-__bmdv_i = 0
-while __bmdv_i < #{times}
- #{content}
- __bmdv_i += 1
-end
- RUBY
- end
- end
- private_constant :BenchmarkScript
-end
diff --git a/benchmark/lib/benchmark_driver/runner/utime.rb b/benchmark/lib/benchmark_driver/runner/utime.rb
deleted file mode 100644
index b61d83a188..0000000000
--- a/benchmark/lib/benchmark_driver/runner/utime.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'benchmark_driver/runner/total'
-
-class BenchmarkDriver::Runner::Utime < BenchmarkDriver::Runner::Total
- METRIC = BenchmarkDriver::Metric.new(name: 'utime', unit: 's', larger_better: false)
-
- # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job"
- Job = Class.new(BenchmarkDriver::DefaultJob)
- # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
- JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC])
-
- private
-
- # Overriding BenchmarkDriver::Runner::Total#metric
- def metric
- METRIC
- end
-
- # Overriding BenchmarkDriver::Runner::Total#target
- def target
- :utime
- end
-end
diff --git a/benchmark/lib/load.rb b/benchmark/lib/load.rb
deleted file mode 100644
index 31b770c484..0000000000
--- a/benchmark/lib/load.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# How to use this file:
-# 1. write a `$(srcdir)/test.rb` like:
-=begin
-require_relative 'benchmark/lib/load'
-
-Benchmark.driver(repeat_count: 5){|x|
- x.executable name: 'clean-miniruby', command: %w'../clean-trunk/miniruby'
- x.executable name: 'modif-miniruby', command: %w'./miniruby'
-
- x.report %q{
- h = {a: 1, b: 2, c: 3, d: 4}
- }
-}
-=end
-#
-# 2. `make run`
-$:.unshift(File.join(__dir__, '../benchmark-driver/lib'))
-require 'benchmark_driver'
diff --git a/benchmark/make_fasta_output.rb b/benchmark/make_fasta_output.rb
new file mode 100644
index 0000000000..b6d787ae27
--- /dev/null
+++ b/benchmark/make_fasta_output.rb
@@ -0,0 +1,19 @@
+# prepare 'fasta.output'
+
+def prepare_fasta_output n
+ filebase = File.join(File.dirname($0), 'fasta.output')
+ script = File.join(File.dirname($0), 'bm_so_fasta.rb')
+ file = "#{filebase}.#{n}"
+
+ unless FileTest.exist?(file)
+ STDERR.puts "preparing #{file}"
+
+ open(file, 'w'){|f|
+ ARGV[0] = n
+ $stdout = f
+ load script
+ $stdout = STDOUT
+ }
+ end
+end
+
diff --git a/benchmark/marshal_dump_load_geniv.rb b/benchmark/marshal_dump_load_geniv.rb
deleted file mode 100644
index 8252ad90fa..0000000000
--- a/benchmark/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/marshal_dump_load_time.rb b/benchmark/marshal_dump_load_time.rb
deleted file mode 100644
index e29743b791..0000000000
--- a/benchmark/marshal_dump_load_time.rb
+++ /dev/null
@@ -1 +0,0 @@
-100000.times { Marshal.load(Marshal.dump(Time.now)) }
diff --git a/benchmark/match_gt4.rb b/benchmark/match_gt4.rb
deleted file mode 100644
index ffda109912..0000000000
--- a/benchmark/match_gt4.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times { /(.)(.)(\d+)(\d)/.match("THX1138.") }
diff --git a/benchmark/match_small.rb b/benchmark/match_small.rb
deleted file mode 100644
index 3b743d484a..0000000000
--- a/benchmark/match_small.rb
+++ /dev/null
@@ -1 +0,0 @@
-1000000.times { 'haystack'.match(/hay/) }
diff --git a/benchmark/mjit_exec_jt2jt.yml b/benchmark/mjit_exec_jt2jt.yml
deleted file mode 100644
index 5be408e30c..0000000000
--- a/benchmark/mjit_exec_jt2jt.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Usage:
-# RUBYOPT=-Ibenchmark/lib benchmark-driver -e 'ruby --jit' benchmark/mjit_exec_vm2jt.yml
-type: mjit_exec # benchmark/lib/benchmark_driver/runner/mjit_exec.rb
-num_methods: [1]
-#num_methods: (1..100).to_a + [200, 300, 400, 500, 600, 700, 800, 900, 1000]
-loop_count: 50000000
-from_jit: true
-to_jit: true
diff --git a/benchmark/mjit_exec_vm2jt.yml b/benchmark/mjit_exec_vm2jt.yml
deleted file mode 100644
index 9947dbb7dd..0000000000
--- a/benchmark/mjit_exec_vm2jt.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Usage:
-# RUBYOPT=-Ibenchmark/lib benchmark-driver -e 'ruby --jit' benchmark/mjit_exec_vm2jt.yml
-type: mjit_exec # benchmark/lib/benchmark_driver/runner/mjit_exec.rb
-num_methods: [1]
-#num_methods: (1..100).to_a + [200, 300, 400, 500, 600, 700, 800, 900, 1000]
-loop_count: 50000000
-from_jit: false
-to_jit: true
diff --git a/benchmark/mjit_exec_vm2vm.yml b/benchmark/mjit_exec_vm2vm.yml
deleted file mode 100644
index 4b84427b10..0000000000
--- a/benchmark/mjit_exec_vm2vm.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Usage:
-# RUBYOPT=-Ibenchmark/lib benchmark-driver -e 'ruby --jit' benchmark/mjit_exec_vm2vm.yml
-type: mjit_exec # benchmark/lib/benchmark_driver/runner/mjit_exec.rb
-num_methods: [1]
-#num_methods: (1..100).to_a + [200, 300, 400, 500, 600, 700, 800, 900, 1000]
-loop_count: 50000000
-from_jit: false
-to_jit: false
diff --git a/benchmark/nil_p.yml b/benchmark/nil_p.yml
deleted file mode 100644
index 79ba4f2177..0000000000
--- a/benchmark/nil_p.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-prelude: |
- class Niller; def nil?; true; end; end
- xnil, notnil = nil, Object.new
- niller = Niller.new
-benchmark:
- - xnil.nil?
- - notnil.nil?
- - niller.nil?
-loop_count: 10000000
diff --git a/benchmark/other-lang/fact.py b/benchmark/other-lang/fact.py
index 1ce9f76275..01593965d9 100644
--- a/benchmark/other-lang/fact.py
+++ b/benchmark/other-lang/fact.py
@@ -3,7 +3,7 @@
def factL(n):
r = 1
- for x in range(2, n+1):
+ for x in range(2, n):
r *= x
return r
diff --git a/benchmark/prepare_so_count_words.rb b/benchmark/prepare_so_count_words.rb
new file mode 100644
index 0000000000..ee2138cdb2
--- /dev/null
+++ b/benchmark/prepare_so_count_words.rb
@@ -0,0 +1,15 @@
+# prepare 'wc.input'
+
+def prepare_wc_input
+ wcinput = File.join(File.dirname($0), 'wc.input')
+ wcbase = File.join(File.dirname($0), 'wc.input.base')
+ unless FileTest.exist?(wcinput)
+ data = File.read(wcbase)
+ 13.times{
+ data << data
+ }
+ open(wcinput, 'w'){|f| f.write data}
+ end
+end
+
+prepare_wc_input
diff --git a/benchmark/prepare_so_k_nucleotide.rb b/benchmark/prepare_so_k_nucleotide.rb
new file mode 100644
index 0000000000..d83aeb7a7e
--- /dev/null
+++ b/benchmark/prepare_so_k_nucleotide.rb
@@ -0,0 +1,2 @@
+require_relative 'make_fasta_output'
+prepare_fasta_output(100_000)
diff --git a/benchmark/prepare_so_reverse_complement.rb b/benchmark/prepare_so_reverse_complement.rb
new file mode 100644
index 0000000000..da3ec2df14
--- /dev/null
+++ b/benchmark/prepare_so_reverse_complement.rb
@@ -0,0 +1,2 @@
+require_relative 'make_fasta_output'
+prepare_fasta_output(2_500_000)
diff --git a/benchmark/range_last.yml b/benchmark/range_last.yml
deleted file mode 100644
index a6674f82ee..0000000000
--- a/benchmark/range_last.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- - (1..1_000_000).last(100)
- - (1..1_000_000).last(1000)
- - (1..1_000_000).last(10000)
diff --git a/benchmark/realpath.yml b/benchmark/realpath.yml
deleted file mode 100644
index 90a029d5b9..0000000000
--- a/benchmark/realpath.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-prelude: |
- f = File
- pwd = Dir.pwd
- Dir.mkdir('b') unless f.directory?('b')
- f.write('b/a', '') unless f.file?('b/a')
-
- relative = 'b/a'
- absolute = File.join(pwd, relative)
- dir = 'b'
- file = 'a'
-
- relative_dir = 'b/c'
- absolute_dir = File.join(pwd, relative_dir)
- file_dir = 'c'
-benchmark:
- relative_nil: "f.realpath(relative, nil)"
- absolute_nil: "f.realpath(absolute, nil)"
- relative_relative: "f.realpath(file, dir)"
- absolute_relative: "f.realpath(absolute, dir)"
- relative_absolute: "f.realpath(relative, pwd)"
- relative_nil_dir: "f.realdirpath(relative_dir, nil)"
- absolute_nil_dir: "f.realdirpath(absolute_dir, nil)"
- relative_relative_dir: "f.realdirpath(file_dir, dir)"
- absolute_relative_dir: "f.realdirpath(absolute_dir, dir)"
- relative_absolute_dir: "f.realdirpath(relative_dir, pwd)"
- relative_nil_notexist: "f.realpath(relative_dir, nil) rescue nil"
- absolute_nil_notexist: "f.realpath(absolute_dir, nil) rescue nil"
- relative_relative_notexist: "f.realpath(file_dir, dir) rescue nil"
- absolute_relative_notexist: "f.realpath(absolute_dir, dir) rescue nil"
- relative_absolute_notexist: "f.realpath(relative_dir, pwd) rescue nil"
diff --git a/benchmark/report.rb b/benchmark/report.rb
new file mode 100644
index 0000000000..d2dc56b1e1
--- /dev/null
+++ b/benchmark/report.rb
@@ -0,0 +1,79 @@
+#
+# YARV benchmark driver
+#
+
+require 'yarvutil'
+require 'benchmark'
+require 'rbconfig'
+
+def exec_command type, file, w
+ <<-EOP
+ $DRIVER_PATH = '#{File.dirname($0)}'
+ $LOAD_PATH.replace $LOAD_PATH | #{$LOAD_PATH.inspect}
+ require 'benchmark'
+ require 'yarvutil'
+# print '#{type}'
+ begin
+ puts Benchmark.measure{
+ #{w}('#{file}')
+ }.utime
+ rescue Exception => exec_command_error_variable
+ puts "\t" + exec_command_error_variable.message
+ end
+ EOP
+end
+
+def benchmark cmd
+ rubybin = ENV['RUBY'] || RbConfig.ruby
+
+ IO.popen(rubybin, 'r+'){|io|
+ io.write cmd
+ io.close_write
+ return io.gets
+ }
+end
+
+def ruby_exec file
+ prog = exec_command 'ruby', file, 'load'
+ benchmark prog
+end
+
+def yarv_exec file
+ prog = exec_command 'yarv', file, 'YARVUtil.load_bm'
+ benchmark prog
+end
+
+$wr = $wy = nil
+
+def measure bench
+ file = File.dirname($0) + "/bm_#{bench}.rb"
+ r = ruby_exec(file).to_f
+ y = yarv_exec(file).to_f
+ puts "#{bench}\t#{r}\t#{y}"
+end
+
+def measure2
+ r = ruby_exec.to_f
+ y = yarv_exec.to_f
+ puts r/y
+end
+
+if $0 == __FILE__
+ %w{
+ whileloop
+ whileloop2
+ times
+ const
+ method
+ poly_method
+ block
+ rescue
+ rescue2
+ }.each{|bench|
+ measure bench
+ }
+end
+
+
+
+
diff --git a/benchmark/require.yml b/benchmark/require.yml
deleted file mode 100644
index 09f218cf08..0000000000
--- a/benchmark/require.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-prelude: |
- 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|
- File.write("#{data_dir}/c#{i}.rb", "class C#{i}\n""end\n")
- end
- end
-
- prepare
-benchmark:
- require: |
- $:.push File.join(File.dirname(__FILE__), "bm_require.data")
-
- 1.upto(10000) do |i|
- require "c#{i}"
- end
-
- $:.pop
-loop_count: 1
diff --git a/benchmark/require_thread.yml b/benchmark/require_thread.yml
deleted file mode 100644
index 0c63257106..0000000000
--- a/benchmark/require_thread.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-prelude: |
- 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|
- File.write("#{data_dir}/c#{i}.rb", "class C#{i}\n""end\n")
- end
- end
-
- prepare
-benchmark:
- require_thread: |
- $:.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
-loop_count: 1
diff --git a/benchmark/run.rb b/benchmark/run.rb
new file mode 100644
index 0000000000..0cd2363849
--- /dev/null
+++ b/benchmark/run.rb
@@ -0,0 +1,127 @@
+#
+# Ruby benchmark driver
+#
+
+require 'benchmark'
+require 'rbconfig'
+
+$matzrubyonly = false
+$rubyonly = false
+
+$results = []
+
+# prepare 'wc.input'
+def prepare_wc_input
+ wcinput = File.join(File.dirname($0), 'wc.input')
+ wcbase = File.join(File.dirname($0), 'wc.input.base')
+ unless FileTest.exist?(wcinput)
+ data = File.read(wcbase)
+ 13.times{
+ data << data
+ }
+ open(wcinput, 'w'){|f| f.write data}
+ end
+end
+
+prepare_wc_input
+
+def bm file
+ prog = File.readlines(file).map{|e| e.rstrip}.join("\n")
+ return if prog.empty?
+
+ /[a-z]+_(.+)\.rb/ =~ file
+ bm_name = $1
+ puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly
+ puts "#{bm_name}: "
+
+
+puts <<EOS unless $matzrubyonly || $rubyonly
+#{prog}
+--
+EOS
+ begin
+ result = [bm_name]
+ result << matzruby_exec(file) unless $rubyonly
+ result << ruby_exec(file) unless $matzrubyonly
+ $results << result
+
+ rescue Exception => e
+ puts
+ puts "** benchmark failure: #{e}"
+ puts e.backtrace
+ end
+end
+
+def benchmark file, bin
+ m = Benchmark.measure{
+ `#{bin} #{$opts} #{file}`
+ }
+ sec = '%.3f' % m.real
+ puts " #{sec}"
+ sec
+end
+
+def ruby_exec file
+ print 'ruby'
+ benchmark file, $ruby_program
+end
+
+def matzruby_exec file
+ print 'matz'
+ rubylib = ENV['RUBYLIB']
+ ENV['RUBYLIB'] = ''
+ r = benchmark file, $matzruby_program
+ ENV['RUBYLIB'] = rubylib
+ r
+end
+
+if $0 == __FILE__
+ ARGV.each{|arg|
+ case arg
+ when /\A--ruby=(.+)/
+ $ruby_program = $1
+ when /\A--matzruby=(.+)/
+ $matzruby_program = $1
+ when /\A--opts=(.+)/
+ $opts = $1
+ when /\A(-r|--only-ruby)\z/
+ $rubyonly = true
+ when /\A(-m|--only-matzruby)\z/
+ $matzrubyonly = true
+ end
+ }
+ ARGV.delete_if{|arg|
+ /\A-/ =~ arg
+ }
+
+ puts "MatzRuby:"
+ system("#{$matzruby_program} -v")
+ puts "Ruby:"
+ system("#{$ruby_program} -v")
+ puts
+
+ if ARGV.empty?
+ Dir.glob(File.dirname(__FILE__) + '/bm_*.rb').sort.each{|file|
+ bm file
+ }
+ else
+ ARGV.each{|file|
+ Dir.glob(File.join(File.dirname(__FILE__), file + '*')){|ef|
+ # file = "#{File.dirname(__FILE__)}/#{file}.rb"
+ bm ef
+ }
+ }
+ end
+
+ puts
+ puts "-- benchmark summary ---------------------------"
+ $results.each{|res|
+ print res.shift, "\t"
+ (res||[]).each{|result|
+ /([\d\.]+)/ =~ result
+ print $1 + "\t" if $1
+ }
+ puts
+ }
+end
+
diff --git a/benchmark/runc.rb b/benchmark/runc.rb
new file mode 100644
index 0000000000..97c5cef045
--- /dev/null
+++ b/benchmark/runc.rb
@@ -0,0 +1,27 @@
+#
+#
+#
+
+require 'benchmark'
+require 'rbconfig'
+
+$rubybin = ENV['RUBY'] || RbConfig.ruby
+
+def runfile file
+ puts file
+ file = File.join(File.dirname($0), 'contrib', file)
+ Benchmark.bm{|x|
+ x.report('ruby'){
+ system("#{$rubybin} #{file}")
+ }
+ x.report('yarv'){
+ system("#{$rubybin} -rite -I.. #{file}")
+ }
+ }
+end
+
+ARGV.each{|file|
+ runfile file
+}
+
+
diff --git a/benchmark/so_ackermann.rb b/benchmark/so_ackermann.rb
deleted file mode 100644
index 4effa1ecaf..0000000000
--- a/benchmark/so_ackermann.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: ackermann-ruby.code,v 1.4 2004/11/13 07:40:41 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-
-def ack(m, n)
- if m == 0 then
- n + 1
- elsif n == 0 then
- ack(m - 1, 1)
- else
- ack(m - 1, ack(m, n - 1))
- end
-end
-
-NUM = 9
-ack(3, NUM)
-
-
diff --git a/benchmark/so_array.rb b/benchmark/so_array.rb
deleted file mode 100644
index 767e03db5f..0000000000
--- a/benchmark/so_array.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: ary-ruby.code,v 1.4 2004/11/13 07:41:27 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-# with help from Paul Brannan and Mark Hubbart
-
-n = 9000 # Integer(ARGV.shift || 1)
-
-x = Array.new(n)
-y = Array.new(n, 0)
-
-n.times{|bi|
- x[bi] = bi + 1
-}
-
-(0 .. 999).each do |e|
- (n-1).step(0,-1) do |bi|
- y[bi] += x.at(bi)
- end
-end
-# puts "#{y.first} #{y.last}"
-
-
diff --git a/benchmark/so_concatenate.rb b/benchmark/so_concatenate.rb
deleted file mode 100644
index 4468e20ac8..0000000000
--- a/benchmark/so_concatenate.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: strcat-ruby.code,v 1.4 2004/11/13 07:43:28 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-# based on code from Aristarkh A Zagorodnikov and Dat Nguyen
-
-STUFF = "hello\n"
-i = 0
-while i<10
- i += 1
- hello = ''
- 4_000_000.times do |e|
- hello << STUFF
- end
-end
-# puts hello.length
-
-
diff --git a/benchmark/so_count_words.yml b/benchmark/so_count_words.yml
deleted file mode 100644
index 99683505f9..0000000000
--- a/benchmark/so_count_words.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-prelude: |
- #!/usr/bin/ruby
-
- wc_input_base = <<EOS
- Subject: Re: Who was Izchak Miller?
- From: "Jane D. Anonymous" <nobody@yale.edu>
- Date: 1996/04/28
- Message-Id: <4lv7bc$oh@news.ycc.yale.edu>
- References: <317C405E.5DFA@panix.com> <4lk6vl$gde@ns.oar.net>
- To: 75176.2330@compuserve.com
- Content-Type: text/plain; charset=us-ascii
- Organization: Yale University
- X-Url: news:4lk6vl$gde@ns.oar.net
- Mime-Version: 1.0
- Newsgroups: rec.games.roguelike.nethack
- X-Mailer: Mozilla 1.1N (Macintosh; I; 68K)
-
- Hello there, Izchak Miller was my father. When I was younger I spent
- many a night, hunched over the keyboard with a cup of tea, playing
- nethack with him and my brother. my dad was a philosopher with a strong
- weakness for fantasy/sci fi. I remember when he started to get involved
- with the Nethack team- my brother's Dungeons and Dragons monster book
- found a regular place beside my dad's desk. it's nice to see him living
- on in the game he loved so much :-).
- Tamar Miller
-
- The following is a really long word of 5000 characters:
-
- wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww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wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
- EOS
-
- # prepare 'wc.input'
-
- def prepare_wc_input(wcbase)
- wcinput = File.join(File.dirname($0), 'wc.input')
- unless FileTest.exist?(wcinput)
- data = wcbase.dup
- 13.times{
- data << data
- }
- open(wcinput, 'w'){|f| f.write data}
- end
- end
-
- prepare_wc_input(wc_input_base)
-
-benchmark:
- so_count_words: |
- # $Id: wc-ruby.code,v 1.4 2004/11/13 07:43:32 bfulgham Exp $
- # http://www.bagley.org/~doug/shootout/
- # with help from Paul Brannan
- input = open(File.join(File.dirname($0), 'wc.input'), 'rb')
-
- nl = nw = nc = 0
- while true
- tmp = input.read(4096) or break
- data = tmp << (input.gets || "")
- nc += data.length
- nl += data.count("\n")
- ((data.strip! || data).tr!("\n", " ") || data).squeeze!
- nw += data.count(" ") + 1
- end
- # STDERR.puts "#{nl} #{nw} #{nc}"
-
-loop_count: 1
diff --git a/benchmark/so_exception.rb b/benchmark/so_exception.rb
deleted file mode 100644
index eb205b4df1..0000000000
--- a/benchmark/so_exception.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: except-ruby.code,v 1.4 2004/11/13 07:41:33 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-
-$HI = 0
-$LO = 0
-NUM = 250000 # Integer(ARGV[0] || 1)
-
-
-class Lo_Exception < Exception
- def initialize(num)
- @value = num
- end
-end
-
-class Hi_Exception < Exception
- def initialize(num)
- @value = num
- end
-end
-
-def some_function(num)
- begin
- hi_function(num)
- rescue
- print "We shouldn't get here, exception is: #{$!.type}\n"
- end
-end
-
-def hi_function(num)
- begin
- lo_function(num)
- rescue Hi_Exception
- $HI = $HI + 1
- end
-end
-
-def lo_function(num)
- begin
- blowup(num)
- rescue Lo_Exception
- $LO = $LO + 1
- end
-end
-
-def blowup(num)
- if num % 2 == 0
- raise Lo_Exception.new(num)
- else
- raise Hi_Exception.new(num)
- end
-end
-
-
-i = 1
-max = NUM+1
-while i < max
- i += 1
- some_function(i+1)
-end
diff --git a/benchmark/so_fasta.rb b/benchmark/so_fasta.rb
deleted file mode 100644
index dcc6b39507..0000000000
--- a/benchmark/so_fasta.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-# The Computer Language Shootout
-# http://shootout.alioth.debian.org/
-# Contributed by Sokolov Yura
-
-$last = 42.0
-def gen_random(max, im=139968, ia=3877, ic=29573)
- (max * ($last = ($last * ia + ic) % im)) / im
-end
-
-alu =
- "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG"+
- "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA"+
- "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT"+
- "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA"+
- "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG"+
- "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC"+
- "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
-
-iub = [
- ["a", 0.27],
- ["c", 0.12],
- ["g", 0.12],
- ["t", 0.27],
-
- ["B", 0.02],
- ["D", 0.02],
- ["H", 0.02],
- ["K", 0.02],
- ["M", 0.02],
- ["N", 0.02],
- ["R", 0.02],
- ["S", 0.02],
- ["V", 0.02],
- ["W", 0.02],
- ["Y", 0.02],
-]
-homosapiens = [
- ["a", 0.3029549426680],
- ["c", 0.1979883004921],
- ["g", 0.1975473066391],
- ["t", 0.3015094502008],
-]
-
-def make_repeat_fasta(id, desc, src, n)
- puts ">#{id} #{desc}"
- v = nil
- width = 60
- l = src.length
- s = src * ((n / l) + 1)
- s.slice!(n, l)
- puts(s.scan(/.{1,#{width}}/).join("\n"))
-end
-
-def make_random_fasta(id, desc, table, n)
- puts ">#{id} #{desc}"
- rand, v = nil,nil
- width = 60
- chunk = 1 * width
- prob = 0.0
- table.each{|v| v[1]= (prob += v[1])}
- for i in 1..(n/width)
- puts((1..width).collect{
- rand = gen_random(1.0)
- table.find{|v| v[1]>rand}[0]
- }.join)
- end
- if n%width != 0
- puts((1..(n%width)).collect{
- rand = gen_random(1.0)
- table.find{|v| v[1]>rand}[0]
- }.join)
- end
-end
-
-
-n = (ARGV[0] or 250_000).to_i
-
-make_repeat_fasta('ONE', 'Homo sapiens alu', alu, n*2)
-make_random_fasta('TWO', 'IUB ambiguity codes', iub, n*3)
-make_random_fasta('THREE', 'Homo sapiens frequency', homosapiens, n*5)
-
diff --git a/benchmark/so_k_nucleotide.yml b/benchmark/so_k_nucleotide.yml
deleted file mode 100644
index d7df086c39..0000000000
--- a/benchmark/so_k_nucleotide.yml
+++ /dev/null
@@ -1,155 +0,0 @@
-prelude: |
- bm_so_fasta = <<'EOS'
- # The Computer Language Shootout
- # http://shootout.alioth.debian.org/
- # Contributed by Sokolov Yura
-
- $last = 42.0
- def gen_random(max, im=139968, ia=3877, ic=29573)
- (max * ($last = ($last * ia + ic) % im)) / im
- end
-
- alu =
- "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG"+
- "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA"+
- "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT"+
- "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA"+
- "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG"+
- "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC"+
- "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
-
- iub = [
- ["a", 0.27],
- ["c", 0.12],
- ["g", 0.12],
- ["t", 0.27],
-
- ["B", 0.02],
- ["D", 0.02],
- ["H", 0.02],
- ["K", 0.02],
- ["M", 0.02],
- ["N", 0.02],
- ["R", 0.02],
- ["S", 0.02],
- ["V", 0.02],
- ["W", 0.02],
- ["Y", 0.02],
- ]
- homosapiens = [
- ["a", 0.3029549426680],
- ["c", 0.1979883004921],
- ["g", 0.1975473066391],
- ["t", 0.3015094502008],
- ]
-
- def make_repeat_fasta(id, desc, src, n)
- puts ">#{id} #{desc}"
- v = nil
- width = 60
- l = src.length
- s = src * ((n / l) + 1)
- s.slice!(n, l)
- puts(s.scan(/.{1,#{width}}/).join("\n"))
- end
-
- def make_random_fasta(id, desc, table, n)
- puts ">#{id} #{desc}"
- rand, v = nil,nil
- width = 60
- chunk = 1 * width
- prob = 0.0
- table.each{|v| v[1]= (prob += v[1])}
- for i in 1..(n/width)
- puts((1..width).collect{
- rand = gen_random(1.0)
- table.find{|v| v[1]>rand}[0]
- }.join)
- end
- if n%width != 0
- puts((1..(n%width)).collect{
- rand = gen_random(1.0)
- table.find{|v| v[1]>rand}[0]
- }.join)
- end
- end
-
-
- n = (ARGV[0] or 250_000).to_i
-
- make_repeat_fasta('ONE', 'Homo sapiens alu', alu, n*2)
- make_random_fasta('TWO', 'IUB ambiguity codes', iub, n*3)
- make_random_fasta('THREE', 'Homo sapiens frequency', homosapiens, n*5)
- EOS
-benchmark:
- - name: so_k_nucleotide
- prelude: |
- script = File.join(File.dirname($0), 'bm_so_fasta.rb')
- File.write(script, bm_so_fasta)
-
- def prepare_fasta_output n
- filebase = File.join(File.dirname($0), 'fasta.output')
- script = File.join(File.dirname($0), 'bm_so_fasta.rb')
- file = "#{filebase}.#{n}"
-
- unless FileTest.exist?(file)
- STDERR.puts "preparing #{file}"
-
- open(file, 'w'){|f|
- ARGV[0] = n
- $stdout = f
- load script
- $stdout = STDOUT
- }
- end
- end
- prepare_fasta_output(100_000)
- script: |
- # The Computer Language Shootout
- # http://shootout.alioth.debian.org
- #
- # contributed by jose fco. gonzalez
- # modified by Sokolov Yura
-
- seq = String.new
-
- def frecuency( seq,length )
- n, table = seq.length - length + 1, Hash.new(0)
- f, i = nil, nil
- (0 ... length).each do |f|
- (f ... n).step(length) do |i|
- table[seq[i,length]] += 1
- end
- end
- [n,table]
-
- end
-
- def sort_by_freq( seq,length )
- n,table = frecuency( seq,length )
- a, b, v = nil, nil, nil
- table.sort{|a,b| b[1] <=> a[1]}.each do |v|
- puts "%s %.3f" % [v[0].upcase,((v[1]*100).to_f/n)]
- end
- puts
- end
-
- def find_seq( seq,s )
- n,table = frecuency( seq,s.length )
- puts "#{table[s].to_s}\t#{s.upcase}"
- end
-
- input = open(File.join(File.dirname($0), 'fasta.output.100000'), 'rb')
-
- line = input.gets while line !~ /^>THREE/
- line = input.gets
-
- while (line !~ /^>/) & line do
- seq << line.chomp
- line = input.gets
- end
-
- [1,2].each {|i| sort_by_freq( seq,i ) }
-
- %w(ggt ggta ggtatt ggtattttaatt ggtattttaatttatagt).each{|s| find_seq( seq,s) }
- loop_count: 1
diff --git a/benchmark/so_matrix.rb b/benchmark/so_matrix.rb
deleted file mode 100644
index 2d1e72bda9..0000000000
--- a/benchmark/so_matrix.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: matrix-ruby.code,v 1.4 2004/11/13 07:42:14 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-
-n = 60 #Integer(ARGV.shift || 1)
-
-size = 40
-
-def mkmatrix(rows, cols)
- count = 1
- mx = Array.new(rows)
- (0 .. (rows - 1)).each do |bi|
- row = Array.new(cols, 0)
- (0 .. (cols - 1)).each do |j|
- row[j] = count
- count += 1
- end
- mx[bi] = row
- end
- mx
-end
-
-def mmult(rows, cols, m1, m2)
- m3 = Array.new(rows)
- (0 .. (rows - 1)).each do |bi|
- row = Array.new(cols, 0)
- (0 .. (cols - 1)).each do |j|
- val = 0
- (0 .. (cols - 1)).each do |k|
- val += m1.at(bi).at(k) * m2.at(k).at(j)
- end
- row[j] = val
- end
- m3[bi] = row
- end
- m3
-end
-
-m1 = mkmatrix(size, size)
-m2 = mkmatrix(size, size)
-mm = Array.new
-n.times do
- mm = mmult(size, size, m1, m2)
-end
-# puts "#{mm[0][0]} #{mm[2][3]} #{mm[3][2]} #{mm[4][4]}"
-
-
diff --git a/benchmark/so_meteor_contest.rb b/benchmark/so_meteor_contest.rb
deleted file mode 100644
index 8c136baa6c..0000000000
--- a/benchmark/so_meteor_contest.rb
+++ /dev/null
@@ -1,563 +0,0 @@
-#!/usr/bin/env ruby
-#
-# The Computer Language Shootout
-# http://shootout.alioth.debian.org
-# contributed by Kevin Barnes (Ruby novice)
-
-# PROGRAM: the main body is at the bottom.
-# 1) read about the problem here: http://www-128.ibm.com/developerworks/java/library/j-javaopt/
-# 2) see how I represent a board as a bitmask by reading the blank_board comments
-# 3) read as your mental paths take you
-
-def print *args
-end
-
-# class to represent all information about a particular rotation of a particular piece
-class Rotation
- # an array (by location) containing a bit mask for how the piece maps at the given location.
- # if the rotation is invalid at that location the mask will contain false
- attr_reader :start_masks
-
- # maps a direction to a relative location. these differ depending on whether it is an even or
- # odd row being mapped from
- @@rotation_even_adder = { :west => -1, :east => 1, :nw => -7, :ne => -6, :sw => 5, :se => 6 }
- @@rotation_odd_adder = { :west => -1, :east => 1, :nw => -6, :ne => -5, :sw => 6, :se => 7 }
-
- def initialize( directions )
- @even_offsets, @odd_offsets = normalize_offsets( get_values( directions ))
-
- @even_mask = mask_for_offsets( @even_offsets)
- @odd_mask = mask_for_offsets( @odd_offsets)
-
- @start_masks = Array.new(60)
-
- # create the rotational masks by placing the base mask at the location and seeing if
- # 1) it overlaps the boundaries and 2) it produces a prunable board. if either of these
- # is true the piece cannot be placed
- 0.upto(59) do | offset |
- mask = is_even(offset) ? (@even_mask << offset) : (@odd_mask << offset)
- if (blank_board & mask == 0 && !prunable(blank_board | mask, 0, true)) then
- imask = compute_required( mask, offset)
- @start_masks[offset] = [ mask, imask, imask | mask ]
- else
- @start_masks[offset] = false
- end
- end
- end
-
- def compute_required( mask, offset )
- board = blank_board
- 0.upto(offset) { | i | board |= 1 << i }
- board |= mask
- return 0 if (!prunable(board | mask, offset))
- board = flood_fill(board,58)
- count = 0
- imask = 0
- 0.upto(59) do | i |
- if (board[i] == 0) then
- imask |= (1 << i)
- count += 1
- end
- end
- (count > 0 && count < 5) ? imask : 0
- end
-
- def flood_fill( board, location)
- return board if (board[location] == 1)
- board |= 1 << location
- row, col = location.divmod(6)
- board = flood_fill( board, location - 1) if (col > 0)
- board = flood_fill( board, location + 1) if (col < 4)
- if (row % 2 == 0) then
- board = flood_fill( board, location - 7) if (col > 0 && row > 0)
- board = flood_fill( board, location - 6) if (row > 0)
- board = flood_fill( board, location + 6) if (row < 9)
- board = flood_fill( board, location + 5) if (col > 0 && row < 9)
- else
- board = flood_fill( board, location - 5) if (col < 4 && row > 0)
- board = flood_fill( board, location - 6) if (row > 0)
- board = flood_fill( board, location + 6) if (row < 9)
- board = flood_fill( board, location + 7) if (col < 4 && row < 9)
- end
- board
- end
-
- # given a location, produces a list of relative locations covered by the piece at this rotation
- def offsets( location)
- if is_even( location) then
- @even_offsets.collect { | value | value + location }
- else
- @odd_offsets.collect { | value | value + location }
- end
- end
-
- # returns a set of offsets relative to the top-left most piece of the rotation (by even or odd rows)
- # this is hard to explain. imagine we have this partial board:
- # 0 0 0 0 0 x [positions 0-5]
- # 0 0 1 1 0 x [positions 6-11]
- # 0 0 1 0 0 x [positions 12-17]
- # 0 1 0 0 0 x [positions 18-23]
- # 0 1 0 0 0 x [positions 24-29]
- # 0 0 0 0 0 x [positions 30-35]
- # ...
- # The top-left of the piece is at position 8, the
- # board would be passed as a set of positions (values array) containing [8,9,14,19,25] not necessarily in that
- # sorted order. Since that array starts on an odd row, the offsets for an odd row are: [0,1,6,11,17] obtained
- # by subtracting 8 from everything. Now imagine the piece shifted up and to the right so it's on an even row:
- # 0 0 0 1 1 x [positions 0-5]
- # 0 0 1 0 0 x [positions 6-11]
- # 0 0 1 0 0 x [positions 12-17]
- # 0 1 0 0 0 x [positions 18-23]
- # 0 0 0 0 0 x [positions 24-29]
- # 0 0 0 0 0 x [positions 30-35]
- # ...
- # Now the positions are [3,4,8,14,19] which after subtracting the lowest value (3) gives [0,1,5,11,16] thus, the
- # offsets for this particular piece are (in even, odd order) [0,1,5,11,16],[0,1,6,11,17] which is what
- # this function would return
- def normalize_offsets( values)
- min = values.min
- even_min = is_even(min)
- other_min = even_min ? min + 6 : min + 7
- other_values = values.collect do | value |
- if is_even(value) then
- value + 6 - other_min
- else
- value + 7 - other_min
- end
- end
- values.collect! { | value | value - min }
-
- if even_min then
- [values, other_values]
- else
- [other_values, values]
- end
- end
-
- # produce a bitmask representation of an array of offset locations
- def mask_for_offsets( offsets )
- mask = 0
- offsets.each { | value | mask = mask + ( 1 << value ) }
- mask
- end
-
- # finds a "safe" position that a position as described by a list of directions can be placed
- # without falling off any edge of the board. the values returned a location to place the first piece
- # at so it will fit after making the described moves
- def start_adjust( directions )
- south = east = 0;
- directions.each do | direction |
- east += 1 if ( direction == :sw || direction == :nw || direction == :west )
- south += 1 if ( direction == :nw || direction == :ne )
- end
- south * 6 + east
- end
-
- # 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 )
- start = start_adjust(directions)
- values = [ start ]
- directions.each do | direction |
- if (start % 12 >= 6) then
- start += @@rotation_odd_adder[direction]
- else
- start += @@rotation_even_adder[direction]
- end
- values += [ start ]
- end
-
- # some moves take you back to an existing location, we'll strip duplicates
- values.uniq
- end
-end
-
-# describes a piece and caches information about its rotations to as to be efficient for iteration
-# ATTRIBUTES:
-# rotations -- all the rotations of the piece
-# type -- a numeic "name" of the piece
-# masks -- an array by location of all legal rotational masks (a n inner array) for that location
-# placed -- the mask that this piece was last placed at (not a location, but the actual mask used)
-class Piece
- attr_reader :rotations, :type, :masks
- attr_accessor :placed
-
- # transform hashes that change one direction into another when you either flip or rotate a set of directions
- @@flip_converter = { :west => :west, :east => :east, :nw => :sw, :ne => :se, :sw => :nw, :se => :ne }
- @@rotate_converter = { :west => :nw, :east => :se, :nw => :ne, :ne => :east, :sw => :west, :se => :sw }
-
- def initialize( directions, type )
- @type = type
- @rotations = Array.new();
- @map = {}
-
- generate_rotations( directions )
- directions.collect! { | value | @@flip_converter[value] }
- generate_rotations( directions )
-
- # creates the masks AND a map that returns [location, rotation] for any given mask
- # this is used when a board is found and we want to draw it, otherwise the map is unused
- @masks = Array.new();
- 0.upto(59) do | i |
- even = true
- @masks[i] = @rotations.collect do | rotation |
- mask = rotation.start_masks[i]
- @map[mask[0]] = [ i, rotation ] if (mask)
- mask || nil
- end
- @masks[i].compact!
- end
- end
-
- # rotates a set of directions through all six angles and adds a Rotation to the list for each one
- def generate_rotations( directions )
- 6.times do
- rotations.push( Rotation.new(directions))
- directions.collect! { | value | @@rotate_converter[value] }
- end
- end
-
- # given a board string, adds this piece to the board at whatever location/rotation
- # important: the outbound board string is 5 wide, the normal location notation is six wide (padded)
- def fill_string( board_string)
- location, rotation = @map[@placed]
- rotation.offsets(location).each do | offset |
- row, col = offset.divmod(6)
- board_string[ row*5 + col, 1 ] = @type.to_s
- end
- end
-end
-
-# a blank bit board having this form:
-#
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 0 0 0 0 0 1
-# 1 1 1 1 1 1
-#
-# where left lest significant bit is the top left and the most significant is the lower right
-# the actual board only consists of the 0 places, the 1 places are blockers to keep things from running
-# off the edges or bottom
-def blank_board
- 0b111111100000100000100000100000100000100000100000100000100000100000
-end
-
-def full_board
- 0b111111111111111111111111111111111111111111111111111111111111111111
-end
-
-# determines if a location (bit position) is in an even row
-def is_even( location)
- (location % 12) < 6
-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
-# $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,
-# the second is the count of those bits and the third is identical to the first
-# examples:
-# 0b10010 => [ 0b01100, 2, 0b01100 ], [ 0b00001, 1, 0b00001]
-# 0b01010 => [ 0b10000, 1, 0b10000 ], [ 0b00100, 1, 0b00100 ], [ 0b00001, 1, 0b00001]
-# 0b10001 => [ 0b01110, 3, 0b01110 ]
-def create_collector_support
- odd_map = [0b11, 0b110, 0b1100, 0b11000, 0b10000]
- even_map = [0b1, 0b11, 0b110, 0b1100, 0b11000]
-
- all_odds = Array.new(0b100000)
- all_evens = Array.new(0b100000)
- bit_counts = Array.new(0b100000)
- new_regions = Array.new(0b100000)
- 0.upto(0b11111) do | i |
- bit_count = odd = even = 0
- 0.upto(4) do | bit |
- if (i[bit] == 1) then
- bit_count += 1
- odd |= odd_map[bit]
- even |= even_map[bit]
- end
- end
- all_odds[i] = odd
- all_evens[i] = even
- bit_counts[i] = bit_count
- new_regions[i] = create_regions( i)
- end
-
- $converter = []
- 10.times { | row | $converter.push((row % 2 == 0) ? all_evens : all_odds) }
- $bit_counts = bit_counts
- $regions = new_regions.collect { | set | set.collect { | value | [ value, bit_counts[value], value] } }
-end
-
-# determines if a board is punable, meaning that there is no possibility that it
-# can be filled up with pieces. A board is prunable if there is a grouping of unfilled spaces
-# that are not a multiple of five. The following board is an example of a prunable board:
-# 0 0 1 0 0
-# 0 1 0 0 0
-# 1 1 0 0 0
-# 0 1 0 0 0
-# 0 0 0 0 0
-# ...
-#
-# This board is prunable because the top left corner is only 3 bits in area, no piece will ever fit it
-# parameters:
-# board -- an initial bit board (6 bit padded rows, see blank_board for format)
-# location -- starting location, everything above and to the left is already full
-# slotting -- set to true only when testing initial pieces, when filling normally
-# additional assumptions are possible
-#
-# Algorithm:
-# The algorithm starts at the top row (as determined by location) and iterates a row at a time
-# maintainng counts of active open areas (kept in the collector array) each collector contains
-# three values at the start of an iteration:
-# 0: mask of bits that would be adjacent to the collector in this row
-# 1: the number of bits collected so far
-# 2: a scratch space starting as zero, but used during the computation to represent
-# the empty bits in the new row that are adjacent (position 0)
-# The exact procedure is described in-code
-def prunable( board, location, slotting = false)
- collectors = []
- # loop across the rows
- (location / 6).to_i.upto(9) do | row_on |
- # obtain a set of regions representing the bits of the current row.
- regions = $regions[(board >> (row_on * 6)) & 0b11111]
- converter = $converter[row_on]
-
- # track the number of collectors at the start of the cycle so that
- # we don't compute against newly created collectors, only existing collectors
- initial_collector_count = collectors.length
-
- # loop against the regions. For each region of the row
- # we will see if it connects to one or more existing collectors.
- # if it connects to 1 collector, the bits from the region are added to the
- # bits of the collector and the mask is placed in collector[2]
- # If the region overlaps more than one collector then all the collectors
- # it overlaps with are merged into the first one (the others are set to nil in the array)
- # if NO collectors are found then the region is copied as a new collector
- regions.each do | region |
- collector_found = nil
- region_mask = region[2]
- initial_collector_count.times do | collector_num |
- collector = collectors[collector_num]
- if (collector) then
- collector_mask = collector[0]
- if (collector_mask & region_mask != 0) then
- if (collector_found) then
- collector_found[0] |= collector_mask
- collector_found[1] += collector[1]
- collector_found[2] |= collector[2]
- collectors[collector_num] = nil
- else
- collector_found = collector
- collector[1] += region[1]
- collector[2] |= region_mask
- end
- end
- end
- end
- if (collector_found == nil) then
- collectors.push(Array.new(region))
- end
- end
-
- # check the existing collectors, if any collector overlapped no bits in the region its [2] value will
- # be zero. The size of any such reaason is tested if it is not a multiple of five true is returned since
- # the board is prunable. if it is a multiple of five it is removed.
- # Collector that are still active have a new adjacent value [0] set based n the matched bits
- # and have [2] cleared out for the next cycle.
- collectors.length.times do | collector_num |
- collector = collectors[collector_num]
- if (collector) then
- if (collector[2] == 0) then
- return true if (collector[1] % 5 != 0)
- collectors[collector_num] = nil
- else
- # if a collector matches all bits in the row then we can return unprunable early for the
- # following reasons:
- # 1) there can be no more unavailable bits bince we fill from the top left downward
- # 2) all previous regions have been closed or joined so only this region can fail
- # 3) this region must be good since there can never be only 1 region that is nuot
- # a multiple of five
- # this rule only applies when filling normally, so we ignore the rule if we are "slotting"
- # in pieces to see what configurations work for them (the only other time this algorithm is used).
- return false if (collector[2] == 0b11111 && !slotting)
- collector[0] = converter[collector[2]]
- collector[2] = 0
- end
- end
- end
-
- # get rid of all the empty converters for the next round
- collectors.compact!
- end
- return false if (collectors.length <= 1) # 1 collector or less and the region is fine
- collectors.any? { | collector | (collector[1] % 5) != 0 } # more than 1 and we test them all for bad size
-end
-
-# creates a region given a row mask. see prunable for what a "region" is
-def create_regions( value )
- regions = []
- cur_region = 0
- 5.times do | bit |
- if (value[bit] == 0) then
- cur_region |= 1 << bit
- else
- if (cur_region != 0 ) then
- regions.push( cur_region)
- cur_region = 0;
- end
- end
- end
- regions.push(cur_region) if (cur_region != 0)
- regions
-end
-
-# find up to the counted number of solutions (or all solutions) and prints the final result
-def find_all
- find_top( 1)
- find_top( 0)
- print_results
-end
-
-# show the board
-def print_results
- print "#{@boards_found} solutions found\n\n"
- print_full_board( @min_board)
- print "\n"
- print_full_board( @max_board)
- print "\n"
-end
-
-# finds solutions. This special version of the main function is only used for the top level
-# the reason for it is basically to force a particular ordering on how the rotations are tested for
-# the first piece. It is called twice, first looking for placements of the odd rotations and then
-# looking for placements of the even locations.
-#
-# WHY?
-# Since any found solution has an inverse we want to maximize finding solutions that are not already found
-# as an inverse. The inverse will ALWAYS be 3 one of the piece configurations that is exactly 3 rotations away
-# (an odd number). Checking even vs odd then produces a higher probability of finding more pieces earlier
-# in the cycle. We still need to keep checking all the permutations, but our probability of finding one will
-# diminsh over time. Since we are TOLD how many to search for this lets us exit before checking all pieces
-# this bennifit is very great when seeking small numbers of solutions and is 0 when looking for more than the
-# maximum number
-def find_top( rotation_skip)
- board = blank_board
- (@pieces.length-1).times do
- piece = @pieces.shift
- piece.masks[0].each do | mask, imask, cmask |
- if ((rotation_skip += 1) % 2 == 0) then
- piece.placed = mask
- find( 1, 1, board | mask)
- end
- end
- @pieces.push(piece)
- end
- piece = @pieces.shift
- @pieces.push(piece)
-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
-# 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
-# placed -- number of pieces placed
-# board -- current state of the board
-#
-# see in-code comments
-def find( start_location, placed, board)
- # find the next location to place a piece by looking for an empty bit
- while board[start_location] == 1
- start_location += 1
- end
-
- @pieces.length.times do
- piece = @pieces.shift
- piece.masks[start_location].each do | mask, imask, cmask |
- if ( board & cmask == imask) then
- piece.placed = mask
- if (placed == 9) then
- add_board
- else
- find( start_location + 1, placed + 1, board | mask)
- end
- end
- end
- @pieces.push(piece)
- end
-end
-
-# print the board
-def print_full_board( board_string)
- 10.times do | row |
- print " " if (row % 2 == 1)
- 5.times do | col |
- print "#{board_string[row*5 + col,1]} "
- end
- print "\n"
- end
-end
-
-# when a board is found we "draw it" into a string and then flip that string, adding both to
-# the list (hash) of solutions if they are unique.
-def add_board
- board_string = "99999999999999999999999999999999999999999999999999"
- @all_pieces.each { | piece | piece.fill_string( board_string ) }
- save( board_string)
- save( board_string.reverse)
-end
-
-# adds a board string to the list (if new) and updates the current best/worst board
-def save( board_string)
- if (@all_boards[board_string] == nil) then
- @min_board = board_string if (board_string < @min_board)
- @max_board = board_string if (board_string > @max_board)
- @all_boards.store(board_string,true)
- @boards_found += 1
-
- # the exit motif is a time saver. Ideally the function should return, but those tests
- # take noticeable time (performance).
- if (@boards_found == @stop_count) then
- print_results
- exit(0)
- end
- end
-end
-
-
-##
-## MAIN BODY :)
-##
-create_collector_support
-@pieces = [
- Piece.new( [ :nw, :ne, :east, :east ], 2),
- Piece.new( [ :ne, :se, :east, :ne ], 7),
- Piece.new( [ :ne, :east, :ne, :nw ], 1),
- Piece.new( [ :east, :sw, :sw, :se ], 6),
- Piece.new( [ :east, :ne, :se, :ne ], 5),
- Piece.new( [ :east, :east, :east, :se ], 0),
- Piece.new( [ :ne, :nw, :se, :east, :se ], 4),
- Piece.new( [ :se, :se, :se, :west ], 9),
- Piece.new( [ :se, :se, :east, :se ], 8),
- Piece.new( [ :east, :east, :sw, :se ], 3)
- ];
-
-@all_pieces = Array.new( @pieces)
-
-@min_board = "99999999999999999999999999999999999999999999999999"
-@max_board = "00000000000000000000000000000000000000000000000000"
-@stop_count = ARGV[0].to_i || 2089
-@all_boards = {}
-@boards_found = 0
-
-find_all ######## DO IT!!!
diff --git a/benchmark/so_nested_loop.rb b/benchmark/so_nested_loop.rb
deleted file mode 100644
index 766fcf7b84..0000000000
--- a/benchmark/so_nested_loop.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: nestedloop-ruby.code,v 1.4 2004/11/13 07:42:22 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-# from Avi Bryant
-
-n = 16 # Integer(ARGV.shift || 1)
-x = 0
-n.times do
- n.times do
- n.times do
- n.times do
- n.times do
- n.times do
- x += 1
- end
- end
- end
- end
- end
-end
-# puts x
-
-
diff --git a/benchmark/so_object.rb b/benchmark/so_object.rb
deleted file mode 100644
index 131f44624c..0000000000
--- a/benchmark/so_object.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/ruby
-# -*- Ruby -*-
-# $Id: objinst-ruby.code,v 1.4 2004/11/13 07:42:25 bfulgham Exp $
-# http://www.bagley.org/~doug/shootout/
-# with help from Aristarkh Zagorodnikov
-
-class Toggle
- def initialize(start_state)
- @bool = start_state
- end
-
- def value
- @bool
- end
-
- def activate
- @bool = !@bool
- self
- end
-end
-
-class NthToggle < Toggle
- def initialize(start_state, max_counter)
- super start_state
- @count_max = max_counter
- @counter = 0
- end
-
- def activate
- @counter += 1
- if @counter >= @count_max
- @bool = !@bool
- @counter = 0
- end
- self
- end
-end
-
-n = 1500000 # (ARGV.shift || 1).to_i
-
-toggle = Toggle.new 1
-5.times do
- toggle.activate.value ? 'true' : 'false'
-end
-n.times do
- toggle = Toggle.new 1
-end
-
-ntoggle = NthToggle.new 1, 3
-8.times do
- ntoggle.activate.value ? 'true' : 'false'
-end
-n.times do
- ntoggle = NthToggle.new 1, 3
-end
-
diff --git a/benchmark/so_pidigits.rb b/benchmark/so_pidigits.rb
deleted file mode 100644
index 9a537b2d1c..0000000000
--- a/benchmark/so_pidigits.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-# The Great Computer Language Shootout
-# http://shootout.alioth.debian.org/
-#
-# contributed by Gabriele Renzi
-
-class PiDigitSpigot
-
- def initialize()
- @z = Transformation.new 1,0,0,1
- @x = Transformation.new 0,0,0,0
- @inverse = Transformation.new 0,0,0,0
- end
-
- def next!
- @y = @z.extract(3)
- if safe? @y
- @z = produce(@y)
- @y
- else
- @z = consume @x.next!()
- next!()
- end
- end
-
- def safe?(digit)
- digit == @z.extract(4)
- end
-
- def produce(i)
- @inverse.qrst(10,-10*i,0,1).compose(@z)
- end
-
- def consume(a)
- @z.compose(a)
- end
-end
-
-
-class Transformation
- attr_reader :q, :r, :s, :t
- def initialize(q, r, s, t)
- @q,@r,@s,@t,@k = q,r,s,t,0
- end
-
- def next!()
- @q = @k = @k + 1
- @r = 4 * @k + 2
- @s = 0
- @t = 2 * @k + 1
- self
- end
-
- def extract(j)
- (@q * j + @r) / (@s * j + @t)
- end
-
- def compose(a)
- self.class.new( @q * a.q,
- @q * a.r + r * a.t,
- @s * a.q + t * a.s,
- @s * a.r + t * a.t
- )
- end
-
- def qrst *args
- initialize *args
- self
- end
-
-
-end
-
-
-WIDTH = 10
-n = 2_500 # Integer(ARGV[0])
-j = 0
-
-digits = PiDigitSpigot.new
-
-while n > 0
- if n >= WIDTH
- WIDTH.times {print digits.next!}
- j += WIDTH
- else
- n.times {print digits.next!}
- (WIDTH-n).times {print " "}
- j += n
- end
- puts "\t:"+j.to_s
- n -= WIDTH
-end
-
diff --git a/benchmark/so_reverse_complement.yml b/benchmark/so_reverse_complement.yml
deleted file mode 100644
index de05eedfc4..0000000000
--- a/benchmark/so_reverse_complement.yml
+++ /dev/null
@@ -1,137 +0,0 @@
-prelude: |
- bm_so_fasta = <<'EOS'
- # The Computer Language Shootout
- # http://shootout.alioth.debian.org/
- # Contributed by Sokolov Yura
-
- $last = 42.0
- def gen_random(max, im=139968, ia=3877, ic=29573)
- (max * ($last = ($last * ia + ic) % im)) / im
- end
-
- alu =
- "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG"+
- "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA"+
- "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT"+
- "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA"+
- "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG"+
- "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC"+
- "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
-
- iub = [
- ["a", 0.27],
- ["c", 0.12],
- ["g", 0.12],
- ["t", 0.27],
-
- ["B", 0.02],
- ["D", 0.02],
- ["H", 0.02],
- ["K", 0.02],
- ["M", 0.02],
- ["N", 0.02],
- ["R", 0.02],
- ["S", 0.02],
- ["V", 0.02],
- ["W", 0.02],
- ["Y", 0.02],
- ]
- homosapiens = [
- ["a", 0.3029549426680],
- ["c", 0.1979883004921],
- ["g", 0.1975473066391],
- ["t", 0.3015094502008],
- ]
-
- def make_repeat_fasta(id, desc, src, n)
- puts ">#{id} #{desc}"
- v = nil
- width = 60
- l = src.length
- s = src * ((n / l) + 1)
- s.slice!(n, l)
- puts(s.scan(/.{1,#{width}}/).join("\n"))
- end
-
- def make_random_fasta(id, desc, table, n)
- puts ">#{id} #{desc}"
- rand, v = nil,nil
- width = 60
- chunk = 1 * width
- prob = 0.0
- table.each{|v| v[1]= (prob += v[1])}
- for i in 1..(n/width)
- puts((1..width).collect{
- rand = gen_random(1.0)
- table.find{|v| v[1]>rand}[0]
- }.join)
- end
- if n%width != 0
- puts((1..(n%width)).collect{
- rand = gen_random(1.0)
- table.find{|v| v[1]>rand}[0]
- }.join)
- end
- end
-
-
- n = (ARGV[0] or 250_000).to_i
-
- make_repeat_fasta('ONE', 'Homo sapiens alu', alu, n*2)
- make_random_fasta('TWO', 'IUB ambiguity codes', iub, n*3)
- make_random_fasta('THREE', 'Homo sapiens frequency', homosapiens, n*5)
- EOS
-benchmark:
- - name: so_reverse_complement
- prelude: |
- script = File.join(File.dirname($0), 'bm_so_fasta.rb')
- File.write(script, bm_so_fasta)
-
- def prepare_fasta_output n
- filebase = File.join(File.dirname($0), 'fasta.output')
- script = File.join(File.dirname($0), 'bm_so_fasta.rb')
- file = "#{filebase}.#{n}"
-
- unless FileTest.exist?(file)
- STDERR.puts "preparing #{file}"
-
- open(file, 'w'){|f|
- ARGV[0] = n
- $stdout = f
- load script
- $stdout = STDOUT
- }
- end
- end
- prepare_fasta_output(2_500_000)
- script: |
- # The Great Computer Language Shootout
- # http://shootout.alioth.debian.org/
- #
- # Contributed by Peter Bjarke Olsen
- # Modified by Doug King
-
- seq=Array.new
-
- def revcomp(seq)
- seq.reverse!.tr!('wsatugcyrkmbdhvnATUGCYRKMBDHVN','WSTAACGRYMKVHDBNTAACGRYMKVHDBN')
- stringlen=seq.length
- 0.step(stringlen-1,60) {|x| print seq.slice(x,60) , "\n"}
- end
-
- input = open(File.join(File.dirname($0), 'fasta.output.2500000'), 'rb')
-
- while input.gets
- if $_ =~ />/
- if seq.length != 0
- revcomp(seq.join)
- seq=Array.new
- end
- puts $_
- else
- $_.sub(/\n/,'')
- seq.push $_
- end
- end
- revcomp(seq.join)
- loop_count: 1
diff --git a/benchmark/string_capitalize.yml b/benchmark/string_capitalize.yml
deleted file mode 100644
index 7d23fd3d35..0000000000
--- a/benchmark/string_capitalize.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-prelude: |
- str1 = [*"a".."m",*"N".."Z",*"0".."9"].join("")
- str10 = str1 * 10
- str100 = str10 * 10
- str1000 = str100 * 10
-benchmark:
- capitalize-1: str1.capitalize
- capitalize-10: str10.capitalize
- capitalize-100: str100.capitalize
- capitalize-1000: str1000.capitalize
diff --git a/benchmark/string_downcase.yml b/benchmark/string_downcase.yml
deleted file mode 100644
index a31c3ac712..0000000000
--- a/benchmark/string_downcase.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-prelude: |
- str1 = [*"A".."Z",*"0".."9"].join("")
- str10 = str1 * 10
- str100 = str10 * 10
- str1000 = str100 * 10
-benchmark:
- downcase-1: str1.upcase
- downcase-10: str10.upcase
- downcase-100: str100.upcase
- downcase-1000: str1000.upcase
diff --git a/benchmark/string_index.rb b/benchmark/string_index.rb
deleted file mode 100644
index 7783111082..0000000000
--- a/benchmark/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/string_scan_re.rb b/benchmark/string_scan_re.rb
deleted file mode 100644
index b0d60201a9..0000000000
--- a/benchmark/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/string_scan_str.rb b/benchmark/string_scan_str.rb
deleted file mode 100644
index 42440bd948..0000000000
--- a/benchmark/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/string_split.yml b/benchmark/string_split.yml
deleted file mode 100644
index 84ffe8f6a7..0000000000
--- a/benchmark/string_split.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- str0 = [*0..9].join("")
-benchmark:
- to_chars-1: str0.split('')
- to_chars-10: (str0 * 10).split('')
- to_chars-100: (str0 * 100).split('')
- to_chars-1000: (str0 * 1000).split('')
diff --git a/benchmark/string_swapcase.yml b/benchmark/string_swapcase.yml
deleted file mode 100644
index afaae3f696..0000000000
--- a/benchmark/string_swapcase.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-prelude: |
- str1 = [*"A".."M",*"n".."z",*"0".."9"].join("")
- str10 = str1 * 10
- str100 = str10 * 10
- str1000 = str100 * 10
-benchmark:
- swapcase-1: str1.swapcase
- swapcase-10: str10.swapcase
- swapcase-100: str100.swapcase
- swapcase-1000: str1000.swapcase
diff --git a/benchmark/string_upcase.yml b/benchmark/string_upcase.yml
deleted file mode 100644
index 456d213c74..0000000000
--- a/benchmark/string_upcase.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-prelude: |
- str1 = [*"a".."z",*"0".."9"].join("")
- str10 = str1 * 10
- str100 = str10 * 10
- str1000 = str100 * 10
-benchmark:
- upcase-1: str1.upcase
- upcase-10: str10.upcase
- upcase-100: str100.upcase
- upcase-1000: str1000.upcase
diff --git a/benchmark/time_strptime.yml b/benchmark/time_strptime.yml
deleted file mode 100644
index 8d89ebb7a7..0000000000
--- a/benchmark/time_strptime.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-prelude: |
- require 'time'
-benchmark:
- - Time.strptime("28/Aug/2005:06:54:20 +0000", "%d/%b/%Y:%T %z")
- - Time.strptime("1", "%s")
- - Time.strptime("0 +0100", "%s %z")
- - Time.strptime("0 UTC", "%s %z")
- - Time.strptime("1.5", "%s.%N")
- - Time.strptime("1.000000000001", "%s.%N")
- - Time.strptime("20010203 -0200", "%Y%m%d %z")
- - Time.strptime("20010203 UTC", "%Y%m%d %z")
- - Time.strptime("2018-365", "%Y-%j")
- - Time.strptime("2018-091", "%Y-%j")
diff --git a/benchmark/time_subsec.rb b/benchmark/time_subsec.rb
deleted file mode 100644
index 505021c701..0000000000
--- a/benchmark/time_subsec.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-t = Time.now
-4000000.times { t.subsec }
diff --git a/benchmark/vm1_attr_ivar.yml b/benchmark/vm1_attr_ivar.yml
deleted file mode 100644
index f714dd9bd9..0000000000
--- a/benchmark/vm1_attr_ivar.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-prelude: |
- class C
- attr_reader :a, :b
- def initialize
- @a = nil
- @b = nil
- end
- end
- obj = C.new
-benchmark:
- vm1_attr_ivar: |
- j = obj.a
- k = obj.b
-loop_count: 30000000
diff --git a/benchmark/vm1_attr_ivar_set.yml b/benchmark/vm1_attr_ivar_set.yml
deleted file mode 100644
index f383e59ef4..0000000000
--- a/benchmark/vm1_attr_ivar_set.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-prelude: |
- class C
- attr_accessor :a, :b
- def initialize
- @a = nil
- @b = nil
- end
- end
- obj = C.new
-benchmark:
- vm1_attr_ivar_set: |
- obj.a = 1
- obj.b = 2
-loop_count: 30000000
diff --git a/benchmark/vm1_block.yml b/benchmark/vm1_block.yml
deleted file mode 100644
index ac7c940f93..0000000000
--- a/benchmark/vm1_block.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-prelude: |
- def m
- yield
- end
-benchmark:
- vm1_block: |
- m{
- }
-loop_count: 30000000
diff --git a/benchmark/vm1_blockparam.yml b/benchmark/vm1_blockparam.yml
deleted file mode 100644
index 947b8c53d5..0000000000
--- a/benchmark/vm1_blockparam.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- def m &b
- end
-benchmark:
- vm1_blockparam: |
- m{}
-loop_count: 30000000
diff --git a/benchmark/vm1_blockparam_call.yml b/benchmark/vm1_blockparam_call.yml
deleted file mode 100644
index e2817a3ce2..0000000000
--- a/benchmark/vm1_blockparam_call.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- def m &b
- b.call
- end
-benchmark:
- vm1_blockparam_call: |
- m{}
-loop_count: 30000000
diff --git a/benchmark/vm1_blockparam_pass.yml b/benchmark/vm1_blockparam_pass.yml
deleted file mode 100644
index ca1bef3369..0000000000
--- a/benchmark/vm1_blockparam_pass.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-prelude: |
- def bp_yield
- yield
- end
-
- def bp_pass &b
- bp_yield &b
- end
-benchmark:
- vm1_blockparam_pass: |
- bp_pass{}
-loop_count: 30000000
diff --git a/benchmark/vm1_blockparam_yield.yml b/benchmark/vm1_blockparam_yield.yml
deleted file mode 100644
index 56ae617798..0000000000
--- a/benchmark/vm1_blockparam_yield.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- def bp_yield &b
- yield
- end
-benchmark:
- vm1_blockparam_yield: |
- bp_yield{}
-loop_count: 30000000
diff --git a/benchmark/vm1_const.yml b/benchmark/vm1_const.yml
deleted file mode 100644
index b98db1545c..0000000000
--- a/benchmark/vm1_const.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- Const = 1
-benchmark:
- vm1_const: |
- j = Const
- k = Const
-loop_count: 30000000
diff --git a/benchmark/vm1_ensure.yml b/benchmark/vm1_ensure.yml
deleted file mode 100644
index afbbe38bec..0000000000
--- a/benchmark/vm1_ensure.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-# Not utilizing loop_count since using it for this is too unstable for now
-benchmark:
- vm1_ensure: |
- i = 0
- while i<30_000_000
- i += 1
- begin
- begin
- ensure
- end
- ensure
- end
- end
-loop_count: 1
diff --git a/benchmark/vm1_float_simple.yml b/benchmark/vm1_float_simple.yml
deleted file mode 100644
index 4e9ad1852b..0000000000
--- a/benchmark/vm1_float_simple.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- f = 0.0
-benchmark:
- vm1_float_simple: |
- f += 0.1; f -= 0.1
- f += 0.1; f -= 0.1
- f += 0.1; f -= 0.1
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_short_lived.yml b/benchmark/vm1_gc_short_lived.yml
deleted file mode 100644
index 8fdcb7371d..0000000000
--- a/benchmark/vm1_gc_short_lived.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-benchmark:
- vm1_gc_short_lived: |
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_short_with_complex_long.yml b/benchmark/vm1_gc_short_with_complex_long.yml
deleted file mode 100644
index c22ea74a60..0000000000
--- a/benchmark/vm1_gc_short_with_complex_long.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-prelude: |
- def nested_hash h, n
- if n == 0
- ''
- else
- 10.times{
- h[Object.new] = nested_hash(h, n-1)
- }
- end
- end
-
- long_lived = Hash.new
- nested_hash long_lived, 6
-
- GC.start
- GC.start
-benchmark:
- vm1_gc_short_with_complex_long: |
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_short_with_long.yml b/benchmark/vm1_gc_short_with_long.yml
deleted file mode 100644
index c731aae548..0000000000
--- a/benchmark/vm1_gc_short_with_long.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-prelude: |
- long_lived = Array.new(1_000_000){|i| "#{i}"}
- GC.start
- GC.start
-benchmark:
- vm1_gc_short_with_long: |
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_short_with_symbol.yml b/benchmark/vm1_gc_short_with_symbol.yml
deleted file mode 100644
index 7fc1abedd8..0000000000
--- a/benchmark/vm1_gc_short_with_symbol.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-prelude: |
- 50_000.times{|i| sym = "sym#{i}".to_sym}
- GC.start
- GC.start
-benchmark:
- vm1_gc_short_with_symbol: |
- a = '' # short-lived String
- b = ''
- c = ''
- d = ''
- e = ''
- f = ''
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_wb_ary.yml b/benchmark/vm1_gc_wb_ary.yml
deleted file mode 100644
index 50fb4b6f84..0000000000
--- a/benchmark/vm1_gc_wb_ary.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-prelude: |
- short_lived_ary = []
-
- if RUBY_VERSION >= "2.2.0"
- GC.start(full_mark: false, immediate_mark: true, immediate_sweep: true)
- end
-
- short_lived = ''
-benchmark:
- vm1_gc_wb_ary: |
- short_lived_ary[0] = short_lived # write barrier
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_wb_ary_promoted.yml b/benchmark/vm1_gc_wb_ary_promoted.yml
deleted file mode 100644
index cf9b5de005..0000000000
--- a/benchmark/vm1_gc_wb_ary_promoted.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-prelude: |
- 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
-
- short_lived = ''
-
-benchmark:
- vm1_gc_wb_ary_promoted: |
- long_lived[0] = short_lived # write barrier
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_wb_obj.yml b/benchmark/vm1_gc_wb_obj.yml
deleted file mode 100644
index 9dc08e7e1a..0000000000
--- a/benchmark/vm1_gc_wb_obj.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-prelude: |
- 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
-
- short_lived = ''
-benchmark:
- vm1_gc_wb_obj: |
- short_lived_obj.foo = short_lived # write barrier
-loop_count: 30000000
diff --git a/benchmark/vm1_gc_wb_obj_promoted.yml b/benchmark/vm1_gc_wb_obj_promoted.yml
deleted file mode 100644
index 26859d2a52..0000000000
--- a/benchmark/vm1_gc_wb_obj_promoted.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-prelude: |
- 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
-
- short_lived = ''
-benchmark:
- vm1_gc_wb_obj_promoted: |
- long_lived.foo = short_lived # write barrier
-loop_count: 30000000
diff --git a/benchmark/vm1_ivar.yml b/benchmark/vm1_ivar.yml
deleted file mode 100644
index 7aa6fac729..0000000000
--- a/benchmark/vm1_ivar.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-prelude: "@a = 1\n"
-benchmark:
- vm1_ivar: |
- j = @a
- k = @a
-loop_count: 30000000
diff --git a/benchmark/vm1_ivar_set.yml b/benchmark/vm1_ivar_set.yml
deleted file mode 100644
index 6f19412d16..0000000000
--- a/benchmark/vm1_ivar_set.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-benchmark:
- vm1_ivar_set: |
- @a = 1
- @b = 2
-loop_count: 30000000
diff --git a/benchmark/vm1_length.yml b/benchmark/vm1_length.yml
deleted file mode 100644
index a18e2ca2e6..0000000000
--- a/benchmark/vm1_length.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- a = 'abc'
- b = [1, 2, 3]
-benchmark:
- vm1_length: |
- a.length
- b.length
-loop_count: 30000000
diff --git a/benchmark/vm1_lvar_init.yml b/benchmark/vm1_lvar_init.yml
deleted file mode 100644
index 10e2becef9..0000000000
--- a/benchmark/vm1_lvar_init.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-# while loop cost is not removed because `i` is used in the script
-benchmark:
- vm1_lvar_init: |
- def m v
- unless v
- # unreachable code
- v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 =
- v11 = v12 = v13 = v14 = v15 = v16 = v17 = v18 = v19 = v20 =
- v21 = v22 = v23 = v24 = v25 = v26 = v27 = v28 = v29 = v30 =
- v31 = v32 = v33 = v34 = v35 = v36 = v37 = v38 = v39 = v40 =
- v41 = v42 = v43 = v44 = v45 = v46 = v47 = v48 = v49 = v50 = 1
- end
- end
-
- i = 0
-
- while i<30_000_000
- i += 1
- m i
- end
-loop_count: 1
diff --git a/benchmark/vm1_lvar_set.yml b/benchmark/vm1_lvar_set.yml
deleted file mode 100644
index df8f6b6ea4..0000000000
--- a/benchmark/vm1_lvar_set.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm1_lvar_set: |
- a = b = c = d = e = f = g = h = j = k = l = m = n = o = p = q = r = 1
-loop_count: 30000000
diff --git a/benchmark/vm1_neq.yml b/benchmark/vm1_neq.yml
deleted file mode 100644
index 65a8128dda..0000000000
--- a/benchmark/vm1_neq.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- obj1 = Object.new
- obj2 = Object.new
-benchmark:
- vm1_neq: |
- obj1 != obj2
-loop_count: 30000000
diff --git a/benchmark/vm1_not.yml b/benchmark/vm1_not.yml
deleted file mode 100644
index 0fb7b282a9..0000000000
--- a/benchmark/vm1_not.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-prelude: |
- obj = Object.new
-benchmark:
- vm1_not: |
- !obj
-loop_count: 30000000
diff --git a/benchmark/vm1_rescue.yml b/benchmark/vm1_rescue.yml
deleted file mode 100644
index a175b823af..0000000000
--- a/benchmark/vm1_rescue.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-benchmark:
- vm1_rescue: |
- begin
- rescue
- end
-loop_count: 30000000
diff --git a/benchmark/vm1_simplereturn.yml b/benchmark/vm1_simplereturn.yml
deleted file mode 100644
index 3564aac7e2..0000000000
--- a/benchmark/vm1_simplereturn.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- def m
- return 1
- end
-benchmark:
- vm1_simplereturn: m
-loop_count: 30000000
diff --git a/benchmark/vm1_swap.yml b/benchmark/vm1_swap.yml
deleted file mode 100644
index fed87ccd62..0000000000
--- a/benchmark/vm1_swap.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- a = 1
- b = 2
-benchmark:
- vm1_swap: |
- a, b = b, a
-loop_count: 30000000
diff --git a/benchmark/vm1_yield.yml b/benchmark/vm1_yield.yml
deleted file mode 100644
index ae1f9316f9..0000000000
--- a/benchmark/vm1_yield.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-# while loop cost is not removed due to benchmark_driver.gem's limitation
-benchmark:
- vm1_yield: |
- def m
- i = 0
- while i<30_000_000
- i += 1
- yield
- end
- end
-
- m{}
-loop_count: 1
diff --git a/benchmark/vm2_array.yml b/benchmark/vm2_array.yml
deleted file mode 100644
index 7373098d5e..0000000000
--- a/benchmark/vm2_array.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm2_array: |
- a = [1,2,3,4,5,6,7,8,9,10]
-loop_count: 6000000
diff --git a/benchmark/vm2_bigarray.yml b/benchmark/vm2_bigarray.yml
deleted file mode 100644
index 2ad6da3905..0000000000
--- a/benchmark/vm2_bigarray.yml
+++ /dev/null
@@ -1,105 +0,0 @@
-benchmark:
- vm2_bigarray: |
- a = [
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2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,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- 1,2,3,4,5,6,7,8,9,10,
- ]
-loop_count: 6000000
diff --git a/benchmark/vm2_bighash.yml b/benchmark/vm2_bighash.yml
deleted file mode 100644
index e9154e4ba9..0000000000
--- a/benchmark/vm2_bighash.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm2_bighash: |
- a = {0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20, 21=>21, 22=>22, 23=>23, 24=>24, 25=>25, 26=>26, 27=>27, 28=>28, 29=>29, 30=>30, 31=>31, 32=>32, 33=>33, 34=>34, 35=>35, 36=>36, 37=>37, 38=>38, 39=>39, 40=>40, 41=>41, 42=>42, 43=>43, 44=>44, 45=>45, 46=>46, 47=>47, 48=>48, 49=>49, 50=>50, 51=>51, 52=>52, 53=>53, 54=>54, 55=>55, 56=>56, 57=>57, 58=>58, 59=>59, 60=>60, 61=>61, 62=>62, 63=>63, 64=>64, 65=>65, 66=>66, 67=>67, 68=>68, 69=>69, 70=>70, 71=>71, 72=>72, 73=>73, 74=>74, 75=>75, 76=>76, 77=>77, 78=>78, 79=>79, 80=>80, 81=>81, 82=>82, 83=>83, 84=>84, 85=>85, 86=>86, 87=>87, 88=>88, 89=>89, 90=>90, 91=>91, 92=>92, 93=>93, 94=>94, 95=>95, 96=>96, 97=>97, 98=>98, 99=>99, 100=>100, 101=>101, 102=>102, 103=>103, 104=>104, 105=>105, 106=>106, 107=>107, 108=>108, 109=>109, 110=>110, 111=>111, 112=>112, 113=>113, 114=>114, 115=>115, 116=>116, 117=>117, 118=>118, 119=>119, 120=>120, 121=>121, 122=>122, 123=>123, 124=>124, 125=>125, 126=>126, 127=>127, 128=>128, 129=>129, 130=>130, 131=>131, 132=>132, 133=>133, 134=>134, 135=>135, 136=>136, 137=>137, 138=>138, 139=>139, 140=>140, 141=>141, 142=>142, 143=>143, 144=>144, 145=>145, 146=>146, 147=>147, 148=>148, 149=>149, 150=>150, 151=>151, 152=>152, 153=>153, 154=>154, 155=>155, 156=>156, 157=>157, 158=>158, 159=>159, 160=>160, 161=>161, 162=>162, 163=>163, 164=>164, 165=>165, 166=>166, 167=>167, 168=>168, 169=>169, 170=>170, 171=>171, 172=>172, 173=>173, 174=>174, 175=>175, 176=>176, 177=>177, 178=>178, 179=>179, 180=>180, 181=>181, 182=>182, 183=>183, 184=>184, 185=>185, 186=>186, 187=>187, 188=>188, 189=>189, 190=>190, 191=>191, 192=>192, 193=>193, 194=>194, 195=>195, 196=>196, 197=>197, 198=>198, 199=>199, 200=>200, 201=>201, 202=>202, 203=>203, 204=>204, 205=>205, 206=>206, 207=>207, 208=>208, 209=>209, 210=>210, 211=>211, 212=>212, 213=>213, 214=>214, 215=>215, 216=>216, 217=>217, 218=>218, 219=>219, 220=>220, 221=>221, 222=>222, 223=>223, 224=>224, 225=>225, 226=>226, 227=>227, 228=>228, 229=>229, 230=>230, 231=>231, 232=>232, 233=>233, 234=>234, 235=>235, 236=>236, 237=>237, 238=>238, 239=>239, 240=>240, 241=>241, 242=>242, 243=>243, 244=>244, 245=>245, 246=>246, 247=>247, 248=>248, 249=>249, 250=>250, 251=>251, 252=>252, 253=>253, 254=>254, 255=>255, 256=>256, 257=>257, 258=>258, 259=>259, 260=>260, 261=>261, 262=>262, 263=>263, 264=>264, 265=>265, 266=>266, 267=>267, 268=>268, 269=>269, 270=>270, 271=>271, 272=>272, 273=>273, 274=>274, 275=>275, 276=>276, 277=>277, 278=>278, 279=>279, 280=>280, 281=>281, 282=>282, 283=>283, 284=>284, 285=>285, 286=>286, 287=>287, 288=>288, 289=>289, 290=>290, 291=>291, 292=>292, 293=>293, 294=>294, 295=>295, 296=>296, 297=>297, 298=>298, 299=>299, 300=>300, 301=>301, 302=>302, 303=>303, 304=>304, 305=>305, 306=>306, 307=>307, 308=>308, 309=>309, 310=>310, 311=>311, 312=>312, 313=>313, 314=>314, 315=>315, 316=>316, 317=>317, 318=>318, 319=>319, 320=>320, 321=>321, 322=>322, 323=>323, 324=>324, 325=>325, 326=>326, 327=>327, 328=>328, 329=>329, 330=>330, 331=>331, 332=>332, 333=>333, 334=>334, 335=>335, 336=>336, 337=>337, 338=>338, 339=>339, 340=>340, 341=>341, 342=>342, 343=>343, 344=>344, 345=>345, 346=>346, 347=>347, 348=>348, 349=>349, 350=>350, 351=>351, 352=>352, 353=>353, 354=>354, 355=>355, 356=>356, 357=>357, 358=>358, 359=>359, 360=>360, 361=>361, 362=>362, 363=>363, 364=>364, 365=>365, 366=>366, 367=>367, 368=>368, 369=>369, 370=>370, 371=>371, 372=>372, 373=>373, 374=>374, 375=>375, 376=>376, 377=>377, 378=>378, 379=>379, 380=>380, 381=>381, 382=>382, 383=>383, 384=>384, 385=>385, 386=>386, 387=>387, 388=>388, 389=>389, 390=>390, 391=>391, 392=>392, 393=>393, 394=>394, 395=>395, 396=>396, 397=>397, 398=>398, 399=>399, 400=>400, 401=>401, 402=>402, 403=>403, 404=>404, 405=>405, 406=>406, 407=>407, 408=>408, 409=>409, 410=>410, 411=>411, 412=>412, 413=>413, 414=>414, 415=>415, 416=>416, 417=>417, 418=>418, 419=>419, 420=>420, 421=>421, 422=>422, 423=>423, 424=>424, 425=>425, 426=>426, 427=>427, 428=>428, 429=>429, 430=>430, 431=>431, 432=>432, 433=>433, 434=>434, 435=>435, 436=>436, 437=>437, 438=>438, 439=>439, 440=>440, 441=>441, 442=>442, 443=>443, 444=>444, 445=>445, 446=>446, 447=>447, 448=>448, 449=>449, 450=>450, 451=>451, 452=>452, 453=>453, 454=>454, 455=>455, 456=>456, 457=>457, 458=>458, 459=>459, 460=>460, 461=>461, 462=>462, 463=>463, 464=>464, 465=>465, 466=>466, 467=>467, 468=>468, 469=>469, 470=>470, 471=>471, 472=>472, 473=>473, 474=>474, 475=>475, 476=>476, 477=>477, 478=>478, 479=>479, 480=>480, 481=>481, 482=>482, 483=>483, 484=>484, 485=>485, 486=>486, 487=>487, 488=>488, 489=>489, 490=>490, 491=>491, 492=>492, 493=>493, 494=>494, 495=>495, 496=>496, 497=>497, 498=>498, 499=>499, 500=>500,}
-loop_count: 60000
diff --git a/benchmark/vm2_case.yml b/benchmark/vm2_case.yml
deleted file mode 100644
index 7716783c09..0000000000
--- a/benchmark/vm2_case.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-benchmark:
- vm2_case: |
- case :foo
- when :bar
- raise
- when :baz
- raise
- when :boo
- raise
- when :foo
- # noop
- end
-loop_count: 6000000
diff --git a/benchmark/vm2_case_lit.yml b/benchmark/vm2_case_lit.yml
deleted file mode 100644
index c49b8dfe5e..0000000000
--- a/benchmark/vm2_case_lit.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_case_lit: |
- 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
- 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
-loop_count: 1
diff --git a/benchmark/vm2_defined_method.yml b/benchmark/vm2_defined_method.yml
deleted file mode 100644
index e1b0d55674..0000000000
--- a/benchmark/vm2_defined_method.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- class Object
- define_method(:m){}
- end
-benchmark:
- vm2_defined_method: |
- m; m; m; m; m; m; m; m;
-loop_count: 6000000
diff --git a/benchmark/vm2_dstr.yml b/benchmark/vm2_dstr.yml
deleted file mode 100644
index f8bd6e0133..0000000000
--- a/benchmark/vm2_dstr.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-prelude: |
- x = y = 'z'
-benchmark:
- vm2_dstr: |
- str = "foo#{x}bar#{y}baz"
-loop_count: 6000000
diff --git a/benchmark/vm2_eval.yml b/benchmark/vm2_eval.yml
deleted file mode 100644
index d506a9c079..0000000000
--- a/benchmark/vm2_eval.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm2_eval: |
- eval("1")
-loop_count: 6000000
diff --git a/benchmark/vm2_fiber_allocate.yml b/benchmark/vm2_fiber_allocate.yml
deleted file mode 100644
index f29705f694..0000000000
--- a/benchmark/vm2_fiber_allocate.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- # Disable GC to see raw throughput:
- GC.disable
-benchmark:
- vm2_fiber_allocate: |
- fiber = Fiber.new{Fiber.yield}
- fiber.resume
-loop_count: 100000
diff --git a/benchmark/vm2_fiber_count.yml b/benchmark/vm2_fiber_count.yml
deleted file mode 100644
index 3ecf6bdcb2..0000000000
--- a/benchmark/vm2_fiber_count.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-# On Linux, you will need to increase the maximum number of memory maps:
-# sudo sysctl -w vm.max_map_count=200000
-prelude: |
- fibers = []
-benchmark:
- vm2_fiber_count: |
- fiber = Fiber.new{Fiber.yield}
- fibers << fiber
- fiber.resume
-loop_count: 100000
diff --git a/benchmark/vm2_fiber_reuse.yml b/benchmark/vm2_fiber_reuse.yml
deleted file mode 100644
index 0170650638..0000000000
--- a/benchmark/vm2_fiber_reuse.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-prelude: |
- GC.disable
- fibers = []
-benchmark:
- vm2_fiber_reuse: |
- 1024.times do
- fiber = Fiber.new{Fiber.yield}
- fibers << fiber
- fiber.resume
- end
-
- fibers.clear
- GC.start
-loop_count: 200
diff --git a/benchmark/vm2_fiber_reuse_gc.yml b/benchmark/vm2_fiber_reuse_gc.yml
deleted file mode 100644
index 8fb91a84eb..0000000000
--- a/benchmark/vm2_fiber_reuse_gc.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# https://bugs.ruby-lang.org/issues/16009
-prelude: |
- fibers = []
-benchmark:
- vm2_fiber_reuse_gc: |
- 2000.times do
- fiber = Fiber.new{Fiber.yield}
- fibers << fiber
- fiber.resume
- end
- fibers.clear
-loop_count: 100
diff --git a/benchmark/vm2_fiber_switch.yml b/benchmark/vm2_fiber_switch.yml
deleted file mode 100644
index fbf7283c29..0000000000
--- a/benchmark/vm2_fiber_switch.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-prelude: |
- # based on benchmark for [ruby-core:65518] [Feature #10341] by Knut Franke
- fib = Fiber.new do
- loop { Fiber.yield }
- end
-benchmark:
- vm2_fiber_switch: |
- fib.resume
-loop_count: 20000000
diff --git a/benchmark/vm2_freezestring.yml b/benchmark/vm2_freezestring.yml
deleted file mode 100644
index b78af91a20..0000000000
--- a/benchmark/vm2_freezestring.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-prelude: |
- class String
- def freeze
- -self
- end
- end
-benchmark:
- vm2_freezestring: |
- "tXnL1BP5T1WPXMjuFNLQtallEtRcay1t2lHtJSrlVsDgvunlbtfpr/DGdH0NGYE9".freeze
-loop_count: 6000000
diff --git a/benchmark/vm2_method.yml b/benchmark/vm2_method.yml
deleted file mode 100644
index cc7b9b28ff..0000000000
--- a/benchmark/vm2_method.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- def m
- nil
- end
-benchmark:
- vm2_method: |
- m; m; m; m; m; m; m; m;
-loop_count: 6000000
diff --git a/benchmark/vm2_method_missing.yml b/benchmark/vm2_method_missing.yml
deleted file mode 100644
index cbfb794b25..0000000000
--- a/benchmark/vm2_method_missing.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-prelude: |
- class C
- def method_missing mid
- end
- end
-
- obj = C.new
-benchmark:
- vm2_method_missing: |
- obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m; obj.m;
-loop_count: 6000000
diff --git a/benchmark/vm2_method_with_block.yml b/benchmark/vm2_method_with_block.yml
deleted file mode 100644
index 6e522adccc..0000000000
--- a/benchmark/vm2_method_with_block.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- def m
- nil
- end
-benchmark:
- vm2_method_with_block: |
- m{}; m{}; m{}; m{}; m{}; m{}; m{}; m{};
-loop_count: 6000000
diff --git a/benchmark/vm2_module_ann_const_set.yml b/benchmark/vm2_module_ann_const_set.yml
deleted file mode 100644
index b0becd9d3d..0000000000
--- a/benchmark/vm2_module_ann_const_set.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm2_module_ann_const_set: |
- Module.new.const_set(:X, Module.new)
-loop_count: 6000000
diff --git a/benchmark/vm2_module_const_set.yml b/benchmark/vm2_module_const_set.yml
deleted file mode 100644
index 05a640069c..0000000000
--- a/benchmark/vm2_module_const_set.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- module M
- end
- $VERBOSE = nil
-benchmark:
- vm2_module_const_set: |
- M.const_set(:X, Module.new)
-loop_count: 6000000
diff --git a/benchmark/vm2_mutex.yml b/benchmark/vm2_mutex.yml
deleted file mode 100644
index c40a90444a..0000000000
--- a/benchmark/vm2_mutex.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- require 'thread'
-
- m = Thread::Mutex.new
-benchmark:
- vm2_mutex: |
- m.synchronize{}
-loop_count: 6000000
diff --git a/benchmark/vm2_newlambda.yml b/benchmark/vm2_newlambda.yml
deleted file mode 100644
index 93133f9f30..0000000000
--- a/benchmark/vm2_newlambda.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm2_newlambda: |
- lambda {}
-loop_count: 6000000
diff --git a/benchmark/vm2_poly_method.yml b/benchmark/vm2_poly_method.yml
deleted file mode 100644
index 0104bdfb66..0000000000
--- a/benchmark/vm2_poly_method.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_poly_method: |
- class C1
- def m
- 1
- end
- end
- class C2
- def m
- 2
- end
- end
-
- o1 = C1.new
- o2 = C2.new
-
- i = 0
- while i<6_000_000
- 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
-loop_count: 1
diff --git a/benchmark/vm2_poly_method_ov.yml b/benchmark/vm2_poly_method_ov.yml
deleted file mode 100644
index 3748073ba2..0000000000
--- a/benchmark/vm2_poly_method_ov.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_poly_method_ov: |
- class C1
- def m
- 1
- end
- end
- class C2
- def m
- 2
- end
- end
-
- o1 = C1.new
- o2 = C2.new
-
- i = 0
- while i<6_000_000
- 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
-loop_count: 1
diff --git a/benchmark/vm2_poly_same_method.yml b/benchmark/vm2_poly_same_method.yml
deleted file mode 100644
index 867c433cf8..0000000000
--- a/benchmark/vm2_poly_same_method.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-prelude: |
- module AR; end
- class AR::Base
- def create_or_update
- nil
- end
- def save
- create_or_update
- end
- end
- class Foo < AR::Base; end
- class Bar < AR::Base; end
- o1 = Foo.new
- o2 = Bar.new
-benchmark:
- vm2_poly_same_method: |
- o1.save; o2.save;
- o1.save; o2.save;
- o1.save; o2.save;
- o1.save; o2.save;
- o1.save; o2.save;
- o1.save; o2.save;
- o1.save; o2.save;
- o1.save; o2.save;
-loop_count: 6000000
diff --git a/benchmark/vm2_poly_singleton.yml b/benchmark/vm2_poly_singleton.yml
deleted file mode 100644
index e58d7bfb37..0000000000
--- a/benchmark/vm2_poly_singleton.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_poly_singleton: |
- 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
-loop_count: 1
diff --git a/benchmark/vm2_proc.yml b/benchmark/vm2_proc.yml
deleted file mode 100644
index 5c36e936d9..0000000000
--- a/benchmark/vm2_proc.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-prelude: |
- def m &b
- b
- end
-
- pr = m{
- a = 1
- }
-benchmark:
- vm2_proc: |
- pr.call
-loop_count: 6000000
diff --git a/benchmark/vm2_raise1.yml b/benchmark/vm2_raise1.yml
deleted file mode 100644
index f6eb308968..0000000000
--- a/benchmark/vm2_raise1.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-prelude: |
- def rec n
- if n > 0
- rec n-1
- else
- raise
- end
- end
-benchmark:
- vm2_raise1: |
- begin
- rec 1
- rescue
- # ignore
- end
-loop_count: 6000000
diff --git a/benchmark/vm2_raise2.yml b/benchmark/vm2_raise2.yml
deleted file mode 100644
index 7d51b1b314..0000000000
--- a/benchmark/vm2_raise2.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-prelude: |
- def rec n
- if n > 0
- rec n-1
- else
- raise
- end
- end
-benchmark:
- vm2_raise2: |
- begin
- rec 10
- rescue
- # ignore
- end
-loop_count: 6000000
diff --git a/benchmark/vm2_regexp.yml b/benchmark/vm2_regexp.yml
deleted file mode 100644
index e53341f43b..0000000000
--- a/benchmark/vm2_regexp.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-prelude: |
- str = 'xxxhogexxx'
-benchmark:
- vm2_regexp: |
- /hoge/ =~ str
- vm2_regexp_invert: |
- str =~ /hoge/
-loop_count: 6000000
diff --git a/benchmark/vm2_send.yml b/benchmark/vm2_send.yml
deleted file mode 100644
index 44a12a27d9..0000000000
--- a/benchmark/vm2_send.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-prelude: |
- class C
- def m
- end
- end
-
- o = C.new
-benchmark:
- vm2_send: |
- o.__send__ :m
-loop_count: 6000000
diff --git a/benchmark/vm2_string_literal.yml b/benchmark/vm2_string_literal.yml
deleted file mode 100644
index 54b0aec1fe..0000000000
--- a/benchmark/vm2_string_literal.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm2_string_literal: |
- x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_big_aref_hi.yml b/benchmark/vm2_struct_big_aref_hi.yml
deleted file mode 100644
index eed1846d28..0000000000
--- a/benchmark/vm2_struct_big_aref_hi.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(*('a'..'z').map { |x| x.to_sym })
- x = s.new
-benchmark:
- vm2_struct_big_aref_hi: |
- x.z # x[25]
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_big_aref_lo.yml b/benchmark/vm2_struct_big_aref_lo.yml
deleted file mode 100644
index 0915435b76..0000000000
--- a/benchmark/vm2_struct_big_aref_lo.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(*('a'..'z').map { |x| x.to_sym })
- x = s.new
-benchmark:
- vm2_struct_big_aref_lo: |
- x.k # x[10]
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_big_aset.yml b/benchmark/vm2_struct_big_aset.yml
deleted file mode 100644
index 6af50103d3..0000000000
--- a/benchmark/vm2_struct_big_aset.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_struct_big_aset: |
- s = Struct.new(*('a'..'z').map { |x| x.to_sym })
- x = s.new
- i = 0
- while i<6_000_000
- i += 1
- x.k = i # x[10] = i
- end
-loop_count: 1
diff --git a/benchmark/vm2_struct_big_href_hi.yml b/benchmark/vm2_struct_big_href_hi.yml
deleted file mode 100644
index 60aa7fddf3..0000000000
--- a/benchmark/vm2_struct_big_href_hi.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(*('a'..'z').map { |x| x.to_sym })
- x = s.new
-benchmark:
- vm2_struct_big_href_hi: |
- x[:z]
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_big_href_lo.yml b/benchmark/vm2_struct_big_href_lo.yml
deleted file mode 100644
index c55c0bd16c..0000000000
--- a/benchmark/vm2_struct_big_href_lo.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(*('a'..'z').map { |x| x.to_sym })
- x = s.new
-benchmark:
- vm2_struct_big_href_lo: |
- x[:k]
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_big_hset.yml b/benchmark/vm2_struct_big_hset.yml
deleted file mode 100644
index d199c5bd47..0000000000
--- a/benchmark/vm2_struct_big_hset.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_struct_big_hset: |
- s = Struct.new(*('a'..'z').map { |x| x.to_sym })
- x = s.new
- i = 0
- while i<6_000_000
- i += 1
- x[:k] = i
- end
-loop_count: 1
diff --git a/benchmark/vm2_struct_small_aref.yml b/benchmark/vm2_struct_small_aref.yml
deleted file mode 100644
index 83381bed3a..0000000000
--- a/benchmark/vm2_struct_small_aref.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(:a, :b, :c)
- x = s.new
-benchmark:
- vm2_struct_small_aref: |
- x.a
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_small_aset.yml b/benchmark/vm2_struct_small_aset.yml
deleted file mode 100644
index 3e84a61dd0..0000000000
--- a/benchmark/vm2_struct_small_aset.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# loop_count is not utilized since `i` is involved in the script
-benchmark:
- vm2_struct_small_aset: |
- s = Struct.new(:a, :b, :c)
- x = s.new
- i = 0
- while i<6_000_000
- i += 1
- x.a = i
- end
-loop_count: 1
diff --git a/benchmark/vm2_struct_small_href.yml b/benchmark/vm2_struct_small_href.yml
deleted file mode 100644
index b744f070d1..0000000000
--- a/benchmark/vm2_struct_small_href.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(:a, :b, :c)
- x = s.new
-benchmark:
- vm2_struct_small_href: |
- x[:a]
-loop_count: 6000000
diff --git a/benchmark/vm2_struct_small_hset.yml b/benchmark/vm2_struct_small_hset.yml
deleted file mode 100644
index d43845d6e0..0000000000
--- a/benchmark/vm2_struct_small_hset.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- s = Struct.new(:a, :b, :c)
- x = s.new
-benchmark:
- vm2_struct_small_hset: |
- x[:a] = 1
-loop_count: 6000000
diff --git a/benchmark/vm2_super.yml b/benchmark/vm2_super.yml
deleted file mode 100644
index 674743762a..0000000000
--- a/benchmark/vm2_super.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-prelude: |
- class C
- def m
- 1
- end
- end
-
- class CC < C
- def m
- super()
- end
- end
-
- obj = CC.new
-benchmark:
- vm2_super: obj.m
-loop_count: 6000000
diff --git a/benchmark/vm2_unif1.yml b/benchmark/vm2_unif1.yml
deleted file mode 100644
index caef13279f..0000000000
--- a/benchmark/vm2_unif1.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-prelude: |
- def m a, b
- end
-benchmark:
- vm2_unif1: |
- m 100, 200
-loop_count: 6000000
diff --git a/benchmark/vm2_zsuper.yml b/benchmark/vm2_zsuper.yml
deleted file mode 100644
index f760cfd48e..0000000000
--- a/benchmark/vm2_zsuper.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-prelude: |
- class C
- def m a
- 1
- end
- end
-
- class CC < C
- def m a
- super
- end
- end
-
- obj = CC.new
-benchmark:
- vm2_zsuper: |
- obj.m 10
-loop_count: 6000000
diff --git a/benchmark/vm3_gc.rb b/benchmark/vm3_gc.rb
deleted file mode 100644
index e668026915..0000000000
--- a/benchmark/vm3_gc.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-5000.times do
- 100.times do
- {"xxxx"=>"yyyy"}
- end
- GC.start
-end
diff --git a/benchmark/vm3_gc_old_full.rb b/benchmark/vm3_gc_old_full.rb
deleted file mode 100644
index cfdfc8c5a5..0000000000
--- a/benchmark/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/vm3_gc_old_immediate.rb b/benchmark/vm3_gc_old_immediate.rb
deleted file mode 100644
index ad22feb655..0000000000
--- a/benchmark/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/vm3_gc_old_lazy.rb b/benchmark/vm3_gc_old_lazy.rb
deleted file mode 100644
index b74d44baf1..0000000000
--- a/benchmark/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/vm_symbol_block_pass.rb b/benchmark/vm_symbol_block_pass.rb
deleted file mode 100644
index 1d433353e1..0000000000
--- a/benchmark/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/vm_thread_alive_check.yml b/benchmark/vm_thread_alive_check.yml
deleted file mode 100644
index d21737d3e8..0000000000
--- a/benchmark/vm_thread_alive_check.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-benchmark:
- vm_thread_alive_check: |
- t = Thread.new{}
- while t.alive?
- Thread.pass
- end
-loop_count: 50_000
-
diff --git a/benchmark/vm_thread_condvar1.rb b/benchmark/vm_thread_condvar1.rb
deleted file mode 100644
index cf5706b23e..0000000000
--- a/benchmark/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/vm_thread_condvar2.rb b/benchmark/vm_thread_condvar2.rb
deleted file mode 100644
index 7c8dc19481..0000000000
--- a/benchmark/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/vm_thread_mutex1.rb b/benchmark/vm_thread_mutex1.rb
deleted file mode 100644
index 66e42c85e1..0000000000
--- a/benchmark/vm_thread_mutex1.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# one thread, one mutex (no contention)
-
-require 'thread'
-m = Thread::Mutex.new
-r = 0
-max = 2000
-lmax = max * max
-(1..1).map{
- Thread.new{
- i = 0
- while i<lmax
- i += 1
- m.synchronize{
- r += 1
- }
- end
- }
-}.each{|e|
- e.join
-}
-raise r.to_s if r != max * max
diff --git a/benchmark/vm_thread_mutex2.rb b/benchmark/vm_thread_mutex2.rb
deleted file mode 100644
index 6e6c804c31..0000000000
--- a/benchmark/vm_thread_mutex2.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# two threads, one mutex
-
-require 'thread'
-m = Thread::Mutex.new
-r = 0
-max = 2000
-lmax = (max * max)/2
-(1..2).map{
- Thread.new{
- i = 0
- while i<lmax
- i += 1
- m.synchronize{
- r += 1
- }
- end
- }
-}.each{|e|
- e.join
-}
-raise r.to_s if r != max * max
diff --git a/benchmark/vm_thread_mutex3.rb b/benchmark/vm_thread_mutex3.rb
deleted file mode 100644
index c750dc542a..0000000000
--- a/benchmark/vm_thread_mutex3.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# 1000 threads, one mutex
-
-require 'thread'
-m = Thread::Mutex.new
-r = 0
-max = 2000
-(1..max).map{
- Thread.new{
- i = 0
- while i<max
- i += 1
- m.synchronize{
- r += 1
- }
- end
- }
-}.each{|e|
- e.join
-}
-raise r.to_s if r != max * max
diff --git a/benchmark/vm_thread_pass.rb b/benchmark/vm_thread_pass.rb
deleted file mode 100644
index 438bd08d45..0000000000
--- a/benchmark/vm_thread_pass.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# Plenty Thread.pass
-# A performance may depend on GVL implementation.
-
-tmax = (ARGV.shift || 8).to_i
-lmax = 400_000 / tmax
-
-(1..tmax).map{
- Thread.new{
- lmax.times{
- Thread.pass
- }
- }
-}.each{|t| t.join}
-
-
diff --git a/benchmark/vm_thread_pass_flood.rb b/benchmark/vm_thread_pass_flood.rb
deleted file mode 100644
index 65df8e6154..0000000000
--- a/benchmark/vm_thread_pass_flood.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# n.b. this is a good test for GVL when pinned to a single CPU
-
-5_000.times{
- Thread.new{loop{Thread.pass}}
-}
-
-i = 0
-while i<10_000
- i += 1
-end
diff --git a/benchmark/vm_thread_pipe.rb b/benchmark/vm_thread_pipe.rb
deleted file mode 100644
index 112a621905..0000000000
--- a/benchmark/vm_thread_pipe.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# Measure small and plenty pipe read/write.
-# A performance may depend on GVL implementation.
-
-lmax = 100_000
-r, w = IO.pipe
-[Thread.new{
- lmax.times{
- w.write('a')
- }
- p "w:exit"
-}, Thread.new{
- lmax.times{
- r.read(1)
- }
- p "r:exit"
-}].each{|t| t.join}
-
diff --git a/benchmark/vm_thread_queue.rb b/benchmark/vm_thread_queue.rb
deleted file mode 100644
index 1dd3696a3c..0000000000
--- a/benchmark/vm_thread_queue.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'thread'
-
-n = 10_000_000
-q = Thread::Queue.new
-consumer = Thread.new{
- while q.pop
- # consuming
- end
-}
-
-producer = Thread.new{
- n.times{
- q.push true
- }
- q.push nil
-}
-
-consumer.join
diff --git a/benchmark/vm_thread_sized_queue.rb b/benchmark/vm_thread_sized_queue.rb
deleted file mode 100644
index 7b9af5482b..0000000000
--- a/benchmark/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/vm_thread_sized_queue2.rb b/benchmark/vm_thread_sized_queue2.rb
deleted file mode 100644
index de9f55e978..0000000000
--- a/benchmark/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/vm_thread_sized_queue3.rb b/benchmark/vm_thread_sized_queue3.rb
deleted file mode 100644
index ce5f1796d8..0000000000
--- a/benchmark/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/vm_thread_sized_queue4.rb b/benchmark/vm_thread_sized_queue4.rb
deleted file mode 100644
index a9b7d80ec0..0000000000
--- a/benchmark/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/vm_thread_sleep.yml b/benchmark/vm_thread_sleep.yml
deleted file mode 100644
index 96901d8466..0000000000
--- a/benchmark/vm_thread_sleep.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-benchmark:
- vm_thread_sleep: |
- Thread.new { sleep }
-loop_count: 10_000
diff --git a/benchmark/wc.input.base b/benchmark/wc.input.base
new file mode 100644
index 0000000000..41143fbac0
--- /dev/null
+++ b/benchmark/wc.input.base
@@ -0,0 +1,25 @@
+Subject: Re: Who was Izchak Miller?
+From: "Jane D. Anonymous" <nobody@yale.edu>
+Date: 1996/04/28
+Message-Id: <4lv7bc$oh@news.ycc.yale.edu>
+References: <317C405E.5DFA@panix.com> <4lk6vl$gde@ns.oar.net>
+To: 75176.2330@compuserve.com
+Content-Type: text/plain; charset=us-ascii
+Organization: Yale University
+X-Url: news:4lk6vl$gde@ns.oar.net
+Mime-Version: 1.0
+Newsgroups: rec.games.roguelike.nethack
+X-Mailer: Mozilla 1.1N (Macintosh; I; 68K)
+
+Hello there, Izchak Miller was my father. When I was younger I spent
+many a night, hunched over the keyboard with a cup of tea, playing
+nethack with him and my brother. my dad was a philosopher with a strong
+weakness for fantasy/sci fi. I remember when he started to get involved
+with the Nethack team- my brother's Dungeons and Dragons monster book
+found a regular place beside my dad's desk. it's nice to see him living
+on in the game he loved so much :-).
+ Tamar Miller
+
+The following is a really long word of 5000 characters:
+
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww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wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
diff --git a/bignum.c b/bignum.c
index 4569183e45..fbf2778f9b 100644
--- a/bignum.c
+++ b/bignum.c
@@ -12,7 +12,6 @@
#include "internal.h"
#include "ruby/thread.h"
#include "ruby/util.h"
-#include "id.h"
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -23,7 +22,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 +31,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
@@ -65,6 +62,7 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGIT % SIZEOF_LONG == 0);
#else
# define HOST_BIGENDIAN_P 0
#endif
+#define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2))
/* (!LSHIFTABLE(d, n) ? 0 : (n)) is same as n but suppress a warning, C4293, by Visual Studio. */
#define LSHIFTABLE(d, n) ((n) < sizeof(d) * CHAR_BIT)
#define LSHIFTX(d, n) (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n))))
@@ -100,6 +98,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)
@@ -112,7 +111,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); \
@@ -138,11 +137,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);
@@ -179,7 +173,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 = []
@@ -385,7 +379,6 @@ bdigitdbl2bary(BDIGIT *ds, size_t n, BDIGIT_DBL num)
static int
bary_cmp(const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
{
- size_t i;
BARY_TRUNC(xds, xn);
BARY_TRUNC(yds, yn);
@@ -394,12 +387,11 @@ bary_cmp(const BDIGIT *xds, size_t xn, const BDIGIT *yds, size_t yn)
if (xn > yn)
return 1;
- for (i = 0; i < xn; i++)
- if (xds[xn - i - 1] != yds[yn - i - 1])
- break;
- if (i == xn)
+ while (xn-- && xds[xn] == yds[xn])
+ ;
+ if (xn == (size_t)-1)
return 0;
- return xds[xn - i - 1] < yds[yn - i - 1] ? -1 : 1;
+ return xds[xn] < yds[xn] ? -1 : 1;
}
static BDIGIT
@@ -420,22 +412,22 @@ bary_small_lshift(BDIGIT *zds, const BDIGIT *xds, size_t n, int shift)
static void
bary_small_rshift(BDIGIT *zds, const BDIGIT *xds, size_t n, int shift, BDIGIT higher_bdigit)
{
- size_t i;
BDIGIT_DBL num = 0;
+ BDIGIT x;
assert(0 <= shift && shift < BITSPERDIG);
num = BIGUP(higher_bdigit);
- for (i = 0; i < n; i++) {
- BDIGIT x = xds[n - i - 1];
- num = (num | x) >> shift;
- zds[n - i - 1] = BIGLO(num);
+ while (n--) {
+ 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;
@@ -448,9 +440,8 @@ bary_zero_p(const BDIGIT *xds, size_t xn)
static void
bary_neg(BDIGIT *ds, size_t n)
{
- size_t i;
- for (i = 0; i < n; i++)
- ds[n - i - 1] = BIGLO(~ds[n - i - 1]);
+ while (n--)
+ ds[n] = BIGLO(~ds[n]);
}
static int
@@ -620,12 +611,8 @@ static int
bytes_2comp(unsigned char *buf, size_t len)
{
size_t i;
- for (i = 0; i < len; i++) {
- signed char c = buf[i];
- signed int d = ~c;
- unsigned int e = d & 0xFF;
- buf[i] = e;
- }
+ for (i = 0; i < len; i++)
+ buf[i] = ~buf[i];
for (i = 0; i < len; i++) {
buf[i]++;
if (buf[i] != 0)
@@ -675,7 +662,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
return ((1 < de - dp || CLEAR_LOWBITS(d, 8) != 0) ? 2 : 1) * sign;
}
#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
- if (wordsize == 2 && (uintptr_t)words % RUBY_ALIGNOF(uint16_t) == 0) {
+ if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
uint16_t u = (uint16_t)(d = dp[0]);
if (need_swap) u = swap16(u);
*((uint16_t *)words) = u;
@@ -683,7 +670,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
#endif
#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
- if (wordsize == 4 && (uintptr_t)words % RUBY_ALIGNOF(uint32_t) == 0) {
+ if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
uint32_t u = (uint32_t)(d = dp[0]);
if (need_swap) u = swap32(u);
*((uint32_t *)words) = u;
@@ -691,7 +678,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
#endif
#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
- if (wordsize == 8 && (uintptr_t)words % RUBY_ALIGNOF(uint64_t) == 0) {
+ if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
uint64_t u = (uint64_t)(d = dp[0]);
if (need_swap) u = swap64(u);
*((uint64_t *)words) = u;
@@ -706,7 +693,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
return (1 < de - dp || FILL_LOWBITS(d, 8) != -1) ? -2 : -1;
}
#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
- if (wordsize == 2 && (uintptr_t)words % RUBY_ALIGNOF(uint16_t) == 0) {
+ if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
uint16_t u = (uint16_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
if (need_swap) u = swap16(u);
*((uint16_t *)words) = u;
@@ -715,7 +702,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
#endif
#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
- if (wordsize == 4 && (uintptr_t)words % RUBY_ALIGNOF(uint32_t) == 0) {
+ if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
uint32_t u = (uint32_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
if (need_swap) u = swap32(u);
*((uint32_t *)words) = u;
@@ -724,7 +711,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
#endif
#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
- if (wordsize == 8 && (uintptr_t)words % RUBY_ALIGNOF(uint64_t) == 0) {
+ if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
uint64_t u = (uint64_t)(d = -(BDIGIT_DBL_SIGNED)dp[0]);
if (need_swap) u = swap64(u);
*((uint64_t *)words) = u;
@@ -767,7 +754,7 @@ bary_pack(int sign, BDIGIT *ds, size_t num_bdigits, void *words, size_t numwords
}
#endif
if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
- wordsize % SIZEOF_BDIGIT == 0 && (uintptr_t)words % RUBY_ALIGNOF(BDIGIT) == 0) {
+ wordsize % SIZEOF_BDIGIT == 0 && (uintptr_t)words % ALIGNOF(BDIGIT) == 0) {
size_t bdigits_per_word = wordsize / SIZEOF_BDIGIT;
size_t src_num_bdigits = de - dp;
size_t dst_num_bdigits = numwords * bdigits_per_word;
@@ -910,6 +897,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;
@@ -1087,13 +1076,6 @@ integer_unpack_single_bdigit(BDIGIT u, size_t size, int flags, BDIGIT *dp)
return sign;
}
-#ifdef HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED
-#define reinterpret_cast(type, value) (type) \
- __builtin_assume_aligned((value), sizeof(*(type)NULL));
-#else
-#define reinterpret_cast(type, value) (type)value
-#endif
-
static int
bary_unpack_internal(BDIGIT *bdigits, size_t num_bdigits, const void *words, size_t numwords, size_t wordsize, size_t nails, int flags, int nlp_bits)
{
@@ -1114,24 +1096,23 @@ bary_unpack_internal(BDIGIT *bdigits, size_t num_bdigits, const void *words, siz
return integer_unpack_single_bdigit(*(uint8_t *)buf, sizeof(uint8_t), flags, dp);
}
#if defined(HAVE_UINT16_T) && 2 <= SIZEOF_BDIGIT
- if (wordsize == 2 && (uintptr_t)words % RUBY_ALIGNOF(uint16_t) == 0) {
- uint16_t u = *reinterpret_cast(const uint16_t *, buf);
+ if (wordsize == 2 && (uintptr_t)words % ALIGNOF(uint16_t) == 0) {
+ uint16_t u = *(uint16_t *)buf;
return integer_unpack_single_bdigit(need_swap ? swap16(u) : u, sizeof(uint16_t), flags, dp);
}
#endif
#if defined(HAVE_UINT32_T) && 4 <= SIZEOF_BDIGIT
- if (wordsize == 4 && (uintptr_t)words % RUBY_ALIGNOF(uint32_t) == 0) {
- uint32_t u = *reinterpret_cast(const uint32_t *, buf);
+ if (wordsize == 4 && (uintptr_t)words % ALIGNOF(uint32_t) == 0) {
+ uint32_t u = *(uint32_t *)buf;
return integer_unpack_single_bdigit(need_swap ? swap32(u) : u, sizeof(uint32_t), flags, dp);
}
#endif
#if defined(HAVE_UINT64_T) && 8 <= SIZEOF_BDIGIT
- if (wordsize == 8 && (uintptr_t)words % RUBY_ALIGNOF(uint64_t) == 0) {
- uint64_t u = *reinterpret_cast(const uint64_t *, buf);
+ if (wordsize == 8 && (uintptr_t)words % ALIGNOF(uint64_t) == 0) {
+ uint64_t u = *(uint64_t *)buf;
return integer_unpack_single_bdigit(need_swap ? swap64(u) : u, sizeof(uint64_t), flags, dp);
}
#endif
-#undef reinterpret_cast
}
#if !defined(WORDS_BIGENDIAN)
if (nails == 0 && SIZEOF_BDIGIT == sizeof(BDIGIT) &&
@@ -1447,9 +1428,7 @@ bary_add_one(BDIGIT *ds, size_t n)
{
size_t i;
for (i = 0; i < n; i++) {
- BDIGIT_DBL n = ds[i];
- n += 1;
- ds[i] = BIGLO(n);
+ ds[i] = BIGLO(ds[i]+1);
if (ds[i] != 0)
return 0;
}
@@ -1517,16 +1496,15 @@ bigdivrem_mulsub(BDIGIT *zds, size_t zn, BDIGIT x, const BDIGIT *yds, size_t yn)
i = 0;
do {
- BDIGIT_DBL_SIGNED ee;
+ BDIGIT_DBL ee;
t2 += (BDIGIT_DBL)yds[i] * x;
ee = num - BIGLO(t2);
- num = (BDIGIT_DBL_SIGNED)zds[i] + ee;
+ num = (BDIGIT_DBL)zds[i] + ee;
if (ee) zds[i] = BIGLO(num);
num = BIGDN(num);
t2 = BIGDN(t2);
} while (++i < yn);
- num -= (BDIGIT_DBL_SIGNED)t2;
- num += (BDIGIT_DBL_SIGNED)zds[yn]; /* borrow from high digit; don't update */
+ num += zds[i] - t2; /* borrow from high digit; don't update */
return num;
}
@@ -2508,8 +2486,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
@@ -2518,7 +2501,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;
}
@@ -2572,7 +2555,6 @@ bigdivrem1(void *ptr)
return 0;
}
-/* async-signal-safe */
static void
rb_big_stop(void *ptr)
{
@@ -2595,9 +2577,10 @@ bigdivrem_single1(BDIGIT *qds, const BDIGIT *xds, size_t xn, BDIGIT x_higher_bdi
size_t i;
BDIGIT_DBL t2;
t2 = x_higher_bdigit;
- for (i = 0; i < xn; i++) {
- t2 = BIGUP(t2) + xds[xn - i - 1];
- qds[xn - i - 1] = (BDIGIT)(t2 / y);
+ i = xn;
+ while (i--) {
+ t2 = BIGUP(t2) + xds[i];
+ qds[i] = (BDIGIT)(t2 / y);
t2 %= y;
}
return (BDIGIT)t2;
@@ -2637,7 +2620,7 @@ bigdivrem_restoring(BDIGIT *zds, size_t zn, BDIGIT *yds, size_t yn)
if (bds.zn > 10000 || bds.yn > 10000) {
retry:
bds.stop = Qfalse;
- rb_nogvl(bigdivrem1, &bds, rb_big_stop, &bds, RB_NOGVL_UBF_ASYNC_SAFE);
+ rb_thread_call_without_gvl(bigdivrem1, &bds, rb_big_stop, &bds);
if (bds.stop == Qtrue) {
/* execute trap handler, but exception was not raised. */
@@ -2996,7 +2979,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);
@@ -3155,7 +3138,7 @@ rb_big_norm(VALUE x)
}
VALUE
-rb_uint2big(uintptr_t n)
+rb_uint2big(VALUE n)
{
long i;
VALUE big = bignew(bdigit_roomof(SIZEOF_VALUE), 1);
@@ -3177,7 +3160,7 @@ rb_uint2big(uintptr_t n)
}
VALUE
-rb_int2big(intptr_t n)
+rb_int2big(SIGNED_VALUE n)
{
long neg = 0;
VALUE u;
@@ -3192,20 +3175,20 @@ rb_int2big(intptr_t n)
}
big = rb_uint2big(u);
if (neg) {
- BIGNUM_SET_NEGATIVE_SIGN(big);
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
VALUE
-rb_uint2inum(uintptr_t n)
+rb_uint2inum(VALUE n)
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_uint2big(n);
}
VALUE
-rb_int2inum(intptr_t n)
+rb_int2inum(SIGNED_VALUE n)
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_int2big(n);
@@ -3703,44 +3686,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) {
@@ -3750,32 +3705,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
@@ -3990,117 +3940,59 @@ str2big_gmp(
}
#endif
-static VALUE rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base);
-
-/*
- * 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;
@@ -4113,75 +4005,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)) {
@@ -4200,15 +4076,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;
@@ -4235,39 +4108,36 @@ rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits,
return bignorm(z);
}
-static 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_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception)
+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) {
- if (!raise_exception) return Qnil;
- invalid_integer(str);
- }
- ret = INT2FIX(0);
+ if (badcheck) {
+ s = StringValueCStr(str);
}
- return ret;
-}
+ else {
+ s = RSTRING_PTR(str);
+ }
+ if (s) {
+ len = RSTRING_LEN(str);
+ if (s[len]) { /* no sentinel somehow */
+ char *p = ALLOCV(v, len+1);
-VALUE
-rb_str_to_inum(VALUE str, int base, int badcheck)
-{
- return rb_str_convert_to_inum(str, base, badcheck, TRUE);
+ 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;
}
VALUE
@@ -4277,25 +4147,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,
@@ -4313,28 +4180,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);
@@ -4355,28 +4219,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);
@@ -4398,28 +4259,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);
@@ -4473,7 +4331,7 @@ rb_ll2big(LONG_LONG n)
}
big = rb_ull2big(u);
if (neg) {
- BIGNUM_SET_NEGATIVE_SIGN(big);
+ BIGNUM_SET_SIGN(big, 0);
}
return big;
}
@@ -4494,46 +4352,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;
-}
-
-MJIT_FUNC_EXPORTED 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)
{
@@ -4742,9 +4560,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);
@@ -4754,9 +4571,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;
}
@@ -4940,8 +4756,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'");
@@ -5007,7 +4823,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;
@@ -5066,8 +4882,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'");
@@ -5093,12 +4909,38 @@ 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)
{
-#if SIZEOF_LONG > SIZEOF_BDIGIT
- size_t i;
-#endif
size_t len = BIGNUM_LEN(x);
unsigned long num;
BDIGIT *ds;
@@ -5113,9 +4955,9 @@ big2ulong(VALUE x, const char *type)
num = (unsigned long)ds[0];
#else
num = 0;
- for (i = 0; i < len; i++) {
+ while (len--) {
num <<= BITSPERDIG;
- num += (unsigned long)ds[len - i - 1]; /* overflow is already checked */
+ num += (unsigned long)ds[len]; /* overflow is already checked */
}
#endif
return num;
@@ -5130,8 +4972,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");
}
@@ -5146,8 +4990,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'");
}
@@ -5157,9 +5003,6 @@ rb_big2long(VALUE x)
static unsigned LONG_LONG
big2ull(VALUE x, const char *type)
{
-#if SIZEOF_LONG_LONG > SIZEOF_BDIGIT
- size_t i;
-#endif
size_t len = BIGNUM_LEN(x);
unsigned LONG_LONG num;
BDIGIT *ds = BDIGITS(x);
@@ -5172,9 +5015,9 @@ big2ull(VALUE x, const char *type)
num = (unsigned LONG_LONG)ds[0];
#else
num = 0;
- for (i = 0; i < len; i++) {
+ while (len--) {
num = BIGUP(num);
- num += ds[len - i - 1];
+ num += ds[len];
}
#endif
return num;
@@ -5189,8 +5032,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");
}
@@ -5205,8 +5050,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'");
}
@@ -5281,13 +5128,8 @@ big2dbl(VALUE x)
}
}
if (carry) {
- BDIGIT mask = BDIGMAX;
- BDIGIT bit = 1;
- mask <<= bits;
- bit <<= bits;
- dl &= mask;
- dl += bit;
- dl = BIGLO(dl);
+ dl &= BDIGMAX << bits;
+ dl = BIGLO(dl + ((BDIGIT)1 << bits));
if (!dl) d += 1;
}
}
@@ -5302,7 +5144,7 @@ big2dbl(VALUE x)
}
}
}
- if (BIGNUM_NEGATIVE_P(x)) d = -d;
+ if (!BIGNUM_SIGN(x)) d = -d;
return d;
}
@@ -5321,6 +5163,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)
{
@@ -5371,17 +5228,6 @@ rb_integer_float_cmp(VALUE x, VALUE y)
return INT2FIX(-1);
}
-#if SIZEOF_LONG * CHAR_BIT >= DBL_MANT_DIG /* assume FLT_RADIX == 2 */
-COMPILER_WARNING_PUSH
-#ifdef __has_warning
-#if __has_warning("-Wimplicit-int-float-conversion")
-COMPILER_WARNING_IGNORED(-Wimplicit-int-float-conversion)
-#endif
-#endif
-static const double LONG_MAX_as_double = LONG_MAX;
-COMPILER_WARNING_POP
-#endif
-
VALUE
rb_integer_float_eq(VALUE x, VALUE y)
{
@@ -5401,7 +5247,7 @@ rb_integer_float_eq(VALUE x, VALUE y)
return Qtrue;
#else
long xn, yn;
- if (yi < LONG_MIN || LONG_MAX_as_double <= yi)
+ if (yi < LONG_MIN || LONG_MAX < yi)
return Qfalse;
xn = FIX2LONG(x);
yn = (long)yi;
@@ -5414,33 +5260,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 {
@@ -5456,7 +5321,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)) {
@@ -5466,9 +5331,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);
}
@@ -5485,26 +5350,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);
}
@@ -5514,8 +5411,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 Integer#eql?, which requires
- * <i>obj</i> to be a Integer.
+ * 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
*/
@@ -5524,7 +5421,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)) {
}
@@ -5540,6 +5438,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)
{
@@ -5550,18 +5459,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);
@@ -5641,7 +5569,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);
@@ -5704,7 +5632,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);
@@ -5820,6 +5748,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)
{
@@ -5849,6 +5784,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)
{
@@ -5893,10 +5835,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;
@@ -5929,6 +5878,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)
{
@@ -5978,7 +5934,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
zds = BDIGITS(z);
dd = bigdivrem_single(zds, xds, xn, dd);
if (modp) {
- *modp = rb_uint2big((uintptr_t)dd);
+ *modp = rb_uint2big((VALUE)dd);
BIGNUM_SET_SIGN(*modp, BIGNUM_SIGN(x));
}
if (divp) *divp = z;
@@ -6068,15 +6024,12 @@ rb_big_divide(VALUE x, VALUE y, ID op)
}
else if (RB_FLOAT_TYPE_P(y)) {
if (op == '/') {
- double dx = rb_big2dbl(x);
- return rb_flo_div_flo(DBL2NUM(dx), y);
+ return DBL2NUM(rb_big2dbl(x) / RFLOAT_VALUE(y));
}
else {
- VALUE v;
double dy = RFLOAT_VALUE(y);
if (dy == 0.0) rb_num_zerodiv();
- v = rb_big_divide(x, y, '/');
- return rb_dbl2big(RFLOAT_VALUE(v));
+ return rb_dbl2big(rb_big2dbl(x) / dy);
}
}
else {
@@ -6087,18 +6040,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, idDiv);
+ 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)
{
@@ -6115,7 +6093,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;
@@ -6131,6 +6118,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)
{
@@ -6140,7 +6134,7 @@ rb_big_divmod(VALUE x, VALUE y)
y = rb_int2big(FIX2LONG(y));
}
else if (!RB_BIGNUM_TYPE_P(y)) {
- return rb_num_coerce_bin(x, y, idDivmod);
+ return rb_num_coerce_bin(x, y, rb_intern("divmod"));
}
bigdivmod(x, y, &div, &mod);
@@ -6157,11 +6151,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;
@@ -6169,8 +6162,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);
@@ -6178,14 +6169,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 HUGE_VAL;
- 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;
@@ -6197,7 +6188,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;
@@ -6205,11 +6196,23 @@ 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;
- VALUE v;
dx = big2dbl(x);
if (FIXNUM_P(y)) {
@@ -6218,27 +6221,35 @@ rb_big_fdiv_double(VALUE x, VALUE y)
return big_fdiv_int(x, rb_int2big(FIX2LONG(y)));
}
else if (RB_BIGNUM_TYPE_P(y)) {
- return big_fdiv_int(x, y);
+ dy = rb_big2dbl(y);
+ if (isinf(dx) || isinf(dy))
+ return big_fdiv_int(x, 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, idFdiv));
+ return rb_num_coerce_bin(x, y, rb_intern("fdiv"));
}
- v = rb_flo_div_flo(DBL2NUM(dx), DBL2NUM(dy));
- return NUM2DBL(v);
+ 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 #=> (1/15241578750190521)
+ */
VALUE
rb_big_pow(VALUE x, VALUE y)
@@ -6248,12 +6259,10 @@ rb_big_pow(VALUE x, VALUE y)
again:
if (y == INT2FIX(0)) return INT2FIX(1);
- if (y == INT2FIX(1)) return x;
if (RB_FLOAT_TYPE_P(y)) {
d = RFLOAT_VALUE(y);
- if ((BIGNUM_NEGATIVE_P(x) && !BIGZEROP(x))) {
- return rb_dbl_complex_new_polar_pi(pow(-rb_big2dbl(x), d), d);
- }
+ if ((!BIGNUM_SIGN(x) && !BIGZEROP(x)) && d != round(d))
+ return rb_funcall(rb_complex_raw1(x), rb_intern("**"), 1, y);
}
else if (RB_BIGNUM_TYPE_P(y)) {
y = bignorm(y);
@@ -6265,13 +6274,8 @@ rb_big_pow(VALUE x, VALUE y)
else if (FIXNUM_P(y)) {
yy = FIX2LONG(y);
- if (yy < 0) {
- x = rb_big_pow(x, INT2NUM(-yy));
- if (RB_INTEGER_TYPE_P(x))
- return rb_rational_raw(INT2FIX(1), x);
- else
- return DBL2NUM(1.0 / NUM2DBL(x));
- }
+ if (yy < 0)
+ return rb_funcall(rb_rational_raw1(x), rb_intern("**"), 1, y);
else {
VALUE z = 0;
SIGNED_VALUE mask;
@@ -6296,7 +6300,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));
}
@@ -6356,6 +6360,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)
{
@@ -6368,7 +6379,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, '&');
}
@@ -6475,6 +6486,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)
{
@@ -6487,7 +6505,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, '|');
}
@@ -6568,6 +6586,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)
@@ -6581,7 +6605,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, '^');
}
@@ -6617,6 +6641,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)
{
@@ -6647,6 +6678,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)
{
@@ -6677,7 +6716,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;
@@ -6687,7 +6745,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)) {
@@ -6722,13 +6780,22 @@ rb_big_aref(VALUE x, VALUE y)
return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
}
+/*
+ * call-seq:
+ * big.hash -> fixnum
+ *
+ * Compute a hash based on the value of _big_.
+ *
+ * See also Object#hash.
+ */
+
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);
}
/*
@@ -6746,47 +6813,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;
@@ -6827,7 +6942,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) {
@@ -6836,323 +6958,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) {
- if (nlz((BDIGIT)d) + rshift >= BITSPERDIG) {
- /* (d << rshift) does cause overflow.
- * example: Integer.sqrt(0xffff_ffff_ffff_ffff ** 2)
- */
- d = ~(BDIGIT_DBL)0;
- }
- else {
- 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_big_minus(z, 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_big_rshift(y, LONG2FIX(1L))) {
- if (RTEST(rb_int_odd_p(y))) {
- tmp = rb_int_mul(tmp, x);
- tmp = rb_int_modulo(tmp, m);
- }
- x = rb_int_mul(x, x);
- x = rb_int_modulo(x, m);
- }
- for (yy = FIX2LONG(y); yy; yy >>= 1L) {
- if (yy & 1L) {
- tmp = rb_int_mul(tmp, x);
- tmp = rb_int_modulo(tmp, m);
- }
- x = rb_int_mul(x, x);
- x = rb_int_modulo(x, m);
- }
-
- if (nega_flg && rb_int_positive_p(tmp)) {
- tmp = rb_int_minus(tmp, 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_big_rshift(y, 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_big_rshift(y, 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_int_pow(num, 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_int_negative_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_int_negative_p(m)) {
- m = rb_int_uminus(m);
- nega_flg = 1;
- }
-
- if (FIXNUM_P(m)) {
- long const half_val = (long)HALF_LONG_MSB;
- long const mm = FIX2LONG(m);
- if (!mm) rb_num_zerodiv();
- 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_bigzero_p(m)) rb_num_zerodiv();
- 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(Qnil);
+ return Qtrue;
}
/*
@@ -7176,18 +6995,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
- /* An obsolete class, use Integer */
- 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/bundle b/bin/bundle
deleted file mode 100755
index 1a0b06b005..0000000000
--- a/bin/bundle
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'bundler' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0.a"
-
-str = ARGV.first
-if str
- str = str.b[/\A_(.*)_\z/, 1]
- if str and Gem::Version.correct?(str)
- version = str
- ARGV.shift
- end
-end
-
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('bundler', 'bundle', version)
-else
-gem "bundler", version
-load Gem.bin_path("bundler", "bundle", version)
-end
diff --git a/bin/bundler b/bin/bundler
deleted file mode 100755
index e15eb39ed7..0000000000
--- a/bin/bundler
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'bundler' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0.a"
-
-str = ARGV.first
-if str
- str = str.b[/\A_(.*)_\z/, 1]
- if str and Gem::Version.correct?(str)
- version = str
- ARGV.shift
- end
-end
-
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('bundler', 'bundler', version)
-else
-gem "bundler", version
-load Gem.bin_path("bundler", "bundler", version)
-end
diff --git a/bin/erb b/bin/erb
index 2435224fe1..1ba49c9dc1 100755
--- a/bin/erb
+++ b/bin/erb
@@ -75,9 +75,8 @@ class ERB
when '-r' # require
require ARGV.req_arg
when '-S' # security level
- warn 'warning: -S option of erb command is deprecated. Please do not use this.'
arg = ARGV.req_arg
- raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-1]\z/
+ raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-3]\z/
safe_level = arg.to_i
when '-T' # trim mode
arg = ARGV.req_arg
@@ -113,26 +112,22 @@ class ERB
-v enable verbose mode
-d set $DEBUG to true
-r library load a library
+ -S safe_level set $SAFE (0..3)
-E ex[:in] set default external/internal encodings
- -U set default encoding to UTF-8
+ -U set default encoding to UTF-8.
-T trim_mode specify trim_mode (0..2, -)
- -P disable ruby code evaluation for lines beginning with %
+ -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
trim = trim_mode_opt(trim_mode, disable_percent)
- if safe_level.nil?
- erb = factory.new(src, trim_mode: trim)
- else
- # [deprecated] This will be removed at Ruby 2.7.
- erb = factory.new(src, safe_level, trim_mode: trim)
- end
+ erb = factory.new(src.untaint, safe_level, trim)
erb.filename = filename
if output
if number
@@ -143,7 +138,7 @@ EOU
puts erb.src
end
else
- bind = TOPLEVEL_BINDING
+ bind = TOPLEVEL_BINDING.taint
if variables
enc = erb.encoding
for var, val in variables do
diff --git a/bin/irb b/bin/irb
index ae6d358c9d..c64ee85fbd 100755
--- a/bin/irb
+++ b/bin/irb
@@ -1,27 +1,11 @@
#!/usr/bin/env ruby
#
-# This file was generated by RubyGems.
+# irb.rb - interactive ruby
+# $Release Version: 0.9.6 $
+# $Revision$
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
-# The application 'irb' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0.a"
-str = ARGV.first
-if str
- str = str.b[/\A_(.*)_\z/, 1]
- if str and Gem::Version.correct?(str)
- version = str
- ARGV.shift
- end
-end
+require "irb"
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('irb', 'irb', version)
-else
-gem "irb", version
-load Gem.bin_path("irb", "irb", version)
-end
+IRB.start(__FILE__)
diff --git a/bin/racc b/bin/racc
deleted file mode 100755
index 3ddac532b4..0000000000
--- a/bin/racc
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'racc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0.a"
-
-if ARGV.first
- str = ARGV.first
- str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
- if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
- version = $1
- ARGV.shift
- end
-end
-
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('racc', 'racc', version)
-else
-gem "racc", version
-load Gem.bin_path("racc", "racc", version)
-end
diff --git a/bin/racc2y b/bin/racc2y
deleted file mode 100755
index a1e4352632..0000000000
--- a/bin/racc2y
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'racc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0.a"
-
-if ARGV.first
- str = ARGV.first
- str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
- if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
- version = $1
- ARGV.shift
- end
-end
-
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('racc', 'racc2y', version)
-else
-gem "racc", version
-load Gem.bin_path("racc", "racc2y", version)
-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/bin/rdoc b/bin/rdoc
index 8fa948cddb..aaa23292df 100755
--- a/bin/rdoc
+++ b/bin/rdoc
@@ -1,27 +1,44 @@
#!/usr/bin/env ruby
#
-# This file was generated by RubyGems.
-#
-# The application 'rdoc' is installed as part of a gem, and
-# this file is here to facilitate running it.
+# RDoc: Documentation tool for source code
+# (see lib/rdoc/rdoc.rb for more information)
#
+# Copyright (c) 2003 Dave Thomas
+# Released under the same terms as Ruby
-require 'rubygems'
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
+end
-version = ">= 0.a"
+require 'rdoc/rdoc'
-str = ARGV.first
-if str
- str = str.b[/\A_(.*)_\z/, 1]
- if str and Gem::Version.correct?(str)
- version = str
- ARGV.shift
+begin
+ r = RDoc::RDoc.new
+ r.document ARGV
+rescue Errno::ENOSPC
+ $stderr.puts 'Ran out of space creating documentation'
+ $stderr.puts
+ $stderr.puts 'Please free up some space and try again'
+rescue SystemExit
+ raise
+rescue Exception => e
+ if $DEBUG_RDOC then
+ $stderr.puts e.message
+ $stderr.puts "#{e.backtrace.join "\n\t"}"
+ $stderr.puts
+ elsif Interrupt === e then
+ $stderr.puts
+ $stderr.puts 'Interrupted'
+ else
+ $stderr.puts "uh-oh! RDoc had a problem:"
+ $stderr.puts e.message
+ $stderr.puts
+ $stderr.puts "run with --debug for full backtrace"
end
-end
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('rdoc', 'rdoc', version)
-else
-gem "rdoc", version
-load Gem.bin_path("rdoc", "rdoc", version)
+ exit 1
end
+
diff --git a/bin/ri b/bin/ri
index 0cc2f73bb6..7fbed0c099 100755
--- a/bin/ri
+++ b/bin/ri
@@ -1,27 +1,12 @@
#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'rdoc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-require 'rubygems'
-
-version = ">= 0.a"
-
-str = ARGV.first
-if str
- str = str.b[/\A_(.*)_\z/, 1]
- if str and Gem::Version.correct?(str)
- version = str
- ARGV.shift
- end
+begin
+ gem 'rdoc'
+rescue NameError => e # --disable-gems
+ raise unless e.name == :gem
+rescue Gem::LoadError
end
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('rdoc', 'ri', version)
-else
-gem "rdoc", version
-load Gem.bin_path("rdoc", "ri", version)
-end
+require 'rdoc/ri/driver'
+
+RDoc::RI::Driver.run ARGV
diff --git a/bin/y2racc b/bin/y2racc
deleted file mode 100755
index 023615f369..0000000000
--- a/bin/y2racc
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'racc' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0.a"
-
-if ARGV.first
- str = ARGV.first
- str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
- if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
- version = $1
- ARGV.shift
- end
-end
-
-if Gem.respond_to?(:activate_bin_path)
-load Gem.activate_bin_path('racc', 'y2racc', version)
-else
-gem "racc", version
-load Gem.bin_path("racc", "y2racc", version)
-end
diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb
index 0959bfa2b0..744c0adac1 100644
--- a/bootstraptest/pending.rb
+++ b/bootstraptest/pending.rb
@@ -37,8 +37,3 @@ assert_normal_exit %q{
r.instance_eval { initialize r, r }
r.inspect
}
-
-# This randomly fails on mswin.
-assert_equal %q{[]}, %q{
- Thread.new{sleep}.backtrace
-}
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 56b4b12230..d58b824386 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -1,4 +1,4 @@
-"exec" "${RUBY-ruby}" "-x" "$0" "$@" || true # -*- Ruby -*-
+"exec" "${RUBY-ruby}" "-x" "$0" "$@" || true # -*- mode: ruby; coding: utf-8 -*-
#!./ruby
# $Id$
@@ -6,7 +6,6 @@
# Never use optparse in this file.
# Never use test/unit in this file.
# Never use Ruby extensions in this file.
-# Maintain Ruby 1.8 compatibility for now
begin
require 'fileutils'
@@ -61,7 +60,6 @@ end
def main
@ruby = File.expand_path('miniruby')
@verbose = false
- $VERBOSE = false
$stress = false
@color = nil
@tty = nil
@@ -138,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__, "../tool/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 = ""
@@ -171,8 +163,8 @@ End
end
def erase(e = true)
- if e and @columns > 0 and @tty and !@verbose
- "\e[1K\r"
+ if e and @columns > 0 and !@verbose
+ "\r#{" "*@columns}\r"
else
""
end
@@ -208,9 +200,6 @@ def exec_test(pathes)
$stderr.puts unless @quiet and @tty and @error == error
end
$stderr.print(erase) if @quiet
- @errbuf.each do |msg|
- $stderr.puts msg
- end
if @error == 0
if @count == 0
$stderr.puts "No tests, no problem"
@@ -219,6 +208,9 @@ def exec_test(pathes)
end
exit true
else
+ @errbuf.each do |msg|
+ $stderr.puts msg
+ end
$stderr.puts "#{@failed}FAIL#{@reset} #{@error}/#{@count} tests failed"
exit false
end
@@ -244,7 +236,7 @@ def show_progress(message = '')
else
$stderr.print "#{@failed}F"
$stderr.printf(" %.3f", t) if @verbose
- $stderr.print @reset
+ $stderr.print "#{@reset}"
$stderr.puts if @verbose
error faildesc, message
unless errout.empty?
@@ -255,34 +247,30 @@ def show_progress(message = '')
end
end
rescue Interrupt
- $stderr.puts "\##{@count} #{@location}"
- raise
+ raise Interrupt
rescue Exception => err
$stderr.print 'E'
$stderr.puts if @verbose
error err.message, message
end
-def show_limit(testsrc, opt = '', **argh)
- result = get_result_string(testsrc, opt, **argh)
- if @tty and @verbose
- $stderr.puts ".{#@reset}\n#{erase}#{result}"
- else
- @errbuf.push result
- end
+# 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 = '', **argh)
+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
@@ -323,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)
@@ -376,9 +367,6 @@ def assert_normal_exit(testsrc, *rest, timeout: nil, **opt)
end
def assert_finish(timeout_seconds, testsrc, message = '')
- if RubyVM.const_defined? :MJIT
- timeout_seconds *= 3 if RubyVM::MJIT.enabled? # for --jit-wait
- end
newtest
show_progress(message) {
faildesc = nil
@@ -387,24 +375,12 @@ def assert_finish(timeout_seconds, testsrc, message = '')
pid = io.pid
waited = false
tlimit = Time.now + timeout_seconds
- diff = timeout_seconds
- while diff > 0
+ while Time.now < tlimit
if Process.waitpid pid, Process::WNOHANG
waited = true
break
end
- if io.respond_to?(:read_nonblock)
- if IO.select([io], nil, nil, diff)
- begin
- io.read_nonblock(1024)
- rescue Errno::EAGAIN, IO::WaitReadable, EOFError
- break
- end while true
- end
- else
- sleep 0.1
- end
- diff = tlimit - Time.now
+ sleep 0.1
end
if !waited
Process.kill(:KILL, pid)
@@ -422,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
@@ -436,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_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 fa04323b7f..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 %{
@@ -190,8 +190,7 @@ assert_equal %q{[10, main]}, %q{
}
%w[break next redo].each do |keyword|
- assert_match %r"Can't escape from eval with #{keyword}\b", %{
- STDERR.reopen(STDOUT)
+ assert_match %r"Can't escape from eval with #{keyword}\z", %{
begin
eval "0 rescue #{keyword}"
rescue SyntaxError => e
diff --git a/bootstraptest/test_exception.rb b/bootstraptest/test_exception.rb
index 0fb6f552b8..35c8d25e37 100644
--- a/bootstraptest/test_exception.rb
+++ b/bootstraptest/test_exception.rb
@@ -402,7 +402,7 @@ assert_equal 'nil', %q{
exc.inspect
}, '[ruby-dev:32608]'
-assert_equal 'divided by 0', %q{
+assert_equal 'exception class/object expected', %q{
class ZeroDivisionError
def self.new(message)
42
diff --git a/bootstraptest/test_fiber.rb b/bootstraptest/test_fiber.rb
deleted file mode 100644
index 35e1bf6851..0000000000
--- a/bootstraptest/test_fiber.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-show_limit %q{
- fibers = []
- begin
- fiber = Fiber.new{Fiber.yield}
- fiber.resume
- fibers << fiber
-
- raise Exception, "skipping" if fibers.count >= 10_000
- rescue Exception => error
- puts "Fiber count: #{fibers.count} (#{error})"
- break
- end while true
-}
-
-assert_equal %q{ok}, %q{
- Fiber.new{
- }.resume
- :ok
-}
-
-assert_equal %q{ok}, %q{
- 10_000.times.collect{Fiber.new{}}
- :ok
-}
-
-assert_equal %q{ok}, %q{
- fibers = 100.times.collect{Fiber.new{Fiber.yield}}
- fibers.each(&:resume)
- fibers.each(&:resume)
- :ok
-}
-
-assert_normal_exit %q{
- at_exit { Fiber.new{}.resume }
-}
-
-assert_normal_exit %q{
- Fiber.new(&Object.method(:class_eval)).resume("foo")
-}, '[ruby-dev:34128]'
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 83923dad97..5de6ee1b12 100644
--- a/bootstraptest/test_fork.rb
+++ b/bootstraptest/test_fork.rb
@@ -21,12 +21,10 @@ assert_finish 10, %q{
end
}, '[ruby-core:22158]'
-# temporarily stop this test to enable explicit failure when
-# timer thread couldn't be created (r61706 and r61717).
-assert_normal_exit(<<'End', '[ruby-dev:37934]') if false
+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 1269d7d013..0000000000
--- a/bootstraptest/test_insns.rb
+++ /dev/null
@@ -1,440 +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
- if defined? RbConfig::LIMITS
- $FIXNUM_MAX = RbConfig::LIMITS["FIXNUM_MAX"]
- $FIXNUM_MIN = RbConfig::LIMITS["FIXNUM_MIN"]
- end
-end
-
-fsl = { frozen_string_literal: true } # used later
-tests = [
- # insn , expression to generate such insn
- [ 'nop', %q{ raise rescue 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 }.() }.() }, ],
-
- [ 'setblockparam', <<-'},', ], # {
- def m&b
- b = # here
- proc { true }
- end
- m { false }.call
- },
- [ 'getblockparam', <<-'},', ], # {
- def m&b
- b # here
- end
- m { true }.call
- },
- [ 'getblockparamproxy', <<-'},', ], # {
- def m&b
- b # here
- .call
- end
- m { true }
- },
-
- [ '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" && $~ }, ],
- [ 'intern', %q{ :"#{true}" }, ],
-
- [ 'newarray', %q{ ["true"][0] }, ],
- [ 'newarraykwsplat', %q{ [**{x:'true'}][0][:x] }, ],
- [ '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] }, ],
- [ 'newhashfromarray', %q{ { a: true }[:a] }, ],
- [ '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 }, ],
- [ '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 }, ],
- [ 'checktype', %q{ x = true; "#{x}" }, ],
- [ '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_nil_p', %q{ nil.nil? }, ],
- [ 'opt_nil_p', %q{ !Object.nil? }, ],
- [ 'opt_nil_p', %q{ Class.new{def nil?; true end}.new.nil? }, ],
- [ '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_regexpmatch2', %q{ /true/ =~ 'true' && $~ }, ],
- [ 'opt_regexpmatch2', <<-'},', ], # {
- 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/
- },
-
- [ 'opt_call_c_function', 'Struct.new(:x).new.x = true', ],
-]
-
-# normal path
-tests.compact.each do |(insn, expr, *a)|
- if a.last.is_a?(Hash)
- a = a.dup
- kw = a.pop
- assert_equal 'true', expr, insn, *a, **kw
- else
- assert_equal 'true', expr, insn, *a
- end
-end
-
-# with trace
-tests.compact.each {|(insn, expr, *a)|
- progn = "set_trace_func(proc{})\n" + expr
- if a.last.is_a?(Hash)
- a = a.dup
- kw = a.pop
- assert_equal 'true', progn, 'trace_' + insn, *a, **kw
- else
- assert_equal 'true', progn, 'trace_' + insn, *a
- end
-}
diff --git a/bootstraptest/test_io.rb b/bootstraptest/test_io.rb
index 89c00d0b88..1d2b19368a 100644
--- a/bootstraptest/test_io.rb
+++ b/bootstraptest/test_io.rb
@@ -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_jump.rb b/bootstraptest/test_jump.rb
index 7944915862..595aaa7c4b 100644
--- a/bootstraptest/test_jump.rb
+++ b/bootstraptest/test_jump.rb
@@ -146,16 +146,15 @@ assert_equal %q{131}, %q{
end
}
}
-assert_match %r{Invalid retry}, %q{
-STDERR.reopen(STDOUT)
+assert_equal %q{ok}, %q{
begin
eval %q{
1.times{
retry
}
}
-rescue SyntaxError => e
- e.message
+rescue SyntaxError
+ :ok
end
}
assert_equal %q{3}, %q{
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_literal_suffix.rb b/bootstraptest/test_literal_suffix.rb
index c36fa7078f..4316c9e040 100644
--- a/bootstraptest/test_literal_suffix.rb
+++ b/bootstraptest/test_literal_suffix.rb
@@ -46,9 +46,9 @@ assert_equal '1', '1rescue nil'
assert_equal '10000000000000000001/10000000000000000000',
'1.0000000000000000001r'
-assert_equal 'syntax error, unexpected local variable or method, expecting end-of-input',
+assert_equal 'syntax error, unexpected tIDENTIFIER, expecting end-of-input',
%q{begin eval('1ir', nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end}
-assert_equal 'syntax error, unexpected local variable or method, expecting end-of-input',
+assert_equal 'syntax error, unexpected tIDENTIFIER, expecting end-of-input',
%q{begin eval('1.2ir', nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end}
-assert_equal 'syntax error, unexpected local variable or method, expecting end-of-input',
+assert_equal 'syntax error, unexpected tIDENTIFIER, expecting end-of-input',
%q{begin eval('1e1r', nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end}
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 63a8d99322..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]'
@@ -44,12 +44,3 @@ assert_normal_exit %q{
Thread.new {}
end
}, '[ruby-core:37858]'
-
-assert_equal 'ok', %q{
- objects_and_ids = 1000.times.map { o = Object.new; [o, o.object_id] }
- objects_and_ids.each { |expected, id|
- actual = ObjectSpace._id2ref(id)
- raise "expected #{expected.inspect}, got #{actual.inspect}" unless actual.equal?(expected)
- }
- 'ok'
-}
diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb
index 1e384411dc..c23394e8d2 100644
--- a/bootstraptest/test_proc.rb
+++ b/bootstraptest/test_proc.rb
@@ -224,14 +224,14 @@ assert_equal %q{[[nil, []], [1, []], [1, [2]], [1, [2, 3]]]}, %q{
Proc.new{|a, *b| [a, b]}.call(1, 2, 3),
]
}
-assert_equal %q{1}, %q{
+assert_equal %q{0}, %q{
pr = proc{
$SAFE
}
$SAFE = 1
pr.call
}
-assert_equal %q{[1, 1]}, %q{
+assert_equal %q{[1, 0]}, %q{
pr = proc{
$SAFE += 1
}
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 f00e2f7efc..d64f44be49 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -1,14 +1,5 @@
-show_limit %q{
- threads = []
- begin
- threads << Thread.new{sleep}
+# Thread and Fiber
- raise Exception, "skipping" if threads.count >= 10_000
- rescue Exception => error
- puts "Thread count: #{threads.count} (#{error})"
- break
- end while true
-}
assert_equal %q{ok}, %q{
Thread.new{
}.join
@@ -34,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{
}
@@ -44,13 +34,9 @@ begin
e.join()
}
}
-rescue ThreadError => e
- /can't create Thread/ =~ e.message ? :ok : 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{
}
@@ -58,9 +44,6 @@ begin
e.join(1000000000)
}
}
-rescue ThreadError => e
- /can't create Thread/ =~ e.message ? :ok : e.message
-end
}
assert_equal %q{ok}, %q{
begin
@@ -308,6 +291,10 @@ assert_equal 'ok', %q{
}, '[ruby-dev:34492]'
assert_normal_exit %q{
+ at_exit { Fiber.new{}.resume }
+}
+
+assert_normal_exit %q{
g = enum_for(:local_variables)
loop { g.next }
}, '[ruby-dev:34128]'
@@ -333,6 +320,10 @@ assert_normal_exit %q{
}, '[ruby-dev:34128]'
assert_normal_exit %q{
+ Fiber.new(&Object.method(:class_eval)).resume("foo")
+}, '[ruby-dev:34128]'
+
+assert_normal_exit %q{
Thread.new("foo", &Object.method(:class_eval)).join
}, '[ruby-dev:34128]'
@@ -348,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
@@ -359,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
@@ -410,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?
@@ -438,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/builtin.c b/builtin.c
deleted file mode 100644
index 6de77228d0..0000000000
--- a/builtin.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "internal.h"
-#include "vm_core.h"
-#include "iseq.h"
-#include "builtin.h"
-
-#if CROSS_COMPILING
-
-#define INCLUDED_BY_BUILTIN_C 1
-#include "mini_builtin.c"
-
-#else
-
-#include "builtin_binary.inc"
-
-static const unsigned char*
-builtin_lookup(const char *feature, size_t *psize)
-{
- static int index = 0;
- int i = index++;
-
- // usually, `builtin_binary` order is loading order at miniruby.
- if (LIKELY(strcmp(builtin_binary[i].feature, feature) == 0)) {
- found:
- *psize = builtin_binary[i].bin_size;
- return builtin_binary[i].bin;
- }
- else {
- if (0) fprintf(stderr, "builtin_lookup: cached index miss (index:%d)\n", i);
- for (i=0; i<BUILTIN_BINARY_SIZE; i++) {
- if (strcmp(builtin_binary[i].feature, feature) == 0) {
- goto found;
- }
- }
- }
- rb_bug("builtin_lookup: can not find %s\n", feature);
-}
-
-void
-rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table)
-{
- // search binary
- size_t size;
- const unsigned char *bin = builtin_lookup(feature_name, &size);
-
- // load binary
- rb_vm_t *vm = GET_VM();
- if (vm->builtin_function_table != NULL) rb_bug("vm->builtin_function_table should be NULL.");
- vm->builtin_function_table = table;
- vm->builtin_inline_index = 0;
- const rb_iseq_t *iseq = rb_iseq_ibf_load_bytes((const char *)bin, size);
- vm->builtin_function_table = NULL;
-
- // exec
- rb_iseq_eval(rb_iseq_check(iseq));
-}
-
-#endif
-
-void
-Init_builtin(void)
-{
- // nothing
-}
-
-void
-Init_builtin_features(void)
-{
- rb_load_with_builtin_functions("gem_prelude", NULL);
-}
diff --git a/builtin.h b/builtin.h
deleted file mode 100644
index f4d485e08d..0000000000
--- a/builtin.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef BUILTIN_H_INCLUDED
-#define BUILTIN_H_INCLUDED
-
-// invoke
-
-struct rb_builtin_function {
- // for invocation
- const void * const func_ptr;
- const int argc;
-
- // for load
- const int index;
- const char * const name;
-};
-
-#define RB_BUILTIN_FUNCTION(_i, _name, _fname, _arity) { \
- .name = #_name, \
- .func_ptr = (void *)_fname, \
- .argc = _arity, \
- .index = _i \
-}
-
-void rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table);
-
-#ifndef VM_CORE_H_EC_DEFINED
-typedef struct rb_execution_context_struct rb_execution_context_t;
-#endif
-
-/* The following code is generated by the following Ruby script:
-
-16.times{|i|
- args = (i > 0 ? ', ' : '') + (0...i).map{"VALUE"}.join(', ')
- puts "static inline void rb_builtin_function_check_arity#{i}(VALUE (*f)(rb_execution_context_t *ec, VALUE self#{args})){}"
-}
-*/
-
-static inline void rb_builtin_function_check_arity0(VALUE (*f)(rb_execution_context_t *ec, VALUE self)){}
-static inline void rb_builtin_function_check_arity1(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE)){}
-static inline void rb_builtin_function_check_arity2(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity3(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity4(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity5(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity6(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity7(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity8(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity9(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity10(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity11(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity12(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity13(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity14(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-static inline void rb_builtin_function_check_arity15(VALUE (*f)(rb_execution_context_t *ec, VALUE self, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)){}
-
-VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index);
-
-// __builtin_inline!
-
-PUREFUNC(static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index));
-
-static inline VALUE
-rb_vm_lvar(rb_execution_context_t *ec, int index)
-{
-#if VM_CORE_H_EC_DEFINED
- return ec->cfp->ep[index];
-#else
- return rb_vm_lvar_exposed(ec, index);
-#endif
-}
-
-// dump/load
-
-struct builtin_binary {
- const char *feature; // feature name
- const unsigned char *bin; // binary by ISeq#to_binary
- size_t bin_size;
-};
-
-#endif // BUILTIN_H_INCLUDED
diff --git a/ccan/list/list.h b/ccan/list/list.h
index 7d219307bc..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
@@ -57,7 +57,7 @@ struct list_head
* Example:
* static struct list_head my_list = LIST_HEAD_INIT(my_list);
*/
-#define LIST_HEAD_INIT(name) { { &(name).n, &(name).n } }
+#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
/**
* LIST_HEAD - define and initialize 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);
}
/**
@@ -238,21 +188,6 @@ static inline int list_empty_nodebug(const struct list_head *h)
#endif
/**
- * list_empty_nocheck - is a list empty?
- * @h: the list_head
- *
- * If the list is empty, returns true. This doesn't perform any
- * debug check for list consistency, so it can be called without
- * locks, racing with the list being modified. This is ok for
- * checks where an incorrect result is not an issue (optimized
- * bail out path for example).
- */
-static inline bool list_empty_nocheck(const struct list_head *h)
-{
- return h->n.next == &h->n;
-}
-
-/**
* list_del - delete an entry from an (unknown) linked list.
* @n: the list_node to delete from the list.
*
@@ -330,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
@@ -483,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
@@ -519,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--;
@@ -633,28 +516,10 @@ 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
- * @i: the pointer to a memory region which contains list node data.
+ * @i: the pointer to a memory region wich contains list node data.
* @off: offset(relative to @i) at which list node data resides.
*
* This is a low-level wrapper to iterate @i over the entire list, used to
@@ -662,12 +527,12 @@ static inline void list_prepend_list_(struct list_head *to,
* so you can break and continue as normal.
*
* WARNING! Being the low-level macro that it is, this wrapper doesn't know
- * nor care about the type of @i. The only assumption made is that @i points
+ * nor care about the type of @i. The only assumtion made is that @i points
* to a chunk of memory that at some @offset, relative to @i, contains a
- * properly filled `struct list_node' which in turn contains pointers to
- * memory chunks and it's turtles all the way down. With all that in mind
+ * properly filled `struct node_list' which in turn contains pointers to
+ * memory chunks and it's turtles all the way down. Whith all that in mind
* remember that given the wrong pointer/offset couple this macro will
- * happily churn all you memory until SEGFAULT stops it, in other words
+ * happilly churn all you memory untill SEGFAULT stops it, in other words
* caveat emptor.
*
* It is worth mentioning that one of legitimate use-cases for that wrapper
@@ -681,24 +546,17 @@ 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 which 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
* during deletion
* @h: the list_head
- * @i: the pointer to a memory region which contains list node data.
+ * @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.
*
@@ -711,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 which 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 c866d1d727..f142f4472a 100644
--- a/class.c
+++ b/class.c
@@ -25,9 +25,9 @@
#include "internal.h"
#include "ruby/st.h"
+#include "method.h"
#include "constant.h"
#include "vm_core.h"
-#include "id_table.h"
#include <ctype.h>
#define id_attached id__attached__
@@ -110,7 +110,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 +119,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);
}
/**
@@ -163,30 +151,24 @@ 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);
+ 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();
- RB_OBJ_WRITE(obj, &RCLASS_REFINED_CLASS(obj), Qnil);
- RCLASS_EXT(obj)->allocator = 0;
+ 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.
@@ -205,6 +187,7 @@ rb_class_boot(VALUE super)
RCLASS_SET_SUPER(klass, super);
RCLASS_M_TBL_INIT(klass);
+ OBJ_INFECT(klass, super);
return (VALUE)klass;
}
@@ -219,8 +202,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");
@@ -246,34 +229,34 @@ 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));
+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);
+ rb_vm_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
@@ -284,14 +267,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
@@ -312,12 +295,6 @@ class_init_copy_check(VALUE clone, VALUE orig)
VALUE
rb_mod_init_copy(VALUE clone, VALUE orig)
{
- /* cloned flag is refer at constant inline cache
- * see vm_get_const_key_cref() in vm_insnhelper.c
- */
- FL_SET(clone, RCLASS_CLONED);
- FL_SET(orig , RCLASS_CLONED);
-
if (RB_TYPE_P(clone, T_CLASS)) {
class_init_copy_check(clone, orig);
}
@@ -336,11 +313,14 @@ 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;
- rb_iv_tbl_copy(clone, orig);
+ RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(orig));
CONST_ID(id, "__tmp_classpath__");
st_delete(RCLASS_IV_TBL(clone), &id, 0);
CONST_ID(id, "__classpath__");
@@ -351,16 +331,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;
@@ -375,7 +353,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;
@@ -393,24 +371,20 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
RCLASS_SET_SUPER(clone, RCLASS_SUPER(klass));
RCLASS_EXT(clone)->allocator = RCLASS_EXT(klass)->allocator;
if (RCLASS_IV_TBL(klass)) {
- rb_iv_tbl_copy(clone, klass);
+ RCLASS_IV_TBL(clone) = rb_st_copy(clone, RCLASS_IV_TBL(klass));
}
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);
@@ -429,7 +403,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);
}
}
@@ -445,19 +419,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
@@ -465,7 +426,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.
@@ -510,6 +471,8 @@ make_metaclass(VALUE klass)
while (RB_TYPE_P(super, T_ICLASS)) super = RCLASS_SUPER(super);
RCLASS_SET_SUPER(metaclass, super ? ENSURE_EIGENCLASS(super) : rb_cClass);
+ OBJ_INFECT(metaclass, RCLASS_SUPER(metaclass));
+
return metaclass;
}
@@ -540,8 +503,8 @@ boot_defclass(const char *name, VALUE super)
VALUE obj = rb_class_boot(super);
ID id = rb_intern(name);
+ rb_name_class(obj, id);
rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
- rb_vm_add_root_module(id, obj);
return obj;
}
@@ -550,11 +513,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_set_class_path_string(rb_cObject, rb_cObject, rb_fstring_lit("Object"));
-
rb_cModule = boot_defclass("Module", rb_cObject);
rb_cClass = boot_defclass("Class", rb_cModule);
@@ -619,7 +577,7 @@ rb_define_class_id(ID id, VALUE super)
* \return the value \c Class#inherited's returns
* \pre Each of \a super and \a klass must be a \c Class object.
*/
-MJIT_FUNC_EXPORTED VALUE
+VALUE
rb_class_inherited(VALUE super, VALUE klass)
{
ID inherited;
@@ -634,12 +592,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
@@ -655,22 +613,19 @@ 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);
}
-
- /* Class may have been defined in Ruby and not pin-rooted */
- rb_vm_add_root_module(id, klass);
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);
+ rb_name_class(klass, id);
rb_const_set(rb_cObject, id, klass);
rb_class_inherited(super, klass);
@@ -687,7 +642,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.
*
@@ -710,7 +665,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.
*
@@ -725,30 +680,21 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
if (rb_const_defined_at(outer, id)) {
klass = rb_const_get_at(outer, id);
if (!RB_TYPE_P(klass, T_CLASS)) {
- rb_raise(rb_eTypeError, "%"PRIsVALUE"::%"PRIsVALUE" is not a class"
- " (%"PRIsVALUE")",
- outer, rb_id2str(id), rb_obj_class(klass));
+ rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a class", rb_id2str(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, "%"PRIsVALUE" is already defined", rb_id2str(id));
}
- /* Class may have been defined in Ruby and not pin-rooted */
- rb_vm_add_root_module(id, klass);
-
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 `%"PRIsVALUE"::%"PRIsVALUE"', Object assumed",
+ rb_class_path(outer), rb_id2str(id));
}
klass = rb_define_class_id(id, super);
rb_set_class_path_string(klass, outer, rb_id2str(id));
rb_const_set(outer, id, klass);
rb_class_inherited(super, klass);
- rb_vm_add_root_module(id, klass);
rb_gc_register_mark_object(klass);
return klass;
@@ -765,7 +711,12 @@ rb_module_new(void)
VALUE
rb_define_module_id(ID id)
{
- return rb_module_new();
+ VALUE mdl;
+
+ mdl = rb_module_new();
+ rb_name_class(mdl, id);
+
+ return mdl;
}
VALUE
@@ -777,17 +728,12 @@ 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));
- }
- /* Module may have been defined in Ruby and not pin-rooted */
- rb_vm_add_root_module(id, 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);
- rb_gc_register_mark_object(module);
rb_const_set(rb_cObject, id, module);
return module;
@@ -806,12 +752,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,10 +770,6 @@ rb_include_class_new(VALUE module, VALUE super)
{
VALUE klass = class_alloc(T_ICLASS, rb_cClass);
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(klass)) =
- RCLASS_M_TBL(OBJ_WB_UNPROTECT(module)); /* TODO: unprotected? */
-
- RCLASS_SET_ORIGIN(klass, module == RCLASS_ORIGIN(module) ? klass : RCLASS_ORIGIN(module));
if (BUILTIN_TYPE(module) == T_ICLASS) {
module = RBASIC(module)->klass;
}
@@ -837,11 +777,14 @@ 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_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)) {
RBASIC_SET_CLASS(klass, RBASIC(module)->klass);
@@ -849,99 +792,91 @@ rb_include_class_new(VALUE module, VALUE super)
else {
RBASIC_SET_CLASS(klass, module);
}
+ OBJ_INFECT(klass, module);
+ OBJ_INFECT(klass, 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_class_modify_check(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");
- }
-}
+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 void ensure_origin(VALUE klass);
-
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));
-
- if (FL_TEST(module, RCLASS_REFINED_BY_ANY)) {
- ensure_origin(module);
- }
+ 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;
if (klass_m_tbl && klass_m_tbl == RCLASS_M_TBL(module))
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);
- RCLASS_SET_INCLUDER(iclass, klass);
- {
- 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);
}
@@ -952,57 +887,58 @@ 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;
}
}
-static void
-ensure_origin(VALUE klass)
+void
+rb_prepend_module(VALUE klass, VALUE module)
{
- VALUE origin = RCLASS_ORIGIN(klass);
+ VALUE origin;
+ int changed = 0;
+
+ rb_frozen_class_p(klass);
+
+ Check_Type(module, T_MODULE);
+
+ OBJ_INFECT(klass, module);
+
+ origin = RCLASS_ORIGIN(klass);
if (origin == klass) {
origin = class_alloc(T_ICLASS, klass);
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);
+ RB_OBJ_WRITE(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));
}
-}
-
-void
-rb_prepend_module(VALUE klass, VALUE module)
-{
- int changed = 0;
-
- ensure_includable(klass, module);
- ensure_origin(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) {
@@ -1101,62 +1037,62 @@ rb_mod_ancestors(VALUE mod)
VALUE p, ary = rb_ary_new();
for (p = mod; p; p = RCLASS_SUPER(p)) {
- if (p != RCLASS_ORIGIN(p)) continue;
if (BUILTIN_TYPE(p) == T_ICLASS) {
rb_ary_push(ary, RBASIC(p)->klass);
}
- else {
+ else if (p == RCLASS_ORIGIN(p)) {
rb_ary_push(ary, p);
}
}
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 {
@@ -1164,64 +1100,45 @@ struct method_entry_arg {
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;
+ 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) {
+ VALUE klass = me->klass;
+ me = rb_resolve_refined_method(Qnil, me, NULL);
+ if (!me) return ST_CONTINUE;
+ if (!arg->recur && me->klass != klass) return ST_CONTINUE;
}
- if (!st_is_member(arg->list, key)) {
+ if (!st_lookup(arg->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(arg->list, key, type);
}
- return ID_TABLE_CONTINUE;
-}
-
-static void
-add_instance_method_list(VALUE mod, struct method_entry_arg *me_arg)
-{
- struct rb_id_table *m_tbl = RCLASS_M_TBL(mod);
- if (!m_tbl) return;
- rb_id_table_foreach(m_tbl, method_entry_i, me_arg);
-}
-
-static bool
-particular_class_p(VALUE mod)
-{
- if (!mod) return false;
- if (FL_TEST(mod, FL_SINGLETON)) return true;
- if (BUILTIN_TYPE(mod) == T_ICLASS) return true;
- return false;
+ return ST_CONTINUE;
}
static VALUE
class_instance_method_list(int argc, const VALUE *argv, VALUE mod, int obj, int (*func) (st_data_t, st_data_t, st_data_t))
{
VALUE ary;
- int recur = TRUE, prepended = 0;
+ int recur, prepended = 0;
struct method_entry_arg me_arg;
- if (rb_check_arity(argc, 0, 1)) recur = RTEST(argv[0]);
-
- me_arg.list = st_init_numtable();
- me_arg.recur = recur;
-
- if (obj) {
- for (; particular_class_p(mod); mod = RCLASS_SUPER(mod)) {
- add_instance_method_list(mod, &me_arg);
- }
+ if (argc == 0) {
+ recur = TRUE;
+ }
+ else {
+ VALUE r;
+ rb_scan_args(argc, argv, "01", &r);
+ recur = RTEST(r);
}
if (!recur && RCLASS_ORIGIN(mod) != mod) {
@@ -1229,12 +1146,15 @@ 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;
for (; mod; mod = RCLASS_SUPER(mod)) {
- add_instance_method_list(mod, &me_arg);
+ if (RCLASS_M_TBL(mod)) st_foreach(RCLASS_M_TBL(mod), method_entry_i, (st_data_t)&me_arg);
if (BUILTIN_TYPE(mod) == T_ICLASS && !prepended) continue;
+ if (obj && FL_TEST(mod, FL_SINGLETON)) continue;
if (!recur) break;
}
- ary = rb_ary_new2(me_arg.list->num_entries);
+ ary = rb_ary_new();
st_foreach(me_arg.list, func, ary);
st_free_table(me_arg.list);
@@ -1335,7 +1255,7 @@ rb_class_public_instance_methods(int argc, const VALUE *argv, VALUE mod)
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
* If the optional parameter is <code>false</code>, it
- * returns an array of <i>obj</i>'s public and protected singleton methods,
+ * returns an array of <i>obj<i>'s public and protected singleton methods,
* the array will not include methods in modules included in <i>obj</i>.
*
* class Klass
@@ -1448,30 +1368,33 @@ rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj)
VALUE
rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
{
- VALUE ary, klass, origin;
+ VALUE recur, ary, klass, origin;
struct method_entry_arg me_arg;
- struct rb_id_table *mtbl;
- int recur = TRUE;
+ st_table *mtbl;
- if (rb_check_arity(argc, 0, 1)) recur = RTEST(argv[0]);
- if (RB_TYPE_P(obj, T_CLASS) && FL_TEST(obj, FL_SINGLETON)) {
- rb_singleton_class(obj);
+ if (argc == 0) {
+ recur = Qtrue;
+ }
+ else {
+ rb_scan_args(argc, argv, "01", &recur);
}
klass = CLASS_OF(obj);
origin = RCLASS_ORIGIN(klass);
me_arg.list = st_init_numtable();
- me_arg.recur = recur;
+ me_arg.recur = RTEST(recur);
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)&me_arg);
klass = RCLASS_SUPER(klass);
}
- if (recur) {
+ 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)&me_arg);
klass = RCLASS_SUPER(klass);
}
}
- ary = rb_ary_new2(me_arg.list->num_entries);
+ ary = rb_ary_new();
st_foreach(me_arg.list, ins_methods_i, ary);
st_free_table(me_arg.list);
@@ -1535,63 +1458,34 @@ rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj)
* \{
*/
-#ifdef rb_define_method_id
-#undef rb_define_method_id
-#endif
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);
}
-#ifdef rb_define_method
-#undef rb_define_method
-#endif
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);
}
-#ifdef rb_define_protected_method
-#undef rb_define_protected_method
-#endif
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);
}
-#ifdef rb_define_private_method
-#undef rb_define_private_method
-#endif
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);
}
/*!
@@ -1651,21 +1545,22 @@ singleton_class_of(VALUE obj)
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;
}
}
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;
}
- RB_FL_SET_RAW(klass, RB_OBJ_FROZEN_RAW(obj));
+ if (OBJ_TAINTED(obj)) {
+ OBJ_TAINT(klass);
+ }
+ else {
+ FL_UNSET(klass, FL_TAINT);
+ }
+ if (OBJ_FROZEN(obj)) OBJ_FREEZE_RAW(klass);
return klass;
}
@@ -1708,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.
@@ -1741,9 +1636,6 @@ rb_singleton_class(VALUE obj)
* \{
*/
-#ifdef rb_define_singleton_method
-#undef rb_define_singleton_method
-#endif
/*!
* Defines a singleton method for \a obj.
* \param obj an arbitrary object
@@ -1757,9 +1649,8 @@ rb_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS),
rb_define_method(singleton_class_of(obj), name, func, argc);
}
-#ifdef rb_define_module_function
-#undef rb_define_module_function
-#endif
+
+
/*!
* Defines a module function for \a module.
* \param module an module or a class.
@@ -1774,9 +1665,7 @@ rb_define_module_function(VALUE module, const char *name, VALUE (*func)(ANYARGS)
rb_define_singleton_method(module, name, func, argc);
}
-#ifdef rb_define_global_function
-#undef rb_define_global_function
-#endif
+
/*!
* Defines a global function
* \param name name of the function
@@ -1815,21 +1704,166 @@ rb_define_attr(VALUE klass, const char *name, int read, int write)
rb_attr(klass, rb_intern(name), read, write, FALSE);
}
-MJIT_FUNC_EXPORTED VALUE
-rb_keyword_error_new(const char *error, VALUE keys)
+int
+rb_obj_basic_to_s_p(VALUE obj)
{
- long i = 0, len = RARRAY_LEN(keys);
- VALUE error_message = rb_sprintf("%s keyword%.*s", error, len > 1, "s");
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"), 0);
+ if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
+ me->def->body.cfunc.func == rb_any_to_s)
+ return 1;
+ return 0;
+}
+
+#include <stdarg.h>
+
+int
+rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
+{
+ int i;
+ const char *p = fmt;
+ VALUE *var;
+ 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;
+ VALUE hash = Qnil;
+
+ if (ISDIGIT(*p)) {
+ n_lead = *p - '0';
+ p++;
+ 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++;
+ }
+ }
+ block_arg:
+ if (*p == ':') {
+ f_hash = 1;
+ p++;
+ }
+ if (*p == '&') {
+ f_block = 1;
+ p++;
+ }
+ if (*p != '\0') {
+ rb_fatal("bad scan arg format: %s", fmt);
+ }
+ n_mand = n_lead + n_trail;
+
+ if (argc < n_mand)
+ goto argc_error;
+
+ va_start(vargs, fmt);
- if (len > 0) {
- rb_str_cat_cstr(error_message, ": ");
- while (1) {
- const VALUE k = RARRAY_AREF(keys, i);
- rb_str_append(error_message, rb_inspect(k));
- if (++i >= len) break;
- rb_str_cat_cstr(error_message, ", ");
+ /* capture an option hash - phase 1: pop */
+ if (f_hash && n_mand < argc) {
+ VALUE last = argv[argc - 1];
+
+ if (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 (!NIL_P(hash)) {
+ VALUE opts = rb_extract_keywords(&hash);
+ if (!hash) argc--;
+ hash = opts ? opts : Qnil;
+ }
+ }
+ }
+ /* capture leading mandatory arguments */
+ for (i = n_lead; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ 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 = argv[argi];
+ argi++;
+ }
+ else {
+ if (var) *var = Qnil;
+ }
+ }
+ /* capture variable length arguments */
+ if (f_var) {
+ int n_var = argc - argi - n_trail;
+
+ var = va_arg(vargs, VALUE *);
+ if (0 < n_var) {
+ if (var) *var = rb_ary_new4(n_var, &argv[argi]);
+ argi += n_var;
+ }
+ else {
+ if (var) *var = rb_ary_new();
+ }
+ }
+ /* capture trailing mandatory arguments */
+ for (i = n_trail; i-- > 0; ) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = argv[argi];
+ argi++;
+ }
+ /* capture an option hash - phase 2: assignment */
+ if (f_hash) {
+ var = va_arg(vargs, VALUE *);
+ if (var) *var = hash;
+ }
+ /* capture iterator block */
+ if (f_block) {
+ var = va_arg(vargs, VALUE *);
+ if (rb_block_given_p()) {
+ *var = rb_block_proc();
+ }
+ else {
+ *var = Qnil;
}
}
+ va_end(vargs);
+
+ if (argi < argc) {
+ argc_error:
+ rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
+ }
+
+ return argc;
+}
+
+VALUE
+rb_keyword_error_new(const char *error, VALUE keys)
+{
+ const char *msg = "";
+ VALUE error_message;
+
+ if (RARRAY_LEN(keys) == 1) {
+ keys = RARRAY_AREF(keys, 0);
+ }
+ else {
+ keys = rb_ary_join(keys, rb_usascii_str_new2(", "));
+ msg = "s";
+ }
+
+ error_message = rb_sprintf("%s keyword%s: %"PRIsVALUE, error, msg, keys);
return rb_exc_new_str(rb_eArgError, error_message);
}
@@ -1845,19 +1879,23 @@ NORETURN(static void unknown_keyword_error(VALUE hash, const ID *table, int keyw
static void
unknown_keyword_error(VALUE hash, const ID *table, int keywords)
{
+ st_table *tbl = rb_hash_tbl_raw(hash);
+ VALUE keys;
int i;
for (i = 0; i < keywords; i++) {
st_data_t key = ID2SYM(table[i]);
- rb_hash_stlike_delete(hash, &key, NULL);
+ st_delete(tbl, &key, NULL);
}
- rb_keyword_error("unknown", rb_hash_keys(hash));
+ keys = rb_funcall(hash, rb_intern("keys"), 0, 0);
+ if (!RB_TYPE_P(keys, T_ARRAY)) rb_raise(rb_eArgError, "unknown keyword");
+ rb_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);
@@ -1874,11 +1912,8 @@ rb_extract_keywords(VALUE *orighash)
*orighash = 0;
return hash;
}
- rb_hash_foreach(hash, separate_symbol, (st_data_t)&parthash);
+ 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];
}
@@ -1892,8 +1927,8 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
#define extract_kwarg(keyword, val) \
(key = (st_data_t)(keyword), values ? \
- (rb_hash_stlike_delete(keyword_hash, &key, &(val)) || ((val) = Qundef, 0)) : \
- rb_hash_stlike_lookup(keyword_hash, key, NULL))
+ 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;
@@ -1901,11 +1936,18 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
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) {
- if (extract_kwarg(keyword, values[i])) {
+ st_data_t val;
+ if (extract_kwarg(keyword, &val)) {
+ if (values) values[i] = (VALUE)val;
continue;
}
}
@@ -1919,290 +1961,22 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
j = i;
if (optional && keyword_hash) {
for (i = 0; i < optional; i++) {
- if (extract_kwarg(ID2SYM(table[required+i]), values[required+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)) {
+ if (RHASH_SIZE(keyword_hash) > (unsigned int)j) {
unknown_keyword_error(keyword_hash, table, required+optional);
}
}
- if (values && !keyword_hash) {
- for (i = 0; i < required + optional; i++) {
- values[i] = Qundef;
- }
- }
return j;
#undef extract_kwarg
}
-struct rb_scan_args_t {
- int argc;
- const VALUE *argv;
- va_list vargs;
- int f_var;
- int f_hash;
- int f_block;
- int n_lead;
- int n_opt;
- int n_trail;
- int n_mand;
- int argi;
- int last_idx;
- VALUE hash;
- VALUE last_hash;
- VALUE *tmp_buffer;
-};
-
-static void
-rb_scan_args_parse(int kw_flag, int argc, const VALUE *argv, const char *fmt, struct rb_scan_args_t *arg)
-{
- const char *p = fmt;
- VALUE *tmp_buffer = arg->tmp_buffer;
- int keyword_given = 0;
- int empty_keyword_given = 0;
- int last_hash_keyword = 0;
-
- memset(arg, 0, sizeof(*arg));
- arg->last_idx = -1;
- arg->hash = Qnil;
-
- switch (kw_flag) {
- case RB_SCAN_ARGS_PASS_CALLED_KEYWORDS:
- if (!(keyword_given = rb_keyword_given_p())) {
- empty_keyword_given = rb_empty_keyword_given_p();
- }
- break;
- case RB_SCAN_ARGS_KEYWORDS:
- keyword_given = 1;
- break;
- case RB_SCAN_ARGS_EMPTY_KEYWORDS:
- empty_keyword_given = 1;
- break;
- case RB_SCAN_ARGS_LAST_HASH_KEYWORDS:
- last_hash_keyword = 1;
- break;
- }
-
- if (ISDIGIT(*p)) {
- arg->n_lead = *p - '0';
- p++;
- if (ISDIGIT(*p)) {
- arg->n_opt = *p - '0';
- p++;
- }
- }
- if (*p == '*') {
- arg->f_var = 1;
- p++;
- }
- if (ISDIGIT(*p)) {
- arg->n_trail = *p - '0';
- p++;
- }
- if (*p == ':') {
- arg->f_hash = 1;
- p++;
- }
- if (*p == '&') {
- arg->f_block = 1;
- p++;
- }
- if (*p != '\0') {
- rb_fatal("bad scan arg format: %s", fmt);
- }
- arg->n_mand = arg->n_lead + arg->n_trail;
-
- /* capture an option hash - phase 1: pop */
- /* Ignore final positional hash if empty keywords given */
- if (argc > 0 && !(arg->f_hash && empty_keyword_given)) {
- VALUE last = argv[argc - 1];
-
- if (arg->f_hash && arg->n_mand < argc) {
- if (keyword_given) {
- if (!RB_TYPE_P(last, T_HASH)) {
- rb_warn("Keyword flag set when calling rb_scan_args, but last entry is not a hash");
- }
- else {
- arg->hash = last;
- }
- }
- else if (NIL_P(last)) {
- /* For backwards compatibility, 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.
- This will be removed in Ruby 3. */
- if (!arg->f_var && arg->n_mand + arg->n_opt < argc) {
- rb_warn("The last argument is nil, treating as empty keywords");
- argc--;
- }
- }
- else {
- arg->hash = rb_check_hash_type(last);
- }
-
- /* Ruby 3: Remove if branch, as it will not attempt to split hashes */
- if (!NIL_P(arg->hash)) {
- VALUE opts = rb_extract_keywords(&arg->hash);
-
- if (!(arg->last_hash = arg->hash)) {
- if (!keyword_given && !last_hash_keyword) {
- /* Warn if treating positional as keyword, as in Ruby 3,
- this will be an error */
- rb_warn("Using the last argument as keyword parameters is deprecated");
- }
- argc--;
- }
- else {
- /* Warn if splitting either positional hash to keywords or keywords
- to positional hash, as in Ruby 3, no splitting will be done */
- rb_warn("The last argument is split into positional and keyword parameters");
- arg->last_idx = argc - 1;
- }
- arg->hash = opts ? opts : Qnil;
- }
- }
- else if (arg->f_hash && keyword_given && arg->n_mand == argc) {
- /* Warn if treating keywords as positional, as in Ruby 3, this will be an error */
- rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
- }
- }
- if (arg->f_hash && arg->n_mand == argc+1 && empty_keyword_given) {
- VALUE *ptr = rb_alloc_tmp_buffer2(tmp_buffer, argc+1, sizeof(VALUE));
- memcpy(ptr, argv, sizeof(VALUE)*argc);
- ptr[argc] = rb_hash_new();
- argc++;
- *(&argv) = ptr;
- rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
- }
-
- arg->argc = argc;
- arg->argv = argv;
-}
-
-static int
-rb_scan_args_assign(struct rb_scan_args_t *arg, va_list vargs)
-{
- int argi = 0;
- int i;
- VALUE *var;
-
- if (arg->argc < arg->n_mand) {
- return 1;
- }
-
- /* capture leading mandatory arguments */
- for (i = arg->n_lead; i-- > 0; ) {
- var = va_arg(vargs, VALUE *);
- if (var) *var = (argi == arg->last_idx) ? arg->last_hash : arg->argv[argi];
- argi++;
- }
- /* capture optional arguments */
- for (i = arg->n_opt; i-- > 0; ) {
- var = va_arg(vargs, VALUE *);
- if (argi < arg->argc - arg->n_trail) {
- if (var) *var = (argi == arg->last_idx) ? arg->last_hash : arg->argv[argi];
- argi++;
- }
- else {
- if (var) *var = Qnil;
- }
- }
- /* capture variable length arguments */
- if (arg->f_var) {
- int n_var = arg->argc - argi - arg->n_trail;
-
- var = va_arg(vargs, VALUE *);
- if (0 < n_var) {
- if (var) {
- int f_last = (arg->last_idx + 1 == arg->argc - arg->n_trail);
- *var = rb_ary_new4(n_var - f_last, &arg->argv[argi]);
- if (f_last) rb_ary_push(*var, arg->last_hash);
- }
- argi += n_var;
- }
- else {
- if (var) *var = rb_ary_new();
- }
- }
- /* capture trailing mandatory arguments */
- for (i = arg->n_trail; i-- > 0; ) {
- var = va_arg(vargs, VALUE *);
- if (var) *var = (argi == arg->last_idx) ? arg->last_hash : arg->argv[argi];
- argi++;
- }
- /* capture an option hash - phase 2: assignment */
- if (arg->f_hash) {
- var = va_arg(vargs, VALUE *);
- if (var) *var = arg->hash;
- }
- /* capture iterator block */
- if (arg->f_block) {
- var = va_arg(vargs, VALUE *);
- if (rb_block_given_p()) {
- *var = rb_block_proc();
- }
- else {
- *var = Qnil;
- }
- }
-
- if (argi < arg->argc) return 1;
-
- return 0;
-}
-
-#undef rb_scan_args
-int
-rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
-{
- int error;
- va_list vargs;
- VALUE tmp_buffer = 0;
- struct rb_scan_args_t arg;
- arg.tmp_buffer = &tmp_buffer;
- rb_scan_args_parse(RB_SCAN_ARGS_PASS_CALLED_KEYWORDS, argc, argv, fmt, &arg);
- va_start(vargs,fmt);
- error = rb_scan_args_assign(&arg, vargs);
- va_end(vargs);
- if (tmp_buffer) {
- rb_free_tmp_buffer(&tmp_buffer);
- }
- if (error) {
- rb_error_arity(arg.argc, arg.n_mand, arg.f_var ? UNLIMITED_ARGUMENTS : arg.n_mand + arg.n_opt);
- }
- return arg.argc;
-}
-
-int
-rb_scan_args_kw(int kw_flag, int argc, const VALUE *argv, const char *fmt, ...)
-{
- int error;
- va_list vargs;
- VALUE tmp_buffer = 0;
- struct rb_scan_args_t arg;
- arg.tmp_buffer = &tmp_buffer;
- rb_scan_args_parse(kw_flag, argc, argv, fmt, &arg);
- va_start(vargs,fmt);
- error = rb_scan_args_assign(&arg, vargs);
- va_end(vargs);
- if (tmp_buffer) {
- rb_free_tmp_buffer(&tmp_buffer);
- }
- if (error) {
- rb_error_arity(arg.argc, arg.n_mand, arg.f_var ? UNLIMITED_ARGUMENTS : arg.n_mand + arg.n_opt);
- }
- return arg.argc;
-}
-
-int
-rb_class_has_methods(VALUE c)
-{
- return rb_id_table_size(RCLASS_M_TBL(c)) == 0 ? FALSE : TRUE;
-}
-
/*!
* \}
*/
diff --git a/common.mk b/common.mk
index 3706aeb4ce..a5ce202910 100644
--- a/common.mk
+++ b/common.mk
@@ -1,10 +1,8 @@
-# -*- mode: makefile-gmake; indent-tabs-mode: t -*-
-
bin: $(PROGRAM) $(WPROGRAM)
lib: $(LIBRUBY)
dll: $(LIBRUBY_SO)
-.SUFFIXES: .rbinc .rb .inc .h .c .y .i .$(ASMEXT) .$(DTRACE_EXT)
+.SUFFIXES: .inc .h .c .y .i .$(DTRACE_EXT)
# V=0 quiet, V=1 verbose. other values don't work.
V = 0
@@ -13,84 +11,41 @@ Q = $(Q1:0=@)
ECHO0 = $(ECHO1:0=echo)
ECHO = @$(ECHO0)
-mflags = $(MFLAGS)
-gnumake_recursive =
-enable_shared = $(ENABLE_SHARED:no=)
-
-UNICODE_VERSION = 12.1.0
-UNICODE_EMOJI_VERSION = 12.1
-UNICODE_BETA = NO
+UNICODE_VERSION = 7.0.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)
RUBYLIB = $(PATH_SEPARATOR)
RUBYOPT = -
RUN_OPTS = --disable-gems
-GITPULLOPTIONS = --rebase
+SPEC_GIT_BASE = git://github.com/ruby
+MSPEC_GIT_URL = $(SPEC_GIT_BASE)/mspec.git
+RUBYSPEC_GIT_URL = $(SPEC_GIT_BASE)/rubyspec.git
-INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(UNICODE_HDR_DIR)
-
-GEM_HOME =
-GEM_PATH =
-GEM_VENDOR =
-
-BENCHMARK_DRIVER_GIT_URL = https://github.com/benchmark-driver/benchmark-driver
-BENCHMARK_DRIVER_GIT_REF = v0.15.6
-SIMPLECOV_GIT_URL = https://github.com/colszowka/simplecov.git
-SIMPLECOV_GIT_REF = v0.17.0
-SIMPLECOV_HTML_GIT_URL = https://github.com/colszowka/simplecov-html.git
-SIMPLECOV_HTML_GIT_REF = v0.10.2
-DOCLIE_GIT_URL = https://github.com/ms-ati/docile.git
-DOCLIE_GIT_REF = v1.3.2
+SIMPLECOV_GIT_URL = git://github.com/hsbt/simplecov.git
STATIC_RUBY = static-ruby
-TIMESTAMPDIR = $(EXTOUT)/.timestamp
-RUBYCOMMONDIR = $(EXTOUT)/common
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
-RDOC = $(XRUBY) "$(srcdir)/libexec/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all
+PLATFORM_D = ./$(PLATFORM_DIR)/.time
RDOCOUT = $(EXTOUT)/rdoc
HTMLOUT = $(EXTOUT)/html
CAPIOUT = doc/capi
-INSTALL_DOC_OPTS = --rdoc-output="$(RDOCOUT)" --html-output="$(HTMLOUT)"
-RDOC_GEN_OPTS = --page-dir "$(srcdir)/doc" --no-force-update
INITOBJS = dmyext.$(OBJEXT) dmyenc.$(OBJEXT)
NORMALMAINOBJ = main.$(OBJEXT)
MAINOBJ = $(NORMALMAINOBJ)
DLDOBJS = $(INITOBJS)
EXTSOLIBS =
-MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(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) \
- ast.$(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) \
@@ -98,23 +53,20 @@ 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) \
- mjit.$(OBJEXT) \
- mjit_compile.$(OBJEXT) \
node.$(OBJEXT) \
numeric.$(OBJEXT) \
object.$(OBJEXT) \
pack.$(OBJEXT) \
parse.$(OBJEXT) \
- proc.$(OBJEXT) \
process.$(OBJEXT) \
random.$(OBJEXT) \
range.$(OBJEXT) \
@@ -135,18 +87,20 @@ COMMONOBJS = array.$(OBJEXT) \
string.$(OBJEXT) \
struct.$(OBJEXT) \
symbol.$(OBJEXT) \
- thread.$(OBJEXT) \
time.$(OBJEXT) \
transcode.$(OBJEXT) \
- transient_heap.$(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) \
- $(COROUTINE_OBJ) \
+ thread.$(OBJEXT) \
+ cont.$(OBJEXT) \
$(DTRACE_OBJ) \
$(BUILTIN_ENCOBJS) \
$(BUILTIN_TRANSOBJS) \
@@ -157,15 +111,15 @@ EXPORTOBJS = $(DLNOBJ) \
loadpath.$(OBJEXT) \
$(COMMONOBJS)
-OBJS = $(EXPORTOBJS) builtin.$(OBJEXT)
+OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)
ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
DEFAULT_PRELUDES = $(GEM_PRELUDE)
-PRELUDE_SCRIPTS = $(DEFAULT_PRELUDES)
-GEM_PRELUDE =
-PRELUDES = {$(srcdir)}miniprelude.c
+PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
+GEM_PRELUDE = $(srcdir)/gem_prelude.rb
+PRELUDES = {$(srcdir)}prelude.c {$(srcdir)}miniprelude.c
GOLFPRELUDES = {$(srcdir)}golf_prelude.c
SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
@@ -173,8 +127,7 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
--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) \
@@ -185,67 +138,27 @@ INSTRUBY_ARGS = $(SCRIPT_ARGS) \
INSTALL_PROG_MODE = 0755
INSTALL_DATA_MODE = 0644
+PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil' -- \
+ $(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
+
TESTSDIR = $(srcdir)/test
-TOOL_TESTSDIR = $(srcdir)/tool/test
-TEST_EXCLUDES = --excludes-dir=$(TESTSDIR)/excludes --name=!/memory_leak/
TESTWORKDIR = testwork
-TESTOPTS = $(RUBY_TESTOPTS)
TESTRUN_SCRIPT = $(srcdir)/test.rb
-COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmpl
-
-SHOWFLAGS = showflags
-
-MAKE_LINK = $(MINIRUBY) -rfileutils -e "include FileUtils::Verbose" \
- -e "src, dest = ARGV" \
- -e "exit if File.identical?(src, dest) or cmp(src, dest) rescue nil" \
- -e "def noraise; yield; rescue; rescue NotImplementedError; end" \
- -e "noraise {ln_sf('../'*dest.count('/')+src, dest)} or" \
- -e "noraise {ln(src, dest)} or" \
- -e "cp(src, dest)"
+BOOTSTRAPRUBY = $(BASERUBY)
+COMPILE_PRELUDE = $(srcdir)/tool/generic_erb.rb $(srcdir)/template/prelude.c.tmpl
-all: $(SHOWFLAGS) main docs
+all: showflags main docs
-main: $(SHOWFLAGS) exts $(ENCSTATIC:static=lib)encs
+main: showflags exts $(ENCSTATIC:static=lib)encs
@$(NULLCMD)
-mjit-headers: $(MJIT_SUPPORT)-mjit-headers
-no-mjit-headers: PHONY
-yes-mjit-headers: mjit_config.h PHONY
-
-mjit.$(OBJEXT): mjit_config.h
-mjit_config.h: Makefile
-
-
-# These rules using MJIT_HEADER_SUFFIX must be in common.mk, not
-# Makefile.in, in order to override the macro in defs/universal.mk.
-
-# Other `-Dxxx`s preceding `-DMJIT_HEADER` will be removed in transform_mjit_header.rb.
-# So `-DMJIT_HEADER` should be passed first when rb_mjit_header.h is generated.
-$(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time: probes.h vm.$(OBJEXT) \
- $(TIMESTAMPDIR)/$(arch)/.time
- $(ECHO) building $(@F:.time=.h)
- $(Q) $(CPP) -DMJIT_HEADER $(MJIT_HEADER_FLAGS) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(srcdir)/vm.c $(CPPOUTFLAG)$(@F:.time=.h).new
- $(Q) $(IFCHANGE) "--timestamp=$@" $(@F:.time=.h) $(@F:.time=.h).new
-
-$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time
-
-$(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h: \
- $(TIMESTAMPDIR)/$(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).time \
- $(srcdir)/tool/transform_mjit_header.rb $(PREP) \
- $(MJIT_HEADER:.h=)$(MJIT_HEADER_SUFFIX).h
- $(ECHO) building $@
- $(MINIRUBY) $(srcdir)/tool/transform_mjit_header.rb "$(CC) $(ARCH_FLAG) $(CFLAGS)" $(MJIT_HEADER:.h=)$(MJIT_HEADER_ARCH).h $@
- $(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
- $(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
-
.PHONY: showflags
-exts enc trans: $(SHOWFLAGS)
+exts enc trans: showflags
showflags:
$(MESSAGE_BEGIN) \
- " BASERUBY = $(BASERUBY)" \
" CC = $(CC)" \
" LD = $(LD)" \
" LDSHARED = $(LDSHARED)" \
@@ -254,10 +167,6 @@ showflags:
" CPPFLAGS = $(CPPFLAGS)" \
" DLDFLAGS = $(DLDFLAGS)" \
" SOLIBS = $(SOLIBS)" \
- " LANG = $(LANG)" \
- " LC_ALL = $(LC_ALL)" \
- " LC_CTYPE = $(LC_CTYPE)" \
- " MFLAGS = $(MFLAGS)" \
$(MESSAGE_END)
-@$(CC_VERSION)
@@ -267,44 +176,20 @@ 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 $(srcdir)/template/exts.mk.tmpl \
- $(TIMESTAMPDIR)/$(arch)/.time $(TIMESTAMPDIR)/.RUBYCOMMONDIR.time
- $(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) \
+ $(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)
prog: program wprogram
-programs: $(PROGRAM) $(WPROGRAM)
$(PREP): $(MKFILES)
@@ -313,53 +198,41 @@ miniruby$(EXEEXT): config.status $(ALLOBJS) $(ARCHFILE)
objs: $(ALLOBJS)
GORUBY = go$(RUBY_INSTALL_NAME)
-GOLF = $(GORUBY)
-golf: $(GOLF)
-$(GOLF): $(LIBRUBY) $(GOLFOBJS) PHONY
- $(Q) $(MAKE) $(mflags) \
- GOLF=_dummy_golf_target_to_avoid_conflict_just_in_case_ \
- MAINOBJ=goruby.$(OBJEXT) \
- EXTOBJS="golf_prelude.$(OBJEXT) $(EXTOBJS)" \
- PROGRAM=$(GORUBY)$(EXEEXT) \
- V=$(V) \
- program
+golf: $(LIBRUBY) $(GOLFOBJS) PHONY
+ $(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_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(BUILTIN_ENCOBJS)
+$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) $(LIBRUBY_A) $(PREP) $(LIBRUBY_SO_UPDATE) $(BUILTIN_ENCOBJS)
$(LIBRUBY_EXTS):
- @$(NULLCMD) > $@
+ @exit > $@
$(STATIC_RUBY)$(EXEEXT): $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A)
$(Q)$(RM) $@
- $(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
+ $(PURIFY) $(CC) $(MAINOBJ) $(DLDOBJS) $(EXTOBJS) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)$@ $(LDFLAGS) $(XLDFLAGS)
ruby.imp: $(COMMONOBJS)
- $(Q){ \
- $(NM) -Pgp $(COMMONOBJS) | \
- awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^$(SYMBOL_PREFIX)(Init_|InitVM_|ruby_static_id_|.*_threadptr_|rb_ec_)|^\./{print $$1}'; \
- ($(CHDIR) $(srcdir) && \
- exec sed -n '/^MJIT_FUNC_EXPORTED/!d;N;s/.*\n\(rb_[a-zA-Z_0-9]*\).*/$(SYMBOL_PREFIX)\1/p' cont.c gc.c thread*c vm*.c) \
- } | \
+ $(Q)$(NM) -Pgp $(COMMONOBJS) | \
+ awk 'BEGIN{print "#!"}; $$2~/^[BDT]$$/&&$$1!~/^(Init_|.*_threadptr_|\.)/{print $$1}' | \
sort -u -o $@
install: install-$(INSTALLDOC)
@@ -370,14 +243,14 @@ $(ruby_pc): $(srcdir)/template/ruby.pc.in config.status
install-all: docs pre-install-all do-install-all post-install-all
pre-install-all:: all pre-install-local pre-install-ext pre-install-doc
do-install-all: pre-install-all
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) $(INSTALL_DOC_OPTS)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
post-install-all:: post-install-local post-install-ext post-install-doc
@$(NULLCMD)
install-nodoc: pre-install-nodoc do-install-nodoc post-install-nodoc
pre-install-nodoc:: pre-install-local pre-install-ext
do-install-nodoc: main pre-install-nodoc
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --exclude=doc
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS)
post-install-nodoc:: post-install-local post-install-ext
install-local: pre-install-local do-install-local post-install-local
@@ -452,7 +325,7 @@ what-where-all: no-install-all
no-install-all: pre-no-install-all dont-install-all post-no-install-all
pre-no-install-all:: pre-no-install-local pre-no-install-ext pre-no-install-doc
dont-install-all: $(PROGRAM)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all $(INSTALL_DOC_OPTS)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=all --rdoc-output="$(RDOCOUT)"
post-no-install-all:: post-no-install-local post-no-install-ext post-no-install-doc
@$(NULLCMD)
@@ -539,7 +412,7 @@ post-no-install-man::
install-doc: rdoc pre-install-doc do-install-doc post-install-doc
pre-install-doc:: install-prereq
do-install-doc: $(PROGRAM) pre-install-doc
- $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc $(INSTALL_DOC_OPTS)
+ $(INSTRUBY) --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-install-doc::
@$(NULLCMD)
@@ -552,15 +425,15 @@ post-install-gem::
rdoc: PHONY main
@echo Generating RDoc documentation
- $(Q) $(RDOC) --ri --op "$(RDOCOUT)" $(RDOC_GEN_OPTS) $(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)"
html: PHONY main
@echo Generating RDoc HTML files
- $(Q) $(RDOC) --op "$(HTMLOUT)" $(RDOC_GEN_OPTS) $(RDOCFLAGS) "$(srcdir)"
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --op "$(HTMLOUT)" --debug $(RDOCFLAGS) "$(srcdir)"
rdoc-coverage: PHONY main
@echo Generating RDoc coverage report
- $(Q) $(RDOC) --quiet -C $(RDOCFLAGS) "$(srcdir)"
+ $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)"
RDOCBENCHOUT=/tmp/rdocbench
@@ -578,7 +451,7 @@ what-where-doc: no-install-doc
no-install-doc: pre-no-install-doc dont-install-doc post-no-install-doc
pre-no-install-doc:: install-prereq
dont-install-doc:: $(PREP)
- $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc $(INSTALL_DOC_OPTS)
+ $(INSTRUBY) -n --make="$(MAKE)" $(INSTRUBY_ARGS) --install=rdoc --rdoc-output="$(RDOCOUT)"
post-no-install-doc::
@$(NULLCMD)
@@ -589,21 +462,16 @@ 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) $(COROUTINE_H:/Context.h=/.time)
- $(Q)$(RM) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT) ruby.imp
- $(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D)
- -$(Q) $(RMDIR) enc/jis enc/trans enc $(COROUTINE_H:/Context.h=) coroutine 2> $(NULL) || $(NULLCMD)
-
-bin/clean-runnable:: PHONY
- $(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || $(NULLCMD)
-lib/clean-runnable:: PHONY
- $(Q)$(CHDIR) lib 2>$(NULL) && $(RM) $(LIBRUBY_A) $(LIBRUBY) $(LIBRUBY_ALIASES) $(RUBY_BASE_NAME)/$(RUBY_PROGRAM_VERSION) $(RUBY_BASE_NAME)/vendor_ruby 2>$(NULL) || $(NULLCMD)
-clean-runnable:: bin/clean-runnable lib/clean-runnable PHONY
- $(Q)$(RMDIR) lib/$(RUBY_BASE_NAME) lib bin 2>$(NULL) || $(NULLCMD)
+ $(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
+clean-runnable:: PHONY
+ $(Q)$(CHDIR) bin 2>$(NULL) && $(RM) $(PROGRAM) $(WPROGRAM) $(GORUBY)$(EXEEXT) bin/*.$(DLEXT) 2>$(NULL) || exit 0
+ $(Q)$(CHDIR) lib 2>$(NULL) && $(RM) $(LIBRUBY_A) $(LIBRUBY) $(LIBRUBY_ALIASES) $(RUBY_BASE_NAME)/$(RUBY_PROGRAM_VERSION) $(RUBY_BASE_NAME)/vendor_ruby 2>$(NULL) || exit 0
+ $(Q)$(RMDIR) lib/$(RUBY_BASE_NAME) lib bin 2>$(NULL) || exit 0
clean-ext:: PHONY
clean-golf: PHONY
$(Q)$(RM) $(GORUBY)$(EXEEXT) $(GOLFOBJS)
@@ -612,94 +480,40 @@ clean-html: PHONY
clean-capi: PHONY
clean-platform: PHONY
clean-extout: PHONY
- -$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || $(NULLCMD)
+ -$(Q)$(RMDIR) $(EXTOUT)/$(arch) $(EXTOUT) 2> $(NULL) || exit 0
clean-docs: clean-rdoc clean-html clean-capi
-clean-spec: PHONY
-clean-rubyspec: clean-spec
-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) *.rbinc
+ $(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(arch)-fake.rb
$(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
+distclean-rdoc: PHONY
+distclean-html: 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 realclean-srcs-local
-
-clean-srcs:: clean-srcs-local clean-srcs-ext
-realclean-srcs:: realclean-srcs-local realclean-srcs-ext
-
-clean-srcs-local::
- $(Q)$(RM) parse.c parse.h lex.c enc/trans/newline.c revision.h
- $(Q)$(RM) id.c id.h probes.dmyh probes.h
- $(Q)$(RM) encdb.h transdb.h verconf.h ruby-runner.h
- $(Q)$(RM) mjit_config.h rb_mjit_header.h
- $(Q)$(RM) $(MJIT_MIN_HEADER) $(MJIT_MIN_HEADER:.h=)$(MJIT_HEADER_SUFFIX:%=*).h
-
-realclean-srcs-local:: clean-srcs-local
- $(Q)$(CHDIR) $(srcdir) && $(RM) \
- parse.c parse.h lex.c enc/trans/newline.c $(PRELUDES) revision.h \
- id.c id.h probes.dmyh configure aclocal.m4 tool/config.guess tool/config.sub gems/*.gem \
- || $(NULLCMD)
-
-clean-srcs-ext::
-realclean-srcs-ext:: clean-srcs-ext
-
+realclean-local:: distclean-local
+ $(Q)$(RM) parse.c parse.h lex.c newline.c $(PRELUDES) revision.h
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) parse.c parse.h lex.c newline.c $(PRELUDES) revision.h
+ $(Q)$(CHDIR) $(srcdir) && $(exec) $(RM) configure tool/config.guess tool/config.sub gems/*.gem
realclean-ext:: PHONY
realclean-golf: distclean-golf
$(Q)$(RM) $(GOLFPRELUDES)
-realclean-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:: ext/clean.mk
-ext/distclean:: ext/distclean.mk
-ext/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) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD)
-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) || $(NULLCMD)
+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) || $(NULLCMD)
-
clean-rdoc distclean-rdoc realclean-rdoc:
@echo $(@:-rdoc=ing) rdoc
$(Q)$(RMALL) $(RDOCOUT)
@@ -714,114 +528,64 @@ clean-capi distclean-capi realclean-capi:
clean-platform:
$(Q) $(RM) $(PLATFORM_D)
- -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || $(NULLCMD)
+ -$(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) || $(NULLCMD)
-
-check: main test test-tool test-all test-spec
+check: main test test-all
$(ECHO) check succeeded
- -$(Q) if [ x"$(GIT)" != x ] && $(CHDIR) "$(srcdir)" && $(GIT) rev-parse > /dev/null 2>&1; then \
- set -x; $(GIT) --no-pager log --format=oneline -G "^ *# *include" origin/master..HEAD; \
- fi
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) -DRUBY_EXPORT $(INCFLAGS) $(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) $(BTESTS)
+ $(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) $(BTESTS)
+ $(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
+ -$(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) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS) testunit minitest
-no-test-testframework: PHONY
+test: test-sample btest-ruby test-knownbug
-test-tool: $(TEST_RUNNABLE)-test-tool
-yes-test-tool: prog PHONY
- $(gnumake_recursive)$(Q)$(exec) $(RUNRUBY) "$(TOOL_TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TESTOPTS)
-no-test-tool: PHONY
-
-test-sample: test-basic # backward compatibility for mswin-build
-test-short: btest-ruby test-knownbug test-basic
-test: test-short
-
-# $ 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) "$(TESTSDIR)/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" "$(TESTSDIR)/runner.rb" $(TESTOPTS) $(TESTS_BUILD)
-
-test-almost: test-all
-yes-test-almost: yes-test-all
-no-test-almost: no-test-all
+ $(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) "$(TESTSDIR)/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) \
- -unicode_emoji_version=$(UNICODE_EMOJI_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 $(arch)-fake.rb
+ $(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/default.mspec $(MSPECOPT)
RUNNABLE = $(LIBRUBY_RELATIVE:no=un)-runnable
runnable: $(RUNNABLE) prog $(srcdir)/tool/mkrunnable.rb PHONY
@@ -830,19 +594,20 @@ 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)
@@ -852,10 +617,9 @@ $(ENC_MK): $(srcdir)/enc/make_encmake.rb $(srcdir)/enc/Makefile.in $(srcdir)/enc
.PHONY: clean clean-ext clean-local clean-enc clean-golf clean-rdoc clean-html clean-extout
.PHONY: distclean distclean-ext distclean-local distclean-enc distclean-golf distclean-extout
.PHONY: realclean realclean-ext realclean-local realclean-enc realclean-golf realclean-extout
-.PHONY: exam check test test-short test-all btest btest-ruby test-basic test-knownbug
-.PHONY: run runruby parse benchmark gdb gdb-ruby
-.PHONY: update-mspec update-rubyspec test-rubyspec test-spec
-.PHONY: touch-unicode-files
+.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
PHONY:
@@ -865,64 +629,31 @@ PHONY:
{$(srcdir)}.y.c:
$(ECHO) generating $@
$(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y
- $(Q)$(BASERUBY) $(srcdir)/tool/pure_parser.rb parse.tmp.y $(YACC)
$(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)
- @$(NULLCMD) > $@
-
-exe/$(PROGRAM): ruby-runner.c ruby-runner.h exe/.time miniruby$(EXEEXT) {$(VPATH)}config.h
- $(Q) $(CC) $(CFLAGS) $(INCFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(@F) $(COUTFLAG)ruby-runner.$(OBJEXT) -c $(CSRCFLAG)$(srcdir)/ruby-runner.c
- $(Q) $(PURIFY) $(CC) $(CFLAGS) $(LDFLAGS) $(OUTFLAG)$@ ruby-runner.$(OBJEXT) $(LIBS)
- $(Q) $(POSTLINK)
- $(Q) ./miniruby$(EXEEXT) \
- -e 'prog, dest, inst = ARGV; dest += "/ruby"' \
- -e 'exit unless prog==inst' \
- -e 'unless prog=="ruby"' \
- -e ' begin File.unlink(dest); rescue Errno::ENOENT; end' \
- -e ' File.symlink(prog, dest)' \
- -e 'end' \
- $(@F) $(@D) $(RUBY_INSTALL_NAME)$(EXEEXT)
-
-exe/.time:
- $(Q) $(MAKEDIRS) $(@D)
- @$(NULLCMD) > $@
-
-$(BUILTIN_ENCOBJS) $(BUILTIN_TRANSOBJS): $(ENC_TRANS_D)
-
-$(ENC_TRANS_D):
- $(Q) $(MAKEDIRS) enc/trans $(@D)
- @$(NULLCMD) > $@
-
-$(TIMESTAMPDIR)/$(arch)/.time:
- $(Q)$(MAKEDIRS) $(@D) $(EXTOUT)/$(arch)
- @$(NULLCMD) > $@
-
-$(TIMESTAMPDIR)/.RUBYCOMMONDIR.time:
- $(Q)$(MAKEDIRS) $(@D) $(RUBYCOMMONDIR)
- @$(NULLCMD) > $@
+ $(Q) $(MAKEDIRS) $(PLATFORM_DIR)
+ @exit > $@
###
CCAN_DIR = {$(VPATH)}ccan
RUBY_H_INCLUDES = {$(VPATH)}ruby.h {$(VPATH)}config.h {$(VPATH)}defines.h \
{$(VPATH)}intern.h {$(VPATH)}missing.h {$(VPATH)}st.h \
- {$(VPATH)}assert.h {$(VPATH)}subst.h
+ {$(VPATH)}subst.h
###
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
@@ -935,39 +666,36 @@ 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
-
-.coroutine_obj $(COROUTINE_OBJ): \
- {$(VPATH)}$(COROUTINE_SRC) \
- $(COROUTINE_H:/Context.h=/.time)
-$(COROUTINE_H:/Context.h=/.time):
- $(Q) $(MAKEDIRS) $(@D)
- @$(NULLCMD) > $@
+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 \
+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 {$(VPATH)}thread.h \
$(RUBY_H_INCLUDES) $(PLATFORM_D)
$(NEWLINE_C): $(srcdir)/enc/trans/newline.trans $(srcdir)/tool/transcode-tblgen.rb
- $(Q) $(MAKEDIRS) $(@D)
$(Q) $(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo $@ $(srcdir)/enc/trans/newline.trans
-enc/trans/newline.$(OBJEXT): $(NEWLINE_C)
+newline.$(OBJEXT): $(NEWLINE_C)
verconf.h: $(srcdir)/template/verconf.h.tmpl $(srcdir)/tool/generic_erb.rb
$(ECHO) creating $@
- $(Q) $(BOOTSTRAPRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
+ $(Q) $(MINIRUBY) "$(srcdir)/tool/generic_erb.rb" -o $@ $(srcdir)/template/verconf.h.tmpl
ruby-glommed.$(OBJEXT): $(OBJS)
@@ -975,64 +703,33 @@ $(OBJS): {$(VPATH)}config.h {$(VPATH)}missing.h
INSNS2VMOPT = --srcdir="$(srcdir)"
-srcs_vpath = {$(VPATH)}
-
-inc_common_headers = $(srcdir)/tool/ruby_vm/views/_copyright.erb $(srcdir)/tool/ruby_vm/views/_notice.erb
-$(srcs_vpath)opt_sc.inc: $(srcdir)/tool/ruby_vm/views/opt_sc.inc.erb $(inc_common_headers)
-$(srcs_vpath)optinsn.inc: $(srcdir)/tool/ruby_vm/views/optinsn.inc.erb $(inc_common_headers)
-$(srcs_vpath)optunifs.inc: $(srcdir)/tool/ruby_vm/views/optunifs.inc.erb $(inc_common_headers)
-$(srcs_vpath)insns.inc: $(srcdir)/tool/ruby_vm/views/insns.inc.erb $(inc_common_headers)
-$(srcs_vpath)insns_info.inc: $(srcdir)/tool/ruby_vm/views/insns_info.inc.erb $(inc_common_headers) \
- $(srcdir)/tool/ruby_vm/views/_insn_type_chars.erb $(srcdir)/tool/ruby_vm/views/_insn_name_info.erb \
- $(srcdir)/tool/ruby_vm/views/_insn_len_info.erb $(srcdir)/tool/ruby_vm/views/_insn_operand_info.erb \
- $(srcdir)/tool/ruby_vm/views/_attributes.erb $(srcdir)/tool/ruby_vm/views/_comptime_insn_stack_increase.erb \
- $(srcdir)/tool/ruby_vm/views/_insn_sp_pc_dependency.erb
-$(srcs_vpath)vmtc.inc: $(srcdir)/tool/ruby_vm/views/vmtc.inc.erb $(inc_common_headers)
-$(srcs_vpath)vm.inc: $(srcdir)/tool/ruby_vm/views/vm.inc.erb $(inc_common_headers) \
- $(srcdir)/tool/ruby_vm/views/_insn_entry.erb $(srcdir)/tool/ruby_vm/views/_trace_instruction.erb
-$(srcs_vpath)mjit_compile.inc: $(srcdir)/tool/ruby_vm/views/mjit_compile.inc.erb $(inc_common_headers) \
- $(srcdir)/tool/ruby_vm/views/_mjit_compile_insn.erb $(srcdir)/tool/ruby_vm/views/_mjit_compile_send.erb \
- $(srcdir)/tool/ruby_vm/views/_mjit_compile_ivar.erb \
- $(srcdir)/tool/ruby_vm/views/_mjit_compile_insn_body.erb $(srcdir)/tool/ruby_vm/views/_mjit_compile_pc_and_sp.erb
-
-BUILTIN_RB_SRCS = \
- $(srcdir)/ast.rb \
- $(srcdir)/gc.rb \
- $(srcdir)/io.rb \
- $(srcdir)/pack.rb \
- $(srcdir)/trace_point.rb \
- $(srcdir)/warning.rb \
- $(srcdir)/prelude.rb \
- $(srcdir)/gem_prelude.rb \
- $(empty)
-BUILTIN_RB_INCS = $(BUILTIN_RB_SRCS:.rb=.rbinc)
-
-common-srcs: $(srcs_vpath)parse.c $(srcs_vpath)lex.c $(srcs_vpath)enc/trans/newline.c $(srcs_vpath)id.c \
- $(BUILTIN_RB_INCS) \
- srcs-lib srcs-ext incs
-
-missing-srcs: $(srcdir)/missing/des_tables.c
-
-srcs: common-srcs missing-srcs srcs-enc
+{$(VPATH)}minsns.inc: $(srcdir)/template/minsns.inc.tmpl
+
+{$(VPATH)}opt_sc.inc: $(srcdir)/template/opt_sc.inc.tmpl
+
+{$(VPATH)}optinsn.inc: $(srcdir)/template/optinsn.inc.tmpl
+
+{$(VPATH)}optunifs.inc: $(srcdir)/template/optunifs.inc.tmpl
+
+{$(VPATH)}insns.inc: $(srcdir)/template/insns.inc.tmpl
+
+{$(VPATH)}insns_info.inc: $(srcdir)/template/insns_info.inc.tmpl
+
+{$(VPATH)}vmtc.inc: $(srcdir)/template/vmtc.inc.tmpl
+
+{$(VPATH)}vm.inc: $(srcdir)/template/vm.inc.tmpl
+
+common-srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c {$(VPATH)}newline.c {$(VPATH)}id.c \
+ srcs-lib srcs-ext
+
+srcs: common-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 \
- $(srcdir)/ext/etc/constdefs.h \
- # EXT_SRCS
+ $(srcdir)/ext/rbconfig/sizeof/sizes.c
srcs-ext: $(EXT_SRCS)
-realclean-srcs-ext::
- $(Q)$(RM) $(EXT_SRCS)
-
-EXTRA_SRCS = $(srcdir)/ext/json/parser/parser.c \
- $(srcdir)/ext/date/zonetab.h \
- $(empty)
-srcs-extra: $(EXTRA_SRCS)
-realclean-srcs-extra::
- $(Q)$(RM) $(EXTRA_SRCS)
+srcs-extra: $(srcdir)/ext/json/parser/parser.c
LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb
@@ -1040,13 +737,11 @@ 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 \
+ $(srcdir)/revision.h $(REVISION_H) enc/unicode/name2ctype.h enc/jis/props.h \
{$(VPATH)}id.h {$(VPATH)}probes.dmyh
insns: $(INSNS)
@@ -1061,9 +756,9 @@ id.c: $(srcdir)/tool/generic_erb.rb $(srcdir)/template/id.c.tmpl $(srcdir)/defs/
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb --output=$@ \
$(srcdir)/template/id.c.tmpl
-node_name.inc: $(srcdir)/tool/node_name.rb $(srcdir)/node.h
+node_name.inc: {$(VPATH)}node.h
$(ECHO) generating $@
- $(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $(srcdir)/node.h > $@
+ $(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@
encdb.h: $(PREP) $(srcdir)/tool/generic_erb.rb $(srcdir)/template/encdb.h.tmpl
$(ECHO) generating $@
@@ -1079,104 +774,59 @@ 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): $(COMPILE_PRELUDE)
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/mk_call_iseq_optimized.rb > $@
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
+ $(srcdir)/template/prelude.c.tmpl
-$(MINIPRELUDE_C): $(COMPILE_PRELUDE) $(BUILTIN_RB_SRCS)
+$(PRELUDE_C): $(COMPILE_PRELUDE) \
+ {$(srcdir)}lib/rubygems/defaults.rb \
+ {$(srcdir)}lib/rubygems/core_ext/kernel_gem.rb \
+ $(PRELUDE_SCRIPTS) $(LIB_SRCS)
$(ECHO) generating $@
- $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -o $@ \
- $(srcdir)/template/prelude.c.tmpl $(BUILTIN_RB_SRCS)
+ $(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb -I$(srcdir) -c -o $@ \
+ $(srcdir)/template/prelude.c.tmpl $(PRELUDE_SCRIPTS)
-$(GOLF_PRELUDE_C): $(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)}.rb.rbinc:
- $(ECHO) making $@
- $(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $<
-
-builtin_binary.inc: $(PREP) $(BUILTIN_RB_SRCS) $(srcdir)/tool/mk_builtin_binary.rb
- $(Q) $(MINIRUBY) $(srcdir)/tool/mk_builtin_binary.rb --cross=$(CROSS_COMPILING)
-
-$(BUILTIN_RB_INCS): $(top_srcdir)/tool/mk_builtin_loader.rb
-
$(srcdir)/revision.h:
- $(Q)$(gnumake:yes=#) $(RM) $(@F)
- $(Q)$(gnumake:yes=#) $(NULLCMD) > $@ || $(NULLCMD) > $(@F)
-
-revision.tmp::
- $(Q) $(NULLCMD) > $@
-revision.$(HAVE_BASERUBY:yes=tmp):: $(srcdir)/version.h $(srcdir)/tool/file2lastrev.rb $(REVISION_FORCE)
- $(Q) $(BASERUBY) $(srcdir)/tool/file2lastrev.rb -q --revision.h --srcdir="$(srcdir)" > $@
+ @exit > $@
-$(REVISION_H): 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)/ext/ripper/tools/preproc.rb $(srcdir)/parse.y id.h $(srcdir)/ext/ripper/depend
+$(srcdir)/ext/ripper/ripper.c: parse.y id.h
$(ECHO) generating $@
- $(Q) VPATH=$${PWD-`pwd`} && $(CHDIR) $(@D) && \
- sed -e 's/{\$$([^(){}]*)[^{}]*}//g' -e /AUTOGENERATED/q depend | \
- $(exec) $(MAKE) -f - $(mflags) \
- Q=$(Q) ECHO=$(ECHO) RM="$(RM)" BISON=$(YACC) top_srcdir=../.. srcdir=. VPATH="$${VPATH}" \
+ $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f depend $(MFLAGS) \
+ Q=$(Q) ECHO=$(ECHO) RM="$(RM)" VPATH="$(PWD)" \
+ top_srcdir=../.. srcdir=. \
RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
-$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl $(srcdir)/ext/json/parser/prereq.mk
+$(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/date/prereq.mk
- $(ECHO) generating $@
- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(mflags) \
- Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. BASERUBY="$(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
- $(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
+ $(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/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)"
-
-$(srcdir)/ext/etc/constdefs.h: $(srcdir)/ext/etc/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)"
##
@@ -1187,7 +837,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)
@@ -1196,17 +846,23 @@ bisect-ruby: PHONY
$(srcdir)/tool/bisect.sh ruby $(srcdir)
COMPARE_RUBY = $(BASERUBY)
-BENCH_RUBY = $(RUNRUBY)
ITEM =
-ARGS = $$(find $(srcdir)/benchmark -maxdepth 1 -name '$(ITEM)' -o -name '*$(ITEM)*.yml' -o -name '*$(ITEM)*.rb' | sort)
OPTS =
-# See benchmark/README.md for details.
-benchmark: miniruby$(EXEEXT) update-benchmark-driver PHONY
- $(BASERUBY) -rrubygems -I$(srcdir)/benchmark/lib $(srcdir)/benchmark/benchmark-driver/exe/benchmark-driver \
- --executables="compare-ruby::$(COMPARE_RUBY) -I$(EXTOUT)/common --disable-gem" \
- --executables="built-ruby::$(BENCH_RUBY) --disable-gem" \
- $(ARGS) $(OPTS)
+benchmark: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern='bm_' --directory=$(srcdir)/benchmark $(OPTS)
+
+benchmark-each: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern=$(ITEM) --directory=$(srcdir)/benchmark $(OPTS)
+
+tbench: $(PROGRAM) PHONY
+ $(BASERUBY) $(srcdir)/benchmark/driver.rb -v \
+ --executables="$(COMPARE_RUBY); built-ruby::$(RUNRUBY)" \
+ --pattern='bmx_' --directory=$(srcdir)/benchmark $(OPTS)
run.gdb:
echo set breakpoint pending on > run.gdb
@@ -1229,257 +885,72 @@ 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 -srcdir=$(srcdir) tmp $(RELNAME)
up::
- -$(Q)$(MAKE) $(mflags) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
+ -$(Q)$(MAKE) $(MFLAGS) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
up::
- -$(Q)$(MAKE) $(mflags) Q=$(Q) after-update
-
-yes::
-no::
-
-after-update:: extract-extlibs
-after-update:: extract-gems
-
-update-remote:: update-src update-download
-update-download:: $(ALWAYS_UPDATE_UNICODE:yes=update-unicode)
-update-download:: update-gems
-update-download:: download-extlibs
+ -$(Q)$(MAKE) $(MFLAGS) Q=$(Q) after-update
-update-mspec:
-update-rubyspec:
+after-update:: update-unicode update-gems extract-extlibs
update-config_files: PHONY
- $(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb -d tool --cache-dir=$(CACHE_DIR) -e gnu \
+ $(Q) $(BASERUBY) -C "$(srcdir)/tool" \
+ ../tool/downloader.rb -e gnu \
config.guess config.sub
-refresh-gems: update-bundled_gems update-gems extract-gems
-
update-gems: PHONY
$(ECHO) Downloading bundled gem files...
- $(Q) $(BASERUBY) -C "$(srcdir)" \
- -I./tool -rdownloader -answ \
+ $(Q) $(BASERUBY) -C "$(srcdir)/gems" \
+ -I../tool -rdownloader -answ \
-e 'gem, ver = *$$F' \
- -e 'old = Dir.glob("gems/#{gem}-*.gem")' \
+ -e 'old = Dir.glob("#{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")' \
+ -e 'Downloader::RubyGems.download(gem, nil, nil) and' \
+ -e 'File.unlink(*(old-[gem]))' \
bundled_gems
-update-bundled_gems: PHONY
- $(Q) $(RUNRUBY) -rrubygems \
- -pla \
- -e '(gem,src), = Gem::SpecFetcher.fetcher.detect(:latest) {'"|s|" \
- -e 's.platform=="ruby"&&s.name==$$F[0]' \
- -e '}' \
- -e 'gem = src.fetch_spec(gem)' \
- -e 'uri = gem.metadata["source_code_uri"]||gem.homepage' \
- -e 'uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "")' \
- -e '$$_ = [gem.name, gem.version, uri].join(" ")' \
- "$(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-document \
- --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:
-
-# Override this to allow failure of specific gems on CI
-# TEST_BUNDLED_GEMS_ALLOW_FAILURES =
-
-test-bundled-gems-run: $(PREPARE_BUNDLED_GEMS)
- $(Q) $(XRUBY) $(srcdir)/tool/test-bundled-gems.rb
-
-test-bundler-precheck: $(arch)-fake.rb programs
-
-yes-test-bundler-prepare: test-bundler-precheck
- $(XRUBY) -C "$(srcdir)" bin/gem install --no-document \
- --install-dir .bundle --conservative "rspec:~> 3.5" "rake:~> 12.0" "parallel_tests:~> 2.29"
-
-RSPECOPTS =
-BUNDLER_SPECS =
-test-bundler: $(TEST_RUNNABLE)-test-bundler
-yes-test-bundler: yes-test-bundler-prepare
- $(XRUBY) -C $(srcdir) -Ispec/bundler .bundle/bin/rspec \
- --require spec_helper $(RSPECOPTS) spec/bundler/$(BUNDLER_SPECS)
-no-test-bundler:
-
-PARALLELRSPECOPTS = --runtime-log $(srcdir)/tmp/parallel_runtime_rspec.log
-test-bundler-parallel: $(TEST_RUNNABLE)-test-bundler-parallel
-yes-test-bundler-parallel: yes-test-bundler-prepare
- $(XRUBY) -C $(srcdir) -Ispec/bundler .bundle/bin/parallel_rspec \
- -o "--require $(srcdir)/spec/bundler/spec_helper --require $(srcdir)/spec/bundler/support/parallel" \
- $(PARALLELRSPECOPTS) spec/bundler/$(BUNDLER_SPECS)
-no-test-bundler-parallel:
-
-GEM = up
-sync-default-gems:
- $(Q) $(XRUBY) -C "$(srcdir)" tool/sync_default_gems.rb $(GEM)
-
-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 \
- $(empty)
-
-UNICODE_AUXILIARY_FILES = \
- $(UNICODE_SRC_DATA_DIR)/auxiliary/GraphemeBreakProperty.txt \
- $(UNICODE_SRC_DATA_DIR)/auxiliary/GraphemeBreakTest.txt \
- $(empty)
-
-UNICODE_EMOJI_FILES = \
- $(UNICODE_SRC_EMOJI_DATA_DIR)/emoji-data.txt \
- $(UNICODE_SRC_EMOJI_DATA_DIR)/emoji-sequences.txt \
- $(UNICODE_SRC_EMOJI_DATA_DIR)/emoji-test.txt \
- $(UNICODE_SRC_EMOJI_DATA_DIR)/emoji-variation-sequences.txt \
- $(UNICODE_SRC_EMOJI_DATA_DIR)/emoji-zwj-sequences.txt \
- $(empty)
-
-update-unicode: $(UNICODE_FILES) $(UNICODE_PROPERTY_FILES) \
- $(UNICODE_AUXILIARY_FILES) $(UNICODE_EMOJI_FILES)
-
-CACHE_DIR = $(srcdir)/.downloaded-cache
-UNICODE_DOWNLOAD = \
- $(BASERUBY) $(srcdir)/tool/downloader.rb \
- --cache-dir=$(CACHE_DIR) \
- --unicode-beta $(UNICODE_BETA) \
- -d $(UNICODE_SRC_DATA_DIR) \
- -p $(UNICODE_VERSION)/ucd \
- -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
-UNICODE_AUXILIARY_DOWNLOAD = \
- $(BASERUBY) $(srcdir)/tool/downloader.rb \
- --cache-dir=$(CACHE_DIR) \
- --unicode-beta $(UNICODE_BETA) \
- -d $(UNICODE_SRC_DATA_DIR)/auxiliary \
- -p $(UNICODE_VERSION)/ucd/auxiliary \
- -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
-UNICODE_EMOJI_DOWNLOAD = \
- $(BASERUBY) $(srcdir)/tool/downloader.rb \
- --cache-dir=$(CACHE_DIR) \
- --unicode-beta $(UNICODE_BETA) \
- -d $(UNICODE_SRC_EMOJI_DATA_DIR) \
- -p emoji/$(UNICODE_EMOJI_VERSION) \
- -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
-
-$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES): update-unicode-files
-update-unicode-files:
- $(ECHO) Downloading Unicode $(UNICODE_VERSION) data and property files...
- $(Q) $(MAKEDIRS) "$(UNICODE_SRC_DATA_DIR)"
- $(Q) $(UNICODE_DOWNLOAD) $(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)
-
-$(UNICODE_AUXILIARY_FILES): update-unicode-auxiliary-files
-update-unicode-auxiliary-files:
- $(ECHO) Downloading Unicode $(UNICODE_VERSION) auxiliary files...
- $(Q) $(MAKEDIRS) "$(UNICODE_SRC_DATA_DIR)/auxiliary"
- $(Q) $(UNICODE_AUXILIARY_DOWNLOAD) $(UNICODE_AUXILIARY_FILES)
-
-$(UNICODE_EMOJI_FILES): update-unicode-emoji-files
-update-unicode-emoji-files:
- $(ECHO) Downloading Unicode emoji $(UNICODE_EMOJI_VERSION) files...
- $(Q) $(MAKEDIRS) "$(UNICODE_SRC_EMOJI_DATA_DIR)"
- $(Q) $(UNICODE_EMOJI_DOWNLOAD) $(UNICODE_EMOJI_FILES)
-
-$(srcdir)/lib/unicode_normalize/$(HAVE_BASERUBY:yes=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) \
- $(UNICODE_AUXILIARY_FILES) $(UNICODE_EMOJI_FILES)
-
-touch-unicode-files:
- $(MAKEDIRS) $(UNICODE_SRC_DATA_DIR)
- touch $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time $(UNICODE_DATA_HEADERS)
-
-UNICODE_TABLES_TIMESTAMP = yes
-$(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)
+UPDATE_LIBRARIES = no
+
+### set the following environment variable or uncomment the line if
+### the Unicode data files are updated every minute.
+# ALWAYS_UPDATE_UNICODE = yes
+
+UNICODE_FILES = $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/UnicodeData.txt \
+ $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/CompositionExclusions.txt \
+ $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/NormalizationTest.txt
+
+update-unicode: $(UNICODE_FILES) PHONY
+
+UNICODE_FILES_DEPS0 = $(UPDATE_LIBRARIES:yes=download-unicode-data)
+UNICODE_FILES_DEPS = $(UNICODE_FILES_DEPS0:no=)
+$(UNICODE_FILES): $(UNICODE_FILES_DEPS)
+
+download-unicode-data: ./.unicode-$(UNICODE_VERSION).time
+./.unicode-$(UNICODE_VERSION).time: PHONY
+ $(ECHO) Downloading Unicode $(UNICODE_VERSION) data files...
+ $(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)"
+ $(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb \
+ -d enc/unicode/data/$(UNICODE_VERSION) \
+ -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode \
+ $(UNICODE_VERSION)/ucd/UnicodeData.txt \
+ $(UNICODE_VERSION)/ucd/CompositionExclusions.txt \
+ $(UNICODE_VERSION)/ucd/NormalizationTest.txt
+ @exit > $@
+
+$(srcdir)/$(HAVE_BASERUBY:yes=lib/unicode_normalize/tables.rb): \
+ $(UNICODE_FILES_DEPS:download-unicode-data=./.unicode-tables.time)
+
+./.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
+ $(UNICODE_FILES) $(UNICODE_FILES_DEPS) \
+ $(srcdir)/template/unicode_norm_gen.tmpl
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
- -c $(UNICODE_TABLES_TIMESTAMP:yes=-t$@) \
- -o $(srcdir)/lib/unicode_normalize/tables.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):
- $(gnumake_recursive)$(Q) $(MAKEDIRS) $@
-
-$(UNICODE_HDR_DIR)/$(ALWAYS_UPDATE_UNICODE:yes=name2ctype.h): \
- $(srcdir)/tool/enc-unicode.rb \
- $(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
- $(UNICODE_PROPERTY_FILES) \
- $(UNICODE_EMOJI_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)
+ enc/unicode/data/$(UNICODE_VERSION) lib/unicode_normalize
download-extlibs:
$(Q) $(BASERUBY) -C $(srcdir) -w tool/extlibs.rb --download ext
@@ -1490,9 +961,6 @@ extract-extlibs:
clean-extlibs:
$(Q) $(RMALL) $(srcdir)/.downloaded-cache
-clean-gems:
- $(Q) $(RM) gems/*.gem
-
CLEAN_CACHE = clean-extlibs
info: info-program info-libruby_a info-libruby_so info-arch
@@ -1505,62 +973,48 @@ info-libruby_so: PHONY
info-arch: PHONY
@echo arch=$(arch)
-exam: check
+change: PHONY
+ $(BASERUBY) -C "$(srcdir)" ./tool/change_maker.rb $(CHANGES) > change.log
-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) echo > $(NULL)
-update-man-date: PHONY
- -$(Q) $(BASERUBY) -I"$(srcdir)/tool/lib" -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_EXTRA_TASKS = ""
-
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-tool test-all test-spec" \
- " test: ruby core tests [BTESTS=<bootstraptest files>]" \
- " test-all: all ruby tests [TESTOPTS=-j4 TESTS=<test files>]" \
- " test-spec: run the Ruby spec suite [SPECOPTS=<specs, opts>]" \
- " test-bundler: run the Bundler spec" \
- " test-bundled-gems: run the test suite of bundled gems" \
- " test-tool: tests under the tool/test" \
- " update-gems: download files of the bundled gems" \
- " update-bundled_gems: update the latest version of bundled gems" \
- " sync-default-gems: sync default gems from upstream [GEM=<gem_name>]" \
- " up: update local copy and autogenerated files" \
- " benchmark: benchmark this ruby and COMPARE_RUBY." \
- " gcbench: gc benchmark [GCBENCH_ITEM=<item_name>]" \
- " install: install all ruby distributions" \
- " install-nodoc: install without rdoc" \
- " install-cross: install cross compiling stuff" \
- " clean: clean for tarball" \
- " distclean: clean for repository" \
- " golf: build goruby for golfers" \
- $(HELP_EXTRA_TASKS) \
+ " 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)
@@ -1569,137 +1023,77 @@ help: PHONY
addr2line.$(OBJEXT): {$(VPATH)}addr2line.c
addr2line.$(OBJEXT): {$(VPATH)}addr2line.h
addr2line.$(OBJEXT): {$(VPATH)}config.h
-addr2line.$(OBJEXT): {$(VPATH)}defines.h
addr2line.$(OBJEXT): {$(VPATH)}missing.h
-array.$(OBJEXT): $(hdrdir)/ruby.h
array.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+array.$(OBJEXT): $(top_srcdir)/include/ruby.h
array.$(OBJEXT): {$(VPATH)}array.c
-array.$(OBJEXT): {$(VPATH)}assert.h
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)}transient_heap.h
array.$(OBJEXT): {$(VPATH)}util.h
-ast.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-ast.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-ast.$(OBJEXT): $(CCAN_DIR)/list/list.h
-ast.$(OBJEXT): $(CCAN_DIR)/str/str.h
-ast.$(OBJEXT): $(hdrdir)/ruby.h
-ast.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-ast.$(OBJEXT): {$(VPATH)}assert.h
-ast.$(OBJEXT): {$(VPATH)}ast.c
-ast.$(OBJEXT): {$(VPATH)}ast.rbinc
-ast.$(OBJEXT): {$(VPATH)}builtin.h
-ast.$(OBJEXT): {$(VPATH)}config.h
-ast.$(OBJEXT): {$(VPATH)}defines.h
-ast.$(OBJEXT): {$(VPATH)}encoding.h
-ast.$(OBJEXT): {$(VPATH)}id.h
-ast.$(OBJEXT): {$(VPATH)}intern.h
-ast.$(OBJEXT): {$(VPATH)}internal.h
-ast.$(OBJEXT): {$(VPATH)}iseq.h
-ast.$(OBJEXT): {$(VPATH)}method.h
-ast.$(OBJEXT): {$(VPATH)}missing.h
-ast.$(OBJEXT): {$(VPATH)}node.h
-ast.$(OBJEXT): {$(VPATH)}onigmo.h
-ast.$(OBJEXT): {$(VPATH)}oniguruma.h
-ast.$(OBJEXT): {$(VPATH)}ruby_assert.h
-ast.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-ast.$(OBJEXT): {$(VPATH)}st.h
-ast.$(OBJEXT): {$(VPATH)}subst.h
-ast.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-ast.$(OBJEXT): {$(VPATH)}thread_native.h
-ast.$(OBJEXT): {$(VPATH)}util.h
-ast.$(OBJEXT): {$(VPATH)}vm_core.h
-ast.$(OBJEXT): {$(VPATH)}vm_opts.h
-bignum.$(OBJEXT): $(hdrdir)/ruby.h
+array.$(OBJEXT): {$(VPATH)}vm_opts.h
+ascii.$(OBJEXT): {$(VPATH)}ascii.c
+ascii.$(OBJEXT): {$(VPATH)}config.h
+ascii.$(OBJEXT): {$(VPATH)}defines.h
+ascii.$(OBJEXT): {$(VPATH)}missing.h
+ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
+ascii.$(OBJEXT): {$(VPATH)}regenc.h
bignum.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-bignum.$(OBJEXT): {$(VPATH)}assert.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)}id.h
+bignum.$(OBJEXT): {$(VPATH)}encoding.h
bignum.$(OBJEXT): {$(VPATH)}intern.h
bignum.$(OBJEXT): {$(VPATH)}internal.h
+bignum.$(OBJEXT): {$(VPATH)}io.h
bignum.$(OBJEXT): {$(VPATH)}missing.h
-bignum.$(OBJEXT): {$(VPATH)}ruby_assert.h
+bignum.$(OBJEXT): {$(VPATH)}oniguruma.h
bignum.$(OBJEXT): {$(VPATH)}st.h
bignum.$(OBJEXT): {$(VPATH)}subst.h
bignum.$(OBJEXT): {$(VPATH)}thread.h
bignum.$(OBJEXT): {$(VPATH)}util.h
-builtin.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-builtin.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-builtin.$(OBJEXT): $(CCAN_DIR)/list/list.h
-builtin.$(OBJEXT): $(CCAN_DIR)/str/str.h
-builtin.$(OBJEXT): $(hdrdir)/ruby.h
-builtin.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-builtin.$(OBJEXT): {$(VPATH)}assert.h
-builtin.$(OBJEXT): {$(VPATH)}builtin.c
-builtin.$(OBJEXT): {$(VPATH)}builtin.h
-builtin.$(OBJEXT): {$(VPATH)}builtin_binary.inc
-builtin.$(OBJEXT): {$(VPATH)}config.h
-builtin.$(OBJEXT): {$(VPATH)}defines.h
-builtin.$(OBJEXT): {$(VPATH)}id.h
-builtin.$(OBJEXT): {$(VPATH)}intern.h
-builtin.$(OBJEXT): {$(VPATH)}internal.h
-builtin.$(OBJEXT): {$(VPATH)}iseq.h
-builtin.$(OBJEXT): {$(VPATH)}method.h
-builtin.$(OBJEXT): {$(VPATH)}missing.h
-builtin.$(OBJEXT): {$(VPATH)}node.h
-builtin.$(OBJEXT): {$(VPATH)}ruby_assert.h
-builtin.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-builtin.$(OBJEXT): {$(VPATH)}st.h
-builtin.$(OBJEXT): {$(VPATH)}subst.h
-builtin.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-builtin.$(OBJEXT): {$(VPATH)}thread_native.h
-builtin.$(OBJEXT): {$(VPATH)}vm_core.h
-builtin.$(OBJEXT): {$(VPATH)}vm_opts.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.h
class.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-class.$(OBJEXT): {$(VPATH)}assert.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)}ruby_assert.h
+class.$(OBJEXT): {$(VPATH)}oniguruma.h
class.$(OBJEXT): {$(VPATH)}ruby_atomic.h
class.$(OBJEXT): {$(VPATH)}st.h
class.$(OBJEXT): {$(VPATH)}subst.h
class.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
class.$(OBJEXT): {$(VPATH)}thread_native.h
class.$(OBJEXT): {$(VPATH)}vm_core.h
+class.$(OBJEXT): {$(VPATH)}vm_debug.h
class.$(OBJEXT): {$(VPATH)}vm_opts.h
-compar.$(OBJEXT): $(hdrdir)/ruby.h
compar.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-compar.$(OBJEXT): {$(VPATH)}assert.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)}internal.h
compar.$(OBJEXT): {$(VPATH)}missing.h
compar.$(OBJEXT): {$(VPATH)}st.h
compar.$(OBJEXT): {$(VPATH)}subst.h
@@ -1707,99 +1101,84 @@ 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.h
compile.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-compile.$(OBJEXT): {$(VPATH)}assert.h
-compile.$(OBJEXT): {$(VPATH)}builtin.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.def
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)}util.h
compile.$(OBJEXT): {$(VPATH)}vm_core.h
compile.$(OBJEXT): {$(VPATH)}vm_debug.h
compile.$(OBJEXT): {$(VPATH)}vm_opts.h
-complex.$(OBJEXT): $(hdrdir)/ruby.h
complex.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-complex.$(OBJEXT): {$(VPATH)}assert.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)}id.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)}ruby_assert.h
+complex.$(OBJEXT): {$(VPATH)}oniguruma.h
complex.$(OBJEXT): {$(VPATH)}st.h
complex.$(OBJEXT): {$(VPATH)}subst.h
cont.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
cont.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
cont.$(OBJEXT): $(CCAN_DIR)/list/list.h
cont.$(OBJEXT): $(CCAN_DIR)/str/str.h
-cont.$(OBJEXT): $(hdrdir)/ruby.h
cont.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-cont.$(OBJEXT): {$(VPATH)}$(COROUTINE_H)
-cont.$(OBJEXT): {$(VPATH)}assert.h
+cont.$(OBJEXT): $(top_srcdir)/include/ruby.h
cont.$(OBJEXT): {$(VPATH)}config.h
cont.$(OBJEXT): {$(VPATH)}cont.c
-cont.$(OBJEXT): {$(VPATH)}debug_counter.h
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)}mjit.h
cont.$(OBJEXT): {$(VPATH)}node.h
-cont.$(OBJEXT): {$(VPATH)}ruby_assert.h
+cont.$(OBJEXT): {$(VPATH)}oniguruma.h
cont.$(OBJEXT): {$(VPATH)}ruby_atomic.h
cont.$(OBJEXT): {$(VPATH)}st.h
cont.$(OBJEXT): {$(VPATH)}subst.h
cont.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
cont.$(OBJEXT): {$(VPATH)}thread_native.h
cont.$(OBJEXT): {$(VPATH)}vm_core.h
+cont.$(OBJEXT): {$(VPATH)}vm_debug.h
cont.$(OBJEXT): {$(VPATH)}vm_opts.h
debug.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
debug.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
debug.$(OBJEXT): $(CCAN_DIR)/list/list.h
debug.$(OBJEXT): $(CCAN_DIR)/str/str.h
-debug.$(OBJEXT): $(hdrdir)/ruby.h
debug.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-debug.$(OBJEXT): {$(VPATH)}assert.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
@@ -1807,63 +1186,40 @@ 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.h
-debug_counter.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-debug_counter.$(OBJEXT): {$(VPATH)}assert.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)}intern.h
-debug_counter.$(OBJEXT): {$(VPATH)}internal.h
-debug_counter.$(OBJEXT): {$(VPATH)}missing.h
-debug_counter.$(OBJEXT): {$(VPATH)}st.h
-debug_counter.$(OBJEXT): {$(VPATH)}subst.h
-dir.$(OBJEXT): $(hdrdir)/ruby.h
dir.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-dir.$(OBJEXT): {$(VPATH)}assert.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)}id.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)}thread.h
dir.$(OBJEXT): {$(VPATH)}util.h
-dln.$(OBJEXT): $(hdrdir)/ruby.h
dln.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-dln.$(OBJEXT): {$(VPATH)}assert.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)}internal.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)}assert.h
dln_find.$(OBJEXT): {$(VPATH)}config.h
dln_find.$(OBJEXT): {$(VPATH)}defines.h
dln_find.$(OBJEXT): {$(VPATH)}dln.h
@@ -1873,7 +1229,6 @@ 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)}assert.h
dmydln.$(OBJEXT): {$(VPATH)}config.h
dmydln.$(OBJEXT): {$(VPATH)}defines.h
dmydln.$(OBJEXT): {$(VPATH)}dmydln.c
@@ -1883,67 +1238,23 @@ 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)}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)}onigmo.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)}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)}regenc.h
-encoding.$(OBJEXT): $(hdrdir)/ruby.h
encoding.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-encoding.$(OBJEXT): {$(VPATH)}assert.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.h
enum.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enum.$(OBJEXT): {$(VPATH)}assert.h
+enum.$(OBJEXT): $(top_srcdir)/include/ruby.h
enum.$(OBJEXT): {$(VPATH)}config.h
enum.$(OBJEXT): {$(VPATH)}defines.h
enum.$(OBJEXT): {$(VPATH)}encoding.h
@@ -1951,66 +1262,63 @@ 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)}node.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.h
enumerator.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enumerator.$(OBJEXT): {$(VPATH)}assert.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)}id.h
enumerator.$(OBJEXT): {$(VPATH)}intern.h
enumerator.$(OBJEXT): {$(VPATH)}internal.h
+enumerator.$(OBJEXT): {$(VPATH)}io.h
enumerator.$(OBJEXT): {$(VPATH)}missing.h
+enumerator.$(OBJEXT): {$(VPATH)}node.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.h
error.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-error.$(OBJEXT): {$(VPATH)}assert.h
-error.$(OBJEXT): {$(VPATH)}builtin.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)}eval_intern.h
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
-error.$(OBJEXT): {$(VPATH)}warning.rbinc
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.h
eval.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-eval.$(OBJEXT): {$(VPATH)}assert.h
+eval.$(OBJEXT): $(top_srcdir)/include/ruby.h
eval.$(OBJEXT): {$(VPATH)}config.h
-eval.$(OBJEXT): {$(VPATH)}debug_counter.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
@@ -2019,15 +1327,14 @@ 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)}mjit.h
eval.$(OBJEXT): {$(VPATH)}node.h
-eval.$(OBJEXT): {$(VPATH)}probes.dmyh
+eval.$(OBJEXT): {$(VPATH)}oniguruma.h
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
@@ -2035,25 +1342,19 @@ 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.h
file.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-file.$(OBJEXT): {$(VPATH)}assert.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
@@ -2063,79 +1364,67 @@ 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.h
gc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-gc.$(OBJEXT): {$(VPATH)}assert.h
-gc.$(OBJEXT): {$(VPATH)}builtin.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)}gc.rbinc
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)}mjit.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)}symbol.h
gc.$(OBJEXT): {$(VPATH)}thread.h
gc.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
gc.$(OBJEXT): {$(VPATH)}thread_native.h
-gc.$(OBJEXT): {$(VPATH)}transient_heap.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.h
golf_prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-golf_prelude.$(OBJEXT): {$(VPATH)}assert.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)}golf_prelude.rb
golf_prelude.$(OBJEXT): {$(VPATH)}id.h
golf_prelude.$(OBJEXT): {$(VPATH)}intern.h
golf_prelude.$(OBJEXT): {$(VPATH)}internal.h
-golf_prelude.$(OBJEXT): {$(VPATH)}iseq.h
+golf_prelude.$(OBJEXT): {$(VPATH)}io.h
golf_prelude.$(OBJEXT): {$(VPATH)}method.h
golf_prelude.$(OBJEXT): {$(VPATH)}missing.h
golf_prelude.$(OBJEXT): {$(VPATH)}node.h
-golf_prelude.$(OBJEXT): {$(VPATH)}ruby_assert.h
+golf_prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
golf_prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
golf_prelude.$(OBJEXT): {$(VPATH)}st.h
golf_prelude.$(OBJEXT): {$(VPATH)}subst.h
golf_prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
golf_prelude.$(OBJEXT): {$(VPATH)}thread_native.h
golf_prelude.$(OBJEXT): {$(VPATH)}vm_core.h
+golf_prelude.$(OBJEXT): {$(VPATH)}vm_debug.h
golf_prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
-goruby.$(OBJEXT): $(hdrdir)/ruby.h
goruby.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-goruby.$(OBJEXT): {$(VPATH)}assert.h
-goruby.$(OBJEXT): {$(VPATH)}backward.h
+goruby.$(OBJEXT): $(top_srcdir)/include/ruby.h
goruby.$(OBJEXT): {$(VPATH)}config.h
goruby.$(OBJEXT): {$(VPATH)}defines.h
goruby.$(OBJEXT): {$(VPATH)}goruby.c
@@ -2146,103 +1435,79 @@ 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.h
hash.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-hash.$(OBJEXT): {$(VPATH)}assert.h
+hash.$(OBJEXT): $(top_srcdir)/include/ruby.h
hash.$(OBJEXT): {$(VPATH)}config.h
-hash.$(OBJEXT): {$(VPATH)}debug_counter.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)}ruby_assert.h
hash.$(OBJEXT): {$(VPATH)}st.h
hash.$(OBJEXT): {$(VPATH)}subst.h
hash.$(OBJEXT): {$(VPATH)}symbol.h
-hash.$(OBJEXT): {$(VPATH)}transient_heap.h
hash.$(OBJEXT): {$(VPATH)}util.h
-inits.$(OBJEXT): $(hdrdir)/ruby.h
+hash.$(OBJEXT): {$(VPATH)}vm_opts.h
inits.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-inits.$(OBJEXT): {$(VPATH)}assert.h
-inits.$(OBJEXT): {$(VPATH)}builtin.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)}prelude.rbinc
+inits.$(OBJEXT): {$(VPATH)}oniguruma.h
inits.$(OBJEXT): {$(VPATH)}st.h
inits.$(OBJEXT): {$(VPATH)}subst.h
-io.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-io.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-io.$(OBJEXT): $(CCAN_DIR)/list/list.h
-io.$(OBJEXT): $(CCAN_DIR)/str/str.h
-io.$(OBJEXT): $(hdrdir)/ruby.h
io.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-io.$(OBJEXT): {$(VPATH)}assert.h
-io.$(OBJEXT): {$(VPATH)}builtin.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)}io.rbinc
-io.$(OBJEXT): {$(VPATH)}method.h
io.$(OBJEXT): {$(VPATH)}missing.h
-io.$(OBJEXT): {$(VPATH)}node.h
-io.$(OBJEXT): {$(VPATH)}onigmo.h
io.$(OBJEXT): {$(VPATH)}oniguruma.h
-io.$(OBJEXT): {$(VPATH)}ruby_assert.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)}thread_$(THREAD_MODEL).h
-io.$(OBJEXT): {$(VPATH)}thread_native.h
io.$(OBJEXT): {$(VPATH)}util.h
-io.$(OBJEXT): {$(VPATH)}vm_core.h
-io.$(OBJEXT): {$(VPATH)}vm_opts.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.h
iseq.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-iseq.$(OBJEXT): {$(VPATH)}assert.h
-iseq.$(OBJEXT): {$(VPATH)}builtin.h
+iseq.$(OBJEXT): $(top_srcdir)/include/ruby.h
iseq.$(OBJEXT): {$(VPATH)}config.h
-iseq.$(OBJEXT): {$(VPATH)}debug_counter.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.def
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)}mjit.h
iseq.$(OBJEXT): {$(VPATH)}node.h
iseq.$(OBJEXT): {$(VPATH)}node_name.inc
-iseq.$(OBJEXT): {$(VPATH)}ruby_assert.h
+iseq.$(OBJEXT): {$(VPATH)}oniguruma.h
iseq.$(OBJEXT): {$(VPATH)}ruby_atomic.h
iseq.$(OBJEXT): {$(VPATH)}st.h
iseq.$(OBJEXT): {$(VPATH)}subst.h
@@ -2250,14 +1515,14 @@ 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.h
load.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-load.$(OBJEXT): {$(VPATH)}assert.h
+load.$(OBJEXT): $(top_srcdir)/include/ruby.h
load.$(OBJEXT): {$(VPATH)}config.h
load.$(OBJEXT): {$(VPATH)}defines.h
load.$(OBJEXT): {$(VPATH)}dln.h
@@ -2266,16 +1531,13 @@ load.$(OBJEXT): {$(VPATH)}eval_intern.h
load.$(OBJEXT): {$(VPATH)}id.h
load.$(OBJEXT): {$(VPATH)}intern.h
load.$(OBJEXT): {$(VPATH)}internal.h
-load.$(OBJEXT): {$(VPATH)}iseq.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
@@ -2283,11 +1545,11 @@ 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)}assert.h
loadpath.$(OBJEXT): {$(VPATH)}config.h
loadpath.$(OBJEXT): {$(VPATH)}defines.h
loadpath.$(OBJEXT): {$(VPATH)}intern.h
@@ -2296,25 +1558,21 @@ loadpath.$(OBJEXT): {$(VPATH)}missing.h
loadpath.$(OBJEXT): {$(VPATH)}st.h
loadpath.$(OBJEXT): {$(VPATH)}subst.h
loadpath.$(OBJEXT): {$(VPATH)}verconf.h
-localeinit.$(OBJEXT): $(hdrdir)/ruby.h
localeinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-localeinit.$(OBJEXT): {$(VPATH)}assert.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.h
main.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-main.$(OBJEXT): {$(VPATH)}assert.h
-main.$(OBJEXT): {$(VPATH)}backward.h
+main.$(OBJEXT): $(top_srcdir)/include/ruby.h
main.$(OBJEXT): {$(VPATH)}config.h
main.$(OBJEXT): {$(VPATH)}defines.h
main.$(OBJEXT): {$(VPATH)}intern.h
@@ -2324,186 +1582,96 @@ 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.h
marshal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-marshal.$(OBJEXT): {$(VPATH)}assert.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.h
math.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-math.$(OBJEXT): {$(VPATH)}assert.h
+math.$(OBJEXT): $(top_srcdir)/include/ruby.h
math.$(OBJEXT): {$(VPATH)}config.h
math.$(OBJEXT): {$(VPATH)}defines.h
+math.$(OBJEXT): {$(VPATH)}encoding.h
math.$(OBJEXT): {$(VPATH)}intern.h
math.$(OBJEXT): {$(VPATH)}internal.h
+math.$(OBJEXT): {$(VPATH)}io.h
math.$(OBJEXT): {$(VPATH)}math.c
math.$(OBJEXT): {$(VPATH)}missing.h
+math.$(OBJEXT): {$(VPATH)}oniguruma.h
math.$(OBJEXT): {$(VPATH)}st.h
math.$(OBJEXT): {$(VPATH)}subst.h
-miniinit.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-miniinit.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-miniinit.$(OBJEXT): $(CCAN_DIR)/list/list.h
-miniinit.$(OBJEXT): $(CCAN_DIR)/str/str.h
-miniinit.$(OBJEXT): $(hdrdir)/ruby.h
miniinit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-miniinit.$(OBJEXT): {$(VPATH)}assert.h
-miniinit.$(OBJEXT): {$(VPATH)}ast.rb
-miniinit.$(OBJEXT): {$(VPATH)}builtin.h
miniinit.$(OBJEXT): {$(VPATH)}config.h
miniinit.$(OBJEXT): {$(VPATH)}defines.h
miniinit.$(OBJEXT): {$(VPATH)}encoding.h
-miniinit.$(OBJEXT): {$(VPATH)}gc.rb
-miniinit.$(OBJEXT): {$(VPATH)}gem_prelude.rb
-miniinit.$(OBJEXT): {$(VPATH)}id.h
miniinit.$(OBJEXT): {$(VPATH)}intern.h
-miniinit.$(OBJEXT): {$(VPATH)}internal.h
-miniinit.$(OBJEXT): {$(VPATH)}io.rb
-miniinit.$(OBJEXT): {$(VPATH)}iseq.h
-miniinit.$(OBJEXT): {$(VPATH)}method.h
-miniinit.$(OBJEXT): {$(VPATH)}mini_builtin.c
miniinit.$(OBJEXT): {$(VPATH)}miniinit.c
-miniinit.$(OBJEXT): {$(VPATH)}miniprelude.c
miniinit.$(OBJEXT): {$(VPATH)}missing.h
-miniinit.$(OBJEXT): {$(VPATH)}node.h
-miniinit.$(OBJEXT): {$(VPATH)}onigmo.h
miniinit.$(OBJEXT): {$(VPATH)}oniguruma.h
-miniinit.$(OBJEXT): {$(VPATH)}pack.rb
-miniinit.$(OBJEXT): {$(VPATH)}prelude.rb
-miniinit.$(OBJEXT): {$(VPATH)}ruby_assert.h
-miniinit.$(OBJEXT): {$(VPATH)}ruby_atomic.h
miniinit.$(OBJEXT): {$(VPATH)}st.h
miniinit.$(OBJEXT): {$(VPATH)}subst.h
-miniinit.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-miniinit.$(OBJEXT): {$(VPATH)}thread_native.h
-miniinit.$(OBJEXT): {$(VPATH)}trace_point.rb
-miniinit.$(OBJEXT): {$(VPATH)}vm_core.h
-miniinit.$(OBJEXT): {$(VPATH)}vm_opts.h
-miniinit.$(OBJEXT): {$(VPATH)}warning.rb
-mjit.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-mjit.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-mjit.$(OBJEXT): $(CCAN_DIR)/list/list.h
-mjit.$(OBJEXT): $(CCAN_DIR)/str/str.h
-mjit.$(OBJEXT): $(hdrdir)/ruby.h
-mjit.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-mjit.$(OBJEXT): {$(VPATH)}assert.h
-mjit.$(OBJEXT): {$(VPATH)}config.h
-mjit.$(OBJEXT): {$(VPATH)}constant.h
-mjit.$(OBJEXT): {$(VPATH)}debug.h
-mjit.$(OBJEXT): {$(VPATH)}debug_counter.h
-mjit.$(OBJEXT): {$(VPATH)}defines.h
-mjit.$(OBJEXT): {$(VPATH)}dln.h
-mjit.$(OBJEXT): {$(VPATH)}gc.h
-mjit.$(OBJEXT): {$(VPATH)}id.h
-mjit.$(OBJEXT): {$(VPATH)}id_table.h
-mjit.$(OBJEXT): {$(VPATH)}intern.h
-mjit.$(OBJEXT): {$(VPATH)}internal.h
-mjit.$(OBJEXT): {$(VPATH)}method.h
-mjit.$(OBJEXT): {$(VPATH)}missing.h
-mjit.$(OBJEXT): {$(VPATH)}mjit.c
-mjit.$(OBJEXT): {$(VPATH)}mjit.h
-mjit.$(OBJEXT): {$(VPATH)}mjit_config.h
-mjit.$(OBJEXT): {$(VPATH)}mjit_worker.c
-mjit.$(OBJEXT): {$(VPATH)}node.h
-mjit.$(OBJEXT): {$(VPATH)}ruby_assert.h
-mjit.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-mjit.$(OBJEXT): {$(VPATH)}st.h
-mjit.$(OBJEXT): {$(VPATH)}subst.h
-mjit.$(OBJEXT): {$(VPATH)}thread.h
-mjit.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-mjit.$(OBJEXT): {$(VPATH)}thread_native.h
-mjit.$(OBJEXT): {$(VPATH)}util.h
-mjit.$(OBJEXT): {$(VPATH)}vm_core.h
-mjit.$(OBJEXT): {$(VPATH)}vm_opts.h
-mjit_compile.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-mjit_compile.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-mjit_compile.$(OBJEXT): $(CCAN_DIR)/list/list.h
-mjit_compile.$(OBJEXT): $(CCAN_DIR)/str/str.h
-mjit_compile.$(OBJEXT): $(hdrdir)/ruby.h
-mjit_compile.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-mjit_compile.$(OBJEXT): {$(VPATH)}assert.h
-mjit_compile.$(OBJEXT): {$(VPATH)}builtin.h
-mjit_compile.$(OBJEXT): {$(VPATH)}config.h
-mjit_compile.$(OBJEXT): {$(VPATH)}debug_counter.h
-mjit_compile.$(OBJEXT): {$(VPATH)}defines.h
-mjit_compile.$(OBJEXT): {$(VPATH)}id.h
-mjit_compile.$(OBJEXT): {$(VPATH)}insns.def
-mjit_compile.$(OBJEXT): {$(VPATH)}insns.inc
-mjit_compile.$(OBJEXT): {$(VPATH)}insns_info.inc
-mjit_compile.$(OBJEXT): {$(VPATH)}intern.h
-mjit_compile.$(OBJEXT): {$(VPATH)}internal.h
-mjit_compile.$(OBJEXT): {$(VPATH)}iseq.h
-mjit_compile.$(OBJEXT): {$(VPATH)}method.h
-mjit_compile.$(OBJEXT): {$(VPATH)}missing.h
-mjit_compile.$(OBJEXT): {$(VPATH)}mjit.h
-mjit_compile.$(OBJEXT): {$(VPATH)}mjit_compile.c
-mjit_compile.$(OBJEXT): {$(VPATH)}mjit_compile.inc
-mjit_compile.$(OBJEXT): {$(VPATH)}node.h
-mjit_compile.$(OBJEXT): {$(VPATH)}ruby_assert.h
-mjit_compile.$(OBJEXT): {$(VPATH)}ruby_atomic.h
-mjit_compile.$(OBJEXT): {$(VPATH)}st.h
-mjit_compile.$(OBJEXT): {$(VPATH)}subst.h
-mjit_compile.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-mjit_compile.$(OBJEXT): {$(VPATH)}thread_native.h
-mjit_compile.$(OBJEXT): {$(VPATH)}vm_core.h
-mjit_compile.$(OBJEXT): {$(VPATH)}vm_exec.h
-mjit_compile.$(OBJEXT): {$(VPATH)}vm_insnhelper.h
-mjit_compile.$(OBJEXT): {$(VPATH)}vm_opts.h
+miniprelude.$(OBJEXT): {$(VPATH)}miniprelude.c
+newline.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+newline.$(OBJEXT): {$(VPATH)}config.h
+newline.$(OBJEXT): {$(VPATH)}defines.h
+newline.$(OBJEXT): {$(VPATH)}intern.h
+newline.$(OBJEXT): {$(VPATH)}missing.h
+newline.$(OBJEXT): {$(VPATH)}newline.c
+newline.$(OBJEXT): {$(VPATH)}st.h
+newline.$(OBJEXT): {$(VPATH)}subst.h
+newline.$(OBJEXT): {$(VPATH)}transcode_data.h
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.h
node.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-node.$(OBJEXT): {$(VPATH)}assert.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)}ruby_assert.h
+node.$(OBJEXT): {$(VPATH)}oniguruma.h
node.$(OBJEXT): {$(VPATH)}ruby_atomic.h
node.$(OBJEXT): {$(VPATH)}st.h
node.$(OBJEXT): {$(VPATH)}subst.h
node.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
node.$(OBJEXT): {$(VPATH)}thread_native.h
node.$(OBJEXT): {$(VPATH)}vm_core.h
+node.$(OBJEXT): {$(VPATH)}vm_debug.h
node.$(OBJEXT): {$(VPATH)}vm_opts.h
-numeric.$(OBJEXT): $(hdrdir)/ruby.h
numeric.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-numeric.$(OBJEXT): {$(VPATH)}assert.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.h
object.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-object.$(OBJEXT): {$(VPATH)}assert.h
+object.$(OBJEXT): $(top_srcdir)/include/ruby.h
object.$(OBJEXT): {$(VPATH)}config.h
object.$(OBJEXT): {$(VPATH)}constant.h
object.$(OBJEXT): {$(VPATH)}defines.h
@@ -2511,34 +1679,30 @@ 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.h
+object.$(OBJEXT): {$(VPATH)}vm_opts.h
pack.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-pack.$(OBJEXT): {$(VPATH)}assert.h
-pack.$(OBJEXT): {$(VPATH)}builtin.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)}pack.rbinc
pack.$(OBJEXT): {$(VPATH)}st.h
pack.$(OBJEXT): {$(VPATH)}subst.h
-parse.$(OBJEXT): $(hdrdir)/ruby.h
parse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-parse.$(OBJEXT): {$(VPATH)}assert.h
+parse.$(OBJEXT): $(top_srcdir)/include/ruby.h
parse.$(OBJEXT): {$(VPATH)}config.h
parse.$(OBJEXT): {$(VPATH)}defines.h
parse.$(OBJEXT): {$(VPATH)}defs/keywords
@@ -2546,15 +1710,14 @@ 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
@@ -2562,45 +1725,72 @@ parse.$(OBJEXT): {$(VPATH)}st.h
parse.$(OBJEXT): {$(VPATH)}subst.h
parse.$(OBJEXT): {$(VPATH)}symbol.h
parse.$(OBJEXT): {$(VPATH)}util.h
+parse.$(OBJEXT): {$(VPATH)}vm_opts.h
+prelude.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
+prelude.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
+prelude.$(OBJEXT): $(CCAN_DIR)/list/list.h
+prelude.$(OBJEXT): $(CCAN_DIR)/str/str.h
+prelude.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+prelude.$(OBJEXT): $(top_srcdir)/include/ruby.h
+prelude.$(OBJEXT): {$(VPATH)}config.h
+prelude.$(OBJEXT): {$(VPATH)}defines.h
+prelude.$(OBJEXT): {$(VPATH)}encoding.h
+prelude.$(OBJEXT): {$(VPATH)}id.h
+prelude.$(OBJEXT): {$(VPATH)}intern.h
+prelude.$(OBJEXT): {$(VPATH)}internal.h
+prelude.$(OBJEXT): {$(VPATH)}io.h
+prelude.$(OBJEXT): {$(VPATH)}method.h
+prelude.$(OBJEXT): {$(VPATH)}missing.h
+prelude.$(OBJEXT): {$(VPATH)}node.h
+prelude.$(OBJEXT): {$(VPATH)}oniguruma.h
+prelude.$(OBJEXT): {$(VPATH)}prelude.c
+prelude.$(OBJEXT): {$(VPATH)}ruby_atomic.h
+prelude.$(OBJEXT): {$(VPATH)}st.h
+prelude.$(OBJEXT): {$(VPATH)}subst.h
+prelude.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
+prelude.$(OBJEXT): {$(VPATH)}thread_native.h
+prelude.$(OBJEXT): {$(VPATH)}vm_core.h
+prelude.$(OBJEXT): {$(VPATH)}vm_debug.h
+prelude.$(OBJEXT): {$(VPATH)}vm_opts.h
proc.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
proc.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
proc.$(OBJEXT): $(CCAN_DIR)/list/list.h
proc.$(OBJEXT): $(CCAN_DIR)/str/str.h
-proc.$(OBJEXT): $(hdrdir)/ruby.h
proc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-proc.$(OBJEXT): {$(VPATH)}assert.h
+proc.$(OBJEXT): $(top_srcdir)/include/ruby.h
proc.$(OBJEXT): {$(VPATH)}config.h
proc.$(OBJEXT): {$(VPATH)}defines.h
+proc.$(OBJEXT): {$(VPATH)}encoding.h
proc.$(OBJEXT): {$(VPATH)}eval_intern.h
proc.$(OBJEXT): {$(VPATH)}gc.h
proc.$(OBJEXT): {$(VPATH)}id.h
proc.$(OBJEXT): {$(VPATH)}intern.h
proc.$(OBJEXT): {$(VPATH)}internal.h
+proc.$(OBJEXT): {$(VPATH)}io.h
proc.$(OBJEXT): {$(VPATH)}iseq.h
proc.$(OBJEXT): {$(VPATH)}method.h
proc.$(OBJEXT): {$(VPATH)}missing.h
proc.$(OBJEXT): {$(VPATH)}node.h
+proc.$(OBJEXT): {$(VPATH)}oniguruma.h
proc.$(OBJEXT): {$(VPATH)}proc.c
-proc.$(OBJEXT): {$(VPATH)}ruby_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.h
process.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-process.$(OBJEXT): {$(VPATH)}assert.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)}hrtime.h
process.$(OBJEXT): {$(VPATH)}id.h
process.$(OBJEXT): {$(VPATH)}intern.h
process.$(OBJEXT): {$(VPATH)}internal.h
@@ -2608,10 +1798,8 @@ 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
@@ -2620,58 +1808,59 @@ 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.h
random.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-random.$(OBJEXT): {$(VPATH)}assert.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)}mt19937.c
+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.h
range.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-range.$(OBJEXT): {$(VPATH)}assert.h
+range.$(OBJEXT): $(top_srcdir)/include/ruby.h
range.$(OBJEXT): {$(VPATH)}config.h
range.$(OBJEXT): {$(VPATH)}defines.h
+range.$(OBJEXT): {$(VPATH)}encoding.h
range.$(OBJEXT): {$(VPATH)}id.h
range.$(OBJEXT): {$(VPATH)}intern.h
range.$(OBJEXT): {$(VPATH)}internal.h
+range.$(OBJEXT): {$(VPATH)}io.h
range.$(OBJEXT): {$(VPATH)}missing.h
+range.$(OBJEXT): {$(VPATH)}oniguruma.h
range.$(OBJEXT): {$(VPATH)}range.c
range.$(OBJEXT): {$(VPATH)}st.h
range.$(OBJEXT): {$(VPATH)}subst.h
-rational.$(OBJEXT): $(hdrdir)/ruby.h
rational.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-rational.$(OBJEXT): {$(VPATH)}assert.h
+rational.$(OBJEXT): $(top_srcdir)/include/ruby.h
rational.$(OBJEXT): {$(VPATH)}config.h
rational.$(OBJEXT): {$(VPATH)}defines.h
-rational.$(OBJEXT): {$(VPATH)}id.h
+rational.$(OBJEXT): {$(VPATH)}encoding.h
rational.$(OBJEXT): {$(VPATH)}intern.h
rational.$(OBJEXT): {$(VPATH)}internal.h
+rational.$(OBJEXT): {$(VPATH)}io.h
rational.$(OBJEXT): {$(VPATH)}missing.h
+rational.$(OBJEXT): {$(VPATH)}oniguruma.h
rational.$(OBJEXT): {$(VPATH)}rational.c
-rational.$(OBJEXT): {$(VPATH)}ruby_assert.h
rational.$(OBJEXT): {$(VPATH)}st.h
rational.$(OBJEXT): {$(VPATH)}subst.h
-re.$(OBJEXT): $(hdrdir)/ruby.h
re.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-re.$(OBJEXT): {$(VPATH)}assert.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
@@ -2682,12 +1871,11 @@ re.$(OBJEXT): {$(VPATH)}st.h
re.$(OBJEXT): {$(VPATH)}subst.h
re.$(OBJEXT): {$(VPATH)}util.h
regcomp.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regcomp.$(OBJEXT): {$(VPATH)}assert.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
@@ -2695,48 +1883,44 @@ regcomp.$(OBJEXT): {$(VPATH)}regparse.h
regcomp.$(OBJEXT): {$(VPATH)}st.h
regcomp.$(OBJEXT): {$(VPATH)}subst.h
regenc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regenc.$(OBJEXT): {$(VPATH)}assert.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)}assert.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)}assert.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)}assert.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
@@ -2744,30 +1928,23 @@ regparse.$(OBJEXT): {$(VPATH)}regparse.h
regparse.$(OBJEXT): {$(VPATH)}st.h
regparse.$(OBJEXT): {$(VPATH)}subst.h
regsyntax.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-regsyntax.$(OBJEXT): {$(VPATH)}assert.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)}config.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.h
ruby.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-ruby.$(OBJEXT): $(hdrdir)/ruby/version.h
-ruby.$(OBJEXT): {$(VPATH)}assert.h
+ruby.$(OBJEXT): $(top_srcdir)/include/ruby.h
ruby.$(OBJEXT): {$(VPATH)}config.h
-ruby.$(OBJEXT): {$(VPATH)}debug_counter.h
ruby.$(OBJEXT): {$(VPATH)}defines.h
ruby.$(OBJEXT): {$(VPATH)}dln.h
ruby.$(OBJEXT): {$(VPATH)}encoding.h
@@ -2775,39 +1952,38 @@ 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)}mjit.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.h
safe.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-safe.$(OBJEXT): {$(VPATH)}assert.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)}ruby_assert.h
+safe.$(OBJEXT): {$(VPATH)}oniguruma.h
safe.$(OBJEXT): {$(VPATH)}ruby_atomic.h
safe.$(OBJEXT): {$(VPATH)}safe.c
safe.$(OBJEXT): {$(VPATH)}st.h
@@ -2815,10 +1991,10 @@ 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.h
setproctitle.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-setproctitle.$(OBJEXT): {$(VPATH)}assert.h
+setproctitle.$(OBJEXT): $(top_srcdir)/include/ruby.h
setproctitle.$(OBJEXT): {$(VPATH)}config.h
setproctitle.$(OBJEXT): {$(VPATH)}defines.h
setproctitle.$(OBJEXT): {$(VPATH)}intern.h
@@ -2831,20 +2007,20 @@ 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.h
signal.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-signal.$(OBJEXT): {$(VPATH)}assert.h
+signal.$(OBJEXT): $(top_srcdir)/include/ruby.h
signal.$(OBJEXT): {$(VPATH)}config.h
-signal.$(OBJEXT): {$(VPATH)}debug_counter.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)}ruby_assert.h
+signal.$(OBJEXT): {$(VPATH)}oniguruma.h
signal.$(OBJEXT): {$(VPATH)}ruby_atomic.h
signal.$(OBJEXT): {$(VPATH)}signal.c
signal.$(OBJEXT): {$(VPATH)}st.h
@@ -2852,18 +2028,18 @@ 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.h
sprintf.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-sprintf.$(OBJEXT): {$(VPATH)}assert.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
@@ -2871,57 +2047,48 @@ sprintf.$(OBJEXT): {$(VPATH)}sprintf.c
sprintf.$(OBJEXT): {$(VPATH)}st.h
sprintf.$(OBJEXT): {$(VPATH)}subst.h
sprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
-st.$(OBJEXT): $(hdrdir)/ruby.h
st.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-st.$(OBJEXT): {$(VPATH)}assert.h
+st.$(OBJEXT): $(top_srcdir)/include/ruby.h
st.$(OBJEXT): {$(VPATH)}config.h
st.$(OBJEXT): {$(VPATH)}defines.h
+st.$(OBJEXT): {$(VPATH)}encoding.h
st.$(OBJEXT): {$(VPATH)}intern.h
st.$(OBJEXT): {$(VPATH)}internal.h
+st.$(OBJEXT): {$(VPATH)}io.h
st.$(OBJEXT): {$(VPATH)}missing.h
+st.$(OBJEXT): {$(VPATH)}oniguruma.h
st.$(OBJEXT): {$(VPATH)}st.c
st.$(OBJEXT): {$(VPATH)}st.h
st.$(OBJEXT): {$(VPATH)}subst.h
-strftime.$(OBJEXT): $(hdrdir)/ruby.h
strftime.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-strftime.$(OBJEXT): {$(VPATH)}assert.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)}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.h
string.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-string.$(OBJEXT): {$(VPATH)}assert.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
-string.$(OBJEXT): {$(VPATH)}util.h
+string.$(OBJEXT): {$(VPATH)}vm_opts.h
strlcat.$(OBJEXT): {$(VPATH)}config.h
strlcat.$(OBJEXT): {$(VPATH)}missing.h
strlcat.$(OBJEXT): {$(VPATH)}strlcat.c
@@ -2932,77 +2099,67 @@ 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.h
struct.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-struct.$(OBJEXT): {$(VPATH)}assert.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)}ruby_assert.h
+struct.$(OBJEXT): {$(VPATH)}oniguruma.h
struct.$(OBJEXT): {$(VPATH)}ruby_atomic.h
struct.$(OBJEXT): {$(VPATH)}st.h
struct.$(OBJEXT): {$(VPATH)}struct.c
struct.$(OBJEXT): {$(VPATH)}subst.h
struct.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
struct.$(OBJEXT): {$(VPATH)}thread_native.h
-struct.$(OBJEXT): {$(VPATH)}transient_heap.h
struct.$(OBJEXT): {$(VPATH)}vm_core.h
+struct.$(OBJEXT): {$(VPATH)}vm_debug.h
struct.$(OBJEXT): {$(VPATH)}vm_opts.h
-symbol.$(OBJEXT): $(hdrdir)/ruby.h
symbol.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-symbol.$(OBJEXT): {$(VPATH)}assert.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)}node.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
+symbol.$(OBJEXT): {$(VPATH)}vm_opts.h
thread.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
thread.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
thread.$(OBJEXT): $(CCAN_DIR)/list/list.h
thread.$(OBJEXT): $(CCAN_DIR)/str/str.h
-thread.$(OBJEXT): $(hdrdir)/ruby.h
thread.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-thread.$(OBJEXT): {$(VPATH)}assert.h
+thread.$(OBJEXT): $(top_srcdir)/include/ruby.h
thread.$(OBJEXT): {$(VPATH)}config.h
-thread.$(OBJEXT): {$(VPATH)}debug.h
-thread.$(OBJEXT): {$(VPATH)}debug_counter.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)}hrtime.h
thread.$(OBJEXT): {$(VPATH)}id.h
thread.$(OBJEXT): {$(VPATH)}intern.h
thread.$(OBJEXT): {$(VPATH)}internal.h
thread.$(OBJEXT): {$(VPATH)}io.h
-thread.$(OBJEXT): {$(VPATH)}iseq.h
thread.$(OBJEXT): {$(VPATH)}method.h
thread.$(OBJEXT): {$(VPATH)}missing.h
-thread.$(OBJEXT): {$(VPATH)}mjit.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
@@ -3011,176 +2168,139 @@ 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.h
time.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-time.$(OBJEXT): {$(VPATH)}assert.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.h
transcode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-transcode.$(OBJEXT): {$(VPATH)}assert.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
-transient_heap.$(OBJEXT): $(hdrdir)/ruby.h
-transient_heap.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-transient_heap.$(OBJEXT): {$(VPATH)}assert.h
-transient_heap.$(OBJEXT): {$(VPATH)}config.h
-transient_heap.$(OBJEXT): {$(VPATH)}debug.h
-transient_heap.$(OBJEXT): {$(VPATH)}debug_counter.h
-transient_heap.$(OBJEXT): {$(VPATH)}defines.h
-transient_heap.$(OBJEXT): {$(VPATH)}gc.h
-transient_heap.$(OBJEXT): {$(VPATH)}intern.h
-transient_heap.$(OBJEXT): {$(VPATH)}internal.h
-transient_heap.$(OBJEXT): {$(VPATH)}missing.h
-transient_heap.$(OBJEXT): {$(VPATH)}node.h
-transient_heap.$(OBJEXT): {$(VPATH)}ruby_assert.h
-transient_heap.$(OBJEXT): {$(VPATH)}st.h
-transient_heap.$(OBJEXT): {$(VPATH)}subst.h
-transient_heap.$(OBJEXT): {$(VPATH)}transient_heap.c
-transient_heap.$(OBJEXT): {$(VPATH)}transient_heap.h
-transient_heap.$(OBJEXT): {$(VPATH)}vm_debug.h
-util.$(OBJEXT): $(hdrdir)/ruby.h
+unicode.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+unicode.$(OBJEXT): {$(VPATH)}config.h
+unicode.$(OBJEXT): {$(VPATH)}defines.h
+unicode.$(OBJEXT): {$(VPATH)}intern.h
+unicode.$(OBJEXT): {$(VPATH)}missing.h
+unicode.$(OBJEXT): {$(VPATH)}oniguruma.h
+unicode.$(OBJEXT): {$(VPATH)}regenc.h
+unicode.$(OBJEXT): {$(VPATH)}regint.h
+unicode.$(OBJEXT): {$(VPATH)}st.h
+unicode.$(OBJEXT): {$(VPATH)}subst.h
+unicode.$(OBJEXT): {$(VPATH)}unicode.c
+unicode.$(OBJEXT): {$(VPATH)}unicode/casefold.h
+unicode.$(OBJEXT): {$(VPATH)}unicode/name2ctype.h
+us_ascii.$(OBJEXT): {$(VPATH)}config.h
+us_ascii.$(OBJEXT): {$(VPATH)}defines.h
+us_ascii.$(OBJEXT): {$(VPATH)}missing.h
+us_ascii.$(OBJEXT): {$(VPATH)}oniguruma.h
+us_ascii.$(OBJEXT): {$(VPATH)}regenc.h
+us_ascii.$(OBJEXT): {$(VPATH)}us_ascii.c
+utf_8.$(OBJEXT): {$(VPATH)}config.h
+utf_8.$(OBJEXT): {$(VPATH)}defines.h
+utf_8.$(OBJEXT): {$(VPATH)}missing.h
+utf_8.$(OBJEXT): {$(VPATH)}oniguruma.h
+utf_8.$(OBJEXT): {$(VPATH)}regenc.h
+utf_8.$(OBJEXT): {$(VPATH)}utf_8.c
util.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-util.$(OBJEXT): {$(VPATH)}assert.h
+util.$(OBJEXT): $(top_srcdir)/include/ruby.h
util.$(OBJEXT): {$(VPATH)}config.h
util.$(OBJEXT): {$(VPATH)}defines.h
-util.$(OBJEXT): {$(VPATH)}dtoa.c
+util.$(OBJEXT): {$(VPATH)}encoding.h
util.$(OBJEXT): {$(VPATH)}intern.h
util.$(OBJEXT): {$(VPATH)}internal.h
+util.$(OBJEXT): {$(VPATH)}io.h
util.$(OBJEXT): {$(VPATH)}missing.h
+util.$(OBJEXT): {$(VPATH)}oniguruma.h
util.$(OBJEXT): {$(VPATH)}st.h
util.$(OBJEXT): {$(VPATH)}subst.h
util.$(OBJEXT): {$(VPATH)}util.c
util.$(OBJEXT): {$(VPATH)}util.h
-variable.$(OBJEXT): $(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.h
variable.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-variable.$(OBJEXT): {$(VPATH)}assert.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)}method.h
+variable.$(OBJEXT): {$(VPATH)}io.h
variable.$(OBJEXT): {$(VPATH)}missing.h
variable.$(OBJEXT): {$(VPATH)}node.h
-variable.$(OBJEXT): {$(VPATH)}onigmo.h
variable.$(OBJEXT): {$(VPATH)}oniguruma.h
-variable.$(OBJEXT): {$(VPATH)}ruby_assert.h
-variable.$(OBJEXT): {$(VPATH)}ruby_atomic.h
variable.$(OBJEXT): {$(VPATH)}st.h
variable.$(OBJEXT): {$(VPATH)}subst.h
-variable.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-variable.$(OBJEXT): {$(VPATH)}thread_native.h
-variable.$(OBJEXT): {$(VPATH)}transient_heap.h
variable.$(OBJEXT): {$(VPATH)}util.h
variable.$(OBJEXT): {$(VPATH)}variable.c
-variable.$(OBJEXT): {$(VPATH)}variable.h
-variable.$(OBJEXT): {$(VPATH)}vm_core.h
-variable.$(OBJEXT): {$(VPATH)}vm_opts.h
-version.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
-version.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
-version.$(OBJEXT): $(CCAN_DIR)/list/list.h
-version.$(OBJEXT): $(CCAN_DIR)/str/str.h
-version.$(OBJEXT): $(hdrdir)/ruby.h
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)}assert.h
version.$(OBJEXT): {$(VPATH)}config.h
-version.$(OBJEXT): {$(VPATH)}debug_counter.h
version.$(OBJEXT): {$(VPATH)}defines.h
-version.$(OBJEXT): {$(VPATH)}id.h
version.$(OBJEXT): {$(VPATH)}intern.h
-version.$(OBJEXT): {$(VPATH)}internal.h
-version.$(OBJEXT): {$(VPATH)}method.h
version.$(OBJEXT): {$(VPATH)}missing.h
-version.$(OBJEXT): {$(VPATH)}mjit.h
-version.$(OBJEXT): {$(VPATH)}node.h
-version.$(OBJEXT): {$(VPATH)}ruby_assert.h
-version.$(OBJEXT): {$(VPATH)}ruby_atomic.h
version.$(OBJEXT): {$(VPATH)}st.h
version.$(OBJEXT): {$(VPATH)}subst.h
-version.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
-version.$(OBJEXT): {$(VPATH)}thread_native.h
version.$(OBJEXT): {$(VPATH)}version.c
-version.$(OBJEXT): {$(VPATH)}vm_core.h
-version.$(OBJEXT): {$(VPATH)}vm_opts.h
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.h
vm.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm.$(OBJEXT): {$(VPATH)}assert.h
-vm.$(OBJEXT): {$(VPATH)}builtin.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)}defs/opt_operand.def
+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)}insns_info.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)}mjit.h
vm.$(OBJEXT): {$(VPATH)}node.h
-vm.$(OBJEXT): {$(VPATH)}probes.dmyh
+vm.$(OBJEXT): {$(VPATH)}oniguruma.h
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)}variable.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
@@ -3195,9 +2315,8 @@ 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.h
vm_backtrace.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm_backtrace.$(OBJEXT): {$(VPATH)}assert.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
@@ -3206,13 +2325,12 @@ 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
@@ -3220,64 +2338,62 @@ 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.h
vm_dump.$(OBJEXT): $(hdrdir)/ruby/ruby.h
+vm_dump.$(OBJEXT): $(top_srcdir)/include/ruby.h
vm_dump.$(OBJEXT): {$(VPATH)}addr2line.h
-vm_dump.$(OBJEXT): {$(VPATH)}assert.h
vm_dump.$(OBJEXT): {$(VPATH)}config.h
vm_dump.$(OBJEXT): {$(VPATH)}defines.h
-vm_dump.$(OBJEXT): {$(VPATH)}gc.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)}procstat_vm.c
-vm_dump.$(OBJEXT): {$(VPATH)}ruby_assert.h
+vm_dump.$(OBJEXT): {$(VPATH)}oniguruma.h
vm_dump.$(OBJEXT): {$(VPATH)}ruby_atomic.h
vm_dump.$(OBJEXT): {$(VPATH)}st.h
vm_dump.$(OBJEXT): {$(VPATH)}subst.h
vm_dump.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
vm_dump.$(OBJEXT): {$(VPATH)}thread_native.h
vm_dump.$(OBJEXT): {$(VPATH)}vm_core.h
+vm_dump.$(OBJEXT): {$(VPATH)}vm_debug.h
vm_dump.$(OBJEXT): {$(VPATH)}vm_dump.c
vm_dump.$(OBJEXT): {$(VPATH)}vm_opts.h
vm_trace.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
vm_trace.$(OBJEXT): $(CCAN_DIR)/container_of/container_of.h
vm_trace.$(OBJEXT): $(CCAN_DIR)/list/list.h
vm_trace.$(OBJEXT): $(CCAN_DIR)/str/str.h
-vm_trace.$(OBJEXT): $(hdrdir)/ruby.h
vm_trace.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-vm_trace.$(OBJEXT): {$(VPATH)}assert.h
-vm_trace.$(OBJEXT): {$(VPATH)}builtin.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)}debug_counter.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)}iseq.h
+vm_trace.$(OBJEXT): {$(VPATH)}io.h
vm_trace.$(OBJEXT): {$(VPATH)}method.h
vm_trace.$(OBJEXT): {$(VPATH)}missing.h
-vm_trace.$(OBJEXT): {$(VPATH)}mjit.h
vm_trace.$(OBJEXT): {$(VPATH)}node.h
-vm_trace.$(OBJEXT): {$(VPATH)}ruby_assert.h
+vm_trace.$(OBJEXT): {$(VPATH)}oniguruma.h
vm_trace.$(OBJEXT): {$(VPATH)}ruby_atomic.h
vm_trace.$(OBJEXT): {$(VPATH)}st.h
vm_trace.$(OBJEXT): {$(VPATH)}subst.h
vm_trace.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
vm_trace.$(OBJEXT): {$(VPATH)}thread_native.h
-vm_trace.$(OBJEXT): {$(VPATH)}trace_point.rbinc
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 94072c9fc1..3d0a3e81dc 100644
--- a/compar.c
+++ b/compar.c
@@ -10,16 +10,10 @@
**********************************************************************/
#include "ruby/ruby.h"
-#include "id.h"
-#include "internal.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)
@@ -40,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
@@ -60,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;
}
/*
@@ -70,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;
+ VALUE a[2];
- c = rb_exec_recursive_paired_outer(cmp_eq_recursive, x, y, y);
-
- if (NIL_P(c)) return Qfalse;
- if (rb_cmpint(c, x, y) == 0) return Qtrue;
- return Qfalse;
-}
+ 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);
}
/*
@@ -96,13 +103,15 @@ cmpint(VALUE x, VALUE y)
* obj > other -> true or false
*
* Compares two objects based on the receiver's <code><=></code>
- * method, returning true if it returns a value greater than 0.
+ * method, returning true if it returns 1.
*/
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;
}
@@ -111,13 +120,15 @@ cmp_gt(VALUE x, VALUE y)
* obj >= other -> true or false
*
* Compares two objects based on the receiver's <code><=></code>
- * method, returning true if it returns a value greater than or equal to 0.
+ * method, returning true if it returns 0 or 1.
*/
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;
}
@@ -126,13 +137,15 @@ cmp_ge(VALUE x, VALUE y)
* obj < other -> true or false
*
* Compares two objects based on the receiver's <code><=></code>
- * method, returning true if it returns a value less than 0.
+ * method, returning true if it returns -1.
*/
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;
}
@@ -141,13 +154,15 @@ cmp_lt(VALUE x, VALUE y)
* obj <= other -> true or false
*
* Compares two objects based on the receiver's <code><=></code>
- * method, returning true if it returns a value less than or equal to 0.
+ * method, returning true if it returns -1 or 0.
*/
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;
}
@@ -155,9 +170,9 @@ cmp_le(VALUE x, VALUE y)
* call-seq:
* obj.between?(min, max) -> true or false
*
- * Returns <code>false</code> if _obj_ <code><=></code> _min_ is less
- * than zero or if _obj_ <code><=></code> _max_ is greater than zero,
- * <code>true</code> otherwise.
+ * Returns <code>false</code> if <i>obj</i> <code><=></code>
+ * <i>min</i> is less than zero or if <i>anObject</i> <code><=></code>
+ * <i>max</i> is greater than zero, <code>true</code> otherwise.
*
* 3.between?(1, 5) #=> true
* 6.between?(1, 5) #=> false
@@ -169,105 +184,28 @@ 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
- * obj.clamp(range) -> obj
- *
- * In <code>(min, max)</code> form, returns _min_ if _obj_
- * <code><=></code> _min_ is less than zero, _max_ if _obj_
- * <code><=></code> _max_ is greater than zero, and _obj_
- * 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'
- *
- * In <code>(range)</code> form, returns _range.begin_ if _obj_
- * <code><=></code> _range.begin_ is less than zero, _range.end_
- * if _obj_ <code><=></code> _range.end_ is greater than zero, and
- * _obj_ 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'
- *
- * If _range.begin_ is +nil+, it is considered smaller than _obj_,
- * and if _range.end_ is +nil+, it is considered greater than
- * _obj_.
- *
- * -20.clamp(0..) #=> 0
- * 523.clamp(..100) #=> 100
- *
- * When _range.end_ is excluded and not +nil+, an exception is
- * raised.
- *
- * 100.clamp(0...100) # ArgumentError
- */
-
-static VALUE
-cmp_clamp(int argc, VALUE *argv, VALUE x)
-{
- VALUE min, max;
- int c, excl = 0;
-
- if (rb_scan_args(argc, argv, "11", &min, &max) == 1) {
- VALUE range = min;
- if (!rb_range_values(range, &min, &max, &excl)) {
- rb_raise(rb_eTypeError, "wrong argument type %s (expected Range)",
- rb_builtin_class_name(range));
- }
- if (!NIL_P(max)) {
- if (excl) rb_raise(rb_eArgError, "cannot clamp with an exclusive range");
- if (!NIL_P(min) && cmpint(min, max) > 0) goto arg_error;
- }
- }
- else if (cmpint(min, max) > 0) {
- arg_error:
- rb_raise(rb_eArgError, "min argument must be smaller than max argument");
- }
-
- if (!NIL_P(min)) {
- c = cmpint(x, min);
- if (c == 0) return x;
- if (c < 0) return min;
- }
- if (!NIL_P(max)) {
- c = cmpint(x, max);
- if (c > 0) return max;
- }
- return x;
-}
-
-/*
- * The Comparable 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 a
- * value less than 0, returning 0, or returning a value greater than 0,
- * depending on whether the receiver is less than, equal to,
- * or greater than the other object. If the other object is not
- * comparable then the <code><=></code> operator should return +nil+.
- * Comparable uses <code><=></code> to implement the conventional
- * comparison operators (<code><</code>, <code><=</code>,
- * <code>==</code>, <code>>=</code>, and <code>></code>) and the
- * method <code>between?</code>.
+ * 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,
+ * or +1 depending on whether the receiver is less than, equal to, or
+ * greater than the other object. If the other object is not comparable
+ * then the <code><=></code> operator should return nil.
+ * <code>Comparable</code> uses
+ * <code><=></code> to implement the conventional comparison operators
+ * (<code><</code>, <code><=</code>, <code>==</code>, <code>>=</code>,
+ * and <code>></code>) and the method <code>between?</code>.
*
* 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
@@ -303,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, -1);
+
+ cmp = rb_intern("<=>");
}
diff --git a/compile.c b/compile.c
index 7043ba9a73..36db683c4a 100644
--- a/compile.c
+++ b/compile.c
@@ -9,39 +9,28 @@
**********************************************************************/
-#include "ruby/encoding.h"
-#include "ruby/re.h"
-#include "ruby/util.h"
#include "internal.h"
-#include "encindex.h"
#include <math.h>
+#define USE_INSN_STACK_INCREASE 1
#include "vm_core.h"
-#include "vm_debug.h"
-#include "builtin.h"
#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 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_ANCHOR,
+ 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;
@@ -64,23 +53,18 @@ typedef struct iseq_label_data {
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 {
@@ -89,12 +73,6 @@ typedef struct iseq_adjust_data {
int line_no;
} ADJUST;
-typedef struct iseq_trace_data {
- LINK_ELEMENT link;
- rb_event_flag_t event;
- long data;
-} TRACE;
-
struct ensure_range {
LABEL *begin;
LABEL *end;
@@ -102,13 +80,11 @@ 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;
};
-const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO};
-
/**
* debug function(macro) interface depend on CPDEBUG
* if it is less than 0, runtime option is in effect.
@@ -129,7 +105,7 @@ const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO};
#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
@@ -159,24 +135,35 @@ const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO};
#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
@@ -184,17 +171,21 @@ const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO};
#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) \
@@ -204,33 +195,22 @@ const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO};
#define ADD_INSN(seq, line, insn) \
ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
-/* insert an instruction before next */
-#define INSERT_BEFORE_INSN(next, line, insn) \
- ELEM_INSERT_PREV(&(next)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
-
-/* insert an instruction after prev */
-#define INSERT_AFTER_INSN(prev, line, insn) \
- ELEM_INSERT_NEXT(&(prev)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
+/* insert an instruction before prev */
+#define INSERT_BEFORE_INSN(prev, line, insn) \
+ INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) new_insn_body(iseq, (line), BIN(insn), 0))
/* add an instruction with some operands (1, 2, 3, 5) */
#define ADD_INSN1(seq, line, insn, op1) \
ADD_ELEM((seq), (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
-/* insert an instruction with some operands (1, 2, 3, 5) before next */
-#define INSERT_BEFORE_INSN1(next, line, insn, op1) \
- ELEM_INSERT_PREV(&(next)->link, (LINK_ELEMENT *) \
- new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
-
-/* insert an instruction with some operands (1, 2, 3, 5) after prev */
-#define INSERT_AFTER_INSN1(prev, line, insn, op1) \
- ELEM_INSERT_NEXT(&(prev)->link, (LINK_ELEMENT *) \
+/* insert an instruction with some operands (1, 2, 3, 5) before prev */
+#define INSERT_BEFORE_INSN1(prev, line, insn, op1) \
+ INSERT_ELEM_PREV(&(prev)->link, (LINK_ELEMENT *) \
new_insn_body(iseq, (line), BIN(insn), 1, (VALUE)(op1)))
-#define LABEL_REF(label) ((label)->refcnt++)
-
/* add an instruction with label operand (alias of ADD_INSN1) */
-#define ADD_INSNL(seq, line, insn, label) (ADD_INSN1(seq, line, insn, label), 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 *) \
@@ -242,72 +222,40 @@ const ID rb_iseq_shared_exc_local_tbl[] = {idERROR_INFO};
/* Specific Insn factory */
#define ADD_SEND(seq, line, id, argc) \
- ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(0), NULL)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (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)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (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)(block), (VALUE)INT2FIX(0), NULL)
#define ADD_CALL_RECEIVER(seq, line) \
ADD_INSN((seq), (line), putself)
#define ADD_CALL(seq, line, id, argc) \
- ADD_SEND_R((seq), (line), (id), (argc), NULL, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
+ ADD_SEND_R((seq), (line), (id), (argc), (VALUE)Qfalse, (VALUE)INT2FIX(VM_CALL_FCALL), NULL)
#define ADD_CALL_WITH_BLOCK(seq, line, id, argc, block) \
ADD_SEND_R((seq), (line), (id), (argc), (block), (VALUE)INT2FIX(VM_CALL_FCALL), 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), 0))
-#define ADD_TRACE_WITH_DATA(seq, event, data) \
- ADD_ELEM((seq), (LINK_ELEMENT *)new_trace_body(iseq, (event), (data)))
-
+ ADD_ELEM((seq), (LINK_ELEMENT *) new_insn_send(iseq, (line), (id), (VALUE)(argc), (VALUE)(block), (VALUE)(flag), (keywords)))
-#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(5); \
- 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) > 0 && \
+ (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_TRACE_WITH_DATA(seq, RUBY_EVENT_COVERAGE_BRANCH, counter_idx); \
- ADD_INSN(seq, last_line, nop); \
+ 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))
@@ -321,19 +269,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); \
- if (NIL_P(ISEQ_COMPILE_DATA(iseq)->catch_table_ary)) \
- RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, rb_ary_tmp_new(3)); \
- 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) \
@@ -341,19 +281,19 @@ 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) ? \
(ADD_INSN(anchor, nd_line(node), putself), VM_CALL_FCALL) : \
- COMPILE(anchor, desc, node->nd_recv) ? 0 : -1)
+ (COMPILE(anchor, desc, node->nd_recv), 0))
#define OPERAND_AT(insn, idx) \
(((INSN*)(insn))->operands[(idx)])
@@ -361,108 +301,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(const rb_iseq_t *iseq, int line, const char *fmt, ...));
-#endif
-
-static void
-append_compile_error(const 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) {
- if (SPECIAL_CONST_P(err)) err = rb_eSyntaxError;
- 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 NO_CHECK(sub) (void)(sub)
-#define BEFORE_RETURN
/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
* missing */
#define DECL_ANCHOR(name) \
- LINK_ANCHOR name[1] = {{{ISEQ_ELEMENT_ANCHOR,},}}
+ 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
@@ -479,11 +345,10 @@ 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
#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);
@@ -491,32 +356,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, long data);
-
-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_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;
@@ -547,36 +407,11 @@ verify_list(ISEQ_ARG_DECLARE const char *info, LINK_ANCHOR *const anchor)
#define verify_list(info, anchor) verify_list(iseq, (info), (anchor))
#endif
-static void
-verify_call_cache(rb_iseq_t *iseq)
-{
-#if CPDEBUG
- VALUE *original = rb_iseq_original_iseq(iseq);
- size_t i = 0;
- while (i < iseq->body->iseq_size) {
- VALUE insn = original[i];
- const char *types = insn_op_types(insn);
-
- for (int j=0; types[j]; j++) {
- if (types[j] == TS_CALLDATA) {
- struct rb_call_cache cc;
- struct rb_call_data *cd = (struct rb_call_data *)original[i+j+1];
- MEMZERO(&cc, cc, 1);
- if (memcmp(&cc, &cd->cc, sizeof(cc))) {
- rb_bug("call cache not zero for fresh iseq");
- }
- }
- }
- i += insn_len(insn);
- }
-#endif
-}
-
/*
* 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;
@@ -588,7 +423,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;
@@ -599,10 +434,28 @@ 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
-#define ISEQ_LAST_LINE(iseq) (ISEQ_COMPILE_DATA(iseq)->last_line)
+static int
+iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
+{
+ if (!SPECIAL_CONST_P(v)) {
+ rb_iseq_add_mark_object(iseq, v);
+ }
+ return COMPILE_OK;
+}
+
+#define ruby_sourcefile RSTRING_PTR(iseq->location.path)
+
+static int
+iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v)
+{
+ if (!SPECIAL_CONST_P(v)) {
+ rb_ary_push(iseq->compile_data->mark_ary, v);
+ }
+ return COMPILE_OK;
+}
static int
validate_label(st_data_t name, st_data_t label, st_data_t arg)
@@ -611,9 +464,11 @@ 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,
+ "%"PRIsVALUE": undefined label",
+ rb_id2str((ID)name)));
+ if (ret) break;
} while (0);
}
return ST_CONTINUE;
@@ -623,180 +478,172 @@ 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_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * 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);
-
- if (imemo_type_p((VALUE)node, imemo_ifunc)) {
- rb_raise(rb_eArgError, "unexpected imemo_ifunc");
- }
+ GetISeqPtr(self, iseq);
if (node == 0) {
- NO_CHECK(COMPILE(ret, "nil", node));
+ COMPILE(ret, "nil", node);
iseq_set_local_table(iseq, 0);
}
- /* 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_location.end_pos.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_PLAIN:
- CHECK(COMPILE(ret, "ensure", node));
+ case ISEQ_TYPE_DEFINED_GUARD:
+ 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 OPT_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 SUPPORT_JOKE
+ 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);
}
-static int
+int
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;
}
- FL_SET(iseq, ISEQ_TRANSLATED);
#endif
return COMPILE_OK;
}
+#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
+static int
+rb_vm_insn_addr2insn(const void *addr) /* cold path */
+{
+ int insn;
+ const void * const *table = rb_vm_get_insns_address_table();
+
+ for (insn = 0; insn < VM_INSTRUCTION_SIZE; insn++) {
+ if (table[insn] == addr) {
+ return insn;
+ }
+ }
+ rb_bug("rb_vm_insn_addr2insn: invalid insn address: %p", addr);
+}
+#endif
+
VALUE *
-rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
+rb_iseq_original_iseq(rb_iseq_t *iseq) /* cold path */
{
- VALUE *original_code;
+ if (iseq->iseq) return iseq->iseq;
+
+ iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
- 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);
+ 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;
}
/*********************************************/
@@ -806,7 +653,7 @@ rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
/*
* 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.
+ * generate SPARCV8PLUS code with unaligned memory accesss instructions.
* That is why the STRICT_ALIGNMENT is defined only with GCC.
*/
#if defined(__sparc) && SIZEOF_VOIDP == 4 && defined(__GNUC__)
@@ -853,10 +700,11 @@ calc_padding(void *ptr, size_t size)
#endif /* STRICT_ALIGNMENT */
static void *
-compile_data_alloc_with_arena(struct iseq_compile_data_storage **arena, size_t size)
+compile_data_alloc(rb_iseq_t *iseq, size_t size)
{
void *ptr = 0;
- struct iseq_compile_data_storage *storage = *arena;
+ struct iseq_compile_data_storage *storage =
+ iseq->compile_data->storage_current;
#ifdef STRICT_ALIGNMENT
size_t padding = calc_padding((void *)&storage->buff[storage->pos], size);
#else
@@ -872,8 +720,8 @@ compile_data_alloc_with_arena(struct iseq_compile_data_storage **arena, size_t s
alloc_size *= 2;
}
storage->next = (void *)ALLOC_N(char, alloc_size +
- offsetof(struct iseq_compile_data_storage, buff));
- storage = *arena = storage->next;
+ SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
+ storage = iseq->compile_data->storage_current = storage->next;
storage->next = 0;
storage->pos = 0;
storage->size = alloc_size;
@@ -891,25 +739,10 @@ compile_data_alloc_with_arena(struct iseq_compile_data_storage **arena, size_t s
return ptr;
}
-static void *
-compile_data_alloc(rb_iseq_t *iseq, size_t size)
-{
- struct iseq_compile_data_storage ** arena = &ISEQ_COMPILE_DATA(iseq)->node.storage_current;
- return compile_data_alloc_with_arena(arena, size);
-}
-
-static inline void *
-compile_data_alloc2(rb_iseq_t *iseq, size_t x, size_t y)
-{
- size_t size = rb_size_mul_or_raise(x, y, rb_eRuntimeError);
- return compile_data_alloc(iseq, size);
-}
-
static INSN *
compile_data_alloc_insn(rb_iseq_t *iseq)
{
- struct iseq_compile_data_storage ** arena = &ISEQ_COMPILE_DATA(iseq)->insn.storage_current;
- return (INSN *)compile_data_alloc_with_arena(arena, sizeof(INSN));
+ return (INSN *)compile_data_alloc(iseq, sizeof(INSN));
}
static LABEL *
@@ -924,17 +757,25 @@ 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)
+/*
+ * elem1, elemX => elemX, elem2, elem1
+ */
+static void
+INSERT_ELEM_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
{
- return (TRACE *)compile_data_alloc(iseq, sizeof(TRACE));
+ elem2->prev = elem1->prev;
+ elem2->next = elem1;
+ elem1->prev = elem2;
+ if (elem2->prev) {
+ elem2->prev->next = elem2;
+ }
}
/*
* 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;
@@ -945,24 +786,10 @@ ELEM_INSERT_NEXT(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
}
/*
- * elem1, elemX => elemX, elem2, elem1
- */
-static void
-ELEM_INSERT_PREV(LINK_ELEMENT *elem1, LINK_ELEMENT *elem2)
-{
- elem2->prev = elem1->prev;
- elem2->next = elem1;
- elem1->prev = elem2;
- if (elem2->prev) {
- elem2->prev->next = elem2;
- }
-}
-
-/*
* 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;
@@ -975,7 +802,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) {
@@ -984,19 +811,19 @@ ELEM_REMOVE(LINK_ELEMENT *elem)
}
static LINK_ELEMENT *
-FIRST_ELEMENT(const LINK_ANCHOR *const anchor)
+FIRST_ELEMENT(LINK_ANCHOR *anchor)
{
return anchor->anchor.next;
}
static LINK_ELEMENT *
-LAST_ELEMENT(LINK_ANCHOR *const anchor)
+LAST_ELEMENT(LINK_ANCHOR *anchor)
{
return anchor->last;
}
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;
@@ -1008,42 +835,14 @@ POP_ELEMENT(ISEQ_ARG_DECLARE LINK_ANCHOR *const anchor)
#define POP_ELEMENT(anchor) POP_ELEMENT(iseq, (anchor))
#endif
-static LINK_ELEMENT *
-ELEM_FIRST_INSN(LINK_ELEMENT *elem)
-{
- while (elem) {
- switch (elem->type) {
- case ISEQ_ELEMENT_INSN:
- case ISEQ_ELEMENT_ADJUST:
- return elem;
- default:
- elem = elem->next;
- }
- }
- return NULL;
-}
-
-static int
-LIST_INSN_SIZE_ONE(const LINK_ANCHOR *const 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;
- }
-}
-
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;
}
}
@@ -1055,7 +854,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;
@@ -1068,9 +867,38 @@ APPEND_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *const anc1, LINK_ANCHOR *const anc2)
#define APPEND_LIST(anc1, anc2) APPEND_LIST(iseq, (anc1), (anc2))
#endif
+/*
+ * anc1: e1, e2, e3
+ * anc2: e4, e5
+ *#=>
+ * anc1: e4, e5, e1, e2, e3
+ * anc2: e4, e5 (broken)
+ */
+static void
+INSERT_LIST(ISEQ_ARG_DECLARE LINK_ANCHOR *anc1, LINK_ANCHOR *anc2)
+{
+ if (anc2->anchor.next) {
+ LINK_ELEMENT *first = anc1->anchor.next;
+ anc1->anchor.next = anc2->anchor.next;
+ anc1->anchor.next->prev = &anc1->anchor;
+ anc2->last->next = first;
+ if (first) {
+ first->prev = anc2->last;
+ }
+ else {
+ anc1->last = anc2->last;
+ }
+ }
+
+ verify_list("append", anc1);
+}
+#if CPDEBUG < 0
+#define INSERT_LIST(anc1, anc2) INSERT_LIST(iseq, (anc1), (anc2))
+#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");
@@ -1089,23 +917,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, long data)
-{
- TRACE *trace = compile_data_alloc_trace(iseq);
-
- trace->link.type = ISEQ_ELEMENT_TRACE;
- trace->link.next = NULL;
- trace->event = event;
- trace->data = data;
-
- return trace;
-}
-
static LABEL *
new_label_body(rb_iseq_t *iseq, long line)
{
@@ -1114,13 +927,11 @@ 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;
}
@@ -1132,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;
}
@@ -1141,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;
@@ -1163,7 +971,7 @@ new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int a
if (argc > 0) {
int i;
va_init_list(argv, argc);
- operands = compile_data_alloc2(iseq, sizeof(VALUE), argc);
+ operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
for (i = 0; i < argc; i++) {
VALUE v = va_arg(argv, VALUE);
operands[i] = v;
@@ -1173,159 +981,71 @@ 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, rb_call_info_kw_arg_t *kw_arg)
{
- 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;
+ ci->kw_arg = kw_arg;
if (kw_arg) {
- ci->flag |= VM_CALL_KWARG;
- ci_kw->kw_arg = kw_arg;
+ ci->argc += kw_arg->keyword_len;
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 | VM_CALL_KW_SPLAT)) &&
- kw_arg == NULL && !has_blockiseq) {
+ if (!(ci->flag & (VM_CALL_ARGS_SPLAT | VM_CALL_ARGS_BLOCKARG)) &&
+ ci->blockiseq == NULL && ci->kw_arg == NULL) {
ci->flag |= VM_CALL_ARGS_SIMPLE;
}
+
+ 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++;
+
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, rb_call_info_kw_arg_t *keywords)
{
- VALUE *operands = compile_data_alloc2(iseq, sizeof(VALUE), 2);
- operands[0] = (VALUE)new_callinfo(iseq, id, FIX2INT(argc), FIX2INT(flag), keywords, blockiseq != NULL);
- operands[1] = (VALUE)blockiseq;
- return new_insn_core(iseq, line_no, BIN(send), 2, operands);
+ VALUE *operands = (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * 1);
+ operands[0] = (VALUE)new_callinfo(iseq, id, FIX2INT(argc), block, FIX2INT(flag), keywords);
+ 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;
- rb_ast_body_t ast;
-
- ast.root = node;
- ast.compile_option = 0;
- ast.line_count = -1;
+ VALUE ret;
debugs("[new_child_iseq]> ---------------------------------------\n");
- ret_iseq = rb_iseq_new_with_opt(&ast, 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");
- return ret_iseq;
-}
-
-static rb_iseq_t *
-new_child_iseq_with_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func *ifunc,
- VALUE name, const rb_iseq_t *parent, enum iseq_type type, int line_no)
-{
- rb_iseq_t *ret_iseq;
-
- debugs("[new_child_iseq_with_callback]> ---------------------------------------\n");
- ret_iseq = rb_iseq_new_with_callback(ifunc, name,
- rb_iseq_path(iseq), rb_iseq_realpath(iseq),
- INT2FIX(line_no), parent, type, ISEQ_COMPILE_DATA(iseq)->option);
- debugs("[new_child_iseq_with_callback]< ---------------------------------------\n");
- return ret_iseq;
-}
-
-static void
-set_catch_except_p(struct rb_iseq_constant_body *body)
-{
- body->catch_except_p = TRUE;
- if (body->parent_iseq != NULL) {
- set_catch_except_p(body->parent_iseq->body);
- }
-}
-
-/* Set body->catch_except_p to TRUE if the ISeq may catch an exception. If it is FALSE,
- JIT-ed code may be optimized. If we are extremely conservative, we should set TRUE
- if catch table exists. But we want to optimize while loop, which always has catch
- table entries for break/next/redo.
-
- So this function sets TRUE for limited ISeqs with break/next/redo catch table entries
- whose child ISeq would really raise an exception. */
-static void
-update_catch_except_flags(struct rb_iseq_constant_body *body)
-{
- unsigned int pos;
- size_t i;
- int insn;
- const struct iseq_catch_table *ct = body->catch_table;
-
- /* This assumes that a block has parent_iseq which may catch an exception from the block, and that
- BREAK/NEXT/REDO catch table entries are used only when `throw` insn is used in the block. */
- pos = 0;
- while (pos < body->iseq_size) {
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- insn = rb_vm_insn_addr2insn((void *)body->iseq_encoded[pos]);
-#else
- insn = (int)body->iseq_encoded[pos];
-#endif
- if (insn == BIN(throw)) {
- set_catch_except_p(body);
- break;
- }
- pos += insn_len(insn);
- }
-
- if (ct == NULL)
- return;
-
- for (i = 0; i < ct->size; i++) {
- const struct iseq_catch_table_entry *entry =
- UNALIGNED_MEMBER_PTR(ct, entries[i]);
- if (entry->type != CATCH_TYPE_BREAK
- && entry->type != CATCH_TYPE_NEXT
- && entry->type != CATCH_TYPE_REDO) {
- body->catch_except_p = TRUE;
- break;
- }
- }
-}
-
-static void
-iseq_insert_nop_between_end_and_cont(rb_iseq_t *iseq)
-{
- VALUE catch_table_ary = ISEQ_COMPILE_DATA(iseq)->catch_table_ary;
- if (NIL_P(catch_table_ary)) return;
- unsigned int i, tlen = (unsigned int)RARRAY_LEN(catch_table_ary);
- const VALUE *tptr = RARRAY_CONST_PTR_TRANSIENT(catch_table_ary);
- for (i = 0; i < tlen; i++) {
- const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(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)
@@ -1337,344 +1057,198 @@ 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;
-
- update_catch_except_flags(iseq->body);
+ 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);
}
- verify_call_cache(iseq);
debugs("[compile step: finish]\n");
- return COMPILE_OK;
+ return 0;
}
static int
iseq_set_exception_local_table(rb_iseq_t *iseq)
{
- iseq->body->local_table_size = numberof(rb_iseq_shared_exc_local_tbl);
- iseq->body->local_table = rb_iseq_shared_exc_local_tbl;
+ ID id_dollar_bang;
+
+ CONST_ID(id_dollar_bang, "#$!");
+ iseq->local_table = (ID *)ALLOC_N(ID, 1);
+ iseq->local_table_size = 1;
+ iseq->local_size = iseq->local_table_size + 1;
+ iseq->local_table[0] = id_dollar_bang;
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) {
- COMPILE_ERROR(iseq, ISEQ_LAST_LINE(iseq),
- "get_local_var_idx: %d", idx);
+ rb_bug("get_local_var_idx: %d", idx);
}
return idx;
}
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;
- const rb_iseq_t *const topmost_iseq = iseq;
while (iseq) {
idx = get_dyna_var_idx_at_raw(iseq, id);
if (idx >= 0) {
break;
}
- iseq = iseq->body->parent_iseq;
+ iseq = iseq->parent_iseq;
lv++;
}
if (idx < 0) {
- COMPILE_ERROR(topmost_iseq, ISEQ_LAST_LINE(topmost_iseq),
- "get_dyna_var_idx: -1");
+ rb_bug("get_dyna_var_idx: -1");
}
*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)
-{
- const struct rb_iseq_constant_body *body;
- while (level > 0) {
- iseq = iseq->body->parent_iseq;
- level--;
- }
- body = iseq->body;
- if (body->local_iseq == iseq && /* local variables */
- body->param.flags.has_block &&
- body->local_table_size - body->param.block_start == idx) {
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-static int
-iseq_block_param_id_p(const rb_iseq_t *iseq, ID id, int *pidx, int *plevel)
-{
- int level, ls;
- int idx = get_dyna_var_idx(iseq, id, &level, &ls);
- if (iseq_local_block_param_p(iseq, ls - idx, level)) {
- *pidx = ls - idx;
- *plevel = level;
- 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)
{
- struct rb_iseq_constant_body *const body = iseq->body;
- if (body->param.flags.has_opt ||
- body->param.flags.has_post ||
- body->param.flags.has_rest ||
- body->param.flags.has_block ||
- body->param.flags.has_kw ||
- body->param.flags.has_kwrest) {
+ if (iseq->param.flags.has_opt ||
+ iseq->param.flags.has_post ||
+ iseq->param.flags.has_rest ||
+ iseq->param.flags.has_block ||
+ iseq->param.flags.has_kw ||
+ iseq->param.flags.has_kwrest) {
- if (body->param.flags.has_block) {
- body->param.size = body->param.block_start + 1;
+ if (iseq->param.flags.has_block) {
+ iseq->param.size = iseq->param.block_start + 1;
}
- else if (body->param.flags.has_kwrest) {
- body->param.size = body->param.keyword->rest_start + 1;
+ else if (iseq->param.flags.has_kwrest) {
+ iseq->param.size = iseq->param.keyword->rest_start + 1;
}
- else if (body->param.flags.has_kw) {
- body->param.size = body->param.keyword->bits_start + 1;
+ else if (iseq->param.flags.has_kw) {
+ iseq->param.size = iseq->param.keyword->bits_start + 1;
}
- else if (body->param.flags.has_post) {
- body->param.size = body->param.post_start + body->param.post_num;
+ else if (iseq->param.flags.has_post) {
+ iseq->param.size = iseq->param.post_start + iseq->param.post_num;
}
- else if (body->param.flags.has_rest) {
- body->param.size = body->param.rest_start + 1;
+ else if (iseq->param.flags.has_rest) {
+ iseq->param.size = iseq->param.rest_start + 1;
}
- else if (body->param.flags.has_opt) {
- body->param.size = body->param.lead_num + body->param.opt_num;
+ else if (iseq->param.flags.has_opt) {
+ iseq->param.size = iseq->param.lead_num + iseq->param.opt_num;
}
else {
- UNREACHABLE;
+ rb_bug("unreachable");
}
}
else {
- body->param.size = body->param.lead_num;
+ iseq->param.size = iseq->param.lead_num;
}
}
static int
-iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
- const struct rb_args_info *args, int arg_size)
-{
- const NODE *node = args->kw_args;
- struct rb_iseq_constant_body *const body = iseq->body;
- 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;
-
- body->param.flags.has_kw = TRUE;
- body->param.keyword = keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
-
- while (node) {
- kw++;
- node = node->nd_next;
- }
- arg_size += kw;
- keyword->bits_start = arg_size++;
-
- node = args->kw_args;
- while (node) {
- const NODE *val_node = node->nd_body->nd_value;
- VALUE dv;
-
- if (val_node == NODE_SPECIAL_REQUIRED_KEYWORD) {
- ++rkw;
- }
- else {
- switch (nd_type(val_node)) {
- case NODE_LIT:
- dv = val_node->nd_lit;
- break;
- case NODE_NIL:
- dv = Qnil;
- break;
- case NODE_TRUE:
- dv = Qtrue;
- break;
- case NODE_FALSE:
- dv = Qfalse;
- break;
- default:
- NO_CHECK(COMPILE_POPPED(optargs, "kwarg", node)); /* nd_type(node) == NODE_KW_ARG */
- dv = complex_mark;
- }
-
- keyword->num = ++di;
- rb_ary_push(default_values, dv);
- }
-
- node = node->nd_next;
- }
-
- keyword->num = kw;
-
- if (args->kw_rest_arg->nd_vid != 0) {
- keyword->rest_start = arg_size++;
- body->param.flags.has_kwrest = TRUE;
- }
- keyword->required_num = rkw;
- keyword->table = &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;
- if (!SPECIAL_CONST_P(dv)) {
- RB_OBJ_WRITTEN(iseq, Qundef, dv);
- }
- dvs[i] = dv;
- }
-
- keyword->default_values = dvs;
- }
- return arg_size;
-}
-
-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");
if (node_args) {
- struct rb_iseq_constant_body *const body = iseq->body;
struct rb_args_info *args = node_args->nd_ainfo;
ID rest_id = 0;
int last_comma = 0;
ID block_id = 0;
- int arg_size;
- 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)));
+ }
- body->param.flags.ruby2_keywords = args->ruby2_keywords;
- body->param.lead_num = arg_size = (int)args->pre_args_num;
- if (body->param.lead_num > 0) body->param.flags.has_lead = TRUE;
- debugs(" - argc: %d\n", body->param.lead_num);
+
+ iseq->param.lead_num = (int)args->pre_args_num;
+ if (iseq->param.lead_num > 0) iseq->param.flags.has_lead = TRUE;
+ debugs(" - argc: %d\n", iseq->param.lead_num);
rest_id = args->rest_arg;
- if (rest_id == NODE_SPECIAL_EXCESSIVE_COMMA) {
+ if (rest_id == 1) {
last_comma = 1;
rest_id = 0;
}
block_id = args->block_arg;
+ if (args->first_post_arg) {
+ iseq->param.post_start = get_dyna_var_idx_at_raw(iseq, args->first_post_arg);
+ iseq->param.post_num = args->post_args_num;
+ iseq->param.flags.has_post = TRUE;
+ }
+
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);
- NO_CHECK(COMPILE_POPPED(optargs, "optarg", node->nd_body));
+ COMPILE_POPED(optargs, "optarg", node->nd_body);
node = node->nd_next;
i += 1;
}
@@ -1684,75 +1258,118 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
rb_ary_push(labels, (VALUE)label | 1);
ADD_LABEL(optargs, label);
- opt_table = ALLOC_N(VALUE, i+1);
-
- MEMCPY(opt_table, RARRAY_CONST_PTR_TRANSIENT(labels), VALUE, i+1);
+ iseq->param.opt_num = i;
+ iseq->param.opt_table = ALLOC_N(VALUE, i+1);
+ MEMCPY(iseq->param.opt_table, RARRAY_CONST_PTR(labels), VALUE, i+1);
for (j = 0; j < i+1; j++) {
- opt_table[j] &= ~1;
+ iseq->param.opt_table[j] &= ~1;
}
rb_ary_clear(labels);
- body->param.flags.has_opt = TRUE;
- body->param.opt_num = i;
- body->param.opt_table = opt_table;
- arg_size += i;
+ iseq->param.flags.has_opt = TRUE;
}
- if (rest_id) {
- body->param.rest_start = arg_size++;
- body->param.flags.has_rest = TRUE;
- assert(body->param.rest_start != -1);
- }
+ if (args->kw_args) {
+ NODE *node = args->kw_args;
+ 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;
- if (args->first_post_arg) {
- body->param.post_start = arg_size;
- body->param.post_num = args->post_args_num;
- body->param.flags.has_post = TRUE;
- arg_size += args->post_args_num;
+ iseq->param.flags.has_kw = TRUE;
+ iseq->param.keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
+ iseq->param.keyword->bits_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
- if (body->param.flags.has_rest) { /* TODO: why that? */
- body->param.post_start = body->param.rest_start + 1;
+ while (node) {
+ NODE *val_node = node->nd_body->nd_value;
+ VALUE dv;
+
+ if (val_node == (NODE *)-1) {
+ ++rkw;
+ }
+ else {
+ switch (nd_type(val_node)) {
+ case NODE_LIT:
+ dv = val_node->nd_lit;
+ iseq_add_mark_object(iseq, dv);
+ break;
+ case NODE_NIL:
+ dv = Qnil;
+ break;
+ case NODE_TRUE:
+ dv = Qtrue;
+ break;
+ case NODE_FALSE:
+ dv = Qfalse;
+ break;
+ default:
+ COMPILE_POPED(optargs, "kwarg", node); /* nd_type(node) == NODE_KW_ARG */
+ dv = complex_mark;
+ }
+
+ iseq->param.keyword->num = ++di;
+ rb_ary_push(default_values, dv);
+ }
+
+ kw++;
+ node = node->nd_next;
}
- }
- if (args->kw_args) {
- arg_size = iseq_set_arguments_keywords(iseq, optargs, args, arg_size);
+ iseq->param.keyword->num = kw;
+
+ if (args->kw_rest_arg->nd_cflag != 0) {
+ iseq->param.keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_cflag);
+ iseq->param.flags.has_kwrest = TRUE;
+ }
+ iseq->param.keyword->required_num = rkw;
+ iseq->param.keyword->table = &iseq->local_table[iseq->param.keyword->bits_start - iseq->param.keyword->num];
+ iseq->param.keyword->default_values = 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;
+ iseq->param.keyword->default_values[i] = dv;
+ }
}
else if (args->kw_rest_arg) {
- struct rb_iseq_param_keyword *keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
- keyword->rest_start = arg_size++;
- body->param.keyword = keyword;
- body->param.flags.has_kwrest = TRUE;
- }
- else if (args->no_kwarg) {
- body->param.flags.accepts_no_kwarg = TRUE;
+ iseq->param.flags.has_kwrest = TRUE;
+ iseq->param.keyword = ZALLOC_N(struct rb_iseq_param_keyword, 1);
+ iseq->param.keyword->rest_start = get_dyna_var_idx_at_raw(iseq, args->kw_rest_arg->nd_vid);
}
- if (block_id) {
- body->param.block_start = arg_size++;
- body->param.flags.has_block = TRUE;
+ if (args->pre_init) { /* m_init */
+ COMPILE_POPED(optargs, "init arguments (m)", args->pre_init);
+ }
+ if (args->post_init) { /* p_init */
+ COMPILE_POPED(optargs, "init arguments (p)", args->post_init);
}
- iseq_calc_param_size(iseq);
- body->param.size = arg_size;
+ if (rest_id) {
+ iseq->param.rest_start = get_dyna_var_idx_at_raw(iseq, rest_id);
+ iseq->param.flags.has_rest = TRUE;
+ assert(iseq->param.rest_start != -1);
- if (args->pre_init) { /* m_init */
- NO_CHECK(COMPILE_POPPED(optargs, "init arguments (m)", args->pre_init));
+ if (iseq->param.post_start == 0) { /* TODO: why that? */
+ iseq->param.post_start = iseq->param.rest_start + 1;
+ }
}
- if (args->post_init) { /* p_init */
- NO_CHECK(COMPILE_POPPED(optargs, "init arguments (p)", args->post_init));
+
+ if (block_id) {
+ iseq->param.block_start = get_dyna_var_idx_at_raw(iseq, block_id);
+ iseq->param.flags.has_block = TRUE;
}
- if (body->type == ISEQ_TYPE_BLOCK) {
- if (body->param.flags.has_opt == FALSE &&
- body->param.flags.has_post == FALSE &&
- body->param.flags.has_rest == FALSE &&
- body->param.flags.has_kw == FALSE &&
- body->param.flags.has_kwrest == FALSE) {
+ iseq_calc_param_size(iseq);
+
+ if (iseq->type == ISEQ_TYPE_BLOCK) {
+ if (iseq->param.flags.has_opt == FALSE &&
+ iseq->param.flags.has_post == FALSE &&
+ iseq->param.flags.has_rest == FALSE &&
+ iseq->param.flags.has_kw == FALSE &&
+ iseq->param.flags.has_kwrest == FALSE) {
- if (body->param.lead_num == 1 && last_comma == 0) {
+ if (iseq->param.lead_num == 1 && last_comma == 0) {
/* {|a|} */
- body->param.flags.ambiguous_param0 = TRUE;
+ iseq->param.flags.ambiguous_param0 = TRUE;
}
}
}
@@ -1764,10 +1381,10 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
static int
iseq_set_local_table(rb_iseq_t *iseq, const ID *tbl)
{
- unsigned int size;
+ int size;
if (tbl) {
- size = (unsigned int)*tbl;
+ size = (int)*tbl;
tbl++;
}
else {
@@ -1775,70 +1392,48 @@ 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;
}
static int
cdhash_cmp(VALUE val, VALUE lit)
{
- int tval, tlit;
-
- if (val == lit) {
- return 0;
- }
- else if ((tlit = OBJ_BUILTIN_TYPE(lit)) == -1) {
- return val != lit;
- }
- else if ((tval = OBJ_BUILTIN_TYPE(val)) == -1) {
- return -1;
- }
- else if (tlit != tval) {
- return -1;
- }
- else if (tlit == T_SYMBOL) {
- return val != lit;
- }
- else if (tlit == T_STRING) {
- return rb_str_hash_cmp(lit, val);
+ if (val == lit) return 0;
+ if (SPECIAL_CONST_P(lit)) {
+ return val != lit;
}
- else if (tlit == T_BIGNUM) {
- long x = FIX2LONG(rb_big_cmp(lit, val));
-
- /* Given lit and val are both Bignum, x must be -1, 0, 1.
- * There is no need to call rb_fix2int here. */
- RUBY_ASSERT((x == 1) || (x == 0) || (x == -1));
- return (int)x;
- }
- else if (tlit == T_FLOAT) {
- return rb_float_cmp(lit, val);
+ if (SPECIAL_CONST_P(val) || BUILTIN_TYPE(val) != BUILTIN_TYPE(lit)) {
+ return -1;
}
- else {
- UNREACHABLE_RETURN(-1);
+ if (BUILTIN_TYPE(lit) == T_STRING) {
+ return rb_str_hash_cmp(lit, val);
}
+ return !rb_eql(lit, val);
}
static st_index_t
cdhash_hash(VALUE a)
{
- switch (OBJ_BUILTIN_TYPE(a)) {
- case -1:
- case T_SYMBOL:
- return (st_index_t)a;
- case T_STRING:
- return rb_str_hash(a);
- case T_BIGNUM:
- return FIX2LONG(rb_big_hash(a));
- case T_FLOAT:
- return rb_dbl_long_hash(RFLOAT_VALUE(a));
- default:
- UNREACHABLE_RETURN(0);
+ if (SPECIAL_CONST_P(a)) return (st_index_t)a;
+ if (RB_TYPE_P(a, T_STRING)) return rb_str_hash(a);
+ {
+ VALUE hval = rb_hash(a);
+ return (st_index_t)FIX2LONG(hval);
}
}
@@ -1854,7 +1449,7 @@ struct cdhash_set_label_struct {
};
static int
-cdhash_set_label_i(VALUE key, VALUE val, VALUE ptr)
+cdhash_set_label_i(VALUE key, VALUE val, void *ptr)
{
struct cdhash_set_label_struct *data = (struct cdhash_set_label_struct *)ptr;
LABEL *lobj = (LABEL *)(val & ~1);
@@ -1862,267 +1457,74 @@ cdhash_set_label_i(VALUE key, VALUE val, VALUE 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(FIRST_ELEMENT(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, unsigned int *positions,
- int insns_info_index, int code_index, const INSN *iobj)
-{
- 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].line_no = iobj->insn_info.line_no;
- insns_info[insns_info_index].events = iobj->insn_info.events;
- positions[insns_info_index] = code_index;
- return TRUE;
- }
- return FALSE;
-}
-
-static int
-add_adjust_info(struct iseq_insn_info_entry *insns_info, unsigned int *positions,
- int insns_info_index, int code_index, const ADJUST *adjust)
-{
- if (insns_info_index > 0 ||
- insns_info[insns_info_index-1].line_no != adjust->line_no) {
- insns_info[insns_info_index].line_no = adjust->line_no;
- insns_info[insns_info_index].events = 0;
- positions[insns_info_index] = code_index;
- return TRUE;
- }
- return FALSE;
-}
-
/**
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;
- struct rb_iseq_constant_body *const body = iseq->body;
- unsigned int *positions;
+ 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;
- long data = 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 */
- insn_num = code_index = 0;
- for (list = FIRST_ELEMENT(anchor); list; list = list->next) {
+ /* set label position */
+ list = FIRST_ELEMENT(anchor);
+ k = pos = 0;
+ while (list) {
switch (list->type) {
case ISEQ_ELEMENT_INSN:
{
- INSN *iobj = (INSN *)list;
- /* update sp */
- sp = calc_sp_depth(sp, iobj);
- insn_num++;
- events = iobj->insn_info.events |= events;
- if (ISEQ_COVERAGE(iseq)) {
- if (ISEQ_LINE_COVERAGE(iseq) && (events & RUBY_EVENT_COVERAGE_LINE) &&
- !(rb_get_coverage_mode() & COVERAGE_TARGET_ONESHOT_LINES)) {
- int line = iobj->insn_info.line_no;
- if (line >= 1) {
- RARRAY_ASET(ISEQ_LINE_COVERAGE(iseq), line - 1, INT2FIX(0));
- }
- }
- if (ISEQ_BRANCH_COVERAGE(iseq) && (events & RUBY_EVENT_COVERAGE_BRANCH)) {
- while (RARRAY_LEN(ISEQ_PC2BRANCHINDEX(iseq)) <= code_index) {
- rb_ary_push(ISEQ_PC2BRANCHINDEX(iseq), Qnil);
- }
- RARRAY_ASET(ISEQ_PC2BRANCHINDEX(iseq), code_index, INT2FIX(data));
- }
- }
- code_index += insn_data_length(iobj);
- events = 0;
- data = 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;
- if (trace->event & RUBY_EVENT_COVERAGE_BRANCH) data = trace->data;
+ /* 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: 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);
- positions = ALLOC_N(unsigned int, insn_num);
- body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, body->is_size);
- body->call_data =
- rb_xcalloc_mul_add_mul(
- sizeof(struct rb_call_data), body->ci_size,
- sizeof(struct rb_kwarg_call_data), 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) {
@@ -2131,17 +1533,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); */
@@ -2149,8 +1568,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:
@@ -2158,102 +1584,96 @@ 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;
- RB_OBJ_WRITTEN(iseq, Qundef, map);
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
+ 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_VALUE: /* VALUE */
case TS_ISEQ: /* iseq */
{
VALUE v = operands[j];
- generated_iseq[code_index + 1 + j] = v;
- /* to mark ruby object */
- if (!SPECIAL_CONST_P(v)) {
- RB_OBJ_WRITTEN(iseq, Qundef, v);
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
+ 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[pos + 1 + j] = v;
+ /* to mark ruby object */
+ iseq_add_mark_object(iseq, v);
break;
}
- case TS_ISE: /* inline storage entry */
- /* Treated as an IC, but may contain a markable VALUE */
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
- /* fall through */
case TS_IC: /* inline cache */
- case TS_IVC: /* inline ivar cache */
{
- unsigned int ic_index = FIX2UINT(operands[j]);
- IC ic = (IC)&body->is_entries[ic_index];
- if (UNLIKELY(ic_index >= body->is_size)) {
- BADINSN_DUMP(anchor, &iobj->link, 0);
- COMPILE_ERROR(iseq, iobj->insn_info.line_no,
- "iseq_set_sequence: ic_index overflow: index: %d, size: %d",
- ic_index, 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 */
+ {
+ rb_call_info_t *base_ci = (rb_call_info_t *)operands[j];
+ rb_call_info_t *ci = &iseq->callinfo_entries[base_ci->aux.index];
+ *ci = *base_ci;
+
+ if (UNLIKELY(base_ci->aux.index >= iseq->callinfo_size)) {
+ rb_bug("iseq_set_sequence: ci_index overflow: index: %d, size: %d", base_ci->argc, iseq->callinfo_size);
+ }
+ generated_iseq[pos + 1 + j] = (VALUE)ci;
break;
}
- case TS_CALLDATA:
- {
- struct rb_call_info *source_ci = (struct rb_call_info *)operands[j];
- struct rb_call_data *cd;
-
- if (source_ci->flag & VM_CALL_KWARG) {
- struct rb_kwarg_call_data *kw_calls = (struct rb_kwarg_call_data *)&body->call_data[body->ci_size];
- struct rb_kwarg_call_data *cd_kw = &kw_calls[ISEQ_COMPILE_DATA(iseq)->ci_kw_index++];
- cd_kw->ci_kw = *((struct rb_call_info_with_kwarg *)source_ci);
- cd = (struct rb_call_data *)cd_kw;
- assert(ISEQ_COMPILE_DATA(iseq)->ci_kw_index <= body->ci_kw_size);
- }
- else {
- cd = &body->call_data[ISEQ_COMPILE_DATA(iseq)->ci_index++];
- cd->ci = *source_ci;
- assert(ISEQ_COMPILE_DATA(iseq)->ci_index <= body->ci_size);
- }
-
- generated_iseq[code_index + 1 + j] = (VALUE)cd;
- 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];
+ generated_iseq[pos + 1 + j] = operands[j];
break;
- case TS_BUILTIN:
- 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, positions, insns_info_index, code_index, 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:
@@ -2269,27 +1689,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_adjust_info(insns_info, positions, insns_info_index, code_index, 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(nop);
+ generated_iseq[pos++] = BIN(nop);
}
- else if (diff < 0) {
- int label_no = adjust->label ? adjust->label->label_no : -1;
- xfree(generated_iseq);
- xfree(insns_info);
- xfree(positions);
- 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;
@@ -2301,19 +1721,13 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
list = list->next;
}
- body->iseq_encoded = (void *)generated_iseq;
- body->iseq_size = code_index;
- body->stack_max = stack_max;
-
- /* get rid of memory leak when REALLOC failed */
- body->insns_info.body = insns_info;
- body->insns_info.positions = positions;
+ 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);
- body->insns_info.body = insns_info;
- REALLOC_N(positions, unsigned int, insns_info_index);
- body->insns_info.positions = positions;
- 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;
}
@@ -2334,51 +1748,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;
- if (NIL_P(ISEQ_COMPILE_DATA(iseq)->catch_table_ary)) goto no_catch_table;
- tlen = (int)RARRAY_LEN(ISEQ_COMPILE_DATA(iseq)->catch_table_ary);
- tptr = RARRAY_CONST_PTR_TRANSIENT(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_TRANSIENT(tptr[i]);
- entry = UNALIGNED_MEMBER_PTR(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];
- RB_OBJ_WRITTEN(iseq, Qundef, 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--;
- }
- }
- else {
- entry->cont = 0;
+ iseq->catch_table = xmalloc(iseq_catch_table_bytes(tlen));
+ iseq->catch_table->size = tlen;
+ }
+
+ 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 {
- no_catch_table:
- 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;
}
@@ -2395,11 +1808,10 @@ 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->param.flags.has_opt) {
+ for (i = 0; i < iseq->param.opt_num + 1; i++) {
+ iseq->param.opt_table[i] = label_get_position((LABEL *)iseq->param.opt_table[i]);
}
}
return COMPILE_OK;
@@ -2410,32 +1822,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;
- default: break;
}
list = list->next;
}
- found:
- if (list && IS_INSN(list)) {
- INSN *iobj = (INSN *)list;
- iobj->insn_info.events |= events;
- }
return list;
}
@@ -2445,7 +1839,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;
@@ -2459,7 +1853,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;
@@ -2467,244 +1861,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_CALLDATA:
- 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
-is_frozen_putstring(INSN *insn, VALUE *op)
-{
- if (IS_INSN_ID(insn, putstring)) {
- *op = OPERAND_AT(insn, 0);
- return 1;
- }
- else if (IS_INSN_ID(insn, putobject)) { /* frozen_string_literal */
- *op = OPERAND_AT(insn, 0);
- return RB_TYPE_P(*op, T_STRING);
- }
- return 0;
-}
-
-static int
-optimize_checktype(rb_iseq_t *iseq, INSN *iobj)
-{
- /*
- * putobject obj
- * dup
- * checktype T_XXX
- * branchif l1
- * l2:
- * ...
- * l1:
- *
- * => obj is a T_XXX
- *
- * putobject obj (T_XXX)
- * jump L1
- * L1:
- *
- * => obj is not a T_XXX
- *
- * putobject obj (T_XXX)
- * jump L2
- * L2:
- */
- int line;
- INSN *niobj, *ciobj, *dup = 0;
- LABEL *dest = 0;
- VALUE type;
-
- switch (INSN_OF(iobj)) {
- case BIN(putstring):
- type = INT2FIX(T_STRING);
- break;
- case BIN(putnil):
- type = INT2FIX(T_NIL);
- break;
- case BIN(putobject):
- type = INT2FIX(TYPE(OPERAND_AT(iobj, 0)));
- break;
- default: return FALSE;
- }
-
- ciobj = (INSN *)get_next_insn(iobj);
- if (IS_INSN_ID(ciobj, jump)) {
- ciobj = (INSN *)get_next_insn((INSN*)OPERAND_AT(ciobj, 0));
- }
- if (IS_INSN_ID(ciobj, dup)) {
- ciobj = (INSN *)get_next_insn(dup = ciobj);
- }
- if (!ciobj || !IS_INSN_ID(ciobj, checktype)) return FALSE;
- niobj = (INSN *)get_next_insn(ciobj);
- if (!niobj) {
- no_branch:
- /* TODO: putobject true/false */
- return FALSE;
- }
- switch (INSN_OF(niobj)) {
- case BIN(branchif):
- if (OPERAND_AT(ciobj, 0) == type) {
- dest = (LABEL *)OPERAND_AT(niobj, 0);
- }
- break;
- case BIN(branchunless):
- if (OPERAND_AT(ciobj, 0) != type) {
- dest = (LABEL *)OPERAND_AT(niobj, 0);
- }
- break;
- default:
- goto no_branch;
- }
- line = ciobj->insn_info.line_no;
- if (!dest) {
- if (niobj->link.next && IS_LABEL(niobj->link.next)) {
- dest = (LABEL *)niobj->link.next; /* reuse label */
- }
- else {
- dest = NEW_LABEL(line);
- ELEM_INSERT_NEXT(&niobj->link, &dest->link);
- }
- }
- INSERT_AFTER_INSN1(iobj, line, jump, dest);
- LABEL_REF(dest);
- if (!dup) INSERT_AFTER_INSN(iobj, line, pop);
- 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:
- optimize_checktype(iseq, iobj);
-
- if (IS_INSN_ID(iobj, jump)) {
- INSN *niobj, *diobj, *piobj;
+ 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);
@@ -2715,28 +1888,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
* ...
@@ -2744,115 +1904,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;
- }
- 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);
+ OPERAND_AT(piobj, 0) = OPERAND_AT(iobj, 0);
+ REMOVE_ELEM(&iobj->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;
- VALUE str_beg, str_end;
-
- if (range && IS_INSN_ID(range, newrange) &&
- (end = (INSN *)get_prev_insn(range)) != 0 &&
- is_frozen_putstring(end, &str_end) &&
- (beg = (INSN *)get_prev_insn(end)) != 0 &&
- is_frozen_putstring(beg, &str_beg)) {
- int excl = FIX2INT(OPERAND_AT(range, 0));
- VALUE lit_range = rb_range_new(str_beg, str_end, excl);
-
- ELEM_REMOVE(&beg->link);
- ELEM_REMOVE(&end->link);
- range->insn_id = BIN(putobject);
- OPERAND_AT(range, 0) = lit_range;
- RB_OBJ_WRITTEN(iseq, Qundef, 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
* ...
@@ -2862,300 +1954,12 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* if L2
*/
INSN *nobj = (INSN *)get_destination_insn(iobj);
-
- /* This is super nasty hack!!!
- *
- * This jump-jump optimization may ignore event flags of the jump
- * instruction being skipped. Actually, Line 2 TracePoint event
- * is never fired in the following code:
- *
- * 1: raise if 1 == 2
- * 2: while true
- * 3: break
- * 4: end
- *
- * This is critical for coverage measurement. [Bug #15980]
- *
- * This is a stopgap measure: stop the jump-jump optimization if
- * coverage measurement is enabled and if the skipped instruction
- * has any event flag.
- *
- * Note that, still, TracePoint Line event does not occur on Line 2.
- * This should be fixed in future.
- */
- int stop_optimization =
- ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq) &&
- nobj->insn_info.events;
- if (!stop_optimization) {
- 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(dup) ||
- previ == BIN(getlocal) ||
- previ == BIN(getblockparam) ||
- previ == BIN(getblockparamproxy) ||
- /* getinstancevariable may issue a warning */
- 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);
- }
- else if (previ == BIN(concatarray)) {
- INSN *piobj = (INSN *)prev;
- INSERT_BEFORE_INSN1(piobj, piobj->insn_info.line_no, splatarray, Qfalse);
- INSN_OF(piobj) = BIN(pop);
- }
- else if (previ == BIN(concatstrings)) {
- if (OPERAND_AT(prev, 0) == INT2FIX(1)) {
- ELEM_REMOVE(prev);
- }
- else {
- ELEM_REMOVE(&iobj->link);
- INSN_OF(prev) = BIN(adjuststack);
- }
- }
- }
- }
-
- 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 (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 (nobj->insn_id == BIN(jump)) {
+ OPERAND_AT(iobj, 0) = OPERAND_AT(nobj, 0);
}
}
- if (IS_INSN_ID(iobj, freezestring) &&
- NIL_P(OPERAND_AT(iobj, 0)) &&
- IS_NEXT_INSN_ID(&iobj->link, send)) {
- INSN *niobj = (INSN *)iobj->link.next;
- struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(niobj, 0);
- /*
- * freezestring nil # no debug_info
- * send <:+@, 0, ARG_SIMPLE> # :-@, too
- * =>
- * send <:+@, 0, ARG_SIMPLE> # :-@, too
- */
- if ((ci->mid == idUPlus || ci->mid == idUMinus) &&
- (ci->flag & VM_CALL_ARGS_SIMPLE) &&
- ci->orig_argc == 0) {
- ELEM_REMOVE(list);
- return COMPILE_OK;
- }
- }
-
- 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
@@ -3163,109 +1967,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;
- /* fall through */
- 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 *)OPERAND_AT(piobj, 0);
- if (IS_INSN_ID(piobj, send) || IS_INSN_ID(piobj, invokesuper)) {
- if (OPERAND_AT(piobj, 1) == 0) { /* no blockiseq */
- ci->flag |= VM_CALL_TAILCALL;
- }
- }
- else {
+ if (previ == BIN(send) || previ == BIN(opt_send_without_block) || 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);
- }
- }
- }
-
- if (IS_INSN_ID(iobj, opt_invokebuiltin_delegate)) {
- if (IS_TRACE(iobj->link.next)) {
- if (IS_NEXT_INSN_ID(iobj->link.next, leave)) {
- iobj->insn_id = BIN(opt_invokebuiltin_delegate_leave);
- }
- }
- }
-
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 = 2;
- iobj->operands = compile_data_alloc2(iseq, iobj->operand_size, sizeof(VALUE));
- iobj->operands[0] = (VALUE)new_callinfo(iseq, idEq, 1, 0, NULL, FALSE);
- iobj->operands[1] = old_operands[0];
+ if (insn_id != BIN(opt_neq)) {
+ rb_bug("insn_set_specialized_instruction: unknown insn: %d", insn_id);
+ }
+ iobj->operands = (VALUE *)compile_data_alloc(iseq, iobj->operand_size * sizeof(VALUE));
+ iobj->operands[0] = old_operands[0];
+ iobj->operands[1] = (VALUE)new_callinfo(iseq, idEq, 1, 0, 0, NULL);
}
return COMPILE_OK;
@@ -3274,32 +2003,8 @@ 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, 1);
+ 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) {
@@ -3309,7 +2014,6 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
case idLength: SP_INSN(length); return COMPILE_OK;
case idSize: SP_INSN(size); return COMPILE_OK;
case idEmptyP: SP_INSN(empty_p);return COMPILE_OK;
- case idNilP: SP_INSN(nil_p); return COMPILE_OK;
case idSucc: SP_INSN(succ); return COMPILE_OK;
case idNot: SP_INSN(not); return COMPILE_OK;
}
@@ -3323,15 +2027,12 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
case idMOD: SP_INSN(mod); return COMPILE_OK;
case idEq: SP_INSN(eq); return COMPILE_OK;
case idNeq: SP_INSN(neq); return COMPILE_OK;
- case idEqTilde:SP_INSN(regexpmatch2);return COMPILE_OK;
case idLT: SP_INSN(lt); return COMPILE_OK;
case idLE: SP_INSN(le); return COMPILE_OK;
case idGT: SP_INSN(gt); return COMPILE_OK;
case idGE: SP_INSN(ge); return COMPILE_OK;
case idLTLT: SP_INSN(ltlt); return COMPILE_OK;
case idAREF: SP_INSN(aref); return COMPILE_OK;
- case idAnd: SP_INSN(and); return COMPILE_OK;
- case idOr: SP_INSN(or); return COMPILE_OK;
}
break;
case 2:
@@ -3342,9 +2043,8 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
}
}
- if ((ci->flag & VM_CALL_ARGS_BLOCKARG) == 0 && blockiseq == NULL) {
+ if ((ci->flag & VM_CALL_ARGS_BLOCKARG) == 0 && ci->blockiseq == NULL) {
iobj->insn_id = BIN(opt_send_without_block);
- iobj->operand_size = insn_len(iobj->insn_id) - 1;
}
}
#undef SP_INSN
@@ -3355,11 +2055,7 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
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 */
+ switch (iseq->type) {
case ISEQ_TYPE_RESCUE:
case ISEQ_TYPE_ENSURE:
/* rescue block can't tail call because of errinfo */
@@ -3370,21 +2066,21 @@ tailcallable_p(rb_iseq_t *iseq)
}
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_peepholeopt = iseq->compile_data->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;
+ 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;
int rescue_level = 0;
int tailcallopt = do_tailcallopt;
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);
}
@@ -3395,7 +2091,7 @@ iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
insn_operands_unification((INSN *)list);
}
}
- if (IS_LABEL(list)) {
+ if (list->type == ISEQ_ELEMENT_LABEL) {
switch (((LABEL *)list)->rescued) {
case LABEL_RESCUE_BEG:
rescue_level++;
@@ -3431,7 +2127,7 @@ new_unified_insn(rb_iseq_t *iseq,
if (argc > 0) {
ptr = operands =
- compile_data_alloc2(iseq, sizeof(VALUE), argc);
+ (VALUE *)compile_data_alloc(iseq, sizeof(VALUE) * argc);
}
/* copy operands */
@@ -3443,7 +2139,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
@@ -3453,7 +2149,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;
@@ -3463,7 +2159,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) {
@@ -3472,7 +2168,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;
}
@@ -3511,7 +2207,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;
@@ -3526,12 +2222,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 {
@@ -3567,7 +2263,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;
@@ -3598,7 +2294,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;
}
@@ -3609,7 +2305,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;
}
@@ -3631,12 +2327,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;
}
@@ -3644,7 +2339,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:
@@ -3664,155 +2359,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 = rb_fstring(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);
- RB_OBJ_WRITTEN(iseq, Qundef, 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 = rb_fstring(head->nd_lit);
- ADD_INSN1(ret, nd_line(head), putobject, lit);
- RB_OBJ_WRITTEN(iseq, Qundef, 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_ZLIST:
- 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;
@@ -3821,25 +2444,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_LIST:
- case NODE_ARGSCAT:
- case NODE_DREGX:
- case NODE_DSTR:
- CHECK(COMPILE_POPPED(ret, "branch condition", cond));
- ADD_INSNL(ret, nd_line(cond), jump, then_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;
@@ -3848,35 +2454,21 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *co
}
static int
-keyword_node_p(const NODE *const node)
-{
- return nd_type(node) == NODE_HASH && node->nd_brace == FALSE;
-}
-
-static int
-compile_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)
+compile_array_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *ret, const NODE * const root_node, rb_call_info_kw_arg_t ** const kw_arg_ptr)
{
if (kw_arg_ptr == NULL) return FALSE;
- if (keyword_node_p(root_node) && root_node->nd_head && nd_type(root_node->nd_head) == NODE_LIST) {
- const NODE *node = root_node->nd_head;
+ if (nd_type(root_node) == NODE_HASH && root_node->nd_head && nd_type(root_node->nd_head) == NODE_ARRAY) {
+ NODE *node = root_node->nd_head;
while (node) {
- const NODE *key_node = node->nd_head;
+ NODE *key_node = node->nd_head;
- assert(nd_type(node) == NODE_LIST);
- if (!key_node) {
- if (flag) *flag |= VM_CALL_KW_SPLAT;
- return FALSE;
- }
- else if (nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {
+ assert(nd_type(node) == NODE_ARRAY);
+ if (key_node && nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {
/* can be keywords */
}
else {
- if (flag) *flag |= VM_CALL_KW_SPLAT;
return FALSE;
}
node = node->nd_next; /* skip value node */
@@ -3887,8 +2479,7 @@ compile_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
node = root_node->nd_head;
{
int len = (int)node->nd_alen / 2;
- struct rb_call_info_kw_arg *kw_arg =
- rb_xmalloc_mul_add(len - 1, sizeof(VALUE), sizeof(struct rb_call_info_kw_arg));
+ rb_call_info_kw_arg_t *kw_arg = (rb_call_info_kw_arg_t *)ruby_xmalloc(sizeof(rb_call_info_kw_arg_t) + sizeof(VALUE) * (len - 1));
VALUE *keywords = kw_arg->keywords;
int i = 0;
kw_arg->keyword_len = len;
@@ -3896,10 +2487,10 @@ compile_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
*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;
+ NODE *key_node = node->nd_head;
+ NODE *val_node = node->nd_next->nd_head;
keywords[i] = key_node->nd_lit;
- NO_CHECK(COMPILE(ret, "keyword values", val_node));
+ COMPILE(ret, "keyword values", val_node);
}
assert(i == len);
return TRUE;
@@ -3908,384 +2499,176 @@ compile_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
return FALSE;
}
-static int
-compile_args(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node,
- struct rb_call_info_kw_arg **keywords_ptr, unsigned int *flag)
-{
- int len = 0;
-
- for (; node; len++, node = node->nd_next) {
- if (CPDEBUG > 0) {
- EXPECT_NODE("compile_args", node, NODE_LIST, -1);
- }
-
- if (node->nd_next == NULL /* last node */ &&
- compile_keyword_arg(iseq, ret, node->nd_head, keywords_ptr, flag)) {
- len--;
- }
- else {
- NO_CHECK(COMPILE_(ret, "array element", node->nd_head, FALSE));
- }
- }
-
- return len;
-}
-
-static inline int
-static_literal_node_p(const NODE *node, const rb_iseq_t *iseq)
-{
- node = node->nd_head;
- switch (nd_type(node)) {
- case NODE_LIT:
- case NODE_NIL:
- case NODE_TRUE:
- case NODE_FALSE:
- return TRUE;
- case NODE_STR:
- return ISEQ_COMPILE_DATA(iseq)->option->frozen_string_literal;
- default:
- return FALSE;
- }
-}
-
-static inline VALUE
-static_literal_value(const NODE *node, rb_iseq_t *iseq)
-{
- node = node->nd_head;
- switch (nd_type(node)) {
- case NODE_NIL:
- return Qnil;
- case NODE_TRUE:
- return Qtrue;
- case NODE_FALSE:
- return Qfalse;
- case NODE_STR:
- if (ISEQ_COMPILE_DATA(iseq)->option->debug_frozen_string_literal || RTEST(ruby_debug)) {
- VALUE lit;
- VALUE debug_info = rb_ary_new_from_args(2, rb_iseq_path(iseq), INT2FIX((int)nd_line(node)));
- lit = rb_str_dup(node->nd_lit);
- rb_ivar_set(lit, id_debug_created_info, rb_obj_freeze(debug_info));
- return rb_str_freeze(lit);
- }
- else {
- return rb_fstring(node->nd_lit);
- }
- default:
- return node->nd_lit;
- }
-}
+enum compile_array_type_t {
+ COMPILE_ARRAY_TYPE_ARRAY,
+ COMPILE_ARRAY_TYPE_HASH,
+ COMPILE_ARRAY_TYPE_ARGS
+};
static int
-compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped)
+compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
+ enum compile_array_type_t type, rb_call_info_kw_arg_t **keywords_ptr, int poped)
{
+ NODE *node = node_root;
int line = (int)nd_line(node);
+ int len = 0;
- if (nd_type(node) == NODE_ZLIST) {
- if (!popped) {
- ADD_INSN1(ret, line, newarray, INT2FIX(0));
+ if (nd_type(node) == NODE_ZARRAY) {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY: ADD_INSN1(ret, line, newarray, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_HASH: ADD_INSN1(ret, line, newhash, INT2FIX(0)); break;
+ case COMPILE_ARRAY_TYPE_ARGS: /* do nothing */ break;
+ }
}
- return 0;
}
+ else {
+ int opt_p = 1;
+ int first = 1, i;
- EXPECT_NODE("compile_array", node, NODE_LIST, -1);
-
- if (popped) {
- for (; node; node = node->nd_next) {
- NO_CHECK(COMPILE_(ret, "array element", node->nd_head, popped));
- }
- return 1;
- }
-
- /* Compilation of an array literal.
- * The following code is essentially the same as:
- *
- * for (int count = 0; node; count++; node->nd_next) {
- * compile(node->nd_head);
- * }
- * ADD_INSN(newarray, count);
- *
- * However, there are three points.
- *
- * - The code above causes stack overflow for a big string literal.
- * The following limits the stack length up to max_stack_len.
- *
- * [x1,x2,...,x10000] =>
- * push x1 ; push x2 ; ...; push x256; newarray 256;
- * push x257; push x258; ...; push x512; newarray 256; concatarray;
- * push x513; push x514; ...; push x768; newarray 256; concatarray;
- * ...
- *
- * - Long subarray can be optimized by pre-allocating a hidden array.
- *
- * [1,2,3,...,100] =>
- * duparray [1,2,3,...,100]
- *
- * [x, 1,2,3,...,100, z] =>
- * push x; newarray 1;
- * putobject [1,2,3,...,100] (<- hidden array); concatarray;
- * push z; newarray 1; concatarray
- *
- * - If the last element is a keyword, newarraykwsplat should be emitted
- * to check and remove empty keyword arguments hash from array.
- * (Note: a keyword is NODE_HASH which is not static_literal_node_p.)
- *
- * [1,2,3,**kw] =>
- * putobject 1; putobject 2; putobject 3; push kw; newarraykwsplat
- */
+ while (node) {
+ NODE *start_node = node, *end_node;
+ NODE *kw = 0;
+ const int max = 0x100;
+ DECL_ANCHOR(anchor);
+ INIT_ANCHOR(anchor);
+
+ for (i=0; i<max && node; i++, len++, node = node->nd_next) {
+ if (CPDEBUG > 0 && nd_type(node) != NODE_ARRAY) {
+ rb_bug("compile_array: This node is not NODE_ARRAY, but %s", ruby_node_name(nd_type(node)));
+ }
- const int max_stack_len = 0x100;
- const int min_tmp_ary_len = 0x40;
- int stack_len = 0;
- int first_chunk = 1;
-
- /* Convert pushed elements to an array, and concatarray if needed */
-#define FLUSH_CHUNK(newarrayinsn) \
- if (stack_len) { \
- ADD_INSN1(ret, line, newarrayinsn, INT2FIX(stack_len)); \
- if (!first_chunk) ADD_INSN(ret, line, concatarray); \
- first_chunk = stack_len = 0; \
- }
-
- while (node) {
- int count = 1;
-
- /* pre-allocation check (this branch can be omittable) */
- if (static_literal_node_p(node, iseq)) {
- /* count the elements that are optimizable */
- const NODE *node_tmp = node->nd_next;
- for (; node_tmp && static_literal_node_p(node_tmp, iseq); node_tmp = node_tmp->nd_next)
- count++;
-
- if ((first_chunk && stack_len == 0 && !node_tmp) || count >= min_tmp_ary_len) {
- /* The literal contains only optimizable elements, or the subarray is long enough */
- VALUE ary = rb_ary_tmp_new(count);
-
- /* Create a hidden array */
- for (; count; count--, node = node->nd_next)
- rb_ary_push(ary, static_literal_value(node, iseq));
- OBJ_FREEZE(ary);
-
- /* Emit optimized code */
- FLUSH_CHUNK(newarray);
- if (first_chunk) {
- ADD_INSN1(ret, line, duparray, ary);
- first_chunk = 0;
- }
- else {
- ADD_INSN1(ret, line, putobject, ary);
- ADD_INSN(ret, line, concatarray);
- }
- RB_OBJ_WRITTEN(iseq, Qundef, ary);
- }
- }
+ if (type != COMPILE_ARRAY_TYPE_ARRAY && !node->nd_head) {
+ kw = node->nd_next;
+ node = 0;
+ if (kw) {
+ opt_p = 0;
+ node = kw->nd_next;
+ kw = kw->nd_head;
+ }
+ break;
+ }
+ if (opt_p && nd_type(node->nd_head) != NODE_LIT) {
+ opt_p = 0;
+ }
- /* Base case: Compile "count" elements */
- for (; count; count--, node = node->nd_next) {
- if (CPDEBUG > 0) {
- EXPECT_NODE("compile_array", node, NODE_LIST, -1);
- }
+ if (type == COMPILE_ARRAY_TYPE_ARGS && node->nd_next == NULL /* last node */ && compile_array_keyword_arg(iseq, anchor, node->nd_head, keywords_ptr)) {
+ len--;
+ }
+ else {
+ COMPILE_(anchor, "array element", node->nd_head, poped);
+ }
+ }
- NO_CHECK(COMPILE_(ret, "array element", node->nd_head, 0));
- stack_len++;
+ if (opt_p && type != COMPILE_ARRAY_TYPE_ARGS) {
+ if (!poped) {
+ VALUE ary = rb_ary_tmp_new(i);
- if (!node->nd_next && keyword_node_p(node->nd_head)) {
- /* Reached the end, and the last element is a keyword */
- FLUSH_CHUNK(newarraykwsplat);
- return 1;
- }
+ end_node = node;
+ node = start_node;
- /* If there are many pushed elements, flush them to avoid stack overflow */
- if (stack_len >= max_stack_len) FLUSH_CHUNK(newarray);
- }
- }
+ while (node != end_node) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ }
+ while (node && nd_type(node->nd_head) == NODE_LIT &&
+ node->nd_next && nd_type(node->nd_next->nd_head) == NODE_LIT) {
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ rb_ary_push(ary, node->nd_head->nd_lit);
+ node = node->nd_next;
+ len++;
+ }
- FLUSH_CHUNK(newarray);
-#undef FLUSH_CHUNK
- return 1;
-}
+ OBJ_FREEZE(ary);
-static inline int
-static_literal_node_pair_p(const NODE *node, const rb_iseq_t *iseq)
-{
- return node->nd_head && static_literal_node_p(node, iseq) && static_literal_node_p(node->nd_next, iseq);
-}
+ iseq_add_mark_object_compile_time(iseq, ary);
-static int
-compile_hash(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped)
-{
- int line = (int)nd_line(node);
+ if (first) {
+ first = 0;
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, duparray, ary);
+ }
+ else { /* COMPILE_ARRAY_TYPE_HASH */
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_SEND(ret, line, id_core_hash_from_ary, INT2FIX(1));
+ }
+ }
+ else {
+ if (type == COMPILE_ARRAY_TYPE_ARRAY) {
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_INSN(ret, line, concatarray);
+ }
+ else {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putobject, ary);
+ ADD_SEND(ret, line, id_core_hash_merge_ary, INT2FIX(1));
+ }
+ }
+ }
+ }
+ else {
+ if (!poped) {
+ switch (type) {
+ case COMPILE_ARRAY_TYPE_ARRAY:
+ ADD_INSN1(anchor, line, newarray, INT2FIX(i));
- node = node->nd_head;
+ if (first) {
+ first = 0;
+ }
+ else {
+ ADD_INSN(anchor, line, concatarray);
+ }
- if (!node || nd_type(node) == NODE_ZLIST) {
- if (!popped) {
- ADD_INSN1(ret, line, newhash, INT2FIX(0));
+ APPEND_LIST(ret, anchor);
+ break;
+ case COMPILE_ARRAY_TYPE_HASH:
+ if (i > 0) {
+ if (first) {
+ ADD_INSN1(anchor, line, newhash, INT2FIX(i));
+ APPEND_LIST(ret, anchor);
+ }
+ else {
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN(ret, line, swap);
+ APPEND_LIST(ret, anchor);
+ ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(i + 1));
+ }
+ }
+ if (kw) {
+ VALUE nhash = (i > 0 || !first) ? INT2FIX(2) : INT2FIX(1);
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ if (i > 0 || !first) ADD_INSN(ret, line, swap);
+ COMPILE(ret, "keyword splat", kw);
+ ADD_SEND(ret, line, id_core_hash_merge_kwd, nhash);
+ if (nhash == INT2FIX(1)) ADD_SEND(ret, line, rb_intern("dup"), INT2FIX(0));
+ }
+ first = 0;
+ break;
+ case COMPILE_ARRAY_TYPE_ARGS:
+ APPEND_LIST(ret, anchor);
+ break;
+ }
+ }
+ else {
+ /* poped */
+ APPEND_LIST(ret, anchor);
+ }
+ }
}
- return 0;
- }
-
- EXPECT_NODE("compile_hash", node, NODE_LIST, -1);
-
- if (popped) {
- for (; node; node = node->nd_next) {
- NO_CHECK(COMPILE_(ret, "hash element", node->nd_head, popped));
- }
- return 1;
- }
-
- /* Compilation of a hash literal (or keyword arguments).
- * This is very similar to compile_array, but there are some differences:
- *
- * - It contains key-value pairs. So we need to take every two elements.
- * We can assume that the length is always even.
- *
- * - Merging is done by a method call (id_core_hash_merge_ptr).
- * Sometimes we need to insert the receiver, so "anchor" is needed.
- * In addition, a method call is much slower than concatarray.
- * So it pays only when the subsequence is really long.
- * (min_tmp_hash_len must be much larger than min_tmp_ary_len.)
- *
- * - We need to handle keyword splat: **kw.
- * For **kw, the key part (node->nd_head) is NULL, and the value part
- * (node->nd_next->nd_head) is "kw".
- * The code is a bit difficult to avoid hash allocation for **{}.
- */
-
- const int max_stack_len = 0x100;
- const int min_tmp_hash_len = 0x800;
- int stack_len = 0;
- int first_chunk = 1;
- DECL_ANCHOR(anchor);
- INIT_ANCHOR(anchor);
-
- /* Convert pushed elements to a hash, and merge if needed */
-#define FLUSH_CHUNK() \
- if (stack_len) { \
- if (first_chunk) { \
- APPEND_LIST(ret, anchor); \
- ADD_INSN1(ret, line, newhash, INT2FIX(stack_len)); \
- } \
- else { \
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE)); \
- ADD_INSN(ret, line, swap); \
- APPEND_LIST(ret, anchor); \
- ADD_SEND(ret, line, id_core_hash_merge_ptr, INT2FIX(stack_len + 1)); \
- } \
- INIT_ANCHOR(anchor); \
- first_chunk = stack_len = 0; \
- }
-
- while (node) {
- int count = 1;
-
- /* pre-allocation check (this branch can be omittable) */
- if (static_literal_node_pair_p(node, iseq)) {
- /* count the elements that are optimizable */
- const NODE *node_tmp = node->nd_next->nd_next;
- for (; node_tmp && static_literal_node_pair_p(node_tmp, iseq); node_tmp = node_tmp->nd_next->nd_next)
- count++;
-
- if ((first_chunk && stack_len == 0 && !node_tmp) || count >= min_tmp_hash_len) {
- /* The literal contains only optimizable elements, or the subsequence is long enough */
- VALUE ary = rb_ary_tmp_new(count);
-
- /* Create a hidden hash */
- for (; count; count--, node = node->nd_next->nd_next) {
- VALUE elem[2];
- elem[0] = static_literal_value(node, iseq);
- elem[1] = static_literal_value(node->nd_next, iseq);
- rb_ary_cat(ary, elem, 2);
- }
- VALUE hash = rb_hash_new_with_size(RARRAY_LEN(ary) / 2);
- rb_hash_bulk_insert(RARRAY_LEN(ary), RARRAY_CONST_PTR_TRANSIENT(ary), hash);
- hash = rb_obj_hide(hash);
- OBJ_FREEZE(hash);
-
- /* Emit optimized code */
- FLUSH_CHUNK();
- if (first_chunk) {
- ADD_INSN1(ret, line, duphash, hash);
- first_chunk = 0;
- }
- else {
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN(ret, line, swap);
-
- ADD_INSN1(ret, line, putobject, hash);
-
- ADD_SEND(ret, line, id_core_hash_merge_kwd, INT2FIX(2));
- }
- RB_OBJ_WRITTEN(iseq, Qundef, hash);
- }
- }
-
- /* Base case: Compile "count" elements */
- for (; count; count--, node = node->nd_next->nd_next) {
-
- if (CPDEBUG > 0) {
- EXPECT_NODE("compile_hash", node, NODE_LIST, -1);
- }
-
- if (node->nd_head) {
- /* Normal key-value pair */
- NO_CHECK(COMPILE_(anchor, "hash key element", node->nd_head, 0));
- NO_CHECK(COMPILE_(anchor, "hash value element", node->nd_next->nd_head, 0));
- stack_len += 2;
-
- /* If there are many pushed elements, flush them to avoid stack overflow */
- if (stack_len >= max_stack_len) FLUSH_CHUNK();
- }
- else {
- /* kwsplat case: foo(..., **kw, ...) */
- FLUSH_CHUNK();
-
- const NODE *kw = node->nd_next->nd_head;
- int empty_kw = nd_type(kw) == NODE_LIT; /* foo( ..., **{}, ...) */
- int first_kw = first_chunk && stack_len == 0; /* foo(1,2,3, **kw, ...) */
- int last_kw = !node->nd_next->nd_next; /* foo( ..., **kw) */
- int only_kw = last_kw && first_kw; /* foo(1,2,3, **kw) */
-
- if (empty_kw) {
- if (only_kw) {
- /* **{} appears at the last, so it won't be modified.
- * kw is a special NODE_LIT that contains a special empty hash,
- * so this emits: putobject {}
- */
- NO_CHECK(COMPILE(ret, "keyword splat", kw));
- }
- else if (first_kw) {
- /* **{} appears at the first, so it may be modified.
- * We need to create a fresh hash object.
- */
- ADD_INSN1(ret, line, newhash, INT2FIX(0));
- }
- }
- else {
- /* This is not empty hash: **{k:1}.
- * We need to clone the hash (if first), or merge the hash to
- * the accumulated hash (if not first).
- */
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- if (first_kw) ADD_INSN1(ret, line, newhash, INT2FIX(0));
- else ADD_INSN(ret, line, swap);
-
- NO_CHECK(COMPILE(ret, "keyword splat", kw));
-
- ADD_SEND(ret, line, id_core_hash_merge_kwd, INT2FIX(2));
- }
-
- first_chunk = 0;
- }
- }
}
+ return len;
+}
- FLUSH_CHUNK();
-#undef FLUSH_CHUNK
- return 1;
+static VALUE
+compile_array(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root, enum compile_array_type_t type)
+{
+ return compile_array_(iseq, ret, node_root, type, NULL, 0);
}
-VALUE
-rb_node_case_when_optimizable_literal(const NODE *const node)
+static VALUE
+case_when_optimizable_literal(NODE * node)
{
switch (nd_type(node)) {
case NODE_LIT: {
@@ -4300,43 +2683,40 @@ rb_node_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;
- VALUE lit = rb_node_case_when_optimizable_literal(val);
+ NODE* val = vals->nd_head;
+ VALUE lit = case_when_optimizable_literal(val);
if (lit == Qundef) {
only_special_literals = 0;
}
- else if (NIL_P(rb_hash_lookup(literals, lit))) {
- rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
+ else {
+ if (rb_hash_lookup(literals, lit) != Qnil) {
+ rb_compile_warning(RSTRING_PTR(iseq->location.path), nd_line(val), "duplicated when clause is ignored");
+ }
+ else {
+ rb_hash_aset(literals, lit, (VALUE)(l1) | 1);
+ }
}
ADD_INSN(cond_seq, nd_line(val), dup); /* dup target */
if (nd_type(val) == NODE_STR) {
+ val->nd_lit = rb_fstring(val->nd_lit);
debugp_param("nd_lit", val->nd_lit);
- lit = rb_fstring(val->nd_lit);
- ADD_INSN1(cond_seq, nd_line(val), putobject, lit);
- RB_OBJ_WRITTEN(iseq, Qundef, lit);
+ ADD_INSN1(cond_seq, nd_line(val), putobject, val->nd_lit);
}
else {
- if (!COMPILE(cond_seq, "when cond", val)) return -1;
+ COMPILE(cond_seq, "when cond", val);
}
ADD_INSN1(cond_seq, nd_line(vals), checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
@@ -4347,60 +2727,19 @@ when_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, const NODE *vals,
}
static int
-when_splat_vals(rb_iseq_t *iseq, LINK_ANCHOR *const cond_seq, const NODE *vals,
- LABEL *l1, int only_special_literals, VALUE literals)
-{
- const int line = nd_line(vals);
-
- switch (nd_type(vals)) {
- case NODE_LIST:
- if (when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals) < 0)
- return COMPILE_NG;
- break;
- case NODE_SPLAT:
- ADD_INSN (cond_seq, line, dup);
- CHECK(COMPILE(cond_seq, "when splat", vals->nd_head));
- ADD_INSN1(cond_seq, line, splatarray, Qfalse);
- ADD_INSN1(cond_seq, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
- ADD_INSNL(cond_seq, line, branchif, l1);
- break;
- case NODE_ARGSCAT:
- CHECK(when_splat_vals(iseq, cond_seq, vals->nd_head, l1, only_special_literals, literals));
- CHECK(when_splat_vals(iseq, cond_seq, vals->nd_body, l1, only_special_literals, literals));
- break;
- case NODE_ARGSPUSH:
- CHECK(when_splat_vals(iseq, cond_seq, vals->nd_head, l1, only_special_literals, literals));
- ADD_INSN (cond_seq, line, dup);
- CHECK(COMPILE(cond_seq, "when argspush body", vals->nd_body));
- ADD_INSN1(cond_seq, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- ADD_INSNL(cond_seq, line, branchif, l1);
- break;
- default:
- ADD_INSN (cond_seq, line, dup);
- CHECK(COMPILE(cond_seq, "when val", vals));
- ADD_INSN1(cond_seq, line, splatarray, Qfalse);
- ADD_INSN1(cond_seq, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE | VM_CHECKMATCH_ARRAY));
- ADD_INSNL(cond_seq, line, branchif, l1);
- break;
- }
- return COMPILE_OK;
-}
-
-
-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 *)OPERAND_AT(iobj, 0);
+ ci = (rb_call_info_t *)iobj->operands[0];
ci->orig_argc += 1;
dupidx = INT2FIX(ci->orig_argc);
@@ -4416,16 +2755,16 @@ compile_massign_lhs(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const n
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);
}
}
@@ -4433,26 +2772,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; \
@@ -4463,12 +2801,12 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
mem[memindex++] = (v); \
}
- if (rhsn == 0 || nd_type(rhsn) != NODE_LIST) {
+ if (rhsn == 0 || nd_type(rhsn) != NODE_ARRAY) {
return 0;
}
while (lhsn) {
- const NODE *ln = lhsn->nd_head;
+ NODE *ln = lhsn->nd_head;
switch (nd_type(ln)) {
case NODE_LASGN:
MEMORY(ln->nd_vid);
@@ -4476,6 +2814,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;
@@ -4488,10 +2827,10 @@ compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
while (rhsn) {
if (llen <= rlen) {
- NO_CHECK(COMPILE_POPPED(ret, "masgn val (popped)", rhsn->nd_head));
+ COMPILE_POPED(ret, "masgn val (popped)", rhsn->nd_head);
}
else {
- NO_CHECK(COMPILE(ret, "masgn val", rhsn->nd_head));
+ COMPILE(ret, "masgn val", rhsn->nd_head);
}
rhsn = rhsn->nd_next;
rlen++;
@@ -4507,96 +2846,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 && NODE_NAMED_REST_P(splatn)) ? 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;
}
- NO_CHECK(COMPILE(ret, "normal masgn rhs", rhsn));
+ 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 | (NODE_NAMED_REST_P(restn) ? 0x01 : 0x00);
+ int flag = 0x02 | (((VALUE)restn == (VALUE)-1) ? 0x00 : 0x01);
ADD_INSN2(ret, nd_line(splatn), expandarray,
INT2FIX(num), INT2FIX(flag));
- if (NODE_NAMED_REST_P(restn)) {
- 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);
}
}
}
@@ -4604,77 +2905,62 @@ 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);
- ADD_INSN1(body, nd_line(node), putobject, Qtrue);
- ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(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), putobject, Qtrue);
- ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
+ 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);
- ADD_INSN1(body, nd_line(node), putobject, Qfalse);
- ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(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 */
- NO_CHECK(COMPILE(ret, "nd_else->nd_head", cpath->nd_head));
- return VM_DEFINECLASS_FLAG_SCOPED;
+ COMPILE(ret, "nd_else->nd_head", cpath->nd_head);
+ return Qfalse;
}
else {
/* class at cbase Foo */
ADD_INSN1(ret, nd_line(cpath), putspecialobject,
INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
- return 0;
- }
-}
-
-static inline int
-private_recv_p(const NODE *node)
-{
- if (nd_type(node->nd_recv) == NODE_SELF) {
- NODE *self = node->nd_recv;
- return self->nd_state != 0;
+ return Qtrue;
}
- return 0;
}
-static void
-defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const node, LABEL **lfinish, VALUE needstr);
+#define private_recv_p(node) (nd_type((node)->nd_recv) == NODE_SELF)
-static void
-defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const node, LABEL **lfinish, VALUE needstr)
+#define defined_expr defined_expr0
+static int
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
{
- enum defined_type expr_type = DEFINED_NOT_DEFINED;
+ enum defined_type expr_type = 0;
enum node_type type;
- const int line = nd_line(node);
switch (type = nd_type(node)) {
@@ -4692,22 +2978,21 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
expr_type = DEFINED_FALSE;
break;
- case NODE_LIST:{
- const NODE *vals = node;
+ case NODE_ARRAY:{
+ 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(line);
+ lfinish[1] = NEW_LABEL(nd_line(node));
}
- ADD_INSNL(ret, line, branchunless, lfinish[1]);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
} while ((vals = vals->nd_next) != NULL);
}
- /* fall through */
case NODE_STR:
case NODE_LIT:
- case NODE_ZLIST:
+ case NODE_ZARRAY:
case NODE_AND:
case NODE_OR:
default:
@@ -4721,99 +3006,103 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
break;
case NODE_IVAR:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_IVAR),
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_IVAR),
ID2SYM(node->nd_vid), needstr);
- return;
+ return 1;
case NODE_GVAR:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_GVAR),
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_GVAR),
ID2SYM(node->nd_entry->id), needstr);
- return;
+ return 1;
case NODE_CVAR:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_CVAR),
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CVAR),
ID2SYM(node->nd_vid), needstr);
- return;
+ return 1;
case NODE_CONST:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_CONST),
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_CONST),
ID2SYM(node->nd_vid), needstr);
- return;
+ return 1;
case NODE_COLON2:
if (!lfinish[1]) {
- lfinish[1] = NEW_LABEL(line);
+ lfinish[1] = NEW_LABEL(nd_line(node));
}
- defined_expr0(iseq, ret, node->nd_head, lfinish, Qfalse);
- ADD_INSNL(ret, line, branchunless, lfinish[1]);
- NO_CHECK(COMPILE(ret, "defined/colon2#nd_head", node->nd_head));
+ defined_expr(iseq, ret, node->nd_head, lfinish, Qfalse);
+ ADD_INSNL(ret, nd_line(node), branchunless, lfinish[1]);
- ADD_INSN3(ret, line, defined,
- (rb_is_const_id(node->nd_mid) ?
- INT2FIX(DEFINED_CONST_FROM) : INT2FIX(DEFINED_METHOD)),
- ID2SYM(node->nd_mid), needstr);
- return;
+ 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, line, putobject, rb_cObject);
- ADD_INSN3(ret, line, defined,
- INT2FIX(DEFINED_CONST_FROM), ID2SYM(node->nd_mid), needstr);
- return;
+ ADD_INSN1(ret, nd_line(node), putobject, rb_cObject);
+ ADD_INSN3(ret, nd_line(node), defined,
+ INT2FIX(DEFINED_CONST), ID2SYM(node->nd_mid), needstr);
+ return 1;
/* 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)) {
- lfinish[1] = NEW_LABEL(line);
+ if (!lfinish[1]) {
+ lfinish[1] = NEW_LABEL(nd_line(node));
}
if (node->nd_args) {
- defined_expr0(iseq, ret, node->nd_args, lfinish, Qfalse);
- ADD_INSNL(ret, line, branchunless, lfinish[1]);
+ 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);
- ADD_INSNL(ret, line, branchunless, lfinish[1]);
- NO_CHECK(COMPILE(ret, "defined/recv", node->nd_recv));
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_METHOD),
+ 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),
ID2SYM(node->nd_mid), needstr);
}
else {
- ADD_INSN(ret, line, putself);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_FUNC),
+ ADD_INSN(ret, nd_line(node), putself);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_FUNC),
ID2SYM(node->nd_mid), needstr);
}
- return;
+ return 1;
}
case NODE_YIELD:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_YIELD), 0,
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_YIELD), 0,
needstr);
- return;
+ return 1;
case NODE_BACK_REF:
case NODE_NTH_REF:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_REF),
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_REF),
INT2FIX((node->nd_nth << 1) | (type == NODE_BACK_REF)),
needstr);
- return;
+ return 1;
case NODE_SUPER:
case NODE_ZSUPER:
- ADD_INSN(ret, line, putnil);
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_ZSUPER), 0,
+ ADD_INSN(ret, nd_line(node), putnil);
+ ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_ZSUPER), 0,
needstr);
- return;
+ return 1;
case NODE_OP_ASGN1:
case NODE_OP_ASGN2:
@@ -4826,111 +3115,82 @@ 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;
}
- assert(expr_type != DEFINED_NOT_DEFINED);
-
- if (needstr != Qfalse) {
- VALUE str = rb_iseq_defined_string(expr_type);
- ADD_INSN1(ret, line, putobject, str);
- }
- else {
- ADD_INSN1(ret, line, putobject, Qtrue);
+ if (expr_type) {
+ if (needstr != Qfalse) {
+ VALUE str = rb_iseq_defined_string(expr_type);
+ ADD_INSN1(ret, nd_line(node), putobject, str);
+ }
+ else {
+ ADD_INSN1(ret, nd_line(node), putobject, Qtrue);
+ }
+ return 1;
}
+ return 0;
}
+#undef defined_expr
-static void
-build_defined_rescue_iseq(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const void *unused)
-{
- ADD_INSN(ret, 0, putnil);
- iseq_set_exception_local_table(iseq);
-}
-
-static void
-defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
- const NODE *const node, LABEL **lfinish, VALUE needstr)
+static int
+defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *ret,
+ NODE *node, LABEL **lfinish, VALUE needstr)
{
LINK_ELEMENT *lcur = ret->last;
- defined_expr0(iseq, ret, node, lfinish, needstr);
+ int done = defined_expr0(iseq, ret, node, lfinish, needstr);
if (lfinish[1]) {
int line = nd_line(node);
LABEL *lstart = NEW_LABEL(line);
LABEL *lend = NEW_LABEL(line);
- const rb_iseq_t *rescue;
- struct rb_iseq_new_with_callback_callback_func *ifunc =
- rb_iseq_new_with_callback_new_callback(build_defined_rescue_iseq, NULL);
- rescue = new_child_iseq_with_callback(iseq, ifunc,
- rb_str_concat(rb_str_new2("defined guard in "),
- iseq->body->location.label),
- iseq, ISEQ_TYPE_RESCUE, 0);
+ VALUE rescue = NEW_CHILD_ISEQVAL(NEW_NIL(),
+ rb_str_concat(rb_str_new2
+ ("defined guard in "),
+ iseq->location.label),
+ ISEQ_TYPE_DEFINED_GUARD, 0);
lstart->rescued = LABEL_RESCUE_BEG;
lend->rescued = LABEL_RESCUE_END;
APPEND_LABEL(ret, lcur, lstart);
ADD_LABEL(ret, lend);
ADD_CATCH_ENTRY(CATCH_TYPE_RESCUE, lstart, lend, rescue, lfinish[1]);
}
-}
-
-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;
+ return done;
}
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
@@ -4952,16 +3212,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);
@@ -4969,9 +3229,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);
- NO_CHECK(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);
}
@@ -4982,2234 +3242,808 @@ 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 int
-check_keyword(const NODE *node)
+static VALUE
+setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args, NODE *argn, unsigned int *flag, rb_call_info_kw_arg_t **keywords)
{
- /* This check is essentially a code clone of compile_keyword_arg. */
+ VALUE argc = INT2FIX(0);
+ int nsplat = 0;
+ DECL_ANCHOR(arg_block);
+ DECL_ANCHOR(args_splat);
- if (nd_type(node) == NODE_LIST) {
- while (node->nd_next) {
- node = node->nd_next;
- }
- node = node->nd_head;
+ INIT_ANCHOR(arg_block);
+ INIT_ANCHOR(args_splat);
+ if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
+ COMPILE(arg_block, "block", argn->nd_body);
+ *flag |= VM_CALL_ARGS_BLOCKARG;
+ argn = argn->nd_head;
}
- return keyword_node_p(node);
-}
-
-static VALUE
-setup_args_core(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
- int dup_rest, unsigned int *flag, struct rb_call_info_kw_arg **keywords)
-{
+ setup_argn:
if (argn) {
- switch (nd_type(argn)) {
- case NODE_SPLAT: {
- NO_CHECK(COMPILE(args, "args (splat)", argn->nd_head));
- ADD_INSN1(args, nd_line(argn), splatarray, dup_rest ? Qtrue : Qfalse);
- if (flag) *flag |= VM_CALL_ARGS_SPLAT;
- return INT2FIX(1);
- }
- case NODE_ARGSCAT:
- case NODE_ARGSPUSH: {
- int next_is_list = (nd_type(argn->nd_head) == NODE_LIST);
- VALUE argc = setup_args_core(iseq, args, argn->nd_head, 1, NULL, NULL);
- if (nd_type(argn->nd_body) == NODE_LIST) {
- /* This branch is needed to avoid "newarraykwsplat" [Bug #16442] */
- int rest_len = compile_args(iseq, args, argn->nd_body, NULL, NULL);
- ADD_INSN1(args, nd_line(argn), newarray, INT2FIX(rest_len));
- }
- else {
- NO_CHECK(COMPILE(args, "args (cat: splat)", argn->nd_body));
- }
- if (flag) {
- *flag |= VM_CALL_ARGS_SPLAT;
- /* This is a dirty hack. It traverses the AST twice.
- * In a long term, it should be fixed by a redesign of keyword arguments */
- if (check_keyword(argn->nd_body))
- *flag |= VM_CALL_KW_SPLAT;
- }
- if (nd_type(argn) == NODE_ARGSCAT) {
- if (next_is_list) {
- ADD_INSN1(args, nd_line(argn), splatarray, Qtrue);
- return INT2FIX(FIX2INT(argc) + 1);
- }
- else {
- ADD_INSN1(args, nd_line(argn), splatarray, Qfalse);
- ADD_INSN(args, nd_line(argn), concatarray);
- return argc;
- }
- }
- else {
- ADD_INSN1(args, nd_line(argn), newarray, INT2FIX(1));
- ADD_INSN(args, nd_line(argn), concatarray);
- return argc;
- }
- }
- case NODE_LIST: {
- int len = compile_args(iseq, args, argn, keywords, flag);
- return INT2FIX(len);
- }
- default: {
- UNKNOWN_NODE("setup_arg", argn, Qnil);
- }
- }
+ switch (nd_type(argn)) {
+ case NODE_SPLAT: {
+ COMPILE(args, "args (splat)", argn->nd_head);
+ ADD_INSN1(args, nd_line(argn), splatarray, Qfalse);
+ argc = INT2FIX(1);
+ nsplat++;
+ *flag |= VM_CALL_ARGS_SPLAT;
+ break;
+ }
+ case NODE_ARGSCAT:
+ case NODE_ARGSPUSH: {
+ int next_is_array = (nd_type(argn->nd_head) == NODE_ARRAY);
+ DECL_ANCHOR(tmp);
+
+ INIT_ANCHOR(tmp);
+ COMPILE(tmp, "args (cat: splat)", argn->nd_body);
+ 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 (next_is_array) {
+ argc = INT2FIX(compile_array(iseq, args, argn->nd_head, COMPILE_ARRAY_TYPE_ARGS) + 1);
+ }
+ else {
+ argn = argn->nd_head;
+ goto setup_argn;
+ }
+ break;
+ }
+ case NODE_ARRAY:
+ {
+ argc = INT2FIX(compile_array_(iseq, args, argn, COMPILE_ARRAY_TYPE_ARGS, keywords, FALSE));
+ break;
+ }
+ default: {
+ rb_bug("setup_arg: unknown node: %s\n", ruby_node_name(nd_type(argn)));
+ }
+ }
}
- return INT2FIX(0);
-}
-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)
-{
- VALUE ret;
- if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
- DECL_ANCHOR(arg_block);
- INIT_ANCHOR(arg_block);
- NO_CHECK(COMPILE(arg_block, "block", argn->nd_body));
-
- *flag |= VM_CALL_ARGS_BLOCKARG;
- ret = setup_args_core(iseq, args, argn->nd_head, 0, flag, keywords);
-
- 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(getblockparamproxy);
- }
- }
- }
- ADD_SEQ(args, arg_block);
+ if (nsplat > 1) {
+ int i;
+ for (i=1; i<nsplat; i++) {
+ ADD_INSN(args_splat, nd_line(args), concatarray);
+ }
}
- else {
- ret = setup_args_core(iseq, args, argn, 0, flag, keywords);
+
+ if (!LIST_SIZE_ZERO(args_splat)) {
+ ADD_SEQ(args, args_splat);
}
- return ret;
+
+ if (*flag & VM_CALL_ARGS_BLOCKARG) {
+ ADD_SEQ(args, arg_block);
+ }
+ return argc;
}
-static void
-build_postexe_iseq(rb_iseq_t *iseq, LINK_ANCHOR *ret, const void *ptr)
+static VALUE
+build_postexe_iseq(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE *body)
{
- const NODE *body = ptr;
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);
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)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)
-{
- const NODE *vars;
- LINK_ELEMENT *last;
- int line = nd_line(node);
- LABEL *fail_label = NEW_LABEL(line), *end_label = NEW_LABEL(line);
+/**
+ compile each node
-#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);
+ 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)
+{
+ enum node_type type;
+ LINK_ELEMENT *saved_last_element = 0;
+ int line;
- for (vars = node; vars; vars = vars->nd_next) {
- INSN *cap;
- if (vars->nd_next) {
- ADD_INSN(ret, line, dup);
- }
- last = ret->last;
- NO_CHECK(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 == 0) {
+ if (!poped) {
+ debugs("node: NODE_NIL(implicit)\n");
+ ADD_INSN(ret, iseq->compile_data->last_line, putnil);
}
-#endif
+ return COMPILE_OK;
}
- 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;
- NO_CHECK(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);
-}
-static int
-number_literal_p(const NODE *n)
-{
- return (n && nd_type(n) == NODE_LIT && RB_INTEGER_TYPE_P(n->nd_lit));
-}
+ line = (int)nd_line(node);
-static int
-compile_if(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped, const enum node_type type)
-{
- struct rb_iseq_constant_body *const body = iseq->body;
- 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 = Qfalse;
- int ci_size, ci_kw_size;
- VALUE catch_table = ISEQ_COMPILE_DATA(iseq)->catch_table_ary;
- long catch_table_size = NIL_P(catch_table) ? 0 : RARRAY_LEN(catch_table);
-
- 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 = body->ci_size;
- ci_kw_size = body->ci_kw_size;
- CHECK(COMPILE_(then_seq, "then", node_body, popped));
- catch_table = ISEQ_COMPILE_DATA(iseq)->catch_table_ary;
- if (!then_label->refcnt) {
- body->ci_size = ci_size;
- body->ci_kw_size = ci_kw_size;
- if (!NIL_P(catch_table)) rb_ary_set_len(catch_table, catch_table_size);
+ if (iseq->compile_data->last_line == line) {
+ /* ignore */
}
else {
- if (!NIL_P(catch_table)) catch_table_size = RARRAY_LEN(catch_table);
+ if (node->flags & NODE_FL_NEWLINE) {
+ iseq->compile_data->last_line = line;
+ ADD_TRACE(ret, line, RUBY_EVENT_LINE);
+ saved_last_element = ret->last;
+ }
}
- ci_size = body->ci_size;
- ci_kw_size = body->ci_kw_size;
- CHECK(COMPILE_(else_seq, "else", node_else, popped));
- catch_table = ISEQ_COMPILE_DATA(iseq)->catch_table_ary;
- if (!else_label->refcnt) {
- body->ci_size = ci_size;
- body->ci_kw_size = ci_kw_size;
- if (!NIL_P(catch_table)) rb_ary_set_len(catch_table, catch_table_size);
- }
- else {
- if (!NIL_P(catch_table)) catch_table_size = RARRAY_LEN(catch_table);
- }
+ debug_node_start(node);
- ADD_SEQ(ret, cond_seq);
+ type = nd_type(node);
- if (then_label->refcnt && else_label->refcnt) {
- DECL_BRANCH_BASE(branches, lineno, column, last_lineno, last_column, type == NODE_IF ? "if" : "unless");
- }
+ 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;
+ }
+ if (node) {
+ COMPILE_(ret, "BLOCK next", node->nd_next, poped);
+ }
+ 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);
+
+ 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);
- 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);
- end_label = NEW_LABEL(line);
- ADD_INSNL(then_seq, line, jump, end_label);
- }
ADD_SEQ(ret, then_seq);
- }
+ 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 = Qfalse;
+ 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)));
+ }
- RHASH_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;
- EXPECT_NODE("NODE_CASE", node, NODE_WHEN, COMPILE_NG);
- 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);
-
- endlabel = NEW_LABEL(line);
- elselabel = NEW_LABEL(line);
-
- ADD_SEQ(ret, head); /* case VAL */
-
- while (type == NODE_WHEN) {
- LABEL *l1;
-
- 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);
-
- vals = node->nd_head;
- if (vals) {
- switch (nd_type(vals)) {
- case NODE_LIST:
- only_special_literals = when_vals(iseq, cond_seq, vals, l1, only_special_literals, literals);
- if (only_special_literals < 0) return COMPILE_NG;
- break;
- case NODE_SPLAT:
- case NODE_ARGSCAT:
- case NODE_ARGSPUSH:
- only_special_literals = 0;
- CHECK(when_splat_vals(iseq, cond_seq, vals, l1, only_special_literals, literals));
+ 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);
+
+ 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");
+ }
+
+ node = node->nd_next;
+ if (!node) {
break;
- default:
- UNKNOWN_NODE("NODE_CASE", vals, COMPILE_NG);
}
+ type = nd_type(node);
+ line = nd_line(node);
}
- else {
- EXPECT_NODE_NONULL("NODE_CASE", node, NODE_LIST, COMPILE_NG);
- }
-
- node = node->nd_next;
- if (!node) {
- break;
+ /* 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);
}
- 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);
+ 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);
}
- ADD_INSNL(cond_seq, nd_line(orig_node), jump, endlabel);
- }
- if (only_special_literals && ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- ADD_INSN(ret, nd_line(orig_node), dup);
- ADD_INSN2(ret, nd_line(orig_node), opt_case_dispatch, literals, elselabel);
- RB_OBJ_WRITTEN(iseq, Qundef, literals);
- LABEL_REF(elselabel);
- }
+ if (only_special_literals) {
+ iseq_add_mark_object(iseq, literals);
- ADD_SEQ(ret, cond_seq);
- ADD_SEQ(ret, body_seq);
- ADD_LABEL(ret, endlabel);
- return COMPILE_OK;
-}
+ ADD_INSN(ret, nd_line(tempnode), dup);
+ ADD_INSN2(ret, nd_line(tempnode), opt_case_dispatch, literals, elselabel);
+ }
-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 = Qfalse;
-
- 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) {
- EXPECT_NODE_NONULL("NODE_WHEN", node, NODE_LIST, COMPILE_NG);
- }
- switch (nd_type(vals)) {
- case NODE_LIST:
- while (vals) {
- LABEL *lnext;
- val = vals->nd_head;
- lnext = NEW_LABEL(nd_line(val));
- debug_compile("== when2\n", (void)0);
- CHECK(compile_branch_condition(iseq, ret, val, l1, lnext));
- ADD_LABEL(ret, lnext);
- vals = vals->nd_next;
+ 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");
}
- 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;
-}
-
-static int
-iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int in_alt_pattern)
-{
- const int line = nd_line(node);
-
- switch (nd_type(node)) {
- case NODE_ARYPTN: {
- /*
- * if pattern.use_rest_num?
- * rest_num = 0
- * end
- * if pattern.has_constant_node?
- * unless pattern.constant === obj
- * goto match_failed
- * end
- * end
- * unless obj.respond_to?(:deconstruct)
- * goto match_failed
- * end
- * d = obj.deconstruct
- * unless Array === d
- * goto type_error
- * end
- * min_argc = pattern.pre_args_num + pattern.post_args_num
- * if pattern.has_rest_arg?
- * unless d.length >= min_argc
- * goto match_failed
- * end
- * else
- * unless d.length == min_argc
- * goto match_failed
- * end
- * end
- * pattern.pre_args_num.each do |i|
- * unless pattern.pre_args[i].match?(d[i])
- * goto match_failed
- * end
- * end
- * if pattern.use_rest_num?
- * rest_num = d.length - min_argc
- * if pattern.has_rest_arg? && pattern.has_rest_arg_id # not `*`, but `*rest`
- * unless pattern.rest_arg.match?(d[pattern.pre_args_num, rest_num])
- * goto match_failed
- * end
- * end
- * end
- * pattern.post_args_num.each do |i|
- * j = pattern.pre_args_num + i
- * j += rest_num
- * unless pattern.post_args[i].match?(d[j])
- * goto match_failed
- * end
- * end
- * true
- * goto fin
- * type_error:
- * FrozenCore.raise TypeError
- * match_failed:
- * false
- * fin:
- */
- struct rb_ary_pattern_info *apinfo = node->nd_apinfo;
- const NODE *args = apinfo->pre_args;
- const int pre_args_num = apinfo->pre_args ? rb_long2int(apinfo->pre_args->nd_alen) : 0;
- const int post_args_num = apinfo->post_args ? rb_long2int(apinfo->post_args->nd_alen) : 0;
-
- const int min_argc = pre_args_num + post_args_num;
- const int use_rest_num = apinfo->rest_arg && (NODE_NAMED_REST_P(apinfo->rest_arg) ||
- (!NODE_NAMED_REST_P(apinfo->rest_arg) && post_args_num > 0));
-
- LABEL *match_failed, *type_error, *fin;
- int i;
- match_failed = NEW_LABEL(line);
- type_error = NEW_LABEL(line);
- fin = NEW_LABEL(line);
-
- if (use_rest_num) {
- ADD_INSN1(ret, line, putobject, INT2FIX(0)); /* allocate stack for rest_num */
- ADD_INSN(ret, line, swap);
- }
-
- if (node->nd_pconst) {
- ADD_INSN(ret, line, dup);
- CHECK(COMPILE(ret, "constant", node->nd_pconst));
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
-
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, ID2SYM(rb_intern("deconstruct")));
- ADD_SEND(ret, line, idRespond_to, INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, match_failed);
-
- ADD_SEND(ret, line, rb_intern("deconstruct"), INT2FIX(0));
-
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, checktype, INT2FIX(T_ARRAY));
- ADD_INSNL(ret, line, branchunless, type_error);
-
- ADD_INSN(ret, line, dup);
- ADD_SEND(ret, line, idLength, INT2FIX(0));
- ADD_INSN1(ret, line, putobject, INT2FIX(min_argc));
- ADD_SEND(ret, line, apinfo->rest_arg ? idGE : idEq, INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, match_failed);
-
- for (i = 0; i < pre_args_num; i++) {
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, INT2FIX(i));
- ADD_SEND(ret, line, idAREF, INT2FIX(1));
- iseq_compile_pattern_each(iseq, ret, args->nd_head, in_alt_pattern);
- args = args->nd_next;
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
-
- if (apinfo->rest_arg) {
- if (NODE_NAMED_REST_P(apinfo->rest_arg)) {
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, INT2FIX(pre_args_num));
- ADD_INSN1(ret, line, topn, INT2FIX(1));
- ADD_SEND(ret, line, idLength, INT2FIX(0));
- ADD_INSN1(ret, line, putobject, INT2FIX(min_argc));
- ADD_SEND(ret, line, idMINUS, INT2FIX(1));
- ADD_INSN1(ret, line, setn, INT2FIX(4));
- ADD_SEND(ret, line, idAREF, INT2FIX(2));
-
- iseq_compile_pattern_each(iseq, ret, apinfo->rest_arg, in_alt_pattern);
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
- else {
- if (post_args_num > 0) {
- ADD_INSN(ret, line, dup);
- ADD_SEND(ret, line, idLength, INT2FIX(0));
- ADD_INSN1(ret, line, putobject, INT2FIX(min_argc));
- ADD_SEND(ret, line, idMINUS, INT2FIX(1));
- ADD_INSN1(ret, line, setn, INT2FIX(2));
- ADD_INSN(ret, line, pop);
- }
- }
- }
-
- args = apinfo->post_args;
- for (i = 0; i < post_args_num; i++) {
- ADD_INSN(ret, line, dup);
-
- ADD_INSN1(ret, line, putobject, INT2FIX(pre_args_num + i));
- ADD_INSN1(ret, line, topn, INT2FIX(3));
- ADD_SEND(ret, line, idPLUS, INT2FIX(1));
-
- ADD_SEND(ret, line, idAREF, INT2FIX(1));
- iseq_compile_pattern_each(iseq, ret, args->nd_head, in_alt_pattern);
- args = args->nd_next;
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
+ switch (nd_type(vals)) {
+ case NODE_ARRAY:
+ 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:
+ 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:
+ rb_bug("NODE_WHEN: unknown node (%s)",
+ ruby_node_name(nd_type(vals)));
+ }
+ node = node->nd_next;
+ }
+ /* else */
+ COMPILE_(ret, "else", node, poped);
+ ADD_INSNL(ret, nd_line(orig_node), jump, endlabel);
- ADD_INSN(ret, line, pop);
- if (use_rest_num) {
- ADD_INSN(ret, line, pop);
- }
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSNL(ret, line, jump, fin);
-
- ADD_LABEL(ret, type_error);
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putobject, rb_eTypeError);
- ADD_INSN1(ret, line, putobject, rb_fstring_lit("deconstruct must return Array"));
- ADD_SEND(ret, line, id_core_raise, INT2FIX(2));
-
- ADD_LABEL(ret, match_failed);
- ADD_INSN(ret, line, pop);
- if (use_rest_num) {
- ADD_INSN(ret, line, pop);
- }
- ADD_INSN1(ret, line, putobject, Qfalse);
- ADD_LABEL(ret, fin);
+ ADD_SEQ(ret, body_seq);
+ ADD_LABEL(ret, endlabel);
- break;
+ break;
}
- case NODE_HSHPTN: {
- /*
- * keys = nil
- * if pattern.has_kw_args_node? && !pattern.has_kw_rest_arg_node?
- * keys = pattern.kw_args_node.keys
- * end
- * if pattern.has_constant_node?
- * unless pattern.constant === obj
- * goto match_failed
- * end
- * end
- * unless obj.respond_to?(:deconstruct_keys)
- * goto match_failed
- * end
- * d = obj.deconstruct_keys(keys)
- * unless Hash === d
- * goto type_error
- * end
- * if pattern.has_kw_rest_arg_node?
- * d = d.dup
- * end
- * if pattern.has_kw_args_node?
- * pattern.kw_args_node.each |k,|
- * unless d.key?(k)
- * goto match_failed
- * end
- * end
- * pattern.kw_args_node.each |k, pat|
- * if pattern.has_kw_rest_arg_node?
- * unless pat.match?(d.delete(k))
- * goto match_failed
- * end
- * else
- * unless pat.match?(d[k])
- * goto match_failed
- * end
- * end
- * end
- * else
- * unless d.empty?
- * goto match_failed
- * end
- * end
- * if pattern.has_kw_rest_arg_node?
- * if pattern.no_rest_keyword?
- * unless d.empty?
- * goto match_failed
- * end
- * else
- * unless pattern.kw_rest_arg_node.match?(d)
- * goto match_failed
- * end
- * end
- * end
- * true
- * goto fin
- * type_error:
- * FrozenCore.raise TypeError
- * match_failed:
- * false
- * fin:
- */
- LABEL *match_failed, *type_error, *fin;
- VALUE keys = Qnil;
-
- match_failed = NEW_LABEL(line);
- type_error = NEW_LABEL(line);
- fin = NEW_LABEL(line);
-
- if (node->nd_pkwargs && !node->nd_pkwrestarg) {
- const NODE *kw_args = node->nd_pkwargs->nd_head;
- keys = rb_ary_new_capa(kw_args ? kw_args->nd_alen/2 : 0);
- while (kw_args) {
- rb_ary_push(keys, kw_args->nd_head->nd_lit);
- kw_args = kw_args->nd_next->nd_next;
- }
- }
-
- if (node->nd_pconst) {
- ADD_INSN(ret, line, dup);
- CHECK(COMPILE(ret, "constant", node->nd_pconst));
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
-
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, ID2SYM(rb_intern("deconstruct_keys")));
- ADD_SEND(ret, line, idRespond_to, INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, match_failed);
-
- if (NIL_P(keys)) {
- ADD_INSN(ret, line, putnil);
- }
- else {
- ADD_INSN1(ret, line, duparray, keys);
- RB_OBJ_WRITTEN(iseq, Qundef, rb_obj_hide(keys));
- }
- ADD_SEND(ret, line, rb_intern("deconstruct_keys"), INT2FIX(1));
-
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, checktype, INT2FIX(T_HASH));
- ADD_INSNL(ret, line, branchunless, type_error);
-
- if (node->nd_pkwrestarg) {
- ADD_SEND(ret, line, rb_intern("dup"), INT2FIX(0));
- }
+ 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;
- if (node->nd_pkwargs) {
- int i;
- int keys_num;
- const NODE *args;
- args = node->nd_pkwargs->nd_head;
- if (args) {
- DECL_ANCHOR(match_values);
- INIT_ANCHOR(match_values);
- keys_num = rb_long2int(args->nd_alen) / 2;
- for (i = 0; i < keys_num; i++) {
- NODE *key_node = args->nd_head;
- NODE *value_node = args->nd_next->nd_head;
- VALUE key;
-
- if (nd_type(key_node) != NODE_LIT) {
- UNKNOWN_NODE("NODE_IN", key_node, COMPILE_NG);
- }
- key = key_node->nd_lit;
-
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, putobject, key);
- ADD_SEND(ret, line, rb_intern("key?"), INT2FIX(1));
- ADD_INSNL(ret, line, branchunless, match_failed);
-
- ADD_INSN(match_values, line, dup);
- ADD_INSN1(match_values, line, putobject, key);
- ADD_SEND(match_values, line, node->nd_pkwrestarg ? rb_intern("delete") : idAREF, INT2FIX(1));
- iseq_compile_pattern_each(iseq, match_values, value_node, in_alt_pattern);
- ADD_INSNL(match_values, line, branchunless, match_failed);
- args = args->nd_next->nd_next;
- }
- ADD_SEQ(ret, match_values);
- }
- }
- else {
- ADD_INSN(ret, line, dup);
- ADD_SEND(ret, line, idEmptyP, INT2FIX(0));
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
+ struct iseq_compile_data_ensure_node_stack enl;
- if (node->nd_pkwrestarg) {
- if (node->nd_pkwrestarg == NODE_SPECIAL_NO_REST_KEYWORD) {
- ADD_INSN(ret, line, dup);
- ADD_SEND(ret, line, idEmptyP, INT2FIX(0));
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
- else {
- ADD_INSN(ret, line, dup);
- iseq_compile_pattern_each(iseq, ret, node->nd_pkwrestarg, in_alt_pattern);
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
- }
+ 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);
- ADD_INSN(ret, line, pop);
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSNL(ret, line, jump, fin);
+ LABEL *next_catch_label = NEW_LABEL(line);
+ LABEL *tmp_label = NULL;
- ADD_LABEL(ret, type_error);
- ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(ret, line, putobject, rb_eTypeError);
- ADD_INSN1(ret, line, putobject, rb_fstring_lit("deconstruct_keys must return Hash"));
- ADD_SEND(ret, line, id_core_raise, INT2FIX(2));
+ iseq->compile_data->loopval_popped = 0;
+ push_ensure_entry(iseq, &enl, 0, 0);
- ADD_LABEL(ret, match_failed);
- ADD_INSN(ret, line, pop);
- ADD_INSN1(ret, line, putobject, Qfalse);
+ 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, 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, fin);
- break;
- }
- case NODE_LIT:
- case NODE_STR:
- case NODE_XSTR:
- case NODE_DSTR:
- case NODE_DSYM:
- case NODE_DREGX:
- case NODE_LIST:
- case NODE_ZLIST:
- case NODE_LAMBDA:
- case NODE_DOT2:
- case NODE_DOT3:
- case NODE_CONST:
- case NODE_LVAR:
- case NODE_DVAR:
- case NODE_TRUE:
- case NODE_FALSE:
- case NODE_SELF:
- case NODE_NIL:
- case NODE_COLON2:
- case NODE_COLON3:
- CHECK(COMPILE(ret, "case in literal", node));
- ADD_INSN1(ret, line, checkmatch, INT2FIX(VM_CHECKMATCH_TYPE_CASE));
- break;
- case NODE_LASGN: {
- struct rb_iseq_constant_body *const body = iseq->body;
- ID id = node->nd_vid;
- int idx = body->local_iseq->body->local_table_size - get_local_var_idx(iseq, id);
-
- if (in_alt_pattern) {
- const char *name = rb_id2name(id);
- if (name && strlen(name) > 0 && name[0] != '_') {
- COMPILE_ERROR(ERROR_ARGS "illegal variable in alternative pattern (%"PRIsVALUE")",
- rb_id2str(id));
- return COMPILE_NG;
- }
- }
+ ADD_LABEL(ret, redo_label);
+ COMPILE_POPED(ret, "while body", node->nd_body);
+ ADD_LABEL(ret, next_label); /* next */
- ADD_SETLOCAL(ret, line, idx, get_lvar_level(iseq));
- ADD_INSN1(ret, line, putobject, Qtrue);
- break;
- }
- case NODE_DASGN:
- case NODE_DASGN_CURR: {
- int idx, lv, ls;
- ID id = node->nd_vid;
-
- idx = get_dyna_var_idx(iseq, id, &lv, &ls);
-
- if (in_alt_pattern) {
- const char *name = rb_id2name(id);
- if (name && strlen(name) > 0 && name[0] != '_') {
- COMPILE_ERROR(ERROR_ARGS "illegal variable in alternative pattern (%"PRIsVALUE")",
- rb_id2str(id));
- return COMPILE_NG;
- }
- }
+ 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 */
+ }
- if (idx < 0) {
- COMPILE_ERROR(ERROR_ARGS "NODE_DASGN(_CURR): unknown id (%"PRIsVALUE")",
- rb_id2str(id));
- return COMPILE_NG;
- }
- ADD_SETLOCAL(ret, line, ls - idx, lv);
- ADD_INSN1(ret, line, putobject, Qtrue);
- break;
- }
- case NODE_IF:
- case NODE_UNLESS: {
- LABEL *match_failed, *fin;
- match_failed = NEW_LABEL(line);
- fin = NEW_LABEL(line);
- iseq_compile_pattern_each(iseq, ret, node->nd_body, in_alt_pattern);
- ADD_INSNL(ret, line, branchunless, match_failed);
- CHECK(COMPILE(ret, "case in if", node->nd_cond));
- if (nd_type(node) == NODE_IF) {
- ADD_INSNL(ret, line, branchunless, match_failed);
- }
- else {
- ADD_INSNL(ret, line, branchif, match_failed);
- }
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSNL(ret, line, jump, fin);
+ ADD_LABEL(ret, end_label);
- ADD_LABEL(ret, match_failed);
- ADD_INSN1(ret, line, putobject, Qfalse);
+ if (node->nd_state == Qundef) {
+ /* ADD_INSN(ret, line, putundef); */
+ rb_bug("unsupported: putundef");
+ }
+ else {
+ ADD_INSN(ret, line, putnil);
+ }
- ADD_LABEL(ret, fin);
- break;
- }
- case NODE_HASH: {
- NODE *n;
- LABEL *match_failed, *fin;
- match_failed = NEW_LABEL(line);
- fin = NEW_LABEL(line);
-
- n = node->nd_head;
- if (! (nd_type(n) == NODE_LIST && n->nd_alen == 2)) {
- COMPILE_ERROR(ERROR_ARGS "unexpected node");
- return COMPILE_NG;
- }
+ ADD_LABEL(ret, break_label); /* break */
- ADD_INSN(ret, line, dup);
- iseq_compile_pattern_each(iseq, ret, n->nd_head, in_alt_pattern);
- ADD_INSNL(ret, line, branchunless, match_failed);
- iseq_compile_pattern_each(iseq, ret, n->nd_next->nd_head, in_alt_pattern);
- ADD_INSNL(ret, line, jump, fin);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
- ADD_LABEL(ret, match_failed);
- ADD_INSN(ret, line, pop);
- ADD_INSN1(ret, line, putobject, Qfalse);
+ 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);
- ADD_LABEL(ret, fin);
- break;
- }
- case NODE_OR: {
- LABEL *match_succeeded, *fin;
- match_succeeded = NEW_LABEL(line);
- fin = NEW_LABEL(line);
-
- ADD_INSN(ret, line, dup);
- iseq_compile_pattern_each(iseq, ret, node->nd_1st, TRUE);
- ADD_INSNL(ret, line, branchif, match_succeeded);
- iseq_compile_pattern_each(iseq, ret, node->nd_2nd, TRUE);
- ADD_INSNL(ret, line, jump, fin);
-
- ADD_LABEL(ret, match_succeeded);
- ADD_INSN(ret, line, pop);
- ADD_INSN1(ret, line, putobject, Qtrue);
-
- ADD_LABEL(ret, fin);
- break;
+ 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;
}
- default:
- UNKNOWN_NODE("NODE_IN", node, COMPILE_NG);
- }
- return COMPILE_OK;
-}
-
-static int
-compile_case3(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_node, int popped)
-{
- const NODE *pattern;
- const NODE *node = orig_node;
- LABEL *endlabel, *elselabel;
- DECL_ANCHOR(head);
- DECL_ANCHOR(body_seq);
- DECL_ANCHOR(cond_seq);
- int line, lineno, column, last_lineno, last_column;
- enum node_type type;
- VALUE branches = 0;
-
- INIT_ANCHOR(head);
- INIT_ANCHOR(body_seq);
- INIT_ANCHOR(cond_seq);
-
- CHECK(COMPILE(head, "case base", node->nd_head));
-
- DECL_BRANCH_BASE(branches, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "case");
-
- node = node->nd_body;
- EXPECT_NODE("NODE_CASE3", node, NODE_IN, COMPILE_NG);
- 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);
-
- endlabel = NEW_LABEL(line);
- elselabel = NEW_LABEL(line);
-
- ADD_SEQ(ret, head); /* case VAL */
-
- while (type == NODE_IN) {
- LABEL *l1;
-
- 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,
- "in",
- branches);
- CHECK(COMPILE_(body_seq, "in body", node->nd_body, popped));
- ADD_INSNL(body_seq, line, jump, endlabel);
-
- pattern = node->nd_head;
- if (pattern) {
- ADD_INSN (cond_seq, nd_line(pattern), dup);
- iseq_compile_pattern_each(iseq, cond_seq, pattern, FALSE);
- ADD_INSNL(cond_seq, nd_line(pattern), branchif, l1);
- }
- else {
- COMPILE_ERROR(ERROR_ARGS "unexpected node");
- return COMPILE_NG;
- }
-
- 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_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);
- ADD_INSN1(cond_seq, nd_line(orig_node), putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- ADD_INSN1(cond_seq, nd_line(orig_node), putobject, rb_eNoMatchingPatternError);
- ADD_INSN1(cond_seq, nd_line(orig_node), topn, INT2FIX(2));
- ADD_SEND(cond_seq, nd_line(orig_node), id_core_raise, INT2FIX(2));
- ADD_INSN(cond_seq, nd_line(orig_node), pop);
- ADD_INSN(cond_seq, nd_line(orig_node), pop);
- if (!popped) {
- ADD_INSN(cond_seq, nd_line(orig_node), putnil);
- }
- ADD_INSNL(cond_seq, nd_line(orig_node), jump, endlabel);
- }
-
- ADD_SEQ(ret, cond_seq);
- ADD_SEQ(ret, body_seq);
- ADD_LABEL(ret, endlabel);
- return COMPILE_OK;
-}
-
-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 = Qfalse;
-
- 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);
-
- if (node->nd_state == Qundef) {
- /* ADD_INSN(ret, line, putundef); */
- COMPILE_ERROR(ERROR_ARGS "unsupported: putundef");
- return COMPILE_NG;
- }
- else {
- ADD_INSN(ret, line, putnil);
- }
-
- ADD_LABEL(ret, break_label); /* 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);
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
+ ADD_LABEL(ret, retry_label);
+ if (nd_type(node) == NODE_FOR) {
+ COMPILE(ret, "iter caller (for)", node->nd_iter);
- 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);
+ iseq->compile_data->current_block =
+ NEW_CHILD_ISEQVAL(node->nd_body, make_name_for_block(iseq),
+ ISEQ_TYPE_BLOCK, line);
- 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;
-}
-
-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, retry_label);
- if (nd_type(node) == NODE_FOR) {
- CHECK(COMPILE(ret, "iter caller (for)", node->nd_iter));
+ ADD_SEND_WITH_BLOCK(ret, line, idEach, INT2FIX(0), iseq->compile_data->current_block);
+ }
+ 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);
- 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);
- }
+ iseq->compile_data->current_block = prevblock;
- ISEQ_COMPILE_DATA(iseq)->current_block = prevblock;
+ ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, 0, retry_end_l);
- ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, child_iseq, retry_end_l);
- return COMPILE_OK;
-}
+ break;
+ }
+ case NODE_BREAK:{
+ unsigned long level = 0;
-static int
-compile_for_masgn(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- /* massign to var in "for"
- * (args.length == 1 && Array.try_convert(args[0])) || args
- */
- const int line = nd_line(node);
- 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_INSN(ret, line, swap);
- ADD_CALL(ret, line, rb_intern("try_convert"), INT2FIX(1));
- ADD_INSN(ret, line, dup);
- 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;
-}
+ 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);
-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 throw_flag = 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);
+ if (!poped) {
+ ADD_INSN(ret, line, putnil);
+ }
}
- }
- 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(throw_flag | TAG_BREAK));
- if (popped) {
- ADD_INSN(ret, line, pop);
+ 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);
+ }
}
- }
- 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;
+ 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;
+ }
- while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
- ip = 0;
- break;
- }
+ level++;
+ if (ip->compile_data->redo_label != 0) {
+ level = 0x8000;
+ if (ip->compile_data->loopval_popped == 0) {
+ /* need value */
+ level |= 0x4000;
+ }
+ 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;
+ }
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- throw_flag = VM_THROW_NO_ESCAPE_FLAG;
- goto break_by_insn;
- }
- else if (ip->body->type == ISEQ_TYPE_BLOCK) {
- goto break_by_insn;
- }
- else if (ip->body->type == ISEQ_TYPE_EVAL) {
- goto break_in_eval;
+ ip = ip->parent_iseq;
}
-
- ip = ip->body->parent_iseq;
+ COMPILE_ERROR((ERROR_ARGS "Invalid break"));
}
- COMPILE_ERROR(ERROR_ARGS "Invalid break");
- return COMPILE_NG;
- }
- return COMPILE_OK;
-}
+ break;
+ }
+ case NODE_NEXT:{
+ unsigned long level = 0;
-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 throw_flag = 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);
+ 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_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;
+ 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);
- if (!popped) {
- ADD_INSN(ret, line, putnil);
+ 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->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;
+ }
- while (ip) {
- if (!ISEQ_COMPILE_DATA(ip)) {
- ip = 0;
- 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;
+ }
- throw_flag = VM_THROW_NO_ESCAPE_FLAG;
- if (ISEQ_COMPILE_DATA(ip)->redo_label != 0) {
- /* while loop */
- break;
+ 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(throw_flag | 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;
+ else if (iseq->type == ISEQ_TYPE_EVAL) {
+ redo_in_eval:
+ COMPILE_ERROR((ERROR_ARGS "Can't escape from eval with redo"));
}
- }
- return COMPILE_OK;
-}
+ else if (iseq->compile_data->start_label) {
+ LABEL *splabel = NEW_LABEL(0);
-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->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);
-
- 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;
+ 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(VM_THROW_NO_ESCAPE_FLAG | 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));
+ 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);
- if (popped) {
+ lstart->rescued = LABEL_RESCUE_BEG;
+ lend->rescued = LABEL_RESCUE_END;
+ ADD_LABEL(ret, lstart);
+ COMPILE(ret, "rescue head", node->nd_head);
+ ADD_LABEL(ret, lend);
+ 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;
-}
+ ADD_INSN(ret, line, nop);
+ ADD_LABEL(ret, lcont);
-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);
- }
-
- /* 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_LIST:
- 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 (retval) {
- rb_warn("argument of top-level return is ignored");
- }
- 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;
+ 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;
- if (type == ISEQ_TYPE_METHOD) {
- splabel = NEW_LABEL(0);
- ADD_LABEL(ret, splabel);
- ADD_ADJUST(ret, line, 0);
- }
+ INIT_ANCHOR(ensr);
+ COMPILE_POPED(ensr, "ensure ensr", node->nd_ensr);
- CHECK(COMPILE(ret, "return nd_stts (return val)", retval));
+ er.begin = lstart;
+ er.end = lend;
+ er.next = 0;
+ push_ensure_entry(iseq, &enl, &er, 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);
-
- 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
-compile_evstr(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int popped)
-{
- CHECK(COMPILE_(ret, "nd_body", node, popped));
-
- if (!popped && !all_string_result_p(node)) {
- const int line = nd_line(node);
- const unsigned int flag = VM_CALL_FCALL;
- LABEL *isstr = NEW_LABEL(line);
- ADD_INSN(ret, line, dup);
- ADD_INSN1(ret, line, checktype, INT2FIX(T_STRING));
- ADD_INSNL(ret, line, branchif, isstr);
- ADD_INSN(ret, line, dup);
- ADD_SEND_R(ret, line, idTo_s, INT2FIX(0), NULL, INT2FIX(flag), NULL);
- ADD_INSN(ret, line, tostring);
- ADD_LABEL(ret, isstr);
- }
- return COMPILE_OK;
-}
-
-static LABEL *
-qcall_branch_start(rb_iseq_t *iseq, LINK_ANCHOR *const recv, VALUE *branches, const NODE *node, int line)
-{
- LABEL *else_label = NEW_LABEL(line);
- const int first_lineno = nd_first_lineno(node), first_column = nd_first_column(node);
- const int last_lineno = nd_last_lineno(node), last_column = nd_last_column(node);
- VALUE br = 0;
-
- DECL_BRANCH_BASE(br, first_lineno, first_column, last_lineno, last_column, "&.");
- *branches = br;
- ADD_INSN(recv, line, dup);
- ADD_INSNL(recv, line, branchnil, else_label);
- ADD_TRACE_BRANCH_COVERAGE(recv, first_lineno, first_column, last_lineno, last_column, "then", br);
- return else_label;
-}
-
-static void
-qcall_branch_end(rb_iseq_t *iseq, LINK_ANCHOR *const ret, LABEL *else_label, VALUE branches, const NODE *node, int line)
-{
- LABEL *end_label;
- if (!else_label) return;
- end_label = NEW_LABEL(line);
- 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);
-}
-
-static int
-compile_call_precheck_freeze(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int line, int popped)
-{
- /* 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 = rb_fstring(node->nd_recv->nd_lit);
- if (node->nd_mid == idUMinus) {
- ADD_INSN2(ret, line, opt_str_uminus, str,
- new_callinfo(iseq, idUMinus, 0, 0, NULL, FALSE));
- }
- else {
- ADD_INSN2(ret, line, opt_str_freeze, str,
- new_callinfo(iseq, idFreeze, 0, 0, NULL, FALSE));
- }
- RB_OBJ_WRITTEN(iseq, Qundef, str);
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
- return TRUE;
- }
- /* optimization shortcut
- * obj["literal"] -> opt_aref_with(obj, "literal")
- */
- if (node->nd_mid == idAREF && !private_recv_p(node) && node->nd_args &&
- nd_type(node->nd_args) == NODE_LIST && 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 = rb_fstring(node->nd_args->nd_head->nd_lit);
- CHECK(COMPILE(ret, "recv", node->nd_recv));
- ADD_INSN2(ret, line, opt_aref_with, str,
- new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE));
- RB_OBJ_WRITTEN(iseq, Qundef, str);
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
- return TRUE;
- }
- return FALSE;
-}
-
-static int
-iseq_has_builtin_function_table(const rb_iseq_t *iseq)
-{
- return ISEQ_COMPILE_DATA(iseq)->builtin_function_table != NULL;
-}
-
-static const struct rb_builtin_function *
-iseq_builtin_function_lookup(const rb_iseq_t *iseq, const char *name)
-{
- int i;
- const struct rb_builtin_function *table = ISEQ_COMPILE_DATA(iseq)->builtin_function_table;
- for (i=0; table[i].index != -1; i++) {
- if (strcmp(table[i].name, name) == 0) {
- return &table[i];
- }
- }
- return NULL;
-}
-
-static const char *
-iseq_builtin_function_name(ID mid)
-{
- const char *name = rb_id2name(mid);
- static const char prefix[] = "__builtin_";
- const size_t prefix_len = sizeof(prefix) - 1;
-
- if (UNLIKELY(strncmp(prefix, name, prefix_len) == 0)) {
- return &name[prefix_len];
- }
- else {
- return NULL;
- }
-}
-
-static int
-delegate_call_p(const rb_iseq_t *iseq, unsigned int argc, const LINK_ANCHOR *args, unsigned int *pstart_index)
-{
-
- if (argc == 0) {
- *pstart_index = 0;
- return TRUE;
- }
- else if (argc <= iseq->body->local_table_size) {
- unsigned int start=0;
-
- // local_table: [p1, p2, p3, l1, l2, l3]
- // arguments: [p3, l1, l2] -> 2
- for (start = 0;
- argc + start <= iseq->body->local_table_size;
- start++) {
- const LINK_ELEMENT *elem = FIRST_ELEMENT(args);
-
- for (unsigned int i=start; i-start<argc; i++) {
- if (elem->type == ISEQ_ELEMENT_INSN &&
- INSN_OF(elem) == BIN(getlocal)) {
- int local_index = FIX2INT(OPERAND_AT(elem, 0));
- int local_level = FIX2INT(OPERAND_AT(elem, 1));
-
- if (local_level == 0) {
- unsigned int index = iseq->body->local_table_size - (local_index - VM_ENV_DATA_SIZE + 1);
- if (0) { // for debug
- fprintf(stderr, "lvar:%s (%d), id:%s (%d) local_index:%d, local_size:%d\n",
- rb_id2name(iseq->body->local_table[i]), i,
- rb_id2name(iseq->body->local_table[index]), index,
- local_index, (int)iseq->body->local_table_size);
- }
- if (i == index) {
- elem = elem->next;
- continue; /* for */
- }
- else {
- goto next;
- }
- }
- else {
- goto fail; // level != 0 is unsupported
- }
- }
- else {
- goto fail; // insn is not a getlocal
- }
- }
- goto success;
- next:;
- }
- fail:
- return FALSE;
- success:
- *pstart_index = start;
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-static int
-compile_call(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node, int type, int line, int popped)
-{
- /* call: obj.method(...)
- * fcall: func(...)
- * vcall: func
- */
- DECL_ANCHOR(recv);
- DECL_ANCHOR(args);
- 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;
- LABEL *else_label = NULL;
- VALUE branches = Qfalse;
-
- ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
-
- INIT_ANCHOR(recv);
- INIT_ANCHOR(args);
-#if OPT_SUPPORT_JOKE
- if (nd_type(node) == NODE_VCALL) {
- ID id_bitblt;
- ID id_answer;
-
- CONST_ID(id_bitblt, "bitblt");
- CONST_ID(id_answer, "the_answer_to_life_the_universe_and_everything");
-
- if (mid == id_bitblt) {
- ADD_INSN(ret, line, bitblt);
- return COMPILE_OK;
- }
- else if (mid == id_answer) {
- ADD_INSN(ret, line, answer);
- return COMPILE_OK;
- }
- }
- /* only joke */
- {
- ID goto_id;
- ID label_id;
-
- CONST_ID(goto_id, "__goto__");
- CONST_ID(label_id, "__label__");
-
- if (nd_type(node) == NODE_FCALL &&
- (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;
-
- if (!labels_table) {
- labels_table = st_init_numtable();
- ISEQ_COMPILE_DATA(iseq)->labels_table = labels_table;
- }
- if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
- SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
-
- label_name = 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;
- st_insert(labels_table, (st_data_t)label_name, (st_data_t)label);
- }
- else {
- label = (LABEL *)data;
- }
- }
- else {
- COMPILE_ERROR(ERROR_ARGS "invalid goto/label format");
- return COMPILE_NG;
- }
-
- if (mid == goto_id) {
- ADD_INSNL(ret, line, jump, label);
- }
- else {
- ADD_LABEL(ret, label);
- }
- return COMPILE_OK;
- }
- }
-#endif
- const char *builtin_func;
- NODE *args_node = node->nd_args;
-
- if (UNLIKELY(iseq_has_builtin_function_table(iseq)) &&
- (builtin_func = iseq_builtin_function_name(mid)) != NULL) {
-
- if (parent_block != NULL) {
- COMPILE_ERROR(iseq, line, "should not call builtins here.");
- return COMPILE_NG;
- }
- else {
- char inline_func[0x20];
- bool cconst = false;
- retry:;
- const struct rb_builtin_function *bf = iseq_builtin_function_lookup(iseq, builtin_func);
-
- if (bf == NULL) {
- if (strcmp("cstmt!", builtin_func) == 0 ||
- strcmp("cexpr!", builtin_func) == 0) {
- inlinec:;
- int inline_index = GET_VM()->builtin_inline_index++;
- snprintf(inline_func, 0x20, "_bi%d", inline_index);
- builtin_func = inline_func;
- args_node = NULL;
- goto retry;
- }
- else if (strcmp("cconst!", builtin_func) == 0) {
- cconst = true;
- goto inlinec;
- }
- else if (strcmp("cinit!", builtin_func) == 0) {
- // ignore
- GET_VM()->builtin_inline_index++;
- return COMPILE_OK;
- }
-
- if (1) {
- rb_bug("can't find builtin function:%s", builtin_func);
- }
- else {
- COMPILE_ERROR(ERROR_ARGS "can't find builtin function:%s", builtin_func);
- }
- return COMPILE_NG;
- }
-
- if (cconst) {
- typedef VALUE(*builtin_func0)(void *, VALUE);
- VALUE const_val = (*(builtin_func0)bf->func_ptr)(NULL, Qnil);
- ADD_INSN1(ret, line, putobject, const_val);
- return COMPILE_OK;
- }
-
- // fprintf(stderr, "func_name:%s -> %p\n", builtin_func, bf->func_ptr);
-
- argc = setup_args(iseq, args, args_node, &flag, &keywords);
-
- if (FIX2INT(argc) != bf->argc) {
- COMPILE_ERROR(ERROR_ARGS "argc is not match for builtin function:%s (expect %d but %d)",
- builtin_func, bf->argc, FIX2INT(argc));
- return COMPILE_NG;
- }
-
- unsigned int start_index;
- if (delegate_call_p(iseq, FIX2INT(argc), args, &start_index)) {
- ADD_INSN2(ret, line, opt_invokebuiltin_delegate, bf, INT2FIX(start_index));
- }
- else {
- ADD_SEQ(ret, args);
- ADD_INSN1(ret,line, invokebuiltin, bf);
- }
-
- if (popped) ADD_INSN(ret, line, pop);
- return COMPILE_OK;
- }
- }
-
-
- /* receiver */
- if (type == NODE_CALL || type == NODE_OPCALL || type == NODE_QCALL) {
- int idx, level;
-
- if (mid == idCall &&
- nd_type(node->nd_recv) == NODE_LVAR &&
- iseq_block_param_id_p(iseq, node->nd_recv->nd_vid, &idx, &level)) {
- ADD_INSN2(recv, nd_line(node->nd_recv), getblockparamproxy, INT2FIX(idx + VM_ENV_DATA_SIZE - 1), INT2FIX(level));
- }
- else if (private_recv_p(node)) {
- ADD_INSN(recv, nd_line(node), putself);
- flag |= VM_CALL_FCALL;
- }
- else {
- CHECK(COMPILE(recv, "recv", node->nd_recv));
- }
-
- if (type == NODE_QCALL) {
- else_label = qcall_branch_start(iseq, recv, &branches, node, line);
- }
- }
- else if (type == NODE_FCALL || type == NODE_VCALL) {
- ADD_CALL_RECEIVER(recv, line);
- }
+ ADD_LABEL(ret, lcont);
- /* args */
- if (type != NODE_VCALL) {
- argc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
- CHECK(!NIL_P(argc));
- }
- else {
- argc = INT2FIX(0);
- }
-
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, args);
-
- debugp_param("call args argc", argc);
- debugp_param("call method", ID2SYM(mid));
-
- switch ((int)type) {
- case NODE_VCALL:
- flag |= VM_CALL_VCALL;
- /* VCALL is funcall, so fall through */
- case NODE_FCALL:
- flag |= VM_CALL_FCALL;
- }
-
- ADD_SEND_R(ret, line, mid, argc, parent_block, INT2FIX(flag), keywords);
-
- qcall_branch_end(iseq, ret, else_label, branches, node, line);
- if (popped) {
- ADD_INSN(ret, line, pop);
- }
- return COMPILE_OK;
-}
-
-
-static int iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int popped);
-/**
- compile each node
-
- 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
-check_yield_place(const rb_iseq_t *iseq, int line)
-{
- VALUE file;
- switch (iseq->body->local_iseq->body->type) {
- case ISEQ_TYPE_TOP:
- case ISEQ_TYPE_MAIN:
- return FALSE;
- case ISEQ_TYPE_CLASS:
- file = rb_iseq_path(iseq);
- if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) {
- rb_compile_warn(RSTRING_PTR(file), line,
- "`yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575]");
- }
- return TRUE;
- default:
- return TRUE;
- }
-}
-
-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);
- struct rb_iseq_constant_body *const body = iseq->body;
-
- if (ISEQ_COMPILE_DATA(iseq)->last_line == line) {
- /* ignore */
- }
- else {
- if (node->flags & NODE_FL_NEWLINE) {
- int event = RUBY_EVENT_LINE;
- ISEQ_COMPILE_DATA(iseq)->last_line = line;
- if (ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq)) {
- event |= RUBY_EVENT_COVERAGE_LINE;
- }
- ADD_TRACE(ret, event);
+ 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));
- }
+ iseq->compile_data->ensure_node_stack = enl.prev;
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_CASE3:
- CHECK(compile_case3(iseq, ret, node, popped));
- break;
- case NODE_WHILE:
- case NODE_UNTIL:
- CHECK(compile_loop(iseq, ret, node, popped, type));
- break;
- case NODE_FOR:
- case NODE_ITER:
- CHECK(compile_iter(iseq, ret, node, popped));
- break;
- case NODE_FOR_MASGN:
- CHECK(compile_for_masgn(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));
- 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) {
@@ -7218,94 +4052,93 @@ 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 = 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));
+ debugs("lvar: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
+ 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);
+ debugi("dassn id", rb_id2str(node->nd_vid) ? 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 (%"PRIsVALUE")", rb_id2str(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) {
- ADD_INSN(ret, line, dup);
- }
+ if (!poped) {
+ ADD_INSN(ret, line, dup);
+ }
if (node->nd_vid) {
ADD_INSN1(ret, line, putspecialobject,
INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
- ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_vid));
}
else {
compile_cpath(ret, iseq, node->nd_else);
- ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_else->nd_mid));
+ ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_else->nd_mid));
}
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,
@@ -7313,9 +4146,10 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
break;
}
case NODE_OP_ASGN1: {
+ DECL_ANCHOR(args);
VALUE argc;
unsigned int flag = 0;
- int asgnflag = 0;
+ unsigned int asgnflag = 0;
ID id = node->nd_mid;
int boff = 0;
@@ -7342,28 +4176,28 @@ 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);
- CHECK(asgnflag != -1);
switch (nd_type(node->nd_args->nd_head)) {
- case NODE_ZLIST:
+ case NODE_ZARRAY:
argc = INT2FIX(0);
break;
case NODE_BLOCK_PASS:
boff = 1;
- /* fall through */
default:
- argc = setup_args(iseq, ret, node->nd_args->nd_head, &flag, NULL);
- CHECK(!NIL_P(argc));
+ INIT_ANCHOR(args);
+ argc = setup_args(iseq, args, node->nd_args->nd_head, &flag, NULL);
+ ADD_SEQ(ret, args);
}
ADD_INSN1(ret, line, dupn, FIXNUM_INC(argc, 1 + boff));
- flag |= asgnflag;
+ flag |= asgnflag;
ADD_SEND_WITH_FLAG(ret, line, idAREF, argc, INT2FIX(flag));
- if (id == idOROP || id == idANDOP) {
- /* a[x] ||= y or a[x] &&= y
+ if (id == 0 || id == 1) {
+ /* 0: or, 1: and
+ a[x] ||= y
unless/if a[x]
a[x]= y
@@ -7375,16 +4209,18 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
LABEL *lfin = NEW_LABEL(line);
ADD_INSN(ret, line, dup);
- if (id == idOROP) {
+ if (id == 0) {
+ /* or */
ADD_INSNL(ret, line, branchif, label);
}
- else { /* idANDOP */
+ else {
+ /* and */
ADD_INSNL(ret, line, branchunless, label);
}
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) {
@@ -7410,16 +4246,16 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
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) {
@@ -7449,11 +4285,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);
- int asgnflag;
+ VALUE asgnflag;
LABEL *lfin = NEW_LABEL(line);
LABEL *lcfin = NEW_LABEL(line);
- LABEL *lskip = 0;
/*
class C; attr_accessor :c; end
r = C.new
@@ -7497,28 +4331,22 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
*/
asgnflag = COMPILE_RECV(ret, "NODE_OP_ASGN2#recv", node);
- CHECK(asgnflag != -1);
- 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_WITH_FLAG(ret, line, vid, INT2FIX(0), INT2FIX(asgnflag));
+ ADD_SEND_WITH_FLAG(ret, line, node->nd_next->nd_vid, INT2FIX(0), INT2FIX(asgnflag));
- if (atype == idOROP || atype == idANDOP) {
+ if (atype == 0 || atype == 1) { /* 0: OR or 1: AND */
ADD_INSN(ret, line, dup);
- if (atype == idOROP) {
+ if (atype == 0) {
ADD_INSNL(ret, line, branchif, lcfin);
}
- else { /* idANDOP */
+ else {
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_WITH_FLAG(ret, line, node->nd_next->nd_aid, INT2FIX(1), INT2FIX(asgnflag));
ADD_INSNL(ret, line, jump, lfin);
ADD_LABEL(ret, lcfin);
@@ -7526,29 +4354,21 @@ 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_WITH_FLAG(ret, line, node->nd_next->nd_aid, INT2FIX(1), INT2FIX(asgnflag));
ADD_INSN(ret, line, pop);
- if (lskip && !popped) {
- ADD_LABEL(ret, lskip);
- }
}
break;
}
@@ -7562,39 +4382,40 @@ 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 */
- if (node->nd_aid == idOROP) {
+ if (node->nd_aid == 0) {
lassign = NEW_LABEL(line);
ADD_INSN(ret, line, dup); /* cref cref */
- ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_CONST_FROM),
+ ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_CONST),
ID2SYM(mid), Qfalse); /* cref bool */
ADD_INSNL(ret, line, branchunless, lassign); /* cref */
}
ADD_INSN(ret, line, dup); /* cref cref */
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSN1(ret, line, getconstant, ID2SYM(mid)); /* cref obj */
+ ADD_INSN1(ret, line, getconstant, ID2SYM(mid)); /* cref obj */
- if (node->nd_aid == idOROP || node->nd_aid == idANDOP) {
+ if (node->nd_aid == 0 || node->nd_aid == 1) {
lfin = NEW_LABEL(line);
- if (!popped) ADD_INSN(ret, line, dup); /* cref [obj] obj */
- if (node->nd_aid == idOROP)
+ if (!poped) ADD_INSN(ret, line, dup); /* cref [obj] obj */
+ if (node->nd_aid == 0)
ADD_INSNL(ret, line, branchif, lfin);
- else /* idANDOP */
+ 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 */
@@ -7602,16 +4423,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 */
}
@@ -7639,7 +4460,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) {
@@ -7651,88 +4472,223 @@ 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: /* obj.foo */
- case NODE_OPCALL: /* foo[] */
- if (compile_call_precheck_freeze(iseq, ret, node, line, popped) == TRUE) {
- break;
- }
- case NODE_QCALL: /* obj&.foo */
- case NODE_FCALL: /* foo() */
- case NODE_VCALL: /* foo (variable or call) */
- if (compile_call(iseq, ret, node, type, line, popped) == COMPILE_NG) {
- goto ng;
- }
- break;
+ case NODE_CALL:
+ /* optimization shortcut
+ * "literal".freeze -> opt_str_freeze("literal")
+ */
+ if (node->nd_recv && nd_type(node->nd_recv) == NODE_STR &&
+ node->nd_mid == idFreeze && node->nd_args == NULL &&
+ iseq->compile_data->current_block == Qfalse &&
+ iseq->compile_data->option->specialized_instruction) {
+ VALUE str = rb_fstring(node->nd_recv->nd_lit);
+ iseq_add_mark_object(iseq, str);
+ ADD_INSN1(ret, line, opt_str_freeze, str);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ /* optimization shortcut
+ * obj["literal"] -> opt_aref_with(obj, "literal")
+ */
+ if (node->nd_mid == idAREF && !private_recv_p(node) && node->nd_args &&
+ nd_type(node->nd_args) == NODE_ARRAY && node->nd_args->nd_alen == 1 &&
+ nd_type(node->nd_args->nd_head) == NODE_STR &&
+ iseq->compile_data->current_block == Qfalse &&
+ iseq->compile_data->option->specialized_instruction) {
+ VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
+ node->nd_args->nd_head->nd_lit = str;
+ COMPILE(ret, "recv", node->nd_recv);
+ ADD_INSN2(ret, line, opt_aref_with,
+ new_callinfo(iseq, idAREF, 1, 0, 0, NULL), str);
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
+ case NODE_FCALL:
+ case NODE_VCALL:{ /* VCALL: variable or call */
+ /*
+ call: obj.method(...)
+ fcall: func(...)
+ vcall: func
+ */
+ DECL_ANCHOR(recv);
+ DECL_ANCHOR(args);
+ ID mid = node->nd_mid;
+ VALUE argc;
+ unsigned int flag = 0;
+ rb_call_info_kw_arg_t *keywords = NULL;
+ VALUE parent_block = iseq->compile_data->current_block;
+ iseq->compile_data->current_block = Qfalse;
+
+ INIT_ANCHOR(recv);
+ INIT_ANCHOR(args);
+#if SUPPORT_JOKE
+ if (nd_type(node) == NODE_VCALL) {
+ ID id_bitblt;
+ ID id_answer;
+
+ CONST_ID(id_bitblt, "bitblt");
+ CONST_ID(id_answer, "the_answer_to_life_the_universe_and_everything");
+
+ if (mid == id_bitblt) {
+ ADD_INSN(ret, line, bitblt);
+ break;
+ }
+ else if (mid == id_answer) {
+ ADD_INSN(ret, line, answer);
+ break;
+ }
+ }
+ /* only joke */
+ {
+ ID goto_id;
+ ID label_id;
+
+ CONST_ID(goto_id, "__goto__");
+ CONST_ID(label_id, "__label__");
+
+ if (nd_type(node) == NODE_FCALL &&
+ (mid == goto_id || mid == label_id)) {
+ LABEL *label;
+ st_data_t data;
+ st_table *labels_table = iseq->compile_data->labels_table;
+ ID label_name;
+
+ if (!labels_table) {
+ labels_table = st_init_numtable();
+ 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 = 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;
+ st_insert(labels_table, (st_data_t)label_name, (st_data_t)label);
+ }
+ else {
+ label = (LABEL *)data;
+ }
+ }
+ else {
+ COMPILE_ERROR((ERROR_ARGS "invalid goto/label format"));
+ }
+
+
+ if (mid == goto_id) {
+ ADD_INSNL(ret, line, jump, label);
+ }
+ else {
+ ADD_LABEL(ret, label);
+ }
+ break;
+ }
+ }
+#endif
+ /* receiver */
+ 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 (nd_type(node) != NODE_VCALL) {
+ argc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
+ }
+ else {
+ argc = INT2FIX(0);
+ }
+
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, args);
+
+ debugp_param("call args argc", argc);
+ debugp_param("call method", ID2SYM(mid));
+
+ switch (nd_type(node)) {
+ case NODE_VCALL:
+ flag |= VM_CALL_VCALL;
+ /* VCALL is funcall, so fall through */
+ case NODE_FCALL:
+ flag |= VM_CALL_FCALL;
+ }
+
+ ADD_SEND_R(ret, line, mid, argc, parent_block, INT2FIX(flag), keywords);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ break;
+ }
case NODE_SUPER:
case NODE_ZSUPER:{
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;
+ rb_call_info_kw_arg_t *keywords = NULL;
+ VALUE parent_block = iseq->compile_data->current_block;
INIT_ANCHOR(args);
- ISEQ_COMPILE_DATA(iseq)->current_block = NULL;
- if (type == NODE_SUPER) {
+ iseq->compile_data->current_block = Qfalse;
+ if (nd_type(node) == NODE_SUPER) {
VALUE vargc = setup_args(iseq, args, node->nd_args, &flag, &keywords);
- CHECK(!NIL_P(vargc));
argc = FIX2INT(vargc);
}
else {
/* NODE_ZSUPER */
int i;
- const rb_iseq_t *liseq = body->local_iseq;
- const struct rb_iseq_constant_body *const local_body = liseq->body;
- const struct rb_iseq_param_keyword *const local_kwd = local_body->param.keyword;
+ rb_iseq_t *liseq = iseq->local_iseq;
int lvar_level = get_lvar_level(iseq);
- argc = local_body->param.lead_num;
+ argc = liseq->param.lead_num;
/* normal arguments */
- for (i = 0; i < local_body->param.lead_num; i++) {
- int idx = local_body->local_table_size - i;
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ for (i = 0; i < liseq->param.lead_num; i++) {
+ int idx = liseq->local_size - i;
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
- if (local_body->param.flags.has_opt) {
+ if (liseq->param.flags.has_opt) {
/* optional arguments */
int j;
- for (j = 0; j < local_body->param.opt_num; j++) {
- int idx = local_body->local_table_size - (i + j);
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ for (j = 0; j < liseq->param.opt_num; j++) {
+ int idx = liseq->local_size - (i + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
i += j;
argc = i;
}
- if (local_body->param.flags.has_rest) {
+ if (liseq->param.flags.has_rest) {
/* rest argument */
- int idx = local_body->local_table_size - local_body->param.rest_start;
-
- ADD_GETLOCAL(args, line, idx, lvar_level);
- ADD_INSN1(args, line, splatarray, Qfalse);
-
- argc = local_body->param.rest_start + 1;
+ int idx = liseq->local_size - liseq->param.rest_start;
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
+ argc = liseq->param.rest_start + 1;
flag |= VM_CALL_ARGS_SPLAT;
}
- if (local_body->param.flags.has_post) {
+ if (liseq->param.flags.has_post) {
/* post arguments */
- int post_len = local_body->param.post_num;
- int post_start = local_body->param.post_start;
+ int post_len = liseq->param.post_num;
+ int post_start = liseq->param.post_start;
- if (local_body->param.flags.has_rest) {
+ if (liseq->param.flags.has_rest) {
int j;
for (j=0; j<post_len; j++) {
- int idx = local_body->local_table_size - (post_start + j);
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ 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);
@@ -7741,199 +4697,242 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
else {
int j;
for (j=0; j<post_len; j++) {
- int idx = local_body->local_table_size - (post_start + j);
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ int idx = liseq->local_size - (post_start + j);
+ ADD_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
argc = post_len + post_start;
}
}
- if (local_body->param.flags.has_kw) { /* TODO: support keywords */
- int local_size = local_body->local_table_size;
+ if (liseq->param.flags.has_kw) { /* TODO: support keywords */
+ int local_size = liseq->local_size;
argc++;
ADD_INSN1(args, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
- if (local_body->param.flags.has_kwrest) {
- int idx = local_body->local_table_size - local_kwd->rest_start;
- ADD_GETLOCAL(args, line, idx, lvar_level);
+ if (liseq->param.flags.has_kwrest) {
+ ADD_INSN2(args, line, getlocal, INT2FIX(liseq->local_size - liseq->param.keyword->rest_start), INT2FIX(lvar_level));
ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
}
else {
ADD_INSN1(args, line, newhash, INT2FIX(0));
}
- for (i = 0; i < local_kwd->num; ++i) {
- ID id = local_kwd->table[i];
+ for (i = 0; i < liseq->param.keyword->num; ++i) {
+ ID id = liseq->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_INSN2(args, line, getlocal, INT2FIX(idx), INT2FIX(lvar_level));
}
ADD_SEND(args, line, id_core_hash_merge_ptr, INT2FIX(i * 2 + 1));
- if (local_body->param.flags.has_rest) {
+ if (liseq->param.flags.has_rest) {
ADD_INSN1(args, line, newarray, INT2FIX(1));
ADD_INSN (args, line, concatarray);
--argc;
}
- flag |= VM_CALL_KW_SPLAT;
}
- else if (local_body->param.flags.has_kwrest) {
- int idx = local_body->local_table_size - local_kwd->rest_start;
- ADD_GETLOCAL(args, line, idx, lvar_level);
-
+ else if (liseq->param.flags.has_kwrest) {
+ ADD_INSN2(args, line, getlocal, INT2FIX(liseq->local_size - liseq->param.keyword->rest_start), INT2FIX(lvar_level));
ADD_SEND (args, line, rb_intern("dup"), INT2FIX(0));
- if (local_body->param.flags.has_rest) {
+ if (liseq->param.flags.has_rest) {
ADD_INSN1(args, line, newarray, INT2FIX(1));
ADD_INSN (args, line, concatarray);
}
else {
argc++;
}
- flag |= VM_CALL_KW_SPLAT;
}
}
- ADD_INSN(ret, line, putself);
+ /* dummy receiver */
+ ADD_INSN1(ret, line, putobject, nd_type(node) == NODE_ZSUPER ? Qfalse : Qtrue);
ADD_SEQ(ret, args);
- ADD_INSN2(ret, line, invokesuper,
- new_callinfo(iseq, 0, argc, flag | VM_CALL_SUPER | (type == NODE_ZSUPER ? VM_CALL_ZSUPER : 0) | VM_CALL_FCALL, keywords, parent_block != NULL),
- parent_block);
+ ADD_INSN1(ret, line, invokesuper, new_callinfo(iseq, 0, argc, parent_block,
+ flag | VM_CALL_SUPER | VM_CALL_FCALL, keywords));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
- case NODE_LIST:{
- CHECK(compile_array(iseq, ret, node, popped) >= 0);
+ case NODE_ARRAY:{
+ compile_array_(iseq, ret, node, COMPILE_ARRAY_TYPE_ARRAY, NULL, poped);
break;
}
- case NODE_ZLIST:{
- if (!popped) {
+ case NODE_ZARRAY:{
+ 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:
- CHECK(compile_hash(iseq, ret, node, popped) >= 0);
- break;
- case NODE_RETURN:
- CHECK(compile_return(iseq, ret, node, popped));
+ case NODE_HASH:{
+ DECL_ANCHOR(list);
+ int type = node->nd_head ? nd_type(node->nd_head) : NODE_ZARRAY;
+
+ INIT_ANCHOR(list);
+ switch (type) {
+ case NODE_ARRAY:
+ compile_array(iseq, list, node->nd_head, COMPILE_ARRAY_TYPE_HASH);
+ ADD_SEQ(ret, list);
+ break;
+
+ case NODE_ZARRAY:
+ ADD_INSN1(ret, line, newhash, INT2FIX(0));
+ break;
+
+ default:
+ 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:{
+ 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;
+ rb_call_info_kw_arg_t *keywords = NULL;
INIT_ANCHOR(args);
-
- if (check_yield_place(iseq, line) == FALSE) {
- 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));
}
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, keywords));
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
case NODE_LVAR:{
- if (!popped) {
+ if (!poped) {
ID id = node->nd_vid;
- int idx = 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));
+ debugs("id: %"PRIsVALUE" idx: %d\n", rb_id2str(id), idx);
+ 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 (%"PRIsVALUE")", rb_id2str(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 = body->is_size++;
+ int ic_index = iseq->is_size++;
- ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index));
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
- ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index));
+ ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
+ ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
+ ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
else {
ADD_INSN(ret, line, putnil);
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid));
+ 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 (!poped) {
if (!node->nd_nth) {
ADD_INSN(ret, line, putnil);
break;
@@ -7944,7 +4943,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
break;
}
case NODE_BACK_REF:{
- if (!popped) {
+ if (!poped) {
ADD_INSN2(ret, line, getspecial, INT2FIX(1) /* '~' */,
INT2FIX(0x01 | (node->nd_nth << 1)));
}
@@ -7965,88 +4964,71 @@ 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;
}
- ADD_SEQ(ret, recv);
- ADD_SEQ(ret, val);
- ADD_SEND(ret, line, idEqTilde, INT2FIX(1));
-
- if (node->nd_args) {
- compile_named_capture_assign(iseq, ret, node->nd_args);
+ if (iseq->compile_data->option->specialized_instruction) {
+ /* TODO: detect by node */
+ if (recv->last == recv->anchor.next &&
+ INSN_OF(recv->last) == BIN(putobject) &&
+ nd_type(node) == NODE_MATCH2) {
+ ADD_SEQ(ret, val);
+ ADD_INSN1(ret, line, opt_regexpmatch1,
+ OPERAND_AT(recv->last, 0));
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_INSN1(ret, line, opt_regexpmatch2, new_callinfo(iseq, idEqTilde, 1, 0, 0, NULL));
+ }
+ }
+ else {
+ ADD_SEQ(ret, recv);
+ ADD_SEQ(ret, val);
+ ADD_SEND(ret, line, idEqTilde, INT2FIX(1));
}
- 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 = rb_fstring(lit);
- ADD_INSN1(ret, line, putstring, lit);
- RB_OBJ_WRITTEN(iseq, Qundef, 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);
- RB_OBJ_WRITTEN(iseq, Qundef, 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));
- }
- ADD_INSN1(ret, line, freezestring, debug_info);
- if (!NIL_P(debug_info)) {
- RB_OBJ_WRITTEN(iseq, Qundef, rb_obj_freeze(debug_info));
- }
- }
- }
break;
}
case NODE_XSTR:{
+ node->nd_lit = rb_fstring(node->nd_lit);
ADD_CALL_RECEIVER(ret, line);
- VALUE str = rb_fstring(node->nd_lit);
- ADD_INSN1(ret, line, putobject, str);
- RB_OBJ_WRITTEN(iseq, Qundef, str);
+ 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;
@@ -8056,126 +5038,140 @@ 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_evstr(iseq, ret, node->nd_body, popped));
+ case NODE_EVSTR:{
+ COMPILE(ret, "nd_body", node->nd_body);
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
+ else {
+ ADD_INSN(ret, line, tostring);
+ }
break;
+ }
case NODE_DREGX:{
compile_dregx(iseq, ret, node);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
}
- case NODE_ONCE:{
- int ic_index = body->is_size++;
- const rb_iseq_t *block_iseq;
- block_iseq = NEW_CHILD_ISEQ(node->nd_body, make_name_for_block(iseq), ISEQ_TYPE_PLAIN, 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));
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)block_iseq);
- 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:{
- ID mid = node->nd_mid;
- const rb_iseq_t *method_iseq = NEW_ISEQ(node->nd_defn,
- rb_id2str(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));
- ADD_INSN2(ret, line, definemethod, ID2SYM(mid), method_iseq);
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)method_iseq);
+ debugp_param("defn/iseq", iseqval);
- if (!popped) {
- ADD_INSN1(ret, line, putobject, ID2SYM(mid));
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_CBASE));
+ ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, line, putiseq, iseqval);
+ ADD_SEND (ret, line, id_core_define_method, INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
}
+ debugp_param("defn", iseqval);
break;
}
case NODE_DEFS:{
- ID mid = node->nd_mid;
- const rb_iseq_t * singleton_method_iseq = NEW_ISEQ(node->nd_defn,
- rb_id2str(mid),
- ISEQ_TYPE_METHOD, line);
-
- debugp_param("defs/iseq", rb_iseqw_new(singleton_method_iseq));
- CHECK(COMPILE(ret, "defs: recv", node->nd_recv));
- ADD_INSN2(ret, line, definesmethod, ID2SYM(mid), singleton_method_iseq);
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)singleton_method_iseq);
-
- if (!popped) {
- ADD_INSN1(ret, line, putobject, ID2SYM(mid));
- }
+ VALUE iseqval = NEW_ISEQVAL(node->nd_defn,
+ rb_id2str(node->nd_mid),
+ ISEQ_TYPE_METHOD, line);
+
+ debugp_param("defs/iseq", iseqval);
+
+ ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));
+ COMPILE(ret, "defs: recv", node->nd_recv);
+ ADD_INSN1(ret, line, putobject, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, line, putiseq, iseqval);
+ ADD_SEND (ret, line, id_core_define_singleton_method, INT2FIX(3));
+
+ if (poped) {
+ ADD_INSN(ret, line, pop);
+ }
break;
}
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;
@@ -8183,61 +5179,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));
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)class_iseq);
-
- if (popped) {
+ VALUE iseqval =
+ NEW_CHILD_ISEQVAL(
+ node->nd_body,
+ rb_sprintf("<class:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, line);
+ VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
+ int flags = VM_DEFINECLASS_TYPE_CLASS;
+ if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
+ if (node->nd_super) flags |= VM_DEFINECLASS_FLAG_HAS_SUPERCLASS;
+ COMPILE(ret, "super", node->nd_super);
+ ADD_INSN3(ret, line, defineclass,
+ ID2SYM(node->nd_cpath->nd_mid), iseqval, INT2FIX(flags));
+
+ 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:%"PRIsVALUE">", rb_id2str(node->nd_cpath->nd_mid)),
+ ISEQ_TYPE_CLASS, line);
+
+ VALUE noscope = compile_cpath(ret, iseq, node->nd_cpath);
+ int flags = VM_DEFINECLASS_TYPE_MODULE;
+ if (!noscope) flags |= VM_DEFINECLASS_FLAG_SCOPED;
ADD_INSN (ret, line, putnil); /* dummy */
- ADD_INSN3(ret, line, defineclass, ID2SYM(node->nd_cpath->nd_mid), module_iseq, INT2FIX(flags));
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)module_iseq);
-
- 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_lit("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));
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)singleton_class);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -8246,17 +5245,17 @@ 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 = 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) {
- ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index));
+ 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 {
ADD_INSN(ret, line, putnil);
@@ -8264,8 +5263,8 @@ 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) {
- ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index));
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index));
ADD_LABEL(ret, lend);
}
}
@@ -8277,118 +5276,135 @@ 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));
+ 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 = 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) {
- ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index));
+ if (iseq->compile_data->option->inline_const_cache) {
+ ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));
ADD_INSN(ret, line, pop);
}
ADD_INSN1(ret, line, putobject, rb_cObject);
- ADD_INSN1(ret, line, putobject, Qtrue);
- ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
+ ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid));
- if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
- ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index));
+ 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);
- ADD_INSN1(ret, line, putobject, val);
- RB_OBJ_WRITTEN(iseq, Qundef, 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 (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);
@@ -8397,26 +5413,39 @@ 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 = body->is_size++;
- struct rb_iseq_new_with_callback_callback_func *ifunc =
- rb_iseq_new_with_callback_new_callback(build_postexe_iseq, node->nd_body);
- const rb_iseq_t *once_iseq =
- new_child_iseq_with_callback(iseq, ifunc,
- rb_fstring(make_name_for_block(iseq)), 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));
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)once_iseq);
- if (popped) {
+ if (poped) {
ADD_INSN(ret, line, pop);
}
break;
@@ -8424,31 +5453,29 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
case NODE_KW_ARG:
{
LABEL *end_label = NEW_LABEL(nd_line(node));
- const NODE *default_value = node->nd_body->nd_value;
+ NODE *default_value = node->nd_body->nd_value;
- if (default_value == NODE_SPECIAL_REQUIRED_KEYWORD) {
+ if (default_value == (NODE *)-1) {
/* required argument. do nothing */
- COMPILE_ERROR(ERROR_ARGS "unreachable");
- goto ng;
+ rb_bug("unreachable");
}
else if (nd_type(default_value) == NODE_LIT ||
nd_type(default_value) == NODE_NIL ||
nd_type(default_value) == NODE_TRUE ||
nd_type(default_value) == NODE_FALSE) {
- COMPILE_ERROR(ERROR_ARGS "unreachable");
- goto ng;
+ rb_bug("unreachable");
}
else {
/* if keywordcheck(_kw_bits, nth_keyword)
* kw = default_value
* end
*/
- int kw_bits_idx = body->local_table_size - body->param.keyword->bits_start;
- int keyword_idx = body->param.keyword->num;
+ int kw_bits_idx = iseq->local_size - iseq->param.keyword->bits_start;
+ int keyword_idx = iseq->param.keyword->num;
- ADD_INSN2(ret, line, checkkeyword, INT2FIX(kw_bits_idx + VM_ENV_DATA_SIZE - 1), INT2FIX(keyword_idx));
+ ADD_INSN2(ret, line, checkkeyword, INT2FIX(kw_bits_idx), INT2FIX(keyword_idx));
ADD_INSNL(ret, line, branchif, end_label);
- CHECK(COMPILE_POPPED(ret, "keyword default argument", node->nd_body));
+ COMPILE_POPED(ret, "keyword default argument", node->nd_body);
ADD_LABEL(ret, end_label);
}
@@ -8456,8 +5483,8 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
}
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);
@@ -8468,31 +5495,29 @@ 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;
VALUE argc;
- LABEL *else_label = NULL;
- VALUE branches = Qfalse;
+ int asgnflag;
/* optimization shortcut
* obj["literal"] = value -> opt_aset_with(obj, "literal", value)
*/
- if (mid == idASET && !private_recv_p(node) && node->nd_args &&
- nd_type(node->nd_args) == NODE_LIST && node->nd_args->nd_alen == 2 &&
+ 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)
+ iseq->compile_data->current_block == Qfalse &&
+ iseq->compile_data->option->specialized_instruction)
{
VALUE str = rb_fstring(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) {
+ 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_INSN2(ret, line, opt_aset_with, str,
- new_callinfo(iseq, idASET, 2, 0, NULL, FALSE));
- RB_OBJ_WRITTEN(iseq, Qundef, str);
+ ADD_INSN2(ret, line, opt_aset_with,
+ new_callinfo(iseq, idASET, 2, 0, 0, NULL), str);
ADD_INSN(ret, line, pop);
break;
}
@@ -8500,21 +5525,13 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
argc = setup_args(iseq, args, node->nd_args, &flag, NULL);
- CHECK(!NIL_P(argc));
- int asgnflag = COMPILE_RECV(recv, "recv", node);
- CHECK(asgnflag != -1);
- flag |= (unsigned int)asgnflag;
+ 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);
- else_label = qcall_branch_start(iseq, recv, &branches, node, line);
- }
- if (!popped) {
+ if (!poped) {
ADD_INSN(ret, line, putnil);
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
@@ -8523,7 +5540,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_WITH_FLAG(ret, line, idAREF, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_SEND_WITH_FLAG(ret, line, idAREF, INT2FIX(1), INT2FIX(asgnflag));
}
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 3));
ADD_INSN (ret, line, pop);
@@ -8531,7 +5548,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_WITH_FLAG(ret, line, idAREF, INT2FIX(1), INT2FIX(asgnflag));
+ ADD_SEND_WITH_FLAG(ret, line, idAREF, INT2FIX(1), INT2FIX(asgnflag));
ADD_INSN1(ret, line, setn, FIXNUM_INC(argc, 2));
ADD_INSN (ret, line, pop);
}
@@ -8543,33 +5560,40 @@ 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));
- qcall_branch_end(iseq, ret, else_label, branches, node, line);
+ ADD_SEND_WITH_FLAG(ret, line, node->nd_mid, argc, INT2FIX(flag));
ADD_INSN(ret, line, pop);
break;
}
+ case NODE_PRELUDE:{
+ 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);
- RB_OBJ_WRITTEN(iseq, Qundef, (VALUE)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;
}
+ /* 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();
return COMPILE_OK;
}
@@ -8587,7 +5611,7 @@ insn_data_length(INSN *iobj)
static int
calc_sp_depth(int depth, INSN *insn)
{
- return comptime_insn_stack_increase(depth, insn->insn_id, insn->operands);
+ return insn_stack_increase(depth, insn->insn_id, insn->operands);
}
static VALUE
@@ -8625,7 +5649,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;
@@ -8634,7 +5658,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));
}
@@ -8658,16 +5682,15 @@ insn_data_to_s_detail(INSN *iobj)
break;
}
case TS_IC: /* inline cache */
- case TS_IVC: /* inline ivar cache */
- case TS_ISE: /* inline storage entry */
rb_str_catf(str, "<ic:%d>", FIX2INT(OPERAND_AT(iobj, j)));
break;
- case TS_CALLDATA: /* we store these as call infos at compile time */
+ case TS_CALLINFO: /* call info */
{
- const struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(iobj, j);
- rb_str_cat2(str, "<calldata:");
- if (ci->mid) rb_str_catf(str, "%"PRIsVALUE, rb_id2str(ci->mid));
- rb_str_catf(str, ", %d>", ci->orig_argc);
+ rb_call_info_t *ci = (rb_call_info_t *)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_CDHASH: /* case/when condition cache */
@@ -8675,7 +5698,7 @@ insn_data_to_s_detail(INSN *iobj)
break;
case TS_FUNCPTR:
{
- void *func = (void *)OPERAND_AT(iobj, j);
+ 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) {
@@ -8686,9 +5709,6 @@ insn_data_to_s_detail(INSN *iobj)
rb_str_catf(str, "<%p>", func);
}
break;
- case TS_BUILTIN:
- rb_bug("unsupported: TS_BUILTIN");
- break;
default:{
rb_raise(rb_eSyntaxError, "unknown operand type: %c", type);
}
@@ -8702,13 +5722,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;
@@ -8718,27 +5732,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" [sp: %d]%s\n", lobj->label_no, lobj->sp,
- 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:
@@ -8754,22 +5765,21 @@ dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr,
link = link->next;
}
printf("---------------------\n");
- fflush(stdout);
}
const char *
rb_insns_name(int i)
{
- return insn_name(i);
+ return insn_name_info[i];
}
VALUE
rb_insns_name_array(void)
{
- VALUE ary = rb_ary_new_capa(VM_INSTRUCTION_SIZE);
+ VALUE ary = rb_ary_new();
int i;
- for (i = 0; i < VM_INSTRUCTION_SIZE; i++) {
- rb_ary_push(ary, rb_fstring_cstr(insn_name(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);
}
@@ -8779,7 +5789,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);
@@ -8788,7 +5798,6 @@ register_label(rb_iseq_t *iseq, struct st_table *labels_table, VALUE obj)
else {
label = (LABEL *)tmp;
}
- LABEL_REF(label);
return label;
}
@@ -8797,6 +5806,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;
@@ -8815,7 +5825,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;
}
@@ -8826,38 +5838,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;
- v = rb_to_array_type(RARRAY_AREF(exception, i));
+ 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");
}
- type = get_exception_sym2type(RARRAY_AREF(v, 0));
- if (RARRAY_AREF(v, 1) == Qnil) {
- eiseq = NULL;
+ ptr = RARRAY_CONST_PTR(v);
+ type = get_exception_sym2type(ptr[0]);
+ if (ptr[1] == Qnil) {
+ eiseqval = 0;
}
else {
- eiseq = rb_iseqw_to_iseq(rb_iseq_load(RARRAY_AREF(v, 1), (VALUE)iseq, Qnil));
- }
-
- lstart = register_label(iseq, labels_table, RARRAY_AREF(v, 2));
- lend = register_label(iseq, labels_table, RARRAY_AREF(v, 3));
- lcont = register_label(iseq, labels_table, RARRAY_AREF(v, 4));
- sp = NUM2UINT(RARRAY_AREF(v, 5));
-
- /* TODO: Dirty Hack! Fix me */
- if (type == CATCH_TYPE_RESCUE ||
- type == CATCH_TYPE_BREAK ||
- type == CATCH_TYPE_NEXT) {
- ++sp;
+ eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil);
}
- lcont->sp = sp;
+ 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]);
- ADD_CATCH_ENTRY(type, lstart, lend, eiseq, lcont);
+ (void)sp;
+
+ ADD_CATCH_ENTRY(type, lstart, lend, eiseqval, lcont);
RB_GC_GUARD(v);
}
@@ -8869,7 +5876,7 @@ insn_make_insn_table(void)
{
struct st_table *table;
int i;
- table = st_init_numtable_with_size(VM_INSTRUCTION_SIZE);
+ table = st_init_numtable();
for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
st_insert(table, ID2SYM(rb_intern(insn_name(i))), i);
@@ -8878,24 +5885,21 @@ 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);
- return loaded_iseq;
+ iseq_add_mark_object(iseq, iseqval);
+ return iseqval;
}
static VALUE
@@ -8903,23 +5907,26 @@ iseq_build_callinfo_from_hash(rb_iseq_t *iseq, VALUE op)
{
ID mid = 0;
int orig_argc = 0;
+ VALUE block = 0;
unsigned int flag = 0;
- struct rb_call_info_kw_arg *kw_arg = 0;
+ rb_call_info_kw_arg_t *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 vblock = rb_hash_aref(op, ID2SYM(rb_intern("blockptr")));
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(vblock)) block = iseq_build_load_iseq(iseq, vblock);
if (!NIL_P(vkw_arg)) {
int i;
int len = RARRAY_LENINT(vkw_arg);
- size_t n = rb_call_info_kw_arg_bytes(len);
+ size_t n = sizeof(rb_call_info_kw_arg_t) + sizeof(VALUE) * (len - 1);
kw_arg = xmalloc(n);
kw_arg->keyword_len = len;
@@ -8931,34 +5938,17 @@ iseq_build_callinfo_from_hash(rb_iseq_t *iseq, VALUE op)
}
}
- 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;
+ return (VALUE)new_callinfo(iseq, mid, orig_argc, block, flag, kw_arg);
}
-
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
@@ -8970,17 +5960,11 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
}
for (i=0; i<len; i++) {
- VALUE obj = RARRAY_AREF(body, i);
+ 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);
@@ -8994,21 +5978,18 @@ 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_compile_error(RSTRING_PTR(iseq->location.path), line_no,
+ "unknown instruction: %"PRIsVALUE,
+ rb_inspect(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) {
- argv = compile_data_alloc2(iseq, sizeof(VALUE), argc);
+ argv = compile_data_alloc(iseq, sizeof(VALUE) * argc);
for (j=0; j<argc; j++) {
VALUE op = rb_ary_entry(obj, j+1);
switch (insn_op_type((VALUE)insn_id, j)) {
@@ -9024,14 +6005,12 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
break;
case TS_VALUE:
argv[j] = op;
- RB_OBJ_WRITTEN(iseq, Qundef, op);
+ iseq_add_mark_object(iseq, op);
break;
case TS_ISEQ:
{
if (op != Qnil) {
- VALUE v = (VALUE)iseq_build_load_iseq(iseq, op);
- argv[j] = v;
- RB_OBJ_WRITTEN(iseq, Qundef, v);
+ argv[j] = iseq_build_load_iseq(iseq, op);
}
else {
argv[j] = 0;
@@ -9039,32 +6018,30 @@ 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_ISE:
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
- /* fall through */
case TS_IC:
- case TS_IVC: /* inline ivar cache */
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_CALLDATA:
+ case TS_CALLINFO:
argv[j] = iseq_build_callinfo_from_hash(iseq, op);
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);
+ VALUE map = rb_hash_new();
- RHASH_TBL_RAW(map)->type = &cdhash_type;
- op = rb_to_array_type(op);
+ rb_hash_tbl_raw(map)->type = &cdhash_type;
+ op = rb_convert_type(op, T_ARRAY, "Array", "to_ary");
+ op = rb_ary_dup(op);
for (i=0; i<RARRAY_LEN(op); i+=2) {
VALUE key = RARRAY_AREF(op, i);
VALUE sym = RARRAY_AREF(op, i+1);
@@ -9074,7 +6051,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor,
}
RB_GC_GUARD(op);
argv[j] = map;
- RB_OBJ_WRITTEN(iseq, Qundef, map);
+ rb_iseq_add_mark_object(iseq, map);
}
break;
case TS_FUNCPTR:
@@ -9100,48 +6077,48 @@ 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);
+ st_free_table(labels_table);
+ iseq_setup(iseq, anchor);
+ return COMPILE_OK;
}
-#define CHECK_ARRAY(v) rb_to_array_type(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_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
static int
int_param(int *dst, VALUE param, VALUE sym)
{
VALUE val = rb_hash_aref(param, sym);
- if (FIXNUM_P(val)) {
+ switch (TYPE(val)) {
+ case T_NIL:
+ return FALSE;
+ case T_FIXNUM:
*dst = FIX2INT(val);
return TRUE;
- }
- else if (!NIL_P(val)) {
+ default:
rb_raise(rb_eTypeError, "invalid %+"PRIsVALUE" Fixnum: %+"PRIsVALUE,
sym, val);
}
return FALSE;
}
-static const struct rb_iseq_param_keyword *
+static void
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;
+ iseq->param.flags.has_kw = TRUE;
- keyword->num = len;
+ iseq->param.keyword = ZALLOC(struct rb_iseq_param_keyword);
+ iseq->param.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];
+ (void)int_param(&iseq->param.keyword->bits_start, params, SYM(kwbits));
+ i = iseq->param.keyword->bits_start - iseq->param.keyword->num;
+ iseq->param.keyword->table = &iseq->local_table[i];
#undef SYM
/* required args */
@@ -9151,21 +6128,17 @@ iseq_build_kw(rb_iseq_t *iseq, VALUE params, VALUE keywords)
if (!SYMBOL_P(val)) {
goto default_values;
}
- ids[i] = SYM2ID(val);
- keyword->required_num++;
+ iseq->param.keyword->table[i] = SYM2ID(val);
+ iseq->param.keyword->required_num++;
}
- default_values: /* note: we intentionally preserve `i' from previous loop */
+default_values: /* note: we intentionally preserve `i' from previous loop */
default_len = len - i;
if (default_len == 0) {
- keyword->table = ids;
- return keyword;
- }
- else if (default_len < 0) {
- UNREACHABLE;
+ return;
}
- dvs = ALLOC_N(VALUE, (unsigned int)default_len);
+ iseq->param.keyword->default_values = ALLOC_N(VALUE, default_len);
for (j = 0; i < len; i++, j++) {
key = RARRAY_AREF(keywords, i);
@@ -9181,80 +6154,23 @@ iseq_build_kw(rb_iseq_t *iseq, VALUE params, VALUE keywords)
default_val = RARRAY_AREF(key, 1);
break;
default:
- rb_raise(rb_eTypeError, "keyword default has unsupported len %+"PRIsVALUE, key);
+ rb_raise(rb_eTypeError,
+ "keyword default has unsupported len %+"PRIsVALUE,
+ key);
}
- ids[i] = SYM2ID(sym);
- dvs[j] = default_val;
- }
-
- keyword->table = ids;
- keyword->default_values = dvs;
-
- return keyword;
-}
-
-void
-rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *storage)
-{
- INSN *iobj = 0;
- size_t size = sizeof(INSN);
- unsigned int pos = 0;
-
- while (storage) {
-#ifdef STRICT_ALIGNMENT
- size_t padding = calc_padding((void *)&storage->buff[pos], size);
-#else
- const size_t padding = 0; /* expected to be optimized by compiler */
-#endif /* STRICT_ALIGNMENT */
- size_t offset = pos + size + padding;
- if (offset > storage->size || offset > storage->pos) {
- pos = 0;
- storage = storage->next;
- }
- else {
-#ifdef STRICT_ALIGNMENT
- pos += (int)padding;
-#endif /* STRICT_ALIGNMENT */
-
- iobj = (INSN *)&storage->buff[pos];
-
- if (iobj->operands) {
- int j;
- const char *types = insn_op_types(iobj->insn_id);
-
- for (j = 0; types[j]; j++) {
- char type = types[j];
- switch (type) {
- case TS_CDHASH:
- case TS_ISEQ:
- case TS_VALUE:
- {
- VALUE op = OPERAND_AT(iobj, j);
- if (!SPECIAL_CONST_P(op)) {
- rb_gc_mark(op);
- }
- break;
- }
- default:
- break;
- }
- }
- }
- pos += (int)size;
- }
+ iseq->param.keyword->table[i] = SYM2ID(sym);
+ iseq->param.keyword->default_values[j] = default_val;
}
}
-void
+VALUE
rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
VALUE exception, VALUE body)
{
#define SYM(s) ID2SYM(rb_intern(#s))
int i, len;
- unsigned int arg_size, local_size, stack_max;
ID *tbl;
struct st_table *labels_table = st_init_numtable();
- VALUE labels_wrapper = Data_Wrap_Struct(0, rb_mark_set, 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"));
@@ -9262,8 +6178,9 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
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 = len;
+ 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++) {
VALUE lv = RARRAY_AREF(locals, i);
@@ -9276,65 +6193,65 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
}
}
-#define INT_PARAM(F) int_param(&iseq->body->param.F, params, SYM(F))
+ /*
+ * we currently ignore misc params,
+ * local_size, stack_size and param.size are all calculated
+ */
+
+#define INT_PARAM(F) int_param(&iseq->param.F, params, SYM(F))
if (INT_PARAM(lead_num)) {
- iseq->body->param.flags.has_lead = TRUE;
+ iseq->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);
+ if (INT_PARAM(post_num)) iseq->param.flags.has_post = TRUE;
+ if (INT_PARAM(post_start)) iseq->param.flags.has_post = TRUE;
+ if (INT_PARAM(rest_start)) iseq->param.flags.has_rest = TRUE;
+ if (INT_PARAM(block_start)) iseq->param.flags.has_block = TRUE;
#undef INT_PARAM
- }
- if (RB_TYPE_P(arg_opt_labels, T_ARRAY)) {
+ switch (TYPE(arg_opt_labels)) {
+ case T_ARRAY:
len = RARRAY_LENINT(arg_opt_labels);
- iseq->body->param.flags.has_opt = !!(len - 1 >= 0);
+ iseq->param.flags.has_opt = !!(len - 1 >= 0);
- if (iseq->body->param.flags.has_opt) {
- VALUE *opt_table = ALLOC_N(VALUE, len);
+ if (iseq->param.flags.has_opt) {
+ iseq->param.opt_num = len - 1;
+ iseq->param.opt_table = (VALUE *)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;
+ iseq->param.opt_table[i] = (VALUE)label;
+ }
}
- }
- else if (!NIL_P(arg_opt_labels)) {
+ case T_NIL:
+ break;
+ default:
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)) {
+ switch (TYPE(keywords)) {
+ case T_ARRAY:
+ iseq_build_kw(iseq, params, keywords);
+ case T_NIL:
+ break;
+ default:
rb_raise(rb_eTypeError, ":keywords param is not an array: %+"PRIsVALUE,
keywords);
}
if (Qtrue == rb_hash_aref(params, SYM(ambiguous_param0))) {
- iseq->body->param.flags.ambiguous_param0 = TRUE;
+ iseq->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;
+ if (!iseq->param.keyword) {
+ iseq->param.keyword = ZALLOC(struct rb_iseq_param_keyword);
+ }
+ iseq->param.keyword->rest_start = i;
+ iseq->param.flags.has_kwrest = TRUE;
+
}
#undef SYM
iseq_calc_param_size(iseq);
@@ -9343,49 +6260,49 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
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 rb_iseq_t *iseq)
+rb_dvar_defined(ID id)
{
- if (iseq) {
- const struct rb_iseq_constant_body *body = iseq->body;
- while (body->type == ISEQ_TYPE_BLOCK ||
- body->type == ISEQ_TYPE_RESCUE ||
- body->type == ISEQ_TYPE_ENSURE ||
- body->type == ISEQ_TYPE_EVAL ||
- 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 < body->local_table_size; i++) {
- if (body->local_table[i] == id) {
+ for (i = 0; i < iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
return 1;
}
}
- iseq = body->parent_iseq;
- body = iseq->body;
+ iseq = iseq->parent_iseq;
}
}
return 0;
}
int
-rb_local_defined(ID id, const rb_iseq_t *iseq)
+rb_local_defined(ID id)
{
- if (iseq) {
- unsigned int i;
- const struct rb_iseq_constant_body *const body = iseq->body->local_iseq->body;
+ rb_thread_t *th = GET_THREAD();
+ rb_iseq_t *iseq;
+
+ if (th->base_block && th->base_block->iseq) {
+ int i;
+ iseq = th->base_block->iseq->local_iseq;
- for (i=0; i<body->local_table_size; i++) {
- if (body->local_table[i] == id) {
+ for (i=0; i<iseq->local_table_size; i++) {
+ if (iseq->local_table[i] == id) {
return 1;
}
}
@@ -9393,22 +6310,34 @@ rb_local_defined(ID id, const rb_iseq_t *iseq)
return 0;
}
+int
+rb_parse_in_eval(void)
+{
+ return GET_THREAD()->parse_in_eval > 0;
+}
+
+int
+rb_parse_in_main(void)
+{
+ return GET_THREAD()->parse_in_eval < 0;
+}
+
static int
-caller_location(VALUE *path, VALUE *realpath)
+caller_location(VALUE *path, VALUE *absolute_path)
{
- const rb_execution_context_t *ec = GET_EC();
+ const rb_thread_t *const th = GET_THREAD();
const rb_control_frame_t *const cfp =
- rb_vm_get_ruby_level_next_cfp(ec, ec->cfp);
+ rb_vm_get_ruby_level_next_cfp(th, th->cfp);
if (cfp) {
int line = rb_vm_get_sourceline(cfp);
- *path = rb_iseq_path(cfp->iseq);
- *realpath = rb_iseq_realpath(cfp->iseq);
+ *path = cfp->iseq->location.path;
+ *absolute_path = cfp->iseq->location.absolute_path;
return line;
}
else {
- *path = rb_fstring_lit("<compiled>");
- *realpath = *path;
+ *path = rb_str_new2("<compiled>");
+ *absolute_path = *path;
return 1;
}
}
@@ -9419,60 +6348,58 @@ typedef struct {
int line;
} accessor_args;
-static const rb_iseq_t *
+static VALUE
method_for_self(VALUE name, VALUE arg, rb_insn_func_t func,
- void (*build)(rb_iseq_t *, LINK_ANCHOR *, const void *))
+ VALUE (*build)(rb_iseq_t *, LINK_ANCHOR *, VALUE))
{
- VALUE path, realpath;
+ VALUE path, absolute_path;
accessor_args acc;
acc.arg = arg;
acc.func = func;
- acc.line = caller_location(&path, &realpath);
- struct rb_iseq_new_with_callback_callback_func *ifunc =
- rb_iseq_new_with_callback_new_callback(build, &acc);
- return rb_iseq_new_with_callback(ifunc,
- rb_sym2str(name), path, realpath,
- INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0);
+ acc.line = caller_location(&path, &absolute_path);
+ return rb_iseq_new_with_opt(NEW_IFUNC(build, (VALUE)&acc),
+ rb_sym2str(name), path, absolute_path,
+ INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0);
}
-static void
-for_self_aref(rb_iseq_t *iseq, LINK_ANCHOR *ret, const void *a)
+static VALUE
+for_self_aref(rb_iseq_t *iseq, LINK_ANCHOR *ret, VALUE a)
{
const accessor_args *const args = (void *)a;
const int line = args->line;
- struct rb_iseq_constant_body *const body = iseq->body;
iseq_set_local_table(iseq, 0);
- body->param.lead_num = 0;
- body->param.size = 0;
+ iseq->param.lead_num = 0;
+ iseq->param.size = 0;
ADD_INSN1(ret, line, putobject, args->arg);
ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
+ return Qnil;
}
-static void
-for_self_aset(rb_iseq_t *iseq, LINK_ANCHOR *ret, const void *a)
+static VALUE
+for_self_aset(rb_iseq_t *iseq, LINK_ANCHOR *ret, VALUE a)
{
const accessor_args *const args = (void *)a;
const int line = args->line;
- struct rb_iseq_constant_body *const body = iseq->body;
static const ID vars[] = {1, idUScore};
iseq_set_local_table(iseq, vars);
- body->param.lead_num = 1;
- body->param.size = 1;
+ iseq->param.lead_num = 1;
+ iseq->param.size = 1;
- ADD_GETLOCAL(ret, line, numberof(vars)-1, 0);
+ ADD_INSN2(ret, line, getlocal, INT2FIX(numberof(vars)-0), INT2FIX(0));
ADD_INSN1(ret, line, putobject, args->arg);
ADD_INSN1(ret, line, opt_call_c_function, (VALUE)args->func);
ADD_INSN(ret, line, pop);
+ return Qnil;
}
/*
* func (index) -> (value)
*/
-const rb_iseq_t *
+VALUE
rb_method_for_self_aref(VALUE name, VALUE arg, rb_insn_func_t func)
{
return method_for_self(name, arg, func, for_self_aref);
@@ -9481,2160 +6408,8 @@ rb_method_for_self_aref(VALUE name, VALUE arg, rb_insn_func_t func)
/*
* func (index, value) -> (index, value)
*/
-const rb_iseq_t *
+VALUE
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 */
-
-#ifndef IBF_ISEQ_DEBUG
-#define IBF_ISEQ_DEBUG 0
-#endif
-
-#ifndef IBF_ISEQ_ENABLE_LOCAL_BUFFER
-#define IBF_ISEQ_ENABLE_LOCAL_BUFFER 0
-#endif
-
-typedef unsigned int ibf_offset_t;
-#define IBF_OFFSET(ptr) ((ibf_offset_t)(VALUE)(ptr))
-
-#define IBF_MAJOR_VERSION ISEQ_MAJOR_VERSION
-#if RUBY_DEVEL
-#define IBF_DEVEL_VERSION 2
-#define IBF_MINOR_VERSION (ISEQ_MINOR_VERSION * 10000 + IBF_DEVEL_VERSION)
-#else
-#define IBF_MINOR_VERSION ISEQ_MINOR_VERSION
-#endif
-
-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 global_object_list_size;
- ibf_offset_t iseq_list_offset;
- ibf_offset_t global_object_list_offset;
-};
-
-struct ibf_dump_buffer {
- VALUE str;
- VALUE obj_list; /* [objs] */
-};
-
-struct ibf_dump {
- VALUE iseq_list; /* [iseqs] */
- st_table *iseq_table; /* iseq -> iseq number */
- struct ibf_dump_buffer global_buffer;
- struct ibf_dump_buffer *current_buffer;
-};
-
-rb_iseq_t * iseq_alloc(void);
-
-struct ibf_load_buffer {
- const char *buff;
- ibf_offset_t size;
-
- VALUE obj_list; /* [obj0, ...] */
- unsigned int obj_list_size;
- ibf_offset_t obj_list_offset;
-};
-
-struct ibf_load {
- const struct ibf_header *header;
- VALUE iseq_list; /* [iseq0, ...] */
- struct ibf_load_buffer global_buffer;
- VALUE loader_obj;
- rb_iseq_t *iseq;
- VALUE str;
- struct ibf_load_buffer *current_buffer;
-};
-
-static ibf_offset_t
-ibf_dump_pos(struct ibf_dump *dump)
-{
- long pos = RSTRING_LEN(dump->current_buffer->str);
-#if SIZEOF_LONG > SIZEOF_INT
- if (pos >= UINT_MAX) {
- rb_raise(rb_eRuntimeError, "dump size exceeds");
- }
-#endif
- return (unsigned int)pos;
-}
-
-static void
-ibf_dump_align(struct ibf_dump *dump, size_t align)
-{
- ibf_offset_t pos = ibf_dump_pos(dump);
- if (pos % align) {
- static const char padding[sizeof(VALUE)];
- size_t size = align - ((size_t)pos % align);
-#if SIZEOF_LONG > SIZEOF_INT
- if (pos + size >= UINT_MAX) {
- rb_raise(rb_eRuntimeError, "dump size exceeds");
- }
-#endif
- for (; size > sizeof(padding); size -= sizeof(padding)) {
- rb_str_cat(dump->current_buffer->str, padding, sizeof(padding));
- }
- rb_str_cat(dump->current_buffer->str, padding, size);
- }
-}
-
-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->current_buffer->str, (const char *)buff, size);
- /* TODO: overflow check */
- return pos;
-}
-
-static ibf_offset_t
-ibf_dump_write_byte(struct ibf_dump *dump, unsigned char byte)
-{
- return ibf_dump_write(dump, &byte, sizeof(unsigned char));
-}
-
-static void
-ibf_dump_overwrite(struct ibf_dump *dump, void *buff, unsigned int size, long offset)
-{
- VALUE str = dump->current_buffer->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 const void *
-ibf_load_ptr(const struct ibf_load *load, ibf_offset_t *offset, int size)
-{
- ibf_offset_t beg = *offset;
- *offset += size;
- return load->current_buffer->buff + beg;
-}
-
-static void *
-ibf_load_alloc(const struct ibf_load *load, ibf_offset_t offset, size_t x, size_t y)
-{
- void *buff = ruby_xmalloc2(x, y);
- size_t size = x * y;
- memcpy(buff, load->current_buffer->buff + offset, size);
- return buff;
-}
-
-#define IBF_W_ALIGN(type) (RUBY_ALIGNOF(type) > 1 ? ibf_dump_align(dump, RUBY_ALIGNOF(type)) : (void)0)
-
-#define IBF_W(b, type, n) (IBF_W_ALIGN(type), (type *)(VALUE)IBF_WP(b, 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))
-#define IBF_ZERO(variable) memset(&(variable), 0, sizeof(variable))
-
-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 void ibf_dump_object_list(struct ibf_dump *dump, ibf_offset_t *obj_list_offset, unsigned int *obj_list_size);
-
-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_list_new(void)
-{
- VALUE obj_list = rb_ary_tmp_new(1);
- rb_ary_push(obj_list, Qnil); /* 0th is nil */
-
- return obj_list;
-}
-
-static VALUE
-ibf_dump_object(struct ibf_dump *dump, VALUE obj)
-{
- VALUE obj_list = dump->current_buffer->obj_list;
- long index = RARRAY_LEN(obj_list);
- long i;
- for (i=0; i<index; i++) {
- if (RARRAY_AREF(obj_list, i) == obj) return (VALUE)i; /* dedup */
- }
- rb_ary_push(obj_list, obj);
- return (VALUE)index;
-}
-
-static VALUE
-ibf_dump_id(struct ibf_dump *dump, ID id)
-{
- if (id == 0 || rb_id2name(id) == NULL) {
- return 0;
- }
- return ibf_dump_object(dump, rb_id2sym(id));
-}
-
-static ID
-ibf_load_id(const struct ibf_load *load, const ID id_index)
-{
- if (id_index == 0) {
- return 0;
- }
- VALUE sym = ibf_load_object(load, id_index);
- return rb_sym2id(sym);
-}
-
-/* dump/load: code */
-
-static VALUE
-ibf_dump_calldata(struct ibf_dump *dump, const struct rb_call_data *cd)
-{
- return (cd->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 int
-ibf_dump_iseq(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- if (iseq == NULL) {
- return -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_push(dump->iseq_list, (VALUE)iseq);
- }
- return 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 unsigned char
-ibf_load_byte(const struct ibf_load *load, ibf_offset_t *offset)
-{
- if (*offset >= load->current_buffer->size) { rb_raise(rb_eRuntimeError, "invalid bytecode"); }
- return (unsigned char)load->current_buffer->buff[(*offset)++];
-}
-
-/*
- * Small uint serialization
- * 0x00000000_00000000 - 0x00000000_0000007f: 1byte | XXXX XXX1 |
- * 0x00000000_00000080 - 0x00000000_00003fff: 2byte | XXXX XX10 | XXXX XXXX |
- * 0x00000000_00004000 - 0x00000000_001fffff: 3byte | XXXX X100 | XXXX XXXX | XXXX XXXX |
- * 0x00000000_00020000 - 0x00000000_0fffffff: 4byte | XXXX 1000 | XXXX XXXX | XXXX XXXX | XXXX XXXX |
- * ...
- * 0x00010000_00000000 - 0x00ffffff_ffffffff: 8byte | 1000 0000 | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX |
- * 0x01000000_00000000 - 0xffffffff_ffffffff: 9byte | 0000 0000 | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX |
- */
-static void
-ibf_dump_write_small_value(struct ibf_dump *dump, VALUE x)
-{
- if (sizeof(VALUE) > 8 || CHAR_BIT != 8) {
- ibf_dump_write(dump, &x, sizeof(VALUE));
- }
-
- enum { max_byte_length = sizeof(VALUE) + 1 };
-
- unsigned char bytes[max_byte_length];
- ibf_offset_t n;
-
- for (n = 0; n < sizeof(VALUE) && (x >> (7 - n)); n++, x >>= 8) {
- bytes[max_byte_length - 1 - n] = (unsigned char)x;
- }
-
- x <<= 1;
- x |= 1;
- x <<= n;
- bytes[max_byte_length - 1 - n] = (unsigned char)x;
- n++;
-
- ibf_dump_write(dump, bytes + max_byte_length - n, n);
-}
-
-static VALUE
-ibf_load_small_value(const struct ibf_load *load, ibf_offset_t *offset)
-{
- if (sizeof(VALUE) > 8 || CHAR_BIT != 8) {
- union { char s[sizeof(VALUE)]; VALUE v; } x;
-
- memcpy(x.s, load->current_buffer->buff + *offset, sizeof(VALUE));
- *offset += sizeof(VALUE);
-
- return x.v;
- }
-
- enum { max_byte_length = sizeof(VALUE) + 1 };
-
- const unsigned char *buffer = (const unsigned char *)load->current_buffer->buff;
- const unsigned char c = buffer[*offset];
-
- ibf_offset_t n =
- c & 1 ? 1 :
- c == 0 ? 9 : ntz_int32(c) + 1;
- VALUE x = (VALUE)c >> n;
-
- if (*offset + n > load->current_buffer->size) {
- rb_raise(rb_eRuntimeError, "invalid byte sequence");
- }
-
- ibf_offset_t i;
- for (i = 1; i < n; i++) {
- x <<= 8;
- x |= (VALUE)buffer[*offset + i];
- }
-
- *offset += n;
- return x;
-}
-
-static void
-ibf_dump_builtin(struct ibf_dump *dump, const struct rb_builtin_function *bf)
-{
- // short: index
- // short: name.length
- // bytes: name
- // // omit argc (only verify with name)
- ibf_dump_write_small_value(dump, (VALUE)bf->index);
-
- size_t len = strlen(bf->name);
- ibf_dump_write_small_value(dump, (VALUE)len);
- ibf_dump_write(dump, bf->name, len);
-}
-
-static const struct rb_builtin_function *
-ibf_load_builtin(const struct ibf_load *load, ibf_offset_t *offset)
-{
- int i = (int)ibf_load_small_value(load, offset);
- int len = (int)ibf_load_small_value(load, offset);
- const char *name = (char *)ibf_load_ptr(load, offset, len);
-
- if (0) {
- for (int i=0; i<len; i++) fprintf(stderr, "%c", name[i]);
- fprintf(stderr, "!!\n");
- }
-
- const struct rb_builtin_function *table = GET_VM()->builtin_function_table;
- if (table == NULL) rb_bug("%s: table is not provided.", RUBY_FUNCTION_NAME_STRING);
- if (strncmp(table[i].name, name, len) != 0) {
- rb_bug("%s: index (%d) mismatch (expect %s but %s).", RUBY_FUNCTION_NAME_STRING, i, name, table[i].name);
- }
- // fprintf(stderr, "load-builtin: name:%s(%d)\n", table[i].name, table[i].argc);
-
- return &table[i];
-}
-
-static ibf_offset_t
-ibf_dump_code(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- const int iseq_size = body->iseq_size;
- int code_index;
- const VALUE *orig_code = rb_iseq_original_iseq(iseq);
-
- ibf_offset_t offset = ibf_dump_pos(dump);
-
- 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;
-
- /* opcode */
- if (insn >= 0x100) { rb_raise(rb_eRuntimeError, "invalid instruction"); }
- ibf_dump_write_small_value(dump, insn);
-
- /* operands */
- for (op_index=0; types[op_index]; op_index++, code_index++) {
- VALUE op = orig_code[code_index];
- VALUE wv;
-
- switch (types[op_index]) {
- case TS_CDHASH:
- case TS_VALUE:
- wv = ibf_dump_object(dump, op);
- break;
- case TS_ISEQ:
- wv = (VALUE)ibf_dump_iseq(dump, (const rb_iseq_t *)op);
- break;
- case TS_IC:
- case TS_IVC:
- case TS_ISE:
- {
- unsigned int i;
- for (i=0; i<body->is_size; i++) {
- if (op == (VALUE)&body->is_entries[i]) {
- break;
- }
- }
- wv = (VALUE)i;
- }
- break;
- case TS_CALLDATA:
- {
- /* ibf_dump_calldata() always returns either Qtrue or Qfalse */
- char c = ibf_dump_calldata(dump, (const struct rb_call_data *)op) == Qtrue; // 1 or 0
- ibf_dump_write_byte(dump, c);
- goto skip_wv;
- }
- case TS_ID:
- wv = ibf_dump_id(dump, (ID)op);
- break;
- case TS_GENTRY:
- wv = ibf_dump_gentry(dump, (const struct rb_global_entry *)op);
- break;
- case TS_FUNCPTR:
- rb_raise(rb_eRuntimeError, "TS_FUNCPTR is not supported");
- goto skip_wv;
- case TS_BUILTIN:
- ibf_dump_builtin(dump, (const struct rb_builtin_function *)op);
- goto skip_wv;
- default:
- wv = op;
- break;
- }
- ibf_dump_write_small_value(dump, wv);
- skip_wv:;
- }
- assert(insn_len(insn) == op_index+1);
- }
-
- return offset;
-}
-
-static VALUE *
-ibf_load_code(const struct ibf_load *load, const rb_iseq_t *iseq, ibf_offset_t bytecode_offset, ibf_offset_t bytecode_size, unsigned int iseq_size)
-{
- unsigned int code_index;
- ibf_offset_t reading_pos = bytecode_offset;
- VALUE *code = ALLOC_N(VALUE, iseq_size);
-
- struct rb_iseq_constant_body *load_body = iseq->body;
- struct rb_call_data *cd_entries = load_body->call_data;
- struct rb_kwarg_call_data *cd_kw_entries = (struct rb_kwarg_call_data *)&load_body->call_data[load_body->ci_size];
- union iseq_inline_storage_entry *is_entries = load_body->is_entries;
-
- for (code_index=0; code_index<iseq_size;) {
- /* opcode */
- const VALUE insn = code[code_index++] = ibf_load_small_value(load, &reading_pos);
- const char *types = insn_op_types(insn);
- int op_index;
-
- /* operands */
- for (op_index=0; types[op_index]; op_index++, code_index++) {
- switch (types[op_index]) {
- case TS_CDHASH:
- case TS_VALUE:
- {
- VALUE op = ibf_load_small_value(load, &reading_pos);
- VALUE v = ibf_load_object(load, op);
- code[code_index] = v;
- if (!SPECIAL_CONST_P(v)) {
- RB_OBJ_WRITTEN(iseq, Qundef, v);
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
- }
- break;
- }
- case TS_ISEQ:
- {
- VALUE op = (VALUE)ibf_load_small_value(load, &reading_pos);
- VALUE v = (VALUE)ibf_load_iseq(load, (const rb_iseq_t *)op);
- code[code_index] = v;
- if (!SPECIAL_CONST_P(v)) {
- RB_OBJ_WRITTEN(iseq, Qundef, v);
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
- }
- break;
- }
- case TS_ISE:
- FL_SET(iseq, ISEQ_MARKABLE_ISEQ);
- /* fall through */
- case TS_IC:
- case TS_IVC:
- {
- VALUE op = ibf_load_small_value(load, &reading_pos);
- code[code_index] = (VALUE)&is_entries[op];
- }
- break;
- case TS_CALLDATA:
- {
- unsigned char op = ibf_load_byte(load, &reading_pos);
- code[code_index] = op ? (VALUE)cd_kw_entries++ : (VALUE)cd_entries++; /* op is 1 (kw) or 0 (!kw) */
- }
- break;
- case TS_ID:
- {
- VALUE op = ibf_load_small_value(load, &reading_pos);
- code[code_index] = ibf_load_id(load, (ID)(VALUE)op);
- }
- break;
- case TS_GENTRY:
- {
- VALUE op = ibf_load_small_value(load, &reading_pos);
- code[code_index] = ibf_load_gentry(load, (const struct rb_global_entry *)(VALUE)op);
- }
- break;
- case TS_FUNCPTR:
- rb_raise(rb_eRuntimeError, "TS_FUNCPTR is not supported");
- break;
- case TS_BUILTIN:
- code[code_index] = (VALUE)ibf_load_builtin(load, &reading_pos);
- break;
- default:
- code[code_index] = ibf_load_small_value(load, &reading_pos);
- continue;
- }
- }
- if (insn_len(insn) != op_index+1) {
- rb_raise(rb_eRuntimeError, "operand size mismatch");
- }
- }
- load_body->iseq_encoded = code;
- load_body->iseq_size = code_index;
-
- assert(code_index == iseq_size);
- assert(reading_pos == bytecode_offset + bytecode_size);
- return code;
-}
-
-static ibf_offset_t
-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) {
- IBF_W_ALIGN(VALUE);
- return ibf_dump_write(dump, iseq->body->param.opt_table, sizeof(VALUE) * (opt_num + 1));
- }
- else {
- return ibf_dump_pos(dump);
- }
-}
-
-static VALUE *
-ibf_load_param_opt_table(const struct ibf_load *load, ibf_offset_t opt_table_offset, int opt_num)
-{
- if (opt_num > 0) {
- VALUE *table = ALLOC_N(VALUE, opt_num+1);
- MEMCPY(table, load->current_buffer->buff + opt_table_offset, VALUE, opt_num+1);
- return table;
- }
- else {
- return NULL;
- }
-}
-
-static ibf_offset_t
-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);
- IBF_W_ALIGN(struct rb_iseq_param_keyword);
- return ibf_dump_write(dump, &dump_kw, sizeof(struct rb_iseq_param_keyword) * 1);
- }
- else {
- return 0;
- }
-}
-
-static const struct rb_iseq_param_keyword *
-ibf_load_param_keyword(const struct ibf_load *load, ibf_offset_t param_keyword_offset)
-{
- if (param_keyword_offset) {
- struct rb_iseq_param_keyword *kw = IBF_R(param_keyword_offset, 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 ibf_offset_t
-ibf_dump_insns_info_body(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- ibf_offset_t offset = ibf_dump_pos(dump);
- const struct iseq_insn_info_entry *entries = iseq->body->insns_info.body;
-
- unsigned int i;
- for (i = 0; i < iseq->body->insns_info.size; i++) {
- ibf_dump_write_small_value(dump, entries[i].line_no);
- ibf_dump_write_small_value(dump, entries[i].events);
- }
-
- return offset;
-}
-
-static struct iseq_insn_info_entry *
-ibf_load_insns_info_body(const struct ibf_load *load, ibf_offset_t body_offset, unsigned int size)
-{
- ibf_offset_t reading_pos = body_offset;
- struct iseq_insn_info_entry *entries = ALLOC_N(struct iseq_insn_info_entry, size);
-
- unsigned int i;
- for (i = 0; i < size; i++) {
- entries[i].line_no = (int)ibf_load_small_value(load, &reading_pos);
- entries[i].events = (rb_event_flag_t)ibf_load_small_value(load, &reading_pos);
- }
-
- return entries;
-}
-
-static ibf_offset_t
-ibf_dump_insns_info_positions(struct ibf_dump *dump, const unsigned int *positions, unsigned int size)
-{
- ibf_offset_t offset = ibf_dump_pos(dump);
-
- unsigned int last = 0;
- unsigned int i;
- for (i = 0; i < size; i++) {
- ibf_dump_write_small_value(dump, positions[i] - last);
- last = positions[i];
- }
-
- return offset;
-}
-
-static unsigned int *
-ibf_load_insns_info_positions(const struct ibf_load *load, ibf_offset_t positions_offset, unsigned int size)
-{
- ibf_offset_t reading_pos = positions_offset;
- unsigned int *positions = ALLOC_N(unsigned int, size);
-
- unsigned int last = 0;
- unsigned int i;
- for (i = 0; i < size; i++) {
- positions[i] = last + (unsigned int)ibf_load_small_value(load, &reading_pos);
- last = positions[i];
- }
-
- return positions;
-}
-
-static ibf_offset_t
-ibf_dump_local_table(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- const int size = body->local_table_size;
- ID *table = ALLOCA_N(ID, size);
- int i;
-
- for (i=0; i<size; i++) {
- table[i] = ibf_dump_id(dump, body->local_table[i]);
- }
-
- IBF_W_ALIGN(ID);
- return ibf_dump_write(dump, table, sizeof(ID) * size);
-}
-
-static ID *
-ibf_load_local_table(const struct ibf_load *load, ibf_offset_t local_table_offset, int size)
-{
- if (size > 0) {
- ID *table = IBF_R(local_table_offset, ID, size);
- int i;
-
- for (i=0; i<size; i++) {
- table[i] = ibf_load_id(load, table[i]);
- }
- return table;
- }
- else {
- return NULL;
- }
-}
-
-static ibf_offset_t
-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 *iseq_indices = ALLOCA_N(int, table->size);
- unsigned int i;
-
- for (i=0; i<table->size; i++) {
- iseq_indices[i] = ibf_dump_iseq(dump, table->entries[i].iseq);
- }
-
- const ibf_offset_t offset = ibf_dump_pos(dump);
-
- for (i=0; i<table->size; i++) {
- ibf_dump_write_small_value(dump, iseq_indices[i]);
- ibf_dump_write_small_value(dump, table->entries[i].type);
- ibf_dump_write_small_value(dump, table->entries[i].start);
- ibf_dump_write_small_value(dump, table->entries[i].end);
- ibf_dump_write_small_value(dump, table->entries[i].cont);
- ibf_dump_write_small_value(dump, table->entries[i].sp);
- }
- return offset;
- }
- else {
- return ibf_dump_pos(dump);
- }
-}
-
-static struct iseq_catch_table *
-ibf_load_catch_table(const struct ibf_load *load, ibf_offset_t catch_table_offset, unsigned int size)
-{
- if (size) {
- struct iseq_catch_table *table = ruby_xmalloc(iseq_catch_table_bytes(size));
- table->size = size;
-
- ibf_offset_t reading_pos = catch_table_offset;
-
- unsigned int i;
- for (i=0; i<table->size; i++) {
- int iseq_index = (int)ibf_load_small_value(load, &reading_pos);
- table->entries[i].type = (enum catch_type)ibf_load_small_value(load, &reading_pos);
- table->entries[i].start = (unsigned int)ibf_load_small_value(load, &reading_pos);
- table->entries[i].end = (unsigned int)ibf_load_small_value(load, &reading_pos);
- table->entries[i].cont = (unsigned int)ibf_load_small_value(load, &reading_pos);
- table->entries[i].sp = (unsigned int)ibf_load_small_value(load, &reading_pos);
-
- table->entries[i].iseq = ibf_load_iseq(load, (const rb_iseq_t *)(VALUE)iseq_index);
- }
- return table;
- }
- else {
- return NULL;
- }
-}
-
-static ibf_offset_t
-ibf_dump_ci_entries(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- const unsigned int ci_size = body->ci_size;
- const unsigned int ci_kw_size = body->ci_kw_size;
- const struct rb_call_data *calls = body->call_data;
- const struct rb_kwarg_call_data *kw_calls = (const struct rb_kwarg_call_data *)&body->call_data[ci_size];
-
- ibf_offset_t offset = ibf_dump_pos(dump);
-
- unsigned int i;
-
- for (i = 0; i < ci_size; i++) {
- VALUE mid = ibf_dump_id(dump, calls[i].ci.mid);
-
- ibf_dump_write_small_value(dump, mid);
- ibf_dump_write_small_value(dump, calls[i].ci.flag);
- ibf_dump_write_small_value(dump, calls[i].ci.orig_argc);
- }
-
- for (i = 0; i < ci_kw_size; i++) {
- const struct rb_call_info_kw_arg *kw_arg = kw_calls[i].ci_kw.kw_arg;
-
- VALUE mid = ibf_dump_id(dump, kw_calls[i].ci_kw.ci.mid);
-
- ibf_dump_write_small_value(dump, mid);
- ibf_dump_write_small_value(dump, kw_calls[i].ci_kw.ci.flag);
- ibf_dump_write_small_value(dump, kw_calls[i].ci_kw.ci.orig_argc);
-
- ibf_dump_write_small_value(dump, kw_arg->keyword_len);
-
- int j;
- for (j = 0; j < kw_calls[i].ci_kw.kw_arg->keyword_len; j++) {
- VALUE keyword = ibf_dump_object(dump, kw_arg->keywords[j]); /* kw_arg->keywords[n] is Symbol */
-
- ibf_dump_write_small_value(dump, keyword);
- }
- }
-
- return offset;
-}
-
-/* note that we dump out rb_call_info but load back rb_call_data */
-static struct rb_call_data *
-ibf_load_ci_entries(const struct ibf_load *load,
- ibf_offset_t ci_entries_offset,
- unsigned int ci_size,
- unsigned int ci_kw_size)
-{
- ibf_offset_t reading_pos = ci_entries_offset;
-
- unsigned int i;
-
- struct rb_call_data *calls =
- rb_xcalloc_mul_add_mul(
- sizeof(struct rb_call_data), ci_size,
- sizeof(struct rb_kwarg_call_data), ci_kw_size);
- struct rb_kwarg_call_data *kw_calls = (struct rb_kwarg_call_data *)&calls[ci_size];
-
- for (i = 0; i < ci_size; i++) {
- VALUE mid_index = ibf_load_small_value(load, &reading_pos);
-
- calls[i].ci.mid = ibf_load_id(load, mid_index);
- calls[i].ci.flag = (unsigned int)ibf_load_small_value(load, &reading_pos);
- calls[i].ci.orig_argc = (int)ibf_load_small_value(load, &reading_pos);
- }
-
- for (i = 0; i < ci_kw_size; i++) {
- VALUE mid_index = ibf_load_small_value(load, &reading_pos);
-
- kw_calls[i].ci_kw.ci.mid = ibf_load_id(load, mid_index);
- kw_calls[i].ci_kw.ci.flag = (unsigned int)ibf_load_small_value(load, &reading_pos);
- kw_calls[i].ci_kw.ci.orig_argc = (int)ibf_load_small_value(load, &reading_pos);
-
- int keyword_len = (int)ibf_load_small_value(load, &reading_pos);
-
- kw_calls[i].ci_kw.kw_arg =
- rb_xmalloc_mul_add(keyword_len - 1, sizeof(VALUE), sizeof(struct rb_call_info_kw_arg));
-
- kw_calls[i].ci_kw.kw_arg->keyword_len = keyword_len;
-
- int j;
- for (j = 0; j < kw_calls[i].ci_kw.kw_arg->keyword_len; j++) {
- VALUE keyword = ibf_load_small_value(load, &reading_pos);
-
- kw_calls[i].ci_kw.kw_arg->keywords[j] = ibf_load_object(load, keyword);
- }
- }
-
- return calls;
-}
-
-static ibf_offset_t
-ibf_dump_iseq_each(struct ibf_dump *dump, const rb_iseq_t *iseq)
-{
- assert(dump->current_buffer == &dump->global_buffer);
-
- unsigned int *positions;
-
- const struct rb_iseq_constant_body *body = iseq->body;
-
- const VALUE location_pathobj_index = ibf_dump_object(dump, body->location.pathobj); /* TODO: freeze */
- const VALUE location_base_label_index = ibf_dump_object(dump, body->location.base_label);
- const VALUE location_label_index = ibf_dump_object(dump, body->location.label);
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
- ibf_offset_t iseq_start = ibf_dump_pos(dump);
-
- struct ibf_dump_buffer *saved_buffer = dump->current_buffer;
- struct ibf_dump_buffer buffer;
- buffer.str = rb_str_new(0, 0);
- buffer.obj_list = ibf_dump_object_list_new();
- dump->current_buffer = &buffer;
-#endif
-
- const ibf_offset_t bytecode_offset = ibf_dump_code(dump, iseq);
- const ibf_offset_t bytecode_size = ibf_dump_pos(dump) - bytecode_offset;
- const ibf_offset_t param_opt_table_offset = ibf_dump_param_opt_table(dump, iseq);
- const ibf_offset_t param_keyword_offset = ibf_dump_param_keyword(dump, iseq);
- const ibf_offset_t insns_info_body_offset = ibf_dump_insns_info_body(dump, iseq);
-
- positions = rb_iseq_insns_info_decode_positions(iseq->body);
- const ibf_offset_t insns_info_positions_offset = ibf_dump_insns_info_positions(dump, positions, body->insns_info.size);
- ruby_xfree(positions);
-
- const ibf_offset_t local_table_offset = ibf_dump_local_table(dump, iseq);
- const unsigned int catch_table_size = body->catch_table ? body->catch_table->size : 0;
- const ibf_offset_t catch_table_offset = ibf_dump_catch_table(dump, iseq);
- const int parent_iseq_index = ibf_dump_iseq(dump, iseq->body->parent_iseq);
- const int local_iseq_index = ibf_dump_iseq(dump, iseq->body->local_iseq);
- const ibf_offset_t ci_entries_offset = ibf_dump_ci_entries(dump, iseq);
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
- ibf_offset_t local_obj_list_offset;
- unsigned int local_obj_list_size;
-
- ibf_dump_object_list(dump, &local_obj_list_offset, &local_obj_list_size);
-#endif
-
- ibf_offset_t body_offset = ibf_dump_pos(dump);
-
- /* dump the constant body */
- unsigned int param_flags =
- (body->param.flags.has_lead << 0) |
- (body->param.flags.has_opt << 1) |
- (body->param.flags.has_rest << 2) |
- (body->param.flags.has_post << 3) |
- (body->param.flags.has_kw << 4) |
- (body->param.flags.has_kwrest << 5) |
- (body->param.flags.has_block << 6) |
- (body->param.flags.ambiguous_param0 << 7) |
- (body->param.flags.accepts_no_kwarg << 8) |
- (body->param.flags.ruby2_keywords << 9);
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
-# define IBF_BODY_OFFSET(x) (x)
-#else
-# define IBF_BODY_OFFSET(x) (body_offset - (x))
-#endif
-
- ibf_dump_write_small_value(dump, body->type);
- ibf_dump_write_small_value(dump, body->iseq_size);
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(bytecode_offset));
- ibf_dump_write_small_value(dump, bytecode_size);
- ibf_dump_write_small_value(dump, param_flags);
- ibf_dump_write_small_value(dump, body->param.size);
- ibf_dump_write_small_value(dump, body->param.lead_num);
- ibf_dump_write_small_value(dump, body->param.opt_num);
- ibf_dump_write_small_value(dump, body->param.rest_start);
- ibf_dump_write_small_value(dump, body->param.post_start);
- ibf_dump_write_small_value(dump, body->param.post_num);
- ibf_dump_write_small_value(dump, body->param.block_start);
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(param_opt_table_offset));
- ibf_dump_write_small_value(dump, param_keyword_offset);
- ibf_dump_write_small_value(dump, location_pathobj_index);
- ibf_dump_write_small_value(dump, location_base_label_index);
- ibf_dump_write_small_value(dump, location_label_index);
- ibf_dump_write_small_value(dump, body->location.first_lineno);
- ibf_dump_write_small_value(dump, body->location.node_id);
- ibf_dump_write_small_value(dump, body->location.code_location.beg_pos.lineno);
- ibf_dump_write_small_value(dump, body->location.code_location.beg_pos.column);
- ibf_dump_write_small_value(dump, body->location.code_location.end_pos.lineno);
- ibf_dump_write_small_value(dump, body->location.code_location.end_pos.column);
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(insns_info_body_offset));
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(insns_info_positions_offset));
- ibf_dump_write_small_value(dump, body->insns_info.size);
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(local_table_offset));
- ibf_dump_write_small_value(dump, catch_table_size);
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(catch_table_offset));
- ibf_dump_write_small_value(dump, parent_iseq_index);
- ibf_dump_write_small_value(dump, local_iseq_index);
- ibf_dump_write_small_value(dump, IBF_BODY_OFFSET(ci_entries_offset));
- ibf_dump_write_small_value(dump, body->variable.flip_count);
- ibf_dump_write_small_value(dump, body->local_table_size);
- ibf_dump_write_small_value(dump, body->is_size);
- ibf_dump_write_small_value(dump, body->ci_size);
- ibf_dump_write_small_value(dump, body->ci_kw_size);
- ibf_dump_write_small_value(dump, body->stack_max);
- ibf_dump_write_small_value(dump, body->catch_except_p);
-
-#undef IBF_BODY_OFFSET
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
- ibf_offset_t iseq_length_bytes = ibf_dump_pos(dump);
-
- dump->current_buffer = saved_buffer;
- ibf_dump_write(dump, RSTRING_PTR(buffer.str), iseq_length_bytes);
-
- ibf_offset_t offset = ibf_dump_pos(dump);
- ibf_dump_write_small_value(dump, iseq_start);
- ibf_dump_write_small_value(dump, iseq_length_bytes);
- ibf_dump_write_small_value(dump, body_offset);
-
- ibf_dump_write_small_value(dump, local_obj_list_offset);
- ibf_dump_write_small_value(dump, local_obj_list_size);
-
- return offset;
-#else
- return body_offset;
-#endif
-}
-
-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(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset)
-{
- struct rb_iseq_constant_body *load_body = iseq->body = rb_iseq_constant_body_alloc();
-
- ibf_offset_t reading_pos = offset;
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
- struct ibf_load_buffer *saved_buffer = load->current_buffer;
- load->current_buffer = &load->global_buffer;
-
- const ibf_offset_t iseq_start = ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t iseq_length_bytes = ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t body_offset = ibf_load_small_value(load, &reading_pos);
-
- struct ibf_load_buffer buffer;
- buffer.buff = load->global_buffer.buff + iseq_start;
- buffer.size = iseq_length_bytes;
- buffer.obj_list_offset = ibf_load_small_value(load, &reading_pos);
- buffer.obj_list_size = ibf_load_small_value(load, &reading_pos);
- buffer.obj_list = rb_ary_tmp_new(buffer.obj_list_size);
- rb_ary_resize(buffer.obj_list, buffer.obj_list_size);
-
- load->current_buffer = &buffer;
- reading_pos = body_offset;
-#endif
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
-# define IBF_BODY_OFFSET(x) (x)
-#else
-# define IBF_BODY_OFFSET(x) (offset - (x))
-#endif
-
- const unsigned int type = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const unsigned int iseq_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t bytecode_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const ibf_offset_t bytecode_size = (ibf_offset_t)ibf_load_small_value(load, &reading_pos);
- const unsigned int param_flags = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const unsigned int param_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const int param_lead_num = (int)ibf_load_small_value(load, &reading_pos);
- const int param_opt_num = (int)ibf_load_small_value(load, &reading_pos);
- const int param_rest_start = (int)ibf_load_small_value(load, &reading_pos);
- const int param_post_start = (int)ibf_load_small_value(load, &reading_pos);
- const int param_post_num = (int)ibf_load_small_value(load, &reading_pos);
- const int param_block_start = (int)ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t param_opt_table_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const ibf_offset_t param_keyword_offset = (ibf_offset_t)ibf_load_small_value(load, &reading_pos);
- const VALUE location_pathobj_index = ibf_load_small_value(load, &reading_pos);
- const VALUE location_base_label_index = ibf_load_small_value(load, &reading_pos);
- const VALUE location_label_index = ibf_load_small_value(load, &reading_pos);
- const VALUE location_first_lineno = ibf_load_small_value(load, &reading_pos);
- const int location_node_id = (int)ibf_load_small_value(load, &reading_pos);
- const int location_code_location_beg_pos_lineno = (int)ibf_load_small_value(load, &reading_pos);
- const int location_code_location_beg_pos_column = (int)ibf_load_small_value(load, &reading_pos);
- const int location_code_location_end_pos_lineno = (int)ibf_load_small_value(load, &reading_pos);
- const int location_code_location_end_pos_column = (int)ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t insns_info_body_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const ibf_offset_t insns_info_positions_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const unsigned int insns_info_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t local_table_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const unsigned int catch_table_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t catch_table_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const int parent_iseq_index = (int)ibf_load_small_value(load, &reading_pos);
- const int local_iseq_index = (int)ibf_load_small_value(load, &reading_pos);
- const ibf_offset_t ci_entries_offset = (ibf_offset_t)IBF_BODY_OFFSET(ibf_load_small_value(load, &reading_pos));
- const rb_snum_t variable_flip_count = (rb_snum_t)ibf_load_small_value(load, &reading_pos);
- const unsigned int local_table_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const unsigned int is_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const unsigned int ci_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const unsigned int ci_kw_size = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const unsigned int stack_max = (unsigned int)ibf_load_small_value(load, &reading_pos);
- const char catch_except_p = (char)ibf_load_small_value(load, &reading_pos);
-
-#undef IBF_BODY_OFFSET
-
- load_body->type = type;
- load_body->stack_max = stack_max;
- load_body->param.flags.has_lead = (param_flags >> 0) & 1;
- load_body->param.flags.has_opt = (param_flags >> 1) & 1;
- load_body->param.flags.has_rest = (param_flags >> 2) & 1;
- load_body->param.flags.has_post = (param_flags >> 3) & 1;
- load_body->param.flags.has_kw = FALSE;
- load_body->param.flags.has_kwrest = (param_flags >> 5) & 1;
- load_body->param.flags.has_block = (param_flags >> 6) & 1;
- load_body->param.flags.ambiguous_param0 = (param_flags >> 7) & 1;
- load_body->param.flags.accepts_no_kwarg = (param_flags >> 8) & 1;
- load_body->param.flags.ruby2_keywords = (param_flags >> 9) & 1;
- load_body->param.size = param_size;
- load_body->param.lead_num = param_lead_num;
- load_body->param.opt_num = param_opt_num;
- load_body->param.rest_start = param_rest_start;
- load_body->param.post_start = param_post_start;
- load_body->param.post_num = param_post_num;
- load_body->param.block_start = param_block_start;
- load_body->local_table_size = local_table_size;
- load_body->is_size = is_size;
- load_body->ci_size = ci_size;
- load_body->ci_kw_size = ci_kw_size;
- load_body->insns_info.size = insns_info_size;
-
- ISEQ_COVERAGE_SET(iseq, Qnil);
- ISEQ_ORIGINAL_ISEQ_CLEAR(iseq);
- iseq->body->variable.flip_count = variable_flip_count;
-
- load_body->location.first_lineno = location_first_lineno;
- load_body->location.node_id = location_node_id;
- load_body->location.code_location.beg_pos.lineno = location_code_location_beg_pos_lineno;
- load_body->location.code_location.beg_pos.column = location_code_location_beg_pos_column;
- load_body->location.code_location.end_pos.lineno = location_code_location_end_pos_lineno;
- load_body->location.code_location.end_pos.column = location_code_location_end_pos_column;
- load_body->catch_except_p = catch_except_p;
-
- load_body->is_entries = ZALLOC_N(union iseq_inline_storage_entry, is_size);
- load_body->call_data = ibf_load_ci_entries(load, ci_entries_offset, ci_size, ci_kw_size);
- load_body->param.opt_table = ibf_load_param_opt_table(load, param_opt_table_offset, param_opt_num);
- load_body->param.keyword = ibf_load_param_keyword(load, param_keyword_offset);
- load_body->param.flags.has_kw = (param_flags >> 4) & 1;
- load_body->insns_info.body = ibf_load_insns_info_body(load, insns_info_body_offset, insns_info_size);
- load_body->insns_info.positions = ibf_load_insns_info_positions(load, insns_info_positions_offset, insns_info_size);
- load_body->local_table = ibf_load_local_table(load, local_table_offset, local_table_size);
- load_body->catch_table = ibf_load_catch_table(load, catch_table_offset, catch_table_size);
- load_body->parent_iseq = ibf_load_iseq(load, (const rb_iseq_t *)(VALUE)parent_iseq_index);
- load_body->local_iseq = ibf_load_iseq(load, (const rb_iseq_t *)(VALUE)local_iseq_index);
-
- ibf_load_code(load, iseq, bytecode_offset, bytecode_size, iseq_size);
-#if VM_INSN_INFO_TABLE_IMPL == 2
- rb_iseq_insns_info_encode_positions(iseq);
-#endif
-
- rb_iseq_translate_threaded_code(iseq);
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
- load->current_buffer = &load->global_buffer;
-#endif
-
- {
- VALUE realpath = Qnil, path = ibf_load_object(load, location_pathobj_index);
- 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, location_base_label_index));
- RB_OBJ_WRITE(iseq, &load_body->location.label, ibf_load_location_str(load, location_label_index));
-
-#if IBF_ISEQ_ENABLE_LOCAL_BUFFER
- load->current_buffer = saved_buffer;
-#endif
- verify_call_cache(iseq);
-}
-
-static void
-ibf_dump_iseq_list(struct ibf_dump *dump, struct ibf_header *header)
-{
- VALUE list = rb_ary_tmp_new(RARRAY_LEN(dump->iseq_list));
- long i;
-
- for (i = 0; i < RARRAY_LEN(dump->iseq_list); i++) {
- ibf_offset_t offset = ibf_dump_iseq_each(dump, (rb_iseq_t *)RARRAY_AREF(dump->iseq_list, i));
- rb_ary_push(list, UINT2NUM(offset));
- }
-
- long size = RARRAY_LEN(dump->iseq_list);
- ibf_offset_t *offsets = ALLOCA_N(ibf_offset_t, size);
-
- for (i = 0; i < size; i++) {
- offsets[i] = NUM2UINT(RARRAY_AREF(list, i));
- }
-
- ibf_dump_align(dump, sizeof(ibf_offset_t));
- header->iseq_list_offset = ibf_dump_write(dump, offsets, sizeof(ibf_offset_t) * size);
- header->iseq_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,
- IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_ERROR,
- IBF_OBJECT_CLASS_TYPE_ERROR,
-};
-
-struct ibf_object_regexp {
- long srcstr;
- char option;
-};
-
-struct ibf_object_hash {
- long len;
- long keyval[FLEX_ARY_LEN];
-};
-
-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[FLEX_ARY_LEN];
-};
-
-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_ALIGNED_OFFSET(align, offset) /* offset > 0 */ \
- ((((offset) - 1) / (align) + 1) * (align))
-#define IBF_OBJBODY(type, offset) (const type *)\
- ibf_load_check_offset(load, IBF_ALIGNED_OFFSET(RUBY_ALIGNOF(type), offset))
-
-static const void *
-ibf_load_check_offset(const struct ibf_load *load, size_t offset)
-{
- if (offset >= load->current_buffer->size) {
- rb_raise(rb_eIndexError, "object offset out of range: %"PRIdSIZE, offset);
- }
- return load->current_buffer->buff + offset;
-}
-
-NORETURN(static void ibf_dump_object_unsupported(struct ibf_dump *dump, VALUE obj));
-
-static void
-ibf_dump_object_unsupported(struct ibf_dump *dump, VALUE obj)
-{
- char buff[0x100];
- rb_raw_obj_info(buff, sizeof(buff), obj);
- rb_raise(rb_eNotImpError, "ibf_dump_object_unsupported: %s", buff);
-}
-
-static VALUE
-ibf_load_object_unsupported(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- rb_raise(rb_eArgError, "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 if (obj == rb_eNoMatchingPatternError) {
- cindex = IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_ERROR;
- }
- else if (obj == rb_eTypeError) {
- cindex = IBF_OBJECT_CLASS_TYPE_ERROR;
- }
- else {
- rb_obj_info_dump(obj);
- rb_p(obj);
- rb_bug("unsupported class");
- }
- ibf_dump_write_small_value(dump, (VALUE)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 cindex = (enum ibf_object_class_index)ibf_load_small_value(load, &offset);
-
- 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;
- case IBF_OBJECT_CLASS_NO_MATCHING_PATTERN_ERROR:
- return rb_eNoMatchingPatternError;
- case IBF_OBJECT_CLASS_TYPE_ERROR:
- return rb_eTypeError;
- }
-
- rb_raise(rb_eArgError, "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);
- (void)IBF_W(&dbl, double, 1);
-}
-
-static VALUE
-ibf_load_object_float(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- const 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_dump_write_small_value(dump, encindex);
- ibf_dump_write_small_value(dump, 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)
-{
- ibf_offset_t reading_pos = offset;
-
- int encindex = (int)ibf_load_small_value(load, &reading_pos);
- const long len = (long)ibf_load_small_value(load, &reading_pos);
- const char *ptr = load->current_buffer->buff + reading_pos;
-
- VALUE str = rb_str_new(ptr, len);
-
- 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)
-{
- VALUE srcstr = RREGEXP_SRC(obj);
- struct ibf_object_regexp regexp;
- regexp.option = (char)rb_reg_options(obj);
- regexp.srcstr = (long)ibf_dump_object(dump, srcstr);
-
- ibf_dump_write_byte(dump, (unsigned char)regexp.option);
- ibf_dump_write_small_value(dump, regexp.srcstr);
-}
-
-static VALUE
-ibf_load_object_regexp(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- struct ibf_object_regexp regexp;
- regexp.option = ibf_load_byte(load, &offset);
- regexp.srcstr = ibf_load_small_value(load, &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 = RARRAY_LEN(obj);
- ibf_dump_write_small_value(dump, len);
- for (i=0; i<len; i++) {
- long index = (long)ibf_dump_object(dump, RARRAY_AREF(obj, i));
- ibf_dump_write_small_value(dump, index);
- }
-}
-
-static VALUE
-ibf_load_object_array(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- ibf_offset_t reading_pos = offset;
-
- const long len = (long)ibf_load_small_value(load, &reading_pos);
-
- VALUE ary = rb_ary_new_capa(len);
- int i;
-
- for (i=0; i<len; i++) {
- const VALUE index = ibf_load_small_value(load, &reading_pos);
- rb_ary_push(ary, ibf_load_object(load, index));
- }
-
- 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;
-
- VALUE key_index = ibf_dump_object(dump, (VALUE)key);
- VALUE val_index = ibf_dump_object(dump, (VALUE)val);
-
- ibf_dump_write_small_value(dump, key_index);
- ibf_dump_write_small_value(dump, val_index);
- return ST_CONTINUE;
-}
-
-static void
-ibf_dump_object_hash(struct ibf_dump *dump, VALUE obj)
-{
- long len = RHASH_SIZE(obj);
- ibf_dump_write_small_value(dump, (VALUE)len);
-
- if (len > 0) rb_hash_foreach(obj, ibf_dump_object_hash_i, (VALUE)dump);
-}
-
-static VALUE
-ibf_load_object_hash(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- long len = (long)ibf_load_small_value(load, &offset);
- VALUE obj = rb_hash_new_with_size(len);
- int i;
-
- for (i = 0; i < len; i++) {
- VALUE key_index = ibf_load_small_value(load, &offset);
- VALUE val_index = ibf_load_small_value(load, &offset);
-
- VALUE key = ibf_load_object(load, key_index);
- VALUE val = ibf_load_object(load, val_index);
- 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;
- IBF_ZERO(range);
- 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_W_ALIGN(struct ibf_object_struct_range);
- IBF_WV(range);
- }
- else {
- rb_raise(rb_eNotImpError, "ibf_dump_object_struct: unsupported class %"PRIsVALUE,
- rb_class_name(CLASS_OF(obj)));
- }
-}
-
-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);
-
- (void)IBF_W(&slen, ssize_t, 1);
- 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);
- long len = strlen(name) + 1;
- long data[2];
- data[0] = IBF_OBJECT_DATA_ENCODING;
- data[1] = len;
- (void)IBF_W(data, long, 2);
- IBF_WP(name, char, len);
- }
- 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 long *body = IBF_OBJBODY(long, offset);
- const enum ibf_object_data_type type = (enum ibf_object_data_type)body[0];
- /* const long len = body[1]; */
- const char *data = (const char *)&body[2];
-
- switch (type) {
- 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 data[2];
- data[0] = (long)ibf_dump_object(dump, RCOMPLEX(obj)->real);
- data[1] = (long)ibf_dump_object(dump, RCOMPLEX(obj)->imag);
-
- (void)IBF_W(data, long, 2);
-}
-
-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);
- VALUE str_index = ibf_dump_object(dump, str);
-
- ibf_dump_write_small_value(dump, str_index);
-}
-
-static VALUE
-ibf_load_object_symbol(const struct ibf_load *load, const struct ibf_object_header *header, ibf_offset_t offset)
-{
- VALUE str_index = ibf_load_small_value(load, &offset);
- VALUE str = ibf_load_object(load, str_index);
- 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 void
-ibf_dump_object_object_header(struct ibf_dump *dump, const struct ibf_object_header header)
-{
- unsigned char byte =
- (header.type << 0) |
- (header.special_const << 5) |
- (header.frozen << 6) |
- (header.internal << 7);
-
- IBF_WV(byte);
-}
-
-static struct ibf_object_header
-ibf_load_object_object_header(const struct ibf_load *load, ibf_offset_t *offset)
-{
- unsigned char byte = ibf_load_byte(load, offset);
-
- struct ibf_object_header header;
- header.type = (byte >> 0) & 0x1f;
- header.special_const = (byte >> 5) & 0x01;
- header.frozen = (byte >> 6) & 0x01;
- header.internal = (byte >> 7) & 0x01;
-
- return header;
-}
-
-static ibf_offset_t
-ibf_dump_object_object(struct ibf_dump *dump, VALUE obj_list, VALUE obj)
-{
- struct ibf_object_header obj_header;
- ibf_offset_t current_offset;
- IBF_ZERO(obj_header);
- obj_header.type = TYPE(obj);
-
- IBF_W_ALIGN(ibf_offset_t);
- current_offset = ibf_dump_pos(dump);
-
- 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_dump_object_object_header(dump, obj_header);
- ibf_dump_write_small_value(dump, 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_dump_object_object_header(dump, 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 offset);
-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 >= (VALUE)RARRAY_LEN(load->current_buffer->obj_list)) {
- rb_raise(rb_eIndexError, "object index out of range: %"PRIdVALUE, object_index);
- }
- else {
- VALUE obj = rb_ary_entry(load->current_buffer->obj_list, (long)object_index);
- if (obj == Qnil) { /* TODO: avoid multiple Qnil load */
- ibf_offset_t *offsets = (ibf_offset_t *)(load->current_buffer->obj_list_offset + load->current_buffer->buff);
- ibf_offset_t offset = offsets[object_index];
- const struct ibf_object_header header = ibf_load_object_object_header(load, &offset);
-
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_object: list=%#x offsets=%p offset=%#x\n",
- load->current_buffer->obj_list_offset, (void *)offsets, offset);
- fprintf(stderr, "ibf_load_object: type=%#x special=%d frozen=%d internal=%d\n",
- header.type, header.special_const, header.frozen, header.internal);
-#endif
- if (offset >= load->current_buffer->size) {
- rb_raise(rb_eIndexError, "object offset out of range: %u", offset);
- }
-
- if (header.special_const) {
- ibf_offset_t reading_pos = offset;
-
- obj = ibf_load_small_value(load, &reading_pos);
- }
- else {
- obj = (*load_object_functions[header.type])(load, &header, offset);
- }
-
- rb_ary_store(load->current_buffer->obj_list, (long)object_index, obj);
- }
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_object: index=%#"PRIxVALUE" obj=%#"PRIxVALUE"\n",
- object_index, obj);
-#endif
- return obj;
- }
-}
-
-static void
-ibf_dump_object_list(struct ibf_dump *dump, ibf_offset_t *obj_list_offset, unsigned int *obj_list_size)
-{
- VALUE obj_list = dump->current_buffer->obj_list;
- VALUE list = rb_ary_tmp_new(RARRAY_LEN(obj_list));
- int i, size;
-
- for (i=0; i<RARRAY_LEN(obj_list); i++) {
- VALUE obj = RARRAY_AREF(obj_list, i);
- ibf_offset_t offset = ibf_dump_object_object(dump, obj_list, obj);
- rb_ary_push(list, UINT2NUM(offset));
- }
- size = i;
- IBF_W_ALIGN(ibf_offset_t);
- *obj_list_offset = ibf_dump_pos(dump);
-
- for (i=0; i<size; i++) {
- ibf_offset_t offset = NUM2UINT(RARRAY_AREF(list, i));
- IBF_WV(offset);
- }
-
- *obj_list_size = size;
-}
-
-static void
-ibf_dump_mark(void *ptr)
-{
- struct ibf_dump *dump = (struct ibf_dump *)ptr;
- rb_gc_mark(dump->global_buffer.str);
- rb_gc_mark(dump->global_buffer.obj_list);
- rb_gc_mark(dump->iseq_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;
- }
- 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);
- 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->iseq_list, rb_ary_tmp_new(0));
- RB_OBJ_WRITE(dumper_obj, &dump->global_buffer.obj_list, ibf_dump_object_list_new());
- RB_OBJ_WRITE(dumper_obj, &dump->global_buffer.str, rb_str_new(0, 0));
- dump->iseq_table = st_init_numtable(); /* need free */
-
- dump->current_buffer = &dump->global_buffer;
-}
-
-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 = IBF_MAJOR_VERSION;
- header.minor_version = IBF_MINOR_VERSION;
- ibf_dump_iseq_list(dump, &header);
- ibf_dump_object_list(dump, &header.global_object_list_offset, &header.global_object_list_size);
- 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->global_buffer.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 (const ibf_offset_t *)(load->global_buffer.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;
- ibf_offset_t offset = ibf_iseq_list(load)[iseq->aux.loader.index];
- load->iseq = iseq;
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "rb_ibf_load_iseq_complete: index=%#x offset=%#x size=%#x\n",
- iseq->aux.loader.index, offset,
- load->header->size);
-#endif
- ibf_load_iseq_each(load, iseq, offset);
- ISEQ_COMPILE_DATA_CLEAR(iseq);
- FL_UNSET(iseq, ISEQ_NOT_LOADED_YET);
- rb_iseq_init_trace(iseq);
- load->iseq = prev_src_iseq;
-}
-
-#if USE_LAZY_LOAD
-MJIT_FUNC_EXPORTED 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 IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_iseq: index_iseq=%p iseq_list=%p\n",
- (void *)index_iseq, (void *)load->iseq_list);
-#endif
- if (iseq_index == -1) {
- return NULL;
- }
- else {
- VALUE iseqv = rb_ary_entry(load->iseq_list, iseq_index);
-
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_iseq: iseqv=%p\n", (void *)iseqv);
-#endif
- if (iseqv != Qnil) {
- return (rb_iseq_t *)iseqv;
- }
- else {
- rb_iseq_t *iseq = iseq_imemo_alloc();
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_iseq: new iseq=%p\n", (void *)iseq);
-#endif
- FL_SET(iseq, ISEQ_NOT_LOADED_YET);
- iseq->aux.loader.obj = load->loader_obj;
- iseq->aux.loader.index = iseq_index;
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_iseq: iseq=%p loader_obj=%p index=%d\n",
- (void *)iseq, (void *)load->loader_obj, iseq_index);
-#endif
- rb_ary_store(load->iseq_list, iseq_index, (VALUE)iseq);
-
-#if !USE_LAZY_LOAD
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_iseq: loading iseq=%p\n", (void *)iseq);
-#endif
- rb_ibf_load_iseq_complete(iseq);
-#else
- if (GET_VM()->builtin_function_table) {
- rb_ibf_load_iseq_complete(iseq);
- }
-#endif /* !USE_LAZY_LOAD */
-
-#if IBF_ISEQ_DEBUG
- fprintf(stderr, "ibf_load_iseq: iseq=%p loaded %p\n",
- (void *)iseq, (void *)load->iseq);
-#endif
- return iseq;
- }
- }
-}
-
-static void
-ibf_load_setup_bytes(struct ibf_load *load, VALUE loader_obj, const char *bytes, size_t size)
-{
- load->loader_obj = loader_obj;
- load->global_buffer.buff = bytes;
- load->header = (struct ibf_header *)load->global_buffer.buff;
- load->global_buffer.size = load->header->size;
- load->global_buffer.obj_list_offset = load->header->global_object_list_offset;
- load->global_buffer.obj_list_size = load->header->global_object_list_size;
- RB_OBJ_WRITE(loader_obj, &load->iseq_list, rb_ary_tmp_new(0));
- RB_OBJ_WRITE(loader_obj, &load->global_buffer.obj_list, rb_ary_tmp_new(load->global_buffer.obj_list_size));
- rb_ary_resize(load->global_buffer.obj_list, load->global_buffer.obj_list_size);
- load->iseq = NULL;
-
- load->current_buffer = &load->global_buffer;
-
- if (size < 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 != IBF_MAJOR_VERSION ||
- load->header->minor_version != IBF_MINOR_VERSION) {
- rb_raise(rb_eRuntimeError, "unmatched version file (%u.%u for %u.%u)",
- load->header->major_version, load->header->minor_version, IBF_MAJOR_VERSION, IBF_MINOR_VERSION);
- }
- if (strcmp(load->global_buffer.buff + sizeof(struct ibf_header), RUBY_PLATFORM) != 0) {
- rb_raise(rb_eRuntimeError, "unmatched platform");
- }
- if (load->header->iseq_list_offset % RUBY_ALIGNOF(ibf_offset_t)) {
- rb_raise(rb_eArgError, "unaligned iseq list offset: %u",
- load->header->iseq_list_offset);
- }
- if (load->global_buffer.obj_list_offset % RUBY_ALIGNOF(ibf_offset_t)) {
- rb_raise(rb_eArgError, "unaligned object list offset: %u",
- load->global_buffer.obj_list_offset);
- }
-}
-
-static void
-ibf_load_setup(struct ibf_load *load, VALUE loader_obj, VALUE str)
-{
- if (RSTRING_LENINT(str) < (int)sizeof(struct ibf_header)) {
- rb_raise(rb_eRuntimeError, "broken binary format");
- }
-
-#if USE_LAZY_LOAD
- str = rb_str_new(RSTRING_PTR(str), RSTRING_LEN(str));
-#endif
-
- ibf_load_setup_bytes(load, loader_obj, StringValuePtr(str), RSTRING_LEN(str));
- RB_OBJ_WRITE(loader_obj, &load->str, str);
-}
-
-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->global_buffer.obj_list);
-}
-
-static void
-ibf_loader_free(void *ptr)
-{
- struct ibf_load *load = (struct ibf_load *)ptr;
- ruby_xfree(load);
-}
-
-static size_t
-ibf_loader_memsize(const void *ptr)
-{
- return sizeof(struct ibf_load);
-}
-
-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)
-{
- 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_GC_GUARD(loader_obj);
- return iseq;
-}
-
-const rb_iseq_t *
-rb_iseq_ibf_load_bytes(const char *bytes, size_t size)
-{
- 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_bytes(load, loader_obj, bytes, size);
- iseq = ibf_load_iseq(load, 0);
-
- RB_GC_GUARD(loader_obj);
- return iseq;
-}
-
-VALUE
-rb_iseq_ibf_load_extra_data(VALUE str)
-{
- struct ibf_load *load;
- VALUE loader_obj = TypedData_Make_Struct(0, struct ibf_load, &ibf_load_type, load);
- VALUE extra_str;
-
- ibf_load_setup(load, loader_obj, str);
- extra_str = rb_str_new(load->global_buffer.buff + load->header->size, load->header->extra_size);
- RB_GC_GUARD(loader_obj);
- return extra_str;
-}
diff --git a/complex.c b/complex.c
index cdd5edc50a..4548c5e2a5 100644
--- a/complex.c
+++ b/complex.c
@@ -5,48 +5,33 @@
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 "internal.h"
-#include "id.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)
-#if USE_FLONUM
-#define RFLOAT_0 DBL2NUM(0)
-#else
-static VALUE RFLOAT_0;
-#endif
-#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \
- !defined(signbit)
-extern int signbit(double);
-#endif
VALUE rb_cComplex;
-static ID id_abs, id_arg,
- id_denominator, id_numerator,
- id_real_p, id_i_real, id_i_imag,
- id_finite_p, id_infinite_p, id_rationalize,
- id_PI;
-#define id_to_i idTo_i
-#define id_to_r idTo_r
-#define id_negate idUMinus
-#define id_expt idPow
-#define id_to_f idTo_f
-#define id_quo idQuo
-#define id_fdiv idFdiv
+static ID id_abs, id_arg, id_convert,
+ id_denominator, id_eqeq_p, id_expt, id_fdiv,
+ id_negate, id_numerator, id_quo,
+ id_real_p, id_to_f, id_to_i, id_to_r,
+ id_i_real, id_i_imag;
#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
+#define binop(n,op) \
+inline static VALUE \
+f_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(x, (op), 1, y);\
+}
+
#define fun1(n) \
inline static VALUE \
f_##n(VALUE x)\
@@ -61,32 +46,31 @@ f_##n(VALUE x, VALUE y)\
return rb_funcall(x, id_##n, 1, y);\
}
+#define math1(n) \
+inline static VALUE \
+m_##n(VALUE x)\
+{\
+ return rb_funcall(rb_mMath, id_##n, 1, x);\
+}
+
+#define math2(n) \
+inline static VALUE \
+m_##n(VALUE x, VALUE y)\
+{\
+ return rb_funcall(rb_mMath, id_##n, 2, x, y);\
+}
+
#define PRESERVE_SIGNEDZERO
inline static VALUE
f_add(VALUE x, VALUE y)
{
- if (RB_INTEGER_TYPE_P(x) &&
- LIKELY(rb_method_basic_definition_p(rb_cInteger, idPLUS))) {
- if (FIXNUM_ZERO_P(x))
- return y;
- if (FIXNUM_ZERO_P(y))
- return x;
- return rb_int_plus(x, y);
- }
- else if (RB_FLOAT_TYPE_P(x) &&
- LIKELY(rb_method_basic_definition_p(rb_cFloat, idPLUS))) {
- if (FIXNUM_ZERO_P(y))
- return x;
- return rb_float_plus(x, y);
- }
- else if (RB_TYPE_P(x, T_RATIONAL) &&
- LIKELY(rb_method_basic_definition_p(rb_cRational, idPLUS))) {
- if (FIXNUM_ZERO_P(y))
- return x;
- return rb_rational_plus(x, y);
- }
-
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
+ return x;
+ else if (FIXNUM_P(x) && FIX2LONG(x) == 0)
+ return y;
+#endif
return rb_funcall(x, '+', 1, y);
}
@@ -98,162 +82,56 @@ 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
f_mul(VALUE x, VALUE y)
{
- if (RB_INTEGER_TYPE_P(x) &&
- LIKELY(rb_method_basic_definition_p(rb_cInteger, idMULT))) {
- if (FIXNUM_ZERO_P(y))
- return ZERO;
- if (FIXNUM_ZERO_P(x) && RB_INTEGER_TYPE_P(y))
- return ZERO;
- if (x == ONE) return y;
- if (y == ONE) return x;
- return rb_int_mul(x, y);
- }
- else if (RB_FLOAT_TYPE_P(x) &&
- LIKELY(rb_method_basic_definition_p(rb_cFloat, idMULT))) {
- if (y == ONE) return x;
- return rb_float_mul(x, y);
- }
- else if (RB_TYPE_P(x, T_RATIONAL) &&
- LIKELY(rb_method_basic_definition_p(rb_cRational, idMULT))) {
- if (y == ONE) return x;
- return rb_rational_mul(x, y);
- }
- else if (LIKELY(rb_method_basic_definition_p(CLASS_OF(x), idMULT))) {
- if (y == ONE) return x;
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y)) {
+ long iy = FIX2LONG(y);
+ if (iy == 0) {
+ if (FIXNUM_P(x) || RB_TYPE_P(x, T_BIGNUM))
+ return ZERO;
+ }
+ else if (iy == 1)
+ return x;
+ }
+ else if (FIXNUM_P(x)) {
+ long ix = FIX2LONG(x);
+ if (ix == 0) {
+ if (FIXNUM_P(y) || RB_TYPE_P(y, T_BIGNUM))
+ return ZERO;
+ }
+ else if (ix == 1)
+ return y;
}
+#endif
return rb_funcall(x, '*', 1, y);
}
inline static VALUE
f_sub(VALUE x, VALUE y)
{
- if (FIXNUM_ZERO_P(y) &&
- LIKELY(rb_method_basic_definition_p(CLASS_OF(x), idMINUS))) {
+#ifndef PRESERVE_SIGNEDZERO
+ if (FIXNUM_P(y) && FIX2LONG(y) == 0)
return x;
- }
+#endif
return rb_funcall(x, '-', 1, y);
}
-inline static VALUE
-f_abs(VALUE x)
-{
- if (RB_INTEGER_TYPE_P(x)) {
- return rb_int_abs(x);
- }
- else if (RB_FLOAT_TYPE_P(x)) {
- return rb_float_abs(x);
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return rb_rational_abs(x);
- }
- else if (RB_TYPE_P(x, T_COMPLEX)) {
- return rb_complex_abs(x);
- }
- return rb_funcall(x, id_abs, 0);
-}
-
-static VALUE numeric_arg(VALUE self);
-static VALUE float_arg(VALUE self);
-
-inline static VALUE
-f_arg(VALUE x)
-{
- if (RB_INTEGER_TYPE_P(x)) {
- return numeric_arg(x);
- }
- else if (RB_FLOAT_TYPE_P(x)) {
- return float_arg(x);
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return numeric_arg(x);
- }
- else if (RB_TYPE_P(x, T_COMPLEX)) {
- return rb_complex_arg(x);
- }
- return rb_funcall(x, id_arg, 0);
-}
-
-inline static VALUE
-f_numerator(VALUE x)
-{
- if (RB_TYPE_P(x, T_RATIONAL)) {
- return RRATIONAL(x)->num;
- }
- if (RB_FLOAT_TYPE_P(x)) {
- return rb_float_numerator(x);
- }
- return x;
-}
-
-inline static VALUE
-f_denominator(VALUE x)
-{
- if (RB_TYPE_P(x, T_RATIONAL)) {
- return RRATIONAL(x)->den;
- }
- if (RB_FLOAT_TYPE_P(x)) {
- return rb_float_denominator(x);
- }
- return INT2FIX(1);
-}
-
-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 rb_complex_uminus(x);
- }
- return rb_funcall(x, id_negate, 0);
-}
-
-static bool nucomp_real_p(VALUE self);
-
-static inline bool
-f_real_p(VALUE x)
-{
- if (RB_INTEGER_TYPE_P(x)) {
- return true;
- }
- else if (RB_FLOAT_TYPE_P(x)) {
- return true;
- }
- else if (RB_TYPE_P(x, T_RATIONAL)) {
- return true;
- }
- else if (RB_TYPE_P(x, T_COMPLEX)) {
- return nucomp_real_p(x);
- }
- return rb_funcall(x, id_real_p, 0);
-}
+fun1(abs)
+fun1(arg)
+fun1(denominator)
+fun1(negate)
+fun1(numerator)
+fun1(real_p)
inline static VALUE
f_to_i(VALUE x)
@@ -262,7 +140,6 @@ 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)
{
@@ -273,117 +150,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)
-static VALUE
-f_quo(VALUE x, VALUE y)
-{
- if (RB_INTEGER_TYPE_P(x))
- return rb_numeric_quo(x, y);
- if (RB_FLOAT_TYPE_P(x))
- return rb_float_div(x, y);
- if (RB_TYPE_P(x, T_RATIONAL))
- return rb_numeric_quo(x, y);
-
- return rb_funcallv(x, id_quo, 1, &y);
-}
-
-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_FLOAT_TYPE_P(x)) {
- return FLOAT_ZERO_P(x);
+ if (RB_TYPE_P(x, T_FIXNUM)) {
+ return f_boolcast(FIX2LONG(x) == 0);
}
- else if (RB_INTEGER_TYPE_P(x)) {
- return FIXNUM_ZERO_P(x);
+ 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)
@@ -392,7 +274,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;
}
@@ -403,22 +284,50 @@ nucomp_s_alloc(VALUE klass)
return nucomp_s_new_internal(klass, ZERO, ZERO);
}
+#if 0
+static VALUE
+nucomp_s_new_bang(int argc, VALUE *argv, VALUE klass)
+{
+ VALUE real, imag;
+
+ switch (rb_scan_args(argc, argv, "11", &real, &imag)) {
+ case 1:
+ if (!k_numeric_p(real))
+ real = f_to_i(real);
+ imag = ZERO;
+ break;
+ default:
+ if (!k_numeric_p(real))
+ real = f_to_i(real);
+ if (!k_numeric_p(imag))
+ imag = f_to_i(imag);
+ break;
+ }
+
+ return nucomp_s_new_internal(klass, real, imag);
+}
+#endif
+
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);
}
#ifdef CANONICALIZATION_FOR_MATHN
+#define CANON
+#endif
+
+#ifdef CANON
static int canonicalization = 0;
RUBY_FUNC_EXPORTED void
@@ -426,15 +335,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,24 +352,26 @@ nucomp_real_check(VALUE num)
inline static VALUE
nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
{
- int complex_r, complex_i;
-#ifdef CANONICALIZATION_FOR_MATHN
+#ifdef CANON
+#define CL_CANON
+#ifdef CL_CANON
if (k_exact_zero_p(imag) && canonicalization)
return real;
+#else
+ if (f_zero_p(imag) && canonicalization)
+ return real;
#endif
- complex_r = RB_TYPE_P(real, T_COMPLEX);
- complex_i = RB_TYPE_P(imag, T_COMPLEX);
- if (!complex_r && !complex_i) {
+#endif
+ if (f_real_p(real) && f_real_p(imag))
return nucomp_s_new_internal(klass, real, imag);
- }
- else if (!complex_r) {
+ else if (f_real_p(real)) {
get_dat1(imag);
return nucomp_s_new_internal(klass,
f_sub(real, dat->imag),
f_add(ZERO, dat->real));
}
- else if (!complex_i) {
+ else if (f_real_p(imag)) {
get_dat1(real);
return nucomp_s_new_internal(klass,
@@ -508,16 +418,13 @@ 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_convert(VALUE klass, VALUE a1, VALUE a2, int raise);
-static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
-
/*
* call-seq:
- * Complex(x[, y], exception: true) -> numeric or nil
+ * Complex(x[, y]) -> numeric
*
* Returns x+i*y;
*
@@ -526,9 +433,6 @@ static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
* Complex(nil) #=> TypeError
* Complex(1, nil) #=> TypeError
*
- * Complex(1, nil, exception: false) #=> nil
- * Complex('1+2', exception: false) #=> nil
- *
* Syntax of string form:
*
* string form = extra spaces , complex , extra spaces ;
@@ -554,19 +458,7 @@ static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
static VALUE
nucomp_f_complex(int argc, VALUE *argv, VALUE klass)
{
- VALUE a1, a2, opts = Qnil;
- int raise = TRUE;
-
- if (rb_scan_args(argc, argv, "11:", &a1, &a2, &opts) == 1) {
- a2 = Qundef;
- }
- if (!NIL_P(opts)) {
- raise = rb_opts_exception_p(opts, raise);
- }
- if (argc > 0 && CLASS_OF(a1) == rb_cComplex && a2 == Qundef) {
- return a1;
- }
- return nucomp_convert(rb_cComplex, a1, a2, raise);
+ return rb_funcall2(rb_cComplex, id_convert, argc, argv);
}
#define imp1(n) \
@@ -576,9 +468,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)
@@ -592,7 +495,7 @@ imp1(sinh)
static VALUE
m_cos(VALUE x)
{
- if (!RB_TYPE_P(x, T_COMPLEX))
+ if (f_real_p(x))
return m_cos_bang(x);
{
get_dat1(x);
@@ -607,7 +510,7 @@ m_cos(VALUE x)
static VALUE
m_sin(VALUE x)
{
- if (!RB_TYPE_P(x, T_COMPLEX))
+ if (f_real_p(x))
return m_sin_bang(x);
{
get_dat1(x);
@@ -619,69 +522,40 @@ m_sin(VALUE x)
}
}
+#if 0
+imp1(sqrt)
+
static VALUE
-f_complex_polar(VALUE klass, VALUE x, VALUE y)
+m_sqrt(VALUE x)
{
- 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);
- }
+ if (f_real_p(x)) {
+ if (f_positive_p(x))
+ return m_sqrt_bang(x);
+ return f_complex_new2(rb_cComplex, ZERO, m_sqrt_bang(f_negate(x)));
+ }
+ else {
+ get_dat1(x);
+
+ if (f_negative_p(dat->imag))
+ return f_conj(m_sqrt(f_conj(x)));
else {
- y = f_mul(x, DBL2NUM(sin(arg)));
- x = f_mul(x, DBL2NUM(cos(arg)));
- if (canonicalization && f_zero_p(y)) return x;
+ 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)));
}
- return nucomp_s_new_internal(klass, x, y);
}
- return nucomp_s_canonicalize_internal(klass,
- f_mul(x, m_cos(y)),
- f_mul(x, m_sin(y)));
}
+#endif
-/* returns a Complex or Float of ang*PI-rotated abs */
-VALUE
-rb_dbl_complex_new_polar_pi(double abs, double ang)
+inline static VALUE
+f_complex_polar(VALUE klass, VALUE x, VALUE y)
{
- double fi;
- const double fr = modf(ang, &fi);
- int pos = fr == +0.5;
-
- if (pos || fr == -0.5) {
- if ((modf(fi / 2.0, &fi) != fr) ^ pos) abs = -abs;
- return rb_complex_new(RFLOAT_0, DBL2NUM(abs));
- }
- else if (fr == 0.0) {
- if (modf(fi / 2.0, &fi) != 0.0) abs = -abs;
- return DBL2NUM(abs);
- }
- else {
- ang *= M_PI;
- return rb_complex_new(DBL2NUM(abs * cos(ang)), DBL2NUM(abs * sin(ang)));
- }
+ 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)));
}
/*
@@ -703,8 +577,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);
@@ -722,8 +596,8 @@ nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
* Complex(7).real #=> 7
* Complex(9, -4).real #=> 9
*/
-VALUE
-rb_complex_real(VALUE self)
+static VALUE
+nucomp_real(VALUE self)
{
get_dat1(self);
return dat->real;
@@ -739,8 +613,8 @@ rb_complex_real(VALUE self)
* Complex(7).imaginary #=> 0
* Complex(9, -4).imaginary #=> -4
*/
-VALUE
-rb_complex_imag(VALUE self)
+static VALUE
+nucomp_imag(VALUE self)
{
get_dat1(self);
return dat->imag;
@@ -754,36 +628,25 @@ rb_complex_imag(VALUE self)
*
* -Complex(1, 2) #=> (-1-2i)
*/
-VALUE
-rb_complex_uminus(VALUE self)
+static VALUE
+nucomp_negate(VALUE self)
{
- get_dat1(self);
- return f_complex_new2(CLASS_OF(self),
- f_negate(dat->real), f_negate(dat->imag));
+ get_dat1(self);
+ return f_complex_new2(CLASS_OF(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);
}
@@ -791,9 +654,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, '+');
}
/*
@@ -808,52 +689,10 @@ rb_complex_plus(VALUE self, VALUE other)
* Complex(9, 8) - 4 #=> (5+8i)
* Complex(20, 9) - 9.8 #=> (10.2+9i)
*/
-VALUE
-rb_complex_minus(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);
-}
-
-static void
-comp_mul(VALUE areal, VALUE aimag, VALUE breal, VALUE bimag, VALUE *real, VALUE *imag)
+nucomp_sub(VALUE self, VALUE other)
{
- int arzero = f_zero_p(areal);
- int aizero = f_zero_p(aimag);
- int brzero = f_zero_p(breal);
- int bizero = f_zero_p(bimag);
- *real = f_sub(safe_mul(areal, breal, arzero, brzero),
- safe_mul(aimag, bimag, aizero, bizero));
- *imag = f_add(safe_mul(areal, bimag, arzero, bizero),
- safe_mul(aimag, breal, aizero, brzero));
+ return f_addsub(self, other, f_sub, '-');
}
/*
@@ -868,14 +707,18 @@ comp_mul(VALUE areal, VALUE aimag, VALUE breal, VALUE bimag, VALUE *real, VALUE
* 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;
+
get_dat2(self, other);
- comp_mul(adat->real, adat->imag, bdat->real, bdat->imag, &real, &imag);
+ 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);
}
@@ -893,38 +736,50 @@ inline static VALUE
f_divide(VALUE self, VALUE other,
VALUE (*func)(VALUE, VALUE), ID id)
{
- if (RB_TYPE_P(other, T_COMPLEX)) {
- VALUE r, n, x, y;
+ 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;
+
r = (*func)(bdat->imag, bdat->real);
n = f_mul(bdat->real, f_add(ONE, f_mul(r, r)));
- x = (*func)(f_add(adat->real, f_mul(adat->imag, r)), n);
- y = (*func)(f_sub(adat->imag, f_mul(adat->real, r)), n);
+ if (flo)
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(self, n),
+ (*func)(f_negate(f_mul(self, r)), n));
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_add(adat->real,
+ f_mul(adat->imag, r)), n),
+ (*func)(f_sub(adat->imag,
+ f_mul(adat->real, r)), n));
}
else {
+ VALUE r, n;
+
r = (*func)(bdat->real, bdat->imag);
n = f_mul(bdat->imag, f_add(ONE, f_mul(r, r)));
- x = (*func)(f_add(f_mul(adat->real, r), adat->imag), n);
- y = (*func)(f_sub(f_mul(adat->imag, r), adat->real), n);
+ if (flo)
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_mul(self, r), n),
+ (*func)(f_negate(self), n));
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(f_add(f_mul(adat->real, r),
+ adat->imag), n),
+ (*func)(f_sub(f_mul(adat->imag, r),
+ adat->real), n));
}
- if (!flo) {
- x = rb_rational_canonicalize(x);
- y = rb_rational_canonicalize(y);
- }
- return f_complex_new2(CLASS_OF(self), x, y);
}
if (k_numeric_p(other) && f_real_p(other)) {
- VALUE x, y;
get_dat1(self);
- x = rb_rational_canonicalize((*func)(dat->real, other));
- y = rb_rational_canonicalize((*func)(dat->imag, other));
- return f_complex_new2(CLASS_OF(self), x, y);
+
+ return f_complex_new2(CLASS_OF(self),
+ (*func)(dat->real, other),
+ (*func)(dat->imag, other));
}
return rb_num_coerce_bin(self, other, id);
}
@@ -944,13 +799,13 @@ f_divide(VALUE self, VALUE other,
* Complex(9, 8) / 4 #=> ((9/4)+(2/1)*i)
* Complex(20, 9) / 9.8 #=> (2.0408163265306123+0.9183673469387754i)
*/
-VALUE
-rb_complex_div(VALUE self, VALUE other)
+static VALUE
+nucomp_div(VALUE self, VALUE other)
{
return f_divide(self, other, f_quo, id_quo);
}
-#define nucomp_quo rb_complex_div
+#define nucomp_quo nucomp_div
/*
* call-seq:
@@ -981,23 +836,23 @@ f_reciprocal(VALUE x)
* Complex('i') ** 2 #=> (-1+0i)
* Complex(-8) ** Rational(1, 3) #=> (1.0000000000000002+1.7320508075688772i)
*/
-VALUE
-rb_complex_pow(VALUE self, VALUE other)
+static VALUE
+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);
@@ -1011,51 +866,44 @@ rb_complex_pow(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)) {
- long n = FIX2LONG(other);
- if (n == 0) {
- return nucomp_s_new_internal(CLASS_OF(self), ONE, ZERO);
- }
- if (n < 0) {
- self = f_reciprocal(self);
- other = rb_int_uminus(other);
- n = -n;
- }
- {
- get_dat1(self);
- VALUE xr = dat->real, xi = dat->imag, zr = xr, zi = xi;
-
- if (f_zero_p(xi)) {
- zr = rb_num_pow(zr, other);
- }
- else if (f_zero_p(xr)) {
- zi = rb_num_pow(zi, other);
- if (n & 2) zi = f_negate(zi);
- if (!(n & 1)) {
- VALUE tmp = zr;
- zr = zi;
- zi = tmp;
- }
- }
- else {
- while (--n) {
- long q, r;
-
- for (; q = n / 2, r = n % 2, r == 0; n = q) {
- VALUE tmp = f_sub(f_mul(xr, xr), f_mul(xi, xi));
- xi = f_mul(f_mul(TWO, xr), xi);
- xr = tmp;
- }
- comp_mul(zr, zi, xr, xi, &zr, &zi);
- }
- }
- return nucomp_s_new_internal(CLASS_OF(self), zr, zi);
+ if (k_fixnum_p(other)) {
+ if (f_gt_p(other, ZERO)) {
+ VALUE x, z;
+ long n;
+
+ x = self;
+ z = x;
+ n = FIX2LONG(other) - 1;
+
+ while (n) {
+ long q, r;
+
+ while (1) {
+ get_dat1(x);
+
+ q = n / 2;
+ r = n % 2;
+
+ if (r)
+ break;
+
+ x = nucomp_s_new_internal(CLASS_OF(self),
+ f_sub(f_mul(dat->real, dat->real),
+ f_mul(dat->imag, dat->imag)),
+ f_mul(f_mul(TWO, dat->real), dat->imag));
+ n = q;
+ }
+ z = f_mul(z, x);
+ n--;
+ }
+ return z;
}
+ 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);
@@ -1082,7 +930,7 @@ rb_complex_pow(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) &&
@@ -1093,57 +941,20 @@ 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));
-}
-
-static bool
-nucomp_real_p(VALUE self)
-{
- get_dat1(self);
- return(f_zero_p(dat->imag) ? true : false);
-}
-
-/*
- * call-seq:
- * cmp <=> object -> 0, 1, -1, or nil
- *
- * If +cmp+'s imaginary part is zero, and +object+ is also a
- * real number (or a Complex number where the imaginary part is zero),
- * compare the real part of +cmp+ to object. Otherwise, return nil.
- *
- * Complex(2, 3) <=> Complex(2, 3) #=> nil
- * Complex(2, 3) <=> 1 #=> nil
- * Complex(2) <=> 1 #=> 1
- * Complex(2) <=> 2 #=> 0
- * Complex(2) <=> 3 #=> -1
- */
-static VALUE
-nucomp_cmp(VALUE self, VALUE other)
-{
- if (nucomp_real_p(self) && k_numeric_p(other)) {
- if (RB_TYPE_P(other, T_COMPLEX) && nucomp_real_p(other)) {
- get_dat2(self, other);
- return rb_funcall(adat->real, idCmp, 1, bdat->real);
- }
- else if (f_real_p(other)) {
- get_dat1(self);
- return rb_funcall(dat->real, idCmp, 1, other);
- }
- }
- return Qnil;
+ return f_eqeq_p(other, self);
}
/* :nodoc: */
static VALUE
nucomp_coerce(VALUE self, VALUE other)
{
+ if (k_numeric_p(other) && f_real_p(other))
+ return rb_assoc_new(f_complex_new_bang1(CLASS_OF(self), other), self);
if (RB_TYPE_P(other, T_COMPLEX))
return rb_assoc_new(other, self);
- if (k_numeric_p(other) && f_real_p(other))
- return rb_assoc_new(f_complex_new_bang1(CLASS_OF(self), 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;
}
@@ -1157,24 +968,24 @@ nucomp_coerce(VALUE self, VALUE other)
* Complex(-1).abs #=> 1
* Complex(3.0, -4.0).abs #=> 5.0
*/
-VALUE
-rb_complex_abs(VALUE self)
+static VALUE
+nucomp_abs(VALUE self)
{
get_dat1(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);
}
/*
@@ -1204,11 +1015,11 @@ nucomp_abs2(VALUE self)
*
* Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
*/
-VALUE
-rb_complex_arg(VALUE self)
+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,19 +1061,27 @@ nucomp_polar(VALUE self)
*
* Complex(1, 2).conjugate #=> (1-2i)
*/
-VALUE
-rb_complex_conjugate(VALUE self)
+static VALUE
+nucomp_conj(VALUE self)
{
get_dat1(self);
return f_complex_new2(CLASS_OF(self), dat->real, f_negate(dat->imag));
}
+#if 0
+/* :nodoc: */
+static VALUE
+nucomp_true(VALUE self)
+{
+ return Qtrue;
+}
+#endif
+
/*
* call-seq:
- * Complex(1).real? -> false
- * Complex(1, 2).real? -> false
+ * cmp.real? -> false
*
- * Returns false, even if the complex number has no imaginary part.
+ * Returns false.
*/
static VALUE
nucomp_false(VALUE self)
@@ -1270,6 +1089,23 @@ nucomp_false(VALUE self)
return Qfalse;
}
+#if 0
+/* :nodoc: */
+static VALUE
+nucomp_exact_p(VALUE self)
+{
+ get_dat1(self);
+ return f_boolcast(k_exact_p(dat->real) && k_exact_p(dat->imag));
+}
+
+/* :nodoc: */
+static VALUE
+nucomp_inexact_p(VALUE self)
+{
+ return f_boolcast(!nucomp_exact_p(self));
+}
+#endif
+
/*
* call-seq:
* cmp.denominator -> integer
@@ -1310,7 +1146,7 @@ nucomp_numerator(VALUE self)
get_dat1(self);
- cd = nucomp_denominator(self);
+ cd = f_denominator(self);
return f_complex_new2(CLASS_OF(self),
f_mul(f_numerator(dat->real),
f_div(cd, f_denominator(dat->real))),
@@ -1331,14 +1167,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)) &&
@@ -1349,27 +1185,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);
@@ -1428,49 +1267,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 real and imaginary parts are both finite numbers,
- * 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 +1+ if +cmp+'s real or imaginary part is an infinite number,
- * otherwise returns +nil+.
- *
- * 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)
@@ -1486,7 +1282,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;
}
@@ -1530,16 +1325,12 @@ rb_complex_new(VALUE x, VALUE y)
}
VALUE
-rb_complex_new_polar(VALUE x, VALUE y)
+rb_complex_polar(VALUE x, VALUE y)
{
return f_complex_polar(rb_cComplex, x, y);
}
-VALUE
-rb_complex_polar(VALUE x, VALUE y)
-{
- return rb_complex_new_polar(x, y);
-}
+static VALUE nucomp_s_convert(int argc, VALUE *argv, VALUE klass);
VALUE
rb_Complex(VALUE x, VALUE y)
@@ -1550,17 +1341,18 @@ rb_Complex(VALUE x, VALUE y)
return nucomp_s_convert(2, a, rb_cComplex);
}
-/*!
- * Creates a Complex object.
- *
- * \param real real part value
- * \param imag imaginary part value
- * \return a new Complex object
- */
VALUE
-rb_dbl_complex_new(double real, double imag)
+rb_complex_set_real(VALUE cmp, VALUE r)
+{
+ RCOMPLEX_SET_REAL(cmp, r);
+ return cmp;
+}
+
+VALUE
+rb_complex_set_imag(VALUE cmp, VALUE i)
{
- return rb_complex_raw(DBL2NUM(real), DBL2NUM(imag));
+ RCOMPLEX_SET_IMAG(cmp, i);
+ return cmp;
}
/*
@@ -1579,7 +1371,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);
}
@@ -1602,7 +1394,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);
}
@@ -1627,7 +1419,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);
}
@@ -1652,13 +1444,13 @@ nucomp_rationalize(int argc, VALUE *argv, VALUE self)
{
get_dat1(self);
- rb_check_arity(argc, 0, 1);
+ 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);
}
/*
@@ -1898,7 +1690,7 @@ read_comp(const char **s, int strict,
return 0; /* e.g. "1@-" */
}
num2 = str2num(bb);
- *ret = rb_complex_new_polar(num, num2);
+ *ret = rb_complex_polar(num, num2);
if (!st)
return 0; /* e.g. "1@2." */
else
@@ -1941,7 +1733,8 @@ skip_ws(const char **s)
}
static int
-parse_comp(const char *s, int strict, VALUE *num)
+parse_comp(const char *s, int strict,
+ VALUE *num)
{
char *buf, *b;
VALUE tmp;
@@ -1952,14 +1745,14 @@ parse_comp(const char *s, int strict, VALUE *num)
skip_ws(&s);
if (!read_comp(&s, strict, num, &b)) {
- ret = 0;
+ ret = 0;
}
else {
- skip_ws(&s);
+ skip_ws(&s);
- if (strict)
- if (*s != '\0')
- ret = 0;
+ if (strict)
+ if (*s != '\0')
+ ret = 0;
}
ALLOCV_END(tmp);
@@ -1967,7 +1760,7 @@ parse_comp(const char *s, int strict, VALUE *num)
}
static VALUE
-string_to_c_strict(VALUE self, int raise)
+string_to_c_strict(VALUE self)
{
char *s;
VALUE num;
@@ -1976,10 +1769,8 @@ string_to_c_strict(VALUE self, int raise)
s = RSTRING_PTR(self);
- if (!s || memchr(s, '\0', RSTRING_LEN(self))) {
- if (!raise) return Qnil;
+ 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);
@@ -1991,7 +1782,6 @@ string_to_c_strict(VALUE self, int raise)
s = (char *)"";
if (!parse_comp(s, 1, &num)) {
- if (!raise) return Qnil;
rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE,
self);
}
@@ -2047,29 +1837,28 @@ string_to_c(VALUE self)
}
static VALUE
-to_complex(VALUE val)
+nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
{
- return rb_convert_type(val, T_COMPLEX, "Complex", "to_c");
-}
+ VALUE a1, a2, backref;
-static VALUE
-nucomp_convert(VALUE klass, VALUE a1, VALUE a2, int raise)
-{
- if (NIL_P(a1) || NIL_P(a2)) {
- if (!raise) return Qnil;
+ rb_scan_args(argc, argv, "11", &a1, &a2);
+
+ if (NIL_P(a1) || (argc == 2 && NIL_P(a2)))
rb_raise(rb_eTypeError, "can't convert nil into Complex");
- }
+
+ backref = rb_backref_get();
+ rb_match_busy(backref);
if (RB_TYPE_P(a1, T_STRING)) {
- a1 = string_to_c_strict(a1, raise);
- if (NIL_P(a1)) return Qnil;
+ a1 = string_to_c_strict(a1);
}
if (RB_TYPE_P(a2, T_STRING)) {
- a2 = string_to_c_strict(a2, raise);
- if (NIL_P(a2)) return Qnil;
+ a2 = string_to_c_strict(a2);
}
+ rb_backref_set(backref);
+
if (RB_TYPE_P(a1, T_COMPLEX)) {
{
get_dat1(a1);
@@ -2089,19 +1878,16 @@ nucomp_convert(VALUE klass, VALUE a1, VALUE a2, int raise)
}
if (RB_TYPE_P(a1, T_COMPLEX)) {
- if (a2 == Qundef || (k_exact_zero_p(a2)))
+ if (argc == 1 || (k_exact_zero_p(a2)))
return a1;
}
- if (a2 == Qundef) {
+ if (argc == 1) {
if (k_numeric_p(a1) && !f_real_p(a1))
return a1;
/* should raise exception for consistency */
- if (!k_numeric_p(a1)) {
- if (!raise)
- return rb_protect(to_complex, a1, NULL);
- return to_complex(a1);
- }
+ if (!k_numeric_p(a1))
+ return rb_convert_type(a1, T_COMPLEX, "Complex", "to_c");
}
else {
if ((k_numeric_p(a1) && k_numeric_p(a2)) &&
@@ -2112,35 +1898,13 @@ nucomp_convert(VALUE klass, VALUE a1, VALUE a2, int raise)
}
{
- int argc;
VALUE argv2[2];
argv2[0] = a1;
- if (a2 == Qundef) {
- argv2[1] = Qnil;
- argc = 1;
- }
- else {
- if (!raise && !RB_INTEGER_TYPE_P(a2) && !RB_FLOAT_TYPE_P(a2) && !RB_TYPE_P(a2, T_RATIONAL))
- return Qnil;
- argv2[1] = a2;
- argc = 2;
- }
+ argv2[1] = a2;
return nucomp_s_new(argc, argv2, klass);
}
}
-static VALUE
-nucomp_s_convert(int argc, VALUE *argv, VALUE klass)
-{
- VALUE a1, a2;
-
- if (rb_scan_args(argc, argv, "11", &a1, &a2) == 1) {
- a2 = Qundef;
- }
-
- return nucomp_convert(klass, a1, a2, TRUE);
-}
-
/* --- */
/*
@@ -2180,6 +1944,8 @@ numeric_abs2(VALUE self)
return f_mul(self, self);
}
+#define id_PI rb_intern("PI")
+
/*
* call-seq:
* num.arg -> 0 or float
@@ -2192,8 +1958,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);
}
/*
@@ -2209,8 +1975,6 @@ numeric_rect(VALUE self)
return rb_assoc_new(self, INT2FIX(0));
}
-static VALUE float_arg(VALUE self);
-
/*
* call-seq:
* num.polar -> array
@@ -2220,25 +1984,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));
}
/*
@@ -2278,10 +2024,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)
@@ -2312,24 +2057,36 @@ Init_Complex(void)
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+ assert(fprintf(stderr, "assert() is now active\n"));
+
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("-@");
id_numerator = rb_intern("numerator");
+ id_quo = rb_intern("quo");
id_real_p = rb_intern("real?");
+ id_to_f = rb_intern("to_f");
+ id_to_i = rb_intern("to_i");
+ id_to_r = rb_intern("to_r");
id_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);
rb_define_alloc_func(rb_cComplex, nucomp_s_alloc);
rb_undef_method(CLASS_OF(rb_cComplex), "allocate");
+#if 0
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new!", nucomp_s_new_bang, -1);
+ rb_define_private_method(CLASS_OF(rb_cComplex), "new", nucomp_s_new, -1);
+#else
rb_undef_method(CLASS_OF(rb_cComplex), "new");
+#endif
rb_define_singleton_method(rb_cComplex, "rectangular", nucomp_s_new, -1);
rb_define_singleton_method(rb_cComplex, "rect", nucomp_s_new, -1);
@@ -2337,8 +2094,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");
@@ -2350,36 +2112,47 @@ Init_Complex(void)
rb_undef_method(rb_cComplex, "truncate");
rb_undef_method(rb_cComplex, "i");
- rb_define_method(rb_cComplex, "real", rb_complex_real, 0);
- rb_define_method(rb_cComplex, "imaginary", rb_complex_imag, 0);
- rb_define_method(rb_cComplex, "imag", rb_complex_imag, 0);
+#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, "-@", rb_complex_uminus, 0);
- rb_define_method(rb_cComplex, "+", rb_complex_plus, 1);
- rb_define_method(rb_cComplex, "-", rb_complex_minus, 1);
- rb_define_method(rb_cComplex, "*", rb_complex_mul, 1);
- rb_define_method(rb_cComplex, "/", rb_complex_div, 1);
+ rb_define_method(rb_cComplex, "-@", nucomp_negate, 0);
+ 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);
rb_define_method(rb_cComplex, "quo", nucomp_quo, 1);
rb_define_method(rb_cComplex, "fdiv", nucomp_fdiv, 1);
- rb_define_method(rb_cComplex, "**", rb_complex_pow, 1);
+ rb_define_method(rb_cComplex, "**", nucomp_expt, 1);
rb_define_method(rb_cComplex, "==", nucomp_eqeq_p, 1);
- rb_define_method(rb_cComplex, "<=>", nucomp_cmp, 1);
rb_define_method(rb_cComplex, "coerce", nucomp_coerce, 1);
- rb_define_method(rb_cComplex, "abs", rb_complex_abs, 0);
- rb_define_method(rb_cComplex, "magnitude", rb_complex_abs, 0);
+ rb_define_method(rb_cComplex, "abs", nucomp_abs, 0);
+ rb_define_method(rb_cComplex, "magnitude", nucomp_abs, 0);
rb_define_method(rb_cComplex, "abs2", nucomp_abs2, 0);
- rb_define_method(rb_cComplex, "arg", rb_complex_arg, 0);
- rb_define_method(rb_cComplex, "angle", rb_complex_arg, 0);
- rb_define_method(rb_cComplex, "phase", rb_complex_arg, 0);
+ rb_define_method(rb_cComplex, "arg", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "angle", nucomp_arg, 0);
+ rb_define_method(rb_cComplex, "phase", nucomp_arg, 0);
rb_define_method(rb_cComplex, "rectangular", nucomp_rect, 0);
rb_define_method(rb_cComplex, "rect", nucomp_rect, 0);
rb_define_method(rb_cComplex, "polar", nucomp_polar, 0);
- rb_define_method(rb_cComplex, "conjugate", rb_complex_conjugate, 0);
- rb_define_method(rb_cComplex, "conj", rb_complex_conjugate, 0);
+ rb_define_method(rb_cComplex, "conjugate", nucomp_conj, 0);
+ rb_define_method(rb_cComplex, "conj", nucomp_conj, 0);
+#if 0
+ rb_define_method(rb_cComplex, "~", nucomp_conj, 0); /* gcc */
+#endif
rb_define_method(rb_cComplex, "real?", nucomp_false, 0);
+#if 0
+ rb_define_method(rb_cComplex, "complex?", nucomp_true, 0);
+ rb_define_method(rb_cComplex, "exact?", nucomp_exact_p, 0);
+ rb_define_method(rb_cComplex, "inexact?", nucomp_inexact_p, 0);
+#endif
rb_define_method(rb_cComplex, "numerator", nucomp_numerator, 0);
rb_define_method(rb_cComplex, "denominator", nucomp_denominator, 0);
@@ -2390,15 +2163,8 @@ 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);
- /* :nodoc: */
- compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject);
+ compat = rb_define_class_under(rb_cComplex, "compatible", rb_cObject); /* :nodoc: */
rb_define_private_method(compat, "marshal_load", nucomp_marshal_load, 1);
rb_marshal_define_compat(rb_cComplex, compat, nucomp_dumper, nucomp_loader);
@@ -2441,9 +2207,11 @@ Init_Complex(void)
rb_define_const(rb_cComplex, "I",
f_complex_new_bang2(rb_cComplex, ZERO, ONE));
-#if !USE_FLONUM
- rb_gc_register_mark_object(RFLOAT_0 = DBL2NUM(0.0));
-#endif
-
rb_provide("complex.so"); /* for backward compatibility */
}
+
+/*
+Local variables:
+c-file-style: "ruby"
+End:
+*/
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index f1ed36bb96..0000000000
--- a/configure.ac
+++ /dev/null
@@ -1,4089 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
-{
-AC_CONFIG_AUX_DIR(tool)
-AC_CONFIG_MACRO_DIRS(tool/m4)
-
-AC_PREREQ(2.67)
-
-dnl override AC_CHECKING
-dnl placed here due to aclocal(1)'s
-dnl ignoring this definition in separate files
-AC_DEFUN([AC_CHECKING],[dnl
-AC_REQUIRE([_COLORIZE_RESULT_PREPARE])dnl
-AS_MESSAGE([checking ${msg_checking}$1${msg_reset}...])])dnl
-
-AC_DISABLE_OPTION_CHECKING
-
-AC_ARG_VAR([cflags], [additional CFLAGS (ignored when CFLAGS is given)])
-AC_ARG_VAR([cppflags], [additional CPPFLAGS (ignored when CPPFLAGS is given)])
-AC_ARG_VAR([cxxflags], [additional CXXFLAGS (ignored when CXXFLAGS is given)])
-
-: "environment section" && {
-HAVE_BASERUBY=yes
-BASERUBY_VERSION=
-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_VERSION=`$BASERUBY -v`
- ])
- $BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub >&AS_MESSAGE_FD
-], [
- 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)
-
-eval `sed -n -e ['s/^@%:@define RUBY_[A-Z_]*VERSION_\([A-Z][A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)$/\1=\2/p'] \
- -e ['s/^@%:@define \(RUBY_PATCHLEVEL\) \(.*\)/\1=\2/p'] \
- $srcdir/include/ruby/version.h $srcdir/version.h`
-for v in MAJOR MINOR TEENY; do
- AS_IF([eval "test \"\$$v\" = ''"], [
- AC_MSG_ERROR(could not determine $v number from version.h)
- ])
-done
-AC_SUBST(MAJOR)
-AC_SUBST(MINOR)
-AC_SUBST(TEENY)
-AC_SUBST(RUBY_API_VERSION, '$(MAJOR).$(MINOR)')
-AC_SUBST(RUBY_PROGRAM_VERSION, '$(MAJOR).$(MINOR).$(TEENY)')
-
-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_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_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}'
-])
-dnl AS_IF([test -z "${CXXFLAGS+set}"], [
-dnl cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
-dnl orig_cxxflags="$cxxflags"
-dnl cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
-dnl ])
-
-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])
- ])],
-[openbsd*:openbsd*], [
- AC_CHECK_TOOLS(CC, [cc])
-])
-AS_IF([test x"${build}" != x"${host}"], [
- AC_CHECK_TOOL(CC, gcc)
-])
-
-AC_PROG_CC_C99
-AS_CASE([$CC],
-[gcc-*], [
- gcc_prefix=gcc- gcc_suffix=`echo "$CC" | sed 's/^gcc//'`
- AC_PROG_CXX(g++${gcc_suffix})],
-[clang-*|clang], [
- gcc_prefix=clang- gcc_suffix=`echo "$CC" | sed 's/^clang//'`
- AC_PROG_CXX(clang++${gcc_suffix})],
-[gcc_prefix= gcc_suffix=])
-
-dnl Select the appropriate C++ compiler in OS X
-AS_CASE(["$build_os:${CXX}"],
- [darwin1*.*:], [
- AC_MSG_CHECKING([CXX for $CC])
- AS_CASE(["/$CC "],
- [*@<:@\ /@:>@"gcc-4.2 "*], [pat='gcc-4\.2' CXX=g++-4.2],
- [*@<:@\ /@:>@"gcc "*], [pat=gcc CXX=g++],
- [*@<:@\ /@:>@"cc "*], [pat=cc CXX=c++],
- [*@<:@\ /@:>@"icc "*], [pat=icc CXX=icpc],
- [*@<:@\ /@:>@"clang "*], [pat=clang CXX=clang++])
- AS_IF([test "${CXX}"], [
- CXX=`echo "/$CC " | sed ["s:\([ /]\)${pat}:\1$CXX:; s:^/::; s: *$::"]`
- ])
- AC_MSG_RESULT([$CXX])],
- [openbsd*:*], [
- AC_CHECK_TOOLS(CXX, [c++])
- ])
-test -z "$CXX" || ac_cv_prog_CXX="$CXX"
-
-AS_CASE(["$target_os"],
-[darwin*], [
- AC_MSG_CHECKING(if minimum required OS X version is supported)
- AC_TRY_CPP([@%:@include <AvailabilityMacros.h>
- @%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5
- @%:@error pre OS X 10.5
- [!<===== pre OS X 10.5 =====>]
- @%:@endif
- ],
- [macosx_min_required=yes],
- [AC_MSG_RESULT(no)
- AC_MSG_ERROR([Unsupported OS X version is required])])
- AC_MSG_RESULT(${macosx_min_required})
-])
-
-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
- icc_version=`echo =__ICC | $CC -E -xc - | sed '/^=/!d;s///;/^__ICC/d'`
- test -n "$icc_version" || icc_version=0
- # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
-], [
- linker_flag=
-])
-
-AS_IF([test "$GCC" = yes -a "$gcc_major" -lt 3 ], [
- AC_MSG_ERROR([too old GCC])
-])
-
-RUBY_PROG_GNU_LD
-RUBY_CPPOUTFILE
-
-: ${OUTFLAG='-o '}
-: ${COUTFLAG=${OUTFLAG}}
-: ${CSRCFLAG=''}
-AC_SUBST(OUTFLAG)
-AC_SUBST(COUTFLAG)
-AC_SUBST(CSRCFLAG)
-
-: ${MJIT_CC=$CC}
-AS_IF([test "x$cross_compiling" = xno], [
- AC_PATH_PROG([MJIT_CC], ${MJIT_CC})
- AS_CASE([$target_os],
- [*mingw*], [command -v cygpath > /dev/null && MJIT_CC=`cygpath -ma $MJIT_CC`])
- shift 2
- MJIT_CC="$MJIT_CC${1+ }$*"
-])
-
-AS_CASE(["$build_os"],
- [darwin1*.*], [
- # Xcode linker warns for deprecated architecture and wrongly
- # installed TBD files.
- CC_WRAPPER=""
- echo 'int main(void) {return 0;}' > conftest.c
- AS_IF([$CC -framework Foundation -o conftest conftest.c 2>&1 |
- grep '^ld: warning: text-based stub file' >/dev/null], [
- CC_WRAPPER=`cd -P "$srcdir/tool" && pwd`/darwin-cc
- CC="$CC_WRAPPER $CC"
- ])
- rm -fr conftest*
- ])
-
-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)
-
-: ${DLDFLAGS="$LDFLAGS"}
-
-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_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_TOOLS(RANLIB, [${gcc_prefix}ranlib${gcc_suffix} ranlib], :)
-AC_CHECK_TOOLS(AR, [${gcc_prefix}ar${gcc_suffix} 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_TOOLS(NM, [${gcc_prefix}nm${gcc_suffix} 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_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" && {
-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
-])
-
-: ${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_CASE(["$GCC:${warnflags+set}:${extra_warnflags:+set}:"],
-[yes::*|yes:*:set:], [# GCC && (!warnflags || extra_warnflags)
- AS_IF([test $gcc_major -ge 4], [
- extra_warnflags="$extra_warnflags -Werror=extra-tokens"
- ])
- AS_IF([test $gcc_major -ge 5 -a $gcc_major -le 6], [
- extra_warnflags="$extra_warnflags -Wno-maybe-uninitialized"
- ])
- # ICC doesn't support -Werror=
- AS_IF([test $icc_version -gt 0], [
- particular_werror_flags=no
- ])
- for wflag in \
- -Werror=deprecated-declarations \
- -Werror=division-by-zero \
- -Werror=duplicated-cond \
- -Werror=implicit-function-declaration \
- -Werror=implicit-int \
- -Werror=misleading-indentation \
- -Werror=pointer-arith \
- -Werror=shorten-64-to-32 \
- -Werror=write-strings \
- -Wimplicit-fallthrough=0 \
- -Wmissing-noreturn \
- -Wno-cast-function-type \
- -Wno-constant-logical-operand \
- -Wno-long-long \
- -Wno-missing-field-initializers \
- -Wno-overlength-strings \
- -Wno-packed-bitfield-compat \
- -Wno-parentheses-equality \
- -Wno-self-assign \
- -Wno-tautological-compare \
- -Wno-unused-parameter \
- -Wno-unused-value \
- -Wsuggest-attribute=format \
- -Wsuggest-attribute=noreturn \
- -Wunused-variable \
- -diag-disable=175,188,2259 \
- $extra_warnflags \
- ; 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)])
-
-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.
-
- # TODO: check if link succeeds with _FORTIFY_SOURCE=2.
- AS_CASE(["$target_os"],
- [mingw*], [
- fortify_source=no
- ])
- AC_ARG_ENABLE(fortify_source,
- AS_HELP_STRING([--disable-fortify-source],
- [disable -D_FORTIFY_SOURCE=2 option, which causes link error on mingw]),
- [fortify_source=$enableval])
- AS_IF([test "x$fortify_source" != xno], [
- RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
- ])
-
- : ${MJIT_HEADER_FLAGS='-P -dD'}
-
- # -fstack-protector
- AS_CASE(["$target_os"],
- [mingw*], [
- stack_protector=no
- ])
- AS_IF([test -z "${stack_protector+set}"], [
- AS_FOR(option, opt, [-fstack-protector-strong -fstack-protector], [
- RUBY_TRY_CFLAGS(option, [stack_protector=yes])
- AS_IF([test "x$stack_protector" = xyes], [
- RUBY_TRY_LDFLAGS(option, [], [stack_protector=])
- ])
- AS_IF([test "x$stack_protector" = xyes], [stack_protector=option; break])
- ])
- ])
- AS_CASE(["$stack_protector"], [-*], [
- RUBY_APPEND_OPTION(XCFLAGS, $stack_protector)
- RUBY_APPEND_OPTION(XLDFLAGS, $stack_protector)
- RUBY_APPEND_OPTION(LDFLAGS, $stack_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 declares 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)
- AS_CASE(["$target_os"],
- [solaris*], [
- # Because "-std=gnu99" affects existence of functions on Solaris,
- # "-std=gnu99" will be appended to CPPFLAGS.
- for ansi_options in -std=gnu99; do
- RUBY_TRY_CFLAGS(${ansi_options}, [
- RUBY_APPEND_OPTIONS(CPPFLAGS, ${ansi_options})
- ], [ansi_options=])
- test "x${ansi_options}" = x || break
- done
- ],
- [
- # ANSI (no XCFLAGS because this is C only)
- rb_tmp_std_check=`echo $CC $CFLAGS $optflags $warnflags $debugflags | fgrep std= | tr -d '\015'`
- AS_IF([test "x$rb_tmp_std_check" = "x"],
- [
- 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
-])
-
-AS_CASE(["$target_cpu"], [[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],
- [
- save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486"
- AC_TRY_LINK([unsigned long atomic_var;],
- [__sync_val_compare_and_swap(&atomic_var, 0, 1);],
- [rb_cv_gcc_compiler_cas=i486],
- [rb_cv_gcc_compiler_cas=no])
- CFLAGS="$save_CFLAGS"
- ])
- ])
- AS_IF([test "$rb_cv_gcc_compiler_cas" = i486], [ARCH_FLAG="-march=i486"])
-])
-
-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\""
-}
-
-AC_CACHE_CHECK([whether compiler has statement and declarations in expressions],
- rb_cv_have_stmt_and_decl_in_expr,
- [AC_TRY_COMPILE([],[ __extension__ ({ int a = 0; a; }); ],
- [rb_cv_have_stmt_and_decl_in_expr=yes],
- [rb_cv_have_stmt_and_decl_in_expr=no])])
-AS_IF([test "$rb_cv_have_stmt_and_decl_in_expr" = yes], [
- AC_DEFINE(HAVE_STMT_AND_DECL_IN_EXPR)
-])
-
-: "header and library section" && {
-AC_ARG_WITH(winnt-ver,
- AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0600)]),
- [with_winnt_ver="$withval"], [with_winnt_ver="0x0600"])
-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])
-
-AS_UNSET(ORIG_LIBS)
-POSTLINK=:
-AC_SUBST(POSTLINK)
-AS_CASE(["$target_os"],
-[nextstep*], [ ],
-[openstep*], [ ],
-[rhapsody*], [ ],
-[darwin*], [
- ORIG_LIBS="$LIBS"
- RUBY_PREPEND_OPTION(LIBS, -lobjc)
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
- AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated,
- [RUBY_WERROR_FLAG([
- AC_TRY_COMPILE([@%:@include <unistd.h>],
- [if (syscall(0)) return 1;],
- [rb_cv_syscall_deprecated=no],
- [rb_cv_syscall_deprecated=yes])])])
- AS_IF([test $rb_cv_syscall_deprecated = yes], [
- ac_cv_func___syscall=no
- ac_cv_func_syscall=no
- ac_cv_header_sys_syscall_h=no
- ac_cv_header_syscall_h=no
- ])
- ac_cv_func_getcontext=no
- ac_cv_func_setcontext=no
- 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
- ])
- with_setjmp_type=sigsetjmp # to hijack SIGCHLD handler
- 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], [
- 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
- ])
- RUBY_WERROR_FLAG([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_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
- ac_cv_type_off_t=yes
- ac_cv_sizeof_off_t=8
- AS_IF([test "$target_cpu" = x64], [
- ac_cv_func___builtin_setjmp=yes
- ac_cv_func_round=no
- rb_cv_coroutine=yes
- ])
- 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"
- ],
-[aix*],[ LIBS="-lm $LIBS"
- ac_cv_func_round=no
- ac_cv_func___builtin_setjmp=no
- ],
-[linux*],[ LIBS="-lm $LIBS"
- # __builtin_longjmp in ppc64* Linux does not restore
- # the TOC register (r2), which is problematic
- # when a global exit happens from JITted .so code.
- AS_CASE(["$target_cpu"], [powerpc64*], [
- ac_cv_func___builtin_setjmp=no
- ])
- # With gcc-8's -fcf-protection, MJIT's __builtin_longjmp fails.
- AS_CASE(["$CC $CFLAGS "], [*" -fcf-protection "*], [cf_protection=yes], [cf_protection=no])
- AS_IF([test "$cf_protection" = yes], [
- ac_cv_func___builtin_setjmp=no
- ])
- ],
-[ LIBS="-lm $LIBS"])
-: ${ORIG_LIBS=$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(copyfile.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(sanitizer/asan_interface.h)
-AC_CHECK_HEADERS(sanitizer/msan_interface.h)
-AC_CHECK_HEADERS(setjmpex.h)
-AC_CHECK_HEADERS(stdalign.h)
-AC_CHECK_HEADERS(sys/attr.h)
-AC_CHECK_HEADERS(sys/eventfd.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" != xno],[
- AC_SEARCH_LIBS([malloc_conf], [jemalloc],
- [
- AC_DEFINE(HAVE_LIBJEMALLOC, 1)
- with_jemalloc=yes
- ],
- [test x$with_jemalloc = xyes && 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" != xyes], [
- 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_CASE(["$with_jemalloc"],
- [yes],
- [
- AC_DEFINE(HAVE_MALLOC_CONF)
- ac_cv_func_malloc_usable_size=yes
- ],
- [no],
- [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"],
- [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
-AC_C_RESTRICT
-
-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])
-
-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)
-])
-
-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)
-])
-
-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 short" "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, [@%:@ifdef HAVE_TIME_H
-@%:@ include <time.h>
-@%:@endif
-@%:@ifdef HAVE_SYS_TIME_H
-@%:@ include <sys/time.h>
-@%:@endif])
-
-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_MSG_ERROR([No string literal concatenation])
-])
-
-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_CACHE_CHECK([for alignas() syntax], rb_cv_have_alignas, [
-rb_cv_have_alignas=no
-RUBY_WERROR_FLAG([
-for attr in \
- "_Alignas(x)" \
- "alignas(x)" \
- "@<:@@<:@alignas(x)@:>@@:>@" \
- "__declspec(aligned(x))" \
- "__attribute__((__aligned__(x)))" \
-;
-do
- # C11 _Alignas and GCC __attribute__((__aligned__)) behave
- # slightly differently. What we want is GCC's. Check that
- # here by something C11 does not allow (`struct ALIGNAS ...`)
- AC_TRY_COMPILE(
- [@%:@define ALIGNAS(x) $attr
- struct ALIGNAS(128) conftest_tag { int foo; } foo; ], [],
- [rb_cv_have_alignas="$attr"; break], [])
-done
-])])
-AS_IF([test "$rb_cv_have_alignas" != no], [
- AC_DEFINE_UNQUOTED([RUBY_ALIGNAS(x)], $rb_cv_have_alignas)
-])
-
-AC_CACHE_CHECK([for alignof() syntax], rb_cv_have_alignof,[
-rb_cv_have_alignof=no
-RUBY_WERROR_FLAG([
-for expr in \
- "alignof" \
- "_Alignof" \
- "__alignof" \
- "__alignof__" \
-;
-do
- AC_TRY_COMPILE([
- @%:@ifdef HAVE_STDALIGN_H
- @%:@include <stdalign.h>
- @%:@endif],[return (int)$expr(int);],
- [rb_cv_have_alignof="$expr"; break], [])
-done
-])])
-AS_IF([test "$rb_cv_have_alignof" != no], [
- AC_DEFINE_UNQUOTED(RUBY_ALIGNOF, $rb_cv_have_alignof)
-])
-
-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(__no_sanitize__(san), NO_SANITIZE(san, x), rb_cv_func_no_sanitize)
-RUBY_FUNC_ATTRIBUTE(__no_sanitize_address__, NO_SANITIZE_ADDRESS)
-RUBY_FUNC_ATTRIBUTE(__no_address_safety_analysis__, NO_ADDRESS_SAFETY_ANALYSIS)
-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)
-])
-
-AC_CACHE_CHECK([for __attribute__((__depreacted__(msg))) in C++],
- rb_cv_CentOS6_CXX_workaround,
- RUBY_WERROR_FLAG([
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [],
- [__attribute__((__deprecated__("message"))) int conftest(...);])],
- [rb_cv_CentOS6_CXX_workaround=yes],
- [rb_cv_CentOS6_CXX_workaround=no])
- AC_LANG_POP()]))
-AS_IF([test "$rb_cv_CentOS6_CXX_workaround" != no],[
- AC_DEFINE([RUBY_CXX_DEPRECATED(msg)],
- [__attribute__((__deprecated__(msg)))])])
-
-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_DECL_ATTRIBUTE([__nonnull__(n)], [RUBY_FUNC_NONNULL(n,x)], [rb_cv_func_nonnull],
- [], [function], [
-@%:@define x int conftest_attribute_check(void *p)
-@%:@define n 1
-])
-
-RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
-
-AC_ARG_ENABLE(mathn,
- AS_HELP_STRING([--disable-mathn], [disable canonicalization for mathn]),
- [mathn=$enableval], [mathn=yes])
-test "x$mathn" = xyes || mathn=
-AC_SUBST(MATHN, $mathn)
-
-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])
-AS_IF([test "x$ac_cv_member_struct_stat_st_birthtimespec" != xyes],
- [AC_CHECK_MEMBERS([struct statx.stx_btime])])
-
-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_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)
-])
-
-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)
-AS_IF([test "x$rb_cv_type_intptr_t" != xno], [
- RUBY_CHECK_PRINTF_PREFIX(intptr_t, '' ll I64 l, PTR)
-])
-RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
-AS_IF([test "x$rb_cv_type_int64_t" != xno], [
- RUBY_CHECK_PRINTF_PREFIX(int64_t, ll I64 l, 64)
-])
-
-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)
-])
-
-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
-
-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(flock)
-AC_REPLACE_FUNCS(hypot)
-AC_REPLACE_FUNCS(lgamma_r)
-AC_REPLACE_FUNCS(memmove)
-AC_REPLACE_FUNCS(nan)
-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)
-
-RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>])
-RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>])
-RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>])
-
-# 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_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(copy_file_range)
-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(eventfd)
-AC_CHECK_FUNCS(explicit_memset)
-AC_CHECK_FUNCS(fcopyfile)
-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(getrandom)
-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(grantpt)
-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(realpath)
-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 "x$ac_cv_member_struct_statx_stx_btime" = xyes],
- [AC_CHECK_FUNCS(statx)])
-
-AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_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>])])])
-
-RUBY_CHECK_BUILTIN_FUNC(__builtin_alloca_with_align, [__builtin_alloca_with_align(1, 4096)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_assume_aligned, [__builtin_assume_aligned((void*)32, 32)])
-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)])
-RUBY_CHECK_BUILTIN_FUNC(__builtin_trap, [__builtin_trap()])
-
-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_CHECK_LIB([rt], [timer_create])
-AC_CHECK_LIB([rt], [timer_settime])
-AS_IF([test x"$ac_cv_lib_rt_timer_create" = xyes], [
- AC_DEFINE(HAVE_TIMER_CREATE, 1)
-])
-AS_IF([test x"$ac_cv_lib_rt_timer_settime" = xyes], [
- AC_DEFINE(HAVE_TIMER_SETTIME, 1)
-])
-
-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)
-])
-
-# 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>
-])])
-])
-
-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_CASE(["$ac_cv_func_gettimeofday:$ac_cv_func_clock_gettime"],
-[*yes*], [],
-[
- AC_MSG_ERROR(clock_gettime() or gettimeofday() must exist)
-])
-
-AS_IF([test "$ac_cv_func_sysconf" = yes], [
- RUBY_CHECK_SYSCONF(CLK_TCK)
-])
-
-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)
-])
-
-AC_ARG_WITH(coroutine,
- AS_HELP_STRING([--with-coroutine=IMPLEMENTATION], [specify the coroutine implementation to use]),
- [rb_cv_coroutine=$withval])
-AS_CASE([$rb_cv_coroutine], [yes|''], [
- AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os})
- AS_CASE(["$target_cpu-$target_os"],
- [x*64-darwin*], [
- rb_cv_coroutine=amd64
- ],
- [x*64-linux*], [
- AS_CASE(["$ac_cv_sizeof_voidp"],
- [8], [ rb_cv_coroutine=amd64 ],
- [4], [ rb_cv_coroutine=x86 ],
- [*], [ rb_cv_coroutine= ]
- )
- ],
- [*86-linux*], [
- rb_cv_coroutine=x86
- ],
- [x64-mingw32], [
- rb_cv_coroutine=win64
- ],
- [*86-mingw32], [
- rb_cv_coroutine=win32
- ],
- [armv7*-linux*], [
- rb_cv_coroutine=ucontext
- ],
- [aarch64-linux*], [
- rb_cv_coroutine=arm64
- ],
- [powerpc64le-linux*], [
- rb_cv_coroutine=ppc64le
- ],
- [x86_64-openbsd*], [
- rb_cv_coroutine=amd64
- ],
- [i386-openbsd*], [
- rb_cv_coroutine=x86
- ],
- [*-openbsd*], [
- rb_cv_coroutine=copy
- ],
- [*], [
- rb_cv_coroutine=ucontext
- ]
- )
- AC_MSG_RESULT(${rb_cv_coroutine})
-])
-COROUTINE_H=coroutine/$rb_cv_coroutine/Context.h
-AS_CASE([$rb_cv_coroutine],
- [copy|ucontext], [
- COROUTINE_SRC=coroutine/$rb_cv_coroutine/Context.c
- ],
- [*], [
- COROUTINE_SRC=coroutine/$rb_cv_coroutine/Context.'$(ASMEXT)'
- ],
-)
-AC_DEFINE_UNQUOTED(COROUTINE_H, ["$COROUTINE_H"])
-AC_SUBST(X_COROUTINE_H, [$COROUTINE_H])
-AC_SUBST(X_COROUTINE_SRC, [$COROUTINE_SRC])
-
-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_create,
- rb_with_pthread=yes, rb_with_pthread=no)
- AS_IF([test "$rb_with_pthread" = "yes"], [break])
- 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:$target_os"],
- [c:*], [],
- [root:*], [],
- [c_r:*|*: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_getguardsize \
- pthread_get_stackaddr_np pthread_get_stacksize_np \
- thr_stksegment pthread_stackseg_np pthread_getthrds_np \
- pthread_condattr_setclock \
- 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_IF([test "x$compress_debug_sections" = xzlib], [
- AC_CHECK_LIB([z], [uncompress])
- ])
- ])
-])
-
-AC_CHECK_HEADERS([mach-o/loader.h])
-AS_IF([test "$ac_cv_header_mach_o_loader_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(MJIT_HEADER_FLAGS)dnl
-AC_SUBST(MJIT_HEADER_INSTALL_DIR)dnl
-AC_SUBST(MJIT_CC)dnl
-AS_IF([test "$GCC" = "yes"], [
- AS_CASE(["$target_os"],[aix*],[mjit_std_cflag="-std=gnu99"])
-])
-AC_SUBST(MJIT_CFLAGS, [${MJIT_CFLAGS-"-w ${mjit_std_cflag} ${orig_cflags}"}])dnl
-AC_SUBST(MJIT_OPTFLAGS, [${MJIT_OPTFLAGS-'$(optflags)'}])dnl
-AC_SUBST(MJIT_DEBUGFLAGS, [${MJIT_DEBUGFLAGS-'$(debugflags)'}])dnl
-AC_SUBST(MJIT_LDSHARED)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'}
- : ${DLDSHARED='$(CC) -dynamiclib'}
- : ${LDFLAGS=""}
- : ${LIBPATHENV=DYLD_FALLBACK_LIBRARY_PATH}
- : ${PRELOADENV=DYLD_INSERT_LIBRARIES}
- rb_cv_dlopen=yes],
- [aix*], [ : ${LDSHARED='$(CC)'}
- AS_IF([test "$GCC" = yes], [
- LDSHARED="$LDSHARED ${linker_flag}-G -shared"
- ], [
- 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) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
- TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(LOCAL_LIBS) $(LIBS)'
- : ${LIBPATHENV=LIBPATH}
- : ${PRELOADENV=LDR_PRELOAD}
- 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([libproc.h])
- 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;
- struct sigaction sa;
-
- 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;
- }
- 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)'
-BOOTSTRAPRUBY='$(BASERUBY)'
-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)'
- TEST_RUNNABLE=no
- CROSS_COMPILING=yes
- AC_DEFINE(CROSS_COMPILING, 1)
-], [
- 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)'
- AS_CASE(["$HAVE_BASERUBY:$build_os"], [no:*|*:mingw*], [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}])
-
-FIRSTMAKEFILE=""
-LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
-LIBRUBY='$(LIBRUBY_A)'
-LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
-LIBRUBYARG='$(LIBRUBYARG_STATIC)'
-SOLIBS='$(MAINLIBS)'
-
-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)
- MJIT_HEADER_INSTALL_DIR=include/'${arch}/${RUBY_VERSION_NAME}'
-], [
- MJIT_HEADER_INSTALL_DIR=include/'${RUBY_VERSION_NAME}/${arch}'
-])
-
-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_API_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=${DLDSHARED=${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
-
- # 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*], [
- 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*], [
- 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*], [
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
- ],
- [solaris*], [
- 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)'
- RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ["${linker_flag}-h${linker_flag:+,}"'$(@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}'
- LIBS="$LIBS -lm -lc"
- ],
- [darwin*], [
- LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT)'
- LIBRUBY_SONAME='$(LIBRUBY_SO)'
- LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(SOEXT)'
- 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)'
- ],
- [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_WITH(rdoc,
- AS_HELP_STRING([--with-rdoc=ri,html], [comma/space separated list of RDoc formats to install]),
- [install_rdoc=`echo ,$withval, | sed 'y/,/ /;s/ ri / rdoc /;s/^ *//;s/ *$//'`], [
-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_CASE(["$install_rdoc"],
- [yes], [
- RDOCTARGET="rdoc"
- ],
- [all], [
- RDOCTARGET="rdoc html"
- ],
- [no|''], [
- RDOCTARGET="nodoc"
- ],
- [
- RDOCTARGET="$install_rdoc"
- ])
- 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(jit-support,
- AS_HELP_STRING([--disable-jit-support], [disable JIT features]),
- [MJIT_SUPPORT=$enableval
- AS_IF([test x"$enable_jit_support" = "xyes"],
- [AC_DEFINE(USE_MJIT, 1)],
- [AC_DEFINE(USE_MJIT, 0)])],
- [MJIT_SUPPORT=yes
- AC_DEFINE(USE_MJIT, 1)])
-
-AC_SUBST(MJIT_SUPPORT)
-
-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)
- AC_COMPILE_IFELSE([
- AC_LANG_BOOL_COMPILE_TRY([@%:@include <AvailabilityMacros.h>],
- [MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7])],
- [dnl
- RUBY_APPEND_OPTION(XLDFLAGS, [-framework Security])
- RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework Security])
- ]dnl
- )
- 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="${LIBRUBY_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
- 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]))
-])
-
-: ${MJIT_LDSHARED=`echo "$LDSHARED" | sed ['s|\$(LD)|'"${LD}"'|g;s|\$(CC)|$(MJIT_CC)|g']`}
-
-MAINLIBS="$LIBS"
-LIBS=$ORIG_LIBS
-AS_IF([test -n "${LIBS}"], [
- libspat=`echo "${LIBS}" | sed 's/[[][|.*$^]]/\\&/g;s/^ */ /;s/^ *$/ /'`
- MAINFLAGS=`echo " $MAINLIBS " | sed "s|$libspat"'||;s/^ *//;s/ *$//'`
-])
-LIBRUBYARG_STATIC="${LIBRUBYARG_STATIC} \$(MAINLIBS)"
-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"'||'`
-])
-rb_cv_warnflags=`echo "$rb_cv_warnflags" | sed 's/^ *//;s/ *$//'`
-warnflags="$rb_cv_warnflags"
-AC_SUBST(cppflags)dnl
-AC_SUBST(cflags, ["${orig_cflags:+$orig_cflags }"'${optflags} ${debugflags} ${warnflags}'])dnl
-AC_SUBST(cxxflags)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(DLDSHARED)
-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}__ &&! defined RUBY_PLATFORM_CPU], 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], [
- 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}" -
-) >&AS_MESSAGE_FD || 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_IF([test x"$CC_WRAPPER" != x], [
- CC='$(CC_WRAPPER) '"${CC@%:@$CC_WRAPPER }"
- CPP='$(CC_WRAPPER) '"${CPP@%:@$CC_WRAPPER }"
- CC_WRAPPER='$(rubyarchdir)/darwin-cc'
- XCC_WRAPPER='$(top_srcdir)/tool/darwin-cc'
-])
-AC_SUBST(CC_WRAPPER, '')
-AC_SUBST(XCC_WRAPPER)
-
-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:template/Makefile.in, [
- tmpmk=confmk$$.tmp
- {
- AS_IF([test ${VCS+set}], [
- :
- ], [git_dir=`$GIT --work-tree="$srcdir" --git-dir="$srcdir/.git" rev-parse --git-dir 2>/dev/null`], [
- VCS='$(GIT)'
- ], [
- VCS='echo cannot'
- ])
- AS_CASE("$VCS",
- ['$(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([test "$silent" = yes], [], [
-AS_IF([${FOLD+:} false], [], [
-AS_IF([test "`echo abcdefg hijklmno | fold -s -w10 | sed 1d`" = hijklmno], [FOLD="fold"], [FOLD=])
-])
-fold_width=`expr $COLUMNS - 30 2>/dev/null` || fold_width=50
-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 -w$fold_width |
- sed '1!s/^/ /;$!s/$/\\/'
- ], [echo "$2"])
- ])]
-)
-
-AS_IF([test $install_doc = yes],
- [DOCTARGETS=`echo " $RDOCTARGET $CAPITARGET " | sed 's/ nodoc //g;s/^ *//;s/ *$//'`],
- [DOCTARGETS=no])
-echo "---"
-echo "Configuration summary for $RUBY_BASE_NAME version $MAJOR.$MINOR.$TEENY"
-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 "with coroutine" "$rb_cv_coroutine"
-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 "DLDFLAGS" "$DLDFLAGS"
-config_summary "optflags" "$optflags"
-config_summary "debugflags" "$debugflags"
-config_summary "warnflags" "$warnflags"
-config_summary "strip command" "$STRIP"
-config_summary "install doc" "$DOCTARGETS"
-config_summary "JIT support" "$MJIT_SUPPORT"
-config_summary "man page type" "$MANTYPE"
-config_summary "search path" "$search_path"
-config_summary "static-linked-ext" ${EXTSTATIC:+"yes"}
-config_summary "BASERUBY -v" "$BASERUBY_VERSION"
-echo ""
-echo "---"
-])
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000000..0470d5cc0a
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,4340 @@
+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
+ $BASERUBY -C "$srcdir/tool" downloader.rb -e gnu config.guess config.sub
+ HAVE_BASERUBY=yes
+else
+ BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
+ HAVE_BASERUBY=no
+fi
+AC_SUBST(BASERUBY)
+AC_SUBST(HAVE_BASERUBY)
+
+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(["$target_cpu"],
+ [x86_64], [nacl_cv_cpu_nick=x86
+ nacl_cv_cpu_nick2=x86_64],
+ [i?86], [nacl_cv_cpu_nick=x86
+ nacl_cv_cpu_nick2=x86_32],
+ [le32], [nacl_cv_cpu_nick=pnacl
+ nacl_cv_cpu_nick2=pnacl
+ ac_cv_exeext=.pexe],
+ [nacl_cv_cpu_nick=$target_cpu])
+ AS_CASE(["$build_os"],
+ [linux*], [nacl_cv_os_nick=linux],
+ [darwin*], [nacl_cv_os_nick=mac],
+ [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 x"$nacl_cv_cpu_nick" = xpnacl; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_pnacl"
+ ac_tool_prefix=pnacl-
+ elif test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
+ elif test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"
+ else
+ AS_CASE(
+ ["${nacl_cv_build_variant}"],
+ [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_MSG_RESULT(${NACL_SDK_ROOT}/toolchain/${NACL_TOOLCHAIN}/bin)
+
+ RUBY_APPEND_OPTIONS(XCFLAGS, '-I$(NACL_SDK_ROOT)/include')
+ if test x"${nacl_cv_cpu_nick}" = xpnacl; then
+ RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/pnacl')
+ elif test x"${nacl_cv_build_variant}" = xnewlib; then
+ RUBY_APPEND_OPTIONS(XCFLAGS, '-isystem $(NACL_SDK_ROOT)/include/newlib')
+ fi
+
+ AC_MSG_CHECKING([nacl library path])
+ if test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}/Release"; then
+ nacl_cv_libpath="${nacl_cv_build_variant}_${nacl_cv_cpu_nick2}"
+ elif test -d "${NACL_SDK_ROOT}/lib/${nacl_cv_cpu_nick2}/Release"; then
+ nacl_cv_libpath="${nacl_cv_cpu_nick2}"
+ else
+ AC_MSG_ERROR([not found])
+ fi
+ AC_MSG_RESULT([${nacl_cv_libpath}])
+ RUBY_APPEND_OPTIONS(XLDFLAGS, '-L$(NACL_SDK_ROOT)/'"lib/${nacl_cv_libpath}/Release")
+
+ AC_SUBST(NACL_TOOLCHAIN)
+ AC_SUBST(NACL_SDK_ROOT)
+ AC_SUBST(NACL_SDK_VARIANT, "${nacl_cv_build_variant}")
+ AC_SUBST(NACL_LIB_PATH, "${nacl_cv_libpath}")
+ AC_CHECK_TOOLS(CC, [clang gcc])
+ AC_CHECK_TOOLS(CXX, [clang++ g++])
+])])
+
+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 " $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
+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, [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///'`
+ gcc_minor=`echo =__GNUC_MINOR__ | $CC -E -xc - | sed '/^=/!d;s///'`
+ test -n "$gcc_major" || gcc_major=0
+ test -n "$gcc_minor" || gcc_minor=0
+ # RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
+else
+ linker_flag=
+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 &&
+ cp -p conftest.o conftest.oo &&
+ $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null
+ }; then
+ rb_cv_prog_dtrace_g=yes
+ cmp -b conftest.o conftest.oo || rb_cv_prog_dtrace_g=rebuild
+ 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
+ # NaCl's glibc build generates undefined references to __memset_chk.
+ # TODO(sbc): Remove this once NaCl's glibc is fixed.
+ AS_CASE(["$target_os"], [nacl], [], [
+ # -D_FORTIFY_SOURCE
+ # When defined _FORTIFY_SOURCE, glibc enables some additional sanity
+ # argument check. The performance drop is very little and Ubuntu enables
+ # _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
+ # a mistake of silly C extensions.
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+ ])
+
+ # -fstack-protector
+ AS_CASE(["$target_os"],
+ [mingw*|nacl|haiku], [
+ 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*|nacl], [
+ # need lgamma_r(), finite()
+ ],
+ [haiku], [
+ # Haiku R1/alpha3 uses gcc-4.4.4 which can not handle anonymous union
+ # with ANSI standard flags. Anonumous union is required to compile
+ # socket extension where <net/if.h> uses anonymous union.
+ ],
+ [
+ # ANSI (no XCFLAGS because this is C only)
+ 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
+ if test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \); then
+ ac_cv_func___builtin_setjmp=no
+ fi
+ AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
+ [AC_TRY_RUN([
+#include <stdio.h>
+#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 <winsock2.h>
+ @%:@include <iphlpapi.h>])
+ if test x"$ac_cv_type_NET_LUID" = xyes; then
+ AC_DEFINE(HAVE_TYPE_NET_LUID, 1)
+ fi
+ AC_CHECK_FUNCS(_gmtime64_s)
+ AC_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
+ ],
+[aix*],[ LIBS="-lm $LIBS"
+ ac_cv_func_round=no
+ ],
+[nacl], [
+ LIBS="-lm $LIBS"
+ if test "${nacl_cv_build_variant}" = "newlib"; then
+ RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
+ else
+ RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
+ fi
+ ],
+[ 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/attr.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=$withval], [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
+ ])
+ 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_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],
+[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);
+ __atomic_or_fetch(&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);
+ __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])])
+ 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], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
+if test "$ac_cv_member_struct_stat_st_blocks" = yes; then
+ RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
+fi
+RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
+AC_CHECK_MEMBERS([struct stat.st_atim])
+AC_CHECK_MEMBERS([struct stat.st_atimespec])
+AC_CHECK_MEMBERS([struct stat.st_atimensec])
+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(fgetattrlist)
+AC_CHECK_FUNCS(fmod)
+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(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(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_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([int foo;], [$2;])],
+ [AS_TR_SH(rb_cv_builtin_$1)=yes],
+ [AS_TR_SH(rb_cv_builtin_$1)=no])])
+if test "${AS_TR_SH(rb_cv_builtin_$1)}" != no; then
+ 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_choose_expr_constant_p, [__builtin_choose_expr(__builtin_constant_p(foo), 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)])
+
+AS_IF([test "x$ac_cv_func_lgamma_r" = xyes], [
+ AC_CACHE_CHECK(whether lgamma_r handles -0.0, rb_cv_lgamma_r_m0, [
+ AC_TRY_RUN([
+@%:@include <math.h>
+@%:@ifdef HAVE_UNISTD_H
+@%:@include <unistd.h>
+@%:@endif
+@%:@ifndef EXIT_SUCCESS
+@%:@define EXIT_SUCCESS 0
+@%:@endif
+@%:@ifndef EXIT_FAILURE
+@%:@define EXIT_FAILURE 1
+@%:@endif
+
+int
+main(int argc, char **argv)
+{
+ int sign;
+ double x = lgamma_r(-0.0, &sign);
+
+ /* should be [+inf, -1] */
+ if (x <= 0) return EXIT_FAILURE;
+ if (!isinf(x)) return EXIT_FAILURE;
+ if (sign != -1) return EXIT_FAILURE;
+ return EXIT_SUCCESS;
+}
+],
+ [rb_cv_lgamma_r_m0=yes],
+ [rb_cv_lgamma_r_m0=no],
+ [rb_cv_lgamma_r_m0=yes]
+ )
+ ])
+ AS_IF([test "x$rb_cv_lgamma_r_m0" = xno], [AC_DEFINE(LGAMMA_R_M0_FIX)])
+])
+
+# Some platform need -lrt for clock_gettime, but the other don't.
+if test x"$ac_cv_func_clock_gettime" != xyes; then
+ # glibc 2.17 moves clock_* functions from librt to the main C library.
+ # 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
+
+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_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)
+ AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)])
+ if test "${host_os}" = "nacl"; then
+ ac_cv_func_pthread_attr_init=no
+ else
+ AC_CHECK_FUNCS(pthread_attr_init)
+ fi
+ 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
+ AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr],
+ [AC_TRY_COMPILE([@%:@include <ucontext.h>
+ mcontext_t test(mcontext_t mc) {return mc+1;}
+ ],
+ [test(0);],
+ [rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])])
+ if test x"$rb_cv_mcontext_t_ptr" = xyes; then
+ AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext)
+ else
+ AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->uc_mcontext)
+ fi
+ if test x"$rb_with_pthread" = xyes; then
+ AC_CHECK_FUNCS(getcontext setcontext)
+ fi
+fi
+
+if test "$ac_cv_func_fork_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 | tr -dc '\177ELF' | tr '\177' .`"],
+[.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
+rb_cv_binary_elf=no)])
+
+if test "$rb_cv_binary_elf" = yes; then
+ 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
+AC_SUBST(ASMEXT, S)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}`echo ${flag} | tr ' ' ,`"
+ 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])
+ if test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes; then
+ AC_CHECK_FUNCS(procstat_getvmmap)
+ fi
+ ])
+AS_CASE(["$target_cpu-$target_os"],
+[*-darwin*], [
+ AC_CHECK_HEADERS([execinfo.h])
+ if test "x$ac_cv_header_execinfo_h" = xyes; then
+ AC_CHECK_LIB([execinfo], [backtrace])
+ AC_CHECK_HEADERS([libunwind.h])
+ fi],
+[*-freebsd*|x86_64-netbsd*], [
+ AC_CHECK_HEADERS([execinfo.h])
+ 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)
+], [
+ 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])
+if test -n "$setup"; then
+ if ! test -f "ext/$setup" -o -f "$srcdir/ext/$setup"; then
+ AC_MSG_ERROR(Setup file $setup not found under ext or $srcdir/ext)
+ fi
+elif test -f "$srcdir/ext/Setup.$target_os"; then
+ setup="Setup.$target_os"
+else
+ setup=
+ 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)'
+DTRACE_REBUILD=
+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" != 'no'; then
+ DTRACE_OBJ='probes.$(OBJEXT)'
+ fi
+ if test "$rb_cv_prog_dtrace_g" = 'rebuild'; then
+ DTRACE_REBUILD=yes
+ LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
+ fi
+ AS_CASE("${target_os}", [freebsd*], [
+ # 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_REBUILD)
+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"])
+
+AS_CASE(["$with_jemalloc: $LIBS "], [no:* | *' -ljemalloc '*], [],
+ [LIBS="-ljemalloc $LIBS"])
+
+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}"
+ AS_CASE(["$arch"], [le32-nacl], [arch="pnacl"])
+ 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 3f1418df17..c7de5da533 100644
--- a/constant.h
+++ b/constant.h
@@ -12,39 +12,32 @@
#define CONSTANT_H
typedef enum {
- CONST_DEPRECATED = 0x100,
-
- CONST_VISIBILITY_MASK = 0xff,
CONST_PUBLIC = 0x00,
CONST_PRIVATE,
CONST_VISIBILITY_MAX
} rb_const_flag_t;
#define RB_CONST_PRIVATE_P(ce) \
- (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
+ ((ce)->flag == 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)
+ ((ce)->flag == CONST_PUBLIC)
typedef struct rb_const_entry_struct {
rb_const_flag_t flag;
int line;
- VALUE value; /* should be mark */
- VALUE file; /* should be mark */
+ const VALUE value; /* should be mark */
+ const VALUE file; /* should be mark */
} rb_const_entry_t;
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);
+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);
-VALUE rb_const_source_location(VALUE, ID);
-VALUE rb_const_source_location_at(VALUE, ID);
#endif /* CONSTANT_H */
diff --git a/cont.c b/cont.c
index 793bce018b..bfa37d1a87 100644
--- a/cont.c
+++ b/cont.c
@@ -13,924 +13,266 @@
#include "vm_core.h"
#include "gc.h"
#include "eval_intern.h"
-#include "mjit.h"
-#include COROUTINE_H
+/* FIBER_USE_NATIVE enables Fiber performance improvement using system
+ * dependent method such as make/setcontext on POSIX system or
+ * CreateFiber() API on Windows.
+ * This hack make Fiber context switch faster (x2 or more).
+ * However, it decrease maximum number of Fiber. For example, on the
+ * 32bit POSIX OS, ten or twenty thousands Fiber can be created.
+ *
+ * Details is reported in the paper "A Fast Fiber Implementation for Ruby 1.9"
+ * in Proc. of 51th Programming Symposium, pp.21--28 (2010) (in Japanese).
+ */
+
+#if !defined(FIBER_USE_NATIVE)
+# if defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT)
+# if 0
+# elif defined(__NetBSD__)
+/* On our experience, NetBSD doesn't support using setcontext() and pthread
+ * simultaneously. This is because pthread_self(), TLS and other information
+ * are represented by stack pointer (higher bits of stack pointer).
+ * TODO: check such constraint on configure.
+ */
+# define FIBER_USE_NATIVE 0
+# elif defined(__sun)
+/* On Solaris because resuming any Fiber caused SEGV, for some reason.
+ */
+# define FIBER_USE_NATIVE 0
+# elif defined(__ia64)
+/* At least, Linux/ia64's getcontext(3) doesn't save register window.
+ */
+# define FIBER_USE_NATIVE 0
+# elif defined(__GNU__)
+/* GNU/Hurd doesn't fully support getcontext, setcontext, makecontext
+ * and swapcontext functions. Disabling their usage till support is
+ * implemented. More info at
+ * http://darnassus.sceen.net/~hurd-web/open_issues/glibc/#getcontext
+ */
+# define FIBER_USE_NATIVE 0
+# else
+# define FIBER_USE_NATIVE 1
+# endif
+# elif defined(_WIN32)
+# 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)
+#define FIBER_USE_NATIVE 0
+#endif
+#if FIBER_USE_NATIVE
#ifndef _WIN32
#include <unistd.h>
#include <sys/mman.h>
+#include <ucontext.h>
#endif
-
-static const int DEBUG = 0;
-
#define RB_PAGE_SIZE (pagesize)
#define RB_PAGE_MASK (~(RB_PAGE_SIZE - 1))
static long pagesize;
-
-static const rb_data_type_t cont_data_type, fiber_data_type;
-static VALUE rb_cContinuation;
-static VALUE rb_cFiber;
-static VALUE rb_eFiberError;
-#ifdef RB_EXPERIMENTAL_FIBER_POOL
-static VALUE rb_cFiberPool;
-#endif
+#endif /*FIBER_USE_NATIVE*/
#define CAPTURE_JUST_VALID_VM_STACK 1
-// Defined in `coroutine/$arch/Context.h`:
-#ifdef COROUTINE_LIMITED_ADDRESS_SPACE
-#define FIBER_POOL_ALLOCATION_FREE
-#define FIBER_POOL_INITIAL_SIZE 8
-#define FIBER_POOL_ALLOCATION_MAXIMUM_SIZE 32
-#else
-#define FIBER_POOL_INITIAL_SIZE 32
-#define FIBER_POOL_ALLOCATION_MAXIMUM_SIZE 1024
-#endif
-
enum context_type {
CONTINUATION_CONTEXT = 0,
- FIBER_CONTEXT = 1
-};
-
-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
-};
-
-struct fiber_pool;
-
-// Represents a single stack.
-struct fiber_pool_stack {
- // A pointer to the memory allocation (lowest address) for the stack.
- void * base;
-
- // The current stack pointer, taking into account the direction of the stack.
- void * current;
-
- // The size of the stack excluding any guard pages.
- size_t size;
-
- // The available stack capacity w.r.t. the current stack offset.
- size_t available;
-
- // The pool this stack should be allocated from.
- struct fiber_pool * pool;
-
- // If the stack is allocated, the allocation it came from.
- struct fiber_pool_allocation * allocation;
-};
-
-// A linked list of vacant (unused) stacks.
-// This structure is stored in the first page of a stack if it is not in use.
-// @sa fiber_pool_vacancy_pointer
-struct fiber_pool_vacancy {
- // Details about the vacant stack:
- struct fiber_pool_stack stack;
-
- // The vacancy linked list.
-#ifdef FIBER_POOL_ALLOCATION_FREE
- struct fiber_pool_vacancy * previous;
-#endif
- struct fiber_pool_vacancy * next;
-};
-
-// Manages singly linked list of mapped regions of memory which contains 1 more more stack:
-//
-// base = +-------------------------------+-----------------------+ +
-// |VM Stack |VM Stack | | |
-// | | | | |
-// | | | | |
-// +-------------------------------+ | |
-// |Machine Stack |Machine Stack | | |
-// | | | | |
-// | | | | |
-// | | | . . . . | | size
-// | | | | |
-// | | | | |
-// | | | | |
-// | | | | |
-// | | | | |
-// +-------------------------------+ | |
-// |Guard Page |Guard Page | | |
-// +-------------------------------+-----------------------+ v
-//
-// +------------------------------------------------------->
-//
-// count
-//
-struct fiber_pool_allocation {
- // A pointer to the memory mapped region.
- void * base;
-
- // The size of the individual stacks.
- size_t size;
-
- // The stride of individual stacks (including any guard pages or other accounting details).
- size_t stride;
-
- // The number of stacks that were allocated.
- size_t count;
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
- // The number of stacks used in this allocation.
- size_t used;
-#endif
-
- struct fiber_pool * pool;
-
- // The allocation linked list.
-#ifdef FIBER_POOL_ALLOCATION_FREE
- struct fiber_pool_allocation * previous;
-#endif
- struct fiber_pool_allocation * next;
-};
-
-// A fiber pool manages vacant stacks to reduce the overhead of creating fibers.
-struct fiber_pool {
- // A singly-linked list of allocations which contain 1 or more stacks each.
- struct fiber_pool_allocation * allocations;
-
- // Provides O(1) stack "allocation":
- struct fiber_pool_vacancy * vacancies;
-
- // The size of the stack allocations (excluding any guard page).
- size_t size;
-
- // The total number of stacks that have been allocated in this pool.
- size_t count;
-
- // The initial number of stacks to allocate.
- size_t initial_count;
-
- // Whether to madvise(free) the stack or not:
- int free_stacks;
-
- // The number of stacks that have been used in this pool.
- size_t used;
-
- // The amount to allocate for the vm_stack:
- size_t vm_stack_size;
+ FIBER_CONTEXT = 1,
+ ROOT_FIBER_CONTEXT = 2
};
typedef struct rb_context_struct {
enum context_type type;
int argc;
- int kw_splat;
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;
- size_t stack_size;
+ VALUE *stack;
+ VALUE *stack_src;
+ size_t stack_size;
+#ifdef __ia64
+ VALUE *register_stack;
+ VALUE *register_stack_src;
+ int register_stack_size;
+#endif
} machine;
- rb_execution_context_t saved_ec;
+ rb_thread_t saved_thread; /* selected properties of GET_THREAD() (see cont_save_thread) */
rb_jmpbuf_t jmpbuf;
rb_ensure_entry_t *ensure_array;
- /* Pointer to MJIT info about the continuation. */
- struct mjit_cont *mjit_cont;
+ 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(fiber) ((fiber)->status == FIBER_CREATED)
-#define FIBER_RESUMED_P(fiber) ((fiber)->status == FIBER_RESUMED)
-#define FIBER_SUSPENDED_P(fiber) ((fiber)->status == FIBER_SUSPENDED)
-#define FIBER_TERMINATED_P(fiber) ((fiber)->status == FIBER_TERMINATED)
-#define FIBER_RUNNABLE_P(fiber) (FIBER_CREATED_P(fiber) || FIBER_SUSPENDED_P(fiber))
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+#define MAX_MACHINE_STACK_CACHE 10
+static int machine_stack_cache_index = 0;
+typedef struct machine_stack_cache_struct {
+ void *ptr;
+ size_t size;
+} machine_stack_cache_t;
+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 {
rb_context_t cont;
- VALUE first_proc;
struct rb_fiber_struct *prev;
- BITFIELD(enum fiber_status, status, 2);
- /* If a fiber invokes by "transfer",
- * then this fiber can't be invoked by "resume" any more after that.
+ 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".
*/
- unsigned int transferred : 1;
-
- struct coroutine_context context;
- struct fiber_pool_stack stack;
-};
-
-static struct fiber_pool shared_fiber_pool = {NULL, NULL, 0, 0, 0, 0};
-
-/*
- * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
- * if MAP_STACK is passed.
- * http://www.FreeBSD.org/cgi/query-pr.cgi?pr=158755
- */
-#if defined(MAP_STACK) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
-#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_STACK)
-#else
-#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON)
-#endif
-
-#define ERRNOMSG strerror(errno)
-
-// Locates the stack vacancy details for the given stack.
-// Requires that fiber_pool_vacancy fits within one page.
-inline static struct fiber_pool_vacancy *
-fiber_pool_vacancy_pointer(void * base, size_t size)
-{
- STACK_GROW_DIR_DETECTION;
-
- return (struct fiber_pool_vacancy *)(
- (char*)base + STACK_DIR_UPPER(0, size - RB_PAGE_SIZE)
- );
-}
-
-// Reset the current stack pointer and available size of the given stack.
-inline static void
-fiber_pool_stack_reset(struct fiber_pool_stack * stack)
-{
- STACK_GROW_DIR_DETECTION;
-
- stack->current = (char*)stack->base + STACK_DIR_UPPER(0, stack->size);
- stack->available = stack->size;
-}
-
-// A pointer to the base of the current unused portion of the stack.
-inline static void *
-fiber_pool_stack_base(struct fiber_pool_stack * stack)
-{
- STACK_GROW_DIR_DETECTION;
-
- VM_ASSERT(stack->current);
-
- return STACK_DIR_UPPER(stack->current, (char*)stack->current - stack->available);
-}
-
-// Allocate some memory from the stack. Used to allocate vm_stack inline with machine stack.
-// @sa fiber_initialize_coroutine
-inline static void *
-fiber_pool_stack_alloca(struct fiber_pool_stack * stack, size_t offset)
-{
- STACK_GROW_DIR_DETECTION;
-
- if (DEBUG) fprintf(stderr, "fiber_pool_stack_alloca(%p): %"PRIuSIZE"/%"PRIuSIZE"\n", (void*)stack, offset, stack->available);
- VM_ASSERT(stack->available >= offset);
-
- // The pointer to the memory being allocated:
- void * pointer = STACK_DIR_UPPER(stack->current, (char*)stack->current - offset);
-
- // Move the stack pointer:
- stack->current = STACK_DIR_UPPER((char*)stack->current + offset, (char*)stack->current - offset);
- stack->available -= offset;
-
- return pointer;
-}
-
-// Reset the current stack pointer and available size of the given stack.
-inline static void
-fiber_pool_vacancy_reset(struct fiber_pool_vacancy * vacancy)
-{
- fiber_pool_stack_reset(&vacancy->stack);
-
- // Consume one page of the stack because it's used for the vacancy list:
- fiber_pool_stack_alloca(&vacancy->stack, RB_PAGE_SIZE);
-}
-
-inline static struct fiber_pool_vacancy *
-fiber_pool_vacancy_push(struct fiber_pool_vacancy * vacancy, struct fiber_pool_vacancy * head)
-{
- vacancy->next = head;
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
- if (head) {
- head->previous = vacancy;
- }
-#endif
-
- return vacancy;
-}
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
-static void
-fiber_pool_vacancy_remove(struct fiber_pool_vacancy * vacancy)
-{
- if (vacancy->next) {
- vacancy->next->previous = vacancy->previous;
- }
-
- if (vacancy->previous) {
- vacancy->previous->next = vacancy->next;
- }
- else {
- // It's the head of the list:
- vacancy->stack.pool->vacancies = vacancy->next;
- }
-}
-
-inline static struct fiber_pool_vacancy *
-fiber_pool_vacancy_pop(struct fiber_pool * pool)
-{
- struct fiber_pool_vacancy * vacancy = pool->vacancies;
-
- if (vacancy) {
- fiber_pool_vacancy_remove(vacancy);
- }
-
- return vacancy;
-}
-#else
-inline static struct fiber_pool_vacancy *
-fiber_pool_vacancy_pop(struct fiber_pool * pool)
-{
- struct fiber_pool_vacancy * vacancy = pool->vacancies;
-
- if (vacancy) {
- pool->vacancies = vacancy->next;
- }
-
- return vacancy;
-}
-#endif
-
-// Initialize the vacant stack. The [base, size] allocation should not include the guard page.
-// @param base The pointer to the lowest address of the allocated memory.
-// @param size The size of the allocated memory.
-inline static struct fiber_pool_vacancy *
-fiber_pool_vacancy_initialize(struct fiber_pool * fiber_pool, struct fiber_pool_vacancy * vacancies, void * base, size_t size)
-{
- struct fiber_pool_vacancy * vacancy = fiber_pool_vacancy_pointer(base, size);
-
- vacancy->stack.base = base;
- vacancy->stack.size = size;
-
- fiber_pool_vacancy_reset(vacancy);
-
- vacancy->stack.pool = fiber_pool;
-
- return fiber_pool_vacancy_push(vacancy, vacancies);
-}
-
-// Allocate a maximum of count stacks, size given by stride.
-// @param count the number of stacks to allocate / were allocated.
-// @param stride the size of the individual stacks.
-// @return [void *] the allocated memory or NULL if allocation failed.
-inline static void *
-fiber_pool_allocate_memory(size_t * count, size_t stride)
-{
- // We use a divide-by-2 strategy to try and allocate memory. We are trying
- // to allocate `count` stacks. In normal situation, this won't fail. But
- // if we ran out of address space, or we are allocating more memory than
- // the system would allow (e.g. overcommit * physical memory + swap), we
- // divide count by two and try again. This condition should only be
- // encountered in edge cases, but we handle it here gracefully.
- while (*count > 1) {
-#if defined(_WIN32)
- void * base = VirtualAlloc(0, (*count)*stride, MEM_COMMIT, PAGE_READWRITE);
-
- if (!base) {
- *count = (*count) >> 1;
- }
- else {
- return base;
- }
-#else
- errno = 0;
- void * base = mmap(NULL, (*count)*stride, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
-
- if (base == MAP_FAILED) {
- // If the allocation fails, count = count / 2, and try again.
- *count = (*count) >> 1;
- }
- else {
- return base;
- }
-#endif
- }
-
- return NULL;
-}
-
-// Given an existing fiber pool, expand it by the specified number of stacks.
-// @param count the maximum number of stacks to allocate.
-// @return the allocated fiber pool.
-// @sa fiber_pool_allocation_free
-static struct fiber_pool_allocation *
-fiber_pool_expand(struct fiber_pool * fiber_pool, size_t count)
-{
- STACK_GROW_DIR_DETECTION;
-
- size_t size = fiber_pool->size;
- size_t stride = size + RB_PAGE_SIZE;
-
- // Allocate the memory required for the stacks:
- void * base = fiber_pool_allocate_memory(&count, stride);
-
- if (base == NULL) {
- rb_raise(rb_eFiberError, "can't alloc machine stack to fiber (%"PRIuSIZE" x %"PRIuSIZE" bytes): %s", count, size, ERRNOMSG);
- }
-
- struct fiber_pool_vacancy * vacancies = fiber_pool->vacancies;
- struct fiber_pool_allocation * allocation = RB_ALLOC(struct fiber_pool_allocation);
-
- // Initialize fiber pool allocation:
- allocation->base = base;
- allocation->size = size;
- allocation->stride = stride;
- allocation->count = count;
-#ifdef FIBER_POOL_ALLOCATION_FREE
- allocation->used = 0;
-#endif
- allocation->pool = fiber_pool;
-
- if (DEBUG) {
- fprintf(stderr, "fiber_pool_expand(%"PRIuSIZE"): %p, %"PRIuSIZE"/%"PRIuSIZE" x [%"PRIuSIZE":%"PRIuSIZE"]\n",
- count, (void*)fiber_pool, fiber_pool->used, fiber_pool->count, size, fiber_pool->vm_stack_size);
- }
-
- // Iterate over all stacks, initializing the vacancy list:
- for (size_t i = 0; i < count; i += 1) {
- void * base = (char*)allocation->base + (stride * i);
- void * page = (char*)base + STACK_DIR_UPPER(size, 0);
-
-#if defined(_WIN32)
- DWORD old_protect;
-
- if (!VirtualProtect(page, RB_PAGE_SIZE, PAGE_READWRITE | PAGE_GUARD, &old_protect)) {
- VirtualFree(allocation->base, 0, MEM_RELEASE);
- rb_raise(rb_eFiberError, "can't set a guard page: %s", ERRNOMSG);
- }
-#else
- if (mprotect(page, RB_PAGE_SIZE, PROT_NONE) < 0) {
- munmap(allocation->base, count*stride);
- rb_raise(rb_eFiberError, "can't set a guard page: %s", ERRNOMSG);
- }
-#endif
-
- vacancies = fiber_pool_vacancy_initialize(
- fiber_pool, vacancies,
- (char*)base + STACK_DIR_UPPER(0, RB_PAGE_SIZE),
- size
- );
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
- vacancies->stack.allocation = allocation;
-#endif
- }
-
- // Insert the allocation into the head of the pool:
- allocation->next = fiber_pool->allocations;
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
- if (allocation->next) {
- allocation->next->previous = allocation;
- }
-
- allocation->previous = NULL;
-#endif
-
- fiber_pool->allocations = allocation;
- fiber_pool->vacancies = vacancies;
- fiber_pool->count += count;
-
- return allocation;
-}
-
-// Initialize the specified fiber pool with the given number of stacks.
-// @param vm_stack_size The size of the vm stack to allocate.
-static void
-fiber_pool_initialize(struct fiber_pool * fiber_pool, size_t size, size_t count, size_t vm_stack_size)
-{
- VM_ASSERT(vm_stack_size < size);
-
- fiber_pool->allocations = NULL;
- fiber_pool->vacancies = NULL;
- fiber_pool->size = ((size / RB_PAGE_SIZE) + 1) * RB_PAGE_SIZE;
- fiber_pool->count = 0;
- fiber_pool->initial_count = count;
- fiber_pool->free_stacks = 1;
- fiber_pool->used = 0;
-
- fiber_pool->vm_stack_size = vm_stack_size;
-
- fiber_pool_expand(fiber_pool, count);
-}
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
-// Free the list of fiber pool allocations.
-static void
-fiber_pool_allocation_free(struct fiber_pool_allocation * allocation)
-{
- STACK_GROW_DIR_DETECTION;
-
- VM_ASSERT(allocation->used == 0);
-
- if (DEBUG) fprintf(stderr, "fiber_pool_allocation_free: %p base=%p count=%"PRIuSIZE"\n", allocation, allocation->base, allocation->count);
-
- size_t i;
- for (i = 0; i < allocation->count; i += 1) {
- void * base = (char*)allocation->base + (allocation->stride * i) + STACK_DIR_UPPER(0, RB_PAGE_SIZE);
-
- struct fiber_pool_vacancy * vacancy = fiber_pool_vacancy_pointer(base, allocation->size);
-
- // Pop the vacant stack off the free list:
- fiber_pool_vacancy_remove(vacancy);
- }
+ int transferred;
+#if FIBER_USE_NATIVE
#ifdef _WIN32
- VirtualFree(allocation->base, 0, MEM_RELEASE);
+ void *fib_handle;
#else
- munmap(allocation->base, allocation->stride * allocation->count);
-#endif
-
- if (allocation->previous) {
- allocation->previous->next = allocation->next;
- }
- else {
- // We are the head of the list, so update the pool:
- allocation->pool->allocations = allocation->next;
- }
-
- if (allocation->next) {
- allocation->next->previous = allocation->previous;
- }
-
- allocation->pool->count -= allocation->count;
-
- ruby_xfree(allocation);
-}
-#endif
-
-// Acquire a stack from the given fiber pool. If none are available, allocate more.
-static struct fiber_pool_stack
-fiber_pool_stack_acquire(struct fiber_pool * fiber_pool) {
- struct fiber_pool_vacancy * vacancy = fiber_pool_vacancy_pop(fiber_pool);
-
- if (DEBUG) fprintf(stderr, "fiber_pool_stack_acquire: %p used=%"PRIuSIZE"\n", (void*)fiber_pool->vacancies, fiber_pool->used);
-
- if (!vacancy) {
- const size_t maximum = FIBER_POOL_ALLOCATION_MAXIMUM_SIZE;
- const size_t minimum = fiber_pool->initial_count;
-
- size_t count = fiber_pool->count;
- if (count > maximum) count = maximum;
- if (count < minimum) count = minimum;
-
- fiber_pool_expand(fiber_pool, count);
-
- // The free list should now contain some stacks:
- VM_ASSERT(fiber_pool->vacancies);
-
- vacancy = fiber_pool_vacancy_pop(fiber_pool);
- }
-
- VM_ASSERT(vacancy);
- VM_ASSERT(vacancy->stack.base);
-
- // Take the top item from the free list:
- fiber_pool->used += 1;
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
- vacancy->stack.allocation->used += 1;
-#endif
-
- fiber_pool_stack_reset(&vacancy->stack);
-
- return vacancy->stack;
-}
-
-// We advise the operating system that the stack memory pages are no longer being used.
-// This introduce some performance overhead but allows system to relaim memory when there is pressure.
-static inline void
-fiber_pool_stack_free(struct fiber_pool_stack * stack)
-{
- void * base = fiber_pool_stack_base(stack);
- size_t size = stack->available;
-
- // If this is not true, the vacancy information will almost certainly be destroyed:
- VM_ASSERT(size <= (stack->size - RB_PAGE_SIZE));
-
- if (DEBUG) fprintf(stderr, "fiber_pool_stack_free: %p+%"PRIuSIZE" [base=%p, size=%"PRIuSIZE"]\n", base, size, stack->base, stack->size);
-
-#if VM_CHECK_MODE > 0 && defined(MADV_DONTNEED)
- // This immediately discards the pages and the memory is reset to zero.
- madvise(base, size, MADV_DONTNEED);
-#elif defined(MADV_FREE_REUSABLE)
- madvise(base, size, MADV_FREE_REUSABLE);
-#elif defined(MADV_FREE)
- madvise(base, size, MADV_FREE);
-#elif defined(MADV_DONTNEED)
- madvise(base, size, MADV_DONTNEED);
-#elif defined(_WIN32)
- VirtualAlloc(base, size, MEM_RESET, PAGE_READWRITE);
- // Not available in all versions of Windows.
- //DiscardVirtualMemory(base, size);
-#endif
-}
-
-// Release and return a stack to the vacancy list.
-static void
-fiber_pool_stack_release(struct fiber_pool_stack * stack)
-{
- struct fiber_pool * pool = stack->pool;
- struct fiber_pool_vacancy * vacancy = fiber_pool_vacancy_pointer(stack->base, stack->size);
-
- if (DEBUG) fprintf(stderr, "fiber_pool_stack_release: %p used=%"PRIuSIZE"\n", stack->base, stack->pool->used);
-
- // Copy the stack details into the vacancy area:
- vacancy->stack = *stack;
- // After this point, be careful about updating/using state in stack, since it's copied to the vacancy area.
-
- // Reset the stack pointers and reserve space for the vacancy data:
- fiber_pool_vacancy_reset(vacancy);
-
- // Push the vacancy into the vancancies list:
- pool->vacancies = fiber_pool_vacancy_push(vacancy, stack->pool->vacancies);
- pool->used -= 1;
-
-#ifdef FIBER_POOL_ALLOCATION_FREE
- struct fiber_pool_allocation * allocation = stack->allocation;
-
- allocation->used -= 1;
-
- // Release address space and/or dirty memory:
- if (allocation->used == 0) {
- fiber_pool_allocation_free(allocation);
- }
- else if (stack->pool->free_stacks) {
- fiber_pool_stack_free(&vacancy->stack);
- }
-#else
- // This is entirely optional, but clears the dirty flag from the stack memory, so it won't get swapped to disk when there is memory pressure:
- if (stack->pool->free_stacks) {
- fiber_pool_stack_free(&vacancy->stack);
- }
+ ucontext_t context;
+ /* Because context.uc_stack.ss_sp and context.uc_stack.ss_size
+ * are not necessarily valid after makecontext() or swapcontext(),
+ * they are saved in these variables for later use.
+ */
+ void *ss_sp;
+ size_t ss_size;
#endif
-}
-
-static COROUTINE
-fiber_entry(struct coroutine_context * from, struct coroutine_context * to)
-{
- rb_fiber_start();
-}
-
-// Initialize a fiber's coroutine's machine stack and vm stack.
-static VALUE *
-fiber_initialize_coroutine(rb_fiber_t *fiber, size_t * vm_stack_size)
-{
- struct fiber_pool * fiber_pool = fiber->stack.pool;
- rb_execution_context_t *sec = &fiber->cont.saved_ec;
- void * vm_stack = NULL;
-
- VM_ASSERT(fiber_pool != NULL);
-
- fiber->stack = fiber_pool_stack_acquire(fiber_pool);
- vm_stack = fiber_pool_stack_alloca(&fiber->stack, fiber_pool->vm_stack_size);
- *vm_stack_size = fiber_pool->vm_stack_size;
-
-#ifdef COROUTINE_PRIVATE_STACK
- coroutine_initialize(&fiber->context, fiber_entry, fiber_pool_stack_base(&fiber->stack), fiber->stack.available, sec->machine.stack_start);
- // The stack for this execution context is still the main machine stack, so don't adjust it.
- // If this is not managed correctly, you will fail in `rb_ec_stack_check`.
-
- // We limit the machine stack usage to the fiber stack size.
- if (sec->machine.stack_maxsize > fiber->stack.available) {
- sec->machine.stack_maxsize = fiber->stack.available;
- }
-#else
- coroutine_initialize(&fiber->context, fiber_entry, fiber_pool_stack_base(&fiber->stack), fiber->stack.available);
-
- // The stack for this execution context is the one we allocated:
- sec->machine.stack_start = fiber->stack.current;
- sec->machine.stack_maxsize = fiber->stack.available;
#endif
+};
- return vm_stack;
-}
-
-// Release the stack from the fiber, it's execution context, and return it to the fiber pool.
-static void
-fiber_stack_release(rb_fiber_t * fiber)
-{
- rb_execution_context_t *ec = &fiber->cont.saved_ec;
-
- if (DEBUG) fprintf(stderr, "fiber_stack_release: %p, stack.base=%p\n", (void*)fiber, fiber->stack.base);
-
- // Return the stack back to the fiber pool if it wasn't already:
- if (fiber->stack.base) {
- fiber_pool_stack_release(&fiber->stack);
- fiber->stack.base = NULL;
- }
-
- // The stack is no longer associated with this execution context:
- rb_ec_clear_vm_stack(ec);
-}
-
-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 *fiber)
-{
-#if VM_CHECK_MODE > 0
- VM_ASSERT(fiber->cont.saved_ec.fiber_ptr == fiber);
-
- switch (fiber->status) {
- case FIBER_RESUMED:
- VM_ASSERT(fiber->cont.saved_ec.vm_stack != NULL);
- break;
- case FIBER_SUSPENDED:
- VM_ASSERT(fiber->cont.saved_ec.vm_stack != NULL);
- break;
- case FIBER_CREATED:
- case FIBER_TERMINATED:
- /* TODO */
- break;
- default:
- VM_UNREACHABLE(fiber_verify);
- }
-#endif
-}
-
-inline static void
-fiber_status_set(rb_fiber_t *fiber, enum fiber_status s)
-{
- // if (DEBUG) fprintf(stderr, "fiber: %p, status: %s -> %s\n", (void *)fiber, fiber_status_name(fiber->status), fiber_status_name(s));
- VM_ASSERT(!FIBER_TERMINATED_P(fiber));
- VM_ASSERT(fiber->status != s);
- fiber_verify(fiber);
- fiber->status = s;
-}
-
-static inline void
-ec_switch(rb_thread_t *th, rb_fiber_t *fiber)
-{
- rb_execution_context_t *ec = &fiber->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);
-}
-
-static rb_context_t *
-cont_ptr(VALUE obj)
-{
- rb_context_t *cont;
-
- TypedData_Get_Struct(obj, rb_context_t, &cont_data_type, cont);
-
- return cont;
-}
-
-static rb_fiber_t *
-fiber_ptr(VALUE obj)
-{
- rb_fiber_t *fiber;
+static const rb_data_type_t cont_data_type, fiber_data_type;
+static VALUE rb_cContinuation;
+static VALUE rb_cFiber;
+static VALUE rb_eFiberError;
- TypedData_Get_Struct(obj, rb_fiber_t, &fiber_data_type, fiber);
- if (!fiber) rb_raise(rb_eFiberError, "uninitialized fiber");
+#define GetContPtr(obj, ptr) \
+ TypedData_Get_Struct((obj), rb_context_t, &cont_data_type, (ptr))
- return fiber;
-}
+#define GetFiberPtr(obj, ptr) do {\
+ TypedData_Get_Struct((obj), rb_fiber_t, &fiber_data_type, (ptr)); \
+ 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_compact(void *ptr)
-{
- rb_context_t *cont = ptr;
-
- if (cont->self) {
- cont->self = rb_gc_location(cont->self);
- }
- cont->value = rb_gc_location(cont->value);
- rb_execution_context_update(&cont->saved_ec);
-}
-
static void
cont_mark(void *ptr)
{
- rb_context_t *cont = ptr;
-
RUBY_MARK_ENTER("cont");
- if (cont->self) {
- rb_gc_mark_movable(cont->self);
- }
- rb_gc_mark_movable(cont->value);
+ 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);
- rb_execution_context_mark(&cont->saved_ec);
- rb_gc_mark(cont_thread_value(cont));
-
- 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 *fiber = (rb_fiber_t*)cont;
-
- if (!FIBER_TERMINATED_P(fiber)) {
- rb_gc_mark_locations(cont->machine.stack,
- cont->machine.stack + cont->machine.stack_size);
+ 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 != fib) && fib->status == RUNNING) {
+ rb_gc_mark_locations(cont->machine.stack,
+ cont->machine.stack + cont->machine.stack_size);
+ }
+ }
+ }
+#ifdef __ia64
+ if (cont->machine.register_stack) {
+ rb_gc_mark_locations(cont->machine.register_stack,
+ cont->machine.register_stack + cont->machine.register_stack_size);
+ }
+#endif
}
-
RUBY_MARK_LEAVE("cont");
}
-static int
-fiber_is_root_p(const rb_fiber_t *fiber)
-{
- return fiber == fiber->cont.saved_ec.thread_ptr->root_fiber;
-}
-
static void
cont_free(void *ptr)
{
- rb_context_t *cont = ptr;
-
RUBY_FREE_ENTER("cont");
+ 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 */
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+#ifdef _WIN32
+ if (GET_THREAD()->fiber != fib && cont->type != ROOT_FIBER_CONTEXT) {
+ /* don't delete root fiber handle */
+ rb_fiber_t *fib = (rb_fiber_t*)cont;
+ if (fib->fib_handle) {
+ DeleteFiber(fib->fib_handle);
+ }
+ }
+#else /* not WIN32 */
+ if (GET_THREAD()->fiber != fib) {
+ 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);
+ }
+ }
+ 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);
+#endif
+#ifdef __ia64
+ RUBY_FREE_UNLESS_NULL(cont->machine.register_stack);
+#endif
+ RUBY_FREE_UNLESS_NULL(cont->vm_stack);
- if (cont->type == CONTINUATION_CONTEXT) {
- ruby_xfree(cont->saved_ec.vm_stack);
- ruby_xfree(cont->ensure_array);
- RUBY_FREE_UNLESS_NULL(cont->machine.stack);
- }
- else {
- rb_fiber_t *fiber = (rb_fiber_t*)cont;
- coroutine_destroy(&fiber->context);
- if (!fiber_is_root_p(fiber)) {
- fiber_stack_release(fiber);
- }
- }
-
- RUBY_FREE_UNLESS_NULL(cont->saved_vm_stack.ptr);
-
- if (mjit_enabled && cont->mjit_cont != NULL) {
- mjit_cont_free(cont->mjit_cont);
+ /* 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");
}
@@ -939,101 +281,77 @@ 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->vm_stack);
+ }
+
+ if (cont->machine.stack) {
+ size += cont->machine.stack_size * sizeof(*cont->machine.stack);
+ }
+#ifdef __ia64
+ if (cont->machine.register_stack) {
+ size += cont->machine.register_stack_size * sizeof(*cont->machine.register_stack);
+ }
#endif
- size += n * sizeof(*cont->saved_vm_stack.ptr);
- }
-
- if (cont->machine.stack) {
- size += cont->machine.stack_size * sizeof(*cont->machine.stack);
}
-
return size;
}
void
-rb_fiber_update_self(rb_fiber_t *fiber)
-{
- if (fiber->cont.self) {
- fiber->cont.self = rb_gc_location(fiber->cont.self);
- }
- else {
- rb_execution_context_update(&fiber->cont.saved_ec);
- }
-}
-
-void
-rb_fiber_mark_self(const rb_fiber_t *fiber)
-{
- if (fiber->cont.self) {
- rb_gc_mark_movable(fiber->cont.self);
- }
- else {
- rb_execution_context_mark(&fiber->cont.saved_ec);
- }
-}
-
-static void
-fiber_compact(void *ptr)
+rb_fiber_mark_self(rb_fiber_t *fib)
{
- rb_fiber_t *fiber = ptr;
- fiber->first_proc = rb_gc_location(fiber->first_proc);
-
- if (fiber->prev) rb_fiber_update_self(fiber->prev);
-
- cont_compact(&fiber->cont);
- fiber_verify(fiber);
+ if (fib)
+ rb_gc_mark(fib->cont.self);
}
static void
fiber_mark(void *ptr)
{
- rb_fiber_t *fiber = ptr;
RUBY_MARK_ENTER("cont");
- fiber_verify(fiber);
- rb_gc_mark_movable(fiber->first_proc);
- if (fiber->prev) rb_fiber_mark_self(fiber->prev);
- cont_mark(&fiber->cont);
+ if (ptr) {
+ rb_fiber_t *fib = ptr;
+ rb_fiber_mark_self(fib->prev);
+ cont_mark(&fib->cont);
+ }
RUBY_MARK_LEAVE("cont");
}
static void
fiber_free(void *ptr)
{
- rb_fiber_t *fiber = 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);
+ }
- //if (DEBUG) fprintf(stderr, "fiber_free: %p[%p]\n", fiber, fiber->stack.base);
-
- if (fiber->cont.saved_ec.local_storage) {
- st_free_table(fiber->cont.saved_ec.local_storage);
+ cont_free(&fib->cont);
}
-
- cont_free(&fiber->cont);
RUBY_FREE_LEAVE("fiber");
}
static size_t
fiber_memsize(const void *ptr)
{
- const rb_fiber_t *fiber = ptr;
- size_t size = sizeof(*fiber);
- const rb_execution_context_t *saved_ec = &fiber->cont.saved_ec;
- const rb_thread_t *th = rb_ec_thread_ptr(saved_ec);
-
- /*
- * vm.c::thread_memsize already counts th->ec->local_storage
- */
- if (saved_ec->local_storage && fiber != th->root_fiber) {
- size += st_memsize(saved_ec->local_storage);
+ const rb_fiber_t *fib = ptr;
+ size_t size = 0;
+ if (ptr) {
+ size = sizeof(*fib);
+ if (fib->cont.type != ROOT_FIBER_CONTEXT &&
+ fib->cont.saved_thread.local_storage != NULL) {
+ size += st_memsize(fib->cont.saved_thread.local_storage);
+ }
+ size += cont_memsize(&fib->cont);
}
- size += cont_memsize(&fiber->cont);
return size;
}
@@ -1041,10 +359,10 @@ VALUE
rb_obj_is_fiber(VALUE obj)
{
if (rb_typeddata_is_kind_of(obj, &fiber_data_type)) {
- return Qtrue;
+ return Qtrue;
}
else {
- return Qfalse;
+ return Qfalse;
}
}
@@ -1053,47 +371,83 @@ 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) {
- REALLOC_N(cont->machine.stack, VALUE, size);
+ REALLOC_N(cont->machine.stack, VALUE, size);
}
else {
- cont->machine.stack = ALLOC_N(VALUE, size);
+ cont->machine.stack = ALLOC_N(VALUE, size);
}
FLUSH_REGISTER_WINDOWS;
MEMCPY(cont->machine.stack, cont->machine.stack_src, VALUE, size);
+
+#ifdef __ia64
+ rb_ia64_flushrs();
+ size = cont->machine.register_stack_size = th->machine.register_stack_end - th->machine.register_stack_start;
+ cont->machine.register_stack_src = th->machine.register_stack_start;
+ if (cont->machine.register_stack) {
+ REALLOC_N(cont->machine.register_stack, VALUE, size);
+ }
+ else {
+ cont->machine.register_stack = ALLOC_N(VALUE, size);
+ }
+
+ MEMCPY(cont->machine.register_stack, cont->machine.register_stack_src, VALUE, size);
+#endif
}
static const rb_data_type_t cont_data_type = {
"continuation",
- {cont_mark, cont_free, cont_memsize, cont_compact},
+ {cont_mark, cont_free, cont_memsize,},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
static inline 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);
+ rb_thread_t *sth = &cont->saved_thread;
/* save thread context */
- *sec = *th->ec;
-
- /* saved_ec->machine.stack_end should be NULL */
+ sth->stack = th->stack;
+ sth->stack_size = th->stack_size;
+ sth->local_storage = th->local_storage;
+ sth->cfp = th->cfp;
+ sth->safe_level = th->safe_level;
+ sth->raised_flag = th->raised_flag;
+ sth->state = th->state;
+ sth->status = th->status;
+ sth->tag = th->tag;
+ sth->protect_tag = th->protect_tag;
+ sth->errinfo = th->errinfo;
+ sth->first_proc = th->first_proc;
+ sth->root_lep = th->root_lep;
+ sth->root_svar = th->root_svar;
+ sth->ensure_list = th->ensure_list;
+
+ sth->trace_arg = th->trace_arg;
+
+ /* saved_thread->machine.stack_(start|end) should be NULL */
/* because it may happen GC afterward */
- sec->machine.stack_end = NULL;
+ sth->machine.stack_start = 0;
+ sth->machine.stack_end = 0;
+#ifdef __ia64
+ sth->machine.register_stack_start = 0;
+ sth->machine.register_stack_end = 0;
+#endif
}
static void
@@ -1101,13 +455,12 @@ 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;
- if (mjit_enabled) {
- cont->mjit_cont = mjit_cont_new(&cont->saved_ec);
- }
+ cont->saved_thread.self = th->self;
+ cont->saved_thread.machine.stack_maxsize = th->machine.stack_maxsize;
+ cont->saved_thread.fiber = th->fiber;
+ cont->saved_thread.local_storage = 0;
+ cont->saved_thread.local_storage_recursive_hash = Qnil;
+ cont->saved_thread.local_storage_recursive_hash_for_trace = Qnil;
}
static rb_context_t *
@@ -1124,204 +477,274 @@ 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
-COMPILER_WARNING_PUSH
-#ifdef __clang__
-COMPILER_WARNING_IGNORED(-Wduplicate-decl-specifier)
-#endif
static VALUE
-cont_capture(volatile int *volatile stat)
+cont_capture(volatile int *stat)
+#if defined(__clang__) && \
+ __clang_major__ == 3 && __clang_minor__ == 8 && __clang_patch__ == 0
+__attribute__ ((optnone))
+#endif
{
- rb_context_t *volatile cont;
+ rb_context_t *cont;
rb_thread_t *th = GET_THREAD();
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;
#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->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
- // At this point, `cfp` is valid but `vm_stack` should be cleared:
- rb_ec_set_vm_stack(&cont->saved_ec, NULL, 0);
- VM_ASSERT(cont->saved_ec.cfp != NULL);
+ cont->saved_thread.stack = 0;
+
cont_save_machine_stack(th, cont);
/* backup ensure_list to array for search in another context */
{
- rb_ensure_list_t *p;
- int size = 0;
- rb_ensure_entry_t *entry;
- for (p=th->ec->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) {
- if (!p->entry.marker)
- p->entry.marker = rb_ary_tmp_new(0); /* dummy object */
- *entry++ = p->entry;
- }
- entry->marker = 0;
+ rb_ensure_list_t *p;
+ int size = 0;
+ rb_ensure_entry_t *entry;
+ 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->ensure_list; p; p=p->next) {
+ if (!p->entry.marker)
+ p->entry.marker = rb_ary_tmp_new(0); /* dummy object */
+ *entry++ = p->entry;
+ }
+ entry->marker = 0;
}
if (ruby_setjmp(cont->jmpbuf)) {
- VALUE value;
-
- VAR_INITIALIZED(cont);
- value = cont->value;
- if (cont->argc == -1) rb_exc_raise(value);
- cont->value = Qnil;
- *stat = 1;
- return value;
+ volatile VALUE value;
+
+ VAR_INITIALIZED(cont);
+ value = cont->value;
+ if (cont->argc == -1) rb_exc_raise(value);
+ cont->value = Qnil;
+ *stat = 1;
+ return value;
}
else {
- *stat = 0;
- return contval;
+ *stat = 0;
+ return contval;
}
}
-COMPILER_WARNING_POP
-
-static inline void
-fiber_restore_thread(rb_thread_t *th, rb_fiber_t *fiber)
-{
- ec_switch(th, fiber);
- VM_ASSERT(th->ec->fiber_ptr == fiber);
-}
static inline 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 *fiber = NULL;
-
- if (sec->fiber_ptr != NULL) {
- fiber = sec->fiber_ptr;
- }
- else if (th->root_fiber) {
- fiber = th->root_fiber;
- }
-
- if (fiber && th->ec != &fiber->cont.saved_ec) {
- ec_switch(th, fiber);
- }
-
- if (th->ec->trace_arg != sec->trace_arg) {
- rb_raise(rb_eRuntimeError, "can't call across trace_func");
- }
-
- /* copy vm stack */
+ /* continuation */
+ rb_fiber_t *fib;
+
+ th->fiber = sth->fiber;
+ fib = th->fiber ? th->fiber : th->root_fiber;
+
+ if (fib) {
+ th->stack_size = fib->cont.saved_thread.stack_size;
+ th->stack = fib->cont.saved_thread.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->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;
-
- VM_ASSERT(th->ec->vm_stack != NULL);
}
else {
- /* fiber */
- fiber_restore_thread(th, (rb_fiber_t*)cont);
- }
+ /* fiber */
+ th->stack = sth->stack;
+ th->stack_size = sth->stack_size;
+ th->local_storage = sth->local_storage;
+ th->local_storage_recursive_hash = sth->local_storage_recursive_hash;
+ th->local_storage_recursive_hash_for_trace = sth->local_storage_recursive_hash_for_trace;
+ th->fiber = (rb_fiber_t*)cont;
+ }
+
+ th->cfp = sth->cfp;
+ 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
+#ifdef _WIN32
+static void
+fiber_set_stack_location(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ VALUE *ptr;
+
+ SET_MACHINE_STACK_END(&ptr);
+ th->machine.stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
}
-NOINLINE(static void fiber_setcontext(rb_fiber_t *new_fiber, rb_fiber_t *old_fiber));
+static VOID CALLBACK
+fiber_entry(void *arg)
+{
+ fiber_set_stack_location();
+ rb_fiber_start();
+}
+#else /* _WIN32 */
-static void
-fiber_setcontext(rb_fiber_t *new_fiber, rb_fiber_t *old_fiber)
+/*
+ * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
+ * if MAP_STACK is passed.
+ * http://www.FreeBSD.org/cgi/query-pr.cgi?pr=158755
+ */
+#if defined(MAP_STACK) && !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_STACK)
+#else
+#define FIBER_STACK_FLAGS (MAP_PRIVATE | MAP_ANON)
+#endif
+
+static char*
+fiber_machine_stack_alloc(size_t size)
{
- rb_thread_t *th = GET_THREAD();
+ char *ptr;
- /* save old_fiber's machine stack - to ensure efficient garbage collection */
- if (!FIBER_TERMINATED_P(old_fiber)) {
- STACK_GROW_DIR_DETECTION;
- SET_MACHINE_STACK_END(&th->ec->machine.stack_end);
- if (STACK_DIR_UPPER(0, 1)) {
- old_fiber->cont.machine.stack_size = th->ec->machine.stack_start - th->ec->machine.stack_end;
- old_fiber->cont.machine.stack = th->ec->machine.stack_end;
- }
- else {
- old_fiber->cont.machine.stack_size = th->ec->machine.stack_end - th->ec->machine.stack_start;
- old_fiber->cont.machine.stack = th->ec->machine.stack_start;
- }
+ if (machine_stack_cache_index > 0) {
+ if (machine_stack_cache[machine_stack_cache_index - 1].size == (size / sizeof(VALUE))) {
+ ptr = machine_stack_cache[machine_stack_cache_index - 1].ptr;
+ machine_stack_cache_index--;
+ machine_stack_cache[machine_stack_cache_index].ptr = NULL;
+ machine_stack_cache[machine_stack_cache_index].size = 0;
+ }
+ else{
+ /* TODO handle multiple machine stack size */
+ rb_bug("machine_stack_cache size is not canonicalized");
+ }
}
+ else {
+ void *page;
+ STACK_GROW_DIR_DETECTION;
- /* exchange machine_stack_start between old_fiber and new_fiber */
- old_fiber->cont.saved_ec.machine.stack_start = th->ec->machine.stack_start;
+ errno = 0;
+ ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
+ if (ptr == MAP_FAILED) {
+ rb_raise(rb_eFiberError, "can't alloc machine stack to fiber: %s", strerror(errno));
+ }
- /* old_fiber->machine.stack_end should be NULL */
- old_fiber->cont.saved_ec.machine.stack_end = NULL;
+ /* guard page setup */
+ page = ptr + STACK_DIR_UPPER(size - RB_PAGE_SIZE, 0);
+ if (mprotect(page, RB_PAGE_SIZE, PROT_NONE) < 0) {
+ rb_raise(rb_eFiberError, "mprotect failed");
+ }
+ }
- /* restore thread context */
- fiber_restore_thread(th, new_fiber);
+ return ptr;
+}
+#endif
- // if (DEBUG) fprintf(stderr, "fiber_setcontext: %p[%p] -> %p[%p]\n", old_fiber, old_fiber->stack.base, new_fiber, new_fiber->stack.base);
+static void
+fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
+{
+ rb_thread_t *sth = &fib->cont.saved_thread;
- /* swap machine context */
- coroutine_transfer(&old_fiber->context, &new_fiber->context);
+#ifdef _WIN32
+ fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
+ if (!fib->fib_handle) {
+ /* try to release unnecessary fibers & retry to create */
+ rb_gc();
+ fib->fib_handle = CreateFiberEx(size - 1, size, 0, fiber_entry, NULL);
+ if (!fib->fib_handle) {
+ rb_raise(rb_eFiberError, "can't create fiber");
+ }
+ }
+ sth->machine.stack_maxsize = size;
+#else /* not WIN32 */
+ ucontext_t *context = &fib->context;
+ char *ptr;
+ STACK_GROW_DIR_DETECTION;
+
+ getcontext(context);
+ ptr = fiber_machine_stack_alloc(size);
+ context->uc_link = NULL;
+ context->uc_stack.ss_sp = ptr;
+ context->uc_stack.ss_size = size;
+ fib->ss_sp = ptr;
+ fib->ss_size = size;
+ makecontext(context, rb_fiber_start, 0);
+ sth->machine.stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
+ sth->machine.stack_maxsize = size - RB_PAGE_SIZE;
+#endif
+#ifdef __ia64
+ sth->machine.register_stack_maxsize = sth->machine.stack_maxsize;
+#endif
+}
+
+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(), *sth = &newfib->cont.saved_thread;
- // It's possible to get here, and new_fiber is already freed.
- // if (DEBUG) fprintf(stderr, "fiber_setcontext: %p[%p] <- %p[%p]\n", old_fiber, old_fiber->stack.base, new_fiber, new_fiber->stack.base);
+ if (newfib->status != RUNNING) {
+ fiber_initialize_machine_stack_context(newfib, th->vm->default_params.fiber_machine_stack_size);
+ }
+
+ /* 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->machine.stack_end);
+ if (STACK_DIR_UPPER(0, 1)) {
+ oldfib->cont.machine.stack_size = th->machine.stack_start - th->machine.stack_end;
+ oldfib->cont.machine.stack = th->machine.stack_end;
+ }
+ else {
+ oldfib->cont.machine.stack_size = th->machine.stack_end - th->machine.stack_start;
+ oldfib->cont.machine.stack = th->machine.stack_start;
+ }
+ }
+ /* exchange machine_stack_start between oldfib and newfib */
+ oldfib->cont.saved_thread.machine.stack_start = th->machine.stack_start;
+ th->machine.stack_start = sth->machine.stack_start;
+ /* oldfib->machine.stack_end should be NULL */
+ oldfib->cont.saved_thread.machine.stack_end = 0;
+#ifndef _WIN32
+ if (!newfib->context.uc_stack.ss_sp && th->root_fiber != newfib) {
+ rb_bug("non_root_fiber->context.uc_stac.ss_sp should not be NULL");
+ }
+#endif
+
+ /* swap machine context */
+#ifdef _WIN32
+ SwitchToFiber(newfib->fib_handle);
+#else
+ swapcontext(&oldfib->context, &newfib->context);
+#endif
}
+#endif
NOINLINE(NORETURN(static void cont_restore_1(rb_context_t *)));
@@ -1333,24 +756,66 @@ cont_restore_1(rb_context_t *cont)
/* restore machine stack */
#ifdef _M_AMD64
{
- /* workaround for x64 SEH */
- jmp_buf buf;
- setjmp(buf);
- _JUMP_BUFFER *bp = (void*)&cont->jmpbuf;
- bp->Frame = ((_JUMP_BUFFER*)((void*)&buf))->Frame;
+ /* workaround for x64 SEH */
+ jmp_buf buf;
+ setjmp(buf);
+ ((_JUMP_BUFFER*)(&cont->jmpbuf))->Frame =
+ ((_JUMP_BUFFER*)(&buf))->Frame;
}
#endif
if (cont->machine.stack_src) {
- FLUSH_REGISTER_WINDOWS;
- MEMCPY(cont->machine.stack_src, cont->machine.stack,
- VALUE, cont->machine.stack_size);
+ FLUSH_REGISTER_WINDOWS;
+ MEMCPY(cont->machine.stack_src, cont->machine.stack,
+ VALUE, cont->machine.stack_size);
}
+#ifdef __ia64
+ if (cont->machine.register_stack_src) {
+ MEMCPY(cont->machine.register_stack_src, cont->machine.register_stack,
+ VALUE, cont->machine.register_stack_size);
+ }
+#endif
+
ruby_longjmp(cont->jmpbuf, 1);
}
NORETURN(NOINLINE(static void cont_restore_0(rb_context_t *, VALUE *)));
+#ifdef __ia64
+#define C(a) rse_##a##0, rse_##a##1, rse_##a##2, rse_##a##3, rse_##a##4
+#define E(a) rse_##a##0= rse_##a##1= rse_##a##2= rse_##a##3= rse_##a##4
+static volatile int C(a), C(b), C(c), C(d), C(e);
+static volatile int C(f), C(g), C(h), C(i), C(j);
+static volatile int C(k), C(l), C(m), C(n), C(o);
+static volatile int C(p), C(q), C(r), C(s), C(t);
+#if 0
+{/* the above lines make cc-mode.el confused so much */}
+#endif
+int rb_dummy_false = 0;
+NORETURN(NOINLINE(static void register_stack_extend(rb_context_t *, VALUE *, VALUE *)));
+static void
+register_stack_extend(rb_context_t *cont, VALUE *vp, VALUE *curr_bsp)
+{
+ if (rb_dummy_false) {
+ /* use registers as much as possible */
+ E(a) = E(b) = E(c) = E(d) = E(e) =
+ E(f) = E(g) = E(h) = E(i) = E(j) =
+ E(k) = E(l) = E(m) = E(n) = E(o) =
+ E(p) = E(q) = E(r) = E(s) = E(t) = 0;
+ E(a) = E(b) = E(c) = E(d) = E(e) =
+ E(f) = E(g) = E(h) = E(i) = E(j) =
+ E(k) = E(l) = E(m) = E(n) = E(o) =
+ E(p) = E(q) = E(r) = E(s) = E(t) = 0;
+ }
+ if (curr_bsp < cont->machine.register_stack_src+cont->machine.register_stack_size) {
+ register_stack_extend(cont, vp, (VALUE*)rb_ia64_bsp());
+ }
+ cont_restore_0(cont, vp);
+}
+#undef C
+#undef E
+#endif
+
static void
cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
{
@@ -1360,45 +825,48 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
#else
#define STACK_PAD_SIZE 1024
#endif
- VALUE space[STACK_PAD_SIZE];
+ VALUE space[STACK_PAD_SIZE];
#if !STACK_GROW_DIRECTION
- if (addr_in_prev_frame > &space[0]) {
- /* Stack grows downward */
+ if (addr_in_prev_frame > &space[0]) {
+ /* Stack grows downward */
#endif
#if STACK_GROW_DIRECTION <= 0
- volatile VALUE *const end = cont->machine.stack_src;
- if (&space[0] > end) {
+ volatile VALUE *const end = cont->machine.stack_src;
+ if (&space[0] > end) {
# ifdef HAVE_ALLOCA
- volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
- space[0] = *sp;
+ volatile VALUE *sp = ALLOCA_N(VALUE, &space[0] - end);
+ space[0] = *sp;
# else
- cont_restore_0(cont, &space[0]);
+ cont_restore_0(cont, &space[0]);
# endif
- }
+ }
#endif
#if !STACK_GROW_DIRECTION
- }
- else {
- /* Stack grows upward */
+ }
+ else {
+ /* Stack grows upward */
#endif
#if STACK_GROW_DIRECTION >= 0
- volatile VALUE *const end = cont->machine.stack_src + cont->machine.stack_size;
- if (&space[STACK_PAD_SIZE] < end) {
+ volatile VALUE *const end = cont->machine.stack_src + cont->machine.stack_size;
+ if (&space[STACK_PAD_SIZE] < end) {
# ifdef HAVE_ALLOCA
- volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
- space[0] = *sp;
+ volatile VALUE *sp = ALLOCA_N(VALUE, end - &space[STACK_PAD_SIZE]);
+ space[0] = *sp;
# else
- cont_restore_0(cont, &space[STACK_PAD_SIZE-1]);
+ cont_restore_0(cont, &space[STACK_PAD_SIZE-1]);
# endif
- }
+ }
#endif
#if !STACK_GROW_DIRECTION
- }
+ }
#endif
}
cont_restore_1(cont);
}
+#ifdef __ia64
+#define cont_restore_0(cont, vp) register_stack_extend((cont), (vp), (VALUE*)rb_ia64_bsp())
+#endif
/*
* Document-class: Continuation
@@ -1406,7 +874,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
* Continuation objects are generated by Kernel#callcc,
* after having +require+d <i>continuation</i>. They hold
* a return address and execution context, allowing a nonlocal return
- * to the end of the #callcc block from anywhere within a
+ * to the end of the <code>callcc</code> block from anywhere within a
* program. Continuations are somewhat analogous to a structured
* version of C's <code>setjmp/longjmp</code> (although they contain
* more state, so you might consider them closer to threads).
@@ -1426,31 +894,13 @@ 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:
*
* require "continuation"
* callcc {|cont|
* for i in 0..4
- * print "#{i}: "
+ * print "\n#{i}: "
* for j in i*5...(i+1)*5
* cont.call() if j == 17
* printf "%3d", j
@@ -1490,10 +940,10 @@ rb_callcc(VALUE self)
volatile VALUE val = cont_capture(&called);
if (called) {
- return val;
+ return val;
}
else {
- return rb_yield(val);
+ return rb_yield(val);
}
}
@@ -1501,39 +951,35 @@ static VALUE
make_passing_arg(int argc, const VALUE *argv)
{
switch (argc) {
- case -1:
- return argv[0];
case 0:
- return Qnil;
+ return Qnil;
case 1:
- return argv[0];
+ return argv[0];
default:
- return rb_ary_new4(argc, argv);
+ return rb_ary_new4(argc, argv);
}
}
-typedef VALUE e_proc(VALUE);
-
/* CAUTION!! : Currently, error in rollback_func is not supported */
/* same as rb_protect if set rollback_func to NULL */
void
-ruby_register_rollback_func_for_ensure(e_proc *ensure_func, e_proc *rollback_func)
+ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE (*rollback_func)(ANYARGS))
{
st_table **table_p = &GET_VM()->ensure_rollback_table;
if (UNLIKELY(*table_p == NULL)) {
- *table_p = st_init_numtable();
+ *table_p = st_init_numtable();
}
st_insert(*table_p, (st_data_t)ensure_func, (st_data_t)rollback_func);
}
-static inline e_proc *
-lookup_rollback_func(e_proc *ensure_func)
+static inline VALUE
+lookup_rollback_func(VALUE (*ensure_func)(ANYARGS))
{
st_table *table = GET_VM()->ensure_rollback_table;
st_data_t val;
if (table && st_lookup(table, (st_data_t)ensure_func, &val))
- return (e_proc *) val;
- return (e_proc *) Qundef;
+ return (VALUE) val;
+ return Qundef;
}
@@ -1542,49 +988,49 @@ rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *ta
{
rb_ensure_list_t *p;
rb_ensure_entry_t *entry;
- size_t i, j;
+ size_t i;
size_t cur_size;
size_t target_size;
size_t base_point;
- e_proc *func;
+ VALUE (*func)(ANYARGS);
cur_size = 0;
for (p=current; p; p=p->next)
- cur_size++;
+ cur_size++;
target_size = 0;
for (entry=target; entry->marker; entry++)
- target_size++;
+ target_size++;
/* search common stack point */
p = current;
base_point = cur_size;
while (base_point) {
- if (target_size >= base_point &&
- p->entry.marker == target[target_size - base_point].marker)
- break;
- base_point --;
- p = p->next;
+ if (target_size >= base_point &&
+ p->entry.marker == target[target_size - base_point].marker)
+ break;
+ base_point --;
+ p = p->next;
}
/* rollback function check */
for (i=0; i < target_size - base_point; i++) {
- if (!lookup_rollback_func(target[i].e_proc)) {
- rb_raise(rb_eRuntimeError, "continuation called from out of critical rb_ensure scope");
- }
+ if (!lookup_rollback_func(target[i].e_proc)) {
+ rb_raise(rb_eRuntimeError, "continuation called from out of critical rb_ensure scope");
+ }
}
/* pop ensure stack */
while (cur_size > base_point) {
- /* escape from ensure block */
- (*current->entry.e_proc)(current->entry.data2);
- current = current->next;
- cur_size--;
+ /* escape from ensure block */
+ (*current->entry.e_proc)(current->entry.data2);
+ current = current->next;
+ cur_size--;
}
/* push ensure stack */
- for (j = 0; j < i; j++) {
- func = lookup_rollback_func(target[i - j - 1].e_proc);
- if ((VALUE)func != Qundef) {
- (*func)(target[i - j - 1].data2);
- }
+ while (i--) {
+ func = (VALUE (*)(ANYARGS)) lookup_rollback_func(target[i].e_proc);
+ if ((VALUE)func != Qundef) {
+ (*func)(target[i].data2);
+ }
}
}
@@ -1593,10 +1039,11 @@ rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *ta
* cont.call(args, ...)
* cont[args, ...]
*
- * Invokes the continuation. The program continues from the end of
- * the #callcc block. If no arguments are given, the original #callcc
- * returns +nil+. If one argument is given, #callcc returns
- * it. Otherwise, an array containing <i>args</i> is returned.
+ * Invokes the continuation. The program continues from the end of the
+ * <code>callcc</code> block. If no arguments are given, the original
+ * <code>callcc</code> returns <code>nil</code>. If one argument is
+ * given, <code>callcc</code> returns it. Otherwise, an array
+ * containing <i>args</i> is returned.
*
* callcc {|cont| cont.call } #=> nil
* callcc {|cont| cont.call 1 } #=> 1
@@ -1606,25 +1053,29 @@ rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *ta
static VALUE
rb_cont_call(int argc, VALUE *argv, VALUE contval)
{
- rb_context_t *cont = cont_ptr(contval);
+ rb_context_t *cont;
rb_thread_t *th = GET_THREAD();
+ GetContPtr(contval, cont);
- if (cont_thread_value(cont) != th->self) {
- rb_raise(rb_eRuntimeError, "continuation called across threads");
+ 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) {
- rb_raise(rb_eRuntimeError, "continuation called across stack rewinding barrier");
+ 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) {
- rb_raise(rb_eRuntimeError, "continuation called across fiber");
- }
+ if (cont->saved_thread.fiber) {
+ 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 */
}
@@ -1643,15 +1094,14 @@ 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
- * be explicitly asked to run using the Fiber#resume method.
+ * be explicitly asked to run using the <code>Fiber#resume</code> method.
* The code running inside the fiber can give up control by calling
- * Fiber.yield in which case it yields control back to caller (the
- * caller of the Fiber#resume).
+ * <code>Fiber.yield</code> in which case it yields control back to caller
+ * (the caller of the <code>Fiber#resume</code>).
*
* Upon yielding or termination the Fiber returns the value of the last
* executed expression
@@ -1673,10 +1123,10 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
* 2
* FiberError: dead fiber called
*
- * The Fiber#resume method accepts an arbitrary number of parameters,
- * if it is the first call to #resume then they will be passed as
- * block arguments. Otherwise they will be the return value of the
- * call to Fiber.yield
+ * The <code>Fiber#resume</code> method accepts an arbitrary number of
+ * parameters, if it is the first call to <code>resume</code> then they
+ * will be passed as block arguments. Otherwise they will be the return
+ * value of the call to <code>Fiber.yield</code>
*
* Example:
*
@@ -1685,20 +1135,20 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
* end
*
* puts fiber.resume 10
- * puts fiber.resume 1_000_000
- * puts fiber.resume "The fiber will be dead before I can cause trouble"
+ * puts fiber.resume 14
+ * puts fiber.resume 18
*
* <em>produces</em>
*
* 12
- * 1000000
+ * 14
* FiberError: dead fiber called
*
*/
static const rb_data_type_t fiber_data_type = {
"fiber",
- {fiber_mark, fiber_free, fiber_memsize, fiber_compact,},
+ {fiber_mark, fiber_free, fiber_memsize,},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
@@ -1709,232 +1159,177 @@ fiber_alloc(VALUE klass)
}
static rb_fiber_t*
-fiber_t_alloc(VALUE fiber_value)
+fiber_t_alloc(VALUE fibval)
{
- rb_fiber_t *fiber;
+ rb_fiber_t *fib;
rb_thread_t *th = GET_THREAD();
- if (DATA_PTR(fiber_value) != 0) {
- rb_raise(rb_eRuntimeError, "cannot initialize twice");
+ if (DATA_PTR(fibval) != 0) {
+ rb_raise(rb_eRuntimeError, "cannot initialize twice");
}
THREAD_MUST_BE_RUNNING(th);
- fiber = ZALLOC(rb_fiber_t);
- fiber->cont.self = fiber_value;
- fiber->cont.type = FIBER_CONTEXT;
- cont_init(&fiber->cont, th);
-
- fiber->cont.saved_ec.fiber_ptr = fiber;
- rb_ec_clear_vm_stack(&fiber->cont.saved_ec);
+ fib = ZALLOC(rb_fiber_t);
+ fib->cont.self = fibval;
+ fib->cont.type = FIBER_CONTEXT;
+ cont_init(&fib->cont, th);
+ fib->prev = NULL;
+ fib->status = CREATED;
- fiber->prev = NULL;
+ DATA_PTR(fibval) = fib;
- /* fiber->status == 0 == CREATED
- * So that we don't need to set status: fiber_status_set(fiber, FIBER_CREATED); */
- VM_ASSERT(FIBER_CREATED_P(fiber));
-
- DATA_PTR(fiber_value) = fiber;
-
- return fiber;
+ return fib;
}
static VALUE
-fiber_initialize(VALUE self, VALUE proc, struct fiber_pool * fiber_pool)
+fiber_init(VALUE fibval, VALUE proc)
{
- rb_fiber_t *fiber = fiber_t_alloc(self);
-
- fiber->first_proc = proc;
- fiber->stack.base = NULL;
- fiber->stack.pool = fiber_pool;
+ rb_fiber_t *fib = fiber_t_alloc(fibval);
+ rb_context_t *cont = &fib->cont;
+ rb_thread_t *th = &cont->saved_thread;
+ rb_thread_t *cth = GET_THREAD();
- return self;
-}
+ /* initialize cont */
+ cont->vm_stack = 0;
-static void
-fiber_prepare_stack(rb_fiber_t *fiber)
-{
- rb_context_t *cont = &fiber->cont;
- rb_execution_context_t *sec = &cont->saved_ec;
+ th->stack = 0;
+ th->stack_size = 0;
- size_t vm_stack_size = 0;
- VALUE *vm_stack = fiber_initialize_coroutine(fiber, &vm_stack_size);
+ th->stack_size = cth->vm->default_params.fiber_vm_stack_size / sizeof(VALUE);
+ th->stack = ALLOC_N(VALUE, th->stack_size);
- /* initialize cont */
- cont->saved_vm_stack.ptr = NULL;
- rb_ec_initialize_vm_stack(sec, vm_stack, vm_stack_size / sizeof(VALUE));
+ 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->local_storage_recursive_hash = Qnil;
+ th->local_storage_recursive_hash_for_trace = Qnil;
+
+ th->first_proc = proc;
+
+#if !FIBER_USE_NATIVE
+ MEMCPY(&cont->jmpbuf, &cth->root_jmpbuf, rb_jmpbuf_t, 1);
+#endif
- sec->tag = NULL;
- sec->local_storage = NULL;
- sec->local_storage_recursive_hash = Qnil;
- sec->local_storage_recursive_hash_for_trace = Qnil;
+ return fibval;
}
/* :nodoc: */
static VALUE
-rb_fiber_initialize(int argc, VALUE* argv, VALUE self)
+rb_fiber_init(VALUE fibval)
{
- return fiber_initialize(self, rb_block_proc(), &shared_fiber_pool);
+ return fiber_init(fibval, rb_block_proc());
}
VALUE
-rb_fiber_new(rb_block_call_func_t func, VALUE obj)
+rb_fiber_new(VALUE (*func)(ANYARGS), VALUE obj)
{
- return fiber_initialize(fiber_alloc(rb_cFiber), rb_proc_new(func, obj), &shared_fiber_pool);
+ return fiber_init(fiber_alloc(rb_cFiber), rb_proc_new(func, obj));
}
-static void rb_fiber_terminate(rb_fiber_t *fiber, int need_interrupt);
-
-#define PASS_KW_SPLAT (rb_empty_keyword_given_p() ? RB_PASS_EMPTY_KEYWORDS : rb_keyword_given_p())
+static void rb_fiber_terminate(rb_fiber_t *fib);
void
rb_fiber_start(void)
{
- rb_thread_t * volatile th = GET_THREAD();
- rb_fiber_t *fiber = th->ec->fiber_ptr;
+ rb_thread_t *th = GET_THREAD();
+ rb_fiber_t *fib = th->fiber;
rb_proc_t *proc;
- enum ruby_tag_type state;
- int need_interrupt = TRUE;
-
- VM_ASSERT(th->ec == ruby_current_execution_context_ptr);
- VM_ASSERT(FIBER_RESUMED_P(fiber));
-
- EC_PUSH_TAG(th->ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- rb_context_t *cont = &VAR_FROM_MEMORY(fiber)->cont;
- int argc;
- const VALUE *argv, args = cont->value;
- int kw_splat = cont->kw_splat;
- GetProcPtr(fiber->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(fiber->first_proc);
- th->ec->root_svar = Qfalse;
-
- EXEC_EVENT_HOOK(th->ec, RUBY_EVENT_FIBER_SWITCH, th->self, 0, 0, 0, Qnil);
- rb_adjust_argv_kw_splat(&argc, &argv, &kw_splat);
- cont->value = rb_vm_invoke_proc(th->ec, proc, argc, argv, kw_splat, VM_BLOCK_HANDLER_NONE);
+ int state;
+
+ TH_PUSH_TAG(th);
+ if ((state = EXEC_TAG()) == 0) {
+ rb_context_t *cont = &VAR_FROM_MEMORY(fib)->cont;
+ int argc;
+ const VALUE *argv, args = cont->value;
+ GetProcPtr(cont->saved_thread.first_proc, proc);
+ argv = (argc = cont->argc) > 1 ? RARRAY_CONST_PTR(args) : &args;
+ cont->value = Qnil;
+ th->errinfo = Qnil;
+ th->root_lep = rb_vm_ep_local_ep(proc->block.ep);
+ th->root_svar = Qnil;
+
+ fib->status = RUNNING;
+ cont->value = rb_vm_invoke_proc(th, proc, argc, argv, 0);
}
- EC_POP_TAG();
+ TH_POP_TAG();
if (state) {
- VALUE err = th->ec->errinfo;
- VM_ASSERT(FIBER_RESUMED_P(fiber));
-
- if (state == TAG_RAISE || state == TAG_FATAL) {
- rb_threadptr_pending_interrupt_enque(th, err);
- }
- else {
- err = rb_vm_make_jump_tag_but_local_jump(state, err);
- if (!NIL_P(err)) {
- rb_threadptr_pending_interrupt_enque(th, err);
- }
- }
- need_interrupt = TRUE;
+ if (state == TAG_RAISE || state == TAG_FATAL) {
+ rb_threadptr_pending_interrupt_enque(th, th->errinfo);
+ }
+ else {
+ VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+ if (!NIL_P(err))
+ rb_threadptr_pending_interrupt_enque(th, err);
+ }
+ RUBY_VM_SET_INTERRUPT(th);
}
- rb_fiber_terminate(fiber, 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 fiber_value = fiber_alloc(rb_cFiber);
- rb_fiber_t *fiber = th->ec->fiber_ptr;
-
- VM_ASSERT(DATA_PTR(fiber_value) == NULL);
- VM_ASSERT(fiber->cont.type == FIBER_CONTEXT);
- VM_ASSERT(fiber->status == FIBER_RESUMED);
-
- th->root_fiber = fiber;
- DATA_PTR(fiber_value) = fiber;
- fiber->cont.self = fiber_value;
-
-#ifdef COROUTINE_PRIVATE_STACK
- fiber->stack = fiber_pool_stack_acquire(&shared_fiber_pool);
- coroutine_initialize_main(&fiber->context, fiber_pool_stack_base(&fiber->stack), fiber->stack.available, th->ec->machine.stack_start);
-#else
- coroutine_initialize_main(&fiber->context);
+ rb_fiber_t *fib;
+ /* no need to allocate vm stack */
+ fib = fiber_t_alloc(fiber_alloc(rb_cFiber));
+ fib->cont.type = ROOT_FIBER_CONTEXT;
+#if FIBER_USE_NATIVE
+#ifdef _WIN32
+ fib->fib_handle = ConvertThreadToFiber(0);
#endif
+#endif
+ fib->status = RUNNING;
- return fiber;
-}
-
-void
-rb_threadptr_root_fiber_setup(rb_thread_t *th)
-{
- rb_fiber_t *fiber = ruby_mimmalloc(sizeof(rb_fiber_t));
- if (!fiber) {
- rb_bug("%s", strerror(errno)); /* ... is it possible to call rb_bug here? */
- }
- MEMZERO(fiber, rb_fiber_t, 1);
- fiber->cont.type = FIBER_CONTEXT;
- fiber->cont.saved_ec.fiber_ptr = fiber;
- fiber->cont.saved_ec.thread_ptr = th;
- fiber_status_set(fiber, FIBER_RESUMED); /* skip CREATED */
- th->ec = &fiber->cont.saved_ec;
-}
-
-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 == 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;
- }
-}
-
-void
-rb_threadptr_root_fiber_terminate(rb_thread_t *th)
-{
- rb_fiber_t *fiber = th->ec->fiber_ptr;
-
- fiber->status = FIBER_TERMINATED;
-
- // The vm_stack is `alloca`ed on the thread stack, so it's gone too:
- rb_ec_clear_vm_stack(th->ec);
+ return fib;
}
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));
+ 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;
}
- return ec->fiber_ptr;
+ return th->fiber;
}
static inline rb_fiber_t*
return_fiber(void)
{
- rb_fiber_t *fiber = fiber_current();
- rb_fiber_t *prev = fiber->prev;
+ 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;
+ rb_fiber_t *root_fiber = GET_THREAD()->root_fiber;
- VM_ASSERT(root_fiber != NULL);
-
- if (root_fiber == fiber) {
- rb_raise(rb_eFiberError, "can't yield from root fiber");
- }
- return root_fiber;
+ if (root_fiber == fib) {
+ rb_raise(rb_eFiberError, "can't yield from root fiber");
+ }
+ return root_fiber;
}
else {
- fiber->prev = NULL;
- return prev;
+ fib->prev = NULL;
+ return prev;
}
}
@@ -1944,183 +1339,178 @@ rb_fiber_current(void)
return fiber_current()->cont.self;
}
-// Prepare to execute next_fiber on the given thread.
static inline VALUE
-fiber_store(rb_fiber_t *next_fiber, rb_thread_t *th)
+fiber_store(rb_fiber_t *next_fib, rb_thread_t *th)
{
- rb_fiber_t *fiber;
+ rb_fiber_t *fib;
- if (th->ec->fiber_ptr != NULL) {
- fiber = th->ec->fiber_ptr;
+ if (th->fiber) {
+ fib = th->fiber;
+ cont_save_thread(&fib->cont, th);
}
else {
- /* create root fiber */
- fiber = root_fiber_alloc(th);
+ /* create current fiber */
+ fib = root_fiber_alloc(th);
+ th->root_fiber = th->fiber = fib;
}
- if (FIBER_CREATED_P(next_fiber)) {
- fiber_prepare_stack(next_fiber);
+#if FIBER_USE_NATIVE
+ fiber_setcontext(next_fib, fib);
+ /* restored */
+#ifndef _WIN32
+ if (terminated_machine_stack.ptr) {
+ if (machine_stack_cache_index < MAX_MACHINE_STACK_CACHE) {
+ machine_stack_cache[machine_stack_cache_index].ptr = terminated_machine_stack.ptr;
+ machine_stack_cache[machine_stack_cache_index].size = terminated_machine_stack.size;
+ machine_stack_cache_index++;
+ }
+ else {
+ if (terminated_machine_stack.ptr != fib->cont.machine.stack) {
+ munmap((void*)terminated_machine_stack.ptr, terminated_machine_stack.size * sizeof(VALUE));
+ }
+ else {
+ rb_bug("terminated fiber resumed");
+ }
+ }
+ terminated_machine_stack.ptr = NULL;
+ terminated_machine_stack.size = 0;
+ }
+#endif /* not _WIN32 */
+ fib = th->fiber;
+ if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
+ return fib->cont.value;
+
+#else /* FIBER_USE_NATIVE */
+ cont_save_machine_stack(th, &fib->cont);
+ if (ruby_setjmp(fib->cont.jmpbuf)) {
+ /* restored */
+ fib = th->fiber;
+ if (fib->cont.argc == -1) rb_exc_raise(fib->cont.value);
+ if (next_fib->cont.value == Qundef) {
+ cont_restore_0(&next_fib->cont, &next_fib->cont.value);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
+ return fib->cont.value;
}
-
- VM_ASSERT(FIBER_RESUMED_P(fiber) || FIBER_TERMINATED_P(fiber));
- VM_ASSERT(FIBER_RUNNABLE_P(next_fiber));
-
- if (FIBER_RESUMED_P(fiber)) fiber_status_set(fiber, FIBER_SUSPENDED);
-
- fiber_status_set(next_fiber, FIBER_RESUMED);
- fiber_setcontext(next_fiber, fiber);
-
- fiber = th->ec->fiber_ptr;
-
- /* Raise an exception if that was the result of executing the fiber */
- if (fiber->cont.argc == -1) rb_exc_raise(fiber->cont.value);
-
- return fiber->cont.value;
+ else {
+ VALUE undef = Qundef;
+ cont_restore_0(&next_fib->cont, &undef);
+ rb_bug("rb_fiber_resume: unreachable");
+ }
+#endif /* FIBER_USE_NATIVE */
}
static inline VALUE
-fiber_switch(rb_fiber_t *fiber, int argc, const VALUE *argv, int is_resume, int kw_splat)
+fiber_switch(rb_fiber_t *fib, int argc, const VALUE *argv, int is_resume)
{
VALUE value;
- rb_context_t *cont = &fiber->cont;
+ rb_context_t *cont = &fib->cont;
rb_thread_t *th = GET_THREAD();
- /* make sure the root_fiber object is available */
- if (th->root_fiber == NULL) root_fiber_alloc(th);
-
- if (th->ec->fiber_ptr == fiber) {
- /* ignore fiber context switch
+ if (th->fiber == fib) {
+ /* ignore fiber context switch
* because destination fiber is same as current fiber
- */
- return make_passing_arg(argc, argv);
+ */
+ return make_passing_arg(argc, argv);
}
- if (cont_thread_value(cont) != th->self) {
- rb_raise(rb_eFiberError, "fiber called across threads");
+ 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) {
- rb_raise(rb_eFiberError, "fiber called across stack rewinding barrier");
+ 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(fiber)) {
- 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);
- }
- 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;
-
- fiber_setcontext(th->root_fiber, th->ec->fiber_ptr);
-
- VM_UNREACHABLE(fiber_switch);
- }
+ else if (fib->status == TERMINATED) {
+ value = rb_exc_new2(rb_eFiberError, "dead fiber called");
+
+ if (th->fiber->status != TERMINATED) rb_exc_raise(value);
+
+ /* th->fiber is also dead => switch to root fiber */
+ /* (this means we're being called from rb_fiber_terminate, */
+ /* and the terminated fiber's return_fiber() is already dead) */
+ cont = &th->root_fiber->cont;
+ cont->argc = -1;
+ cont->value = value;
+#if FIBER_USE_NATIVE
+ fiber_setcontext(th->root_fiber, th->fiber);
+#else
+ cont_restore_0(cont, &value);
+#endif
+ /* unreachable */
}
if (is_resume) {
- fiber->prev = fiber_current();
+ fib->prev = fiber_current();
+ }
+ else {
+ /* restore `tracing' context. see [Feature #4347] */
+ th->trace_arg = cont->saved_thread.trace_arg;
}
-
- VM_ASSERT(FIBER_RUNNABLE_P(fiber));
cont->argc = argc;
- cont->kw_splat = kw_splat;
cont->value = make_passing_arg(argc, argv);
- value = fiber_store(fiber, th);
-
- if (is_resume && FIBER_TERMINATED_P(fiber)) {
- fiber_stack_release(fiber);
- }
-
- 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, th);
+ RUBY_VM_CHECK_INTS(th);
return value;
}
VALUE
-rb_fiber_transfer(VALUE fiber_value, int argc, const VALUE *argv)
-{
- return fiber_switch(fiber_ptr(fiber_value), argc, argv, 0, RB_NO_KEYWORDS);
-}
-
-void
-rb_fiber_close(rb_fiber_t *fiber)
+rb_fiber_transfer(VALUE fibval, int argc, const VALUE *argv)
{
- fiber_status_set(fiber, FIBER_TERMINATED);
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ return fiber_switch(fib, argc, argv, 0);
}
static void
-rb_fiber_terminate(rb_fiber_t *fiber, int need_interrupt)
-{
- VALUE value = fiber->cont.value;
- rb_fiber_t *next_fiber;
-
- VM_ASSERT(FIBER_RESUMED_P(fiber));
- rb_fiber_close(fiber);
-
- coroutine_destroy(&fiber->context);
-
- fiber->cont.machine.stack = NULL;
- fiber->cont.machine.stack_size = 0;
-
- next_fiber = return_fiber();
- if (need_interrupt) RUBY_VM_SET_INTERRUPT(&next_fiber->cont.saved_ec);
- fiber_switch(next_fiber, 1, &value, 0, RB_NO_KEYWORDS);
+rb_fiber_terminate(rb_fiber_t *fib)
+{
+ VALUE value = fib->cont.value;
+ fib->status = TERMINATED;
+#if FIBER_USE_NATIVE && !defined(_WIN32)
+ /* Ruby must not switch to other thread until storing terminated_machine_stack */
+ terminated_machine_stack.ptr = fib->ss_sp;
+ terminated_machine_stack.size = fib->ss_size / sizeof(VALUE);
+ fib->ss_sp = NULL;
+ fib->context.uc_stack.ss_sp = NULL;
+ fib->cont.machine.stack = NULL;
+ fib->cont.machine.stack_size = 0;
+#endif
+ fiber_switch(return_fiber(), 1, &value, 0);
}
VALUE
-rb_fiber_resume_kw(VALUE fiber_value, int argc, const VALUE *argv, int kw_splat)
+rb_fiber_resume(VALUE fibval, int argc, const VALUE *argv)
{
- rb_fiber_t *fiber = fiber_ptr(fiber_value);
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
- if (argc == -1 && FIBER_CREATED_P(fiber)) {
- rb_raise(rb_eFiberError, "cannot raise exception on unborn fiber");
+ if (fib->prev != 0 || fib->cont.type == ROOT_FIBER_CONTEXT) {
+ rb_raise(rb_eFiberError, "double resume");
}
-
- if (fiber->prev != 0 || fiber_is_root_p(fiber)) {
- rb_raise(rb_eFiberError, "double resume");
- }
-
- if (fiber->transferred != 0) {
- rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
+ if (fib->transferred != 0) {
+ rb_raise(rb_eFiberError, "cannot resume transferred Fiber");
}
- return fiber_switch(fiber, argc, argv, 1, kw_splat);
-}
-
-VALUE
-rb_fiber_resume(VALUE fiber_value, int argc, const VALUE *argv)
-{
- return rb_fiber_resume_kw(fiber_value, argc, argv, RB_NO_KEYWORDS);
-}
-
-VALUE
-rb_fiber_yield_kw(int argc, const VALUE *argv, int kw_splat)
-{
- return fiber_switch(return_fiber(), argc, argv, 0, kw_splat);
+ return fiber_switch(fib, argc, argv, 1);
}
VALUE
rb_fiber_yield(int argc, const VALUE *argv)
{
- return fiber_switch(return_fiber(), argc, argv, 0, RB_NO_KEYWORDS);
+ return fiber_switch(return_fiber(), argc, argv, 0);
}
void
-rb_fiber_reset_root_local_storage(rb_thread_t *th)
+rb_fiber_reset_root_local_storage(VALUE thval)
{
- if (th->root_fiber && th->root_fiber != th->ec->fiber_ptr) {
- th->ec->local_storage = th->root_fiber->cont.saved_ec.local_storage;
+ rb_thread_t *th;
+
+ GetThreadPtr(thval, th);
+ if (th->root_fiber && th->root_fiber != th->fiber) {
+ th->local_storage = th->root_fiber->cont.saved_thread.local_storage;
}
}
@@ -2134,56 +1524,32 @@ rb_fiber_reset_root_local_storage(rb_thread_t *th)
* before using this method.
*/
VALUE
-rb_fiber_alive_p(VALUE fiber_value)
+rb_fiber_alive_p(VALUE fibval)
{
- return FIBER_TERMINATED_P(fiber_ptr(fiber_value)) ? Qfalse : Qtrue;
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ return fib->status != TERMINATED ? Qtrue : Qfalse;
}
/*
* call-seq:
* fiber.resume(args, ...) -> obj
*
- * Resumes the fiber from the point at which the last Fiber.yield was
- * called, or starts running it if it is the first call to
- * #resume. Arguments passed to resume will be the value of the
- * Fiber.yield expression or will be passed as block parameters to
- * the fiber's block if this is the first #resume.
+ * Resumes the fiber from the point at which the last <code>Fiber.yield</code>
+ * was called, or starts running it if it is the first call to
+ * <code>resume</code>. Arguments passed to resume will be the value of
+ * the <code>Fiber.yield</code> expression or will be passed as block
+ * parameters to the fiber's block if this is the first <code>resume</code>.
*
* Alternatively, when resume is called it evaluates to the arguments passed
- * to the next Fiber.yield statement inside the fiber's block
+ * to the next <code>Fiber.yield</code> statement inside the fiber's block
* or to the block value if it runs to completion without any
- * Fiber.yield
- */
-static VALUE
-rb_fiber_m_resume(int argc, VALUE *argv, VALUE fiber)
-{
- return rb_fiber_resume_kw(fiber, argc, argv, PASS_KW_SPLAT);
-}
-
-/*
- * call-seq:
- * fiber.raise -> obj
- * fiber.raise(string) -> obj
- * fiber.raise(exception [, string [, array]]) -> obj
- *
- * Raises an exception in the fiber at the point at which the last
- * Fiber.yield was called, or at the start if neither +resume+
- * nor +raise+ were called before.
- *
- * With no arguments, raises a +RuntimeError+. With a single +String+
- * argument, raises a +RuntimeError+ with the string as a message. Otherwise,
- * the first parameter should be the name of an +Exception+ class (or an
- * object that returns an +Exception+ object when sent an +exception+
- * message). The optional second parameter sets the message associated with
- * the exception, and the third parameter is an array of callback information.
- * Exceptions are caught by the +rescue+ clause of <code>begin...end</code>
- * blocks.
+ * <code>Fiber.yield</code>
*/
static VALUE
-rb_fiber_raise(int argc, VALUE *argv, VALUE fiber)
+rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
{
- VALUE exc = rb_make_exception(argc, argv);
- return rb_fiber_resume_kw(fiber, -1, &exc, RB_NO_KEYWORDS);
+ return rb_fiber_resume(fib, argc, argv);
}
/*
@@ -2193,25 +1559,22 @@ rb_fiber_raise(int argc, VALUE *argv, VALUE fiber)
* Transfer control to another fiber, resuming it from where it last
* stopped or starting it if it was not resumed before. The calling
* fiber will be suspended much like in a call to
- * Fiber.yield. You need to <code>require 'fiber'</code>
+ * <code>Fiber.yield</code>. You need to <code>require 'fiber'</code>
* before using this method.
*
* The fiber which receives the transfer call is treats it much like
* a resume call. Arguments passed to transfer are treated like those
* passed to resume.
*
- * You cannot call +resume+ on a fiber that has been transferred to.
- * If you call +transfer+ on a fiber, and later call +resume+ on the
- * the fiber, a +FiberError+ will be raised. Once you call +transfer+ on
- * a fiber, the only way to resume processing the fiber is to
- * call +transfer+ on it again.
+ * You cannot resume a fiber that transferred control to another one.
+ * This will cause a double resume error. You need to transfer control
+ * back to this fiber before it can yield and resume.
*
* Example:
*
* fiber1 = Fiber.new do
* puts "In Fiber 1"
* Fiber.yield
- * puts "In Fiber 1 again"
* end
*
* fiber2 = Fiber.new do
@@ -2226,24 +1589,21 @@ rb_fiber_raise(int argc, VALUE *argv, VALUE fiber)
*
* fiber2.resume
* fiber3.resume
- * fiber1.resume rescue (p $!)
- * fiber1.transfer
*
* <em>produces</em>
*
- * In Fiber 2
- * In Fiber 1
- * In Fiber 3
- * #<FiberError: cannot resume transferred Fiber>
- * In Fiber 1 again
+ * In fiber 2
+ * In fiber 1
+ * In fiber 3
*
*/
static VALUE
-rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fiber_value)
+rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
{
- rb_fiber_t *fiber = fiber_ptr(fiber_value);
- fiber->transferred = 1;
- return fiber_switch(fiber, argc, argv, 0, PASS_KW_SPLAT);
+ rb_fiber_t *fib;
+ GetFiberPtr(fibval, fib);
+ fib->transferred = 1;
+ return fiber_switch(fib, argc, argv, 0);
}
/*
@@ -2252,14 +1612,14 @@ rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fiber_value)
*
* Yields control back to the context that resumed the fiber, passing
* along any arguments that were passed to it. The fiber will resume
- * processing at this point when #resume is called next.
- * Any arguments passed to the next #resume will be the value that
- * this Fiber.yield expression evaluates to.
+ * processing at this point when <code>resume</code> is called next.
+ * Any arguments passed to the next <code>resume</code> will be the
+ * value that this <code>Fiber.yield</code> expression evaluates to.
*/
static VALUE
rb_fiber_s_yield(int argc, VALUE *argv, VALUE klass)
{
- return rb_fiber_yield_kw(argc, argv, PASS_KW_SPLAT);
+ return rb_fiber_yield(argc, argv);
}
/*
@@ -2276,119 +1636,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 fiber_value)
-{
- const rb_fiber_t *fiber = fiber_ptr(fiber_value);
- const rb_proc_t *proc;
- char status_info[0x20];
-
- if (fiber->transferred) {
- snprintf(status_info, 0x20, " (%s, transferred)", fiber_status_name(fiber->status));
- }
- else {
- snprintf(status_info, 0x20, " (%s)", fiber_status_name(fiber->status));
- }
-
- if (!rb_obj_is_proc(fiber->first_proc)) {
- VALUE str = rb_any_to_s(fiber_value);
- 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(fiber->first_proc, proc);
- return rb_block_to_s(fiber_value, &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->prev = 0;
- }
-}
-#endif
-#ifdef RB_EXPERIMENTAL_FIBER_POOL
-static void
-fiber_pool_free(void *ptr)
-{
- struct fiber_pool * fiber_pool = ptr;
- RUBY_FREE_ENTER("fiber_pool");
-
- fiber_pool_free_allocations(fiber_pool->allocations);
- ruby_xfree(fiber_pool);
-
- RUBY_FREE_LEAVE("fiber_pool");
-}
-
-static size_t
-fiber_pool_memsize(const void *ptr)
-{
- const struct fiber_pool * fiber_pool = ptr;
- size_t size = sizeof(*fiber_pool);
-
- size += fiber_pool->count * fiber_pool->size;
-
- return size;
-}
-
-static const rb_data_type_t FiberPoolDataType = {
- "fiber_pool",
- {NULL, fiber_pool_free, fiber_pool_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
-};
-
-static VALUE
-fiber_pool_alloc(VALUE klass)
-{
- struct fiber_pool * fiber_pool = RB_ALLOC(struct fiber_pool);
-
- return TypedData_Wrap_Struct(klass, &FiberPoolDataType, fiber_pool);
-}
-
-static VALUE
-rb_fiber_pool_initialize(int argc, VALUE* argv, VALUE self)
-{
- rb_thread_t *th = GET_THREAD();
- VALUE size = Qnil, count = Qnil, vm_stack_size = Qnil;
- struct fiber_pool * fiber_pool = NULL;
-
- // Maybe these should be keyword arguments.
- rb_scan_args(argc, argv, "03", &size, &count, &vm_stack_size);
-
- if (NIL_P(size)) {
- size = INT2NUM(th->vm->default_params.fiber_machine_stack_size);
- }
-
- if (NIL_P(count)) {
- count = INT2NUM(128);
- }
-
- if (NIL_P(vm_stack_size)) {
- vm_stack_size = INT2NUM(th->vm->default_params.fiber_vm_stack_size);
- }
-
- TypedData_Get_Struct(self, struct fiber_pool, &FiberPoolDataType, fiber_pool);
-
- fiber_pool_initialize(fiber_pool, NUM2SIZET(size), NUM2SIZET(count), NUM2SIZET(vm_stack_size));
-
- return self;
-}
-#endif
/*
* Document-class: FiberError
@@ -2406,10 +1654,8 @@ rb_fiber_pool_initialize(int argc, VALUE* argv, VALUE self)
void
Init_Cont(void)
{
+#if FIBER_USE_NATIVE
rb_thread_t *th = GET_THREAD();
- size_t vm_stack_size = th->vm->default_params.fiber_vm_stack_size;
- size_t machine_stack_size = th->vm->default_params.fiber_machine_stack_size;
- size_t stack_size = machine_stack_size + vm_stack_size;
#ifdef _WIN32
SYSTEM_INFO info;
@@ -2418,30 +1664,15 @@ Init_Cont(void)
#else /* not WIN32 */
pagesize = sysconf(_SC_PAGESIZE);
#endif
- SET_MACHINE_STACK_END(&th->ec->machine.stack_end);
-
- fiber_pool_initialize(&shared_fiber_pool, stack_size, FIBER_POOL_INITIAL_SIZE, vm_stack_size);
-
- char * fiber_shared_fiber_pool_free_stacks = getenv("RUBY_SHARED_FIBER_POOL_FREE_STACKS");
- if (fiber_shared_fiber_pool_free_stacks) {
- shared_fiber_pool.free_stacks = atoi(fiber_shared_fiber_pool_free_stacks);
- }
+ SET_MACHINE_STACK_END(&th->machine.stack_end);
+#endif
rb_cFiber = rb_define_class("Fiber", rb_cObject);
rb_define_alloc_func(rb_cFiber, fiber_alloc);
rb_eFiberError = rb_define_class("FiberError", rb_eStandardError);
rb_define_singleton_method(rb_cFiber, "yield", rb_fiber_s_yield, -1);
- rb_define_method(rb_cFiber, "initialize", rb_fiber_initialize, -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, "raise", rb_fiber_raise, -1);
- rb_define_method(rb_cFiber, "to_s", fiber_to_s, 0);
- rb_define_alias(rb_cFiber, "inspect", "to_s");
-
-#ifdef RB_EXPERIMENTAL_FIBER_POOL
- rb_cFiberPool = rb_define_class("Pool", rb_cFiber);
- rb_define_alloc_func(rb_cFiberPool, fiber_pool_alloc);
- rb_define_method(rb_cFiberPool, "initialize", rb_fiber_pool_initialize, -1);
-#endif
}
RUBY_SYMBOL_EXPORT_BEGIN
diff --git a/coroutine/amd64/Context.S b/coroutine/amd64/Context.S
deleted file mode 100644
index ac986b2aa5..0000000000
--- a/coroutine/amd64/Context.S
+++ /dev/null
@@ -1,46 +0,0 @@
-##
-## This file is part of the "Coroutine" project and released under the MIT License.
-##
-## Created by Samuel Williams on 10/5/2018.
-## Copyright, 2018, by Samuel Williams. All rights reserved.
-##
-
-#define TOKEN_PASTE(x,y) x##y
-#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name)
-
-.text
-
-.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
-PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer):
-
- # Save caller state
- pushq %rbp
- pushq %rbx
- pushq %r12
- pushq %r13
- pushq %r14
- pushq %r15
-
- # Save caller stack pointer
- movq %rsp, (%rdi)
-
- # Restore callee stack pointer
- movq (%rsi), %rsp
-
- # Restore callee state
- popq %r15
- popq %r14
- popq %r13
- popq %r12
- popq %rbx
- popq %rbp
-
- # Put the first argument into the return value
- movq %rdi, %rax
-
- # We pop the return address and jump to it
- ret
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/coroutine/amd64/Context.h b/coroutine/amd64/Context.h
deleted file mode 100644
index 8fe323c1a1..0000000000
--- a/coroutine/amd64/Context.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 10/5/2018.
- * Copyright, 2018, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __attribute__((noreturn)) void
-
-enum {COROUTINE_REGISTERS = 6};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef COROUTINE(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- *--context->stack_pointer = NULL;
- *--context->stack_pointer = (void*)start;
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
-}
-
-struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target);
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
- context->stack_pointer = NULL;
-}
diff --git a/coroutine/arm32/Context.S b/coroutine/arm32/Context.S
deleted file mode 100644
index 4308e1d1d2..0000000000
--- a/coroutine/arm32/Context.S
+++ /dev/null
@@ -1,22 +0,0 @@
-##
-## This file is part of the "Coroutine" project and released under the MIT License.
-##
-## Created by Samuel Williams on 10/5/2018.
-## Copyright, 2018, by Samuel Williams. All rights reserved.
-##
-
-.text
-
-.globl coroutine_transfer
-coroutine_transfer:
- # Save caller state (8 registers + return address)
- push {r4-r11,lr}
-
- # Save caller stack pointer
- str sp, [r0]
-
- # Restore callee stack pointer
- ldr sp, [r1]
-
- # Restore callee state (8 registers program counter)
- pop {r4-r11,pc}
diff --git a/coroutine/arm32/Context.h b/coroutine/arm32/Context.h
deleted file mode 100644
index e29fe1bb63..0000000000
--- a/coroutine/arm32/Context.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 10/5/2018.
- * Copyright, 2018, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __attribute__((noreturn)) void
-#define COROUTINE_LIMITED_ADDRESS_SPACE
-
-enum {COROUTINE_REGISTERS = 8};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef COROUTINE(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- *--context->stack_pointer = (void*)start;
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
-}
-
-struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target);
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
-}
diff --git a/coroutine/arm64/Context.S b/coroutine/arm64/Context.S
deleted file mode 100644
index f6e5f0a6bc..0000000000
--- a/coroutine/arm64/Context.S
+++ /dev/null
@@ -1,59 +0,0 @@
-##
-## This file is part of the "Coroutine" project and released under the MIT License.
-##
-## Created by Samuel Williams on 10/5/2018.
-## Copyright, 2018, by Samuel Williams. All rights reserved.
-##
-
-.text
-.align 2
-
-.global coroutine_transfer
-coroutine_transfer:
-
- # Make space on the stack for caller registers
- sub sp, sp, 0xb0
-
- # Save caller registers
- stp d8, d9, [sp, 0x00]
- stp d10, d11, [sp, 0x10]
- stp d12, d13, [sp, 0x20]
- stp d14, d15, [sp, 0x30]
- stp x19, x20, [sp, 0x40]
- stp x21, x22, [sp, 0x50]
- stp x23, x24, [sp, 0x60]
- stp x25, x26, [sp, 0x70]
- stp x27, x28, [sp, 0x80]
- stp x29, x30, [sp, 0x90]
-
- # Save return address
- str x30, [sp, 0xa0]
-
- # Save stack pointer to x0 (first argument)
- mov x2, sp
- str x2, [x0, 0]
-
- # Load stack pointer from x1 (second argument)
- ldr x3, [x1, 0]
- mov sp, x3
-
- # Restore caller registers
- ldp d8, d9, [sp, 0x00]
- ldp d10, d11, [sp, 0x10]
- ldp d12, d13, [sp, 0x20]
- ldp d14, d15, [sp, 0x30]
- ldp x19, x20, [sp, 0x40]
- ldp x21, x22, [sp, 0x50]
- ldp x23, x24, [sp, 0x60]
- ldp x25, x26, [sp, 0x70]
- ldp x27, x28, [sp, 0x80]
- ldp x29, x30, [sp, 0x90]
-
- # Load return address into x4
- ldr x4, [sp, 0xa0]
-
- # Pop stack frame
- add sp, sp, 0xb0
-
- # Jump to return address (in x4)
- ret x4
diff --git a/coroutine/arm64/Context.h b/coroutine/arm64/Context.h
deleted file mode 100644
index a1ae921144..0000000000
--- a/coroutine/arm64/Context.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 10/5/2018.
- * Copyright, 2018, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __attribute__((noreturn)) void
-
-enum {COROUTINE_REGISTERS = 0xb0 / 8};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef COROUTINE(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
-
- context->stack_pointer[0xa0 / 8] = (void*)start;
-}
-
-struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target);
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
-}
diff --git a/coroutine/copy/Context.c b/coroutine/copy/Context.c
deleted file mode 100644
index a1b8a71200..0000000000
--- a/coroutine/copy/Context.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 24/6/2019.
- * Copyright, 2019, by Samuel Williams. All rights reserved.
-*/
-
-#include "Context.h"
-
-// http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
-#ifndef __GNUC__
-#define __asm__ asm
-#endif
-
-#if defined(__sparc)
-__attribute__((noinline))
-// https://marc.info/?l=linux-sparc&m=131914569320660&w=2
-static void coroutine_flush_register_windows() {
- __asm__
-#ifdef __GNUC__
- __volatile__
-#endif
-#if defined(__sparcv9) || defined(__sparc_v9__) || defined(__arch64__)
-#ifdef __GNUC__
- ("flushw" : : : "%o7")
-#else
- ("flushw")
-#endif
-#else
- ("ta 0x03")
-#endif
- ;
-}
-#else
-static void coroutine_flush_register_windows() {}
-#endif
-
-int coroutine_save_stack(struct coroutine_context * context) {
- void *stack_pointer = &stack_pointer;
-
- assert(context->stack);
- assert(context->base);
-
- // At this point, you may need to ensure on architectures that use register windows, that all registers are flushed to the stack.
- coroutine_flush_register_windows();
-
- // Save stack to private area:
- if (stack_pointer < context->base) {
- size_t size = (char*)context->base - (char*)stack_pointer;
- assert(size <= context->size);
-
- memcpy(context->stack, stack_pointer, size);
- context->used = size;
- } else {
- size_t size = (char*)stack_pointer - (char*)context->base;
- assert(size <= context->size);
-
- memcpy(context->stack, context->base, size);
- context->used = size;
- }
-
- // Save registers / restore point:
- return _setjmp(context->state);
-}
-
-__attribute__((noreturn, noinline))
-static void coroutine_restore_stack_padded(struct coroutine_context *context, void * buffer) {
- void *stack_pointer = &stack_pointer;
-
- assert(context->base);
-
- // Restore stack from private area:
- if (stack_pointer < context->base) {
- void * bottom = (char*)context->base - context->used;
- assert(bottom > stack_pointer);
-
- memcpy(bottom, context->stack, context->used);
- } else {
- void * top = (char*)context->base + context->used;
- assert(top < stack_pointer);
-
- memcpy(context->base, context->stack, context->used);
- }
-
- // Restore registers:
- // The `| (int)buffer` is to force the compiler NOT to elide he buffer and `alloca`.
- _longjmp(context->state, 1 | (int)buffer);
-}
-
-static const size_t GAP = 128;
-
-// In order to swap between coroutines, we need to swap the stack and registers.
-// `setjmp` and `longjmp` are able to swap registers, but what about swapping stacks? You can use `memcpy` to copy the current stack to a private area and `memcpy` to copy the private stack of the next coroutine to the main stack.
-// But if the stack yop are copying in to the main stack is bigger than the currently executing stack, the `memcpy` will clobber the current stack frame (including the context argument). So we use `alloca` to push the current stack frame *beyond* the stack we are about to copy in. This ensures the current stack frame in `coroutine_restore_stack_padded` remains valid for calling `longjmp`.
-__attribute__((noreturn))
-void coroutine_restore_stack(struct coroutine_context *context) {
- void *stack_pointer = &stack_pointer;
- void *buffer = NULL;
- ssize_t offset = 0;
-
- // We must ensure that the next stack frame is BEYOND the stack we are restoring:
- if (stack_pointer < context->base) {
- offset = (char*)stack_pointer - ((char*)context->base - context->used) + GAP;
- if (offset > 0) buffer = alloca(offset);
- } else {
- offset = ((char*)context->base + context->used) - (char*)stack_pointer + GAP;
- if (offset > 0) buffer = alloca(offset);
- }
-
- assert(context->used > 0);
-
- coroutine_restore_stack_padded(context, buffer);
-}
-
-struct coroutine_context *coroutine_transfer(struct coroutine_context *current, struct coroutine_context *target)
-{
- struct coroutine_context *previous = target->from;
-
- // In theory, either this condition holds true, or we should assign the base address to target:
- assert(current->base == target->base);
- // If you are trying to copy the coroutine to a different thread
- // target->base = current->base
-
- target->from = current;
-
- assert(current != target);
-
- // It's possible to come here, even thought the current fiber has been terminated. We are never going to return so we don't bother saving the stack.
-
- if (current->stack) {
- if (coroutine_save_stack(current) == 0) {
- coroutine_restore_stack(target);
- }
- } else {
- coroutine_restore_stack(target);
- }
-
- target->from = previous;
-
- return target;
-}
diff --git a/coroutine/copy/Context.h b/coroutine/copy/Context.h
deleted file mode 100644
index 1319f55d16..0000000000
--- a/coroutine/copy/Context.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 27/6/2019.
- * Copyright, 2019, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <stddef.h>
-#include <setjmp.h>
-#include <string.h>
-#include <stdlib.h>
-#include <alloca.h>
-
-#define COROUTINE __attribute__((noreturn)) void
-
-#if INTPTR_MAX <= INT32_MAX
-#define COROUTINE_LIMITED_ADDRESS_SPACE
-#endif
-
-// This stack copying implementation which uses a private stack for each coroutine, including the main one.
-#define COROUTINE_PRIVATE_STACK
-
-struct coroutine_context
-{
- // Private stack:
- void *stack;
- size_t size, used;
-
- // The top (or bottom) of the currently executing stack:
- void *base;
-
- jmp_buf state;
-
- struct coroutine_context *from;
-};
-
-typedef COROUTINE(*coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-int coroutine_save_stack(struct coroutine_context * context);
-COROUTINE coroutine_restore_stack(struct coroutine_context *context);
-
-// @param stack The private stack area memory allocation (pointer to lowest address).
-// @param size The size of the private stack area.
-// @param base A stack pointer to the base of the main stack. On x86 hardware, this is the upper extent of the region that will be copied to the private stack.
-static inline void coroutine_initialize_main(struct coroutine_context *context, void *stack, size_t size, void *base) {
- assert(stack);
- assert(size >= 1024);
-
- context->stack = stack;
- context->size = size;
- context->used = 0;
-
- assert(base);
- context->base = base;
-
- context->from = NULL;
-}
-
-// @param start The start function to invoke.
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size,
- void *base
-) {
- assert(start);
-
- coroutine_initialize_main(context, stack, size, base);
-
- if (coroutine_save_stack(context)) {
- start(context->from, context);
- }
-}
-
-struct coroutine_context *coroutine_transfer(struct coroutine_context *current, register struct coroutine_context *target);
-
-static inline void coroutine_destroy(struct coroutine_context *context)
-{
- context->stack = NULL;
- context->size = 0;
- context->from = NULL;
-}
diff --git a/coroutine/ppc64le/Context.S b/coroutine/ppc64le/Context.S
deleted file mode 100644
index 1b39086f8f..0000000000
--- a/coroutine/ppc64le/Context.S
+++ /dev/null
@@ -1,72 +0,0 @@
-.text
-.align 2
-
-.globl coroutine_transfer
-.type coroutine_transfer, @function
-coroutine_transfer:
- # Make space on the stack for caller registers
- addi 1,1,-152
-
- # Save caller registers
- std 14,0(1)
- std 15,8(1)
- std 16,16(1)
- std 17,24(1)
- std 18,32(1)
- std 19,40(1)
- std 20,48(1)
- std 21,56(1)
- std 22,64(1)
- std 23,72(1)
- std 24,80(1)
- std 25,88(1)
- std 26,96(1)
- std 27,104(1)
- std 28,112(1)
- std 29,120(1)
- std 30,128(1)
- std 31,136(1)
-
- # Save return address
- mflr 0
- std 0,144(1)
-
- # Save stack pointer to first argument
- std 1,0(3)
-
- # Load stack pointer from second argument
- ld 1,0(4)
-
- # Restore caller registers
- ld 14,0(1)
- ld 15,8(1)
- ld 16,16(1)
- ld 17,24(1)
- ld 18,32(1)
- ld 19,40(1)
- ld 20,48(1)
- ld 21,56(1)
- ld 22,64(1)
- ld 23,72(1)
- ld 24,80(1)
- ld 25,88(1)
- ld 26,96(1)
- ld 27,104(1)
- ld 28,112(1)
- ld 29,120(1)
- ld 30,128(1)
- ld 31,136(1)
-
- # Load return address
- ld 0,144(1)
- mtlr 0
-
- # Pop stack frame
- addi 1,1,152
-
- # Jump to return address
- blr
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/coroutine/ppc64le/Context.h b/coroutine/ppc64le/Context.h
deleted file mode 100644
index adf21b4fd9..0000000000
--- a/coroutine/ppc64le/Context.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __attribute__((noreturn)) void
-
-enum {
- COROUTINE_REGISTERS =
- 19 /* 18 general purpose registers (r14-r31) and 1 return address */
- + 4 /* space for fiber_entry() to store the link register */
-};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef COROUTINE(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
-
- /* Skip a global prologue that sets the TOC register */
- context->stack_pointer[18] = ((char*)start) + 8;
-}
-
-struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target);
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
- context->stack_pointer = NULL;
-}
diff --git a/coroutine/ucontext/Context.c b/coroutine/ucontext/Context.c
deleted file mode 100644
index eec4ef3956..0000000000
--- a/coroutine/ucontext/Context.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 24/6/2019.
- * Copyright, 2019, by Samuel Williams. All rights reserved.
-*/
-
-/* According to Solaris' ucontext.h, makecontext, etc. are removed in SUSv4.
- * To enable the prototype declarations, we need to define __EXTENSIONS__.
- */
-#if defined(__sun) && !defined(__EXTENSIONS__)
-#define __EXTENSIONS__
-#endif
-#include "Context.h"
-
-void coroutine_trampoline(void * _start, void * _context)
-{
- coroutine_start start = _start;
- struct coroutine_context * context = _context;
-
- start(context->from, context);
-}
diff --git a/coroutine/ucontext/Context.h b/coroutine/ucontext/Context.h
deleted file mode 100644
index 6cf16c8604..0000000000
--- a/coroutine/ucontext/Context.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 24/6/2019.
- * Copyright, 2019, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <stddef.h>
-#include <ucontext.h>
-
-#define COROUTINE __attribute__((noreturn)) void
-
-#if INTPTR_MAX <= INT32_MAX
-#define COROUTINE_LIMITED_ADDRESS_SPACE
-#endif
-
-struct coroutine_context
-{
- ucontext_t state;
- struct coroutine_context * from;
-};
-
-typedef COROUTINE(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-COROUTINE coroutine_trampoline(void * _start, void * _context);
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->from = NULL;
- getcontext(&context->state);
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- coroutine_initialize_main(context);
-
- context->state.uc_stack.ss_size = size;
- // Despite what it's called, this is not actually a stack pointer. It points to the address of the stack allocation (the lowest address).
- context->state.uc_stack.ss_sp = (char*)stack;
- context->state.uc_stack.ss_flags = 0;
- context->state.uc_link = NULL;
-
- makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
-}
-
-static inline struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target)
-{
- struct coroutine_context * previous = target->from;
-
- target->from = current;
- swapcontext(&current->state, &target->state);
- target->from = previous;
-
- return target;
-}
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
- context->state.uc_stack.ss_sp = NULL;
- context->state.uc_stack.ss_size = 0;
- context->from = NULL;
-}
diff --git a/coroutine/win32/Context.S b/coroutine/win32/Context.S
deleted file mode 100644
index d14bf435e8..0000000000
--- a/coroutine/win32/Context.S
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## This file is part of the "Coroutine" project and released under the MIT License.
-##
-## Created by Lars Kanis on 06/06/2019.
-##
-
-.text
-
-# Using fastcall is a big win (and it's the same as how x64 works).
-# In coroutine transfer, the arguments are passed in ecx and edx. We don't need
-# to touch these in order to pass them to the destination coroutine.
-
-.globl @coroutine_transfer@8
-@coroutine_transfer@8:
- # Save the thread information block:
- pushl %fs:0
- pushl %fs:4
- pushl %fs:8
-
- # Save caller registers:
- pushl %ebp
- pushl %ebx
- pushl %edi
- pushl %esi
-
- # Save caller stack pointer:
- movl %esp, (%ecx)
-
- # Restore callee stack pointer:
- movl (%edx), %esp
-
- # Restore callee stack:
- popl %esi
- popl %edi
- popl %ebx
- popl %ebp
-
- # Restore the thread information block:
- popl %fs:8
- popl %fs:4
- popl %fs:0
-
- # Save the first argument as the return value:
- movl %ecx, %eax
-
- # Jump to the address on the stack:
- ret
diff --git a/coroutine/win32/Context.asm b/coroutine/win32/Context.asm
deleted file mode 100644
index 2647ea4bc4..0000000000
--- a/coroutine/win32/Context.asm
+++ /dev/null
@@ -1,55 +0,0 @@
-;;
-;; This file is part of the "Coroutine" project and released under the MIT License.
-;;
-;; Created by Samuel Williams on 10/5/2018.
-;; Copyright, 2018, by Samuel Williams. All rights reserved.
-;;
-
-.386
-.model flat
-
-.code
-
-assume fs:nothing
-
-; Using fastcall is a big win (and it's the same has how x64 works).
-; In coroutine transfer, the arguments are passed in ecx and edx. We don't need
-; to touch these in order to pass them to the destination coroutine.
-
-@coroutine_transfer@8 proc
- ; Save the thread information block:
- push fs:[0]
- push fs:[4]
- push fs:[8]
-
- ; Save caller registers:
- push ebp
- push ebx
- push edi
- push esi
-
- ; Save caller stack pointer:
- mov dword ptr [ecx], esp
-
- ; Restore callee stack pointer:
- mov esp, dword ptr [edx]
-
- ; Restore callee stack:
- pop esi
- pop edi
- pop ebx
- pop ebp
-
- ; Restore the thread information block:
- pop fs:[8]
- pop fs:[4]
- pop fs:[0]
-
- ; Save the first argument as the return value:
- mov eax, dword ptr ecx
-
- ; Jump to the address on the stack:
- ret
-@coroutine_transfer@8 endp
-
-end
diff --git a/coroutine/win32/Context.h b/coroutine/win32/Context.h
deleted file mode 100644
index 299515ed92..0000000000
--- a/coroutine/win32/Context.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 10/5/2018.
- * Copyright, 2018, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __declspec(noreturn) void __fastcall
-#define COROUTINE_LIMITED_ADDRESS_SPACE
-
-/* This doesn't include thread information block */
-enum {COROUTINE_REGISTERS = 4};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef void(__fastcall * coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- *--context->stack_pointer = (void*)start;
-
- /* Windows Thread Information Block */
- *--context->stack_pointer = (void*)0xFFFFFFFF; /* fs:[0] */
- *--context->stack_pointer = (void*)top; /* fs:[4] */
- *--context->stack_pointer = (void*)stack; /* fs:[8] */
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
-}
-
-struct coroutine_context * __fastcall coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target);
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
-}
diff --git a/coroutine/win64/Context.S b/coroutine/win64/Context.S
deleted file mode 100644
index 4b16e0ce8c..0000000000
--- a/coroutine/win64/Context.S
+++ /dev/null
@@ -1,77 +0,0 @@
-##
-## This file is part of the "Coroutine" project and released under the MIT License.
-##
-## Created by Samuel Williams on 4/11/2018.
-## Copyright, 2018, by Samuel Williams. All rights reserved.
-##
-
-.text
-
-.globl coroutine_transfer
-coroutine_transfer:
- # Save the thread information block:
- pushq %gs:8
- pushq %gs:16
-
- # Save caller registers:
- pushq %rbp
- pushq %rbx
- pushq %rdi
- pushq %rsi
- pushq %r12
- pushq %r13
- pushq %r14
- pushq %r15
-
- movaps %xmm15, -168(%rsp)
- movaps %xmm14, -152(%rsp)
- movaps %xmm13, -136(%rsp)
- movaps %xmm12, -120(%rsp)
- movaps %xmm11, -104(%rsp)
- movaps %xmm10, -88(%rsp)
- movaps %xmm9, -72(%rsp)
- movaps %xmm8, -56(%rsp)
- movaps %xmm7, -40(%rsp)
- movaps %xmm6, -24(%rsp)
-
- # Save caller stack pointer:
- mov %rsp, (%rcx)
-
- # Restore callee stack pointer:
- mov (%rdx), %rsp
-
- movaps -24(%rsp), %xmm6
- movaps -40(%rsp), %xmm7
- movaps -56(%rsp), %xmm8
- movaps -72(%rsp), %xmm9
- movaps -88(%rsp), %xmm10
- movaps -104(%rsp), %xmm11
- movaps -120(%rsp), %xmm12
- movaps -136(%rsp), %xmm13
- movaps -152(%rsp), %xmm14
- movaps -168(%rsp), %xmm15
-
- # Restore callee stack:
- popq %r15
- popq %r14
- popq %r13
- popq %r12
- popq %rsi
- popq %rdi
- popq %rbx
- popq %rbp
-
- # Restore the thread information block:
- popq %gs:16
- popq %gs:8
-
- # Put the first argument into the return value:
- mov %rcx, %rax
-
- # We pop the return address and jump to it:
- ret
-
-.globl coroutine_trampoline
-coroutine_trampoline:
- # Do not remove this. This forces 16-byte alignment when entering the coroutine.
- ret
diff --git a/coroutine/win64/Context.asm b/coroutine/win64/Context.asm
deleted file mode 100644
index 59673ffa3e..0000000000
--- a/coroutine/win64/Context.asm
+++ /dev/null
@@ -1,79 +0,0 @@
-;;
-;; This file is part of the "Coroutine" project and released under the MIT License.
-;;
-;; Created by Samuel Williams on 10/5/2018.
-;; Copyright, 2018, by Samuel Williams. All rights reserved.
-;;
-
-.code
-
-coroutine_transfer proc
- ; Save the thread information block:
- push qword ptr gs:[8]
- push qword ptr gs:[16]
-
- ; Save caller registers:
- push rbp
- push rbx
- push rdi
- push rsi
- push r12
- push r13
- push r14
- push r15
-
- movaps [rsp - 24], xmm6
- movaps [rsp - 40], xmm7
- movaps [rsp - 56], xmm8
- movaps [rsp - 72], xmm9
- movaps [rsp - 88], xmm10
- movaps [rsp - 104], xmm11
- movaps [rsp - 120], xmm12
- movaps [rsp - 136], xmm13
- movaps [rsp - 152], xmm14
- movaps [rsp - 168], xmm15
-
- ; Save caller stack pointer:
- mov [rcx], rsp
-
- ; Restore callee stack pointer:
- mov rsp, [rdx]
-
- movaps xmm15, [rsp - 168]
- movaps xmm14, [rsp - 152]
- movaps xmm13, [rsp - 136]
- movaps xmm12, [rsp - 120]
- movaps xmm11, [rsp - 104]
- movaps xmm10, [rsp - 88]
- movaps xmm9, [rsp - 72]
- movaps xmm8, [rsp - 56]
- movaps xmm7, [rsp - 40]
- movaps xmm6, [rsp - 24]
-
- ; Restore callee stack:
- pop r15
- pop r14
- pop r13
- pop r12
- pop rsi
- pop rdi
- pop rbx
- pop rbp
-
- ; Restore the thread information block:
- pop qword ptr gs:[16]
- pop qword ptr gs:[8]
-
- ; Put the first argument into the return value:
- mov rax, rcx
-
- ; We pop the return address and jump to it:
- ret
-coroutine_transfer endp
-
-coroutine_trampoline proc
- ; Do not remove this. This forces 16-byte alignment when entering the coroutine.
- ret
-coroutine_trampoline endp
-
-end
diff --git a/coroutine/win64/Context.h b/coroutine/win64/Context.h
deleted file mode 100644
index 6bf2dc5b35..0000000000
--- a/coroutine/win64/Context.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 10/5/2018.
- * Copyright, 2018, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __declspec(noreturn) void
-
-enum {
- COROUTINE_REGISTERS = 8,
- COROUTINE_XMM_REGISTERS = 1+10*2,
-};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef void(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self);
-
-void coroutine_trampoline();
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- /* Win64 ABI requires space for arguments */
- context->stack_pointer -= 4;
-
- /* Return address */
- *--context->stack_pointer = 0;
- *--context->stack_pointer = (void*)start;
- *--context->stack_pointer = (void*)coroutine_trampoline;
-
- /* Windows Thread Information Block */
- /* *--context->stack_pointer = 0; */ /* gs:[0x00] is not used */
- *--context->stack_pointer = (void*)top; /* gs:[0x08] */
- *--context->stack_pointer = (void*)stack; /* gs:[0x10] */
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
- memset(context->stack_pointer - COROUTINE_XMM_REGISTERS, 0, sizeof(void*) * COROUTINE_XMM_REGISTERS);
-}
-
-struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target);
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
-}
diff --git a/coroutine/x86/Context.S b/coroutine/x86/Context.S
deleted file mode 100644
index 001b699a30..0000000000
--- a/coroutine/x86/Context.S
+++ /dev/null
@@ -1,42 +0,0 @@
-##
-## This file is part of the "Coroutine" project and released under the MIT License.
-##
-## Created by Samuel Williams on 3/11/2018.
-## Copyright, 2018, by Samuel Williams. All rights reserved.
-##
-
-#define TOKEN_PASTE(x,y) x##y
-#define PREFIXED_SYMBOL(prefix,name) TOKEN_PASTE(prefix,name)
-
-.text
-
-.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
-PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer):
-
- # Save caller registers
- pushl %ebp
- pushl %ebx
- pushl %edi
- pushl %esi
-
- # Save caller stack pointer
- movl %esp, (%ecx)
-
- # Restore callee stack pointer
- movl (%edx), %esp
-
- # Restore callee stack
- popl %esi
- popl %edi
- popl %ebx
- popl %ebp
-
- # Save the first argument as the return value
- movl %ecx, %eax
-
- # Jump to the address on the stack
- ret
-
-#if defined(__linux__) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/coroutine/x86/Context.h b/coroutine/x86/Context.h
deleted file mode 100644
index 6d3a56eaa6..0000000000
--- a/coroutine/x86/Context.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the "Coroutine" project and released under the MIT License.
- *
- * Created by Samuel Williams on 3/11/2018.
- * Copyright, 2018, by Samuel Williams. All rights reserved.
-*/
-
-#pragma once
-
-#include <assert.h>
-#include <string.h>
-
-#define COROUTINE __attribute__((noreturn, fastcall)) void
-#define COROUTINE_LIMITED_ADDRESS_SPACE
-
-enum {COROUTINE_REGISTERS = 4};
-
-struct coroutine_context
-{
- void **stack_pointer;
-};
-
-typedef COROUTINE(* coroutine_start)(struct coroutine_context *from, struct coroutine_context *self) __attribute__((fastcall));
-
-static inline void coroutine_initialize_main(struct coroutine_context * context) {
- context->stack_pointer = NULL;
-}
-
-static inline void coroutine_initialize(
- struct coroutine_context *context,
- coroutine_start start,
- void *stack,
- size_t size
-) {
- assert(start && stack && size >= 1024);
-
- // Stack grows down. Force 16-byte alignment.
- char * top = (char*)stack + size;
- context->stack_pointer = (void**)((uintptr_t)top & ~0xF);
-
- *--context->stack_pointer = NULL;
- *--context->stack_pointer = (void*)start;
-
- context->stack_pointer -= COROUTINE_REGISTERS;
- memset(context->stack_pointer, 0, sizeof(void*) * COROUTINE_REGISTERS);
-}
-
-struct coroutine_context * coroutine_transfer(struct coroutine_context * current, struct coroutine_context * target) __attribute__((fastcall));
-
-static inline void coroutine_destroy(struct coroutine_context * context)
-{
- context->stack_pointer = NULL;
-}
diff --git a/coverage/README b/coverage/README
index 78a01826aa..7e4ff59e2a 100644
--- a/coverage/README
+++ b/coverage/README
@@ -4,7 +4,7 @@ The make task `update-coverage' retrieves simplecov for coverage report.
COVERAGE=1 make test-all TESTS=test/cgi
-it generates test coverage to coverage directory.
+it generate test coverage to coverage directory.
Limitation
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 192cf43b37..768a1b6b7f 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,8 +32,6 @@ 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)
RCFILES = $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(DLL_BASE_NAME).rc
@@ -39,6 +39,13 @@ 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 a54be27152..b526ab9523 100644
--- a/debug.c
+++ b/debug.c
@@ -11,12 +11,10 @@
#include "ruby/ruby.h"
#include "ruby/encoding.h"
-#include "ruby/io.h"
#include "ruby/util.h"
#include "vm_debug.h"
#include "eval_intern.h"
#include "vm_core.h"
-#include "symbol.h"
#include "id.h"
/* for gdb */
@@ -27,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)
@@ -90,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;
@@ -115,7 +115,7 @@ ID
ruby_debug_print_id(int level, int debug_level, const char *header, ID id)
{
if (level < debug_level) {
- fprintf(stderr, "DBG> %s: %s\n", header, rb_id2name(id));
+ fprintf(stderr, "DBG> %s: %"PRIsVALUE"\n", header, rb_id2str(id));
fflush(stderr);
}
return id;
@@ -137,89 +137,25 @@ 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;
-extern int ruby_on_ci;
-
-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;
+#if defined _WIN32 && RUBY_MSVCRT_VERSION >= 80
+ extern int ruby_w32_rtc_error;
+#endif
#define SET_WHEN(name, var, val) do { \
if (len == sizeof(name) - 1 && \
strncmp(str, (name), len) == 0) { \
(var) = (val); \
- return 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);
- SET_WHEN("ci", ruby_on_ci, 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
+#if defined _WIN32 && RUBY_MSVCRT_VERSION >= 80
SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
-# endif
#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 11ec57a961..0000000000
--- a/debug_counter.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/**********************************************************************
-
- debug_counter.c -
-
- created at: Tue Feb 21 16:51:18 2017
-
- Copyright (C) 2017 Koichi Sasada
-
-**********************************************************************/
-
-#include "internal.h"
-#include "debug_counter.h"
-#include <stdio.h>
-#include <locale.h>
-
-#if USE_DEBUG_COUNTER
-static const char *const debug_counter_names[] = {
- ""
-#define RB_DEBUG_COUNTER(name) #name,
-#include "debug_counter.h"
-#undef RB_DEBUG_COUNTER
-};
-
-MJIT_SYMBOL_EXPORT_BEGIN
-size_t rb_debug_counter[numberof(debug_counter_names)];
-MJIT_SYMBOL_EXPORT_END
-
-int debug_counter_disable_show_at_exit = 0;
-
-// note that this operation is not atomic.
-void
-ruby_debug_counter_reset(void)
-{
- for (int i = 0; i < RB_DEBUG_COUNTER_MAX; i++) {
- switch (i) {
- case RB_DEBUG_COUNTER_mjit_length_unit_queue:
- case RB_DEBUG_COUNTER_mjit_length_active_units:
- case RB_DEBUG_COUNTER_mjit_length_compact_units:
- case RB_DEBUG_COUNTER_mjit_length_stale_units:
- // These counters may be decreased and should not be reset.
- break;
- default:
- rb_debug_counter[i] = 0;
- break;
- }
- }
-}
-
-// note that this operation is not atomic.
-size_t
-ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr)
-{
- int i;
- if (names_ptr != NULL) {
- for (i=0; i<RB_DEBUG_COUNTER_MAX; i++) {
- names_ptr[i] = debug_counter_names[i];
- }
- }
- if (counters_ptr != NULL) {
- for (i=0; i<RB_DEBUG_COUNTER_MAX; i++) {
- counters_ptr[i] = rb_debug_counter[i];
- }
- }
-
- return RB_DEBUG_COUNTER_MAX;
-}
-
-void
-ruby_debug_counter_show_at_exit(int enable)
-{
- debug_counter_disable_show_at_exit = !enable;
-}
-
-void
-rb_debug_counter_show_results(const char *msg)
-{
- const char *env = getenv("RUBY_DEBUG_COUNTER_DISABLE");
-
- setlocale(LC_NUMERIC, "");
-
- if (env == NULL || strcmp("1", env) != 0) {
- int i;
- fprintf(stderr, "[RUBY_DEBUG_COUNTER]\t%d %s\n", getpid(), msg);
- for (i=0; i<RB_DEBUG_COUNTER_MAX; i++) {
- fprintf(stderr, "[RUBY_DEBUG_COUNTER]\t%-30s\t%'14"PRIuSIZE"\n",
- debug_counter_names[i],
- rb_debug_counter[i]);
- }
- }
-}
-
-VALUE
-rb_debug_counter_show(RB_UNUSED_VAR(VALUE klass))
-{
- rb_debug_counter_show_results("method call");
- return Qnil;
-}
-
-VALUE
-rb_debug_counter_reset(RB_UNUSED_VAR(VALUE klass))
-{
- ruby_debug_counter_reset();
- return Qnil;
-}
-
-__attribute__((destructor))
-static void
-debug_counter_show_results_at_exit(void)
-{
- if (debug_counter_disable_show_at_exit == 0) {
- rb_debug_counter_show_results("normal exit.");
- }
-}
-#else
-void
-rb_debug_counter_show_results(const char *msg)
-{
-}
-
-size_t
-ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr)
-{
- return 0;
-}
-void
-ruby_debug_counter_reset(void)
-{
-}
-
-void
-ruby_debug_counter_show_at_exit(int enable)
-{
-}
-
-#endif /* USE_DEBUG_COUNTER */
diff --git a/debug_counter.h b/debug_counter.h
deleted file mode 100644
index 066533d1d1..0000000000
--- a/debug_counter.h
+++ /dev/null
@@ -1,390 +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 cache (mc) counts.
- *
- * * mc_inline_hit/miss: inline mc hit/miss counts (VM send insn)
- * * mc_global_hit/miss: global method cache hit/miss counts
- * two types: (1) inline cache miss (VM send insn)
- * (2) called from C (rb_funcall).
- * * mc_global_state_miss: inline mc miss by global_state miss.
- * * mc_class_serial_miss: ... by mc_class_serial_miss
- * * mc_cme_complement: callable_method_entry complement counts.
- * * mc_cme_complement_hit: callable_method_entry cache hit counts.
- * * mc_search_super: search_method() call counts.
- * * mc_miss_by_nome: inline mc miss by no ment.
- * * mc_miss_by_distinct: ... by distinct ment.
- * * mc_miss_by_refine: ... by ment being refined.
- * * mc_miss_by_visi: ... by visibility change.
- * * mc_miss_spurious: spurious inline mc misshit.
- * * mc_miss_reuse_call: count of reuse of cc->call.
- */
-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)
-RB_DEBUG_COUNTER(mc_miss_by_nome)
-RB_DEBUG_COUNTER(mc_miss_by_distinct)
-RB_DEBUG_COUNTER(mc_miss_by_refine)
-RB_DEBUG_COUNTER(mc_miss_by_visi)
-RB_DEBUG_COUNTER(mc_miss_spurious)
-RB_DEBUG_COUNTER(mc_miss_reuse_call)
-
-/*
- * call cache fastpath usage
- */
-RB_DEBUG_COUNTER(ccf_general)
-RB_DEBUG_COUNTER(ccf_iseq_setup)
-RB_DEBUG_COUNTER(ccf_iseq_setup_0start)
-RB_DEBUG_COUNTER(ccf_iseq_setup_tailcall_0start)
-RB_DEBUG_COUNTER(ccf_iseq_fix) /* several functions created with tool/mk_call_iseq_optimized.rb */
-RB_DEBUG_COUNTER(ccf_iseq_opt) /* has_opt == TRUE (has optional parameters), but other flags are FALSE */
-RB_DEBUG_COUNTER(ccf_iseq_kw1) /* vm_call_iseq_setup_kwparm_kwarg() */
-RB_DEBUG_COUNTER(ccf_iseq_kw2) /* vm_call_iseq_setup_kwparm_nokwarg() */
-RB_DEBUG_COUNTER(ccf_cfunc)
-RB_DEBUG_COUNTER(ccf_ivar) /* attr_reader */
-RB_DEBUG_COUNTER(ccf_attrset) /* attr_writer */
-RB_DEBUG_COUNTER(ccf_method_missing)
-RB_DEBUG_COUNTER(ccf_zsuper)
-RB_DEBUG_COUNTER(ccf_bmethod)
-RB_DEBUG_COUNTER(ccf_opt_send)
-RB_DEBUG_COUNTER(ccf_opt_call)
-RB_DEBUG_COUNTER(ccf_opt_block_call)
-RB_DEBUG_COUNTER(ccf_super_method)
-
-/*
- * control frame push counts.
- *
- * * frame_push: frame push counts.
- * * frame_push_*: frame push counts per each type.
- * * frame_R2R: Ruby frame to Ruby frame
- * * frame_R2C: Ruby frame to C frame
- * * frame_C2C: C frame to C frame
- * * frame_C2R: C frame to Ruby frame
- */
-RB_DEBUG_COUNTER(frame_push)
-RB_DEBUG_COUNTER(frame_push_method)
-RB_DEBUG_COUNTER(frame_push_block)
-RB_DEBUG_COUNTER(frame_push_class)
-RB_DEBUG_COUNTER(frame_push_top)
-RB_DEBUG_COUNTER(frame_push_cfunc)
-RB_DEBUG_COUNTER(frame_push_ifunc)
-RB_DEBUG_COUNTER(frame_push_eval)
-RB_DEBUG_COUNTER(frame_push_rescue)
-RB_DEBUG_COUNTER(frame_push_dummy)
-
-RB_DEBUG_COUNTER(frame_R2R)
-RB_DEBUG_COUNTER(frame_R2C)
-RB_DEBUG_COUNTER(frame_C2C)
-RB_DEBUG_COUNTER(frame_C2R)
-
-/* instance variable counts
- *
- * * ivar_get_ic_hit/miss: ivar_get inline cache (ic) hit/miss counts (VM insn)
- * * ivar_get_ic_miss_serial: ivar_get ic miss reason by serial (VM insn)
- * * ivar_get_ic_miss_unset: ... by unset (VM insn)
- * * ivar_get_ic_miss_noobject: ... by "not T_OBJECT" (VM insn)
- * * ivar_set_...: same counts with ivar_set (VM insn)
- * * ivar_get/set_base: call counts of "rb_ivar_get/set()".
- * because of (1) ic miss.
- * (2) direct call by C extensions.
- */
-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)
-
-/* local variable counts
- *
- * * lvar_get: total lvar get counts (VM insn)
- * * lvar_get_dynamic: lvar get counts if accessing upper env (VM insn)
- * * lvar_set*: same as "get"
- * * lvar_set_slowpath: counts using vm_env_write_slowpath()
- */
-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)
-
-/* GC counts:
- *
- * * count: simple count
- * * _minor: minor gc
- * * _major: major gc
- * * other suffix is corresponding to last_gc_info or
- * gc_profile_record_flag in gc.c.
- */
-RB_DEBUG_COUNTER(gc_count)
-RB_DEBUG_COUNTER(gc_minor_newobj)
-RB_DEBUG_COUNTER(gc_minor_malloc)
-RB_DEBUG_COUNTER(gc_minor_method)
-RB_DEBUG_COUNTER(gc_minor_capi)
-RB_DEBUG_COUNTER(gc_minor_stress)
-RB_DEBUG_COUNTER(gc_major_nofree)
-RB_DEBUG_COUNTER(gc_major_oldgen)
-RB_DEBUG_COUNTER(gc_major_shady)
-RB_DEBUG_COUNTER(gc_major_force)
-RB_DEBUG_COUNTER(gc_major_oldmalloc)
-
-RB_DEBUG_COUNTER(gc_isptr_trial)
-RB_DEBUG_COUNTER(gc_isptr_range)
-RB_DEBUG_COUNTER(gc_isptr_align)
-RB_DEBUG_COUNTER(gc_isptr_maybe)
-
-/* object allocation counts:
- *
- * * obj_newobj: newobj counts
- * * obj_newobj_slowpath: newobj with slowpath counts
- * * obj_newobj_wb_unprotected: newobj for wb_unprotecte.
- * * obj_free: obj_free() counts
- * * obj_promote: promoted counts (oldgen)
- * * obj_wb_unprotect: wb unprotect counts
- *
- * * obj_[type]_[attr]: *free'ed counts* for each type.
- * Note that it is not a allocated counts.
- * * [type]
- * * _obj: T_OBJECT
- * * _str: T_STRING
- * * _ary: T_ARRAY
- * * _xxx: T_XXX (hash, struct, ...)
- *
- * * [attr]
- * * _ptr: R?? is not embed.
- * * _embed: R?? is embed.
- * * _transient: R?? uses transient heap.
- * * type specific attr.
- * * str_shared: str is shared.
- * * str_nofree: nofree
- * * str_fstr: fstr
- * * hash_empty: hash is empty
- * * hash_1_4: has 1 to 4 entries
- * * hash_5_8: has 5 to 8 entries
- * * hash_g8: has n entries (n>8)
- * * match_under4: has under 4 oniguruma regions allocated
- * * match_ge4: has n regions allocated (4<=n<8)
- * * match_ge8: has n regions allocated (8<=n)
- * * data_empty: T_DATA but no memory free.
- * * data_xfree: free'ed by xfree().
- * * data_imm_free: free'ed immediately.
- * * data_zombie: free'ed with zombie.
- * * imemo_*: T_IMEMO with each type.
- */
-RB_DEBUG_COUNTER(obj_newobj)
-RB_DEBUG_COUNTER(obj_newobj_slowpath)
-RB_DEBUG_COUNTER(obj_newobj_wb_unprotected)
-RB_DEBUG_COUNTER(obj_free)
-RB_DEBUG_COUNTER(obj_promote)
-RB_DEBUG_COUNTER(obj_wb_unprotect)
-
-RB_DEBUG_COUNTER(obj_obj_embed)
-RB_DEBUG_COUNTER(obj_obj_transient)
-RB_DEBUG_COUNTER(obj_obj_ptr)
-
-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_embed)
-RB_DEBUG_COUNTER(obj_ary_transient)
-RB_DEBUG_COUNTER(obj_ary_ptr)
-RB_DEBUG_COUNTER(obj_ary_extracapa)
-/*
- ary_shared_create: shared ary by Array#dup and so on.
- ary_shared: finished in shard.
- ary_shared_root_occupied: shared_root but has only 1 refcnt.
- The number (ary_shared - ary_shared_root_occupied) is meaningful.
- */
-RB_DEBUG_COUNTER(obj_ary_shared_create)
-RB_DEBUG_COUNTER(obj_ary_shared)
-RB_DEBUG_COUNTER(obj_ary_shared_root_occupied)
-
-RB_DEBUG_COUNTER(obj_hash_empty)
-RB_DEBUG_COUNTER(obj_hash_1)
-RB_DEBUG_COUNTER(obj_hash_2)
-RB_DEBUG_COUNTER(obj_hash_3)
-RB_DEBUG_COUNTER(obj_hash_4)
-RB_DEBUG_COUNTER(obj_hash_5_8)
-RB_DEBUG_COUNTER(obj_hash_g8)
-
-RB_DEBUG_COUNTER(obj_hash_null)
-RB_DEBUG_COUNTER(obj_hash_ar)
-RB_DEBUG_COUNTER(obj_hash_st)
-RB_DEBUG_COUNTER(obj_hash_transient)
-RB_DEBUG_COUNTER(obj_hash_force_convert)
-
-RB_DEBUG_COUNTER(obj_struct_embed)
-RB_DEBUG_COUNTER(obj_struct_transient)
-RB_DEBUG_COUNTER(obj_struct_ptr)
-
-RB_DEBUG_COUNTER(obj_data_empty)
-RB_DEBUG_COUNTER(obj_data_xfree)
-RB_DEBUG_COUNTER(obj_data_imm_free)
-RB_DEBUG_COUNTER(obj_data_zombie)
-
-RB_DEBUG_COUNTER(obj_match_under4)
-RB_DEBUG_COUNTER(obj_match_ge4)
-RB_DEBUG_COUNTER(obj_match_ge8)
-RB_DEBUG_COUNTER(obj_match_ptr)
-
-RB_DEBUG_COUNTER(obj_iclass_ptr)
-RB_DEBUG_COUNTER(obj_class_ptr)
-RB_DEBUG_COUNTER(obj_module_ptr)
-
-RB_DEBUG_COUNTER(obj_bignum_ptr)
-RB_DEBUG_COUNTER(obj_bignum_embed)
-RB_DEBUG_COUNTER(obj_float)
-RB_DEBUG_COUNTER(obj_complex)
-RB_DEBUG_COUNTER(obj_rational)
-
-RB_DEBUG_COUNTER(obj_regexp_ptr)
-RB_DEBUG_COUNTER(obj_file_ptr)
-RB_DEBUG_COUNTER(obj_symbol)
-
-RB_DEBUG_COUNTER(obj_imemo_ment)
-RB_DEBUG_COUNTER(obj_imemo_iseq)
-RB_DEBUG_COUNTER(obj_imemo_env)
-RB_DEBUG_COUNTER(obj_imemo_tmpbuf)
-RB_DEBUG_COUNTER(obj_imemo_ast)
-RB_DEBUG_COUNTER(obj_imemo_cref)
-RB_DEBUG_COUNTER(obj_imemo_svar)
-RB_DEBUG_COUNTER(obj_imemo_throw_data)
-RB_DEBUG_COUNTER(obj_imemo_ifunc)
-RB_DEBUG_COUNTER(obj_imemo_memo)
-RB_DEBUG_COUNTER(obj_imemo_parser_strterm)
-
-/* ar_table */
-RB_DEBUG_COUNTER(artable_hint_hit)
-RB_DEBUG_COUNTER(artable_hint_miss)
-RB_DEBUG_COUNTER(artable_hint_notfound)
-
-/* heap function counts
- *
- * * heap_xmalloc/realloc/xfree: call counts
- */
-RB_DEBUG_COUNTER(heap_xmalloc)
-RB_DEBUG_COUNTER(heap_xrealloc)
-RB_DEBUG_COUNTER(heap_xfree)
-
-/* transient_heap */
-RB_DEBUG_COUNTER(theap_alloc)
-RB_DEBUG_COUNTER(theap_alloc_fail)
-RB_DEBUG_COUNTER(theap_evacuate)
-
-/* mjit_exec() counts */
-RB_DEBUG_COUNTER(mjit_exec)
-RB_DEBUG_COUNTER(mjit_exec_not_added)
-RB_DEBUG_COUNTER(mjit_exec_not_added_add_iseq)
-RB_DEBUG_COUNTER(mjit_exec_not_ready)
-RB_DEBUG_COUNTER(mjit_exec_not_compiled)
-RB_DEBUG_COUNTER(mjit_exec_call_func)
-
-/* MJIT <-> VM frame push counts */
-RB_DEBUG_COUNTER(mjit_frame_VM2VM)
-RB_DEBUG_COUNTER(mjit_frame_VM2JT)
-RB_DEBUG_COUNTER(mjit_frame_JT2JT)
-RB_DEBUG_COUNTER(mjit_frame_JT2VM)
-
-/* MJIT cancel counters */
-RB_DEBUG_COUNTER(mjit_cancel)
-RB_DEBUG_COUNTER(mjit_cancel_ivar_inline)
-RB_DEBUG_COUNTER(mjit_cancel_send_inline)
-RB_DEBUG_COUNTER(mjit_cancel_opt_insn) /* CALL_SIMPLE_METHOD */
-RB_DEBUG_COUNTER(mjit_cancel_invalidate_all)
-
-/* rb_mjit_unit_list length */
-RB_DEBUG_COUNTER(mjit_length_unit_queue)
-RB_DEBUG_COUNTER(mjit_length_active_units)
-RB_DEBUG_COUNTER(mjit_length_compact_units)
-RB_DEBUG_COUNTER(mjit_length_stale_units)
-
-/* Other MJIT counters */
-RB_DEBUG_COUNTER(mjit_compile_failures)
-
-/* load (not implemented yet) */
-/*
-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 __FILE__
- RB_DEBUG_COUNTER_MAX
-#undef RB_DEBUG_COUNTER
-};
-
-#if USE_DEBUG_COUNTER
-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;
-}
-
-VALUE rb_debug_counter_reset(VALUE klass);
-VALUE rb_debug_counter_show(VALUE klass);
-
-#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
-
-void rb_debug_counter_show_results(const char *msg);
-
-RUBY_SYMBOL_EXPORT_BEGIN
-
-size_t ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr);
-void ruby_debug_counter_reset(void);
-void ruby_debug_counter_show_at_exit(int enable);
-
-RUBY_SYMBOL_EXPORT_END
-
-#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 226e1066a5..f5033b2245 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -1,44 +1,17 @@
-# -*- mode: makefile-gmake; indent-tabs-mode: t -*-
-
+# -*- 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_TARGETS))
-TEST_TARGETS := $(patsubst check,test-spec test-all test-tool test-short,$(TEST_TARGETS))
-TEST_TARGETS := $(patsubst test-rubyspec,test-spec,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out exam check test-spec $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst love,check,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out love $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst test-almost,test-all,$(patsubst check-%,test test-%,$(TEST_TARGETS)))
-TEST_DEPENDS := $(filter-out test-all $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst test,test-short,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out test $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_TARGETS := $(patsubst test-short,btest-ruby test-knownbug test-basic,$(TEST_TARGETS))
-TEST_DEPENDS := $(filter-out test-short $(TEST_TARGETS),$(TEST_DEPENDS))
-TEST_DEPENDS += $(if $(filter great exam love check,$(MAKECMDGOALS)),all exts)
-in-srcdir := $(if $(filter-out .,$(srcdir)),$(CHDIR) $(srcdir) &&)
+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
@@ -54,25 +27,23 @@ define archcmd
%.i: %.$(1).i
endef
-$(foreach arch,$(arch_flags),\
+$(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-tool test-ruby test-all \
- test-spec test-bundler-prepare test-bundler \
- )
-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))
@@ -86,265 +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
endif
-# Cross reference needs to parse all files at once
-love install reinstall: RDOCFLAGS = --force-update
-
-$(srcdir)/missing/des_tables.c: $(srcdir)/missing/crypt.c
-ifeq ($(if $(filter yes,$(CROSS_COMPILING)),,$(CC)),)
- touch $@
-else
- @$(ECHO) building make_des_table
- $(CC) $(INCFLAGS) $(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)/libexec/*)))))
-
-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))) up
- @$(BASERUBY) -C "$(srcdir)" -I./tool/lib -rvcs -e 'VCS.detect(".").commit'
- +$(Q) \
- { \
- $(in-srcdir) \
- exec sed -f tool/prereq.status defs/gmake.mk template/Makefile.in common.mk; \
- } | \
- $(MAKE) $(mflags) Q=$(Q) ECHO=$(ECHO) srcdir="$(srcdir)" srcs_vpath="" CHDIR="$(CHDIR)" \
- BOOTSTRAPRUBY="$(BOOTSTRAPRUBY)" MINIRUBY="$(BASERUBY)" BASERUBY="$(BASERUBY)" \
- VCSUP="" ENC_MK=.top-enc.mk REVISION_FORCE=PHONY CONFIGURE="$(CONFIGURE)" -f - \
- update-src srcs all-incs
-
-GITHUB_RUBY_URL = https://github.com/ruby/ruby
-PR =
-
-COMMIT_GPG_SIGN = $(shell git -C "$(srcdir)" config commit.gpgsign)
-REMOTE_GITHUB_URL = $(shell git -C "$(srcdir)" config remote.github.url)
-COMMITS_NOTES = commits
-
-.PHONY: fetch-github
-fetch-github:
- $(call fetch-github,$(PR))
-
-define fetch-github
- $(if $(1),,\
- echo "usage:"; echo " make $@ PR=1234"; \
- exit 1; \
- )
- $(eval REMOTE_GITHUB_URL := $(REMOTE_GITHUB_URL))
- $(if $(REMOTE_GITHUB_URL),, \
- echo adding $(GITHUB_RUBY_URL) as remote github; \
- git -C "$(srcdir)" remote add github $(GITHUB_RUBY_URL); \
- git -C "$(srcdir)" config --add remote.github.fetch +refs/notes/$(COMMITS_NOTES):refs/notes/$(COMMITS_NOTES)
- $(eval REMOTE_GITHUB_URL := $(GITHUB_RUBY_URL)) \
- )
- $(if $(git -C "$(srcdir)" rev-parse "github/pull/$(1)/head" -- 2> /dev/null), \
- git -C "$(srcdir)" branch -f "gh-$(1)" "github/pull/$(1)/head", \
- git -C "$(srcdir)" fetch -f github "pull/$(1)/head:gh-$(1)" \
- )
-endef
-
-.PHONY: checkout-github
-checkout-github: fetch-github
- git -C "$(srcdir)" checkout "gh-$(PR)"
-
-.PHONY: update-github
-update-github: fetch-github
- $(eval PULL_REQUEST_API := https://api.github.com/repos/ruby/ruby/pulls/$(PR))
- $(eval PULL_REQUEST_FORK_BRANCH := $(shell \
- curl -s $(if $(GITHUB_TOKEN),-H "Authorization: bearer $(GITHUB_TOKEN)") $(PULL_REQUEST_API) | \
- $(BASERUBY) -rjson -e 'JSON.parse(STDIN.read)["head"].tap { |h| print "#{h["repo"]["full_name"]} #{h["ref"]}" }' \
- ))
- $(eval FORK_REPO := $(word 1,$(PULL_REQUEST_FORK_BRANCH)))
- $(eval PR_BRANCH := $(word 2,$(PULL_REQUEST_FORK_BRANCH)))
-
- $(eval GITHUB_UPDATE_WORKTREE := $(shell mktemp -d "$(srcdir)/gh-$(PR)-XXXXXX"))
- git -C "$(srcdir)" worktree add $(notdir $(GITHUB_UPDATE_WORKTREE)) "gh-$(PR)"
- git -C "$(GITHUB_UPDATE_WORKTREE)" merge master --no-edit
- @$(BASERUBY) -e 'print "Are you sure to push this to PR=$(PR)? [Y/n]: "; exit(gets.chomp != "n")'
- git -C "$(srcdir)" remote add fork-$(PR) git@github.com:$(FORK_REPO).git
- git -C "$(GITHUB_UPDATE_WORKTREE)" push fork-$(PR) gh-$(PR):$(PR_BRANCH)
- git -C "$(srcdir)" remote rm fork-$(PR)
- git -C "$(srcdir)" worktree remove $(notdir $(GITHUB_UPDATE_WORKTREE))
- git -C "$(srcdir)" branch -D gh-$(PR)
-
-.PHONY: pull-github
-pull-github: fetch-github
- $(call pull-github,$(PR))
-
-define pull-github
- $(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H))
- $(eval GITHUB_MERGE_BRANCH := $(shell git -C "$(srcdir)" symbolic-ref --short HEAD))
- $(eval GITHUB_MERGE_WORKTREE := $(shell mktemp -d "$(srcdir)/gh-$(1)-XXXXXX"))
- git -C "$(srcdir)" worktree add $(notdir $(GITHUB_MERGE_WORKTREE)) "gh-$(1)"
- git -C "$(GITHUB_MERGE_WORKTREE)" rebase $(GITHUB_MERGE_BRANCH)
- $(eval COMMIT_GPG_SIGN := $(COMMIT_GPG_SIGN))
- $(if $(filter true,$(COMMIT_GPG_SIGN)), \
- git -C "$(GITHUB_MERGE_WORKTREE)" rebase --exec "git commit --amend --no-edit -S" "$(GITHUB_MERGE_BASE)"; \
- )
- git -C "$(GITHUB_MERGE_WORKTREE)" rebase --exec "git notes add --message 'Merged: $(GITHUB_RUBY_URL)/pull/$(1)'" "$(GITHUB_MERGE_BASE)"
-endef
-
-.PHONY: fetch-github-%
-fetch-github-%:
- $(call fetch-github,$*)
-
-.PHONY: checkout-github-%
-checkout-github-%: fetch-github-%
- git -C "$(srcdir)" checkout "gh-$*"
-
-.PHONY: pr-% pull-github-%
-pr-% pull-github-%: fetch-github-%
- $(call pull-github,$*)
-
-HELP_EXTRA_TASKS = \
- " checkout-github: checkout GitHub Pull Request [PR=1234]" \
- " pull-github: rebase GitHub Pull Request to new worktree [PR=1234]" \
- " update-github: merge master branch and push it to Pull Request [PR=1234]" \
- ""
-
-ifneq ($(filter refresh-gems,$(MAKECMDGOALS)),)
-extract-gems: update-gems
-update-gems: update-bundled_gems
-endif
-ifneq ($(filter extract-gems,$(MAKECMDGOALS)),)
-extract-gems: $(filter update-gems update-bundled_gems,$(MAKECMDGOALS))
-endif
-ifneq ($(filter update-gems,$(MAKECMDGOALS)),)
-update-gems: $(filter update-bundled_gems,$(MAKECMDGOALS))
-endif
-
-ifeq ($(filter 0 1,$(words $(arch_flags))),)
-$(foreach x,$(patsubst -arch=%,%,$(arch_flags)), \
- $(eval $$(MJIT_HEADER:.h=)-$(value x).h \
- $$(MJIT_MIN_HEADER:.h=)-$(value x).h \
- $$(TIMESTAMPDIR)/$$(MJIT_HEADER:.h=)-$(value x).time \
- : ARCH_FLAG := -arch $(value x)))
-
-$(foreach x,$(patsubst -arch=%,%,$(arch_flags)), \
- $(eval $$(MJIT_HEADER:.h=)-$(value x).h: \
- $$(TIMESTAMPDIR)/$$(MJIT_HEADER:.h=)-$(value x).time))
-
-mjit_min_headers := $(patsubst -arch=%,$(MJIT_MIN_HEADER:.h=-%.h),$(arch_flags))
-$(MJIT_MIN_HEADER): $(mjit_min_headers) $(PREP)
- @ set -e; set $(patsubst -arch=%,%,$(arch_flags)); \
- cd $(@D); h=$(@F:.h=); \
- exec > $(@F).new; \
- echo '#if 0'; \
- for arch; do\
- echo "#elif defined __$${arch}__"; \
- echo "# include \"$$h-$$arch.h\""; \
- done; \
- echo "#else"; echo "# error unsupported platform"; echo "#endif"
- $(IFCHANGE) $@ $@.new
- $(Q) $(MAKEDIRS) $(MJIT_HEADER_INSTALL_DIR)
- $(Q) $(MAKE_LINK) $@ $(MJIT_HEADER_INSTALL_DIR)/$(@F)
-
-endif
-
-ifeq ($(if $(wildcard $(filter-out .,$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES))),,\
- $(wildcard $(srcdir)/lib/unicode_normalize/tables.rb)),)
-# Needs the dependency when any Unicode data file exists, or
-# normalization tables script doesn't. Otherwise, when the target
-# only exists, use it as-is.
-.PHONY: $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time
-UNICODE_TABLES_TIMESTAMP =
-$(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: \
- $(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)
-endif
-
-REVISION_IN_HEADER := $(shell sed -n 's/^\#define RUBY_FULL_REVISION "\(.*\)"/\1/p' $(srcdir)/revision.h 2>/dev/null)
-REVISION_LATEST := $(shell $(CHDIR) $(srcdir) && git log -1 --format=%H 2>/dev/null)
-ifneq ($(REVISION_IN_HEADER),$(REVISION_LATEST))
-# GNU make treat the target as unmodified when its dependents get
-# updated but it is not updated, while others may not.
-$(srcdir)/revision.h: $(REVISION_H)
-endif
-
-# Query on the generated rdoc
-#
-# $ make rdoc:Integer#+
-rdoc\:%: PHONY
- $(Q)$(RUNRUBY) $(srcdir)/libexec/ri --no-standard-docs --doc-dir=$(RDOCOUT) $(patsubst rdoc:%,%,$@)
-
-test_%.rb test/%: programs PHONY
- +$(Q)$(exec) $(RUNRUBY) "$(TESTSDIR)/runner.rb" --ruby="$(RUNRUBY)" $(TEST_EXCLUDES) $(TESTOPTS) -- $(patsubst test/%,%,$@)
-
-spec/bundler/%: PHONY
- +$(Q)$(exec) $(XRUBY) -C $(srcdir) -Ispec/bundler .bundle/bin/rspec --require spec_helper $(RSPECOPTS) $@
-
-spec/%: programs exts PHONY
- +$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec-run -B $(srcdir)/spec/default.mspec $(SPECOPTS) $(patsubst %,$(srcdir)/%,$@)
-
-benchmark/%: miniruby$(EXEEXT) update-benchmark-driver PHONY
- $(Q)$(BASERUBY) -rrubygems -I$(srcdir)/benchmark/lib $(srcdir)/benchmark/benchmark-driver/exe/benchmark-driver \
- --executables="compare-ruby::$(COMPARE_RUBY) -I$(EXTOUT)/common --disable-gem" \
- --executables="built-ruby::$(BENCH_RUBY) --disable-gem" \
- $(srcdir)/$@ $(OPTS)
-
-clean-srcs-ext::
- $(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXT_SRCS))
-
-clean-srcs-extra::
- $(Q)$(RM) $(patsubst $(srcdir)/%,%,$(EXTRA_SRCS))
-
-ifneq ($(filter $(VCS),git),)
-update-src::
- @$(BASERUBY) $(srcdir)/tool/lib/colorize.rb pass "Latest commit hash = $(shell $(filter-out svn,$(VCS)) -C $(srcdir) rev-parse --short=10 HEAD)"
-endif
-
-# Update dependencies and commit the updates to the current branch.
-update-deps:
- $(eval update_deps := $(shell date +update-deps-%Y%m%d))
- $(eval deps_dir := $(shell mktemp -d)/$(update_deps))
- $(eval GIT_DIR := $(shell git -C $(srcdir) rev-parse --absolute-git-dir))
- git --git-dir=$(GIT_DIR) worktree add $(deps_dir)
- cp $(srcdir)/tool/config.guess $(srcdir)/tool/config.sub $(deps_dir)/tool
- [ -f config.status ] && cp config.status $(deps_dir)
- cd $(deps_dir) && autoconf && \
- exec ./configure -q -C --enable-load-relative --disable-install-doc --disable-rubygems 'optflags=-O0' 'debugflags=-save-temps=obj -g'
- $(RUNRUBY) -C $(deps_dir) tool/update-deps --fix
- git -C $(deps_dir) diff --no-ext-diff --ignore-submodules --exit-code || \
- git -C $(deps_dir) commit --all --message='Update dependencies'
- git --git-dir=$(GIT_DIR) worktree remove $(deps_dir)
- $(RMDIR) $(dir $(deps_dir))
- git --git-dir=$(GIT_DIR) merge --no-edit --ff-only $(update_deps)
- git --git-dir=$(GIT_DIR) branch --delete $(update_deps)
diff --git a/defs/id.def b/defs/id.def
index fc7a04ffbc..d4cd5e77de 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -1,9 +1,6 @@
# -*- mode: ruby; coding: us-ascii -*-
firstline, predefined = __LINE__+1, %[\
- max
- min
freeze
- nil?
inspect
intern
object_id
@@ -39,37 +36,13 @@ firstline, predefined = __LINE__+1, %[\
to_a
to_s
to_i
- to_f
- to_r
bt
bt_locations
call
mesg
exception
- locals
- not NOT
- and AND
- or OR
- div
- divmod
- fdiv
- quo
- name
- nil
_ UScore
-
- # MUST be successive
- _1 NUMPARAM_1
- _2 NUMPARAM_2
- _3 NUMPARAM_3
- _4 NUMPARAM_4
- _5 NUMPARAM_5
- _6 NUMPARAM_6
- _7 NUMPARAM_7
- _8 NUMPARAM_8
- _9 NUMPARAM_9
-
"/*NULL*/" NULL
empty?
eql?
@@ -83,53 +56,10 @@ firstline, predefined = __LINE__+1, %[\
core#define_method
core#define_singleton_method
core#set_postexe
+ core#hash_from_ary
+ core#hash_merge_ary
core#hash_merge_ptr
core#hash_merge_kwd
- core#raise
-
- - debug#created_info
-
- $_ LASTLINE
- $~ BACKREF
- $! ERROR_INFO
-]
-
-# VM ID OP Parser Token
-token_ops = %[\
- Dot2 .. DOT2
- Dot3 ... DOT3
- BDot2 .. BDOT2
- BDot3 ... BDOT3
- 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 !
- And &
- Or |
- Backquote `
- EqTilde =~ MATCH
- NeqTilde !~ NMATCH
- AREF []
- ASET []=
- COLON2 ::
- ANDOP &&
- OROP ||
- ANDDOT &.
]
class KeywordError < RuntimeError
@@ -146,7 +76,6 @@ global_ids = []
const_ids = []
class_ids = []
attrset_ids = []
-token_op_ids = []
names = {}
predefined.split(/^/).each_with_index do |line, num|
next if /^#/ =~ line
@@ -163,10 +92,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
@@ -177,7 +102,7 @@ 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
@@ -185,14 +110,6 @@ predefined.split(/^/).each_with_index do |line, num|
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,
@@ -202,5 +119,4 @@ end
"ATTRSET" => attrset_ids,
:preserved => preserved_ids,
:predefined => predefined_ids,
- :token_op => token_op_ids,
}
diff --git a/defs/keywords b/defs/keywords
index fc30ec2d15..0d4d70b8cf 100644
--- a/defs/keywords
+++ b/defs/keywords
@@ -1,8 +1,8 @@
%{
-struct kwtable {short 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)
%}
diff --git a/defs/known_errors.def b/defs/known_errors.def
index e9694cfbda..b9c490d3a2 100644
--- a/defs/known_errors.def
+++ b/defs/known_errors.def
@@ -1,157 +1,148 @@
+EPERM
+ENOENT
+ESRCH
+EINTR
+EIO
+ENXIO
E2BIG
-EACCES
-EADDRINUSE
-EADDRNOTAVAIL
-EADV
-EAFNOSUPPORT
+ENOEXEC
+EBADF
+ECHILD
EAGAIN
-EALREADY
-EAUTH
-EBADARCH
+ENOMEM
+EACCES
+EFAULT
+ENOTBLK
+EBUSY
+EEXIST
+EXDEV
+ENODEV
+ENOTDIR
+EISDIR
+EINVAL
+ENFILE
+EMFILE
+ENOTTY
+ETXTBSY
+EFBIG
+ENOSPC
+ESPIPE
+EROFS
+EMLINK
+EPIPE
+EDOM
+ERANGE
+EDEADLK
+ENAMETOOLONG
+ENOLCK
+ENOSYS
+ENOTEMPTY
+ELOOP
+EWOULDBLOCK
+ENOMSG
+EIDRM
+ECHRNG
+EL2NSYNC
+EL3HLT
+EL3RST
+ELNRNG
+EUNATCH
+ENOCSI
+EL2HLT
EBADE
-EBADEXEC
-EBADF
-EBADFD
-EBADMACHO
-EBADMSG
EBADR
-EBADRPC
+EXFULL
+ENOANO
EBADRQC
EBADSLT
+EDEADLOCK
EBFONT
-EBUSY
-ECANCELED
-ECAPMODE
-ECHILD
-ECHRNG
+ENOSTR
+ENODATA
+ETIME
+ENOSR
+ENONET
+ENOPKG
+EREMOTE
+ENOLINK
+EADV
+ESRMNT
ECOMM
+EPROTO
+EMULTIHOP
+EDOTDOT
+EBADMSG
+EOVERFLOW
+ENOTUNIQ
+EBADFD
+EREMCHG
+ELIBACC
+ELIBBAD
+ELIBSCN
+ELIBMAX
+ELIBEXEC
+EILSEQ
+ERESTART
+ESTRPIPE
+EUSERS
+ENOTSOCK
+EDESTADDRREQ
+EMSGSIZE
+EPROTOTYPE
+ENOPROTOOPT
+EPROTONOSUPPORT
+ESOCKTNOSUPPORT
+EOPNOTSUPP
+EPFNOSUPPORT
+EAFNOSUPPORT
+EADDRINUSE
+EADDRNOTAVAIL
+ENETDOWN
+ENETUNREACH
+ENETRESET
ECONNABORTED
-ECONNREFUSED
ECONNRESET
-EDEADLK
-EDEADLOCK
-EDESTADDRREQ
-EDEVERR
-EDOM
-EDOOFUS
-EDOTDOT
-EDQUOT
-EEXIST
-EFAULT
-EFBIG
-EFTYPE
+ENOBUFS
+EISCONN
+ENOTCONN
+ESHUTDOWN
+ETOOMANYREFS
+ETIMEDOUT
+ECONNREFUSED
EHOSTDOWN
EHOSTUNREACH
-EHWPOISON
-EIDRM
-EILSEQ
+EALREADY
EINPROGRESS
-EINTR
-EINVAL
-EIO
-EIPSEC
-EISCONN
-EISDIR
+ESTALE
+EUCLEAN
+ENOTNAM
+ENAVAIL
EISNAM
+EREMOTEIO
+EDQUOT
+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PABLE
diff --git a/defs/lex.c.src b/defs/lex.c.src
index fc30ec2d15..0d4d70b8cf 100644
--- a/defs/lex.c.src
+++ b/defs/lex.c.src
@@ -1,8 +1,8 @@
%{
-struct kwtable {short 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)
%}
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 72ee093da7..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 shareable.
-
-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/defs/universal.mk b/defs/universal.mk
deleted file mode 100644
index c34a31b356..0000000000
--- a/defs/universal.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-arch_flags := $(filter -arch=%,$(subst -arch ,-arch=,$(ARCH_FLAG)))
-ifeq ($(filter 0 1,$(words $(arch_flags))),)
-override MJIT_HEADER_SUFFIX = -%
-override MJIT_HEADER_ARCH = -$(word 2,$(ARCH_FLAG))
-endif
diff --git a/dir.c b/dir.c
index 6a926f438c..84413c6b57 100644
--- a/dir.c
+++ b/dir.c
@@ -11,11 +11,7 @@
**********************************************************************/
-#include "ruby/encoding.h"
-#include "ruby/thread.h"
#include "internal.h"
-#include "id.h"
-#include "encindex.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -24,26 +20,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)
@@ -53,7 +29,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
@@ -67,6 +42,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>
@@ -82,8 +61,6 @@ char *strchr(char*,char);
#include "ruby/util.h"
-#define vm_initialized rb_cThread
-
/* define system APIs */
#ifdef _WIN32
#undef chdir
@@ -94,7 +71,6 @@ 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
@@ -104,19 +80,14 @@ char *strchr(char*,char);
#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 USE_NAME_ON_FS 1
# define RUP32(size) ((size)+3/4)
# define SIZEUP32(type) RUP32(sizeof(type))
#elif defined _WIN32
-# define USE_NAME_ON_FS USE_NAME_ON_FS_REAL_BASENAME
+# define USE_NAME_ON_FS 1
#elif defined DOSISH
-# define USE_NAME_ON_FS USE_NAME_ON_FS_BY_FNMATCH
+# define USE_NAME_ON_FS 2 /* by fnmatch */
#else
# define USE_NAME_ON_FS 0
#endif
@@ -176,26 +147,6 @@ has_nonascii(const char *ptr, size_t len)
# define IF_NORMALIZE_UTF8PATH(something) /* nothing */
#endif
-#ifndef IFTODT
-# define IFTODT(m) (((m) & S_IFMT) / ((~S_IFMT & (S_IFMT-1)) + 1))
-#endif
-
-typedef enum {
-#ifdef DT_UNKNOWN
- path_exist = DT_UNKNOWN,
- path_directory = DT_DIR,
- path_regular = DT_REG,
- path_symlink = DT_LNK,
-#else
- 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
@@ -206,11 +157,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
@@ -287,7 +233,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.
@@ -442,7 +388,7 @@ VALUE rb_cDir;
struct dir_data {
DIR *dir;
- const VALUE path;
+ VALUE path;
rb_encoding *enc;
};
@@ -457,25 +403,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
+ 0, 0, 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)
{
@@ -483,34 +439,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
@@ -518,7 +452,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
@@ -531,7 +465,7 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
const char *path;
if (!keyword_ids[0]) {
- keyword_ids[0] = rb_id_encoding();
+ keyword_ids[0] = rb_intern("encoding");
}
fsenc = rb_filesystem_encoding();
@@ -546,7 +480,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);
@@ -554,30 +488,30 @@ 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(path);
if (dp->dir == NULL) {
- int e = errno;
- if (rb_gc_for_fd(e)) {
- dp->dir = opendir_without_gvl(path);
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
+ dp->dir = opendir(path);
}
#ifdef HAVE_GETATTRLIST
- else if (e == EIO) {
+ else if (errno == EIO) {
u_int32_t attrbuf[1];
struct attrlist al = {ATTR_BIT_MAP_COUNT, 0};
if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW) == 0) {
- dp->dir = opendir_without_gvl(path);
+ dp->dir = opendir(path);
}
}
#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;
}
@@ -589,13 +523,14 @@ 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 Dir::new. If a
- * block is present, it is passed <i>aDir</i> as a parameter. The
- * directory is closed at the end of the block, and Dir::open returns
- * the value of the block.
+ * With no block, <code>open</code> is a synonym for
+ * <code>Dir::new</code>. If a block is present, it is passed
+ * <i>aDir</i> as a parameter. The directory is closed at the end of
+ * the block, and <code>Dir::open</code> returns the value of the
+ * block.
*/
static VALUE
dir_s_open(int argc, VALUE *argv, VALUE klass)
@@ -611,8 +546,6 @@ dir_s_open(int argc, VALUE *argv, VALUE klass)
return dir;
}
-NORETURN(static void dir_closed(void));
-
static void
dir_closed(void)
{
@@ -620,16 +553,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;
}
@@ -657,22 +585,9 @@ dir_inspect(VALUE dir)
rb_str_cat2(str, ">");
return str;
}
- return rb_funcallv(dir, idTo_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:
@@ -725,46 +640,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
@@ -789,20 +669,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
@@ -826,17 +697,11 @@ 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);
+ RETURN_ENUMERATOR(dir, 0, 0);
GetDIR(dir, dirp);
rewinddir(dirp->dir);
IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp->dir, RSTRING_PTR(dirp->path)));
@@ -844,11 +709,6 @@ dir_each_entry(VALUE dir, VALUE (*each)(VALUE, VALUE), VALUE arg, int children_o
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) &&
!NIL_P(path = rb_str_normalize_ospath(name, namlen))) {
@@ -857,7 +717,8 @@ dir_each_entry(VALUE dir, VALUE (*each)(VALUE, VALUE), VALUE arg, int children_o
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;
}
@@ -868,7 +729,8 @@ dir_each_entry(VALUE dir, VALUE (*each)(VALUE, VALUE), VALUE arg, int children_o
* dir.pos -> integer
* dir.tell -> integer
*
- * Returns the current position in <em>dir</em>. See also Dir#seek.
+ * Returns the current position in <em>dir</em>. See also
+ * <code>Dir#seek</code>.
*
* d = Dir.new("testdir")
* d.tell #=> 0
@@ -895,7 +757,7 @@ dir_tell(VALUE dir)
* dir.seek( integer ) -> dir
*
* Seeks to a particular location in <em>dir</em>. <i>integer</i>
- * must be a value returned by Dir#tell.
+ * must be a value returned by <code>Dir#tell</code>.
*
* d = Dir.new("testdir") #=> #<Dir:0x401b3c40>
* d.read #=> "."
@@ -923,7 +785,8 @@ dir_seek(VALUE dir, VALUE pos)
* call-seq:
* dir.pos = integer -> integer
*
- * Synonym for Dir#seek, but returns the position parameter.
+ * Synonym for <code>Dir#seek</code>, but returns the position
+ * parameter.
*
* d = Dir.new("testdir") #=> #<Dir:0x401b3c40>
* d.read #=> "."
@@ -967,8 +830,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 +841,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)
{
@@ -1010,9 +864,8 @@ struct chdir_data {
};
static VALUE
-chdir_yield(VALUE v)
+chdir_yield(struct chdir_data *args)
{
- struct chdir_data *args = (void *)v;
dir_chdir(args->new_path);
args->done = TRUE;
chdir_blocking++;
@@ -1022,9 +875,8 @@ chdir_yield(VALUE v)
}
static VALUE
-chdir_restore(VALUE v)
+chdir_restore(struct chdir_data *args)
{
- struct chdir_data *args = (void *)v;
if (args->done) {
chdir_blocking--;
if (chdir_blocking == 0)
@@ -1042,8 +894,8 @@ chdir_restore(VALUE v)
* Changes the current working directory of the process to the given
* string. When called without an argument, changes the directory to
* the value of the environment variable <code>HOME</code>, or
- * <code>LOGDIR</code>. SystemCallError (probably Errno::ENOENT) if
- * the target directory does not exist.
+ * <code>LOGDIR</code>. <code>SystemCallError</code> (probably
+ * <code>Errno::ENOENT</code>) if the target directory does not exist.
*
* If a block is given, it is passed the name of the new current
* directory, and the block is executed with that as the current
@@ -1078,8 +930,10 @@ dir_s_chdir(int argc, VALUE *argv, VALUE obj)
{
VALUE path = Qnil;
- if (rb_check_arity(argc, 0, 1) == 1) {
- path = rb_str_encode_ospath(rb_get_path(argv[0]));
+ rb_secure(2);
+ if (rb_scan_args(argc, argv, "01", &path) == 1) {
+ FilePathValue(path);
+ path = rb_str_encode_ospath(path);
}
else {
const char *dist = getenv("HOME");
@@ -1103,61 +957,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));
-#else
- cwd = rb_str_new2(path);
-#endif
- DATA_PTR(path_guard) = 0;
+ path = my_getcwd();
+ cwd = rb_tainted_str_new2(path);
+ 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 +994,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 +1010,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 +1027,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,29 +1037,17 @@ 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
*
* Makes a new directory named by <i>string</i>, with permissions
* specified by the optional parameter <i>anInteger</i>. The
- * permissions may be modified by the value of File::umask, and are
- * ignored on NT. Raises a SystemCallError if the directory cannot be
- * created. See also the discussion of permissions in the class
- * documentation for File.
+ * permissions may be modified by the value of
+ * <code>File::umask</code>, and are ignored on NT. Raises a
+ * <code>SystemCallError</code> if the directory cannot be created. See
+ * also the discussion of permissions in the class documentation for
+ * <code>File</code>.
*
* Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0
*
@@ -1250,53 +1055,37 @@ 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
* Dir.rmdir( string ) -> 0
* Dir.unlink( string ) -> 0
*
- * Deletes the named directory. Raises a subclass of SystemCallError
- * if the directory isn't empty.
+ * Deletes the named directory. Raises a subclass of
+ * <code>SystemCallError</code> if the directory isn't empty.
*/
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);
@@ -1342,20 +1131,8 @@ sys_enc_warning_in(const char *func, const char *mesg, rb_encoding *enc)
#define sys_warning(val, enc) \
((flags & GLOB_VERBOSE) ? sys_enc_warning_in(RUBY_FUNCTION_NAME_STRING, (val), (enc)) :(void)0)
-static inline void *
-glob_alloc_n(size_t x, size_t y)
-{
- size_t z;
- if (rb_mul_size_overflow(x, y, SSIZE_MAX, &z)) {
- rb_memerror(); /* or...? */
- }
- else {
- return malloc(z);
- }
-}
-
#define GLOB_ALLOC(type) ((type *)malloc(sizeof(type)))
-#define GLOB_ALLOC_N(type, n) ((type *)glob_alloc_n(sizeof(type), n))
+#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))
@@ -1364,63 +1141,30 @@ glob_alloc_n(size_t x, size_t y)
* 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;
-
-static const char *
-at_subpath(int fd, size_t baselen, const char *path)
-{
-#if USE_OPENDIR_AT
- if (fd != (int)AT_FDCWD && baselen > 0) {
- path += baselen;
- if (*path == '/') ++path;
- }
-#endif
- return *path ? path : ".";
-}
-
/* System call with warning */
static int
-do_stat(int fd, size_t baselen, const char *path, struct stat *pst, int flags, rb_encoding *enc)
+do_stat(const char *path, struct stat *pst, int flags, rb_encoding *enc)
{
-#if USE_OPENDIR_AT
- int ret = fstatat(fd, at_subpath(fd, baselen, path), pst, 0);
-#else
int ret = STAT(path, pst);
-#endif
if (ret < 0 && !to_be_ignored(errno))
sys_warning(path, enc);
return ret;
}
-#if defined HAVE_LSTAT || defined lstat || USE_OPENDIR_AT
+#if defined HAVE_LSTAT || defined lstat
static int
-do_lstat(int fd, size_t baselen, const char *path, struct stat *pst, int flags, rb_encoding *enc)
+do_lstat(const char *path, struct stat *pst, int flags, rb_encoding *enc)
{
-#if USE_OPENDIR_AT
- int ret = fstatat(fd, at_subpath(fd, baselen, path), pst, AT_SYMLINK_NOFOLLOW);
-#else
int ret = lstat(path, pst);
-#endif
if (ret < 0 && !to_be_ignored(errno))
sys_warning(path, enc);
@@ -1430,109 +1174,23 @@ do_lstat(int fd, size_t baselen, const char *path, struct stat *pst, int flags,
#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, size_t baselen, 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)) {
+ 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, at_subpath(basefd, baselen, 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);
- }
- }
- }
+ dirp = opendir(path);
+ if (dirp == NULL && !to_be_ignored(errno))
+ sys_warning(path, enc);
#ifdef _WIN32
if (tmp) rb_str_resize(tmp, 0); /* GC guard */
#endif
@@ -1541,7 +1199,7 @@ do_opendir(const int basefd, size_t baselen, const char *path, int flags, rb_enc
}
/* Globing pattern */
-enum glob_pattern_type { PLAIN, ALPHA, BRACE, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };
+enum glob_pattern_type { PLAIN, ALPHA, MAGICAL, RECURSIVE, MATCH_ALL, MATCH_DIR };
/* Return nonzero if S has any special globbing chars in it. */
static enum glob_pattern_type
@@ -1549,20 +1207,15 @@ has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
{
const int escape = !(flags & FNM_NOESCAPE);
int hasalpha = 0;
- int hasmagical = 0;
register char c;
while (p < pend && (c = *p++) != 0) {
switch (c) {
- case '{':
- return BRACE;
-
case '*':
case '?':
case '[':
- hasmagical = 1;
- break;
+ return MAGICAL;
case '\\':
if (escape && p++ >= pend)
@@ -1587,7 +1240,7 @@ has_magic(const char *p, const char *pend, int flags, rb_encoding *enc)
p = Next(p-1, pend, enc);
}
- return hasmagical ? MAGICAL : hasalpha ? ALPHA : PLAIN;
+ return hasalpha ? ALPHA : PLAIN;
}
/* Find separator in globbing pattern. */
@@ -1608,13 +1261,6 @@ find_dirsep(const char *p, const char *pend, int flags, rb_encoding *enc)
open = 0;
continue;
- case '{':
- open = 1;
- continue;
- case '}':
- open = 0;
- continue;
-
case '/':
if (!open)
return (char *)p-1;
@@ -1747,7 +1393,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);
@@ -1762,64 +1408,38 @@ join_path(const char *path, size_t len, int dirsep, const char *name, size_t nam
}
#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)
+is_case_sensitive(DIR *dirp)
{
- struct {
- u_int32_t length;
- vol_capabilities_attr_t cap[1];
- } __attribute__((aligned(4), packed)) attrbuf[1];
+ u_int32_t attrbuf[SIZEUP32(vol_capabilities_attr_t) + 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 vol_capabilities_attr_t *cap = (void *)(attrbuf+1);
const int idx = VOL_CAPABILITIES_FORMAT;
const uint32_t mask = VOL_CAP_FMT_CASE_SENSITIVE;
+ struct statfs sf;
-# if defined HAVE_FGETATTRLIST
- if (fgetattrlist(dirfd(dirp), &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
+ if (fstatfs(dirfd(dirp), &sf)) return -1;
+ if (getattrlist(sf.f_mntonname, &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;
+replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p)
+{
+ u_int32_t attrbuf[SIZEUP32(attrreference_t) + RUP32(MAXPATHLEN * 3) + 1];
+ struct attrlist al = {ATTR_BIT_MAP_COUNT, 0, ATTR_CMN_NAME};
+ const attrreference_t *ar = (void *)(attrbuf+1);
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);
+ if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), FSOPT_NOFOLLOW))
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))
@@ -1844,10 +1464,9 @@ replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int f
}
#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)
+replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p)
{
char *plainname = path;
volatile VALUE tmp = 0;
@@ -1856,8 +1475,10 @@ replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int f
WCHAR *wplain;
HANDLE h = INVALID_HANDLE_VALUE;
long wlen;
- int e = 0;
- if (!fundamental_encoding_p(enc)) {
+ if (enc &&
+ enc != rb_usascii_encoding() &&
+ enc != rb_ascii8bit_encoding() &&
+ enc != rb_utf8_encoding()) {
tmp = rb_enc_str_new_cstr(plainname, enc);
tmp = rb_str_encode_ospath(tmp);
plainname = RSTRING_PTR(tmp);
@@ -1865,28 +1486,11 @@ replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int f
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)) {
+ 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;
- }
+ if (h == INVALID_HANDLE_VALUE) 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);
@@ -1917,10 +1521,12 @@ replace_real_basename(char *path, long base, rb_encoding *enc, int norm_p, int f
}
return path;
}
-#elif USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME
+#elif USE_NAME_ON_FS == 1
# error not implemented
#endif
+enum answer {UNKNOWN = -1, NO, YES};
+
#ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
@@ -1936,8 +1542,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;
};
@@ -1953,171 +1557,25 @@ 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;
-}
-
-struct push_glob_args {
- 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' */
- int flags;
- const ruby_glob_funcs_t *funcs;
- VALUE arg;
-};
-
-struct dirent_brace_args {
- const char *name;
- const struct dirent *dp;
- int flags;
-};
-
-static int
-dirent_match_brace(const char *pattern, VALUE val, void *enc)
-{
- struct dirent_brace_args *arg = (struct dirent_brace_args *)val;
-
- return dirent_match(pattern, enc, arg->name, arg->dp, arg->flags);
-}
-
-/* join paths from pattern list of glob_make_pattern() */
-static char*
-join_path_from_pattern(struct glob_pattern **beg)
-{
- struct glob_pattern *p;
- char *path = NULL;
- size_t path_len = 0;
-
- for (p = *beg; p; p = p->next) {
- const char *str;
- switch (p->type) {
- case RECURSIVE:
- str = "**";
- break;
- case MATCH_DIR:
- /* append last slash */
- str = "";
- break;
- default:
- str = p->str;
- if (!str) continue;
- }
- if (!path) {
- path_len = strlen(str);
- path = GLOB_ALLOC_N(char, path_len + 1);
- if (path) {
- memcpy(path, str, path_len);
- path[path_len] = '\0';
- }
- }
- else {
- size_t len = strlen(str);
- char *tmp;
- tmp = GLOB_REALLOC(path, path_len + len + 2);
- if (tmp) {
- path = tmp;
- path[path_len++] = '/';
- memcpy(path + path_len, str, len);
- path_len += len;
- path[path_len] = '\0';
- }
- }
- }
- return path;
-}
-
-static int push_caller(const char *path, VALUE val, void *enc);
-
-static int ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
- rb_encoding *enc, VALUE var);
-
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)
{
struct stat st;
int status = 0;
struct glob_pattern **cur, **new_beg, **new_end;
- int plain = 0, brace = 0, magical = 0, recursive = 0, match_all = 0, match_dir = 0;
+ int plain = 0, magical = 0, recursive = 0, match_all = 0, match_dir = 0;
int escape = !(flags & FNM_NOESCAPE);
- size_t pathlen = baselen + namelen;
+ long pathlen;
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
@@ -2130,17 +1588,12 @@ glob_helper(
plain = 1;
break;
case ALPHA:
-#if USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME
+#if USE_NAME_ON_FS == 1
plain = 1;
#else
magical = 1;
#endif
break;
- case BRACE:
- if (!recursive) {
- brace = 1;
- }
- break;
case MAGICAL:
magical = 2;
break;
@@ -2155,78 +1608,60 @@ glob_helper(
}
}
- if (brace) {
- struct push_glob_args args;
- char* brace_path = join_path_from_pattern(beg);
- if (!brace_path) return -1;
- args.fd = fd;
- args.path = path;
- args.baselen = baselen;
- args.namelen = namelen;
- args.dirsep = dirsep;
- args.pathtype = pathtype;
- args.flags = flags;
- args.funcs = funcs;
- args.arg = arg;
- status = ruby_brace_expand(brace_path, flags, push_caller, (VALUE)&args, enc, Qfalse);
- GLOB_FREE(brace_path);
- return status;
- }
-
+ pathlen = strlen(path);
if (*path) {
- if (match_all && pathtype == path_unknown) {
- if (do_lstat(fd, baselen, path, &st, flags, enc) == 0) {
- pathtype = IFTODT(st.st_mode);
+ if (match_all && exist == UNKNOWN) {
+ if (do_lstat(path, &st, flags, enc) == 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, baselen, path, &st, flags, enc) == 0) {
- pathtype = IFTODT(st.st_mode);
+ if (match_dir && isdir == UNKNOWN) {
+ if (do_stat(path, &st, flags, enc) == 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) {
- int seplen = (baselen && path[baselen] == '/');
- const char *subpath = path + baselen + seplen;
- char *tmp = join_path(subpath, namelen - seplen, 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, 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
+# if USE_NAME_ON_FS == 2
char *plainname = 0;
# endif
IF_NORMALIZE_UTF8PATH(int norm_p);
-# if USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH
+# if USE_NAME_ON_FS == 2
if (cur + 1 == end && (*cur)->type <= ALPHA) {
plainname = join_path(path, pathlen, dirsep, (*cur)->str, strlen((*cur)->str));
if (!plainname) return -1;
- dirp = do_opendir(fd, basename, plainname, flags, enc, funcs->error, arg, &status);
+ dirp = do_opendir(plainname, flags, enc);
GLOB_FREE(plainname);
}
else
-# else
- ;
# endif
- dirp = do_opendir(fd, baselen, path, flags, enc, funcs->error, arg, &status);
+ dirp = do_opendir(*path ? path : ".", flags, enc);
if (dirp == NULL) {
# if FNM_SYSCASE || NORMALIZE_UTF8PATH
if ((magical < 2) && !recursive && (errno == EACCES)) {
@@ -2234,7 +1669,7 @@ glob_helper(
goto literally;
}
# endif
- return status;
+ return 0;
}
IF_NORMALIZE_UTF8PATH(norm_p = need_normalization(dirp, *path ? path : "."));
@@ -2245,33 +1680,32 @@ glob_helper(
}
# endif
# ifdef HAVE_GETATTRLIST
- if (is_case_sensitive(dirp, path) == 0)
+ if (is_case_sensitive(dirp) == 0)
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);
- 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;
}
}
+ name = dp->d_name;
+ namlen = NAMLEN(dp);
# if NORMALIZE_UTF8PATH
if (norm_p && has_nonascii(name, namlen)) {
if (!NIL_P(utf8str = rb_str_normalize_ospath(name, namlen))) {
@@ -2286,19 +1720,16 @@ glob_helper(
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, baselen, buf, &st, flags, enc) == 0)
- new_pathtype = IFTODT(st.st_mode);
+#ifndef _WIN32
+ if (do_lstat(buf, &st, flags, enc) == 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);
@@ -2310,26 +1741,14 @@ glob_helper(
for (cur = beg; cur < end; ++cur) {
struct glob_pattern *p = *cur;
- struct dirent_brace_args args;
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 BRACE:
- args.name = name;
- args.dp = dp;
- args.flags = flags;
- if (ruby_brace_expand(p->str, flags, dirent_match_brace,
- (VALUE)&args, enc, Qfalse) > 0)
- *new_end++ = p->next;
- break;
case ALPHA:
-# if USE_NAME_ON_FS == USE_NAME_ON_FS_BY_FNMATCH
+# if USE_NAME_ON_FS == 2
if (plainname) {
*new_end++ = p->next;
break;
@@ -2337,16 +1756,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;
@@ -2367,7 +1785,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;
@@ -2401,18 +1818,14 @@ glob_helper(
status = -1;
break;
}
-#if USE_NAME_ON_FS == USE_NAME_ON_FS_REAL_BASENAME
+#if USE_NAME_ON_FS == 1
if ((*cur)->type == ALPHA) {
- buf = replace_real_basename(buf, pathlen + (dirsep != 0), enc,
- IF_NORMALIZE_UTF8PATH(1)+0,
- flags, &new_pathtype);
- if (!buf) break;
+ long base = pathlen + (dirsep != 0);
+ buf = replace_real_basename(buf, base, enc, IF_NORMALIZE_UTF8PATH(1)+0);
}
#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;
@@ -2426,78 +1839,23 @@ glob_helper(
}
static int
-push_caller(const char *path, VALUE val, void *enc)
-{
- struct push_glob_args *arg = (struct push_glob_args *)val;
- struct glob_pattern *list;
- int status;
-
- list = glob_make_pattern(path, path + strlen(path), arg->flags, enc);
- if (!list) {
- return -1;
- }
- status = glob_helper(arg->fd, arg->path, arg->baselen, arg->namelen, arg->dirsep,
- arg->pathtype, &list, &list + 1, arg->flags, arg->funcs,
- arg->arg, enc);
- glob_free_pattern(list);
- return status;
-}
-
-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);
-
-struct push_glob0_args {
- int fd;
- const char *base;
- int flags;
- const ruby_glob_funcs_t *funcs;
- VALUE arg;
-};
-
-static int
-push_glob0_caller(const char *path, VALUE val, void *enc)
-{
- struct push_glob0_args *arg = (struct push_glob0_args *)val;
- return ruby_glob0(path, arg->fd, arg->base, arg->flags, arg->funcs, arg->arg, enc);
-}
-
-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;
-
- if (*root == '{') {
- struct push_glob0_args args;
- args.fd = fd;
- args.base = base;
- args.flags = flags;
- args.funcs = funcs;
- args.arg = arg;
- return ruby_brace_expand(path, flags, push_glob0_caller, (VALUE)&args, enc, Qfalse);
- }
-
flags |= FNM_SYSCASE;
#if defined DOSISH
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);
@@ -2508,9 +1866,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);
@@ -2520,11 +1876,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
@@ -2538,41 +1891,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;
+
+ if (flags & FNM_SYSCASE) {
+ rb_warning("Dir.glob() ignores File::FNM_CASEFOLD");
+ }
- status = ruby_glob0(path, AT_FDCWD, 0, GLOB_VERBOSE, &rb_glob_funcs,
- (VALUE)&args, args.enc);
+ 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();
- 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;
@@ -2585,7 +1938,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;
}
@@ -2617,7 +1970,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);
@@ -2626,12 +1979,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;
};
@@ -2641,94 +1993,86 @@ 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());
+}
+
+int
+ruby_brace_glob_with_enc(const char *str, int flags, ruby_glob_func *func, VALUE arg, rb_encoding *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 glob_args args;
- int fd;
- rb_encoding *enc = rb_enc_get(str);
+#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.func = push_pattern;
args.value = ary;
args.enc = enc;
- args.base = 0;
- 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 ((fd = dirfd(dirp->dir)) == -1)
- rb_sys_fail_path(dir_inspect(base));
-#endif
- base = dirp->path;
- }
- args.base = RSTRING_PTR(base);
- }
-#if defined _WIN32 || defined __APPLE__
- enc = rb_utf8_encoding();
-#endif
- return ruby_glob0(RSTRING_PTR(str), fd, args.base, flags, &rb_glob_funcs,
- (VALUE)&args, enc);
+ 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;
- int status;
- /* can contain null bytes as separators */
- if (!RB_TYPE_P(str, T_STRING)) {
- FilePathValue(str);
- }
- else if (!rb_str_to_cstr(str)) {
- rb_raise(rb_eArgError, "nul-separated glob pattern is deprecated");
- }
- else {
- rb_enc_check(str, rb_enc_from_encoding(rb_usascii_encoding()));
- }
+ GlobPathValue(str, TRUE);
ary = rb_ary_new();
- status = push_glob(ary, str, base, flags);
- if (status) GLOB_JUMP_TAG(status);
+ while (offset < RSTRING_LEN(str)) {
+ char *p, *pend;
+ int status;
+ p = RSTRING_PTR(str) + offset;
+ status = push_glob(ary, rb_enc_str_new(p, strlen(p), rb_enc_get(str)),
+ flags);
+ if (status) GLOB_JUMP_TAG(status);
+ if (offset >= RSTRING_LEN(str)) break;
+ p += strlen(p) + 1;
+ pend = RSTRING_PTR(str) + RSTRING_LEN(str);
+ while (p < pend && !*p)
+ p++;
+ offset = p - RSTRING_PTR(str);
+ }
return ary;
}
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;
@@ -2736,84 +2080,47 @@ 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[ string [, string ...] ] -> array
*
* Equivalent to calling
- * <code>Dir.glob([</code><i>string,...</i><code>], 0)</code>.
+ * <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
- *
- * 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.
+ * Dir.glob( pattern, [flags] ) -> matches
+ * Dir.glob( pattern, [flags] ) { |filename| block } -> nil
*
- * 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.
+ * 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.
*
- * 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.
- * Equivalent to <code>/ .* /mx</code> in regexp.
+ * Equivalent to <code>/ .* /x</code> in regexp.
*
* <code>*</code>:: Matches all files
* <code>c*</code>:: Matches all files beginning with <code>c</code>
@@ -2858,16 +2165,11 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
* Dir.glob("*.{rb,h}") #=> ["main.rb", "config.h"]
* Dir.glob("*") #=> ["config.h", "main.rb"]
* Dir.glob("*", File::FNM_DOTMATCH) #=> [".", "..", "config.h", "main.rb"]
- * Dir.glob(["*.rb", "*.h"]) #=> ["main.rb", "config.h"]
*
* rbfiles = File.join("**", "*.rb")
* 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"]
*
@@ -2881,23 +2183,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);
}
@@ -2911,7 +2211,7 @@ dir_s_glob(int argc, VALUE *argv, VALUE obj)
static VALUE
dir_open_dir(int argc, VALUE *argv)
{
- VALUE dir = rb_funcallv_kw(rb_cDir, rb_intern("open"), argc, argv, RB_PASS_CALLED_KEYWORDS);
+ VALUE dir = rb_funcall2(rb_cDir, rb_intern("open"), argc, argv);
rb_check_typeddata(dir, &dir_data_type);
return dir;
@@ -2951,25 +2251,17 @@ 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
* Dir.entries( dirname, encoding: enc ) -> array
*
* Returns an array containing all of the filenames in the given
- * directory. Will raise a SystemCallError if the named directory
- * doesn't exist.
+ * 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"]
*
@@ -2980,115 +2272,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;
-}
-
-/*
- * call-seq:
- * dir.each_child {| filename | block } -> nil
- * dir.each_child -> an_enumerator
- *
- * Calls the block once for each entry except for "." and ".." in
- * this directory, passing the filename of each entry as a parameter
- * to the block.
- *
- * If no block is given, an enumerator is returned instead.
- *
- * d = Dir.new("testdir")
- * d.each_child {|x| puts "Got #{x}" }
- *
- * <em>produces:</em>
- *
- * Got config.h
- * Got main.rb
- *
- */
-static VALUE
-dir_each_child_m(VALUE dir)
-{
- RETURN_ENUMERATOR(dir, 0, 0);
- return dir_each_entry(dir, dir_yield, Qnil, TRUE);
-}
-
-/*
- * call-seq:
- * dir.children -> array
- *
- * Returns an array containing all of the filenames except for "."
- * and ".." in this directory.
- *
- * d = Dir.new("testdir")
- * d.children #=> ["config.h", "main.rb"]
- *
- */
-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 SystemCallError 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
@@ -3176,7 +2360,6 @@ fnmatch_brace(const char *pattern, VALUE val, void *enc)
*
* File.fnmatch('cat', 'CAT') #=> false # case sensitive
* File.fnmatch('cat', 'CAT', File::FNM_CASEFOLD) #=> true # case insensitive
- * File.fnmatch('cat', 'CAT', File::FNM_SYSCASE) #=> true or false # depends on the system default
*
* File.fnmatch('?', '/', File::FNM_PATHNAME) #=> false # wildcard doesn't match '/' on FNM_PATHNAME
* File.fnmatch('*', '/', File::FNM_PATHNAME) #=> false # ditto
@@ -3223,7 +2406,7 @@ file_s_fnmatch(int argc, VALUE *argv, VALUE obj)
else
flags = 0;
- StringValueCStr(pattern);
+ StringValue(pattern);
FilePathStringValue(path);
if (flags & FNM_EXTGLOB) {
@@ -3232,7 +2415,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 {
@@ -3302,89 +2485,11 @@ 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 Dir are directory streams representing
- * directories in the underlying file system. They provide a variety
- * of ways to list directories and their contents. See also File.
+ * Objects of class <code>Dir</code> are directory streams representing
+ * directories in the underlying file system. They provide a variety of
+ * ways to list directories and their contents. See also
+ * <code>File</code>.
*
* The directory used in these examples contains the two regular files
* (<code>config.h</code> and <code>main.rb</code>), the parent
@@ -3402,8 +2507,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);
@@ -3412,8 +2515,6 @@ Init_Dir(void)
rb_define_method(rb_cDir,"inspect", dir_inspect, 0);
rb_define_method(rb_cDir,"read", dir_read, 0);
rb_define_method(rb_cDir,"each", dir_each, 0);
- rb_define_method(rb_cDir,"each_child", dir_each_child_m, 0);
- rb_define_method(rb_cDir,"children", dir_collect_children, 0);
rb_define_method(rb_cDir,"rewind", dir_rewind, 0);
rb_define_method(rb_cDir,"tell", dir_tell, 0);
rb_define_method(rb_cDir,"seek", dir_seek, 1);
@@ -3435,7 +2536,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);
@@ -3479,11 +2579,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 c40cbfc6ac..e5269ca441 100644
--- a/dln.c
+++ b/dln.c
@@ -22,7 +22,6 @@
static void dln_loaderror(const char *format, ...);
#endif
#include "dln.h"
-#include "internal.h"
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
@@ -86,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, ...)
@@ -103,7 +106,7 @@ 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)
+#if defined(__hp9000s300) || ((defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && !defined(__ELF__)) || defined(__BORLANDC__) || defined(NeXT) || defined(__WATCOMC__) || defined(MACOSX_DYLD)
# define EXTERNAL_PREFIX "_"
#else
# define EXTERNAL_PREFIX ""
@@ -232,13 +235,13 @@ load_header(int fd, struct exec *hdrp, long disp)
# define R_RIGHTSHIFT(r) (reloc_r_rightshift[(r)->r_type])
# define R_BITSIZE(r) (reloc_r_bitsize[(r)->r_type])
# define R_LENGTH(r) (reloc_r_length[(r)->r_type])
-static const int reloc_r_rightshift[] = {
+static int reloc_r_rightshift[] = {
0, 0, 0, 0, 0, 0, 2, 2, 10, 0, 0, 0, 0, 0, 0,
};
-static const int reloc_r_bitsize[] = {
+static int reloc_r_bitsize[] = {
8, 16, 32, 8, 16, 32, 30, 22, 22, 22, 13, 10, 32, 32, 16,
};
-static const int reloc_r_length[] = {
+static int reloc_r_length[] = {
0, 1, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
};
# define R_PCREL(r) \
@@ -1114,12 +1117,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)
{
@@ -1171,7 +1174,7 @@ dln_strerror(void)
}
#endif
-#if defined(_AIX)
+#if defined(_AIX) && ! defined(_IA64)
static void
aix_loaderror(const char *pathname)
{
@@ -1243,31 +1246,15 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
#define translit_separator(str) (void)(str)
#endif
-#ifdef USE_DLN_DLOPEN
-COMPILER_WARNING_PUSH
-#if defined(__clang__) || GCC_VERSION_SINCE(4, 2, 0)
-COMPILER_WARNING_IGNORED(-Wpedantic)
-#endif
-static bool
-dln_incompatible_library_p(void *handle)
-{
- void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
- return ex && ex != ruby_xmalloc;
-}
-COMPILER_WARNING_POP
-#endif
-
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];
@@ -1295,7 +1282,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
@@ -1344,11 +1331,11 @@ dln_load(const char *file)
}
# if defined RUBY_EXPORT
{
- if (dln_incompatible_library_p(handle)) {
+ static const char incompatible[] = "incompatible library version";
+ void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
+ if (ex && ex != ruby_xmalloc) {
-# if defined __APPLE__ && \
- defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
- (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11)
+# if defined __APPLE__
/* dlclose() segfaults */
rb_fatal("%s - %s", incompatible, file);
# else
@@ -1362,8 +1349,7 @@ dln_load(const char *file)
init_fct = (void(*)())(VALUE)dlsym(handle, buf);
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;
}
@@ -1400,7 +1386,7 @@ dln_load(const char *file)
}
#endif /* hpux */
-#if defined(_AIX)
+#if defined(_AIX) && ! defined(_IA64)
#define DLN_DEFINED
{
void (*init_fct)();
@@ -1456,6 +1442,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 d05cda0b8e..25872efc98 100644
--- a/dmydln.c
+++ b/dmydln.c
@@ -1,10 +1,9 @@
#include "ruby/ruby.h"
-NORETURN(void *dln_load(const char *));
void*
dln_load(const char *file)
{
rb_loaderror("this executable file can't load extension libraries");
- UNREACHABLE_RETURN(NULL);
+ UNREACHABLE;
}
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 bd5f140dc3..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 6d9453d011..0d00266735 100644
--- a/doc/ChangeLog-1.8.0
+++ b/doc/ChangeLog-1.8.0
@@ -13020,7 +13020,7 @@ Tue Jun 12 00:41:18 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
Mon Jun 11 14:29:41 2001 WATANABE Hirofumi <eban@ruby-lang.org>
- * configure.in: add RUBY_CANONICAL_BUILD.
+ * confgure.in: add RUBY_CANONICAL_BUILD.
Sun Jun 10 17:31:47 2001 Guy Decoux <decoux@moulon.inra.fr>
@@ -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..b3deb551b0 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]
@@ -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>
@@ -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>
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 96b5ecb077..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 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-YARV b/doc/ChangeLog-YARV
index a8b999dff2..6a6cfbd0c9 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
@@ -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)
diff --git a/doc/NEWS-1.8.7 b/doc/NEWS-1.8.7
index 5da39ff265..38571fe103 100644
--- a/doc/NEWS-1.8.7
+++ b/doc/NEWS-1.8.7
@@ -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
diff --git a/doc/NEWS-1.9.2 b/doc/NEWS-1.9.2
index 430c6cc4f5..9cf58c9aff 100644
--- a/doc/NEWS-1.9.2
+++ b/doc/NEWS-1.9.2
@@ -240,7 +240,7 @@ with all sufficient information, see the ChangeLog file.
* new alias of item.guid.isPermaLink=
* DL
- * Now uses libffi as a backend if available.
+ * Now uses libffi as a backend if avaiable.
It means DL works fine on more platforms.
* Fiddle
@@ -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 414789dcd1..9ad7254317 100644
--- a/doc/NEWS-2.0.0
+++ b/doc/NEWS-2.0.0
@@ -94,7 +94,7 @@ with all sufficient information, see the ChangeLog file.
required caller size.
* Kernel#to_enum and enum_for accept a block for lazy size evaluation.
* incompatible changes:
- * system() and exec() close non-standard file descriptors
+ * system() and exec() closes non-standard file descriptors
(The default of :close_others option is changed to true by default.)
* respond_to? against a protected method now returns false unless
the second argument is true.
@@ -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
@@ -528,3 +528,4 @@ with all sufficient information, see the ChangeLog file.
* NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
* rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class.
+
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/NEWS-2.5.0 b/doc/NEWS-2.5.0
deleted file mode 100644
index c891317b61..0000000000
--- a/doc/NEWS-2.5.0
+++ /dev/null
@@ -1,565 +0,0 @@
-# -*- rdoc -*-
-
-= NEWS for Ruby 2.5.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.4.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]
-
-=== Core classes updates (outstanding ones only)
-
-* Array
-
- * 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]
-
-* 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]
-
-* Enumerable
-
- * Enumerable#any?, Enumerable#all?, Enumerable#none? and Enumerable#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 <code>rb_stat()</code>-using methods
- release GVL. [Bug #13941]
- * File.rename releases GVL. [Feature #13951]
- * File::Stat#atime, File::Stat#mtime and File::Stat#ctime support fractional
- second timestamps on Windows 8 and later. [Feature #13726]
- * File::Stat#ino and File.identical? 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]
-
-* Hash
-
- * New methods:
-
- * 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]
-
- * New methods:
-
- * 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#round, Integer#floor, Integer#ceil and Integer#truncate always
- return an Integer. [Bug #13420]
- * Integer#pow accepts modulo argument for calculating modular
- exponentiation. [Feature #12508] [Feature #11003]
-
- * New methods:
-
- * Integer#allbits?, Integer#anybits?, Integer#nobits? [Feature #12753]
- * Integer.sqrt [Feature #13219]
-
-* 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, Module#attr_accessor, Module#attr_reader and Module#attr_writer
- become public. [Feature #14132]
- * Module#define_method, Module#alias_method, Module#undef_method and
- Module#remove_method become public. [Feature #14133]
-
-* Numeric
-
- * Numeric#step no longer hides errors from coerce method when
- given a step value which cannot be compared with #> to 0. [Feature #7688]
- * Numerical comparison operators (<,<=,>=,>) no longer hide exceptions
- from #coerce method internally. Return nil in #coerce if the coercion is
- impossible. [Feature #7688]
-
-* Process
-
- * 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
-
- * <code>String#-@</code> deduplicates unfrozen strings. Already-frozen
- strings remain unchanged for compatibility. [Feature #13077]
- * <code>-"literal"</code> (<code>String#-@</code>) optimized to return the same object
- (same as <code>"literal".freeze</code> in Ruby 2.1+) [Feature #13295]
- * String#casecmp and String#casecmp? return nil for non-string arguments
- instead of raising a TypeError. [Bug #13312]
- * String#start_with? accepts a regexp [Feature #13712]
-
- * New methods:
-
- * 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
-
- * New methods:
-
- * 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.
-
- 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 and IPAddr#ipv4_compat? are marked for deprecation. [Bug #13769]
-
- * New methods:
-
- * IPAddr#prefix
- * IPAddr#loopback?
- * IPAddr#private? [Feature #11666]
- * IPAddr#link_local? [Feature #10912]
-
-* IRB
-
- * 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]
-
-* Matrix
-
- * New methods:
-
- * Matrix.combine and Matrix#combine [Feature #10903]
- * Matrix#hadamard_product and Matrix#entrywise_product
-
-* Net::HTTP
-
- * Net::HTTP.new supports no_proxy parameter [Feature #11195]
- * Net::HTTP#min_version and Net::HTTP#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 and Net::HTTP#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.
-
-* 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
-
- * New methods:
-
- * 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
-
- * Zlib::GzipWriter#write accepts multiple arguments
-
-=== Compatibility issues (excluding feature bug fixes)
-
-* Socket
-
- * BasicSocket#read_nonblock and BasicSocket#write_nonblock no
- longer set the O_NONBLOCK file description flag as side effect
- (on Linux only) [Feature #13362]
-
-* Random
-
- * Random.raw_seed renamed to become Random.urandom. It is now
- applicable to non-seeding purposes due to [Bug #9569].
-
-* Socket
-
- * Socket::Ifaddr#vhid is added [Feature #13803]
-
-* ConditionVariable, Queue and SizedQueue reimplemented for speed.
- They no longer subclass Struct. [Feature #13552]
-
-=== Stdlib compatibility issues (excluding feature bug fixes)
-
-* Gemification
-
- * Promote following standard libraries to default gems.
- * cmath
- * csv
- * date
- * dbm
- * etc
- * fcntl
- * fiddle
- * fileutils
- * gdbm
- * ipaddr
- * scanf
- * sdbm
- * stringio
- * strscan
- * webrick
- * zlib
-
-* Logger
-
- * 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]
-
-* Rubygems
-
- * Removed "ubygems.rb" file from stdlib. It's needless since Ruby 1.9.
-
-=== 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 twice as fast as 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]
diff --git a/doc/NEWS-2.6.0 b/doc/NEWS-2.6.0
deleted file mode 100644
index 2303a5bd41..0000000000
--- a/doc/NEWS-2.6.0
+++ /dev/null
@@ -1,662 +0,0 @@
-# -*- rdoc -*-
-
-= NEWS for Ruby 2.6.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.5.0 release
-
-=== Language changes
-
-* <code>$SAFE</code> now is a process global state and can be set to 0 again. [Feature #14250]
-
-* Refinements take place at block passing. [Feature #14223]
-
-* Refinements take place at Kernel#public_send. [Feature #15326]
-
-* Refinements take place at Kernel#respond_to?. [Feature #15327]
-
-* +else+ without +rescue+ now causes a syntax error. [EXPERIMENTAL] [Feature #14606]
-
-* Constant names may start with a non-ASCII capital letter. [Feature #13770]
-
-* Endless ranges are introduced. You can use a Range that has no end,
- like <code>(0..)</code> (or similarly <code>(0...)</code>). [Feature #12912]
-
- The following shows typical use cases:
-
- ary[1..] # identical to ary[1..-1]
- (1...).each {|index| block } # infinite loop from index 1
- ary.zip(1..) {|elem, index| block } # ary.each.with_index(1) { }
-
-* Non-Symbol keys in a keyword arguments hash cause an exception.
-
-* The "shadowing outer local variable" warning is removed. [Feature #12490]
-
- You can now write the following without warning:
-
- user = users.find {|user| cond(user) }
-
-* Print +cause+ of the exception if the exception is not caught and printed
- its backtraces and error message. [Feature #8257]
-
-* The flip-flop syntax is deprecated. [Feature #5400]
-
-=== Core classes updates (outstanding ones only)
-
-Array::
-
- New methods::
-
- * Added Array#union and Array#difference instance methods. [Feature #14097]
-
- Modified method::
-
- * Array#to_h now accepts a block that maps elements to new key/value pairs. [Feature #15143]
-
- Aliased methods::
-
- * Array#filter is a new alias for Array#select. [Feature #13784]
- * Array#filter! is a new alias for Array#select!. [Feature #13784]
-
-Binding::
-
- New method::
-
- * Added Binding#source_location. [Feature #14230]
-
- This method returns the source location of the binding, a 2-element
- array of <code>__FILE__</code> and <code>__LINE__</code>.
- Traditionally, the same information could be retrieved by
- <code>eval("[__FILE__, __LINE__]", binding)</code>, but we are
- planning to change this behavior so that Kernel#eval ignores
- binding's source location [Bug #4352]. So, users should use this
- newly-introduced method instead of Kernel#eval.
-
-Dir::
-
- New methods::
-
- * Added Dir#each_child and Dir#children instance methods. [Feature #13969]
-
-Enumerable::
-
- New method::
-
- * Enumerable#chain returns an enumerator object that iterates over the
- elements of the receiver and then those of each argument
- in sequence. [Feature #15144]
-
- Modified method::
-
- * Enumerable#to_h now accepts a block that maps elements to new key/value pairs. [Feature #15143]
-
- Aliased method::
-
- * Enumerable#filter is a new alias for Enumerable#select. [Feature #13784]
-
-Enumerator::ArithmeticSequence::
-
- * This is a new class to represent a generator of an arithmetic sequence,
- that is a number sequence defined by a common difference. It can be used
- for representing what is similar to Python's slice. You can get an
- instance of this class from Numeric#step and Range#step.
-
-Enumerator::Chain::
-
- * This is a new class to represent a chain of enumerables that works as a
- single enumerator, generated by such methods as Enumerable#chain and
- Enumerator#+.
-
-Enumerator::Lazy::
-
- Aliased method::
-
- * Enumerator::Lazy#filter is a new alias for
- Enumerator::Lazy#select. [Feature #13784]
-
-Enumerator::
-
- New methods::
-
- * Enumerator#+ returns an enumerator object that iterates over the
- elements of the receiver and then those of the other operand. [Feature #15144]
-
-ENV::
-
- Modified method::
-
- * ENV.to_h now accepts a block that maps names and values to new keys and values. [Feature #15143]
-
-Exception::
-
- New options::
-
- * Exception#full_message takes +:highlight+ and +:order+
- options. [Bug #14324]
-
-Hash::
-
- Modified methods::
-
- * Hash#merge, Hash#merge!, and Hash#update now accept multiple
- arguments. [Feature #15111]
-
- * Hash#to_h now accepts a block that maps keys and values to new keys and values. [Feature #15143]
-
- Aliased methods::
-
- * Hash#filter is a new alias for Hash#select. [Feature #13784]
-
- * Hash#filter! is a new alias for Hash#select!. [Feature #13784]
-
-IO::
-
- New option::
-
- * Added new mode character <code>'x'</code> to open files for exclusive
- access. [Feature #11258]
-
-Kernel::
-
- Aliased method::
-
- * Kernel#then is a new alias for Kernel#yield_self. [Feature #14594]
-
- New options::
-
- * Kernel#Complex, Kernel#Float, Kernel#Integer, and
- Kernel#Rational take an +:exception+ option to specify the way of
- error handling. [Feature #12732]
-
- * Kernel#system takes an +:exception+ option to raise an exception
- on failure. [Feature #14386]
-
- Incompatible changes::
-
- * Kernel#system and Kernel#exec do not close non-standard file descriptors
- (the default of the +:close_others+ option is changed to +false+,
- but we still set the +FD_CLOEXEC+ flag on descriptors we
- create). [Misc #14907]
-
-KeyError::
-
- New options::
-
- * KeyError.new accepts +:receiver+ and +:key+ options to set receiver and
- key in Ruby code. [Feature #14313]
-
-Method::
-
- New methods::
-
- * Added Method#<< and Method#>> for Proc composition. [Feature #6284]
-
-Module::
-
- Modified methods::
-
- * Module#method_defined?, Module#private_method_defined?, and
- Module#protected_method_defined? now accept the second
- parameter as optional. If it is +true+ (the default value), it checks
- ancestor modules/classes, or checks only the class itself. [Feature #14944]
-
-NameError::
-
- New option::
-
- * NameError.new accepts a +:receiver+ option to set receiver in Ruby
- code. [Feature #14313]
-
-NilClass::
-
- New method::
-
- * NilClass#=~ is added for compatibility. [Feature #15231]
-
-NoMethodError::
-
- New option::
-
- * NoMethodError.new accepts a +:receiver+ option to set receiver in Ruby
- code. [Feature #14313]
-
-Numeric::
-
- Incompatible changes::
-
- * Numeric#step now returns an instance of the Enumerator::ArithmeticSequence
- class rather than one of the Enumerator class.
-
-OpenStruct::
-
- Modified method::
-
- * OpenStruct#to_h now accepts a block that maps keys and values to new keys and values. [Feature #15143]
-
-Proc::
-
- New methods::
-
- * Added Proc#<< and Proc#>> for Proc composition. [Feature #6284]
-
- Incompatible changes::
-
- * Proc#call doesn't change <code>$SAFE</code> any more. [Feature #14250]
-
-Random::
-
- New method::
-
- * Added Random.bytes. [Feature #4938]
-
-Range::
-
- New method::
-
- * Added Range#% instance method. [Feature #14697]
-
- Incompatible changes::
-
- * Range#=== now uses the +#cover?+ instead of the +#include?+ method. [Feature #14575]
- * Range#cover? now accepts a Range object. [Feature #14473]
- * Range#step now returns an instance of the Enumerator::ArithmeticSequence
- class rather than one of the Enumerator class.
-
-Regexp/String::
-
- * Update Unicode version from 10.0.0 to 11.0.0. [Feature #14802]
-
- This includes a rewrite of the grapheme cluster (/\X/) algorithm
- and special-casing for Georgian MTAVRULI on String#downcase.
-
- * Update Emoji version from 5.0 to 11.0.0 [Feature #14802]
-
-RubyVM::AbstractSyntaxTree::
-
- New methods::
-
- * RubyVM::AbstractSyntaxTree.parse parses a given string and returns AST
- nodes. [experimental]
-
- * RubyVM::AbstractSyntaxTree.parse_file parses a given file and returns AST
- nodes. [experimental]
-
- * RubyVM::AbstractSyntaxTree.of returns AST nodes of the given proc or
- method. [experimental]
-
-RubyVM::
-
- New method::
-
- * RubyVM.resolve_feature_path identifies the file that will be loaded by
- "require(feature)". [experimental] [Feature #15230]
-
-String::
-
- * String#crypt is now deprecated. [Feature #14915]
-
- New features::
-
- * String#split yields each substring to the block if given. [Feature #4780]
-
-Struct::
-
- Modified method::
-
- * Struct#to_h now accepts a block that maps keys and values to new keys and values. [Feature #15143]
-
- Aliased method::
-
- * Struct#filter is a new alias for Struct#select. [Feature #13784]
-
-Time::
-
- New features::
-
- * Time.new and Time#getlocal accept a timezone object as well as
- a UTC offset string. Time#+, Time#-, and Time#succ also preserve
- the timezone. [Feature #14850]
-
-TracePoint::
-
- New features::
-
- * "script_compiled" event is supported. [Feature #15287]
-
- New methods::
-
- * TracePoint#parameters [Feature #14694]
-
- * TracePoint#instruction_sequence [Feature #15287]
-
- * TracePoint#eval_script [Feature #15287]
-
- Modified method::
-
- * TracePoint#enable accepts new keywords "target:" and
- "target_line:". [Feature #15289]
-
-=== Stdlib updates (outstanding ones only)
-
-BigDecimal::
-
- Update to version 1.4.0. This version includes several compatibility
- issues, see Compatibility issues section below for details.
-
- Modified method::
-
- * BigDecimal() accepts the new keyword "exception:" similar to Float().
-
- Note for the differences among recent versions::
-
- You should want to know the differences among recent versions of bigdecimal.
- Please select the suitable version of bigdecimal according to the following
- information.
-
- * 1.3.5 has BigDecimal.new without "exception:" keyword. You can see the
- deprecation warning of BigDecimal.new when you specify "-w" option.
- BigDecimal(), BigDecimal.new, and Object#to_d methods are the same.
-
- * 1.4.0 has BigDecimal.new with "exception:" keyword. You always see the
- deprecation warning of BigDecimal.new. Object#to_d method is different
- from BigDecimal() and BigDecimal.new.
-
- * 2.0.0 will be released soon after releasing Ruby 2.6.0. This version
- will not have the BigDecimal.new method.
-
-Bundler::
-
- * Add Bundler to Standard Library. [Feature #12733]
-
- * Use 1.17.2, the latest stable version.
-
-Coverage::
-
- A oneshot_lines mode is added. [Feature #15022]
-
- This mode checks "whether each line was executed at least once or not",
- instead of "how many times each line was executed".
- A hook for each line is fired at most once, and after it is fired
- the hook flag is removed, i.e., it runs with zero overhead.
-
- New options::
-
- * Add +:oneshot_lines+ keyword argument to Coverage.start.
-
- * Add +:stop+ and +:clear+ keyword arguments to Coverage.result.
- If +clear+ is true, it clears the counters to zero.
- If +stop+ is true, it disables coverage measurement.
-
- New methods::
-
- * Coverage.line_stub, which is a simple helper function that
- creates the "stub" of line coverage from a given source code.
-
-CSV::
-
- * Upgrade to 3.0.2. This includes performance improvements especially
- for writing. Writing is about 2 times faster.
- See https://github.com/ruby/csv/blob/master/NEWS.md.
-
-ERB::
-
- New options::
-
- * Add +:trim_mode+ and +:eoutvar+ keyword arguments to ERB.new.
- Now non-keyword arguments other than the first one are softly deprecated
- and will be removed when Ruby 2.5 becomes EOL. [Feature #14256]
-
- * erb command's <tt>-S</tt> option is deprecated, and will be removed
- in the next version.
-
-FileUtils::
-
- New methods::
-
- * FileUtils#cp_lr. [Feature #4189]
-
-Matrix::
-
- New methods::
-
- * Matrix#antisymmetric?, Matrix#skew_symmetric?
-
- * Matrix#map!, Matrix#collect! [Feature #14151]
-
- * Matrix#[]=
-
- * Vector#map!, Vector#collect!
-
- * Vector#[]=
-
-Net::
-
- New options::
-
- * Add +:write_timeout+ keyword argument to Net::HTTP.new. [Feature #13396]
-
- New methods::
-
- * Add Net::HTTP#write_timeout and Net::HTTP#write_timeout=. [Feature #13396]
-
- New constant::
-
- * Add Net::HTTPClientException to deprecate Net::HTTPServerException,
- whose name is misleading. [Bug #14688]
-
-NKF::
-
- * Upgrade to nkf v2.1.5
-
-Psych::
-
- * Upgrade to Psych 3.1.0
-
-RDoc::
-
- * Become about 2 times faster.
-
- * Use SOURCE_DATE_EPOCH to generate files.
-
- * Fix method line number that slipped off.
-
- * Enable <code>--width</code>, <code>--exclude</code>,
- and <code>--line-numbers</code> that were ignored.
-
- * Add support for blockquote by ">>>" in default markup notation.
-
- * Add support for "Raises" lines in TomDoc notation.
-
- * Fix syntax error output.
-
- * Fix many parsing bugs.
-
-REXML::
-
- * Upgrade to REXML 3.1.9.
- See https://github.com/ruby/rexml/blob/master/NEWS.md.
-
- Improved some XPath implementations::
-
- * <code>concat()</code> function: Stringify all arguments before concatenating.
-
- * <code>string()</code> function: Support context node.
-
- * <code>string()</code> function: Support processing instruction node.
-
- * Support <code>"*:#{ELEMENT_NAME}"</code> syntax in XPath 2.0.
-
- Fixed some XPath implementations::
-
- * <code>"//#{ELEMENT_NAME}[#{POSITION}]"</code> case
-
- * <code>string()</code> function: Fix <code>function(document)</code>
- returns nodes that are out of root elements.
-
- * <code>"/ #{ELEMENT_NAME} "</code> case
-
- * <code>"/ #{ELEMENT_NAME} [ #{PREDICATE} ]"</code> case
-
- * <code>"/ #{AXIS}::#{ELEMENT_NAME}"</code> case
-
- * <code>"#{N}-#{M}"</code> case: One or more white spaces were required
- before <code>"-"</code>
-
- * <code>"/child::node()"</code> case
-
- * <code>"#{FUNCTION}()/#{PATH}"</code> case
-
- * <code>"@#{ATTRIBUTE}/parent::"</code> case
-
- * <code>"name(#{NODE_SET})"</code> case
-
-RSS::
-
- New options::
-
- * RSS::Parser.parse now accepts options as Hash. +:validate+ ,
- +:ignore_unknown_element+ , +:parser_class+ options are available.
-
-RubyGems::
-
- * Upgrade to RubyGems 3.0.1
-
- * https://blog.rubygems.org/2018/12/19/3.0.0-released.html
-
- * https://blog.rubygems.org/2018/12/23/3.0.1-released.html
-
-Set::
-
- Aliased method::
-
- * Set#filter! is a new alias for Set#select!. [Feature #13784]
-
-URI::
-
- New constant::
-
- * Add URI::File to handle the file URI scheme. [Feature #14035]
-
-=== Compatibility issues (excluding feature bug fixes)
-
-Dir::
-
- * Dir.glob with <code>'\0'</code>-separated pattern list will be deprecated,
- and is now warned. [Feature #14643]
-
-File::
-
- * File.read, File.binread, File.write, File.binwrite, File.foreach, and
- File.readlines do not invoke external commands even if the path starts
- with the pipe character <code>'|'</code>. [Feature #14245]
-
-Object::
-
- * Object#=~ is deprecated. [Feature #15231]
-
-=== Stdlib compatibility issues (excluding feature bug fixes)
-
-* These standard libraries have been promoted to default gems.
-
- * e2mmap
- * forwardable
- * irb
- * logger
- * matrix
- * mutex_m
- * ostruct
- * prime
- * rexml
- * rss
- * shell
- * sync
- * thwait
- * tracer
-
-BigDecimal::
-
- * The following methods are removed.
-
- * BigDecimal.allocate
- * BigDecimal.ver
-
- * Every BigDecimal object is frozen. [Feature #13984]
-
- * BigDecimal() parses the given string similar to Float().
-
- * String#to_d parses the receiver string similar to String#to_f.
-
- * BigDecimal.new will be removed in version 2.0.
-
-Pathname::
-
- * Pathname#read, Pathname#binread, Pathname#write, Pathname#binwrite,
- Pathname#each_line and Pathname#readlines do not invoke external
- commands even if the path starts with the pipe character <code>'|'</code>.
- This follows [Feature #14245].
-
-=== Implementation improvements
-
-* Speedup Proc#call because we don't need to care about <code>$SAFE</code>
- any more. [Feature #14318]
-
- With +lc_fizzbuzz+ benchmark which uses Proc#call many times we can
- measure x1.4 improvements. [Bug #10212]
-
-* Speedup block.call where +block+ is passed block parameter. [Feature #14330]
-
- Ruby 2.5 improves block passing performance. [Feature #14045]
-
- Additionally, Ruby 2.6 improves the performance of passed block calling.
-
-* Introduce an initial implementation of a JIT (Just-in-time) compiler. [Feature #14235] [experimental]
-
- * <tt>--jit</tt> command line option is added to enable JIT. <tt>--jit-verbose=1</tt>
- is good for inspection. See <tt>ruby --help</tt> for others.
- * To generate machine code, this JIT compiler uses the C compiler used for building
- the interpreter. Currently GCC, Clang, and Microsoft Visual C++ are supported for it.
- * <tt>--disable-mjit-support</tt> option is added to configure. This is added for JIT debugging,
- but if you get an error on building a header file for JIT, you can use this option to skip
- building it as a workaround.
- * rb_waitpid reimplemented on Unix-like platforms to maintain
- compatibility with processes created for JIT [Bug #14867]
-
-* VM generator script renewal; makes the generated VM more optimized. [GH-1779]
-
-* Thread cache enabled for pthreads platforms (for Thread.new and
- Thread.start). [Feature #14757]
-
-* timer thread is eliminated for platforms with POSIX timers. [Misc #14937]
-
-* Transient Heap (theap) is supported. [Bug #14858] [Feature #14989]
-
- theap is a managed heap for short-living memory objects. For example,
- making a small and short-living Hash object is x2 faster. With rdoc benchmark,
- we measured 6-7% performance improvement.
-
-* Native implementations (arm32, arm64, ppc64le, win32, win64, x86, amd64) of
- coroutines to improve performance of Fiber significantly. [Feature #14739]
-
-=== Miscellaneous changes
-
-* On macOS, shared libraries no longer include a full version number of Ruby
- in their names. This eliminates the burden of each teeny upgrade on the
- platform that users need to rebuild every extension library.
-
- Before::
- * libruby.2.6.0.dylib
- * libruby.2.6.dylib -> libruby.2.6.0.dylib
- * libruby.dylib -> libruby.2.6.0.dylib
-
- After::
- * libruby.2.6.dylib
- * libruby.dylib -> libruby.2.6.dylib
-
-* Extracted misc/*.el files to https://github.com/ruby/elisp
diff --git a/doc/bug_triaging.rdoc b/doc/bug_triaging.rdoc
deleted file mode 100644
index 83fe88cabe..0000000000
--- a/doc/bug_triaging.rdoc
+++ /dev/null
@@ -1,79 +0,0 @@
-= Bug Triaging Guide
-
-This guide discusses recommendations for triaging bugs in Ruby's bug tracker.
-
-== Bugs with Reproducible Examples
-
-These are the best bug reports. First, consider whether the bug reported is
-actually an issue or if it is expected Ruby behavior. If it is expected Ruby
-behavior, update the issue with why the behavior is expected, and set the
-status to Rejected.
-
-If the bug reported appears to be an actual bug, try reproducing the bug with
-the master branch. If you are not able to reproduce the issue on the master
-branch, try reproducing it on the latest version for the branch the bug was
-reported on. If you cannot reproduce the issue in either case, update
-the issue stating you cannot reproduce the issue, ask the reporter if they
-can reproduce the issue with either the master branch or a later release,
-and set the status to Feedback.
-
-If you can reproduce the example with the master branch, try to figure out
-what is causing the issue. If you feel comfortable, try working on a
-patch for the issue, update the issue, and attach the patch. Try to figure
-out which committer should be assigned to the issue, and set them as the
-assignee, and set the status to Assigned.
-
-If you cannot reproduce the example with the master branch, but can reproduce
-the issue on the latest version for the branch, then it is likely the bug has
-already been fixed, but it has not been backported yet. Try to determine
-which commit fixed it, and update the issue noting that the issue has been
-fixed but not yet backported. If the Ruby version is in the security
-maintenance phase or no longer supported, change the status to Closed. This
-change can be made without adding a note to avoid spamming the mailing list.
-
-For issues that may require backwards incompatible changes or may benefit from
-general committer attention or discussion, consider adding them as agenda
-items for the next committer meeting (https://bugs.ruby-lang.org/issues/14770).
-
-== Crash Bugs Without Reproducers
-
-Many bugs reported have little more than a crash report, often with no way to
-reproduce the issue. These bugs are difficult to triage as they often do not
-contain enough information.
-
-For these bugs, if the Ruby version is the master branch or is the latest
-release for the branch and the branch is in normal maintenance phase, look at
-the backtrace and see if you can determine what could be causing the issue.
-If you can guess what could be causing the issue, see if you can put together
-a reproducible example (this is in general quite difficult). If you cannot
-guess what could be causing the issue, or cannot put together a reproducible
-example yourself, please ask the reporter to provide a reproducible example,
-and change the status to Feedback.
-
-If the Ruby version is no longer current (e.g. 2.5.0 when the latest version
-on the Ruby 2.5 branch is 2.5.5), add a note to the issue asking the reporter
-to try the latest Ruby version for the branch and report back, and change the
-status to Feedback. If the Ruby version is in the security maintenance phase
-or no longer supported, change the status to Closed. This change can be made
-without adding a note.
-
-== Crash Bugs With 3rd Party C Extensions
-
-If the crash happens inside a 3rd party C extension, try to figure out inside
-which C extension it happens, and add a note to the issue to report the
-issue to that C extension, and set the status to Third Party's Issue.
-
-== Non-Bug reports
-
-Any issues in the bug tracker that are not reports of problems should have
-the tracker changed from Bug to either Feature (new features or performance
-improvements) or Misc. This change can be made without adding a note.
-
-== Stale Issues
-
-There are many issues that are stale, with no updates in months or even years.
-For stale issues in Feedback state, where the feedback has not been received,
-you can change the status to Closed without adding a note. For stale issues
-in Assigned state, you can reach out to the assignee and see if they can update
-the issue. If the assignee is no longer an active committer, remove them
-as the assignee and change the status to Open.
diff --git a/doc/contributing.rdoc b/doc/contributing.rdoc
index 68dda66e46..0809947346 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,25 +51,29 @@ 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}[https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=ruby-defaults]
+* {debian}[http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=ruby-defaults]
* {freebsd}[http://www.freebsd.org/cgi/query-pr-summary.cgi?text=ruby]
* {redhat}[https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED]
-* {macports}[https://trac.macports.org/query?status=assigned&status=new&status=reopened&port=~ruby]
+* {macports}[http://trac.macports.org/query?status=assigned&status=new&status=reopened&port=~ruby]
* etc (add your distribution bug tracker here)
=== 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]
@@ -77,11 +81,9 @@ The current active platform maintainers are as follows:
[Solaris]
Naohisa Goto (ngoto)
[RHEL, CentOS]
- KOSAKI Motohiro (kosaki)
-[macOS]
+ KOSAKI Motohiro kosaki
+[Mac OS X]
Kenta Murata (mrkn)
-[OpenBSD]
- Jeremy Evans (jeremyevans0)
[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
@@ -131,7 +133,7 @@ redmine, if gone without notice. In this case the +patch+ command is your
friend, see <code>man patch</code> for more information. Basically this would
go something like this:
- cd path/to/ruby
+ cd path/to/ruby/trunk
patch -p0 < path/to/patch
You will then be prompted to apply the patch with the associated files. After
@@ -152,12 +154,12 @@ 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'
tracker}[https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&tracker_id=2]
-on ruby-master. For non-CRuby dependent features, features that would apply to
+on ruby-trunk. For non-CRuby dependent features, features that would apply to
alternate Ruby implementations such as JRuby and Rubinius, use the {CommonRuby
tracker}[https://bugs.ruby-lang.org/projects/common-ruby].
@@ -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 master 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,38 +238,60 @@ 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
In order to help resolve existing issues and contributing patches to Ruby you
need to be able to run the test suite.
-CRuby uses git for source control, the {git homepage}[https://git-scm.com/]
-has installation instructions with links to documentation for learning more
-about git. There is a mirror of the repository on {github}[https://github.com/ruby/ruby].
-For other resources see the {ruby-core documentation on
-ruby-lang.org}[https://www.ruby-lang.org/en/community/ruby-core/].
+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}[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
+documentation for learning more about git. There is a mirror of the subversion
+repository on {github}[https://github.com/ruby/ruby].
Install the prerequisite dependencies for building the CRuby interpreter to
run tests.
* C compiler
-* autoconf - 2.67 or later, preferably 2.69.
-* bison - 2.0 or later, preferably 3.4.
-* gperf - 3.0.3 or later, preferably 3.1.
+* autoconf
+* bison
+* gperf
* ruby - Ruby itself is prerequisite in order to build Ruby from source. It
can be 1.8.
You should also have access to development headers for the following
libraries, but these are not required:
+* Tcl/Tk
* NDBM/QDBM
* GDBM
-* OpenSSL/LibreSSL
+* OpenSSL
* readline/editline(libedit)
* zlib
* libffi
@@ -279,16 +302,16 @@ Now let's build CRuby:
* Checkout the CRuby source code:
- git clone https://github.com/ruby/ruby.git ruby-master
+ git clone git://github.com/ruby/ruby.git ruby-trunk
* Generate the configuration files and build:
- cd ruby-master
+ cd ruby-trunk
autoconf
mkdir build && cd build # its good practice to build outside of source dir
- mkdir ~/.rubies # we will install to .rubies/ruby-master in our home dir
- ../configure --prefix="${HOME}/.rubies/ruby-master"
- make up && make install
+ mkdir ~/.rubies # we will install to .rubies/ruby-trunk in our home dir
+ ../configure --prefix=~/.rubies/ruby-trunk
+ make && make install
After adding Ruby to your PATH, you should be ready to run the test suite:
@@ -303,32 +326,20 @@ 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 https://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
+ git clone git://github.com/ruby/ruby.git --branch ruby_1_9_3
== Contributing Documentation
If you're interested in contributing documentation directly to CRuby there is
-some information available at
-{Contributing}[https://github.com/ruby/ruby#contributing].
+a wealth of information available at
+{documenting-ruby.org}[http://documenting-ruby.org/].
There is also the {Ruby Reference
-Manual}[https://github.com/rurema/doctree/wiki] in Japanese.
+Manual}[https://bugs.ruby-lang.org/projects/rurema] in Japanese.
== Contributing A Patch
@@ -344,7 +355,7 @@ Before you submit a patch, there are a few things you should know:
To improve the chance your patch will be accepted please follow these simple rules:
-* Bug fixes should be committed on master first
+* Bug fixes should be committed on trunk first
* Format of the patch file must be a unified diff (ie: diff -pu, svn diff, or git diff)
* Don't introduce cosmetic changes
* Follow the original coding style of the code
@@ -352,24 +363,23 @@ To improve the chance your patch will be accepted please follow these simple rul
First thing you should do is check out the code if you haven't already:
- git clone https://github.com/ruby/ruby.git ruby-master
+ git clone git://github.com/ruby/ruby.git ruby-trunk
Now create a dedicated branch:
- cd ruby-master
+ cd ruby-trunk
git checkout -b my_new_branch
The name of your branch doesn't really matter because it will only exist on
your local computer and won't be part of the official Ruby repository. It will
be used to create patches based on the differences between your branch and
-master, or edge Ruby.
+trunk, or edge Ruby.
=== Coding style
Here are some general rules to follow when writing Ruby and C code for CRuby:
-* Indent 4 spaces for C without tabs (old codes might use tabs for eight-space indentation,
- but newer codes recommend to use spaces only)
+* Indent 4 spaces for C with tabs for eight-space indentation (emacs default)
* Indent 2 space tabs for Ruby
* Do not use TABs in ruby codes
* ANSI C style for 1.9+ for function declarations
@@ -380,30 +390,53 @@ Here are some general rules to follow when writing Ruby and C code for CRuby:
* ABBRs should be all upper case.
* Do as others do
-=== Commit messages
+=== ChangeLog
+
+Although not required, if you wish to add a ChangeLog entry for your change
+please note:
+
+You can use the following template for the ChangeLog entry on your commit:
+
+ Thu Jan 1 00:00:00 2004 Your Name <yourmail@example.com>
-When you're ready to commit:
+ * filename (function): short description of this commit.
+ This should include your intention of this change.
+ [bug:#number] [mailinglist:number]
- git commit path/to/files
+ * filename2 (function2): additional description for this file/function.
-This will open your editor in which you write your commit message.
-Use the following style for commit messages:
+This follows {GNU Coding Standards for Change
+Logs}[http://www.gnu.org/prep/standards/html_node/Change-Logs.html#Change-Logs],
+some other requirements and tips:
-* Use a succinct subject line.
-* Include reasoning behind the change in the commit message, focusing on why
- the change is being made.
-* Refer to redmine issue (such as Fixes [Bug #1234] or Implements
- [Feature #3456]), or discussion on the mailing list
- (such as [ruby-core:12345]).
-* For GitHub issues, use [GH-#] (such as [Fixes GH-234]).
-* Follow the style used by other committers.
+* Timestamps must be in JST (+09:00) in the style as above.
+* Two spaces between the timestamp and your name. Two spaces between
+ your name and your mail address.
+* One blank line between the timestamp and the description.
+* Indent the description with TAB. 2nd line should begin with TAB+2SP.
+* Write a entry (*) for each change.
+* Refer to redmine issue or discussion on the mailing list.
+* For GitHub issues, use [GH-#] (such as [Fixes GH-234]
+* One blank line between entries.
+* Do as other committers do.
-=== Contributing your code
+You can generate the ChangeLog entry by running <code>make change</code>
+
+When you're ready to commit, copy your ChangeLog entry into the commit message,
+keeping the same formatting and select your files:
+
+ git commit ChangeLog path/to/files
+
+In the likely event that your branch becomes outdated, you will have to update
+your working branch:
+
+ git fetch origin
+ git rebase remotes/origin/master
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
@@ -415,7 +448,7 @@ Next copy the writable url for your fork and add it as a git remote, replace
In order to generate a patch that you can upload to the bug tracker, we can use
the github interface to review our changes just visit
-https://github.com/my_username/ruby/compare/master...my_new_branch
+https://github.com/my_username/ruby/compare/trunk...my_new_branch
Next, you can simply add '.patch' to the end of this URL and it will generate
the patch for you, save the file to your computer and upload it to the bug
@@ -426,22 +459,8 @@ Since git is a distributed system, you are welcome to host your git repository
on any {publicly accessible hosting
site}[https://git.wiki.kernel.org/index.php/GitHosting], including {hosting your
own}[https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#public-repositories]
-You may use the {'git format-patch'}[https://git-scm.com/docs/git-format-patch]
+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'}[https://git-scm.com/docs/git-request-pull] command for
+the {'git request-pull'}[http://git-scm.com/docs/git-request-pull] command for
formatting pull request messages to redmine.
-=== Updating the official repository
-
-If you are a committer, you can push changes directly into the official
-repository:
-
- git push origin your-branch-name:master
-
-However, it is likely will have become outdated, and you will have to
-update it. In that case, run:
-
- git fetch origin
- git rebase remotes/origin/master
-
-and then try pushing your changes again.
diff --git a/doc/contributors.rdoc b/doc/contributors.rdoc
index 7c3722032b..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
@@ -88,7 +82,7 @@ Christoph
* patches for set.rb
Sean Chittenden
-* patches for net/http, cgi
+* pathces for net/http, cgi
William D. Clinger
* ruby_strtod is based on his paper.
@@ -109,7 +103,7 @@ Martin Duerst (duerst)
* M17N
Paul Duncan
-* patches for rdoc
+* pathces for rdoc
Alexander Dymo
* a patch for lib/benchmark.rb
@@ -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
new file mode 100644
index 0000000000..877356bb6e
--- /dev/null
+++ b/doc/etc.rd.ja
@@ -0,0 +1,75 @@
+# etc.rd.ja - -*- mode: rd; coding: euc-jp; -*- created at: Fri Jul 14 00:47:15 JST 1995
+=begin
+
+= Etc(モジュール)
+
+実行ã—ã¦ã„ã‚‹OSã‹ã‚‰ã®æƒ…報を得るãŸã‚ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ï¼Žã‚¯ãƒ©ã‚¹ã«ã‚¤ãƒ³ã‚¯ãƒ«ãƒ¼ãƒ‰
+ã—ã¦ä½¿ã†ã“ã¨ã‚‚ã§ãる.
+
+== Module Function
+
+--- getlogin
+
+ 自分ã®loginåã‚’è¿”ã™ï¼Žã“れãŒå¤±æ•—ã—ãŸå ´åˆã¯getpwuid()を用ã„ã‚‹ã¨
+ 良ã„.
+
+--- getpwnam(name)
+
+ /etc/passwdファイル(ã‚ã‚‹ã„ã¯DBMファイルやNISデータベース)を検
+ ç´¢ã—,nameã®åå‰ã‚’æŒã¤passwdエントリを返ã™ï¼Žæˆ»ã‚Šå€¤ã¯passwd構造
+ 体ã§ä»¥ä¸‹ã®ãƒ¡ãƒ³ãƒã‚’æŒã¤ï¼Ž
+
+ struct passwd
+ name # ユーザå(文字列)
+ passwd # パスワード(文字列)
+ uid # ユーザID(整数)
+ gid # グループID(整数)
+ gecos # gecosフィールド(文字列)
+ dir # ホームディレクトリ(文字列)
+ shell # ログインシェル(文字列)
+ # 以é™ã®ãƒ¡ãƒ³ãƒã¯ã‚·ã‚¹ãƒ†ãƒ ã«ã‚ˆã£ã¦ã¯æä¾›ã•れãªã„.
+ change # パスワード変更時間(整数)
+ quota # クォータ(整数)
+ age # エージ(整数)
+ class # ユーザアクセスクラス(文字列)
+ comment # コメント(文字列)
+ expire # アカウント有効期é™(æ•´æ•°)
+ end
+
+ 詳細ã¯getpwnam(3)ã‚’å‚ç…§ã®ã“ã¨ï¼Ž
+
+--- getpwuid([uid])
+
+ uidをユーザIDã¨ã™ã‚‹passwdエントリを返ã™ï¼Žæˆ»ã‚Šå€¤ã¯getpwnam()ã¨
+ åŒæ§˜ã§ã‚る.引数をçœç•¥ã—ãŸå ´åˆã«ã¯getuid()ã®å€¤ã‚’用ã„る.詳細ã¯
+ getpwuid(3)ã‚’å‚ç…§ã®ã“ã¨ï¼Ž
+
+--- getgrgid(gid)
+
+ /etc/groupファイル(ã‚ã‚‹ã„ã¯â€¦getpwnamå‚ç…§)を検索ã—,gidをグルー
+ プIDã¨ã™ã‚‹ã‚°ãƒ«ãƒ¼ãƒ—エントリを返ã™ï¼Žæˆ»ã‚Šå€¤ã¯group構造体ã§ä»¥ä¸‹ã®
+ メンãƒã‚’æŒã¤ï¼Ž
+
+ struct group
+ name # グループå(文字列)
+ passwd # グループã®ãƒ‘スワード(文字列)
+ gid # グループID(整数)
+ mem # グループメンãƒåã®é…列
+ end
+
+ 詳細ã¯getgrgid(3)ã‚’å‚ç…§ã®ã“ã¨ï¼Ž
+
+--- getgrnam(name)
+
+ nameã¨ã„ã†åå‰ã®ã‚°ãƒ«ãƒ¼ãƒ—エントリを返ã™ï¼Žæˆ»ã‚Šå€¤ã¯getgrgid()ã¨åŒ
+ 様ã§ã‚る.詳細ã¯getgrnam(3)ã‚’å‚照.
+
+--- group
+
+ å…¨ã¦ã®ã‚°ãƒ«ãƒ¼ãƒ—エントリを順ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ãŸã‚ã®ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ï¼Ž
+
+--- passwd
+
+ å…¨ã¦ã®passwdエントリを順ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ãŸã‚ã®ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ï¼Ž
+
+=end
diff --git a/doc/extension.ja.rdoc b/doc/extension.ja.rdoc
deleted file mode 100644
index 47303ec408..0000000000
--- a/doc/extension.ja.rdoc
+++ /dev/null
@@ -1,1834 +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_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_str_modify(VALUE str) ::
-
- Rubyã®æ–‡å­—列ã®å¤‰æ›´ã™ã‚‹æº–備をã™ã‚‹ï¼ŽstrãŒå¤‰æ›´å¯èƒ½ã§ãªã‘れã°ä¾‹
- 外ãŒç™ºç”Ÿã™ã‚‹ï¼Žstrã®ãƒãƒƒãƒ•ã‚¡ãŒå…±æœ‰ã•れã¦ã„ã‚‹å ´åˆã¯ï¼Œæ–°ã—ã„ãƒãƒƒ
- ファを割り当ã¦ã¦å…±æœ‰ã•れã¦ã„ãªã„状態ã«ã™ã‚‹ï¼ŽRSTRING_PTRを使ã£
- ã¦ä¸­èº«ã‚’変更ã—ãŸã‚Šï¼Œrb_str_set_lenを呼んã ã‚Šã™ã‚‹å‰ã«ã¯ï¼Œ
- å¿…ãšã“ã®é–¢æ•°ã‚’呼ã°ãªã‘れãªã‚‰ãªã„.
-
-==== é…列ã«å¯¾ã™ã‚‹é–¢æ•°
-
-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)
-
-=== 型変æ›
-
- 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) ::
-
- マークã™ã‚‹å¿…è¦ã®ã‚ã‚‹Rubyオブジェクトをå«ã‚€å¤§åŸŸå¤‰æ•°ã‚’,GC
- ã«ã‚ˆã£ã¦è§£æ”¾ã•れãªã„よã†ã«ä¿è­·ã™ã‚‹ï¼Ž
-
-void rb_gc_register_mark_object(VALUE object) ::
-
- マークã™ã‚‹å¿…è¦ã®ã‚ã‚‹Rubyオブジェクトを,GCã«ã‚ˆã£ã¦è§£æ”¾ã•
- れãªã„よã†ã«ç™»éŒ²ã™ã‚‹ï¼Ž
-
-=== 定数
-
-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 79eb96d518..0000000000
--- a/doc/extension.rdoc
+++ /dev/null
@@ -1,2105 +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_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.
-
-rb_str_modify(VALUE str) ::
-
- Prepares a Ruby string to modify. If str is not modifiable, this
- function raises an exception, or if the buffer of str is shared,
- this function allocates new buffer to make it unshared. Always
- you MUST call this function before modifying the contents using
- RSTRING_PTR and/or rb_str_set_len.
-
-==== 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 specify whether keyword arguments are passed when calling super:
-
- VALUE rb_call_super(int argc, const VALUE *argv, int kw_splat)
-
-+kw_splat+ can have these possible values (used by all methods that accept
-+kw_splat+ argument):
-
-RB_NO_KEYWORDS :: Do not pass keywords
-RB_PASS_KEYWORDS :: Pass keywords, final argument should be a hash of keywords
-RB_PASS_EMPTY_KEYWORDS :: Pass empty keywords (not included in arguments)
- (this will be removed in Ruby 3.0)
-RB_PASS_CALLED_KEYWORDS :: Pass keywords if current method was called with
- keywords, useful for argument delegation
-
-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 invocation 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
-TypedData_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)
-
-or the objects themselves by
-
- void rb_gc_register_mark_object(VALUE object)
-
-=== 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
-
-=== 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) ::
-
- Tells GC to protect C global variable, which holds Ruby value to be marked.
-
-void rb_gc_register_mark_object(VALUE object) ::
-
- Tells GC to protect the +object+, which may not be referenced anywhere.
-
-=== 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 [keyword-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
- keyword-arg-spec := sym-for-keyword-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-keyword-arg := ":" ; Indicates that keyword
- ; argument captured as a hash.
- ; If keyword arguments are not
- ; provided, returns nil.
- ;
- ; Currently, will also consider
- ; final argument as keywords if
- ; it 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.
- ;
- ; However, handling final
- ; argument as keywords if
- ; method was not called with
- ; keywords (whether final
- ; argument is hash or nil) is
- ; deprecated. In that case, a
- ; warning will be emitted, and
- ; in Ruby 3.0 it will be an error.
- 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.
-
-rb_scan_args_kw(int kw_splat, int argc, VALUE *argv, const char *fmt, ...) ::
-
- The same as +rb_scan_args+, except the +kw_splat+ argument specifies whether
- keyword arguments are provided (instead of being determined by the call
- from Ruby to the C function). +kw_splat+ should be one of the following
- values:
-
- RB_SCAN_ARGS_PASS_CALLED_KEYWORDS :: Same behavior as +rb_scan_args+.
- RB_SCAN_ARGS_KEYWORDS :: The final argument should be a hash treated as
- keywords.
- RB_SCAN_ARGS_EMPTY_KEYWORDS :: Don't treat a final hash as keywords.
- (this will be removed in Ruby 3.0)
- RB_SCAN_ARGS_LAST_HASH_KEYWORDS :: Treat a final argument as keywords if it
- is a hash, and not as keywords otherwise.
-
-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_kw(VALUE recv, ID mid, int argc, VALUE *argv, int kw_splat) ::
-
- Same as rb_funcallv, using +kw_splat+ to determine whether keyword
- arguments are passed.
-
-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_funcallv_public_kw(VALUE recv, ID mid, int argc, VALUE *argv, int kw_splat) ::
-
- Same as rb_funcallv_public, using +kw_splat+ to determine whether keyword
- arguments are passed.
-
-VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE* argv) ::
-
- Same as rb_funcallv_public, except is passes the currently active block as
- the block when calling the method.
-
-VALUE rb_funcall_passing_block_kw(VALUE recv, ID mid, int argc, const VALUE* argv, int kw_splat) ::
-
- Same as rb_funcall_passing_block, using +kw_splat+ to determine whether
- keyword arguments are passed.
-
-VALUE rb_funcall_with_block(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE passed_procval) ::
-
- Same as rb_funcallv_public, except +passed_procval+ specifies the block to
- pass to the method.
-
-VALUE rb_funcall_with_block_kw(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE passed_procval, int kw_splat) ::
-
- Same as rb_funcall_with_block, using +kw_splat+ to determine whether
- keyword arguments are passed.
-
-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.
-
-VALUE rb_block_call_kw(VALUE recv, ID mid, int argc, VALUE * argv, VALUE (*func) (ANYARGS), VALUE data2, int kw_splat) ::
-
- Same as rb_funcall_with_block, using +kw_splat+ to determine whether
- keyword arguments are passed.
-
-\[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) ::
-
- Yields val as a single argument to the block.
-
-VALUE rb_yield_values(int n, ...) ::
-
- Yields +n+ number of arguments to the block, using one C argument per Ruby
- argument.
-
-VALUE rb_yield_values2(int n, VALUE *argv) ::
-
- Yields +n+ number of arguments to the block, with all Ruby arguments in the
- C argv array.
-
-VALUE rb_yield_values_kw(int n, VALUE *argv, int kw_splat) ::
-
- Same as rb_yield_values2, using +kw_splat+ to determine whether
- keyword arguments are passed.
-
-VALUE rb_yield_splat(VALUE args) ::
-
- Same as rb_yield_values2, except arguments are specified by the Ruby
- array +args+.
-
-VALUE rb_yield_splat_kw(VALUE args, int kw_splat) ::
-
- Same as rb_yield_splat, using +kw_splat+ to determine whether
- keyword arguments are passed.
-
-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.
-
-=== Defining backward compatible macros for keyword argument functions
-
-Most ruby C extensions are designed to support multiple Ruby versions.
-In order to correctly support Ruby 2.7+ in regards to keyword
-argument separation, C extensions need to use <code>*_kw</code>
-functions. However, these functions do not exist in Ruby 2.6 and
-below, so in those cases macros should be defined to allow you to use
-the same code on multiple Ruby versions. Here are example macros
-you can use in extensions that support Ruby 2.6 (or below) when using
-the <code>*_kw</code> functions introduced in Ruby 2.7.
-
- #ifndef RB_PASS_KEYWORDS
- /* Only define macros on Ruby <2.7 */
- #define rb_funcallv_kw(o, m, c, v, kw) rb_funcallv(o, m, c, v)
- #define rb_funcallv_public_kw(o, m, c, v, kw) rb_funcallv_public(o, m, c, v)
- #define rb_funcall_passing_block_kw(o, m, c, v, kw) rb_funcall_passing_block(o, m, c, v)
- #define rb_funcall_with_block_kw(o, m, c, v, b, kw) rb_funcall_with_block(o, m, c, v, b)
- #define rb_scan_args_kw(kw, c, v, s, ...) rb_scan_args(c, v, s, __VA_ARGS__)
- #define rb_call_super_kw(c, v, kw) rb_call_super(c, v)
- #define rb_yield_values_kw(c, v, kw) rb_yield_values2(c, v)
- #define rb_yield_splat_kw(a, kw) rb_yield_splat(a)
- #define rb_block_call_kw(o, m, c, v, f, p, kw) rb_block_call(o, m, c, v, f, p)
- #define rb_fiber_resume_kw(o, c, v, kw) rb_fiber_resume(o, c, v)
- #define rb_fiber_yield_kw(c, v, kw) rb_fiber_yield(c, v)
- #define rb_enumeratorize_with_size_kw(o, m, c, v, f, kw) rb_enumeratorize_with_size(o, m, c, v, f)
- #define SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) \
- rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()), \
- (argc), (argv), (size_fn))
- #define RETURN_SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) do { \
- if (!rb_block_given_p()) \
- return SIZED_ENUMERATOR(obj, argc, argv, size_fn); \
- } while (0)
- #define RETURN_ENUMERATOR_KW(obj, argc, argv, kw_splat) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
- #define rb_check_funcall_kw(o, m, c, v, kw) rb_check_funcall(o, m, c, v)
- #define rb_obj_call_init_kw(o, c, v, kw) rb_obj_call_init(o, c, v)
- #define rb_class_new_instance_kw(c, v, k, kw) rb_class_new_instance(c, v, k)
- #define rb_proc_call_kw(p, a, kw) rb_proc_call(p, a)
- #define rb_proc_call_with_block_kw(p, c, v, b, kw) rb_proc_call_with_block(p, c, v, b)
- #define rb_method_call_kw(c, v, m, kw) rb_method_call(c, v, m)
- #define rb_method_call_with_block_kw(c, v, m, b, kw) rb_method_call_with_block(c, v, m, b)
- #endif
-
-== 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/globals.rdoc b/doc/globals.rdoc
index 89b94e9a8f..3bc7e05623 100644
--- a/doc/globals.rdoc
+++ b/doc/globals.rdoc
@@ -1,72 +1,70 @@
# -*- mode: rdoc; coding: utf-8; fill-column: 74; -*-
-== Pre-defined global variables
+== Pre-defined variables
-$!:: The Exception object set by Kernel#raise.
-$@:: The same as <code>$!.backtrace</code>.
-$~:: The information about the last match in the current scope (thread-local and frame-local).
+$!:: The exception information message set by 'raise'.
+$@:: Array of backtrace of the last exception thrown.
$&:: The string matched by the last successful match.
$`:: The string to the left of the last successful match.
$':: The string to the right of the last successful match.
$+:: The highest group matched by the last successful match.
$1:: The Nth group of the last successful match. May be > 1.
-$=:: This variable is no longer effective. Deprecated.
-$/:: The input record separator, newline by default. Aliased to $-0.
-$\:: The output record separator for Kernel#print and IO#write. Default is +nil+.
-$,:: The output field separator for Kernel#print and Array#join. Non-nil $, will be deprecated.
-$;:: The default separator for String#split. Non-nil $; will be deprecated. Aliased to $-F.
+$~:: The information about the last match in the current scope.
+$=:: The flag for case insensitive, nil by default.
+$/:: The input record separator, newline by default.
+$\:: The output record separator for the print and IO#write. Default is nil.
+$,:: The output field separator for the print and Array#join.
+$;:: The default separator for String#split.
$.:: The current input line number of the last file that was read.
-$<:: The same as ARGF.
-$>:: The default output stream for Kernel#print and Kernel#printf. $stdout by default.
+$<:: The virtual concatenation file of the files given on command line (or from $stdin if no files were given).
+$>:: The default output for print, printf. $stdout by default.
$_:: The last input line of string by gets or readline.
$0:: Contains the name of the script being executed. May be assignable.
-$*:: The same as ARGV.
-$$:: The process number of the Ruby running this script. Same as Process.pid.
-$?:: The status of the last executed child process (thread-local).
-$LOAD_PATH:: Load path for searching Ruby scripts and extension libraries used
- by Kernel#load and Kernel#require. Aliased to $: and $-I.
- Has a singleton method <code>$LOAD_PATH.resolve_feature_path(feature)</code>
- that returns [+:rb+ or +:so+, path], which resolves the feature to
- the path the original Kernel#require method would load.
-$LOADED_FEATURES:: The array contains the module names loaded by require.
- Aliased to $".
-$DEBUG:: The debug flag, which is set by the <tt>-d</tt> switch. Enabling debug
+$*:: Command line arguments given for the script sans args.
+$$:: The process number of the Ruby running this script.
+$?:: The status of the last executed child process. This value is
+ thread-local.
+$::: Load path for scripts and binary modules by load or require.
+$":: The array contains the module names loaded by require.
+$DEBUG:: The debug flag, which is set by the -d switch. Enabling debug
output prints each exception raised to $stderr (but not its
backtrace). Setting this to a true value enables debug output as
- if <tt>-d</tt> were given on the command line. Setting this to a false
- value disables debug output. Aliased to $-d.
-$FILENAME:: Current input filename from ARGF. Same as ARGF.filename.
+ if -d were given on the command line. Setting this to a false
+ value disables debug output.
+$LOADED_FEATURES:: The alias to the $".
+$FILENAME:: Current input file from $<. Same as $<.filename.
+$LOAD_PATH:: The alias to the $:.
$stderr:: The current standard error output.
$stdin:: The current standard input.
$stdout:: The current standard output.
-$VERBOSE:: The verbose flag, which is set by the <tt>-w</tt> or <tt>-v</tt> switch.
- Setting this to a true value enables warnings as if <tt>-w</tt> or <tt>-v</tt> were given
- on the command line. Setting this to +nil+ disables warnings,
- including from Kernel#warn. Aliased to $-v and $-w.
-$-a:: True if option <tt>-a</tt> is set. Read-only variable.
-$-i:: In in-place-edit mode, this variable holds the extension, otherwise +nil+.
-$-l:: True if option <tt>-l</tt> is set. Read-only variable.
-$-p:: True if option <tt>-p</tt> is set. Read-only variable.
+$VERBOSE:: The verbose flag, which is set by the -w or -v switch. Setting
+ this to a true value enables warnings as if -w or -v were given
+ on the command line. Setting this to nil disables warnings,
+ including from Kernel#warn.
+$-0:: The alias to $/.
+$-a:: True if option -a is set. Read-only variable.
+$-d:: The alias of $DEBUG. See $DEBUG above for further discussion.
+$-F:: The alias to $;.
+$-i:: In in-place-edit mode, this variable holds the extension, otherwise nil.
+$-I:: The alias to $:.
+$-l:: True if option -l is set. Read-only variable.
+$-p:: True if option -p is set. Read-only variable.
+$-v:: An alias of $VERBOSE. See $VERBOSE above for further discussion.
+$-w:: An alias of $VERBOSE. See $VERBOSE above for further discussion.
== Pre-defined global constants
-TRUE:: The typical true value. Deprecated.
-FALSE:: The +false+ itself. Deprecated.
-NIL:: The +nil+ itself. Deprecated.
+TRUE:: The typical true value.
+FALSE:: The false itself.
+NIL:: The nil itself.
STDIN:: The standard input. The default value for $stdin.
STDOUT:: The standard output. The default value for $stdout.
STDERR:: The standard error output. The default value for $stderr.
ENV:: The hash contains current environment variables.
-ARGF:: The virtual concatenation of the files given on command line (or from $stdin if no files were given).
-ARGV:: An Array of command line arguments given for the script.
-DATA:: The file object of the script, pointing just after <code>__END__</code>.
-TOPLEVEL_BINDING:: The Binding of the top level scope.
-RUBY_VERSION:: The Ruby language version.
+ARGF:: The alias to the $<.
+ARGV:: The alias to the $*.
+DATA:: The file object of the script, pointing just after __END__.
+RUBY_VERSION:: The ruby version string (VERSION was deprecated).
RUBY_RELEASE_DATE:: The release date string.
RUBY_PLATFORM:: The platform identifier.
-RUBY_PATCHLEVEL:: The patchlevel for this Ruby. If this is a development build of Ruby the patchlevel will be -1.
-RUBY_REVISION:: The GIT commit hash for this Ruby.
-RUBY_COPYRIGHT:: The copyright string for Ruby.
-RUBY_ENGINE:: The name of the Ruby implementation.
-RUBY_ENGINE_VERSION:: The version of the Ruby implementation.
-RUBY_DESCRIPTION:: The same as <tt>ruby --version</tt>, a String describing various aspects of the Ruby implementation.
+
diff --git a/doc/irb/irb.rd.ja b/doc/irb/irb.rd.ja
index 81247ce4b0..416dec3906 100644
--- a/doc/irb/irb.rd.ja
+++ b/doc/irb/irb.rd.ja
@@ -40,46 +40,39 @@ irbã®ä½¿ã„æ–¹ã¯, Rubyã•ãˆçŸ¥ã£ã¦ã„れã°ã„ãŸã£ã¦ç°¡å˜ã§ã™. 基本
irb.rb [options] file_name opts
options:
-f ~/.irbrc を読ã¿è¾¼ã¾ãªã„.
+ -m bcモード(分数, 行列ã®è¨ˆç®—ãŒã§ãã‚‹)
-d $DEBUG ã‚’trueã«ã™ã‚‹(ruby -d ã¨åŒã˜)
+ -Kc ruby -Kcã¨åŒã˜
-r load-module ruby -r ã¨åŒã˜.
- -I path $LOAD_PATH ã« path を追加ã™ã‚‹.
- -U ruby -U ã¨åŒã˜.
- -E enc ruby -E ã¨åŒã˜.
- -w ruby -w ã¨åŒã˜.
- -W[level=2] ruby -W ã¨åŒã˜.
- --context-mode n æ–°ã—ã„ワークスペースを作æˆã—ãŸæ™‚ã«é–¢é€£ã™ã‚‹ Binding
- オブジェクトã®ä½œæˆæ–¹æ³•ã‚’ 0 ã‹ã‚‰ 3 ã®ã„ãšã‚Œã‹ã«è¨­å®šã™ã‚‹.
- --echo å®Ÿè¡Œçµæžœã‚’表示ã™ã‚‹(デフォルト).
- --noecho å®Ÿè¡Œçµæžœã‚’表示ã—ãªã„.
- --inspect çµæžœå‡ºåŠ›ã«inspectを用ã„ã‚‹.
+ --verbose ã“れã‹ã‚‰å®Ÿè¡Œã™ã‚‹è¡Œã‚’表示ã™ã‚‹(デフォルト)
+ --noverbose ã“れã‹ã‚‰å®Ÿè¡Œã™ã‚‹è¡Œã‚’表示ã—ãªã„
+ --echo å®Ÿè¡Œçµæžœã‚’表示ã™ã‚‹(デフォルト)
+ --noecho å®Ÿè¡Œçµæžœã‚’表示ã—ãªã„
+ --inspect çµæžœå‡ºåŠ›ã«inspectを用ã„ã‚‹(bcモード以外ã¯ãƒ‡ãƒ•ォルト).
--noinspect çµæžœå‡ºåŠ›ã«inspectを用ã„ãªã„.
- --singleline シングルラインエディタを利用ã™ã‚‹.
- --nosingleline シングルラインエディタを利用ã—ãªã„. デフォルトã®å‹•
- 作ã¯, inf-ruby-mode以外ã§ã‚·ãƒ³ã‚°ãƒ«ãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’利
- 用ã—よã†ã¨ã™ã‚‹.
- --colorize 色付ã‘を利用ã™ã‚‹.
- --nocolorize 色付ã‘を利用ã—ãªã„.
- --prompt prompt-mode/--prompt-mode prompt-mode
+ --readline readlineライブラリを利用ã™ã‚‹.
+ --noreadline readlineライブラリを利用ã—ãªã„. デフォルトã®å‹•作ã¯,
+ inf-ruby-mode以外ã§readlineライブラリを利用ã—よã†
+ ã¨ã™ã‚‹.
+ --prompt prompt-mode
+ --prompt-mode prompt-mode
プロンプトモードを切替ãˆã¾ã™. ç¾åœ¨å®šç¾©ã•れã¦ã„るプ
ロンプトモードã¯, default, simple, xmp, inf-rubyãŒ
- 用æ„ã•れã¦ã„ã¾ã™.
+ 用æ„ã•れã¦ã„ã¾ã™. デフォルトã¯defaultプロンプトモー
+ ドã«ãªã£ã¦ã„ã¾ã™.
+
--inf-ruby-mode emacsã®inf-ruby-mode用ã®ãƒ—ロンプト表示を行ãªã†. 特
- ã«æŒ‡å®šãŒãªã„é™ã‚Š, ラインエディタã¯ä½¿ã‚ãªããªã‚‹.
+ ã«æŒ‡å®šãŒãªã„é™ã‚Š, readlineライブラリã¯ä½¿ã‚ãªããªã‚‹.
--simple-prompt
éžå¸¸ã«ã‚·ãƒ³ãƒ—ルãªãƒ—ロンプトを用ã„るモードã§ã™.
--noprompt プロンプト表示を行ãªã‚ãªã„.
- --single-irb irb 中㧠self を実行ã—ã¦å¾—られるオブジェクトをサ
- ブ irb ã¨å…±æœ‰ã™ã‚‹.
--tracer コマンド実行時ã«ãƒˆãƒ¬ãƒ¼ã‚¹ã‚’行ãªã†.
--back-trace-limit n
ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹è¡¨ç¤ºã‚’ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã®é ­ã‹ã‚‰ n, 後ã‚
ã‹ã‚‰nã ã‘行ãªã†. デフォルトã¯16
-
- --verbose 詳細ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã™ã‚‹.
- --noverbose 詳細ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã—ãªã„(デフォルト).
- -v, --version irbã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’表示ã™ã‚‹.
- -h, --help irb ã®ãƒ˜ãƒ«ãƒ—を表示ã™ã‚‹.
- -- 以é™ã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³å¼•数をオプションã¨ã—ã¦æ‰±ã‚ãªã„.
+ --irb_debug n irbã®ãƒ‡ãƒãƒƒã‚°ãƒ‡ãƒãƒƒã‚°ãƒ¬ãƒ™ãƒ«ã‚’nã«è¨­å®šã™ã‚‹(利用ã—ãª
+ ã„æ–¹ãŒç„¡é›£ã§ã—ょã†).
+ -v, --version irbã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’表示ã™ã‚‹
= コンフィギュレーション
@@ -90,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
@@ -98,12 +92,13 @@ irb起動時ã«``~/.irbrc''を読ã¿è¾¼ã¿ã¾ã™. ã‚‚ã—存在ã—ãªã„å ´åˆã¯
IRB.conf[:IRB_RC] = nil
IRB.conf[:BACK_TRACE_LIMIT]=16
IRB.conf[:USE_LOADER] = false
- IRB.conf[:USE_SINGLELINE] = nil
+ IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = false
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:IGNORE_EOF] = false
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:PROMPT] = {...}
+ IRB.conf[:DEBUG_LEVEL]=0
IRB.conf[:VERBOSE]=true
== プロンプトã®è¨­å®š
@@ -189,6 +184,9 @@ irb拡張コマンドã¯, ç°¡å˜ãªåå‰ã¨é ­ã«`irb_'ã‚’ã¤ã‘ãŸåå‰ã¨ä¸¡
ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹è¡¨ç¤ºã‚’ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã®é ­ã‹ã‚‰n, 後ã‚ã‹ã‚‰nã ã‘行ãªã†.
デフォルトã¯16
+--- conf.debug_level = N
+ irb用ã®ãƒ‡ãƒãƒƒã‚°ãƒ¬ãƒ™ãƒ«ã®è¨­å®š
+
--- conf.ignore_eof = true/false
^DãŒå…¥åŠ›ã•ã‚ŒãŸæ™‚ã®å‹•作を設定ã™ã‚‹. trueã®æ™‚ã¯^Dを無視ã™ã‚‹, falseã®
時ã¯irbを終了ã™ã‚‹.
@@ -200,8 +198,7 @@ irb拡張コマンドã¯, ç°¡å˜ãªåå‰ã¨é ­ã«`irb_'ã‚’ã¤ã‘ãŸåå‰ã¨ä¸¡
実行中: 実行を中止ã™ã‚‹.
--- conf.inf_ruby_mode = true/false
- inf-ruby-mode用ã®ãƒ—ロンプト表示を行ãªã†. デフォルトã¯false. ç‰¹ã«æŒ‡å®š
- ãŒãªã„é™ã‚Š, ラインエディタã¯ä½¿ã‚ãªããªã‚‹.
+ inf-ruby-mode用ã®ãƒ—ロンプト表示を行ãªã†. デフォルトã¯false.
--- conf.inspect_mode = true/false/nil
インスペクトモードを設定ã™ã‚‹.
@@ -210,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全体ã«å映ã•れる.
@@ -229,19 +229,12 @@ irb拡張コマンドã¯, ç°¡å˜ãªåå‰ã¨é ­ã«`irb_'ã‚’ã¤ã‘ãŸåå‰ã¨ä¸¡
--- conf.use_prompt = true/false
プロンプト表示ã™ã‚‹ã‹ã©ã†ã‹? デフォルトã§ã¯ãƒ—ロンプトを表示ã™ã‚‹.
---- conf.use_multiline = true/false/nil
- マルãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’使ã†ã‹ã©ã†ã‹?
- true: マルãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’使ã†.
- false: マルãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’使ã‚ãªã„.
- nil: (デフォルト)inf-ruby-mode以外ã§ãƒžãƒ«ãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’利用ã—よã†
- ã¨ã™ã‚‹.
-
---- conf.use_singleline = true/false/nil
- シングルラインエディタを使ã†ã‹ã©ã†ã‹?
- true: シングルラインエディタを使ã†.
- false: シングルラインエディタを使ã‚ãªã„.
- nil: (デフォルト)inf-ruby-modeã¨ãƒžãƒ«ãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ä»¥å¤–ã§ã‚·ãƒ³ã‚°ãƒ«ãƒ©
- インエディタを利用ã—よã†ã¨ã™ã‚‹.
+--- conf.use_readline = true/false/nil
+ readlineを使ã†ã‹ã©ã†ã‹?
+ true: readlineを使ã†.
+ false: readlineを使ã‚ãªã„.
+ nil: (デフォルト)inf-ruby-mode以外ã§readlineライブラリを利用ã—よ
+ ã†ã¨ã™ã‚‹.
#
#--- conf.verbose=T/F
# irbã‹ã‚‰ã„ã‚ã„ã‚ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã™ã‚‹ã‹?
@@ -416,3 +409,4 @@ rubyã§ã¯, 以下ã®ãƒ—ログラムã¯ã‚¨ãƒ©ãƒ¼ã«ãªã‚Šã¾ã™.
% comment-end: "\n"
% End:
%
+
diff --git a/doc/keywords.rdoc b/doc/keywords.rdoc
index a74126823d..98bbd5e864 100644
--- a/doc/keywords.rdoc
+++ b/doc/keywords.rdoc
@@ -76,7 +76,7 @@ for::
expressions}[rdoc-ref:syntax/control_expressions.rdoc]
if::
- Used for +if+ and modifier +if+ statements. See {control
+ Used for +if+ and modifier +if+ expressions. See {control
expressions}[rdoc-ref:syntax/control_expressions.rdoc]
in::
@@ -115,9 +115,7 @@ retry::
handling}[rdoc-ref:syntax/exceptions.rdoc]
return::
- Exits a method. See {methods}[rdoc-ref:syntax/methods.rdoc].
- If met in top-level scope, immediately stops interpretation of
- the current file.
+ Exits a method. See {methods}[rdoc-ref:syntax/methods.rdoc]
self::
The object the current method is attached to. See
@@ -139,7 +137,7 @@ undef::
See {modules and classes}[rdoc-ref:syntax/modules_and_classes.rdoc]
unless::
- Used for +unless+ and modifier +unless+ statements. See {control
+ Used for +unless+ and modifier +unless+ expressions. See {control
expressions}[rdoc-ref:syntax/control_expressions.rdoc]
until::
diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc
index 98de9f2549..82b8004662 100644
--- a/doc/maintainers.rdoc
+++ b/doc/maintainers.rdoc
@@ -34,326 +34,289 @@ 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]
_unmaintained_
+[lib/delegate.rb]
+ _unmaintained_
+[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]
+ 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]
Shugo Maeda (shugo)
+[lib/mutex_m.rb]
+ Keiju ISHITSUKA (keiju)
[lib/net/ftp.rb]
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/protocol.rb]
+[lib/net/pop.rb]
+ _unmaintained_
+[lib/net/smtp.rb]
+ _unmaintained_
+[lib/observer.rb]
_unmaintained_
[lib/open-uri.rb]
Tanaka Akira (akr)
+[lib/open3.rb]
+ _unmaintained_
[lib/optparse.rb, lib/optparse/*]
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]
Tanaka Akira (akr)
+[lib/prime.rb]
+ Yuki Sonoda (yugui)
+[lib/profile.rb]
+ _unmaintained_
+[lib/profiler.rb]
+ _unmaintained_
+[lib/pstore.rb]
+ _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]
Tanaka Akira (akr)
+[lib/rexml/*]
+ Kouhei Sutou (kou)
[lib/rinda/*]
Masatoshi SEKI (seki)
-[lib/rubygems.rb, lib/rubygems/*]
- Eric Hodel (drbrain), Hiroshi SHIBATA (hsbt)
- https://github.com/rubygems/rubygems
+[lib/rss/*]
+ Kouhei Sutou (kou)
+[lib/rubygems.rb, lib/ubygems.rb, lib/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]
Tanaka Akira (akr)
+[lib/shell.rb, lib/shell/*]
+ Keiju ISHITSUKA (keiju)
[lib/shellwords.rb]
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]
Tanaka Akira (akr)
+[lib/timeout.rb]
+ Yukihiro Matsumoto (matz)
+[lib/tracer.rb]
+ Keiju ISHITSUKA (keiju)
[lib/tsort.rb]
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)
-=== Extensions
+== Extension Maintainers
+[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/nkf]
+[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]
+ Aaron Patterson (tenderlove)
[ext/readline]
TAKAO Kouji (kouji)
[ext/ripper]
_unmaintained_
+[ext/sdbm]
+ Yukihiro Matsumoto (matz)
[ext/socket]
* Tanaka Akira (akr)
* API change needs matz's approval
+[ext/stringio]
+ Nobuyuki Nakada (nobu)
+[ext/strscan]
+ _unmaintained_
+[ext/syck]
+ _unmaintained_
[ext/syslog]
Akinori MUSHA (knu)
-[ext/win32]
- NAKAMURA Usaku (usa)
+[ext/thread]
+ * 1.8: _unmaintained_
+ * 1.9: 1.8 feature
+[ext/tcltklib]
+ _deprecated_
+[ext/tk]
+ Hidetoshi NAGAI (nagai)
[ext/win32ole]
Masaki Suketa (suke)
-
-== Default gems Maintainers
-
-=== Libraries
-
-[lib/benchmark.rb]
- _unmaintained_
- https://github.com/bundler/benchmark
- https://rubygems.org/gems/benchmark
-[lib/bundler.rb, lib/bundler/*]
- Hiroshi SHIBATA (hsbt)
- https://github.com/bundler/bundler
- https://rubygems.org/gems/bundler
-[lib/cgi.rb, lib/cgi/*]
- Takeyuki Fujioka (xibbar)
- https://github.com/ruby/cgi
- https://rubygems.org/gems/cgi
-[lib/csv.rb]
- Kenta Murata (mrkn), Kouhei Sutou (kou)
- https://github.com/ruby/csv
- https://rubygems.org/gems/csv
-[lib/delegate.rb]
- _unmaintained_
- https://github.com/ruby/delegate
- https://rubygems.org/gems/delegate
-[lib/did_you_mean.rb]
- Yuki Nishijima (yuki24)
- https://github.com/ruby/did_you_mean
-[lib/fileutils.rb]
- _unmaintained_
- https://github.com/ruby/fileutils
- https://rubygems.org/gems/fileutils
-[lib/forwardable.rb]
- Keiju ISHITSUKA (keiju)
- https://github.com/ruby/forwardable
- https://rubygems.org/gems/forwardable
-[lib/getoptlong.rb]
- _unmaintained_
- https://github.com/ruby/getoptlong
- https://rubygems.org/gems/getoptlong
-[lib/ipaddr.rb]
- Akinori MUSHA (knu)
- https://github.com/ruby/ipaddr
- https://rubygems.org/gems/ipaddr
-[lib/irb.rb, lib/irb/*]
- Keiju ISHITSUKA (keiju)
- https://github.com/ruby/irb
- https://rubygems.org/gems/irb
-[lib/logger.rb]
- Naotoshi Seo (sonots)
- https://github.com/ruby/logger
- https://rubygems.org/gems/logger
-[lib/matrix.rb]
- Marc-Andre Lafortune (marcandre)
- https://github.com/ruby/matrix
- https://rubygems.org/gems/matrix
-[lib/mutex_m.rb]
- Keiju ISHITSUKA (keiju)
- https://github.com/ruby/mutex_m
- https://rubygems.org/gems/mutex_m
-[lib/net/pop.rb]
- _unmaintained_
- https://github.com/ruby/net-pop
- https://rubygems.org/gems/net-pop
-[lib/net/smtp.rb]
- _unmaintained_
- https://github.com/ruby/net-smtp
- https://rubygems.org/gems/net-smtp
-[lib/observer.rb]
- _unmaintained_
- https://github.com/ruby/observer
-[lib/open3.rb]
- _unmaintained_
- https://github.com/ruby/open3
- https://rubygems.org/gems/open3
-[lib/ostruct.rb]
- Marc-Andre Lafortune (marcandre)
- https://github.com/ruby/ostruct
- https://rubygems.org/gems/ostruct
-[lib/prime.rb]
- Yuki Sonoda (yugui)
- https://github.com/ruby/prime
-[lib/pstore.rb]
- _unmaintained_
- https://github.com/ruby/pstore
- https://rubygems.org/gems/pstore
-[lib/racc.rb, lib/racc/*]
- Aaron Patterson (tenderlove), Hiroshi SHIBATA (hsbt)
- https://github.com/ruby/racc
- https://rubygems.org/gems/racc
-[lib/readline.rb]
- aycabta
- https://github.com/ruby/readline
- https://rubygems.org/gems/readline
-[lib/rdoc.rb, lib/rdoc/*]
- Eric Hodel (drbrain), Hiroshi SHIBATA (hsbt)
- https://github.com/ruby/rdoc
- https://rubygems.org/gems/rdoc
-[lib/reline.rb, lib/reline/*]
- aycabta
- https://github.com/ruby/reline
- https://rubygems.org/gems/reline
-[lib/rexml/*]
- Kouhei Sutou (kou)
- https://github.com/ruby/rexml
- https://rubygems.org/gems/rexml
-[lib/rss.rb, lib/rss/*]
- Kouhei Sutou (kou)
- https://github.com/ruby/rss
- https://rubygems.org/gems/rss
-[lib/singleton.rb]
- Yukihiro Matsumoto (matz)
- https://github.com/ruby/singleton
- https://rubygems.org/gems/singleton
-[lib/timeout.rb]
- Yukihiro Matsumoto (matz)
- https://github.com/ruby/timeout
-[lib/thwait.rb]
- Keiju ISHITSUKA (keiju)
- https://github.com/ruby/thwait
- https://rubygems.org/gems/thwait
-[lib/tracer.rb]
- Keiju ISHITSUKA (keiju)
- https://github.com/ruby/tracer
-[lib/uri.rb, lib/uri/*]
- YAMADA, Akira (akira)
- https://github.com/ruby/uri
-[lib/webrick.rb, lib/webrick/*]
- Eric Wong (normalperson)
- https://bugs.ruby-lang.org/
- https://rubygems.org/gems/webrick
-[lib/yaml.rb, lib/yaml/*]
- Aaron Patterson (tenderlove), Hiroshi SHIBATA (hsbt)
- https://github.com/ruby/yaml
-
-=== Extensions
-
-[ext/bigdecimal]
- Kenta Murata (mrkn)
- https://github.com/ruby/bigdecimal
- https://rubygems.org/gems/bigdecimal
-[ext/cgi]
- Nobuyoshi Nakada (nobu)
- https://github.com/ruby/cgi
- https://rubygems.org/gems/cgi
-[ext/date]
- _unmaintained_
- https://github.com/ruby/date
- https://rubygems.org/gems/date
-[ext/dbm]
- _unmaintained_
- https://github.com/ruby/dbm
- https://rubygems.org/gems/dbm
-[ext/etc]
- Ruby core team
- https://github.com/ruby/etc
- https://rubygems.org/gems/etc
-[ext/fcntl]
- Ruby core team
- https://github.com/ruby/fcntl
- https://rubygems.org/gems/fcntl
-[ext/fiddle]
- Aaron Patterson (tenderlove)
- https://github.com/ruby/fiddle
- https://rubygems.org/gems/fiddle
-[ext/gdbm]
- Yukihiro Matsumoto (matz)
- https://github.com/ruby/gdbm
- https://rubygems.org/gems/gdbm
-[ext/io/console]
- Nobuyuki Nakada (nobu)
- https://github.com/ruby/io-console
- https://rubygems.org/gems/io-console
-[ext/json]
- NARUSE, Yui (naruse), Hiroshi SHIBATA (hsbt)
- https://github.com/flori/json
- https://rubygems.org/gems/json
-[ext/openssl]
- Kazuki Yamaguchi (rhe)
- https://github.com/ruby/openssl
- https://rubygems.org/gems/openssl
-[ext/psych]
- Aaron Patterson (tenderlove), Hiroshi SHIBATA (hsbt)
- https://github.com/ruby/psych
- https://rubygems.org/gems/psych
-[ext/racc]
- Aaron Patterson (tenderlove), Hiroshi SHIBATA (hsbt)
- https://github.com/ruby/racc
- https://rubygems.org/gems/racc
-[ext/sdbm]
- Yukihiro Matsumoto (matz)
- https://github.com/ruby/sdbm
- https://rubygems.org/gems/sdbm
-[ext/stringio]
- Nobuyuki Nakada (nobu)
- https://github.com/ruby/stringio
- https://rubygems.org/gems/stringio
-[ext/strscan]
- Kouhei Sutou (kou)
- https://github.com/ruby/strscan
- https://rubygems.org/gems/strscan
[ext/zlib]
- NARUSE, Yui (naruse)
- https://github.com/ruby/zlib
- https://rubygems.org/gems/zlib
-
-== Bundled gems upstream repositories
+ _unmaintained_
-[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/regexp.rdoc b/doc/regexp.rdoc
index d84cae1771..8564258115 100644
--- a/doc/regexp.rdoc
+++ b/doc/regexp.rdoc
@@ -63,14 +63,12 @@ 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 and can contain the same
-backslash escapes (the meaning of <tt>\s</tt> is different, however,
-see below[#label-Character+Classes]).
+Patterns behave like double-quoted strings so can contain the same
+backslash escapes.
/\s\u{6771 4eac 90fd}/.match("Go to æ±äº¬éƒ½")
#=> #<MatchData " æ±äº¬éƒ½">
@@ -130,11 +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>/\R/</tt> - A linebreak: <tt>\n</tt>, <tt>\v</tt>, <tt>\f</tt>, <tt>\r</tt>
- <tt>\u0085</tt> (NEXT LINE), <tt>\u2028</tt> (LINE SEPARATOR), <tt>\u2029</tt> (PARAGRAPH SEPARATOR)
- or <tt>\r\n</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
@@ -193,11 +188,8 @@ At least one uppercase character ('H'), at least one lowercase character
Repetition is <i>greedy</i> by default: as many occurrences as possible
are matched while still allowing the overall match to succeed. By
contrast, <i>lazy</i> matching makes the minimal amount of matches
-necessary for overall success. Most greedy metacharacters can be made lazy
-by following them with <tt>?</tt>. For the <tt>{n}</tt> pattern, because
-it specifies an exact number of characters to match and not a variable
-number of characters, the <tt>?</tt> metacharacter instead makes the
-repeated pattern optional.
+necessary for overall success. A greedy metacharacter can be made lazy by
+following it with <tt>?</tt>.
Both patterns below match the string. The first uses a greedy quantifier so
'.+' matches '<a><b>'; the second uses a lazy quantifier so '.+?' matches
@@ -235,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>,
@@ -245,15 +237,7 @@ where _name_ is the group name.
#=> #<MatchData "ototo" vowel:"o">
*Note*: A regexp can't use named backreferences and numbered
-backreferences simultaneously. Also, if a named capture is used in a
-regexp, then parentheses used for grouping which would otherwise result
-in a unnamed capture are treated as non-capturing.
-
- /(\w)(\w)/.match("ab").captures # => ["a", "b"]
- /(\w)(\w)/.match("ab").named_captures # => {}
-
- /(?<c>\w)(\w)/.match("ab").captures # => ["a"]
- /(?<c>\w)(\w)/.match("ab").named_captures # => {"c"=>"a"}
+backreferences simultaneously.
When named capture groups are used with a literal regexp on the left-hand
side of an expression and the <tt>=~</tt> operator, the captured text is
@@ -486,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
@@ -556,15 +528,10 @@ options which control how the pattern can match.
subexpression level with the
<tt>(?</tt><i>on</i><tt>-</tt><i>off</i><tt>)</tt> construct, which
enables options <i>on</i>, and disables options <i>off</i> for the
-expression enclosed by the parentheses:
-
- /a(?i:b)c/.match('aBc') #=> #<MatchData "aBc">
- /a(?-i:b)c/i.match('ABC') #=> nil
-
-Additionally, these options can also be toggled for the remainder of the
-pattern:
+expression enclosed by the parentheses.
- /a(?i)bc/.match('abC') #=> #<MatchData "abC">
+ /a(?i:b)c/.match('aBc') #=> #<MatchData "aBc">
+ /a(?i:b)c/.match('abc') #=> #<MatchData "abc">
Options may also be used with <tt>Regexp.new</tt>:
@@ -628,9 +595,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 ae20ed30fa..d8efca0042 100644
--- a/doc/security.rdoc
+++ b/doc/security.rdoc
@@ -7,14 +7,27 @@ 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>
+
+Ruby provides a mechanism to restrict what operations can be performed by Ruby
+code in the form of the <code>$SAFE</code> variable.
+
+However, <code>$SAFE</code> does not provide a secure environment for executing
+untrusted code.
+
+If you need to execute untrusted code, you should use an operating system level
+sandboxing mechanism. On Linux, ptrace or LXC can be used to sandbox
+potentially malicious code. Other similar mechanisms exist on every major
+operating system.
+
== +Marshal.load+
Ruby's +Marshal+ module provides methods for serializing and deserializing Ruby
@@ -53,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
new file mode 100644
index 0000000000..a9507fe92a
--- /dev/null
+++ b/doc/shell.rd.ja
@@ -0,0 +1,335 @@
+ -- shell.rb
+ $Release Version: 0.6.0 $
+ $Revision$
+ by Keiju ISHITSUKA(keiju@ishitsuka.com)
+
+=begin
+
+= 目的
+
+ruby上ã§sh/cshã®ã‚ˆã†ã«ã‚³ãƒžãƒ³ãƒ‰ã®å®Ÿè¡ŒåŠã³ãƒ•ィルタリングを手軽ã«è¡Œã†.
+sh/cshã®åˆ¶å¾¡æ–‡ã¯rubyã®æ©Ÿèƒ½ã‚’用ã„ã¦å®Ÿç¾ã™ã‚‹.
+
+= 主ãªã‚¯ãƒ©ã‚¹ä¸€è¦§
+
+== Shell
+
+Shellオブジェクトã¯ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’æŒã¡, コマンド実行ã¯ãã“ã‹ã‚‰ã®
+相対パスã«ãªã‚Šã¾ã™.
+
+--- Shell#cwd
+--- Shell#dir
+--- Shell#getwd
+--- Shell#pwd
+
+ カレントディレクトリを返ã™ã€‚
+
+--- Shell#system_path
+
+ コマンドサーãƒãƒ‘スã®é…列を返ã™ã€‚
+
+--- Shell#umask
+
+ umaskã‚’è¿”ã™ã€‚
+
+== Filter
+
+コマンドã®å®Ÿè¡Œçµæžœã¯ã™ã¹ã¦Filterã¨ã—ã¦ã‹ãˆã‚Šã¾ã™. Enumerableã‚’includeã—
+ã¦ã„ã¾ã™.
+
+= 主ãªãƒ¡ã‚½ãƒƒãƒ‰ä¸€è¦§
+
+== コマンド定義
+
+OS上ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’実行ã™ã‚‹ã«ã¯ã¾ãš, Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦å®šç¾©ã—ã¾ã™.
+
+注) コマンドを定義ã—ãªãã¨ã‚‚直接実行ã§ãã‚‹Shell#systemコマンドもã‚りã¾ã™.
+
+--- Shell.def_system_command(command, path = command)
+
+ Shellã®ãƒ¡ã‚½ãƒƒãƒ‰ã¨ã—ã¦commandを登録ã—ã¾ã™.
+
+ 例)
+ Shell.def_system_command "ls"
+ ls を定義
+
+ Shell.def_system_command "sys_sort", "sort"
+ sortコマンドをsys_sortã¨ã—ã¦å®šç¾©
+
+--- Shell.undef_system_command(command)
+
+ commandを削除ã—ã¾ã™.
+
+--- Shell.alias_command(ali, command, *opts) {...}
+
+ commandã®aliasã‚’ã—ã¾ã™.
+
+ 例)
+ Shell.alias_command "lsC", "ls", "-CBF", "--show-control-chars"
+ Shell.alias_command("lsC", "ls"){|*opts| ["-CBF", "--show-control-chars", *opts]}
+
+--- Shell.unalias_command(ali)
+
+ commandã®aliasを削除ã—ã¾ã™.
+
+--- Shell.install_system_commands(pre = "sys_")
+
+ system_path上ã«ã‚ã‚‹å…¨ã¦ã®å®Ÿè¡Œå¯èƒ½ãƒ•ァイルをShellã«å®šç¾©ã™ã‚‹. メソッ
+ ドåã¯å…ƒã®ãƒ•ァイルåã®é ­ã«preã‚’ã¤ã‘ãŸã‚‚ã®ã¨ãªã‚‹.
+
+== 生æˆ
+
+--- Shell.new
+
+ プロセスã®ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’カレントディレクトリã¨ã™ã‚‹Shellオ
+ ブジェクトを生æˆã—ã¾ã™.
+
+--- Shell.cd(path)
+
+ pathをカレントディレクトリã¨ã™ã‚‹Shellオブジェクトを生æˆã—ã¾ã™.
+
+== プロセス管ç†
+
+--- Shell#jobs
+
+ スケジューリングã•れã¦ã„ã‚‹jobã®ä¸€è¦§ã‚’è¿”ã™.
+
+--- Shell#kill sig, job
+
+ jobã«ã‚·ã‚°ãƒŠãƒ«sigã‚’é€ã‚‹
+
+== カレントディレクトリæ“作
+
+--- Shell#cd(path, &block)
+--- Shell#chdir
+
+ カレントディレクトリをpathã«ã™ã‚‹. イテレータã¨ã—ã¦å‘¼ã°ã‚ŒãŸã¨ãã«ã¯
+ ブロック実行中ã®ã¿ã‚«ãƒ¬ãƒ³ãƒˆãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’変更ã™ã‚‹.
+
+--- Shell#pushd(path = nil, &block)
+--- Shell#pushdir
+
+ カレントディレクトリをディレクトリスタックã«ã¤ã¿, カレントディレク
+ トリをpathã«ã™ã‚‹. pathãŒçœç•¥ã•れãŸã¨ãã«ã¯, カレントディレクトリã¨
+ ディレクトリスタックã®ãƒˆãƒƒãƒ—を交æ›ã™ã‚‹. イテレータã¨ã—ã¦å‘¼ã°ã‚ŒãŸã¨
+ ãã«ã¯, ブロック実行中ã®ã¿pushdã™ã‚‹.
+
+--- Shell#popd
+--- Shell#popdir
+
+ ディレクトリスタックã‹ã‚‰ãƒãƒƒãƒ—ã—, ãれをカレントディレクトリã«ã™ã‚‹.
+
+== ファイル/ディレクトリæ“作
+
+--- Shell#foreach(path = nil, &block)
+
+ pathãŒãƒ•ァイルãªã‚‰, File#foreach
+ pathãŒãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãªã‚‰, Dir#foreach
+
+--- Shell#open(path, mode)
+
+ pathãŒãƒ•ァイルãªã‚‰, File#open
+ pathãŒãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãªã‚‰, Dir#open
+
+--- Shell#unlink(path)
+
+ pathãŒãƒ•ァイルãªã‚‰, File#unlink
+ pathãŒãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãªã‚‰, Dir#unlink
+
+--- Shell#test(command, file1, file2)
+--- Shell#[command, file1, file2]
+
+ ファイルテスト関数testã¨åŒã˜.
+ 例)
+ sh[?e, "foo"]
+ sh[:e, "foo"]
+ sh["e", "foo"]
+ sh[:exists?, "foo"]
+ sh["exists?", "foo"]
+
+--- Shell#mkdir(*path)
+
+ Dir.mkdirã¨åŒã˜(複数å¯)
+
+--- Shell#rmdir(*path)
+
+ Dir.rmdirã¨åŒã˜(複数å¯)
+
+== コマンド実行
+
+--- System#system(command, *opts)
+
+ commandを実行ã™ã‚‹.
+ 例)
+ print sh.system("ls", "-l")
+ sh.system("ls", "-l") | sh.head > STDOUT
+
+--- System#rehash
+
+ リãƒãƒƒã‚·ãƒ¥ã™ã‚‹
+
+--- Shell#transact &block
+
+ ブロック中ã§ã¯shellã‚’selfã¨ã—ã¦å®Ÿè¡Œã™ã‚‹.
+ 例)
+ sh.transact{system("ls", "-l") | head > STDOUT}
+
+--- Shell#out(dev = STDOUT, &block)
+
+ transactを呼ã³å‡ºã—ãã®çµæžœã‚’devã«å‡ºåŠ›ã™ã‚‹.
+
+== 内部コマンド
+
+--- Shell#echo(*strings)
+--- Shell#cat(*files)
+--- Shell#glob(patten)
+--- Shell#tee(file)
+
+ ã“れらã¯å®Ÿè¡Œã™ã‚‹ã¨, ãれらを内容ã¨ã™ã‚‹Filterオブジェクトを返ã—ã¾ã™.
+
+--- Filter#each &block
+
+ フィルタã®ä¸€è¡Œãšã¤ã‚’blockã«æ¸¡ã™.
+
+--- Filter#<(src)
+
+ srcをフィルタã®å…¥åŠ›ã¨ã™ã‚‹. srcãŒ, 文字列ãªã‚‰ã°ãƒ•ァイルを, IOã§ã‚れ
+ ã°ãれをãã®ã¾ã¾å…¥åŠ›ã¨ã™ã‚‹.
+
+--- Filter#>(to)
+
+ srcをフィルタã®å‡ºåŠ›ã¨ã™ã‚‹. toãŒ, 文字列ãªã‚‰ã°ãƒ•ァイルã«, IOã§ã‚れ
+ ã°ãれをãã®ã¾ã¾å‡ºåŠ›ã¨ã™ã‚‹.
+
+--- Filter#>>(to)
+
+ srcをフィルタã«è¿½åŠ ã™ã‚‹. toãŒ, 文字列ãªã‚‰ã°ãƒ•ァイルã«, IOã§ã‚れã°
+ ãれをãã®ã¾ã¾å‡ºåŠ›ã¨ã™ã‚‹.
+
+--- Filter#|(filter)
+
+ パイプçµåˆ
+
+--- Filter#+(filter)
+
+ filter1 + filter2 㯠filter1ã®å‡ºåŠ›ã®å¾Œ, filter2ã®å‡ºåŠ›ã‚’è¡Œã†.
+
+--- Filter#to_a
+--- Filter#to_s
+
+== 組込ã¿ã‚³ãƒžãƒ³ãƒ‰
+
+--- Shell#atime(file)
+--- Shell#basename(file, *opt)
+--- Shell#chmod(mode, *files)
+--- Shell#chown(owner, group, *file)
+--- Shell#ctime(file)
+--- Shell#delete(*file)
+--- Shell#dirname(file)
+--- Shell#ftype(file)
+--- Shell#join(*file)
+--- Shell#link(file_from, file_to)
+--- Shell#lstat(file)
+--- Shell#mtime(file)
+--- Shell#readlink(file)
+--- Shell#rename(file_from, file_to)
+--- Shell#split(file)
+--- Shell#stat(file)
+--- Shell#symlink(file_from, file_to)
+--- Shell#truncate(file, length)
+--- Shell#utime(atime, mtime, *file)
+
+ ã“れらã¯Fileクラスã«ã‚ã‚‹åŒåã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã¨åŒã˜ã§ã™.
+
+--- Shell#blockdev?(file)
+--- Shell#chardev?(file)
+--- Shell#directory?(file)
+--- Shell#executable?(file)
+--- Shell#executable_real?(file)
+--- Shell#exist?(file)/Shell#exists?(file)
+--- Shell#file?(file)
+--- Shell#grpowned?(file)
+--- Shell#owned?(file)
+--- Shell#pipe?(file)
+--- Shell#readable?(file)
+--- Shell#readable_real?(file)
+--- Shell#setgid?(file)
+--- Shell#setuid?(file)
+--- Shell#size(file)/Shell#size?(file)
+--- Shell#socket?(file)
+--- Shell#sticky?(file)
+--- Shell#symlink?(file)
+--- Shell#writable?(file)
+--- Shell#writable_real?(file)
+--- Shell#zero?(file)
+
+ ã“れらã¯FileTestクラスã«ã‚ã‚‹åŒåã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã¨åŒã˜ã§ã™.
+
+--- Shell#syscopy(filename_from, filename_to)
+--- Shell#copy(filename_from, filename_to)
+--- Shell#move(filename_from, filename_to)
+--- Shell#compare(filename_from, filename_to)
+--- Shell#safe_unlink(*filenames)
+--- Shell#makedirs(*filenames)
+--- Shell#install(filename_from, filename_to, mode)
+
+ ã“れらã¯FileToolsクラスã«ã‚ã‚‹åŒåã®ã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ã¨åŒã˜ã§ã™.
+
+ ãã®ä»–, 以下ã®ã‚‚ã®ãŒã‚¨ã‚¤ãƒªã‚¢ã‚¹ã•れã¦ã„ã¾ã™.
+
+--- Shell#cmp <- Shell#compare
+--- Shell#mv <- Shell#move
+--- Shell#cp <- Shell#copy
+--- Shell#rm_f <- Shell#safe_unlink
+--- Shell#mkpath <- Shell#makedirs
+
+= サンプル
+
+== ex1
+
+ sh = Shell.cd("/tmp")
+ sh.mkdir "shell-test-1" unless sh.exists?("shell-test-1")
+ sh.cd("shell-test-1")
+ for dir in ["dir1", "dir3", "dir5"]
+ if !sh.exists?(dir)
+ sh.mkdir dir
+ sh.cd(dir) do
+ f = sh.open("tmpFile", "w")
+ f.print "TEST\n"
+ f.close
+ end
+ print sh.pwd
+ end
+ end
+
+== ex2
+
+ sh = Shell.cd("/tmp")
+ sh.transact do
+ mkdir "shell-test-1" unless exists?("shell-test-1")
+ cd("shell-test-1")
+ for dir in ["dir1", "dir3", "dir5"]
+ if !exists?(dir)
+ mkdir dir
+ cd(dir) do
+ f = open("tmpFile", "w")
+ f.print "TEST\n"
+ f.close
+ end
+ print pwd
+ end
+ end
+ end
+
+== ex3
+
+ sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
+ (sh.cat < "/etc/printcap") | sh.tee("tee11") > "tee12"
+ sh.cat("/etc/printcap") | sh.tee("tee1") >> "tee2"
+ (sh.cat < "/etc/printcap") | sh.tee("tee11") >> "tee12"
+
+== ex4
+
+ print sh.cat("/etc/passwd").head.collect{|l| l =~ /keiju/}
+
+=end
diff --git a/doc/signals.rdoc b/doc/signals.rdoc
deleted file mode 100644
index 403eb66549..0000000000
--- a/doc/signals.rdoc
+++ /dev/null
@@ -1,106 +0,0 @@
-= Caveats for implementing Signal.trap callbacks
-
-As with implementing signal handlers in C or most other languages,
-all code passed to Signal.trap must be reentrant. If you are not
-familiar with reentrancy, you need to read up on it at
-{Wikipedia}[https://en.wikipedia.org/wiki/Reentrancy_(computing)] or
-elsewhere before reading the rest of this document.
-
-Most importantly, "thread-safety" does not guarantee reentrancy;
-and methods such as Mutex#lock and Mutex#synchronize which are
-commonly used for thread-safety even prevent reentrancy.
-
-== An implementation detail of the Ruby VM
-
-The Ruby VM defers Signal.trap callbacks from running until it is safe
-for its internal data structures, but it does not know when it is safe
-for data structures in YOUR code. Ruby implements deferred signal
-handling by registering short C functions with only
-{async-signal-safe functions}[http://man7.org/linux/man-pages/man7/signal-safety.7.html] as
-signal handlers. These short C functions only do enough tell the VM to
-run callbacks registered via Signal.trap later in the main Ruby Thread.
-
-== Unsafe methods to call in Signal.trap blocks
-
-When in doubt, consider anything not listed as safe below as being
-unsafe.
-
-* Mutex#lock, Mutex#synchronize and any code using them are explicitly
- unsafe. This includes Monitor in the standard library which uses
- Mutex to provide reentrancy.
-
-* Dir.chdir with block
-
-* any IO write operations when IO#sync is false;
- including IO#write, IO#write_nonblock, IO#puts.
- Pipes and sockets default to `IO#sync = true', so it is safe to
- write to them unless IO#sync was disabled.
-
-* File#flock, as the underlying flock(2) call is not specified by POSIX
-
-== Commonly safe operations inside Signal.trap blocks
-
-* Assignment and retrieval of local, instance, and class variables
-
-* Most object allocations and initializations of common types
- including Array, Hash, String, Struct, Time.
-
-* Common Array, Hash, String, Struct operations which do not execute a block
- are generally safe; but beware if iteration is occurring elsewhere.
-
-* Hash#[], Hash#[]= (unless Hash.new was given an unsafe block)
-
-* Thread::Queue#push and Thread::SizedQueue#push (since Ruby 2.1)
-
-* Creating a new Thread via Thread.new/Thread.start can used to get
- around the unusability of Mutexes inside a signal handler
-
-* Signal.trap is safe to use inside blocks passed to Signal.trap
-
-* arithmetic on Integer and Float (`+', `-', '%', '*', '/')
-
- Additionally, signal handlers do not run between two successive
- local variable accesses, so shortcuts such as `+=' and `-=' will
- not trigger a data race when used on Integer and Float classes in
- signal handlers.
-
-== System call wrapper methods which are safe inside Signal.trap
-
-Since Ruby has wrappers around many
-{async-signal-safe C functions}[http://man7.org/linux/man-pages/man7/signal-safety.7.html]
-the corresponding wrappers for many IO, File, Dir, and Socket methods
-are safe.
-
-(Incomplete list)
-
-* Dir.chdir (without block arg)
-* Dir.mkdir
-* Dir.open
-* File#truncate
-* File.link
-* File.open
-* File.readlink
-* File.rename
-* File.stat
-* File.symlink
-* File.truncate
-* File.unlink
-* File.utime
-* IO#close
-* IO#dup
-* IO#fsync
-* IO#read
-* IO#read_nonblock
-* IO#stat
-* IO#sysread
-* IO#syswrite
-* IO.select
-* IO.pipe
-* Process.clock_gettime
-* Process.exit!
-* Process.fork
-* Process.kill
-* Process.pid
-* Process.ppid
-* Process.waitpid
-...
diff --git a/doc/standard_library.rdoc b/doc/standard_library.rdoc
index f71cedebf7..00eae208c6 100644
--- a/doc/standard_library.rdoc
+++ b/doc/standard_library.rdoc
@@ -10,112 +10,115 @@ description.
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
+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 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
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
+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
+OpenStruct:: Class to build custom data structures, similar to a Hash
PP:: Provides a PrettyPrinter for Ruby objects
PrettyPrinter:: Implements a pretty printing algorithm for readable structure
+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, 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
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
tmpdir.rb:: Extends the Dir class to manage the OS temporary file path
+Tracer:: Outputs a source level execution trace of a Ruby program
TSort:: Topological sorting using Tarjan's algorithm
un.rb:: Utilities to replace common UNIX commands
-WeakRef:: Allows a referenced object to be garbage-collected
-
-== 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
-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
-
-Benchmark:: Provides methods to measure and report the time used to execute code
-Bundler:: Manage your Ruby application's gem dependencies
-CGI:: Support for the Common Gateway Interface protocol
-CSV:: Provides an interface to read and write CSV files and data
-Delegator:: Provides three abilities to delegate method calls to an object
-DidYouMean:: "Did you mean?" experience in Ruby
-FileUtils:: Several file utility methods for copying, moving, removing, etc
-Forwardable:: Provides delegation of specified methods to a designated object
-GetoptLong:: Parse command line options similar to the GNU C getopt_long()
-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
-Matrix:: Represents a mathematical matrix.
-Mutex_m:: Mixin to extend objects to be handled like a Mutex
-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
-Open3:: Provides access to stdin, stdout and stderr when running other programs
-OpenStruct:: Class to build custom data structures, similar to a Hash
-Prime:: Prime numbers and factorization library
-PStore:: Implements a file based persistence mechanism based on a Hash
-Racc:: A LALR(1) parser generator written in Ruby.
-RDoc:: Produces HTML and command-line documentation for Ruby
-REXML:: An XML toolkit for Ruby
-RSS:: Family of libraries that support various formats of XML "feeds"
-Singleton:: Implementation of the Singleton pattern for Ruby
-Timeout:: Auto-terminate potentially long-running operations in Ruby
-Tracer:: Outputs a source level execution trace of a Ruby program
URI:: A Ruby module providing support for Uniform Resource Identifiers
+WeakRef:: Allows a referenced object to be garbage-collected
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
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
+PTY:: Creates and manages pseudo terminals
Readline:: Provides an interface for GNU Readline and Edit Line (libedit)
-SDBM:: Provides a simple file-based key-value store with String keys and values
+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
-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.rdoc b/doc/syntax.rdoc
index 2463c12a63..fe0f98ce4c 100644
--- a/doc/syntax.rdoc
+++ b/doc/syntax.rdoc
@@ -32,5 +32,3 @@ Refinements[rdoc-ref:syntax/refinements.rdoc] ::
Miscellaneous[rdoc-ref:syntax/miscellaneous.rdoc] ::
+alias+, +undef+, +BEGIN+, +END+
-Comments[rdoc-ref:syntax/comments.rdoc] ::
- Line and block code comments
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc
index a1806e4c48..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
@@ -92,9 +92,8 @@ Now any reference to +big_calculation+ is considered a local variable and will
be cached. To call the method, use <code>self.big_calculation</code>.
You can force a method call by using empty argument parentheses as shown above
-or by using an explicit receiver like <code>self</code>. Using an explicit
-receiver may raise a NameError if the method's visibility is not public or the
-receiver is the literal <code>self</code>.
+or by using an explicit receiver like <code>self.</code>. Using an explicit
+receiver may raise a NameError if the method's visibility is not public.
Another commonly confusing case is when using a modifier +if+:
@@ -110,28 +109,6 @@ The confusion comes from the out-of-order execution of the expression. First
the local variable is assigned-to then you attempt to call a nonexistent
method.
-== Local Variables and eval
-
-Using +eval+ to evaluate Ruby code will allow access to local variables defined
-in the same scope, even if the local variables are not defined until after the
-call to +eval+. However, local variables defined inside the call to +eval+
-will not be reflected in the surrounding scope. Inside the call to +eval+,
-local variables defined in the surrounding scope and local variables defined
-inside the call to +eval+ will be accessible. However, you will not be able
-to access local variables defined in previous or subsequent calls to +eval+ in
-the same scope. Consider each +eval+ call a separate nested scope. Example:
-
- def m
- eval "bar = 1"
- lvs = eval "baz = 2; ary = [local_variables, foo, baz]; x = 2; ary"
- eval "quux = 3"
- foo = 1
- lvs << local_variables
- end
-
- m
- # => [[:baz, :ary, :x, :lvs, :foo], nil, 2, [:lvs, :foo]]
-
== Instance Variables
Instance variables are shared across all methods for the same object.
@@ -160,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
@@ -302,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
@@ -432,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
@@ -475,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 5abecc69da..79c0de59dc 100644
--- a/doc/syntax/calling_methods.rdoc
+++ b/doc/syntax/calling_methods.rdoc
@@ -30,29 +30,6 @@ NoMethodError.
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.
-=== Safe navigation operator
-
-<code>&.</code>, called "safe navigation operator", allows to skip method call
-when receiver is +nil+. It returns +nil+ and doesn't evaluate method's arguments
-if the call is skipped.
-
- REGEX = /(ruby) is (\w+)/i
- "Ruby is awesome!".match(REGEX).values_at(1, 2)
- # => ["Ruby", "awesome"]
- "Python is fascinating!".match(REGEX).values_at(1, 2)
- # NoMethodError: undefined method `values_at' for nil:NilClass
- "Python is fascinating!".match(REGEX)&.values_at(1, 2)
- # => nil
-
-This allows to easily chain methods which could return empty value. Note that
-<code>&.</code> skips only one next call, so for a longer chain it is necessary
-to add operator on each level:
-
- "Python is fascinating!".match(REGEX)&.values_at(1, 2).join(' - ')
- # NoMethodError: undefined method `join' for nil:NilClass
- "Python is fascinating!".match(REGEX)&.values_at(1, 2)&.join(' - ')
- # => nil
-
== Arguments
There are three types of arguments when sending a message, the positional
@@ -85,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
@@ -98,7 +75,7 @@ to:
If the method definition has a <code>*argument</code> extra positional
arguments will be assigned to +argument+ in the method as an Array.
-If the method definition doesn't include keyword arguments, the keyword or
+If the method definition doesn't include keyword arguments the keyword or
hash-type arguments are assigned as a single hash to the last argument:
def my_method(options)
@@ -107,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
@@ -172,8 +149,7 @@ like positional arguments:
my_method(positional1, keyword1: value1, keyword2: value2)
Any keyword arguments not given will use the default value from the method
-definition. If a keyword argument is given that the method did not list,
-and the method definition does not accept arbitrary keyword arguments, an
+definition. If a keyword argument is given that the method did not list an
ArgumentError will be raised.
=== Block Argument
@@ -270,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
@@ -279,20 +255,14 @@ hash at the end of the array into keyword arguments:
arguments = [1, 2, { c: 4 }]
my_method(*arguments)
-Note that this behavior is currently deprecated and will emit a warning.
-This behavior will be removed in Ruby 3.0.
-
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:
-
- my_method *arguments # warning
- my_method(*arguments) # no warning
+avoid a warning.
=== Hash to Keyword Arguments Conversion
@@ -301,8 +271,7 @@ Given the following method:
def my_method(first: 1, second: 2, third: 3)
end
-You can turn a Hash into keyword arguments with the <code>**</code>
-(keyword splat) operator:
+You can turn a Hash into keyword arguments with the <code>**</code> operator:
arguments = { first: 3, second: 4, third: 5 }
my_method(**arguments)
@@ -316,9 +285,8 @@ Both are equivalent to:
my_method(first: 3, second: 4, third: 5)
-If the method definition uses the keyword splat operator to
-gather arbitrary keyword arguments, they will not be gathered
-by <code>*</code>:
+If the method definition uses <code>**</code> to gather arbitrary keyword
+arguments they will not be gathered by <code>*</code>:
def my_method(*a, **kw)
p arguments: a, keywords: kw
@@ -328,7 +296,10 @@ by <code>*</code>:
Prints:
- {:arguments=>[1, 2], :keywords=>{'3'=>4, :five=>6}}
+ {:arguments=>[1, 2], :keywords=>{"3"=>4, :five=>6}}
+
+Unlike the splat operator described above the <code>**</code> operator has no
+commonly recognized name.
=== Proc to Block Conversion
@@ -339,21 +310,21 @@ Given a method that use a block:
end
You can convert a proc or lambda to a block argument with the <code>&</code>
-(block conversion) operator:
+operator:
argument = proc { |a| puts "#{a.inspect} was yielded" }
my_method(&argument)
-If the block conversion operator comes first in the call, parenthesis must be
-used to avoid a warning:
+If the splat operator comes first in the call, parenthesis must be used to
+avoid a warning.
- my_method &argument # warning
- my_method(&argument) # no warning
+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.
@@ -372,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/comments.rdoc b/doc/syntax/comments.rdoc
deleted file mode 100644
index a07dd41494..0000000000
--- a/doc/syntax/comments.rdoc
+++ /dev/null
@@ -1,37 +0,0 @@
-= Code Comments
-
-Ruby has two types of comments: inline and block.
-
-Inline comments start with the <code>#</code> character and continue until the
-end of the line:
-
- # On a separate line
- class Foo # or at the end of the line
- # can be indented
- def bar
- end
- end
-
-Block comments start with <code>=begin</code> and end with <code>=end</code>.
-Each should start on a separate line.
-
- =begin
- This is
- commented out
- =end
-
- class Foo
- end
-
- =begin some_tag
- this works, too
- =end
-
-<code>=begin</code> and <code>=end</code> can not be indented, so this is a
-syntax error:
-
- class Foo
- =begin
- Will not work
- =end
- end
diff --git a/doc/syntax/control_expressions.rdoc b/doc/syntax/control_expressions.rdoc
index f7e6d54924..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"
@@ -144,7 +144,7 @@ expression.
== Modifier +if+ and +unless+
+if+ and +unless+ can also be used to modify an expression. When used as a
-modifier the left-hand side is the "then" statement and the right-hand side
+modifier the left-hand side is the "then" expression and the right-hand side
is the "test" expression:
a = 0
@@ -164,7 +164,7 @@ This will print 1.
This will print 0.
While the modifier and standard versions have both a "test" expression and a
-"then" statement, they are not exact transformations of each other due to
+"then" expression, they are not exact transformations of each other due to
parse order. Here is an example that shows the difference:
p a if a = 0.zero?
@@ -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,72 +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+.
-== Modifier Statements
-
-Ruby's grammar differentiates between statements and expressions. All
-expressions are statements (an expression is a type of statement), but
-not all statements are expressions. Some parts of the grammar accept
-expressions and not other types of statements, which causes code that
-looks similar to be parsed differently.
-
-For example, when not used as a modifier, +if+, +else+, +while+, +until+,
-and +begin+ are expressions (and also statements). However, when
-used as a modifier, +if+, +else+, +while+, +until+ and +rescue+
-are statements but not expressions.
-
- if true; 1 end # expression (and therefore statement)
- 1 if true # statement (not expression)
-
-Statements that are not expressions cannot be used in contexts where an
-expression is expected, such as method arguments.
-
- puts( 1 if true ) #=> SyntaxError
-
-You can wrap a statement in parentheses to create an expression.
-
- puts((1 if true)) #=> 1
-
-If you put a space between the method name and opening parenthesis, you
-do not need two sets of parentheses.
-
- puts (1 if true) #=> 1, because of optional parentheses for method
-
-This is because this is parsed similar to a method call without
-parentheses. It is equivalent to the following code, without the creation
-of a local variable:
-
- x = (1 if true)
- p x
-
-In a modifier statement, the left-hand side must be a statement and the
-right-hand side must be an expression.
-
-So in <code>a if b rescue c</code>, because <code>b rescue c</code> is a
-statement that is not an expression, and therefore is not allowed as the
-right-hand side of the +if+ modifier statement, the code is necessarily
-parsed as <code>(a if b) rescue c</code>.
-
-This interacts with operator precedence in such a way that:
-
- stmt if v = expr rescue x
- stmt if v = expr unless x
-
-are parsed as:
-
- stmt if v = (expr rescue x)
- (stmt if v = expr) unless x
-
-This is because modifier +rescue+ has higher precedence than <code>=</code>,
-and modifier +if+ has lower precedence than <code>=</code>.
-
== 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>.
@@ -519,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 = []
@@ -537,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 = []
@@ -552,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 31e2f0175c..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
@@ -17,14 +17,7 @@ wish to limit the scope of rescued exceptions:
# ...
end
-The same is true for a +class+, +module+, and +block+:
-
- [0, 1, 2].map do |i|
- 10 / i
- rescue ZeroDivisionError
- nil
- end
- #=> [nil, 10, 5]
+The same is true for a +class+ or +module+.
You can assign the exception to a local variable by using <tt>=>
variable_name</tt> at the end of the +rescue+ line:
@@ -36,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+:
@@ -59,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:
@@ -100,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 38bfa38676..194945abbd 100644
--- a/doc/syntax/literals.rdoc
+++ b/doc/syntax/literals.rdoc
@@ -71,33 +71,6 @@ Examples:
All these numbers have the same decimal value, 170. Like integers and floats
you may use an underscore for readability.
-=== Rational numbers
-
-Numbers suffixed by +r+ are Rational numbers.
-
- 12r #=> (12/1)
- 12.3r #=> (123/10)
-
-Rational numbers are exact, whereas Float numbers are inexact.
-
- 0.1r + 0.2r #=> (3/10)
- 0.1 + 0.2 #=> 0.30000000000000004
-
-=== Complex numbers
-
-Numbers suffixed by +i+ are Complex (or imaginary) numbers.
-
- 1i #=> (0+1i)
- 1i * 1i #=> (-1+0i)
-
-Also Rational numbers may be imaginary numbers.
-
- 12.3ri #=> (0+(123/10)*i)
-
-+i+ must be placed after +r+, the opposite is not allowed.
-
- 12.3ir #=> syntax error
-
== Strings
The most common way of writing strings is using <tt>"</tt>:
@@ -110,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>:
@@ -160,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.
@@ -176,24 +124,7 @@ 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 (heredocs)
+=== Here Documents
If you are writing a large block of text you may use a "here document" or
"heredoc":
@@ -223,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,9 +172,6 @@ behaves like Kernel#`:
cat #{__FILE__}
HEREDOC
-When surrounding with quotes, any character but that quote and newline
-(CR and/or LF) can be used as the identifier.
-
To call a method on a heredoc place it after the opening identifier:
expected_result = <<-EXPECTED.chomp
@@ -289,7 +203,7 @@ 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
@@ -319,14 +233,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
@@ -336,8 +242,6 @@ its ending value.
(1..2) # includes its ending value
(1...2) # excludes its ending value
- (1..) # endless range, representing infinite sequence from 1 to Infinity
- (..1) # beginless range, representing infinite sequence from -Infinity to 1
You may create a range of any object. See the Range documentation for details
on the methods you need to implement.
@@ -376,7 +280,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.
@@ -398,3 +302,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 924e31611f..2c01810b4c 100644
--- a/doc/syntax/methods.rdoc
+++ b/doc/syntax/methods.rdoc
@@ -17,8 +17,8 @@ on calling methods}[rdoc-ref:syntax/calling_methods.rdoc].
== Method Names
Method names may be one of the operators or must start a letter or a character
-with the eighth bit set. It may contain letters, numbers, an <code>_</code>
-(underscore or low line) or a character with the eighth bit set. The convention
+with the eight bit set. It may contain letters, numbers, an <code>_</code>
+(underscore or low line) or a character with the eight bit set. The convention
is to use underscores to separate words in a multiword method name:
def method_name
@@ -26,12 +26,12 @@ is to use underscores to separate words in a multiword method name:
end
Ruby programs must be written in a US-ASCII-compatible character set such as
-UTF-8, ISO-8859-1 etc. In such character sets if the eighth bit is set it
+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,27 +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.
+Methods that end with an equals sign indicate an assignment method. For
+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
@@ -92,8 +94,8 @@ operators.
<code>></code> :: greater-than
<code>>=</code> :: greater-than or equal
-To define unary methods minus and plus, follow the operator with an
-<code>@</code> as in <code>+@</code>:
+To define unary methods minus, plus, tilde and not (<code>!</code>) follow the
+operator with an <code>@</code> as in <code>+@</code> or <code>!@</code>:
class C
def -@
@@ -105,13 +107,6 @@ To define unary methods minus and plus, follow the operator with an
-obj # prints "you inverted this object"
-The <code>@</code> is needed to differentiate unary minus and plus
-operators from binary minus and plus operators.
-
-You can also follow tilde and not (<code>!</code>) unary methods with
-<code>@</code>, but it is not required as there are no binary tilde
-and not operators.
-
Unary methods accept zero arguments.
Additionally, methods for element reference and assignment may be defined:
@@ -152,18 +147,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
@@ -288,25 +279,6 @@ This will raise a SyntaxError:
a + b + c
end
-Default argument values can refer to arguments that have already been
-evaluated as local variables, and argument values are always evaluated
-left to right. So this is allowed:
-
- def add_values(a = 1, b = a)
- a + b
- end
- add_values
- # => 2
-
-But this will raise a +NameError+ (unless there is a method named
-+b+ defined):
-
- def add_values(a = b, b = 1)
- a + b
- end
- add_values
- # NameError (undefined local variable or method `b' for main:Object)
-
=== Array Decomposition
You can decompose (unpack or extract values from) an Array using extra
@@ -419,116 +391,12 @@ Arbitrary keyword arguments will be accepted with <code>**</code>:
# prints 1 then {:second=>2, :third=>3}
When calling a method with keyword arguments the arguments may appear in any
-order. If an unknown keyword argument is sent by the caller, and the method
-does not accept arbitrary keyword arguments, an ArgumentError is raised.
-
-To require a specific keyword argument, do not include a default value
-for the keyword argument:
-
- def add_values(first:, second:)
- first + second
- end
- add_values
- # ArgumentError (missing keywords: first, second)
- add_values(first: 1, second: 2)
- # => 3
+order. If an unknown keyword argument is sent by the caller an ArgumentError
+is raised.
When mixing keyword arguments and positional arguments, all positional
arguments must appear before any keyword arguments.
-Also, note that <code>**</code> can be used to ignore keyword arguments:
-
- def ignore_keywords(**)
- end
-
-To mark a method as accepting keywords, but not actually accepting
-keywords, you can use the <code>**nil</code>:
-
- def no_keywords(**nil)
- end
-
-Calling such a method with keywords or a non-empty keyword splat will
-result in an ArgumentError. This syntax is supported so that keywords
-can be added to the method later without affected backwards compatibility.
-
-=== Keyword and Positional Argument Separation
-
-Between Ruby 2.0 and 2.6, keyword and positional arguments were not
-separated, and a keyword argument could be used as a positional argument
-and vice-versa. In Ruby 3.0, keyword and positional arguments will
-be separated if the method definition includes keyword arguments.
-In Ruby 3.0, if the method definition does not include keyword arguments,
-keyword arguments provided when calling the method will continue to be
-treated as a final positional hash argument.
-
-Currently, the keyword and positional arguments are not separated,
-but cases where behavior will change in Ruby 3.0 will result in a
-warning being emitted.
-
-There are a few different types of keyword argument separation issues.
-
-==== Conversion of Hash to Keywords
-
-If a method is called with the hash, the hash could be treated as
-keywords:
-
- def my_method(**keywords)
- keywords
- end
- my_method({a: 1}) # {:a => 1}
-
-This occurs even if the hash could be an optional positional argument
-or an element of a rest argument:
-
- def my_method(hash=nil, **keywords)
- [hash, keywords]
- end
- my_method({a: 1}) # [nil, {:a => 1}]
-
- def my_method(*args, **keywords)
- [args, keywords]
- end
- my_method({a: 1}) # [[], {:a => 1}]
-
-However, if the hash is needed for a mandatory positional argument,
-it would not be treated as keywords:
-
- def my_method(hash, **keywords)
- [hash, keywords]
- end
- my_method({a: 1}) # [{:a => 1}, {}]
-
-==== Conversion of Keywords to Positional Arguments
-
-If a method is called with keywords, but it is missing one
-mandatory positional argument, the keywords are converted to
-a hash and the hash used as the mandatory positional argument:
-
- def my_method(hash, **keywords)
- [hash, keywords]
- end
- my_method(a: 1) # [{:a => 1}, {}]
-
-This is also true for empty keyword splats:
-
- kw = {}
- my_method(**kw) # [{}, {}]
-
-==== Splitting of Positional Hashes or Keywords
-
-If a method definition accepts specific keywords and not arbitrary keywords,
-keywords or a positional hash may be split if the hash includes both Symbol
-keys and non-Symbol keys and the keywords or positional hash are not needed
-as a mandatory positional argument. In this case, the non-Symbol keys are
-separated into a positional argument hash, and the Symbol keys are used
-as the keyword arguments:
-
- def my_method(hash=3, a: 4)
- [hash, a]
- end
- my_method(a: 1, 'a' => 2) # [{"a"=>2}, 1]
- my_method({a: 1, 'a' => 2}) # [{"a"=>2}, 1]
-
== Block Argument
The block argument is indicated by <code>&</code> and must come last:
@@ -552,6 +420,15 @@ in this section:
yield self
end
+There is also a performance benefit to using yield over a calling a block
+parameter. When a block argument is assigned to a variable a Proc object is
+created which holds the block. When using yield this Proc object is not
+created.
+
+If you only need to use the block sometimes you can use Proc.new to create a
+proc from the block that was passed to your method. See Proc.new for further
+details.
+
== Exception Handling
Methods have an implied exception handling block so you do not need to use
@@ -573,28 +450,7 @@ May be written as:
# handle exception
end
-Similarly, if you wish to always run code even if an exception is raised,
-you can use +ensure+ without +begin+ and +end+:
-
- def my_method
- # code that may raise an exception
- ensure
- # code that runs even if previous code raised an exception
- end
-
-You can also combine +rescue+ with +ensure+ and/or +else+, without
-+begin+ and +end+:
-
- def my_method
- # code that may raise an exception
- rescue
- # handle exception
- else
- # only run if no exception raised above
- ensure
- # code that runs even if previous code raised an 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 87ec059ae7..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 mismatch, 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 6122f6e08e..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
@@ -190,41 +190,9 @@ Here is an example:
b.n b #=> 1 -- m called on defining class
a.n b # raises NoMethodError A is not a subclass of B
-The third visibility is +private+. A private method may only be called from
-inside the owner class without a receiver, or with a literal +self+
-as a receiver. If a private method is called with a
-receiver other than a literal +self+, a NoMethodError will be raised.
-
- class A
- def without
- m
- end
-
- def with_self
- self.m
- end
-
- def with_other
- A.new.m
- end
-
- def with_renamed
- copy = self
- copy.m
- end
-
- def m
- 1
- end
-
- private :m
- end
-
- a = A.new
- a.without #=> 1
- a.with_self #=> 1
- a.with_other # NoMethodError (private method `m' called for #<A:0x0000559c287f27d0>)
- a.with_renamed # NoMethodError (private method `m' called for #<A:0x0000559c285f8330>)
+The third visibility is +private+. A private method may not be called with a
+receiver, not even +self+. If a private method is called with a receiver a
+NoMethodError will be raised.
=== +alias+ and +undef+
@@ -374,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/precedence.rdoc b/doc/syntax/precedence.rdoc
index f64691ab1f..515626c74f 100644
--- a/doc/syntax/precedence.rdoc
+++ b/doc/syntax/precedence.rdoc
@@ -49,14 +49,10 @@ Unary <code>+</code> and unary <code>-</code> are for <code>+1</code>,
<code>-1</code> or <code>-(a + b)</code>.
Modifier-if, modifier-unless, etc. are for the modifier versions of those
-keywords. For example, this is a modifier-unless statement:
+keywords. For example, this is a modifier-unless expression:
a += 1 unless a.zero?
-Note that <code>(a if b rescue c)</code> is parsed as <code>((a if b) rescue
-c)</code> due to reasons not related to precedence. See {modifier
-statements}[control_expressions_rdoc.html#label-Modifier+Statements].
-
<code>{ ... }</code> blocks have priority below all listed operations, but
<code>do ... end</code> blocks have lower priority.
diff --git a/doc/syntax/refinements.rdoc b/doc/syntax/refinements.rdoc
index fc554bb476..3ba03f6d58 100644
--- a/doc/syntax/refinements.rdoc
+++ b/doc/syntax/refinements.rdoc
@@ -7,7 +7,7 @@ changes. This can cause unintended side-effects or breakage of programs.
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 can modify both classes and modules.
+class locally.
Here is a basic refinement:
@@ -26,7 +26,8 @@ Here is a basic refinement:
end
First, a class +C+ is defined. Next a refinement for +C+ is created using
-Module#refine.
+Module#refine. Refinements only modify classes, not modules so the argument
+must be a class.
Module#refine creates an anonymous module that contains the changes or
refinements to the class (+C+ in the example). +self+ in the refine block is
@@ -42,21 +43,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 only activate refinements at top-level, not inside any class, module
+or method scope. You may activate refinements in a string passed to
+Kernel#eval that is evaluated at top-level. Refinements are active until the
+end of the file or the end of the eval string, respectively.
-You may activate refinements 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.
-
-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
@@ -79,7 +74,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:
@@ -141,26 +136,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
@@ -179,9 +154,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
@@ -207,6 +182,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
@@ -224,13 +217,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+
@@ -247,37 +239,23 @@ Note that +super+ in a method of a refinement invokes the method in the
refined class even if there is another refinement which has been activated in
the same context.
-== Methods Introspection
+== Indirect Method Calls
-When using introspection methods such as Kernel#method or Kernel#methods refinements are not honored.
+When using indirect method access such as Kernel#send, Kernel#method or
+Kernel#respond_to? refinements are not honored for the caller context during
+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 example, 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/cesu_8.c b/enc/cesu_8.c
deleted file mode 100644
index decbb928f4..0000000000
--- a/enc/cesu_8.c
+++ /dev/null
@@ -1,454 +0,0 @@
-/**********************************************************************
- cesu_8.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"
-#ifdef RUBY
-# include "encindex.h"
-#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
-#endif
-#define VALID_CODE_LIMIT 0x0010ffff
-
-#define utf8_islead(c) ((UChar )((c) & 0xc0) != 0x80)
-
-static const int EncLen_CESU8[] = {
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 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, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-};
-
-typedef enum {
- FAILURE = -2,
- ACCEPT,
- S0, S1, S2, S3,
- S4, S5, S6, S7
-} 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, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* c */ F, F, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* d */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* e */ 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
- },
- { /* S2 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
- },
- { /* S3 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 8 */ 1, 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 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
- },
- { /* S4 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 8 */ 1, 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 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
- },
- { /* S5 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 8 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- /* 9 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- /* a */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- /* b */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
- },
- { /* S6 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* b */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, 7, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F
- },
- { /* S7 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 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 5 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 6 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 7 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 8 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* 9 */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* a */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* b */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* c */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* d */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* e */ F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
- /* f */ F, F, F, F, F, F, F, F, F, F, F, F, F, 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_CESU8[firstbyte]-1);
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(2) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-
- if (p == e) {
- int len = EncLen_CESU8[firstbyte];
- if (s == 4) { /* S4 is CESU-8's surrogate pair; len is 6 */
- len = 6;
- }
- return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(len-2);
- }
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(3) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(3);
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(4) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(2);
- s = trans[s][*p++];
- if (s < 0) return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(5) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-
- if (p == e) return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
- s = trans[s][*p++];
- return s == ACCEPT ? ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(6) :
- ONIGENC_CONSTRUCT_MBCLEN_INVALID();
-}
-
-static int
-is_mbc_newline(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- if (p < end) {
- if (*p == 0x0a) return 1;
-
-#ifdef USE_UNICODE_ALL_LINE_TERMINATORS
- if (*p == 0x0b || *p == 0x0c || *p == 0x0d) return 1;
- if (p + 1 < end) {
- if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
- return 1;
- if (p + 2 < end) {
- if ((*(p+2) == 0xa8 || *(p+2) == 0xa9)
- && *(p+1) == 0x80 && *p == 0xe2) /* U+2028, U+2029 */
- return 1;
- }
- }
-#endif
- }
-
- return 0;
-}
-
-static OnigCodePoint
-mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
-{
- int len;
-
- len = mbc_enc_len(p, end, enc);
- switch (len) {
- case 1:
- return *p;
- case 2:
- return ((p[0] & 0x1F) << 6) | (p[1] & 0x3f);
- case 3:
- return ((p[0] & 0xF) << 12) | ((p[1] & 0x3f) << 6) | (p[2] & 0x3f);
- case 6:
- {
- int high = ((p[0] & 0xF) << 12) | ((p[1] & 0x3f) << 6) | (p[2] & 0x3f);
- int low = ((p[3] & 0xF) << 12) | ((p[4] & 0x3f) << 6) | (p[5] & 0x3f);
- return ((high & 0x03ff) << 10) + (low & 0x03ff) + 0x10000;
- }
- }
-#ifdef USE_INVALID_CODE_SCHEME
- if (*p > 0xfd) {
- return ((*p == 0xfe) ? INVALID_CODE_FE : INVALID_CODE_FF);
- }
-#endif
- return (OnigCodePoint )*p;
-}
-
-static int
-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 6;
-#ifdef USE_INVALID_CODE_SCHEME
- else if (code == INVALID_CODE_FE) return 1;
- else if (code == INVALID_CODE_FF) return 1;
-#endif
- else
- return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
-}
-
-static int
-code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)
-{
-#define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80)
-#define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80)
-
- if ((code & 0xffffff80) == 0) {
- *buf = (UChar )code;
- return 1;
- }
- else {
- UChar *p = buf;
-
- if ((code & 0xfffff800) == 0) {
- *p++ = (UChar )(((code>>6)& 0x1f) | 0xc0);
- }
- else if ((code & 0xffff0000) == 0) {
- *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0);
- *p++ = UTF8_TRAILS(code, 6);
- }
- else if (code <= VALID_CODE_LIMIT) {
- unsigned int high = (code >> 10) + 0xD7C0;
- code = (code & 0x3FF) + 0xDC00;
- *p++ = (UChar )(((high>>12) & 0x0f) | 0xe0);
- *p++ = UTF8_TRAILS(high, 6);
- *p++ = UTF8_TRAIL0(high);
- *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0);
- *p++ = UTF8_TRAILS(code, 6);
- }
-#ifdef USE_INVALID_CODE_SCHEME
- else if (code == INVALID_CODE_FE) {
- *p = 0xfe;
- return 1;
- }
- else if (code == INVALID_CODE_FF) {
- *p = 0xff;
- return 1;
- }
-#endif
- else {
- return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
- }
-
- *p++ = UTF8_TRAIL0(code);
- return (int )(p - buf);
- }
-}
-
-static int
-mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
- const UChar* end, UChar* fold, OnigEncoding enc)
-{
- const UChar* p = *pp;
-
- if (ONIGENC_IS_MBC_ASCII(p)) {
-#ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
- if ((flag & ONIGENC_CASE_FOLD_TURKISH_AZERI) != 0) {
- if (*p == 0x49) {
- *fold++ = 0xc4;
- *fold = 0xb1;
- (*pp)++;
- return 2;
- }
- }
-#endif
-
- *fold = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
- (*pp)++;
- return 1; /* return byte length of converted char to lower */
- }
- else {
- return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold);
- }
-}
-
-
-static int
-get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out,
- const OnigCodePoint* ranges[], OnigEncoding enc ARG_UNUSED)
-{
- *sb_out = 0x80;
- return onigenc_unicode_ctype_code_range(ctype, ranges);
-}
-
-
-static UChar*
-left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc ARG_UNUSED)
-{
- const UChar *p;
-
- if (s <= start) return (UChar* )s;
- p = s;
-
- while (!utf8_islead(*p) && p > start) p--;
- return (UChar* )p;
-}
-
-static int
-get_case_fold_codes_by_str(OnigCaseFoldType flag,
- const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[],
- OnigEncoding enc)
-{
- return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items);
-}
-
-OnigEncodingDefine(cesu_8, CESU_8) = {
- mbc_enc_len,
- "CESU-8", /* name */
- 6, /* max byte length */
- 1, /* min byte length */
- is_mbc_newline,
- mbc_to_code,
- code_to_mbclen,
- code_to_mbc,
- mbc_case_fold,
- onigenc_unicode_apply_all_case_fold,
- get_case_fold_codes_by_str,
- onigenc_unicode_property_name_to_ctype,
- onigenc_unicode_is_code_ctype,
- get_ctype_code_range,
- left_adjust_char_head,
- onigenc_always_true_is_allowed_reverse_match,
- onigenc_unicode_case_map,
- ENCINDEX_UTF_8,
- ONIGENC_FLAG_UNICODE,
-};
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 0fffcc273f..9bbbe5c81e 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,21 +74,8 @@ $(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 "$@" "$<"
@@ -108,11 +89,7 @@ enc/<%=e%>.$(OBJEXT): <%=deps.map {|n| rule_subst % n}.join(' ')%>
% 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 +116,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 +132,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,7 +148,7 @@ 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%>
@@ -178,214 +157,208 @@ clean-srcs:
<%# 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/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/cesu_8.$(OBJEXT): $(top_srcdir)/encindex.h
-enc/cesu_8.$(OBJEXT): $(top_srcdir)/regenc.h
-enc/cesu_8.$(OBJEXT): config.h
-enc/cesu_8.$(OBJEXT): defines.h
-enc/cesu_8.$(OBJEXT): enc/cesu_8.c
-enc/cesu_8.$(OBJEXT): missing.h
-enc/cesu_8.$(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): 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/encdb.$(OBJEXT): $(hdrdir)/ruby.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): assert.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): oniguruma.h
enc/encdb.$(OBJEXT): st.h
enc/encdb.$(OBJEXT): subst.h
+enc/euc_jp.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/euc_jp.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/euc_jp.$(OBJEXT): $(top_srcdir)/regint.h
enc/euc_jp.$(OBJEXT): config.h
enc/euc_jp.$(OBJEXT): defines.h
enc/euc_jp.$(OBJEXT): enc/euc_jp.c
enc/euc_jp.$(OBJEXT): enc/jis/props.h
enc/euc_jp.$(OBJEXT): enc/jis/props.kwd
+enc/euc_jp.$(OBJEXT): intern.h
enc/euc_jp.$(OBJEXT): missing.h
-enc/euc_jp.$(OBJEXT): 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): 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): 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): enc/shift_jis.h
+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): assert.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
@@ -393,21 +366,8 @@ 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/cesu_8.$(OBJEXT): $(hdrdir)/ruby/ruby.h
-enc/trans/cesu_8.$(OBJEXT): $(top_srcdir)/transcode_data.h
-enc/trans/cesu_8.$(OBJEXT): assert.h
-enc/trans/cesu_8.$(OBJEXT): backward.h
-enc/trans/cesu_8.$(OBJEXT): config.h
-enc/trans/cesu_8.$(OBJEXT): defines.h
-enc/trans/cesu_8.$(OBJEXT): enc/trans/cesu_8.c
-enc/trans/cesu_8.$(OBJEXT): intern.h
-enc/trans/cesu_8.$(OBJEXT): missing.h
-enc/trans/cesu_8.$(OBJEXT): st.h
-enc/trans/cesu_8.$(OBJEXT): subst.h
enc/trans/chinese.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/trans/chinese.$(OBJEXT): $(top_srcdir)/transcode_data.h
-enc/trans/chinese.$(OBJEXT): assert.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
@@ -415,21 +375,8 @@ 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): assert.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): assert.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
@@ -439,8 +386,6 @@ 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): assert.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
@@ -450,8 +395,6 @@ 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): assert.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
@@ -461,8 +404,6 @@ 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): assert.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
@@ -472,8 +413,6 @@ 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): assert.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
@@ -483,8 +422,6 @@ 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): assert.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
@@ -494,8 +431,6 @@ 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): assert.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
@@ -505,8 +440,6 @@ 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): assert.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
@@ -516,8 +449,6 @@ 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): assert.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
@@ -527,8 +458,6 @@ 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): assert.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
@@ -538,8 +467,6 @@ 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): assert.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
@@ -549,8 +476,6 @@ 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): assert.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
@@ -560,8 +485,6 @@ 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): assert.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
@@ -569,20 +492,8 @@ 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): assert.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): assert.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
@@ -594,8 +505,6 @@ 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): assert.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
@@ -605,8 +514,6 @@ 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): assert.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
@@ -614,109 +521,48 @@ 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): assert.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): 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/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_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/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/utf_32le.$(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_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_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_1251.$(OBJEXT): oniguruma.h
+enc/windows_31j.$(OBJEXT): $(hdrdir)/ruby/ruby.h
enc/windows_31j.$(OBJEXT): $(top_srcdir)/regenc.h
+enc/windows_31j.$(OBJEXT): $(top_srcdir)/regint.h
enc/windows_31j.$(OBJEXT): config.h
enc/windows_31j.$(OBJEXT): defines.h
enc/windows_31j.$(OBJEXT): enc/jis/props.h
enc/windows_31j.$(OBJEXT): enc/jis/props.kwd
-enc/windows_31j.$(OBJEXT): enc/shift_jis.h
+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/euc_jp.c b/enc/euc_jp.c
index ded051af69..e4d3b70167 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)
@@ -503,9 +503,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 +576,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/gb2312.c b/enc/gb2312.c
index 20c8f5b7cc..6fc15735fc 100644
--- a/enc/gb2312.c
+++ b/enc/gb2312.c
@@ -1,11 +1,13 @@
+#include <ruby/ruby.h>
+#include <ruby/encoding.h>
#include "regenc.h"
void
Init_gb2312(void)
{
+ rb_enc_register("GB2312", rb_enc_find("EUC-KR"));
}
-ENC_REPLICATE("GB2312", "EUC-KR")
ENC_ALIAS("EUC-CN", "GB2312")
ENC_ALIAS("eucCN", "GB2312")
ENC_REPLICATE("GB12345", "GB2312")
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..e3315876cd 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,7 +271,6 @@ 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,
};
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..5607013c80 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;
}
@@ -162,7 +161,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
{ 0xa8, 0xb8 },
{ 0xaa, 0xba },
{ 0xaf, 0xbf },
-
+
{ 0xc0, 0xe0 },
{ 0xc1, 0xe1 },
{ 0xc2, 0xe2 },
@@ -208,63 +207,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 +233,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..9302e62fc1 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,7 +236,6 @@ 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,
};
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..6a74406303 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;
}
@@ -223,56 +222,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 +239,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 bc0597e3f4..6ea2213686 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}"}
@@ -121,11 +107,7 @@ ENCS, ENC_DEPS = target_encodings
ATRANS, TRANS = target_transcoders
if File.exist?(depend = File.join($srcdir, "depend"))
- if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
- erb = ERB.new(File.read(depend), trim_mode: '%')
- else
- erb = ERB.new(File.read(depend), nil, '%')
- end
+ erb = ERB.new(File.read(depend), nil, '%')
erb.filename = depend
tmp = erb.result(binding)
dep = "\n#### depend ####\n\n" << depend_rules(tmp).join
@@ -139,11 +121,7 @@ open(ARGV[0], 'wb') {|f|
}
if MODULE_TYPE == :static
filename = "encinit.c.erb"
- if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
- erb = ERB.new(File.read(File.join($srcdir, filename)), trim_mode: '%-')
- else
- erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')
- end
+ erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')
erb.filename = "enc/#{filename}"
tmp = erb.result(binding)
begin
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..be7c0c9445
--- /dev/null
+++ b/enc/prelude.rb
@@ -0,0 +1,4 @@
+begin
+ require 'unicode_normalize'
+rescue LoadError
+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, 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, 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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, 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 O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, 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/JISX0212%UCS.src b/enc/trans/JIS/JISX0212%UCS.src
index 0e1ab4c9b9..aa51257b99 100644
--- a/enc/trans/JIS/JISX0212%UCS.src
+++ b/enc/trans/JIS/JISX0212%UCS.src
@@ -67,7 +67,7 @@ BEGIN_MAP
#
# However, JIS X 0212 maintains the distinction between
# the lowercase forms of these two elements at 0x2942 and 0x2943.
-# Given the structure of these JIS encodings, it is clear that
+# Given the structre of these JIS encodings, it is clear that
# 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.
diff --git a/enc/trans/JIS/UCS%JISX0212.src b/enc/trans/JIS/UCS%JISX0212.src
index c7711c8ac0..65383a1c9f 100644
--- a/enc/trans/JIS/UCS%JISX0212.src
+++ b/enc/trans/JIS/UCS%JISX0212.src
@@ -67,7 +67,7 @@ BEGIN_MAP
#
# However, JIS X 0212 maintains the distinction between
# the lowercase forms of these two elements at 0x2942 and 0x2943.
-# Given the structure of these JIS encodings, it is clear that
+# Given the structre of these JIS encodings, it is clear that
# 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.
diff --git a/enc/trans/cesu_8.trans b/enc/trans/cesu_8.trans
deleted file mode 100644
index 4e17b1ddbb..0000000000
--- a/enc/trans/cesu_8.trans
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "transcode_data.h"
-
-<%
- map = {}
- map["{00-7f}"] = :nomap
- map["{c2-df}{80-bf}"] = :nomap
- map["e0{a0-bf}{80-bf}"] = :nomap
- map["{e1-ec}{80-bf}{80-bf}"] = :nomap
- map["ed{80-9f}{80-bf}"] = :nomap
- map["{ee-ef}{80-bf}{80-bf}"] = :nomap
- map["ed{a0-af}{80-bf}ed{b0-bf}{80-bf}"] = :func_so # surrogate pairs
- transcode_generate_node(ActionMap.parse(map), "from_CESU_8")
-
- map = {}
- map["{00-7f}"] = :nomap
- map["{c2-df}{80-bf}"] = :nomap
- map["e0{a0-bf}{80-bf}"] = :nomap
- map["{e1-ec}{80-bf}{80-bf}"] = :nomap
- map["ed{80-9f}{80-bf}"] = :nomap
- map["{ee-ef}{80-bf}{80-bf}"] = :nomap
- map["f0{90-bf}{80-bf}{80-bf}"] = :func_so # planes 1-3
- map["{f1-f3}{80-bf}{80-bf}{80-bf}"] = :func_so # planes 4-15
- map["f4{80-8f}{80-bf}{80-bf}"] = :func_so # plane 16
- transcode_generate_node(ActionMap.parse(map), "to_CESU_8")
-%>
-
-<%= transcode_generated_code %>
-
-static ssize_t
-fun_so_from_cesu_8(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- unsigned int scalar = ( ((s[1]&0x0F)<<16) | ((s[2]&0x3F)<<10)
- | ((s[4]&0x0F)<< 6) | (s[5]&0x3F)
- ) + 0x10000;
- o[0] = 0xF0 | (scalar>>18);
- o[1] = 0x80 | ((scalar>>12)&0x3F);
- o[2] = 0x80 | ((scalar>> 6)&0x3F);
- o[3] = 0x80 | ( scalar &0x3F);
- return 4;
-}
-
-static ssize_t
-fun_so_to_cesu_8(void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
-{
- unsigned int scalar = ((s[0]&0x07)<<18) | ((s[1]&0x3F)<<12)
- | ((s[2]&0x3F)<< 6) | (s[3]&0x3F);
- scalar -= 0x10000;
- o[0] = 0xED;
- o[1] = 0xA0 | (scalar>>16);
- o[2] = 0x80 | ((scalar>>10)&0x3F);
- o[3] = 0xED;
- o[4] = 0xB0 | ((scalar>> 6)&0x0F);
- o[5] = 0x80 | (scalar &0x3F);
- return 6;
-}
-
-static const rb_transcoder
-rb_from_CESU_8 = {
- "CESU-8", "UTF-8", from_CESU_8,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 6, /* max_input */
- 4, /* max_output */
- asciicompat_decoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_from_cesu_8
-};
-
-static const rb_transcoder
-rb_to_CESU_8 = {
- "UTF-8", "CESU-8", to_CESU_8,
- TRANSCODE_TABLE_INFO,
- 1, /* input_unit_length */
- 4, /* max_input */
- 6, /* max_output */
- asciicompat_encoder, /* asciicompat_type */
- 0, NULL, NULL, /* state_size, state_init, state_fini */
- NULL, NULL, NULL, fun_so_to_cesu_8
-};
-
-TRANS_INIT(cesu_8)
-{
- rb_register_transcoder(&rb_from_CESU_8);
- rb_register_transcoder(&rb_to_CESU_8);
-}
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 6e8c3d8816..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,167 +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';
- code += '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) && code>=0x1C90 && code<=0x1CBF) { /* Georgian MTAVRULI */
- MODIFIED;
- code += 0x10D0 - 0x1C90;
- }
- else 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 */
- 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 */
- 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);
-}
-
-#if 0
-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
-};
-#endif
diff --git a/enc/unicode/12.1.0/casefold.h b/enc/unicode/12.1.0/casefold.h
deleted file mode 100644
index 4c62f0faee..0000000000
--- a/enc/unicode/12.1.0/casefold.h
+++ /dev/null
@@ -1,7428 +0,0 @@
-/* DO NOT EDIT THIS FILE. */
-/* Generated by enc/unicode/case-folding.rb */
-
-#if defined ONIG_UNICODE_VERSION_STRING && !( \
- ONIG_UNICODE_VERSION_MAJOR == 12 && \
- ONIG_UNICODE_VERSION_MINOR == 1 && \
- ONIG_UNICODE_VERSION_TEENY == 0 && \
- 1)
-# error ONIG_UNICODE_VERSION_STRING mismatch
-#endif
-#define ONIG_UNICODE_VERSION_STRING "12.1.0"
-#define ONIG_UNICODE_VERSION_MAJOR 12
-#define ONIG_UNICODE_VERSION_MINOR 1
-#define ONIG_UNICODE_VERSION_TEENY 0
-
-static const CaseFold_11_Type CaseFold_11_Table[] = {
-#define CaseFold (*(CaseFold_11_Type (*)[1485])(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}}},
- {0x1c90, {1|F|D, {0x10d0}}},
- {0x1c91, {1|F|D, {0x10d1}}},
- {0x1c92, {1|F|D, {0x10d2}}},
- {0x1c93, {1|F|D, {0x10d3}}},
- {0x1c94, {1|F|D, {0x10d4}}},
- {0x1c95, {1|F|D, {0x10d5}}},
- {0x1c96, {1|F|D, {0x10d6}}},
- {0x1c97, {1|F|D, {0x10d7}}},
- {0x1c98, {1|F|D, {0x10d8}}},
- {0x1c99, {1|F|D, {0x10d9}}},
- {0x1c9a, {1|F|D, {0x10da}}},
- {0x1c9b, {1|F|D, {0x10db}}},
- {0x1c9c, {1|F|D, {0x10dc}}},
- {0x1c9d, {1|F|D, {0x10dd}}},
- {0x1c9e, {1|F|D, {0x10de}}},
- {0x1c9f, {1|F|D, {0x10df}}},
- {0x1ca0, {1|F|D, {0x10e0}}},
- {0x1ca1, {1|F|D, {0x10e1}}},
- {0x1ca2, {1|F|D, {0x10e2}}},
- {0x1ca3, {1|F|D, {0x10e3}}},
- {0x1ca4, {1|F|D, {0x10e4}}},
- {0x1ca5, {1|F|D, {0x10e5}}},
- {0x1ca6, {1|F|D, {0x10e6}}},
- {0x1ca7, {1|F|D, {0x10e7}}},
- {0x1ca8, {1|F|D, {0x10e8}}},
- {0x1ca9, {1|F|D, {0x10e9}}},
- {0x1caa, {1|F|D, {0x10ea}}},
- {0x1cab, {1|F|D, {0x10eb}}},
- {0x1cac, {1|F|D, {0x10ec}}},
- {0x1cad, {1|F|D, {0x10ed}}},
- {0x1cae, {1|F|D, {0x10ee}}},
- {0x1caf, {1|F|D, {0x10ef}}},
- {0x1cb0, {1|F|D, {0x10f0}}},
- {0x1cb1, {1|F|D, {0x10f1}}},
- {0x1cb2, {1|F|D, {0x10f2}}},
- {0x1cb3, {1|F|D, {0x10f3}}},
- {0x1cb4, {1|F|D, {0x10f4}}},
- {0x1cb5, {1|F|D, {0x10f5}}},
- {0x1cb6, {1|F|D, {0x10f6}}},
- {0x1cb7, {1|F|D, {0x10f7}}},
- {0x1cb8, {1|F|D, {0x10f8}}},
- {0x1cb9, {1|F|D, {0x10f9}}},
- {0x1cba, {1|F|D, {0x10fa}}},
- {0x1cbd, {1|F|D, {0x10fd}}},
- {0x1cbe, {1|F|D, {0x10fe}}},
- {0x1cbf, {1|F|D, {0x10ff}}},
- {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}}},
- {0xa7b8, {1|F|D, {0xa7b9}}},
- {0xa7ba, {1|F|D, {0xa7bb}}},
- {0xa7bc, {1|F|D, {0xa7bd}}},
- {0xa7be, {1|F|D, {0xa7bf}}},
- {0xa7c2, {1|F|D, {0xa7c3}}},
- {0xa7c4, {1|F|D, {0xa794}}},
- {0xa7c5, {1|F|D, {0x0282}}},
- {0xa7c6, {1|F|D, {0x1d8e}}},
- {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}}},
- {0x16e40, {1|F|D, {0x16e60}}},
- {0x16e41, {1|F|D, {0x16e61}}},
- {0x16e42, {1|F|D, {0x16e62}}},
- {0x16e43, {1|F|D, {0x16e63}}},
- {0x16e44, {1|F|D, {0x16e64}}},
- {0x16e45, {1|F|D, {0x16e65}}},
- {0x16e46, {1|F|D, {0x16e66}}},
- {0x16e47, {1|F|D, {0x16e67}}},
- {0x16e48, {1|F|D, {0x16e68}}},
- {0x16e49, {1|F|D, {0x16e69}}},
- {0x16e4a, {1|F|D, {0x16e6a}}},
- {0x16e4b, {1|F|D, {0x16e6b}}},
- {0x16e4c, {1|F|D, {0x16e6c}}},
- {0x16e4d, {1|F|D, {0x16e6d}}},
- {0x16e4e, {1|F|D, {0x16e6e}}},
- {0x16e4f, {1|F|D, {0x16e6f}}},
- {0x16e50, {1|F|D, {0x16e70}}},
- {0x16e51, {1|F|D, {0x16e71}}},
- {0x16e52, {1|F|D, {0x16e72}}},
- {0x16e53, {1|F|D, {0x16e73}}},
- {0x16e54, {1|F|D, {0x16e74}}},
- {0x16e55, {1|F|D, {0x16e75}}},
- {0x16e56, {1|F|D, {0x16e76}}},
- {0x16e57, {1|F|D, {0x16e77}}},
- {0x16e58, {1|F|D, {0x16e78}}},
- {0x16e59, {1|F|D, {0x16e79}}},
- {0x16e5a, {1|F|D, {0x16e7a}}},
- {0x16e5b, {1|F|D, {0x16e7b}}},
- {0x16e5c, {1|F|D, {0x16e7c}}},
- {0x16e5d, {1|F|D, {0x16e7d}}},
- {0x16e5e, {1|F|D, {0x16e7e}}},
- {0x16e5f, {1|F|D, {0x16e7f}}},
- {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+1485))
- {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 = 3500, 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[] =
- {
- 5, 273, 4, 8, 3, 1, 86, 9, 2, 289,
- 290, 3, 3510, 3510, 3510, 3510, 3510, 3510, 3510, 3510,
- 3510, 3510, 3510, 3510, 3510, 50, 3510, 3510, 3510, 3510,
- 3510, 3510, 3510, 225, 3510, 3510, 3510, 3510, 3510, 28,
- 3510, 3510, 3510, 3510, 3510, 3510, 3510, 3510, 3510, 394,
- 3510, 3510, 3510, 3510, 3510, 3510, 3510, 47, 3510, 3510,
- 255, 40, 286, 1, 3510, 3510, 599, 8, 3510, 3510,
- 3510, 3510, 3510, 282, 3510, 3510, 267, 667, 473, 39,
- 2019, 189, 47, 175, 2001, 107, 1626, 6, 12, 25,
- 1961, 678, 1128, 526, 1945, 148, 1923, 371, 1720, 134,
- 1857, 80, 1375, 66, 1705, 300, 1635, 445, 1611, 472,
- 1795, 216, 1303, 499, 1552, 270, 1511, 243, 121, 619,
- 1284, 540, 875, 592, 1484, 567, 412, 703, 1692, 387,
- 1782, 781, 1767, 664, 1718, 648, 1316, 608, 1647, 715,
- 1592, 771, 1544, 1029, 1563, 887, 1296, 861, 1194, 978,
- 95, 899, 1257, 835, 1335, 765, 1529, 984, 862, 938,
- 1460, 759, 329, 1079, 1159, 940, 234, 1101, 1204, 990,
- 949, 1493, 92, 1438, 77, 1391, 7, 1073, 44, 1377,
- 2, 1435, 4, 1321, 428, 1274, 332, 1206, 11, 1426,
- 46, 478, 200, 1502, 31, 1400, 153, 1663, 352, 1820,
- 229, 1733, 265, 1405, 315, 1879, 198
- };
- return asso_values[bits_of(code, 2)+79] + asso_values[bits_of(code, 1)] + 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 = 1487,
- MIN_WORD_LENGTH = 3,
- MAX_WORD_LENGTH = 3,
- MIN_HASH_VALUE = 10,
- MAX_HASH_VALUE = 3509
- };
-
- static const short wordlist[] =
- {
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x1fe7*/ 848,
- /*0x10408*/ 1268,
- /*0x1f88*/ 775,
- /*0x0408*/ 305,
- /*0x0208*/ 194,
- /*0x0108*/ 61,
- /*0xab88*/ 1166,
- /*0x10409*/ 1269,
- /*0x1f89*/ 776,
- /*0x0409*/ 306,
- /*0x0388*/ 235,
- /*0x2c67*/ 962,
- /*0xab89*/ 1167,
- /*0x2c08*/ 919,
- -1,
- /*0x0189*/ 126,
- /*0x0389*/ 236,
- -1,
- /*0x2c6d*/ 965,
- /*0x2c09*/ 920,
- /*0x1040a*/ 1270,
- /*0x1f8a*/ 777,
- /*0x040a*/ 307,
- /*0x020a*/ 195,
- /*0x010a*/ 62,
- /*0xab8a*/ 1168,
- /*0x2c88*/ 977,
- /*0x1ff3*/ 855,
- /*0x018a*/ 127,
- /*0x038a*/ 237,
- -1,
- /*0x2ced*/ 1024,
- /*0x2c0a*/ 921,
- -1,
- /*0x10400*/ 1260,
- /*0x1f80*/ 767,
- /*0x0400*/ 297,
- /*0x0200*/ 190,
- /*0x0100*/ 57,
- /*0xab80*/ 1158,
- /*0x1fe3*/ 845,
- /*0x1e88*/ 653,
- /*0x10403*/ 1263,
- /*0x1f83*/ 770,
- /*0x0403*/ 300,
- /*0x2c8a*/ 978,
- /*0x2c00*/ 911,
- /*0xab83*/ 1161,
- /*0x1c88*/ 538,
- /*0x10c88*/ 1344,
- /*0x2183*/ 884,
- /*0x2c63*/ 960,
- /*0x1e908*/ 1459,
- /*0x2c6f*/ 967,
- /*0x2c03*/ 914,
- /*0x10c89*/ 1345,
- -1, -1,
- /*0x1e909*/ 1460,
- /*0x2c80*/ 973,
- /*0x1e8a*/ 654,
- /*0x10418*/ 1284,
- /*0x1f98*/ 791,
- /*0x0418*/ 321,
- /*0x0218*/ 202,
- /*0x0118*/ 69,
- /*0xab98*/ 1182,
- -1,
- /*0x10c8a*/ 1346,
- /*0x0198*/ 137,
- /*0x0398*/ 249,
- /*0x1e90a*/ 1461,
- /*0xa780*/ 1105,
- /*0x2c18*/ 935,
- /*0x1e80*/ 649,
- /*0x10416*/ 1282,
- /*0x1f96*/ 789,
- /*0x0416*/ 319,
- /*0x0216*/ 201,
- /*0x0116*/ 68,
- /*0xab96*/ 1180,
- /*0x1c80*/ 530,
- /*0x10c80*/ 1336,
- /*0x0196*/ 135,
- /*0x0396*/ 247,
- /*0x1e900*/ 1451,
- /*0x2c98*/ 985,
- /*0x2c16*/ 933,
- -1,
- /*0x1c83*/ 533,
- /*0x10c83*/ 1339,
- /*0x1fc7*/ 830,
- -1,
- /*0x1e903*/ 1454,
- /*0x0147*/ 91,
- /*0x0047*/ 6,
- -1, -1,
- /*0x01c7*/ 159,
- /*0xa798*/ 1114,
- /*0x2c96*/ 984,
- /*0x1e98*/ 662,
- /*0x10406*/ 1266,
- /*0x1f86*/ 773,
- /*0x0406*/ 303,
- /*0x0206*/ 193,
- /*0x0106*/ 60,
- /*0xab86*/ 1164,
- /*0x1c98*/ 547,
- /*0x10c98*/ 1360,
- /*0x0186*/ 124,
- /*0x0386*/ 234,
- /*0x1e918*/ 1475,
- /*0xa796*/ 1113,
- /*0x2c06*/ 917,
- /*0x1e96*/ 660,
- /*0x10427*/ 1299,
- /*0x1fa7*/ 806,
- /*0x0427*/ 336,
- -1, -1,
- /*0xaba7*/ 1197,
- /*0x1c96*/ 545,
- /*0x10c96*/ 1358,
- /*0x01a7*/ 145,
- /*0x03a7*/ 263,
- /*0x1e916*/ 1473,
- /*0x2c86*/ 976,
- /*0x2c27*/ 950,
- /*0x10414*/ 1280,
- /*0x1f94*/ 787,
- /*0x0414*/ 317,
- /*0x0214*/ 200,
- /*0x0114*/ 67,
- /*0xab94*/ 1178,
- -1, -1,
- /*0x0194*/ 134,
- /*0x0394*/ 245,
- -1,
- /*0xa786*/ 1108,
- /*0x2c14*/ 931,
- /*0x1e86*/ 652,
- /*0x10410*/ 1276,
- /*0x1f90*/ 783,
- /*0x0410*/ 313,
- /*0x0210*/ 198,
- /*0x0110*/ 65,
- /*0xab90*/ 1174,
- /*0x1c86*/ 536,
- /*0x10c86*/ 1342,
- /*0x0190*/ 131,
- /*0x0390*/ 241,
- /*0x1e906*/ 1457,
- /*0x2c94*/ 983,
- /*0x2c10*/ 927,
- -1,
- /*0x03f5*/ 290,
- /*0xfb00*/ 1222,
- -1,
- /*0x2c75*/ 970,
- -1, -1,
- /*0x1ca7*/ 562,
- /*0x10ca7*/ 1375,
- -1,
- /*0xfb03*/ 1225,
- -1,
- /*0x2c90*/ 981,
- /*0x1e94*/ 659,
- /*0x10404*/ 1264,
- /*0x1f84*/ 771,
- /*0x0404*/ 301,
- /*0x0204*/ 192,
- /*0x0104*/ 59,
- /*0xab84*/ 1162,
- /*0x1c94*/ 543,
- /*0x10c94*/ 1356,
- /*0x0184*/ 123,
- -1,
- /*0x1e914*/ 1471,
- /*0xa790*/ 1111,
- /*0x2c04*/ 915,
- /*0x1e90*/ 657,
- /*0x10402*/ 1262,
- /*0x1f82*/ 769,
- /*0x0402*/ 299,
- /*0x0202*/ 191,
- /*0x0102*/ 58,
- /*0xab82*/ 1160,
- /*0x1c90*/ 539,
- /*0x10c90*/ 1352,
- /*0x0182*/ 122,
- -1,
- /*0x1e910*/ 1467,
- /*0x2c84*/ 975,
- /*0x2c02*/ 913,
- /*0x017f*/ 120,
- -1,
- /*0xfb16*/ 1232,
- -1, -1,
- /*0x03ff*/ 296,
- /*0x01f1*/ 181,
- /*0x03f1*/ 288,
- /*0x2c7f*/ 972,
- -1, -1,
- /*0xa784*/ 1107,
- /*0x2c82*/ 974,
- /*0x1e84*/ 651,
- /*0x10420*/ 1292,
- /*0x1fa0*/ 799,
- /*0x0420*/ 329,
- /*0x0220*/ 206,
- /*0x0120*/ 73,
- /*0xaba0*/ 1190,
- /*0x1c84*/ 534,
- /*0x10c84*/ 1340,
- /*0x01a0*/ 141,
- /*0x03a0*/ 257,
- /*0x1e904*/ 1455,
- /*0xa782*/ 1106,
- /*0x2c20*/ 943,
- /*0x1e82*/ 650,
- /*0x1ff9*/ 860,
- /*0xfb06*/ 1228,
- -1,
- /*0x0179*/ 117,
- -1,
- /*0x1fd7*/ 839,
- /*0x1c82*/ 532,
- /*0x10c82*/ 1338,
- /*0x03f9*/ 292,
- /*0x0057*/ 21,
- /*0x1e902*/ 1453,
- /*0x2ca0*/ 989,
- /*0x01d7*/ 168,
- /*0x10426*/ 1298,
- /*0x1fa6*/ 805,
- /*0x0426*/ 335,
- /*0x0226*/ 209,
- /*0x0126*/ 76,
- /*0xaba6*/ 1196,
- -1, -1,
- /*0x01a6*/ 144,
- /*0x03a6*/ 262,
- -1,
- /*0xa7a0*/ 1118,
- /*0x2c26*/ 949,
- /*0x1ea0*/ 667,
- /*0x13f9*/ 525,
- /*0xfb14*/ 1230,
- -1, -1,
- /*0x1e08*/ 589,
- -1,
- /*0x1ca0*/ 555,
- /*0x10ca0*/ 1368,
- -1,
- /*0x1ffb*/ 862,
- /*0x1e920*/ 1483,
- /*0x2ca6*/ 992,
- /*0x017b*/ 118,
- /*0x10424*/ 1296,
- /*0x1fa4*/ 803,
- /*0x0424*/ 333,
- /*0x0224*/ 208,
- /*0x0124*/ 75,
- /*0xaba4*/ 1194,
- -1, -1,
- /*0x01a4*/ 143,
- /*0x03a4*/ 260,
- /*0x1e0a*/ 590,
- /*0xa7a6*/ 1121,
- /*0x2c24*/ 947,
- /*0x1ea6*/ 670,
- /*0x037f*/ 233,
- -1, -1, -1, -1, -1,
- /*0x1ca6*/ 561,
- /*0x10ca6*/ 1374,
- /*0x1f08*/ 715,
- /*0x13fb*/ 527,
- /*0x1e00*/ 585,
- /*0x2ca4*/ 991,
- /*0x0508*/ 425,
- /*0x1f6d*/ 764,
- /*0x1f09*/ 716,
- /*0xfb04*/ 1226,
- /*0x1041a*/ 1286,
- /*0x1f9a*/ 793,
- /*0x041a*/ 323,
- /*0x021a*/ 203,
- /*0x011a*/ 70,
- /*0xab9a*/ 1184,
- -1, -1,
- /*0xa7a4*/ 1120,
- /*0x039a*/ 251,
- /*0x1ea4*/ 669,
- /*0x1f0a*/ 717,
- /*0x2c1a*/ 937,
- /*0xfb02*/ 1224,
- /*0x048a*/ 362,
- /*0x050a*/ 426,
- -1,
- /*0x1ca4*/ 559,
- /*0x10ca4*/ 1372,
- /*0x017d*/ 119,
- /*0x10c7*/ 522,
- /*0x1e18*/ 597,
- -1, -1,
- /*0x03fd*/ 294,
- /*0x2c9a*/ 986,
- -1, -1,
- /*0x0480*/ 361,
- /*0x0500*/ 421,
- /*0x1fd3*/ 837,
- -1,
- /*0x1f6f*/ 766,
- /*0x1feb*/ 852,
- /*0x0053*/ 17,
- /*0x1e16*/ 596,
- -1,
- /*0x01d3*/ 166,
- /*0xa79a*/ 1115,
- -1,
- /*0x1e9a*/ 664,
- -1, -1,
- /*0x13fd*/ 529,
- /*0x2c6b*/ 964,
- -1,
- /*0x10a7*/ 491,
- /*0x1c9a*/ 549,
- /*0x10c9a*/ 1362,
- -1,
- /*0x00df*/ 56,
- /*0x1e91a*/ 1477,
- /*0x1f18*/ 723,
- /*0x1ff7*/ 858,
- -1,
- /*0x0498*/ 369,
- /*0x0518*/ 433,
- /*0x2ceb*/ 1023,
- -1, -1,
- /*0x01f7*/ 185,
- /*0x03f7*/ 291,
- /*0x1e06*/ 588,
- /*0x1f5f*/ 758,
- -1,
- /*0x00dd*/ 54,
- -1, -1,
- /*0x00c7*/ 33,
- /*0x0496*/ 368,
- /*0x0516*/ 432,
- /*0x10412*/ 1278,
- /*0x1f92*/ 785,
- /*0x0412*/ 315,
- /*0x0212*/ 199,
- /*0x0112*/ 66,
- /*0xab92*/ 1176,
- /*0x24c7*/ 902,
- /*0x1f5d*/ 757,
- -1,
- /*0x0392*/ 243,
- -1,
- /*0x104c7*/ 1323,
- /*0x2c12*/ 929,
- /*0x04c7*/ 393,
- /*0x0547*/ 467,
- -1, -1,
- /*0x1fb2*/ 815,
- /*0x1e14*/ 595,
- /*0x0232*/ 215,
- /*0x0132*/ 81,
- /*0xabb2*/ 1208,
- -1, -1,
- /*0x01b2*/ 151,
- /*0x2c92*/ 982,
- /*0x0506*/ 424,
- -1, -1, -1, -1, -1,
- /*0x1e10*/ 593,
- -1, -1, -1, -1, -1,
- /*0xa792*/ 1112,
- -1,
- /*0x1e92*/ 658,
- /*0x2cb2*/ 998,
- /*0x1faf*/ 814,
- /*0x042f*/ 344,
- -1, -1,
- /*0xabaf*/ 1205,
- /*0x1c92*/ 541,
- /*0x10c92*/ 1354,
- /*0x01af*/ 149,
- -1,
- /*0x1e912*/ 1469,
- /*0x0494*/ 367,
- /*0x0514*/ 431,
- /*0xa7b2*/ 1130,
- -1,
- /*0x1eb2*/ 676,
- -1,
- /*0x1fe9*/ 850,
- /*0x1e04*/ 587,
- -1, -1, -1,
- /*0x1cb2*/ 573,
- /*0x10cb2*/ 1386,
- -1,
- /*0x0490*/ 365,
- /*0x0510*/ 429,
- -1,
- /*0x2c69*/ 963,
- /*0x10a0*/ 484,
- -1, -1,
- /*0x1e02*/ 586,
- /*0x1041c*/ 1288,
- /*0x1f9c*/ 795,
- /*0x041c*/ 325,
- /*0x021c*/ 204,
- /*0x011c*/ 71,
- /*0xab9c*/ 1186,
- -1, -1,
- /*0x019c*/ 138,
- /*0x039c*/ 253,
- -1, -1,
- /*0x2c1c*/ 939,
- -1,
- /*0x1caf*/ 570,
- /*0x10caf*/ 1383,
- -1, -1, -1, -1,
- /*0x0504*/ 423,
- -1, -1,
- /*0x10a6*/ 490,
- -1,
- /*0x2c9c*/ 987,
- /*0x1e20*/ 601,
- /*0x1041e*/ 1290,
- /*0x1f9e*/ 797,
- /*0x041e*/ 327,
- /*0x021e*/ 205,
- /*0x011e*/ 72,
- /*0xab9e*/ 1188,
- -1,
- /*0x0502*/ 422,
- /*0x0470*/ 353,
- /*0x039e*/ 255,
- /*0x0170*/ 112,
- /*0xa79c*/ 1116,
- /*0x2c1e*/ 941,
- -1,
- /*0x01f0*/ 180,
- /*0x03f0*/ 287,
- -1, -1,
- /*0x2c70*/ 968,
- -1,
- /*0x1c9c*/ 551,
- /*0x10c9c*/ 1364,
- -1,
- /*0x10a4*/ 488,
- /*0x1e91c*/ 1479,
- /*0x2c9e*/ 988,
- /*0x1e26*/ 604,
- /*0x10422*/ 1294,
- /*0x1fa2*/ 801,
- /*0x0422*/ 331,
- /*0x0222*/ 207,
- /*0x0122*/ 74,
- /*0xaba2*/ 1192,
- /*0x04a0*/ 373,
- /*0x0520*/ 437,
- /*0x01a2*/ 142,
- -1, -1,
- /*0xa79e*/ 1117,
- /*0x2c22*/ 945,
- /*0x1e9e*/ 666,
- /*0x118a7*/ 1394,
- -1, -1, -1, -1,
- /*0x1ef0*/ 707,
- /*0x1c9e*/ 553,
- /*0x10c9e*/ 1366,
- -1, -1,
- /*0x1e91e*/ 1481,
- /*0x2ca2*/ 990,
- /*0x1e24*/ 603,
- /*0x1040e*/ 1274,
- /*0x1f8e*/ 781,
- /*0x040e*/ 311,
- /*0x020e*/ 197,
- /*0x010e*/ 64,
- /*0xab8e*/ 1172,
- /*0x04a6*/ 376,
- /*0x0526*/ 440,
- /*0x018e*/ 129,
- /*0x038e*/ 239,
- /*0xff27*/ 1240,
- /*0xa7a2*/ 1119,
- /*0x2c0e*/ 925,
- /*0x1ea2*/ 668,
- -1,
- /*0x1faa*/ 809,
- /*0x042a*/ 339,
- /*0x022a*/ 211,
- /*0x012a*/ 78,
- /*0xabaa*/ 1200,
- /*0x1ca2*/ 557,
- /*0x10ca2*/ 1370,
- -1,
- /*0x03aa*/ 266,
- -1,
- /*0x2c8e*/ 980,
- /*0x2c2a*/ 953,
- -1, -1,
- /*0x1e1a*/ 598,
- -1, -1, -1,
- /*0x04a4*/ 375,
- /*0x0524*/ 439,
- -1, -1, -1,
- /*0x0370*/ 230,
- /*0x2caa*/ 994,
- /*0x1e8e*/ 656,
- -1,
- /*0x1fae*/ 813,
- /*0x042e*/ 343,
- /*0x022e*/ 213,
- /*0x012e*/ 80,
- /*0xabae*/ 1204,
- -1,
- /*0x10c8e*/ 1350,
- /*0x01ae*/ 148,
- -1,
- /*0x1e90e*/ 1465,
- /*0xa7aa*/ 1123,
- /*0x2c2e*/ 957,
- /*0x1eaa*/ 672,
- -1, -1, -1, -1, -1,
- /*0x1f1a*/ 725,
- /*0x1caa*/ 565,
- /*0x10caa*/ 1378,
- /*0x049a*/ 370,
- /*0x051a*/ 434,
- -1,
- /*0x2cae*/ 996,
- /*0x1fac*/ 811,
- /*0x042c*/ 341,
- /*0x022c*/ 212,
- /*0x012c*/ 79,
- /*0xabac*/ 1202,
- -1, -1,
- /*0x01ac*/ 147,
- /*0x2165*/ 873,
- /*0x00d3*/ 45,
- /*0x2167*/ 875,
- /*0x2c2c*/ 955,
- /*0xa7ae*/ 1127,
- /*0x2161*/ 869,
- /*0x1eae*/ 674,
- /*0x118a0*/ 1387,
- /*0x1fba*/ 822,
- /*0x216d*/ 881,
- /*0x023a*/ 216,
- /*0x10b2*/ 502,
- /*0xabba*/ 1216,
- /*0x1cae*/ 569,
- /*0x10cae*/ 1382,
- /*0x104d3*/ 1335,
- /*0x2cac*/ 995,
- /*0x1f6b*/ 762,
- /*0x0553*/ 479,
- /*0x1fa8*/ 807,
- /*0x0428*/ 337,
- /*0x0228*/ 210,
- /*0x0128*/ 77,
- /*0xaba8*/ 1198,
- -1,
- /*0x1e12*/ 594,
- -1,
- /*0x03a8*/ 264,
- -1,
- /*0xa7ac*/ 1125,
- /*0x2c28*/ 951,
- /*0x1eac*/ 673,
- /*0x2cba*/ 1002,
- -1,
- /*0x118a6*/ 1393,
- -1,
- /*0x10af*/ 499,
- -1,
- /*0x1cac*/ 567,
- /*0x10cac*/ 1380,
- -1,
- /*0x1e32*/ 610,
- /*0x2163*/ 871,
- /*0x2ca8*/ 993,
- /*0x216f*/ 883,
- /*0xa7ba*/ 1135,
- -1,
- /*0x1eba*/ 680,
- /*0x1fb8*/ 820,
- -1, -1, -1,
- /*0xabb8*/ 1214,
- -1,
- /*0x1cba*/ 581,
- /*0x01b8*/ 155,
- /*0xa7a8*/ 1122,
- /*0xff26*/ 1239,
- /*0x1ea8*/ 671,
- /*0x0492*/ 366,
- /*0x0512*/ 430,
- /*0x118a4*/ 1391,
- -1, -1,
- /*0x1fb6*/ 818,
- /*0x1ca8*/ 563,
- /*0x10ca8*/ 1376,
- /*0x0136*/ 83,
- /*0xabb6*/ 1212,
- -1, -1,
- /*0xa688*/ 1053,
- /*0x2cb8*/ 1001,
- /*0x104b2*/ 1302,
- -1,
- /*0x04b2*/ 382,
- /*0x0532*/ 446,
- /*0x1040c*/ 1272,
- /*0x1f8c*/ 779,
- /*0x040c*/ 309,
- /*0x020c*/ 196,
- /*0x010c*/ 63,
- /*0xab8c*/ 1170,
- -1,
- /*0xff24*/ 1237,
- /*0xa7b8*/ 1134,
- /*0x038c*/ 238,
- /*0x1eb8*/ 679,
- /*0x2cb6*/ 1000,
- /*0x2c0c*/ 923,
- /*0xa68a*/ 1054,
- -1, -1, -1,
- /*0x1cb8*/ 579,
- -1, -1,
- /*0x1f2f*/ 736,
- -1,
- /*0x1e1c*/ 599,
- /*0xa779*/ 1101,
- /*0xa7b6*/ 1133,
- /*0x2c8c*/ 979,
- /*0x1eb6*/ 678,
- /*0xa680*/ 1049,
- /*0x0230*/ 214,
- /*0x0130*/ 1486,
- /*0xabb0*/ 1206,
- -1, -1,
- /*0x1cb6*/ 577,
- /*0x03b0*/ 268,
- -1,
- /*0x1f69*/ 760,
- /*0xa726*/ 1065,
- /*0x1fbc*/ 824,
- -1,
- /*0x1e8c*/ 655,
- -1,
- /*0xabbc*/ 1218,
- -1, -1,
- /*0x01bc*/ 156,
- /*0x10a2*/ 486,
- -1,
- /*0x10c8c*/ 1348,
- /*0x1e1e*/ 600,
- /*0x2cb0*/ 997,
- /*0x1e90c*/ 1463,
- -1,
- /*0x1f1c*/ 727,
- /*0xa698*/ 1061,
- /*0x1e70*/ 641,
- /*0x049c*/ 371,
- /*0x051c*/ 435,
- -1,
- /*0xa77b*/ 1102,
- -1, -1,
- /*0x2cbc*/ 1003,
- /*0xa7b0*/ 1128,
- /*0xa724*/ 1064,
- /*0x1eb0*/ 675,
- -1, -1,
- /*0xa696*/ 1060,
- -1, -1, -1,
- /*0x1cb0*/ 571,
- /*0x10cb0*/ 1384,
- -1,
- /*0xa7bc*/ 1136,
- /*0x1e22*/ 602,
- /*0x1ebc*/ 681,
- -1, -1, -1, -1,
- /*0x1fd2*/ 836,
- /*0x049e*/ 372,
- /*0x051e*/ 436,
- /*0x0152*/ 97,
- /*0x0052*/ 16,
- /*0x10aa*/ 494,
- /*0x1fcc*/ 835,
- /*0x04f0*/ 413,
- /*0x024c*/ 227,
- /*0x014c*/ 94,
- /*0x004c*/ 10,
- -1,
- /*0x1fbe*/ 825,
- /*0xa686*/ 1052,
- /*0x023e*/ 219,
- -1,
- /*0xabbe*/ 1220,
- -1, -1,
- /*0x118b2*/ 1405,
- -1,
- /*0x1e0e*/ 592,
- /*0x1fb4*/ 817,
- -1,
- /*0x2cd2*/ 1014,
- /*0x0134*/ 82,
- /*0xabb4*/ 1210,
- /*0xa77d*/ 1103,
- /*0x04a2*/ 374,
- /*0x0522*/ 438,
- /*0x2ccc*/ 1011,
- -1,
- /*0x10ae*/ 498,
- -1, -1,
- /*0x1e2a*/ 606,
- /*0x2cbe*/ 1004,
- -1, -1,
- /*0x1ed2*/ 692,
- /*0xa694*/ 1059,
- -1,
- /*0xff32*/ 1251,
- -1,
- /*0x118af*/ 1402,
- /*0x1ecc*/ 689,
- /*0x2cb4*/ 999,
- -1, -1,
- /*0xa7be*/ 1137,
- -1,
- /*0x1ebe*/ 682,
- /*0x1f0e*/ 721,
- -1,
- /*0xa690*/ 1057,
- /*0x048e*/ 364,
- /*0x050e*/ 428,
- /*0x10ac*/ 496,
- /*0x1cbe*/ 583,
- /*0xa7b4*/ 1132,
- -1,
- /*0x1eb4*/ 677,
- /*0x1e2e*/ 608,
- -1, -1, -1,
- /*0x1f2a*/ 731,
- /*0xff2f*/ 1248,
- /*0x1cb4*/ 575,
- /*0x04aa*/ 378,
- /*0x052a*/ 442,
- -1, -1,
- /*0x10ba*/ 510,
- -1, -1,
- /*0x1fca*/ 833,
- -1,
- /*0x024a*/ 226,
- /*0x014a*/ 93,
- /*0x004a*/ 8,
- /*0xa684*/ 1051,
- /*0x2126*/ 864,
- /*0x01ca*/ 161,
- /*0x10a8*/ 492,
- -1, -1,
- /*0x1e2c*/ 607,
- -1, -1, -1, -1, -1,
- /*0x1f2e*/ 735,
- -1,
- /*0xa682*/ 1050,
- /*0x04ae*/ 380,
- /*0x052e*/ 444,
- -1,
- /*0xa732*/ 1070,
- /*0x2cca*/ 1010,
- -1,
- /*0x1fc4*/ 828,
- /*0x1e3a*/ 614,
- /*0x0244*/ 222,
- -1,
- /*0x0044*/ 3,
- /*0x004f*/ 13,
- -1,
- /*0x01c4*/ 157,
- /*0x01cf*/ 164,
- /*0x03cf*/ 270,
- -1,
- /*0x10b8*/ 508,
- /*0x1e28*/ 605,
- /*0x1eca*/ 688,
- /*0x1fab*/ 810,
- /*0x042b*/ 340,
- /*0x1f2c*/ 733,
- -1,
- /*0xabab*/ 1201,
- /*0x04ac*/ 379,
- /*0x052c*/ 443,
- -1,
- /*0x03ab*/ 267,
- -1,
- /*0x2cc4*/ 1007,
- /*0x2c2b*/ 954,
- /*0x1fc2*/ 826,
- /*0x10b6*/ 506,
- /*0x24ba*/ 889,
- /*0x118a2*/ 1389,
- /*0x0042*/ 1,
- -1,
- /*0x1f3a*/ 739,
- /*0x104ba*/ 1310,
- /*0x03c2*/ 269,
- /*0x04ba*/ 386,
- /*0x053a*/ 454,
- /*0xa7c4*/ 1139,
- /*0x1fc8*/ 831,
- /*0x1ec4*/ 685,
- /*0x0248*/ 225,
- /*0x1e38*/ 613,
- /*0x0048*/ 7,
- /*0x1f28*/ 729,
- -1,
- /*0x01c8*/ 160,
- /*0x04a8*/ 377,
- /*0x0528*/ 441,
- -1, -1,
- /*0x2cc2*/ 1006,
- /*0xa7ab*/ 1124,
- /*0xff22*/ 1235,
- -1, -1, -1, -1,
- /*0x1e36*/ 612,
- -1, -1,
- /*0x1cab*/ 566,
- /*0x10cab*/ 1379,
- /*0x2cc8*/ 1009,
- /*0xa7c2*/ 1138,
- -1,
- /*0x1ec2*/ 684,
- /*0x10b0*/ 500,
- -1,
- /*0x24b8*/ 887,
- /*0x216b*/ 879,
- /*0x118aa*/ 1397,
- /*0x1e0c*/ 591,
- /*0x1f38*/ 737,
- /*0x104b8*/ 1308,
- -1,
- /*0x04b8*/ 385,
- /*0x0538*/ 452,
- /*0x1ec8*/ 687,
- /*0x10bc*/ 512,
- /*0x1fd6*/ 838,
- /*0x0150*/ 96,
- /*0x0050*/ 14,
- /*0x0156*/ 99,
- /*0x0056*/ 20,
- /*0x24b6*/ 885,
- /*0x03d0*/ 271,
- -1,
- /*0x03d6*/ 274,
- /*0x1fdb*/ 843,
- /*0x104b6*/ 1306,
- -1,
- /*0x04b6*/ 384,
- /*0x0536*/ 450,
- /*0xff2a*/ 1243,
- -1,
- /*0x01db*/ 170,
- /*0x1e30*/ 609,
- /*0x118ae*/ 1401,
- -1, -1, -1,
- /*0x2cd0*/ 1013,
- /*0x1f0c*/ 719,
- /*0x2cd6*/ 1016,
- /*0xa69a*/ 1062,
- /*0x048c*/ 363,
- /*0x050c*/ 427,
- -1,
- /*0x1e3c*/ 615,
- /*0xa722*/ 1063,
- -1, -1, -1, -1, -1, -1,
- /*0x1ed0*/ 691,
- /*0x1fc6*/ 829,
- /*0x1ed6*/ 694,
- /*0x0246*/ 224,
- /*0xff2e*/ 1247,
- /*0x0046*/ 5,
- /*0x118ac*/ 1399,
- -1,
- /*0x2132*/ 867,
- /*0x024e*/ 228,
- /*0x014e*/ 95,
- /*0x004e*/ 12,
- /*0x104b0*/ 1300,
- /*0x1fda*/ 842,
- /*0x04b0*/ 381,
- -1,
- /*0x015a*/ 101,
- /*0x005a*/ 24,
- /*0x10be*/ 514,
- /*0x24bc*/ 891,
- -1,
- /*0x03da*/ 276,
- /*0x118ba*/ 1413,
- /*0x1f3c*/ 741,
- /*0x104bc*/ 1312,
- /*0x2cc6*/ 1008,
- /*0x04bc*/ 387,
- /*0x053c*/ 456,
- /*0x10b4*/ 504,
- /*0xff2c*/ 1245,
- -1,
- /*0x2cce*/ 1012,
- -1,
- /*0x118a8*/ 1395,
- /*0xa72a*/ 1067,
- -1,
- /*0x1e52*/ 626,
- /*0x2cda*/ 1018,
- /*0xa7c6*/ 1141,
- -1,
- /*0x1ec6*/ 686,
- -1,
- /*0x1e4c*/ 623,
- -1, -1,
- /*0xff3a*/ 1259,
- /*0x1ece*/ 690,
- /*0xa652*/ 1035,
- /*0x1e3e*/ 616,
- /*0x2169*/ 877,
- -1, -1,
- /*0x1eda*/ 696,
- /*0xa64c*/ 1032,
- /*0x00d2*/ 44,
- -1,
- /*0xff28*/ 1241,
- -1,
- /*0x1e34*/ 611,
- /*0xa692*/ 1058,
- /*0x00cc*/ 38,
- /*0xa72e*/ 1069,
- /*0x118b8*/ 1411,
- -1, -1, -1, -1,
- /*0x1f52*/ 752,
- /*0x104d2*/ 1334,
- /*0x24cc*/ 907,
- /*0x04d2*/ 398,
- /*0x0552*/ 478,
- -1,
- /*0x1f4c*/ 749,
- /*0x104cc*/ 1328,
- /*0x24be*/ 893,
- /*0x2cc0*/ 1005,
- /*0x054c*/ 472,
- /*0x118b6*/ 1409,
- /*0x1f3e*/ 743,
- /*0x104be*/ 1314,
- -1,
- /*0x04be*/ 388,
- /*0x053e*/ 458,
- -1,
- /*0xff38*/ 1257,
- /*0xa72c*/ 1068,
- -1, -1, -1,
- /*0x104b4*/ 1304,
- /*0x1ec0*/ 683,
- /*0x04b4*/ 383,
- /*0x0534*/ 448,
- -1, -1,
- /*0x1fe2*/ 844,
- /*0x0462*/ 346,
- -1,
- /*0x0162*/ 105,
- -1,
- /*0xff36*/ 1255,
- /*0xa73a*/ 1074,
- /*0x01e2*/ 173,
- /*0x03e2*/ 280,
- /*0x0154*/ 98,
- /*0x0054*/ 18,
- /*0x2c62*/ 959,
- /*0x10c4*/ 520,
- -1, -1, -1,
- /*0x1e4a*/ 622,
- /*0xa728*/ 1066,
- -1, -1, -1,
- /*0x118b0*/ 1403,
- -1, -1,
- /*0x2ce2*/ 1022,
- -1,
- /*0x10ab*/ 495,
- /*0xa64a*/ 1031,
- /*0x1fd8*/ 840,
- -1,
- /*0x2cd4*/ 1015,
- /*0x0158*/ 100,
- /*0x0058*/ 22,
- /*0x118bc*/ 1415,
- /*0x00ca*/ 36,
- -1,
- /*0x03d8*/ 275,
- -1,
- /*0x10c2*/ 518,
- /*0x1ee2*/ 700,
- -1, -1,
- /*0x1e44*/ 619,
- /*0x24ca*/ 905,
- /*0xff30*/ 1249,
- /*0x1ed4*/ 693,
- /*0xa738*/ 1073,
- /*0x1f4a*/ 747,
- /*0x104ca*/ 1326,
- -1, -1,
- /*0x054a*/ 470,
- /*0x2cd8*/ 1017,
- /*0xa644*/ 1028,
- /*0x1040d*/ 1273,
- /*0x1f8d*/ 780,
- /*0x040d*/ 310,
- -1, -1,
- /*0xab8d*/ 1171,
- /*0x00c4*/ 30,
- /*0x00cf*/ 41,
- /*0xa736*/ 1072,
- -1, -1,
- /*0x212a*/ 865,
- /*0x2c0d*/ 924,
- /*0x1ed8*/ 695,
- /*0x1e42*/ 618,
- /*0x24c4*/ 899,
- /*0x24cf*/ 910,
- -1, -1, -1,
- /*0x104c4*/ 1320,
- /*0x104cf*/ 1331,
- -1,
- /*0x0544*/ 464,
- /*0x054f*/ 475,
- /*0xa642*/ 1027,
- /*0x1e48*/ 621,
- -1, -1, -1, -1, -1,
- /*0x00c2*/ 28,
- /*0x1f2b*/ 732,
- -1,
- /*0x118be*/ 1417,
- /*0x0055*/ 19,
- /*0xa648*/ 1030,
- /*0xa78d*/ 1110,
- /*0x01d5*/ 167,
- /*0x03d5*/ 273,
- /*0x24c2*/ 897,
- -1, -1,
- /*0x00c8*/ 34,
- /*0x118b4*/ 1407,
- /*0x104c2*/ 1318,
- -1,
- /*0x10c8d*/ 1349,
- /*0x0542*/ 462,
- -1,
- /*0x1e90d*/ 1464,
- -1,
- /*0x24c8*/ 903,
- -1, -1, -1,
- /*0x1f48*/ 745,
- /*0x104c8*/ 1324,
- /*0xa73c*/ 1075,
- -1,
- /*0x0548*/ 468,
- -1, -1,
- /*0xa68e*/ 1056,
- /*0x1e50*/ 625,
- -1,
- /*0x1e56*/ 628,
- /*0xff34*/ 1253,
- /*0x0245*/ 223,
- /*0x0145*/ 90,
- /*0x0045*/ 4,
- -1,
- /*0x16e5f*/ 1450,
- /*0x01c5*/ 158,
- -1,
- /*0xa650*/ 1034,
- /*0x1fd9*/ 841,
- /*0xa656*/ 1037,
- /*0x1fec*/ 853,
- /*0x046c*/ 351,
- /*0x0059*/ 23,
- /*0x016c*/ 110,
- /*0x00d0*/ 42,
- /*0x01d9*/ 169,
- /*0x00d6*/ 48,
- /*0x01ec*/ 178,
- /*0x03ec*/ 285,
- /*0x16e5d*/ 1448,
- -1, -1,
- /*0x16e47*/ 1426,
- -1, -1,
- /*0x00db*/ 52,
- -1,
- /*0x1f50*/ 751,
- /*0x104d0*/ 1332,
- /*0x1f56*/ 754,
- /*0x04d0*/ 397,
- /*0x0550*/ 476,
- /*0x04d6*/ 400,
- /*0x0556*/ 482,
- /*0xa752*/ 1086,
- /*0xa7c5*/ 1140,
- /*0x1e46*/ 620,
- -1,
- /*0x1f5b*/ 756,
- -1,
- /*0xa74c*/ 1083,
- -1,
- /*0x1e4e*/ 624,
- -1, -1, -1,
- /*0xa73e*/ 1076,
- /*0xa646*/ 1029,
- /*0x1e5a*/ 630,
- /*0x1eec*/ 705,
- -1, -1, -1,
- /*0xa64e*/ 1033,
- /*0x00c6*/ 32,
- -1,
- /*0xa734*/ 1071,
- /*0x10c0*/ 516,
- -1,
- /*0xa65a*/ 1039,
- /*0x00ce*/ 40,
- /*0x1fc9*/ 832,
- -1,
- /*0x24c6*/ 901,
- /*0x0149*/ 92,
- /*0x0049*/ 1485,
- /*0x00da*/ 51,
- -1,
- /*0x104c6*/ 1322,
- /*0x24ce*/ 909,
- /*0x118ab*/ 1398,
- /*0x0546*/ 466,
- -1, -1,
- /*0x104ce*/ 1330,
- -1, -1,
- /*0x054e*/ 474,
- /*0x1fea*/ 851,
- /*0x046a*/ 350,
- -1,
- /*0x016a*/ 109,
- /*0x04da*/ 402,
- /*0x0345*/ 229,
- -1,
- /*0x01ea*/ 177,
- /*0x03ea*/ 284,
- /*0x1e40*/ 617,
- /*0x1fa9*/ 808,
- /*0x0429*/ 338,
- -1, -1,
- /*0xaba9*/ 1199,
- /*0xff2b*/ 1244,
- -1,
- /*0x01a9*/ 146,
- /*0x03a9*/ 265,
- -1,
- /*0xa640*/ 1026,
- /*0x2c29*/ 952,
- /*0x1fc3*/ 827,
- -1,
- /*0x0243*/ 221,
- /*0x0143*/ 89,
- /*0x0043*/ 2,
- /*0x00c0*/ 26,
- /*0x10421*/ 1293,
- /*0x1fa1*/ 800,
- /*0x0421*/ 330,
- -1,
- /*0xa74a*/ 1082,
- /*0xaba1*/ 1191,
- -1, -1,
- /*0x24c0*/ 895,
- /*0x03a1*/ 258,
- -1,
- /*0x1eea*/ 704,
- /*0x2c21*/ 944,
- /*0x104c0*/ 1316,
- /*0x1fb9*/ 821,
- /*0x04c0*/ 389,
- /*0x0540*/ 460,
- /*0x0139*/ 84,
- /*0xabb9*/ 1215,
- /*0x1fe8*/ 849,
- /*0x0468*/ 349,
- -1,
- /*0x0168*/ 108,
- -1, -1,
- /*0x1e62*/ 634,
- /*0x01e8*/ 176,
- /*0x03e8*/ 283,
- /*0x1ca9*/ 564,
- /*0x10ca9*/ 1377,
- /*0xa744*/ 1079,
- /*0x1e54*/ 627,
- -1,
- /*0x1fcb*/ 834,
- -1, -1,
- /*0xa662*/ 1043,
- /*0x004b*/ 9,
- -1, -1,
- /*0x01cb*/ 162,
- /*0xa68c*/ 1055,
- /*0xa654*/ 1036,
- -1, -1, -1, -1,
- /*0x1ca1*/ 556,
- /*0x10ca1*/ 1369,
- /*0x00d4*/ 46,
- -1,
- /*0x1e921*/ 1484,
- -1,
- /*0x1e58*/ 629,
- -1,
- /*0x16e57*/ 1442,
- /*0xa742*/ 1078,
- -1,
- /*0x1ee8*/ 703,
- /*0x04e2*/ 406,
- /*0x1cb9*/ 580,
- -1,
- /*0x1f54*/ 753,
- -1,
- /*0xa658*/ 1038,
- /*0x04d4*/ 399,
- /*0x0554*/ 480,
- -1,
- /*0xa748*/ 1081,
- -1, -1,
- /*0x00d8*/ 49,
- /*0x10417*/ 1283,
- /*0x1f97*/ 790,
- /*0x0417*/ 320,
- /*0x1fe4*/ 846,
- /*0x0464*/ 347,
- /*0xab97*/ 1181,
- /*0x0164*/ 106,
- -1,
- /*0x0197*/ 136,
- /*0x0397*/ 248,
- /*0x01e4*/ 174,
- /*0x03e4*/ 281,
- /*0x2c17*/ 934,
- -1,
- /*0x2c64*/ 961,
- /*0x04d8*/ 401,
- -1, -1,
- /*0x0460*/ 345,
- -1,
- /*0x0160*/ 104,
- -1, -1, -1,
- /*0x01e0*/ 172,
- /*0x03e0*/ 279,
- /*0x1ff4*/ 856,
- /*0x0474*/ 355,
- /*0x2c60*/ 958,
- /*0x0174*/ 114,
- -1,
- /*0x1ffc*/ 863,
- /*0x047c*/ 359,
- /*0x01f4*/ 183,
- /*0x03f4*/ 289,
- /*0xa750*/ 1085,
- -1,
- /*0xa756*/ 1088,
- /*0x01fc*/ 188,
- /*0x1f0d*/ 720,
- /*0x1e97*/ 661,
- /*0x2ce0*/ 1021,
- /*0x1ee4*/ 701,
- -1,
- /*0x10c5*/ 521,
- -1, -1,
- /*0x1c97*/ 546,
- /*0x10c97*/ 1359,
- -1, -1,
- /*0x1e917*/ 1474,
- -1,
- /*0x046e*/ 352,
- -1,
- /*0x016e*/ 111,
- /*0x1ee0*/ 699,
- /*0x00d5*/ 47,
- /*0x13fc*/ 528,
- /*0x01ee*/ 179,
- /*0x03ee*/ 286,
- /*0x1fe6*/ 847,
- /*0x0466*/ 348,
- /*0x2c6e*/ 966,
- /*0x0166*/ 107,
- /*0x1ef4*/ 709,
- -1,
- /*0x015e*/ 103,
- /*0x01e6*/ 175,
- /*0x03e6*/ 282,
- /*0x1efc*/ 713,
- /*0x01de*/ 171,
- /*0x03de*/ 278,
- -1,
- /*0x0555*/ 481,
- /*0xa746*/ 1080,
- -1, -1,
- /*0x16e53*/ 1438,
- -1, -1,
- /*0xa74e*/ 1084,
- -1, -1, -1, -1,
- /*0x1e6c*/ 639,
- /*0xa75a*/ 1090,
- /*0x2cde*/ 1020,
- -1,
- /*0x0051*/ 15,
- /*0x1eee*/ 706,
- /*0x00c5*/ 31,
- /*0x01d1*/ 165,
- /*0x03d1*/ 272,
- -1, -1,
- /*0xa66c*/ 1048,
- -1,
- /*0x212b*/ 866,
- /*0x1ee6*/ 702,
- /*0x24c5*/ 900,
- /*0x00d9*/ 50,
- /*0x1ede*/ 698,
- -1, -1,
- /*0x104c5*/ 1321,
- -1,
- /*0x04c5*/ 392,
- /*0x0545*/ 465,
- /*0x1fad*/ 812,
- /*0x042d*/ 342,
- -1, -1,
- /*0xabad*/ 1203,
- /*0x1f59*/ 755,
- -1,
- /*0x1f6c*/ 763,
- -1, -1,
- /*0x04ec*/ 411,
- /*0x2c2d*/ 956,
- /*0x015c*/ 102,
- -1,
- /*0xfb17*/ 1233,
- -1,
- /*0xa740*/ 1077,
- /*0x03dc*/ 277,
- /*0x1ff2*/ 854,
- /*0x0472*/ 354,
- -1,
- /*0x0172*/ 113,
- -1, -1,
- /*0x10a9*/ 493,
- /*0x01f2*/ 182,
- /*0x10425*/ 1297,
- /*0x1fa5*/ 804,
- /*0x0425*/ 334,
- /*0x2c72*/ 969,
- -1,
- /*0xaba5*/ 1195,
- -1,
- /*0x2cdc*/ 1019,
- -1,
- /*0x03a5*/ 261,
- /*0x10c3*/ 519,
- /*0xa7ad*/ 1126,
- /*0x2c25*/ 948,
- -1, -1, -1,
- /*0x2cf2*/ 1025,
- /*0x10a1*/ 485,
- /*0x1e6a*/ 638,
- /*0x00c9*/ 35,
- /*0x1cad*/ 568,
- /*0x10cad*/ 1381,
- /*0x1edc*/ 697,
- /*0x004d*/ 11,
- -1, -1,
- /*0x01cd*/ 163,
- -1,
- /*0x24c9*/ 904,
- /*0xa66a*/ 1047,
- /*0x10b9*/ 509,
- /*0x1ef2*/ 708,
- /*0x1f49*/ 746,
- /*0x104c9*/ 1325,
- /*0xa762*/ 1094,
- /*0x04c9*/ 394,
- /*0x0549*/ 469,
- /*0x013f*/ 87,
- /*0xabbf*/ 1221,
- -1,
- /*0xa754*/ 1087,
- /*0x10423*/ 1295,
- /*0x1fa3*/ 802,
- /*0x0423*/ 332,
- -1, -1,
- /*0xaba3*/ 1193,
- /*0x1ca5*/ 560,
- /*0x10ca5*/ 1373,
- /*0x1f6a*/ 761,
- /*0x03a3*/ 259,
- -1,
- /*0x04ea*/ 410,
- /*0x2c23*/ 946,
- -1,
- /*0x0241*/ 220,
- /*0x0141*/ 88,
- /*0x0041*/ 0,
- /*0x00c3*/ 29,
- /*0x1f29*/ 730,
- -1, -1,
- /*0xa758*/ 1089,
- -1, -1,
- /*0x1e68*/ 637,
- -1,
- /*0x24c3*/ 898,
- -1, -1, -1, -1,
- /*0x104c3*/ 1319,
- -1,
- /*0x04c3*/ 391,
- /*0x0543*/ 463,
- /*0xa668*/ 1046,
- /*0x0372*/ 231,
- -1, -1,
- /*0x1cbf*/ 584,
- -1, -1, -1,
- /*0x023d*/ 218,
- /*0x013d*/ 86,
- /*0xabbd*/ 1219,
- /*0x24b9*/ 888,
- /*0x1ca3*/ 558,
- /*0x10ca3*/ 1371,
- -1,
- /*0x1f39*/ 738,
- /*0x104b9*/ 1309,
- -1, -1,
- /*0x0539*/ 453,
- /*0x1f68*/ 759,
- /*0x00cb*/ 37,
- -1,
- /*0x04e8*/ 409,
- /*0x1041d*/ 1289,
- /*0x1f9d*/ 796,
- /*0x041d*/ 326,
- -1, -1,
- /*0xab9d*/ 1187,
- /*0x24cb*/ 906,
- -1,
- /*0x019d*/ 139,
- /*0x039d*/ 254,
- /*0x1f4b*/ 748,
- /*0x104cb*/ 1327,
- /*0x2c1d*/ 940,
- /*0x04cb*/ 395,
- /*0x054b*/ 471,
- /*0x10407*/ 1267,
- /*0x1f87*/ 774,
- /*0x0407*/ 304,
- /*0x0587*/ 483,
- -1,
- /*0xab87*/ 1165,
- /*0x1e64*/ 635,
- -1,
- /*0x0187*/ 125,
- /*0x1041b*/ 1287,
- /*0x1f9b*/ 794,
- /*0x041b*/ 324,
- /*0x2c07*/ 918,
- /*0x1cbd*/ 582,
- /*0xab9b*/ 1185,
- -1, -1,
- /*0xa664*/ 1044,
- /*0x039b*/ 252,
- -1,
- /*0x1e60*/ 633,
- /*0x2c1b*/ 938,
- /*0x1fbb*/ 823,
- -1,
- /*0x023b*/ 217,
- /*0x013b*/ 85,
- /*0xabbb*/ 1217,
- -1, -1,
- /*0x1e74*/ 643,
- /*0xab73*/ 1145,
- /*0xa660*/ 1042,
- /*0x1c9d*/ 552,
- /*0x10c9d*/ 1365,
- /*0x1e7c*/ 647,
- -1,
- /*0x1e91d*/ 1480,
- -1,
- /*0x1ff6*/ 857,
- /*0x0476*/ 356,
- /*0x04e4*/ 407,
- /*0x0176*/ 115,
- -1, -1, -1,
- /*0x01f6*/ 184,
- /*0x2162*/ 870,
- /*0x1c87*/ 537,
- /*0x10c87*/ 1343,
- /*0x1e9b*/ 665,
- /*0x118a9*/ 1396,
- /*0x1e907*/ 1458,
- /*0xa76c*/ 1099,
- -1,
- /*0x04e0*/ 405,
- /*0x1e6e*/ 640,
- /*0x1c9b*/ 550,
- /*0x10c9b*/ 1363,
- -1, -1,
- /*0x1e91b*/ 1478,
- -1, -1,
- /*0x04f4*/ 415,
- /*0x1e66*/ 636,
- -1, -1,
- /*0x1e5e*/ 632,
- /*0x04fc*/ 419,
- /*0x118a1*/ 1388,
- -1,
- /*0xabb1*/ 1207,
- -1,
- /*0xff29*/ 1242,
- /*0x01b1*/ 150,
- /*0xa666*/ 1045,
- -1,
- /*0x1ef6*/ 710,
- /*0xa65e*/ 1041,
- /*0x10419*/ 1285,
- /*0x1f99*/ 792,
- /*0x0419*/ 322,
- /*0x118b9*/ 1412,
- /*0x10ad*/ 497,
- /*0xab99*/ 1183,
- /*0x00de*/ 55,
- /*0x1f6e*/ 765,
- -1,
- /*0x0399*/ 250,
- /*0x04ee*/ 412,
- -1,
- /*0x2c19*/ 936,
- /*0xff21*/ 1234,
- /*0x1fb7*/ 819,
- /*0x10413*/ 1279,
- /*0x1f93*/ 786,
- /*0x0413*/ 316,
- /*0xabb7*/ 1213,
- /*0x04e6*/ 408,
- /*0xab93*/ 1177,
- /*0x01b7*/ 154,
- /*0x04de*/ 404,
- /*0x0193*/ 133,
- /*0x0393*/ 244,
- /*0xa7b1*/ 1129,
- /*0xff39*/ 1258,
- /*0x2c13*/ 930,
- /*0x00d1*/ 43,
- /*0x1ffa*/ 861,
- /*0x047a*/ 358,
- /*0x10a5*/ 489,
- -1, -1,
- /*0x1cb1*/ 572,
- /*0x10cb1*/ 1385,
- /*0x01fa*/ 187,
- /*0x03fa*/ 293,
- -1, -1,
- /*0x1e99*/ 663,
- /*0xa76a*/ 1098,
- /*0x104d1*/ 1333,
- /*0x1e5c*/ 631,
- /*0x0376*/ 232,
- /*0x0551*/ 477,
- -1,
- /*0x1c99*/ 548,
- /*0x10c99*/ 1361,
- /*0x10cd*/ 523,
- -1,
- /*0x1e919*/ 1476,
- /*0x1e72*/ 642,
- -1,
- /*0xa65c*/ 1040,
- -1,
- /*0x13fa*/ 526,
- -1, -1, -1,
- /*0x1cb7*/ 578,
- /*0x00dc*/ 53,
- /*0x1c93*/ 542,
- /*0x10c93*/ 1355,
- /*0x10bf*/ 515,
- /*0x1f2d*/ 734,
- /*0x1e913*/ 1470,
- /*0xabb5*/ 1211,
- /*0x1efa*/ 712,
- -1,
- /*0x01b5*/ 153,
- -1,
- /*0x10a3*/ 487,
- /*0xab75*/ 1147,
- -1, -1, -1,
- /*0x04dc*/ 403,
- /*0x1fb3*/ 816,
- -1, -1, -1,
- /*0xabb3*/ 1209,
- /*0x10c1*/ 517,
- -1,
- /*0x01b3*/ 152,
- /*0x04f2*/ 414,
- -1,
- /*0xa768*/ 1097,
- -1,
- /*0x1041f*/ 1291,
- /*0x1f9f*/ 798,
- /*0x041f*/ 328,
- -1, -1,
- /*0xab9f*/ 1189,
- -1,
- /*0x00cd*/ 39,
- /*0x019f*/ 140,
- /*0x039f*/ 256,
- /*0x216c*/ 880,
- -1,
- /*0x2c1f*/ 942,
- -1, -1, -1,
- /*0x24cd*/ 908,
- -1, -1,
- /*0x1cb5*/ 576,
- /*0x1f4d*/ 750,
- /*0x104cd*/ 1329,
- /*0x10bd*/ 513,
- /*0x04cd*/ 396,
- /*0x054d*/ 473,
- /*0xa7b3*/ 1131,
- /*0x1ff8*/ 859,
- /*0x0478*/ 357,
- /*0xab7f*/ 1157,
- /*0x0178*/ 116,
- /*0xab71*/ 1143,
- /*0x24bf*/ 894,
- -1,
- /*0x01f8*/ 186,
- /*0x1cb3*/ 574,
- /*0x1f3f*/ 744,
- /*0x104bf*/ 1315,
- -1, -1,
- /*0x053f*/ 459,
- -1,
- /*0x00c1*/ 27,
- -1, -1, -1, -1, -1,
- /*0x1c9f*/ 554,
- /*0x10c9f*/ 1367,
- /*0xfb13*/ 1229,
- /*0x24c1*/ 896,
- /*0x1e91f*/ 1482,
- -1,
- /*0x13f8*/ 524,
- /*0xa764*/ 1095,
- /*0x104c1*/ 1317,
- -1,
- /*0x04c1*/ 390,
- /*0x0541*/ 461,
- /*0xab79*/ 1151,
- -1, -1,
- /*0x10415*/ 1281,
- /*0x1f95*/ 788,
- /*0x0415*/ 318,
- /*0x1ef8*/ 711,
- -1,
- /*0xab95*/ 1179,
- /*0xa760*/ 1093,
- -1, -1,
- /*0x0395*/ 246,
- -1, -1,
- /*0x2c15*/ 932,
- -1, -1,
- /*0x10bb*/ 511,
- /*0x216a*/ 878,
- /*0x24bd*/ 892,
- -1,
- /*0x118ad*/ 1400,
- -1,
- /*0x1f3d*/ 742,
- /*0x104bd*/ 1313,
- -1,
- /*0x047e*/ 360,
- /*0x053d*/ 457,
- /*0x16e52*/ 1437,
- -1, -1, -1,
- /*0x01fe*/ 189,
- /*0x03fe*/ 295,
- /*0x16e4c*/ 1431,
- /*0xab7b*/ 1153,
- /*0x2c7e*/ 971,
- -1, -1, -1, -1, -1,
- /*0x1f1d*/ 728,
- /*0xa76e*/ 1100,
- /*0xff2d*/ 1246,
- -1, -1, -1,
- /*0x118a5*/ 1392,
- /*0x1c95*/ 544,
- /*0x10c95*/ 1357,
- -1,
- /*0xa766*/ 1096,
- /*0x1e915*/ 1472,
- -1,
- /*0xa75e*/ 1092,
- -1, -1, -1, -1, -1, -1,
- /*0x10b1*/ 501,
- /*0x1e76*/ 644,
- /*0x1efe*/ 714,
- /*0x2168*/ 876,
- /*0x1f1b*/ 726,
- -1,
- /*0x10411*/ 1277,
- /*0x1f91*/ 784,
- /*0x0411*/ 314,
- /*0xff25*/ 1238,
- -1,
- /*0xab91*/ 1175,
- /*0x24bb*/ 890,
- -1,
- /*0x0191*/ 132,
- /*0x0391*/ 242,
- /*0x1f3b*/ 740,
- /*0x104bb*/ 1311,
- /*0x2c11*/ 928,
- /*0x118bf*/ 1418,
- /*0x053b*/ 455,
- -1, -1,
- /*0xab7d*/ 1155,
- -1, -1,
- /*0x10b7*/ 507,
- /*0x118a3*/ 1390,
- /*0x1040f*/ 1275,
- /*0x1f8f*/ 782,
- /*0x040f*/ 312,
- -1, -1,
- /*0xab8f*/ 1173,
- -1,
- /*0x04f6*/ 416,
- /*0x018f*/ 130,
- /*0x038f*/ 240,
- -1, -1,
- /*0x2c0f*/ 926,
- -1,
- /*0x16e4a*/ 1429,
- -1,
- /*0x1040b*/ 1271,
- /*0x1f8b*/ 778,
- /*0x040b*/ 308,
- -1,
- /*0xa75c*/ 1091,
- /*0xab8b*/ 1169,
- /*0xff23*/ 1236,
- -1,
- /*0x018b*/ 128,
- /*0x1c91*/ 540,
- /*0x10c91*/ 1353,
- -1,
- /*0x2c0b*/ 922,
- /*0x1e911*/ 1468,
- -1,
- /*0x2164*/ 872,
- /*0xab77*/ 1149,
- -1,
- /*0x104b1*/ 1301,
- -1,
- /*0xfb15*/ 1231,
- /*0x0531*/ 445,
- -1,
- /*0x118bd*/ 1416,
- /*0x16e44*/ 1423,
- /*0x16e4f*/ 1434,
- -1,
- /*0x1e7a*/ 646,
- -1,
- /*0x2160*/ 868,
- /*0x1f19*/ 724,
- /*0x10b5*/ 505,
- /*0x10c8f*/ 1351,
- -1, -1,
- /*0x1e90f*/ 1466,
- -1, -1,
- /*0xa78b*/ 1109,
- /*0x24b7*/ 886,
- /*0x10405*/ 1265,
- /*0x1f85*/ 772,
- /*0x0405*/ 302,
- -1,
- /*0x104b7*/ 1307,
- /*0xab85*/ 1163,
- /*0x10b3*/ 503,
- /*0x0537*/ 451,
- /*0x10c8b*/ 1347,
- -1,
- /*0x16e42*/ 1421,
- /*0x1e90b*/ 1462,
- /*0x2c05*/ 916,
- -1, -1, -1, -1, -1,
- /*0x10401*/ 1261,
- /*0x1f81*/ 768,
- /*0x0401*/ 298,
- /*0x04fa*/ 418,
- /*0x16e48*/ 1427,
- /*0xab81*/ 1159,
- /*0x216e*/ 882,
- -1,
- /*0x0181*/ 121,
- -1, -1, -1,
- /*0x2c01*/ 912,
- -1, -1,
- /*0x2166*/ 874,
- -1, -1, -1, -1,
- /*0x118bb*/ 1414,
- /*0x00b5*/ 25,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x1c85*/ 535,
- /*0x10c85*/ 1341,
- -1, -1,
- /*0x1e905*/ 1456,
- -1,
- /*0x104b5*/ 1305,
- -1, -1,
- /*0x0535*/ 449,
- -1, -1, -1, -1,
- /*0x16e50*/ 1435,
- -1,
- /*0x16e56*/ 1441,
- -1,
- /*0x1c81*/ 531,
- /*0x10c81*/ 1337,
- -1,
- /*0x104b3*/ 1303,
- /*0x1e901*/ 1452,
- -1,
- /*0x0533*/ 447,
- /*0x16e5b*/ 1446,
- -1,
- /*0x1e78*/ 645,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x118b1*/ 1404,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x16e46*/ 1425,
- /*0xab70*/ 1142,
- -1, -1, -1,
- /*0xff31*/ 1250,
- /*0x16e4e*/ 1433,
- /*0x04f8*/ 417,
- /*0x118b7*/ 1410,
- -1, -1, -1,
- /*0x16e5a*/ 1445,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xfb05*/ 1227,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0xff37*/ 1256,
- /*0x1e7e*/ 648,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0xfb01*/ 1223,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x16e40*/ 1419,
- -1, -1, -1, -1, -1,
- /*0x118b5*/ 1408,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x04fe*/ 420,
- -1, -1, -1, -1, -1,
- /*0x118b3*/ 1406,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0xff35*/ 1254,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0xff33*/ 1252,
- -1, -1, -1, -1, -1,
- /*0x16e54*/ 1439,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x16e58*/ 1443,
- -1, -1, -1, -1, -1,
- /*0x1f0f*/ 722,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x1f0b*/ 718,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x16e55*/ 1440,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x16e45*/ 1424,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x16e59*/ 1444,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xa77e*/ 1104,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x16e49*/ 1428,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x16e43*/ 1422,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x16e4b*/ 1430,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x16e5e*/ 1449,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x16e51*/ 1436,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x16e5c*/ 1447,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0x16e4d*/ 1432,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0x16e41*/ 1420,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -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*/ 1146,
- -1, -1, -1, -1,
- /*0xab7c*/ 1154,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0xab72*/ 1144,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xab76*/ 1148,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -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*/ 1152,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -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*/ 1150,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xab7e*/ 1156
- };
-
- 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 (*)[1352])(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}}},
- {0x0282, {1|U, {0xa7c5}}},
- {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}}},
- {0x10d0, {1|U|IT, {0x1c90}}},
- {0x10d1, {1|U|IT, {0x1c91}}},
- {0x10d2, {1|U|IT, {0x1c92}}},
- {0x10d3, {1|U|IT, {0x1c93}}},
- {0x10d4, {1|U|IT, {0x1c94}}},
- {0x10d5, {1|U|IT, {0x1c95}}},
- {0x10d6, {1|U|IT, {0x1c96}}},
- {0x10d7, {1|U|IT, {0x1c97}}},
- {0x10d8, {1|U|IT, {0x1c98}}},
- {0x10d9, {1|U|IT, {0x1c99}}},
- {0x10da, {1|U|IT, {0x1c9a}}},
- {0x10db, {1|U|IT, {0x1c9b}}},
- {0x10dc, {1|U|IT, {0x1c9c}}},
- {0x10dd, {1|U|IT, {0x1c9d}}},
- {0x10de, {1|U|IT, {0x1c9e}}},
- {0x10df, {1|U|IT, {0x1c9f}}},
- {0x10e0, {1|U|IT, {0x1ca0}}},
- {0x10e1, {1|U|IT, {0x1ca1}}},
- {0x10e2, {1|U|IT, {0x1ca2}}},
- {0x10e3, {1|U|IT, {0x1ca3}}},
- {0x10e4, {1|U|IT, {0x1ca4}}},
- {0x10e5, {1|U|IT, {0x1ca5}}},
- {0x10e6, {1|U|IT, {0x1ca6}}},
- {0x10e7, {1|U|IT, {0x1ca7}}},
- {0x10e8, {1|U|IT, {0x1ca8}}},
- {0x10e9, {1|U|IT, {0x1ca9}}},
- {0x10ea, {1|U|IT, {0x1caa}}},
- {0x10eb, {1|U|IT, {0x1cab}}},
- {0x10ec, {1|U|IT, {0x1cac}}},
- {0x10ed, {1|U|IT, {0x1cad}}},
- {0x10ee, {1|U|IT, {0x1cae}}},
- {0x10ef, {1|U|IT, {0x1caf}}},
- {0x10f0, {1|U|IT, {0x1cb0}}},
- {0x10f1, {1|U|IT, {0x1cb1}}},
- {0x10f2, {1|U|IT, {0x1cb2}}},
- {0x10f3, {1|U|IT, {0x1cb3}}},
- {0x10f4, {1|U|IT, {0x1cb4}}},
- {0x10f5, {1|U|IT, {0x1cb5}}},
- {0x10f6, {1|U|IT, {0x1cb6}}},
- {0x10f7, {1|U|IT, {0x1cb7}}},
- {0x10f8, {1|U|IT, {0x1cb8}}},
- {0x10f9, {1|U|IT, {0x1cb9}}},
- {0x10fa, {1|U|IT, {0x1cba}}},
- {0x10fd, {1|U|IT, {0x1cbd}}},
- {0x10fe, {1|U|IT, {0x1cbe}}},
- {0x10ff, {1|U|IT, {0x1cbf}}},
- {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}}},
- {0x1d8e, {1|U, {0xa7c6}}},
- {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}}},
- {0xa794, {1|U, {0xa7c4}}},
- {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}}},
- {0xa7b9, {1|U, {0xa7b8}}},
- {0xa7bb, {1|U, {0xa7ba}}},
- {0xa7bd, {1|U, {0xa7bc}}},
- {0xa7bf, {1|U, {0xa7be}}},
- {0xa7c3, {1|U, {0xa7c2}}},
- {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}}},
- {0x16e60, {1|U, {0x16e40}}},
- {0x16e61, {1|U, {0x16e41}}},
- {0x16e62, {1|U, {0x16e42}}},
- {0x16e63, {1|U, {0x16e43}}},
- {0x16e64, {1|U, {0x16e44}}},
- {0x16e65, {1|U, {0x16e45}}},
- {0x16e66, {1|U, {0x16e46}}},
- {0x16e67, {1|U, {0x16e47}}},
- {0x16e68, {1|U, {0x16e48}}},
- {0x16e69, {1|U, {0x16e49}}},
- {0x16e6a, {1|U, {0x16e4a}}},
- {0x16e6b, {1|U, {0x16e4b}}},
- {0x16e6c, {1|U, {0x16e4c}}},
- {0x16e6d, {1|U, {0x16e4d}}},
- {0x16e6e, {1|U, {0x16e4e}}},
- {0x16e6f, {1|U, {0x16e4f}}},
- {0x16e70, {1|U, {0x16e50}}},
- {0x16e71, {1|U, {0x16e51}}},
- {0x16e72, {1|U, {0x16e52}}},
- {0x16e73, {1|U, {0x16e53}}},
- {0x16e74, {1|U, {0x16e54}}},
- {0x16e75, {1|U, {0x16e55}}},
- {0x16e76, {1|U, {0x16e56}}},
- {0x16e77, {1|U, {0x16e57}}},
- {0x16e78, {1|U, {0x16e58}}},
- {0x16e79, {1|U, {0x16e59}}},
- {0x16e7a, {1|U, {0x16e5a}}},
- {0x16e7b, {1|U, {0x16e5b}}},
- {0x16e7c, {1|U, {0x16e5c}}},
- {0x16e7d, {1|U, {0x16e5d}}},
- {0x16e7e, {1|U, {0x16e5e}}},
- {0x16e7f, {1|U, {0x16e5f}}},
- {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+1352))
- {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 = 2507, 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, 2510, 2, 7, 4, 582, 9, 308, 197, 674,
- 297, 20, 2, 3, 303, 351, 2510, 2510, 2510, 2510,
- 2510, 2510, 2510, 2510, 2510, 2510, 2510, 2510, 2510, 112,
- 2510, 2510, 2510, 2510, 2510, 2510, 2510, 120, 2510, 2510,
- 2510, 2510, 2510, 1, 2510, 2510, 2510, 2510, 2510, 2510,
- 2510, 2510, 2510, 278, 2510, 2510, 2510, 2510, 2510, 2510,
- 2510, 2510, 12, 1, 7, 8, 218, 878, 222, 1178,
- 480, 1102, 54, 1340, 151, 1615, 8, 15, 106, 1607,
- 225, 854, 87, 490, 44, 1351, 5, 1281, 3, 1470,
- 11, 1215, 377, 10, 441, 599, 152, 1642, 127, 1334,
- 702, 841, 594, 827, 123, 916, 146, 1118, 117, 1363,
- 254, 812, 249, 1096, 1630, 945, 437, 745, 1600, 718,
- 1593, 704, 152, 1005, 383, 1064, 1493, 975, 236, 676,
- 761, 579, 1017, 557, 1241, 628, 1195, 614, 1506, 464,
- 1576, 535, 1432, 513, 1159, 423, 1026, 276, 1460, 291,
- 1453, 392, 1263, 201, 1442, 85, 1412, 70, 1430, 100,
- 1632, 129, 1410, 1, 1386, 25, 1373, 35, 656, 55,
- 1188, 45, 1308, 160, 687, 227, 355, 175, 1201, 328,
- 1030, 367, 1483, 414, 1479, 1166, 1418, 783, 994, 937,
- 1083, 959, 1463, 967
- };
- 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 = 1353,
- MIN_WORD_LENGTH = 3,
- MAX_WORD_LENGTH = 3,
- MIN_HASH_VALUE = 3,
- MAX_HASH_VALUE = 2509
- };
-
- static const short wordlist[] =
- {
- -1, -1, -1,
- /*0x13e1*/ 589,
- /*0x0461*/ 340,
- /*0x04e1*/ 400,
- /*0x0061*/ 0,
- -1,
- /*0x104e1*/ 1176,
- /*0x1e61*/ 661,
- /*0x1ee1*/ 720,
- /*0x0161*/ 102,
- /*0x2ce1*/ 952,
- -1,
- /*0x049b*/ 365,
- -1, -1,
- /*0x24e1*/ 840,
- /*0x1e1b*/ 626,
- /*0x048b*/ 357,
- /*0x011b*/ 69,
- /*0x2c9b*/ 917,
- /*0x03e1*/ 280,
- /*0x1e0b*/ 618,
- /*0x1e8b*/ 682,
- /*0x010b*/ 61,
- /*0x2c8b*/ 909,
- /*0x13e3*/ 591,
- /*0x0463*/ 341,
- /*0x04e3*/ 401,
- /*0x0063*/ 2,
- -1,
- /*0x104e3*/ 1178,
- /*0x1e63*/ 662,
- /*0x1ee3*/ 721,
- /*0x0163*/ 103,
- /*0x2ce3*/ 953,
- /*0x13e5*/ 593,
- /*0x0465*/ 342,
- /*0x04e5*/ 402,
- /*0x0065*/ 4,
- /*0x24e3*/ 842,
- /*0x104e5*/ 1180,
- /*0x1e65*/ 663,
- /*0x1ee5*/ 722,
- /*0x0165*/ 104,
- /*0x03e3*/ 281,
- /*0x13e9*/ 597,
- /*0x0469*/ 344,
- /*0x04e9*/ 404,
- /*0x0069*/ 1352,
- /*0x24e5*/ 844,
- /*0x104e9*/ 1184,
- /*0x1e69*/ 665,
- /*0x1ee9*/ 724,
- /*0x0169*/ 106,
- /*0x03e5*/ 282,
- /*0x13e7*/ 595,
- /*0x0467*/ 343,
- /*0x04e7*/ 403,
- /*0x0067*/ 6,
- /*0x24e9*/ 848,
- /*0x104e7*/ 1182,
- /*0x1e67*/ 664,
- /*0x1ee7*/ 723,
- /*0x0167*/ 105,
- /*0x03e9*/ 284,
- -1, -1, -1, -1,
- /*0x24e7*/ 846,
- /*0x13db*/ 583,
- /*0x045b*/ 335,
- /*0x04db*/ 397,
- -1,
- /*0x03e7*/ 283,
- /*0x104db*/ 1170,
- /*0x1e5b*/ 658,
- /*0x1edb*/ 717,
- /*0x015b*/ 99,
- /*0x2cdb*/ 949,
- -1, -1, -1, -1,
- /*0x24db*/ 834,
- /*0x13d9*/ 581,
- /*0x0459*/ 333,
- /*0x04d9*/ 396,
- /*0xa761*/ 1064,
- /*0x03db*/ 277,
- /*0x104d9*/ 1168,
- /*0x1e59*/ 657,
- /*0x1ed9*/ 716,
- /*0x0159*/ 98,
- /*0x2cd9*/ 948,
- -1, -1, -1, -1,
- /*0x24d9*/ 832,
- /*0x13dd*/ 585,
- /*0x045d*/ 337,
- /*0x04dd*/ 398,
- -1,
- /*0x03d9*/ 276,
- /*0x104dd*/ 1172,
- /*0x1e5d*/ 659,
- /*0x1edd*/ 718,
- /*0x015d*/ 100,
- /*0x2cdd*/ 950,
- -1, -1,
- /*0xa763*/ 1065,
- -1,
- /*0x24dd*/ 836,
- /*0x10ce1*/ 1236,
- -1,
- /*0x13aa*/ 534,
- -1,
- /*0x03dd*/ 278,
- /*0x10e1*/ 495,
- /*0x1042a*/ 1129,
- /*0xa765*/ 1066,
- /*0x13a6*/ 530,
- -1, -1, -1,
- /*0x13a0*/ 524,
- -1,
- /*0x13df*/ 587,
- /*0x045f*/ 339,
- /*0x04df*/ 399,
- /*0xa769*/ 1068,
- -1,
- /*0x104df*/ 1174,
- /*0x1e5f*/ 660,
- /*0x1edf*/ 719,
- /*0x015f*/ 101,
- /*0x2cdf*/ 951,
- /*0x10ce3*/ 1238,
- -1, -1,
- /*0xa767*/ 1067,
- /*0x24df*/ 838,
- /*0x10e3*/ 497,
- -1,
- /*0x13a8*/ 532,
- -1,
- /*0x03df*/ 279,
- /*0x10ce5*/ 1240,
- /*0x10428*/ 1127,
- -1,
- /*0x13b8*/ 548,
- /*0x0438*/ 300,
- /*0x10e5*/ 499,
- -1,
- /*0x10438*/ 1143,
- /*0xa75b*/ 1061,
- -1,
- /*0x10ce9*/ 1244,
- /*0x13eb*/ 599,
- /*0x046b*/ 345,
- /*0x04eb*/ 405,
- /*0x006b*/ 9,
- /*0x10e9*/ 503,
- /*0x104eb*/ 1186,
- /*0x1e6b*/ 666,
- /*0x1eeb*/ 725,
- /*0x016b*/ 107,
- /*0x10ce7*/ 1242,
- -1,
- /*0x03b8*/ 253,
- /*0xa759*/ 1060,
- -1,
- /*0x10e7*/ 501,
- /*0x13ef*/ 603,
- /*0x046f*/ 347,
- /*0x04ef*/ 407,
- /*0x006f*/ 13,
- /*0x03eb*/ 285,
- /*0x104ef*/ 1190,
- /*0x1e6f*/ 668,
- /*0x1eef*/ 727,
- /*0x016f*/ 109,
- /*0x10cdb*/ 1230,
- -1, -1,
- /*0xa75d*/ 1062,
- -1,
- /*0x10db*/ 489,
- -1, -1, -1, -1,
- /*0x03ef*/ 287,
- -1, -1,
- /*0x0261*/ 210,
- -1,
- /*0x10cd9*/ 1228,
- -1,
- /*0x13d7*/ 579,
- /*0x0457*/ 331,
- /*0x04d7*/ 395,
- /*0x10d9*/ 487,
- -1,
- /*0x021b*/ 178,
- /*0x1e57*/ 656,
- /*0x1ed7*/ 715,
- /*0x0157*/ 97,
- /*0x2cd7*/ 947,
- /*0x020b*/ 170,
- -1, -1,
- /*0x10cdd*/ 1232,
- /*0x24d7*/ 830,
- /*0xa75f*/ 1063,
- -1,
- /*0x1f61*/ 777,
- /*0x10dd*/ 491,
- /*0x03d7*/ 275,
- /*0x0263*/ 211,
- /*0x1f14*/ 748,
- -1, -1,
- /*0x1d8e*/ 612,
- /*0xa661*/ 1013,
- /*0x13ed*/ 601,
- /*0x046d*/ 346,
- /*0x04ed*/ 406,
- /*0x006d*/ 11,
- /*0x0265*/ 212,
- /*0x104ed*/ 1188,
- /*0x1e6d*/ 667,
- /*0x1eed*/ 726,
- /*0x016d*/ 108,
- /*0x13be*/ 554,
- /*0x043e*/ 306,
- -1, -1,
- /*0x1043e*/ 1149,
- /*0x0269*/ 215,
- /*0x1f63*/ 779,
- /*0x10cdf*/ 1234,
- /*0x013e*/ 85,
- -1,
- /*0x03ed*/ 286,
- /*0xa76b*/ 1069,
- /*0x10df*/ 493,
- /*0x13ae*/ 538,
- /*0xa663*/ 1014,
- -1,
- /*0x1f65*/ 781,
- /*0x1042e*/ 1133,
- /*0x13ac*/ 536,
- /*0x03be*/ 259,
- -1, -1,
- /*0x1042c*/ 1131,
- -1,
- /*0xa665*/ 1015,
- /*0x1f12*/ 746,
- /*0xa76f*/ 1071,
- -1, -1, -1,
- /*0x025b*/ 207,
- -1,
- /*0x03ae*/ 244,
- -1,
- /*0xa669*/ 1017,
- /*0x1f06*/ 742,
- /*0x1f67*/ 783,
- /*0x03ac*/ 242,
- /*0x10ceb*/ 1246,
- -1,
- /*0x13d1*/ 573,
- /*0x0451*/ 325,
- /*0x04d1*/ 392,
- /*0x10eb*/ 505,
- /*0xa667*/ 1016,
- /*0x0259*/ 206,
- /*0x1e51*/ 653,
- /*0x1ed1*/ 712,
- /*0x0151*/ 94,
- /*0x2cd1*/ 944,
- -1, -1,
- /*0xa757*/ 1059,
- /*0x10cef*/ 1250,
- /*0x24d1*/ 824,
- /*0x13d3*/ 575,
- /*0x0453*/ 327,
- /*0x04d3*/ 393,
- /*0x10ef*/ 509,
- /*0xa65b*/ 1010,
- -1,
- /*0x1e53*/ 654,
- /*0x1ed3*/ 713,
- /*0x0153*/ 95,
- /*0x2cd3*/ 945,
- -1,
- /*0xab53*/ 1100,
- /*0x0561*/ 440,
- /*0x1f10*/ 744,
- /*0x24d3*/ 826,
- -1, -1,
- /*0x01e1*/ 151,
- -1,
- /*0xa659*/ 1009,
- -1,
- /*0x051b*/ 429,
- -1,
- /*0xa76d*/ 1070,
- /*0x10cd7*/ 1226,
- -1,
- /*0x050b*/ 421,
- -1, -1,
- /*0x10d7*/ 485,
- -1, -1, -1, -1,
- /*0xa65d*/ 1011,
- -1,
- /*0x0563*/ 442,
- /*0x13f1*/ 605,
- /*0x0471*/ 348,
- /*0x04f1*/ 408,
- /*0x0071*/ 15,
- /*0x01e3*/ 152,
- /*0x104f1*/ 1192,
- /*0x1e71*/ 669,
- /*0x1ef1*/ 728,
- /*0x0171*/ 110,
- /*0x0565*/ 444,
- -1, -1,
- /*0x1f26*/ 756,
- /*0x10ced*/ 1248,
- /*0x01e5*/ 153,
- -1,
- /*0x1f20*/ 750,
- -1,
- /*0x10ed*/ 507,
- /*0x0569*/ 448,
- -1, -1,
- /*0x118db*/ 1281,
- /*0x0192*/ 122,
- /*0x01e9*/ 155,
- -1,
- /*0xa65f*/ 1012,
- /*0x13ee*/ 602,
- /*0x026b*/ 217,
- /*0x0567*/ 446,
- /*0x006e*/ 12,
- -1,
- /*0x104ee*/ 1189,
- -1,
- /*0x01e7*/ 154,
- /*0xa751*/ 1056,
- /*0x2cee*/ 955,
- /*0x118d9*/ 1279,
- -1,
- /*0x13f3*/ 607,
- /*0x0473*/ 349,
- /*0x04f3*/ 409,
- /*0x0073*/ 17,
- /*0x026f*/ 219,
- /*0x104f3*/ 1194,
- /*0x1e73*/ 670,
- /*0x1ef3*/ 729,
- /*0x0173*/ 111,
- /*0x2cf3*/ 956,
- /*0x2c61*/ 896,
- /*0xa753*/ 1057,
- -1,
- /*0x118dd*/ 1283,
- -1, -1,
- /*0x13ba*/ 550,
- /*0x043a*/ 302,
- /*0xa66b*/ 1018,
- /*0x03f3*/ 289,
- /*0x1043a*/ 1145,
- -1, -1,
- /*0x10cd1*/ 1220,
- /*0x013a*/ 83,
- /*0x13d5*/ 577,
- /*0x0455*/ 329,
- /*0x04d5*/ 394,
- /*0x10d1*/ 479,
- -1,
- /*0x0257*/ 205,
- /*0x1e55*/ 655,
- /*0x1ed5*/ 714,
- /*0x0155*/ 96,
- /*0x2cd5*/ 946,
- /*0x03ba*/ 255,
- -1,
- /*0x0586*/ 477,
- /*0x10cd3*/ 1222,
- /*0x24d5*/ 828,
- /*0x01dd*/ 149,
- -1,
- /*0x118df*/ 1285,
- /*0x10d3*/ 481,
- /*0x2c65*/ 897,
- -1,
- /*0x018c*/ 121,
- /*0x13f5*/ 609,
- /*0x0475*/ 350,
- /*0x04f5*/ 410,
- /*0x0075*/ 19,
- /*0x1f57*/ 775,
- /*0x104f5*/ 1196,
- /*0x1e75*/ 671,
- /*0x1ef5*/ 730,
- /*0x0175*/ 112,
- /*0x13cf*/ 571,
- /*0x044f*/ 323,
- /*0x04cf*/ 391,
- /*0xa657*/ 1008,
- /*0x1044f*/ 1166,
- /*0x1e92a*/ 1326,
- /*0x1e4f*/ 652,
- /*0x1ecf*/ 711,
- /*0x014f*/ 93,
- /*0x2ccf*/ 943,
- -1,
- /*0x1e926*/ 1322,
- /*0x1f00*/ 736,
- /*0x01df*/ 150,
- /*0x13b2*/ 542,
- /*0x0432*/ 294,
- /*0x1f02*/ 738,
- -1,
- /*0x10432*/ 1137,
- /*0x10cf1*/ 1252,
- /*0x2d16*/ 979,
- -1,
- /*0x2d14*/ 977,
- /*0x2c5b*/ 892,
- /*0x10f1*/ 511,
- /*0x2d0a*/ 967,
- -1,
- /*0x2d1b*/ 984,
- /*0x2d18*/ 981,
- /*0xa66d*/ 1019,
- /*0x01a8*/ 130,
- -1,
- /*0x2d0b*/ 968,
- /*0x03b2*/ 247,
- /*0x1e928*/ 1324,
- /*0x0188*/ 120,
- /*0x019e*/ 126,
- -1,
- /*0x2c59*/ 890,
- /*0x056b*/ 450,
- /*0x1e938*/ 1340,
- /*0x13c9*/ 565,
- /*0x0449*/ 317,
- -1,
- /*0x01eb*/ 156,
- /*0x10449*/ 1160,
- /*0x10cee*/ 1249,
- /*0x1e49*/ 649,
- /*0x1ec9*/ 708,
- /*0x0251*/ 200,
- /*0x2cc9*/ 940,
- /*0x10ee*/ 508,
- -1,
- /*0x2c5d*/ 894,
- /*0x056f*/ 454,
- -1,
- /*0xa755*/ 1058,
- -1,
- /*0x118d7*/ 1277,
- /*0x01ef*/ 158,
- /*0x03c9*/ 269,
- /*0x2d12*/ 975,
- -1,
- /*0x10f3*/ 513,
- /*0x0253*/ 202,
- -1, -1, -1, -1,
- /*0x0491*/ 360,
- /*0x1f51*/ 772,
- /*0x2d06*/ 963,
- /*0xa794*/ 1082,
- /*0x1e11*/ 621,
- /*0x1e91*/ 685,
- /*0x0111*/ 64,
- /*0x2c91*/ 912,
- /*0xa79b*/ 1085,
- /*0xa651*/ 1005,
- -1, -1, -1, -1,
- /*0x10cd5*/ 1224,
- -1,
- /*0x1f53*/ 773,
- -1,
- /*0xa74f*/ 1055,
- /*0x10d5*/ 483,
- -1,
- /*0x13cd*/ 569,
- /*0x044d*/ 321,
- -1,
- /*0xa653*/ 1006,
- /*0x1044d*/ 1164,
- -1,
- /*0x1e4d*/ 651,
- /*0x1ecd*/ 710,
- /*0x014d*/ 92,
- /*0x2ccd*/ 942,
- -1,
- /*0x0271*/ 220,
- /*0x0180*/ 117,
- -1,
- /*0x2d10*/ 973,
- /*0x2c38*/ 857,
- /*0x056d*/ 452,
- -1, -1,
- /*0x03cd*/ 273,
- /*0x10f5*/ 515,
- /*0x01ed*/ 157,
- /*0x13cb*/ 567,
- /*0x044b*/ 319,
- /*0x10ccf*/ 1218,
- -1,
- /*0x1044b*/ 1162,
- -1,
- /*0x1e4b*/ 650,
- /*0x1ecb*/ 709,
- /*0x014b*/ 91,
- /*0x2ccb*/ 941,
- /*0x1f71*/ 785,
- /*0x2d0c*/ 969,
- /*0x1e93e*/ 1346,
- -1, -1, -1,
- /*0xa749*/ 1052,
- -1, -1,
- /*0x03cb*/ 271,
- -1,
- /*0x118d1*/ 1271,
- /*0x13c3*/ 559,
- /*0x0443*/ 311,
- -1,
- /*0x1e92e*/ 1330,
- /*0x10443*/ 1154,
- -1,
- /*0x1e43*/ 646,
- /*0x1ec3*/ 705,
- /*0x1e92c*/ 1328,
- /*0x2cc3*/ 937,
- /*0x2d20*/ 989,
- /*0x0580*/ 471,
- -1, -1,
- /*0x118d3*/ 1273,
- /*0x0582*/ 473,
- -1, -1, -1,
- /*0x03c3*/ 263,
- /*0x2c57*/ 888,
- /*0x10cc9*/ 1212,
- /*0x13c1*/ 557,
- /*0x0441*/ 309,
- -1,
- /*0x00e1*/ 26,
- /*0x10441*/ 1152,
- /*0x1f73*/ 787,
- /*0x1e41*/ 645,
- /*0x1ec1*/ 704,
- -1,
- /*0x2cc1*/ 936,
- -1, -1,
- /*0x2d08*/ 965,
- /*0x2d1e*/ 987,
- -1,
- /*0x13a4*/ 528,
- -1,
- /*0xa78c*/ 1079,
- -1,
- /*0x03c1*/ 262,
- -1,
- /*0xa74d*/ 1054,
- /*0x049d*/ 366,
- -1, -1, -1,
- /*0x1e1d*/ 627,
- /*0x00e3*/ 28,
- /*0x011d*/ 70,
- /*0x2c9d*/ 918,
- /*0x1f55*/ 774,
- /*0x0275*/ 222,
- -1,
- /*0x2c3e*/ 863,
- -1,
- /*0x13c7*/ 563,
- /*0x0447*/ 315,
- /*0x00e5*/ 30,
- /*0xa655*/ 1007,
- /*0x10447*/ 1158,
- /*0x024f*/ 198,
- /*0x1e47*/ 648,
- /*0x1ec7*/ 707,
- /*0xa74b*/ 1053,
- /*0x2cc7*/ 939,
- /*0x0371*/ 236,
- -1,
- /*0x00e9*/ 34,
- /*0x10ccd*/ 1216,
- /*0x13c5*/ 561,
- /*0x0445*/ 313,
- /*0x0571*/ 456,
- /*0x1f75*/ 789,
- /*0x10445*/ 1156,
- /*0x03c7*/ 267,
- /*0x1e45*/ 647,
- /*0x1ec5*/ 706,
- /*0x00e7*/ 32,
- /*0x2cc5*/ 938,
- -1, -1, -1, -1, -1, -1,
- /*0xa743*/ 1049,
- -1, -1,
- /*0x03c5*/ 265,
- /*0xa64f*/ 1004,
- /*0x10ccb*/ 1214,
- -1, -1,
- /*0x2c51*/ 882,
- -1,
- /*0x1f32*/ 760,
- -1,
- /*0x13e6*/ 594,
- /*0x056e*/ 453,
- /*0x2d00*/ 957,
- /*0x0066*/ 5,
- /*0x0249*/ 195,
- /*0x104e6*/ 1181,
- /*0x2d02*/ 959,
- /*0x0373*/ 237,
- -1,
- /*0x2d0e*/ 971,
- /*0xa741*/ 1048,
- /*0x2c53*/ 884,
- -1,
- /*0x0573*/ 458,
- /*0x24e6*/ 845,
- /*0x10cc3*/ 1206,
- /*0x118d5*/ 1275,
- -1,
- /*0x01f3*/ 159,
- -1,
- /*0x13bf*/ 555,
- /*0x043f*/ 307,
- /*0x04bf*/ 383,
- -1,
- /*0x1043f*/ 1150,
- /*0x028a*/ 230,
- /*0x1e3f*/ 644,
- /*0x1ebf*/ 703,
- /*0x019a*/ 125,
- /*0x2cbf*/ 935,
- /*0x0211*/ 173,
- /*0x13ec*/ 600,
- /*0x028b*/ 231,
- /*0xa649*/ 1001,
- /*0x006c*/ 10,
- -1,
- /*0x104ec*/ 1187,
- /*0x10cc1*/ 1204,
- /*0x1e93a*/ 1342,
- /*0x03bf*/ 260,
- /*0x2cec*/ 954,
- /*0x1f04*/ 740,
- -1, -1, -1,
- /*0xa747*/ 1051,
- /*0x13a2*/ 526,
- /*0x118cf*/ 1269,
- /*0x13b7*/ 547,
- /*0x0437*/ 299,
- /*0x04b7*/ 379,
- /*0x1f11*/ 745,
- /*0x10437*/ 1142,
- /*0x024d*/ 197,
- /*0x1e37*/ 640,
- /*0x1eb7*/ 699,
- /*0x0137*/ 82,
- /*0x2cb7*/ 931,
- -1,
- /*0xa745*/ 1050,
- /*0x0575*/ 460,
- /*0x0292*/ 233,
- /*0x13b5*/ 545,
- /*0x0435*/ 297,
- /*0x04b5*/ 378,
- /*0x01f5*/ 160,
- /*0x10435*/ 1140,
- /*0x03b7*/ 252,
- /*0x1e35*/ 639,
- /*0x1eb5*/ 698,
- /*0x0135*/ 81,
- /*0x2cb5*/ 930,
- /*0x10cc7*/ 1210,
- -1, -1,
- /*0x024b*/ 196,
- -1,
- /*0x16e61*/ 1287,
- -1, -1, -1,
- /*0x03b5*/ 250,
- /*0xa64d*/ 1003,
- -1, -1,
- /*0x00eb*/ 36,
- /*0x10cc5*/ 1208,
- /*0x2c73*/ 902,
- /*0x118c9*/ 1263,
- /*0x13b3*/ 543,
- /*0x0433*/ 295,
- /*0x04b3*/ 377,
- /*0x1e932*/ 1334,
- /*0x10433*/ 1138,
- -1,
- /*0x1e33*/ 638,
- /*0x1eb3*/ 697,
- /*0x0133*/ 80,
- /*0x2cb3*/ 929,
- -1,
- /*0x00ef*/ 40,
- /*0x16e63*/ 1289,
- -1,
- /*0x2c3a*/ 859,
- /*0xa64b*/ 1002,
- /*0x13c0*/ 556,
- /*0x0440*/ 308,
- /*0xa73f*/ 1047,
- /*0x03b3*/ 248,
- /*0x10440*/ 1151,
- -1,
- /*0x16e65*/ 1291,
- /*0x2c55*/ 886,
- /*0x0140*/ 86,
- /*0x10ce6*/ 1241,
- /*0x01c9*/ 139,
- -1, -1,
- /*0x1f43*/ 769,
- /*0x10e6*/ 500,
- -1,
- /*0x16e69*/ 1295,
- -1,
- /*0x028c*/ 232,
- /*0x03c0*/ 261,
- -1,
- /*0xa643*/ 998,
- -1,
- /*0x0479*/ 352,
- /*0x04f9*/ 412,
- /*0x0079*/ 23,
- /*0x16e67*/ 1293,
- /*0x104f9*/ 1200,
- /*0x1e79*/ 673,
- /*0x1ef9*/ 732,
- /*0xa737*/ 1043,
- /*0x0511*/ 424,
- /*0x118cd*/ 1267,
- /*0x1d79*/ 610,
- /*0x021d*/ 179,
- /*0x1f41*/ 767,
- -1, -1,
- /*0x2c4f*/ 880,
- -1,
- /*0x10cec*/ 1247,
- -1, -1,
- /*0xa641*/ 997,
- /*0xa735*/ 1042,
- /*0x10ec*/ 506,
- /*0x2171*/ 807,
- /*0x00ed*/ 38,
- -1,
- /*0x0247*/ 194,
- /*0x1f24*/ 754,
- /*0x13ad*/ 537,
- /*0x2c32*/ 851,
- /*0x04ad*/ 374,
- /*0x118cb*/ 1265,
- /*0x1042d*/ 1132,
- /*0x2d1a*/ 983,
- /*0x1e2d*/ 635,
- /*0x1ead*/ 694,
- /*0x012d*/ 78,
- /*0x2cad*/ 926,
- -1, -1,
- /*0x0288*/ 228,
- /*0x029e*/ 235,
- -1,
- /*0x13a5*/ 529,
- -1,
- /*0x04a5*/ 370,
- /*0x0584*/ 475,
- /*0x03ad*/ 243,
- /*0xa733*/ 1041,
- /*0x1e25*/ 631,
- /*0x1ea5*/ 690,
- /*0x0125*/ 74,
- /*0x2ca5*/ 922,
- /*0x118c3*/ 1257,
- -1,
- /*0xa647*/ 1000,
- /*0x2c49*/ 874,
- /*0x13a3*/ 527,
- -1,
- /*0x04a3*/ 369,
- -1,
- /*0x1f45*/ 771,
- /*0x2173*/ 809,
- /*0x1e23*/ 630,
- /*0x1ea3*/ 689,
- /*0x0123*/ 73,
- /*0x2ca3*/ 921,
- /*0xff59*/ 1125,
- /*0x0266*/ 213,
- /*0xa645*/ 999,
- -1, -1,
- /*0x048f*/ 359,
- -1, -1,
- /*0x118c1*/ 1255,
- /*0x1e0f*/ 620,
- /*0x1e8f*/ 684,
- /*0x010f*/ 63,
- /*0x2c8f*/ 911,
- /*0xa69b*/ 1033,
- -1, -1, -1,
- /*0x1e943*/ 1351,
- /*0xa68b*/ 1025,
- -1, -1,
- /*0x023f*/ 191,
- /*0x1f66*/ 782,
- -1,
- /*0x10cc0*/ 1203,
- -1, -1,
- /*0x1fe1*/ 803,
- -1,
- /*0x0481*/ 356,
- /*0x2d1c*/ 985,
- -1,
- /*0x026c*/ 218,
- /*0x1e01*/ 613,
- /*0x1e81*/ 677,
- /*0x0101*/ 56,
- /*0x2c81*/ 904,
- -1,
- /*0x2c4d*/ 878,
- /*0x1e941*/ 1349,
- /*0x0280*/ 224,
- /*0x16e6b*/ 1297,
- /*0x2175*/ 811,
- /*0x118c7*/ 1261,
- /*0x0282*/ 225,
- -1, -1, -1,
- /*0xa72d*/ 1039,
- -1,
- /*0x051d*/ 430,
- /*0x10f9*/ 519,
- -1, -1,
- /*0x1e924*/ 1320,
- -1,
- /*0x16e6f*/ 1301,
- /*0x118c5*/ 1259,
- /*0x00f1*/ 42,
- -1,
- /*0x2c4b*/ 876,
- /*0x1fe5*/ 804,
- -1,
- /*0xa725*/ 1035,
- -1,
- /*0x13a7*/ 531,
- -1,
- /*0x04a7*/ 371,
- /*0x1f22*/ 752,
- /*0x2d04*/ 961,
- /*0x1f37*/ 765,
- /*0x1e27*/ 632,
- /*0x1ea7*/ 691,
- /*0x0127*/ 75,
- /*0x2ca7*/ 923,
- -1, -1,
- /*0xa723*/ 1034,
- -1,
- /*0x2d11*/ 974,
- -1, -1,
- /*0x2c43*/ 868,
- -1,
- /*0x1f35*/ 763,
- /*0x00ee*/ 39,
- -1,
- /*0x047b*/ 353,
- /*0x04fb*/ 413,
- -1,
- /*0x0233*/ 189,
- /*0x104fb*/ 1202,
- /*0x1e7b*/ 674,
- /*0x1efb*/ 733,
- /*0x13b1*/ 541,
- /*0x0431*/ 293,
- /*0x04b1*/ 376,
- /*0x00f3*/ 44,
- /*0x10431*/ 1136,
- -1,
- /*0x1e31*/ 637,
- /*0x1eb1*/ 696,
- -1,
- /*0x2cb1*/ 928,
- /*0x2c41*/ 866,
- /*0x03fb*/ 291,
- /*0x0240*/ 192,
- /*0x0566*/ 445,
- /*0x16e6d*/ 1299,
- /*0x047d*/ 354,
- /*0x04fd*/ 414,
- /*0x1f33*/ 761,
- -1,
- /*0x03b1*/ 246,
- /*0x1e7d*/ 675,
- /*0x1efd*/ 734,
- /*0xff57*/ 1123,
- /*0x047f*/ 355,
- /*0x04ff*/ 415,
- /*0x1d7d*/ 611,
- -1, -1,
- /*0x1e7f*/ 676,
- /*0x1eff*/ 735,
- /*0x13bd*/ 553,
- /*0x043d*/ 305,
- /*0x04bd*/ 382,
- /*0x1f40*/ 766,
- /*0x1043d*/ 1148,
- /*0xa791*/ 1080,
- /*0x1e3d*/ 643,
- /*0x1ebd*/ 702,
- /*0x01bf*/ 137,
- /*0x2cbd*/ 934,
- -1, -1,
- /*0x1e93f*/ 1347,
- -1,
- /*0x056c*/ 451,
- /*0x2c47*/ 872,
- -1, -1, -1,
- /*0x03bd*/ 258,
- /*0x00f5*/ 46,
- -1,
- /*0x007a*/ 24,
- -1,
- /*0x104fa*/ 1201,
- /*0x1f79*/ 793,
- -1,
- /*0x017a*/ 114,
- /*0xa727*/ 1036,
- /*0x2c45*/ 870,
- /*0x13b9*/ 549,
- /*0x0439*/ 301,
- /*0x04b9*/ 380,
- /*0x022d*/ 186,
- /*0x10439*/ 1144,
- -1,
- /*0x1e39*/ 641,
- /*0x1eb9*/ 700,
- /*0x1e922*/ 1318,
- /*0x2cb9*/ 932,
- /*0x1e937*/ 1339,
- -1,
- /*0x13c2*/ 558,
- /*0x0442*/ 310,
- /*0x04c2*/ 384,
- -1,
- /*0x10442*/ 1153,
- -1,
- /*0x0225*/ 182,
- /*0x03b9*/ 254,
- /*0x0142*/ 87,
- /*0x13d0*/ 572,
- /*0x0450*/ 324,
- -1,
- /*0x1e935*/ 1337,
- /*0x13f2*/ 606,
- -1,
- /*0x2c66*/ 898,
- /*0x0072*/ 16,
- /*0x2d24*/ 993,
- /*0x104f2*/ 1193,
- -1,
- /*0x0223*/ 181,
- -1,
- /*0x2d1d*/ 986,
- /*0x24d0*/ 823,
- /*0x118c0*/ 1254,
- /*0xff51*/ 1117,
- -1,
- /*0x1f25*/ 755,
- -1, -1,
- /*0xa7c3*/ 1099,
- -1,
- /*0x03f2*/ 288,
- /*0x020f*/ 172,
- -1,
- /*0x2c3f*/ 864,
- -1,
- /*0xa77f*/ 1074,
- -1,
- /*0x1e933*/ 1335,
- /*0xff53*/ 1119,
- /*0x1f23*/ 753,
- -1,
- /*0x16e71*/ 1303,
- -1,
- /*0xa73d*/ 1046,
- /*0x2c6c*/ 901,
- /*0x13bb*/ 551,
- /*0x043b*/ 303,
- /*0x04bb*/ 381,
- -1,
- /*0x1043b*/ 1146,
- -1,
- /*0x1e3b*/ 642,
- /*0x1ebb*/ 701,
- /*0x1e940*/ 1348,
- /*0x2cbb*/ 933,
- /*0x0201*/ 165,
- -1, -1, -1,
- /*0x10fd*/ 521,
- -1,
- /*0x2c37*/ 856,
- /*0xa77a*/ 1072,
- -1,
- /*0x03bb*/ 256,
- -1,
- /*0x0579*/ 464,
- /*0x10ff*/ 523,
- /*0x16e6e*/ 1300,
- -1,
- /*0xa79d*/ 1086,
- /*0x01f9*/ 161,
- /*0x017c*/ 115,
- /*0xa739*/ 1044,
- -1,
- /*0x2c35*/ 854,
- /*0x1f01*/ 737,
- /*0x13af*/ 539,
- -1,
- /*0x04af*/ 375,
- /*0x16e73*/ 1305,
- /*0x1042f*/ 1134,
- -1,
- /*0x1e2f*/ 636,
- /*0x1eaf*/ 695,
- /*0x012f*/ 79,
- /*0x2caf*/ 927,
- -1, -1,
- /*0x1e05*/ 615,
- /*0x1e85*/ 679,
- /*0x0105*/ 58,
- /*0x2c85*/ 906,
- /*0x0227*/ 183,
- /*0x10fa*/ 520,
- /*0x052d*/ 438,
- /*0x03af*/ 245,
- -1, -1,
- /*0x13a9*/ 533,
- /*0x01ad*/ 131,
- /*0x04a9*/ 372,
- /*0x2c33*/ 852,
- /*0x10429*/ 1128,
- /*0x1e92d*/ 1329,
- /*0x1e29*/ 633,
- /*0x1ea9*/ 692,
- /*0x0129*/ 76,
- /*0x2ca9*/ 924,
- -1,
- /*0x0525*/ 434,
- -1,
- /*0x10cc2*/ 1205,
- -1,
- /*0x1f27*/ 757,
- /*0x01a5*/ 129,
- -1, -1,
- /*0x2c40*/ 865,
- /*0x1e925*/ 1321,
- -1,
- /*0x10cd0*/ 1219,
- /*0x0231*/ 188,
- /*0x2d22*/ 991,
- /*0x0523*/ 433,
- /*0x10cf2*/ 1253,
- /*0x10d0*/ 478,
- /*0x16e75*/ 1307,
- -1,
- /*0x01a3*/ 128,
- /*0x10f2*/ 512,
- -1,
- /*0xa73b*/ 1045,
- /*0x1e923*/ 1319,
- /*0x1fd1*/ 801,
- /*0x1f7b*/ 795,
- /*0x027d*/ 223,
- /*0x050f*/ 423,
- -1,
- /*0xff55*/ 1121,
- /*0x13ce*/ 570,
- /*0x044e*/ 322,
- /*0x04ce*/ 390,
- /*0x1f31*/ 759,
- /*0x1044e*/ 1165,
- -1, -1,
- /*0xa7bf*/ 1098,
- /*0x0477*/ 351,
- /*0x04f7*/ 411,
- /*0x0077*/ 21,
- /*0xa77c*/ 1073,
- /*0x104f7*/ 1198,
- /*0x1e77*/ 672,
- /*0x1ef7*/ 731,
- /*0x0177*/ 113,
- -1,
- /*0x1f7d*/ 797,
- -1,
- /*0x03ce*/ 274,
- -1,
- /*0x0501*/ 416,
- -1, -1,
- /*0xa72f*/ 1040,
- /*0x1e03*/ 614,
- /*0x1e83*/ 678,
- /*0x0103*/ 57,
- /*0x2c83*/ 905,
- /*0x13e8*/ 596,
- /*0xff4f*/ 1115,
- -1,
- /*0x0068*/ 7,
- -1,
- /*0x104e8*/ 1183,
- /*0xa7b7*/ 1094,
- /*0x13c6*/ 562,
- /*0x0446*/ 314,
- /*0x04c6*/ 386,
- -1,
- /*0x10446*/ 1157,
- -1,
- /*0x13f0*/ 604,
- /*0x24e8*/ 847,
- /*0x0146*/ 89,
- /*0x0070*/ 14,
- /*0xa729*/ 1037,
- /*0x104f0*/ 1191,
- -1,
- /*0xa7b5*/ 1093,
- -1, -1,
- /*0x1f7a*/ 794,
- -1,
- /*0x0242*/ 193,
- /*0x03c6*/ 266,
- -1, -1,
- /*0x0499*/ 364,
- /*0x0527*/ 435,
- -1, -1,
- /*0x1e19*/ 625,
- /*0x0250*/ 199,
- /*0x0119*/ 68,
- /*0x2c99*/ 916,
- -1,
- /*0x0272*/ 221,
- /*0x1e927*/ 1323,
- /*0x0581*/ 472,
- -1,
- /*0xff49*/ 1109,
- -1, -1,
- /*0x037b*/ 239,
- /*0x1f42*/ 768,
- -1, -1,
- /*0x00e6*/ 31,
- -1,
- /*0x057b*/ 466,
- -1,
- /*0x13c4*/ 560,
- /*0x0444*/ 312,
- /*0x04c4*/ 385,
- /*0x01fb*/ 162,
- /*0x10444*/ 1155,
- -1,
- /*0x1f72*/ 786,
- -1,
- /*0x0144*/ 88,
- -1, -1,
- /*0x2d2d*/ 996,
- -1, -1,
- /*0x037d*/ 241,
- /*0x1e931*/ 1333,
- -1, -1, -1,
- /*0x03c4*/ 264,
- /*0x057d*/ 468,
- /*0x2179*/ 815,
- /*0x13d6*/ 578,
- /*0x0456*/ 330,
- -1,
- /*0x01fd*/ 163,
- /*0x2d25*/ 994,
- /*0x00ec*/ 37,
- /*0x057f*/ 470,
- -1, -1,
- /*0x029d*/ 234,
- /*0x10cce*/ 1217,
- /*0x01ff*/ 164,
- -1, -1,
- /*0x24d6*/ 829,
- -1,
- /*0xff4d*/ 1113,
- -1,
- /*0x2d23*/ 992,
- /*0x01bd*/ 136,
- /*0x0495*/ 362,
- -1,
- /*0x10f7*/ 517,
- /*0x1e93d*/ 1345,
- /*0x1e15*/ 623,
- /*0x1e95*/ 687,
- /*0x0115*/ 66,
- /*0x2c95*/ 914,
- -1,
- /*0x022f*/ 187,
- -1,
- /*0x2d0f*/ 972,
- -1,
- /*0x057a*/ 465,
- /*0x118c2*/ 1256,
- /*0x0205*/ 167,
- -1,
- /*0x1f7c*/ 796,
- /*0xff4b*/ 1111,
- /*0x10ce8*/ 1243,
- -1, -1, -1,
- /*0x118d0*/ 1270,
- /*0x10e8*/ 502,
- /*0x13ea*/ 598,
- /*0x10cc6*/ 1209,
- -1,
- /*0x006a*/ 8,
- /*0x01b9*/ 135,
- /*0x104ea*/ 1185,
- /*0x0229*/ 184,
- /*0x10cf0*/ 1251,
- /*0x1e939*/ 1341,
- /*0xa7a5*/ 1090,
- /*0x2d01*/ 958,
- /*0x1f05*/ 741,
- /*0x10f0*/ 510,
- /*0x2c31*/ 850,
- -1,
- /*0xff43*/ 1103,
- -1, -1, -1, -1,
- /*0x1e942*/ 1350,
- -1, -1,
- /*0xa7a3*/ 1089,
- /*0x0572*/ 457,
- /*0x01d0*/ 142,
- /*0x13a1*/ 525,
- -1,
- /*0x04a1*/ 368,
- -1, -1, -1,
- /*0x1e21*/ 629,
- /*0x1ea1*/ 688,
- /*0x0121*/ 72,
- /*0x2ca1*/ 920,
- /*0xa691*/ 1028,
- /*0xff41*/ 1101,
- /*0x1e07*/ 616,
- /*0x1e87*/ 680,
- /*0x0107*/ 59,
- /*0x2c87*/ 907,
- -1,
- /*0x2c3d*/ 862,
- -1,
- /*0x0493*/ 361,
- -1,
- /*0x10cc4*/ 1207,
- /*0x2d27*/ 995,
- /*0x1e13*/ 622,
- /*0x1e93*/ 686,
- /*0x0113*/ 65,
- /*0x2c93*/ 913,
- -1, -1,
- /*0x13ab*/ 535,
- /*0x00f9*/ 49,
- /*0x04ab*/ 373,
- -1,
- /*0x1042b*/ 1130,
- /*0xa781*/ 1075,
- /*0x1e2b*/ 634,
- /*0x1eab*/ 693,
- /*0x012b*/ 77,
- /*0x2cab*/ 925,
- /*0x13e4*/ 592,
- /*0x0203*/ 166,
- /*0x1e93b*/ 1343,
- /*0x0064*/ 3,
- /*0x10cd6*/ 1225,
- /*0x104e4*/ 1179,
- /*0x037c*/ 240,
- /*0xff47*/ 1107,
- /*0x2c39*/ 858,
- /*0x10d6*/ 484,
- /*0x1f77*/ 791,
- /*0x0268*/ 214,
- /*0x057c*/ 467,
- /*0x13e2*/ 590,
- /*0x24e4*/ 843,
- /*0x16e66*/ 1292,
- /*0x0062*/ 1,
- -1,
- /*0x104e2*/ 1177,
- -1,
- /*0x2c42*/ 867,
- /*0xff45*/ 1105,
- /*0x1f03*/ 739,
- -1, -1,
- /*0x052f*/ 439,
- -1,
- /*0x24e2*/ 841,
- -1,
- /*0x2c50*/ 881,
- -1,
- /*0x0505*/ 418,
- -1,
- /*0xa7a7*/ 1091,
- /*0x1e92f*/ 1331,
- -1,
- /*0x0185*/ 119,
- /*0x13e0*/ 588,
- /*0x0219*/ 177,
- /*0x13da*/ 582,
- /*0x045a*/ 334,
- -1,
- /*0x104e0*/ 1175,
- /*0x217b*/ 817,
- /*0x104da*/ 1169,
- /*0x1f70*/ 784,
- /*0x16e6c*/ 1298,
- /*0x0529*/ 436,
- /*0x0078*/ 22,
- /*0x10cea*/ 1245,
- /*0x104f8*/ 1199,
- /*0x24e0*/ 839,
- -1,
- /*0x24da*/ 833,
- /*0x10ea*/ 504,
- -1,
- /*0x1e929*/ 1325,
- /*0x13dc*/ 584,
- /*0x045c*/ 336,
- /*0x13cc*/ 568,
- /*0x044c*/ 320,
- /*0x04cc*/ 389,
- /*0x104dc*/ 1171,
- /*0x1044c*/ 1163,
- /*0x03f8*/ 290,
- /*0x217d*/ 819,
- /*0x118ce*/ 1268,
- /*0x2c3b*/ 860,
- -1,
- /*0x13d8*/ 580,
- /*0x0458*/ 332,
- /*0x24dc*/ 835,
- -1,
- /*0x217f*/ 821,
- /*0x104d8*/ 1167,
- -1, -1,
- /*0xa72b*/ 1038,
- /*0x03cc*/ 272,
- /*0x0585*/ 476,
- /*0x13d4*/ 576,
- /*0x0454*/ 328,
- -1,
- /*0x24d8*/ 831,
- -1,
- /*0x1f44*/ 770,
- /*0x0256*/ 204,
- /*0x13d2*/ 574,
- /*0x0452*/ 326,
- /*0x0377*/ 238,
- -1, -1,
- /*0xa7bd*/ 1097,
- /*0x01ce*/ 141,
- /*0x24d4*/ 827,
- /*0x0577*/ 462,
- -1, -1,
- /*0x017e*/ 116,
- /*0x0497*/ 363,
- /*0x217a*/ 816,
- /*0x24d2*/ 825,
- /*0x118c6*/ 1260,
- /*0x1e17*/ 624,
- /*0x0215*/ 175,
- /*0x0117*/ 67,
- /*0x2c97*/ 915,
- /*0x0503*/ 417,
- -1,
- /*0x0076*/ 20,
- /*0x13f4*/ 608,
- /*0x104f6*/ 1197,
- /*0x0183*/ 118,
- /*0x0074*/ 18,
- /*0x10ce4*/ 1239,
- /*0x104f4*/ 1195,
- -1,
- /*0x0568*/ 447,
- -1,
- /*0x10e4*/ 498,
- /*0x13bc*/ 552,
- /*0x043c*/ 304,
- /*0xa7b9*/ 1095,
- -1,
- /*0x1043c*/ 1147,
- /*0x1f15*/ 749,
- -1,
- /*0x10ce2*/ 1237,
- /*0x013c*/ 84,
- /*0x01c6*/ 138,
- /*0x0570*/ 455,
- /*0x026a*/ 216,
- /*0x10e2*/ 496,
- /*0x13c8*/ 564,
- /*0x0448*/ 316,
- /*0x04c8*/ 387,
- /*0x2172*/ 808,
- /*0x10448*/ 1159,
- -1,
- /*0x03bc*/ 257,
- -1,
- /*0x0148*/ 90,
- /*0x16e79*/ 1311,
- -1,
- /*0x0519*/ 428,
- /*0x00fb*/ 51,
- -1, -1,
- /*0x118c4*/ 1258,
- /*0x0199*/ 124,
- -1,
- /*0x10ce0*/ 1235,
- /*0x03c8*/ 268,
- /*0x10cda*/ 1229,
- -1,
- /*0x0583*/ 474,
- /*0x10e0*/ 494,
- -1,
- /*0x10da*/ 488,
- -1, -1, -1,
- /*0x2c4e*/ 879,
- /*0x0207*/ 168,
- /*0x10f8*/ 518,
- -1, -1,
- /*0x00fd*/ 53,
- -1,
- /*0x2d05*/ 962,
- /*0x118d6*/ 1276,
- /*0x10cdc*/ 1231,
- -1,
- /*0x10ccc*/ 1215,
- /*0x0213*/ 174,
- /*0x00ff*/ 55,
- /*0x10dc*/ 490,
- -1,
- /*0x1f21*/ 751,
- -1, -1,
- /*0xa7bb*/ 1096,
- -1,
- /*0x10cd8*/ 1227,
- /*0x1f07*/ 743,
- -1,
- /*0x022b*/ 185,
- -1,
- /*0x10d8*/ 486,
- /*0x217c*/ 818,
- -1,
- /*0x2c68*/ 899,
- -1, -1,
- /*0x10cd4*/ 1223,
- /*0x1f13*/ 747,
- -1,
- /*0x01d6*/ 145,
- /*0x2c46*/ 871,
- /*0x10d4*/ 482,
- -1,
- /*0x10cd2*/ 1221,
- /*0x00fa*/ 50,
- /*0x13ca*/ 566,
- /*0x044a*/ 318,
- /*0x04ca*/ 388,
- /*0x10d2*/ 480,
- /*0x1044a*/ 1161,
- /*0x2184*/ 822,
- /*0x10fe*/ 522,
- /*0x0515*/ 426,
- -1, -1, -1, -1,
- /*0x0195*/ 123,
- -1,
- /*0x1f64*/ 780,
- -1,
- /*0xa785*/ 1077,
- /*0x13b6*/ 546,
- /*0x0436*/ 298,
- /*0x03ca*/ 270,
- -1,
- /*0x10436*/ 1141,
- /*0x10f6*/ 516,
- -1,
- /*0x13b4*/ 544,
- /*0x0434*/ 296,
- /*0x10f4*/ 514,
- /*0x1f62*/ 778,
- /*0x10434*/ 1139,
- -1,
- /*0x0260*/ 209,
- -1,
- /*0xa7a9*/ 1092,
- /*0x048d*/ 358,
- /*0x056a*/ 449,
- /*0x00f2*/ 43,
- /*0x03b6*/ 251,
- /*0x1e0d*/ 619,
- /*0x1e8d*/ 683,
- /*0x010d*/ 62,
- /*0x2c8d*/ 910,
- /*0x2c44*/ 869,
- /*0x2d03*/ 960,
- /*0x03b4*/ 249,
- /*0x10cc8*/ 1211,
- /*0x1e09*/ 617,
- /*0x1e89*/ 681,
- /*0x0109*/ 60,
- /*0x2c89*/ 908,
- -1,
- /*0x025c*/ 208,
- /*0x1f60*/ 776,
- -1, -1,
- /*0x13b0*/ 540,
- /*0x0430*/ 292,
- /*0x13de*/ 586,
- /*0x045e*/ 338,
- /*0x10430*/ 1135,
- /*0x1f78*/ 792,
- /*0x0521*/ 432,
- /*0x104de*/ 1173,
- /*0x214e*/ 805,
- /*0x2c56*/ 887,
- -1,
- /*0x01a1*/ 127,
- /*0x0507*/ 419,
- -1,
- /*0x049f*/ 367,
- /*0x2177*/ 813,
- /*0x24de*/ 837,
- -1,
- /*0x1e1f*/ 628,
- /*0x0254*/ 203,
- /*0x011f*/ 71,
- /*0x2c9f*/ 919,
- -1,
- /*0x0513*/ 425,
- -1,
- /*0x2d19*/ 982,
- /*0x0252*/ 201,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x00fc*/ 52,
- /*0x052b*/ 437,
- /*0x0217*/ 176,
- -1,
- /*0xa783*/ 1076,
- /*0x16e7b*/ 1313,
- -1, -1, -1, -1,
- /*0x1e92b*/ 1327,
- /*0x0564*/ 443,
- -1, -1, -1, -1,
- /*0x2170*/ 806,
- -1, -1, -1,
- /*0x2c6a*/ 900,
- -1, -1, -1,
- /*0x0562*/ 441,
- /*0x023c*/ 190,
- /*0x10cca*/ 1213,
- /*0x16e7d*/ 1315,
- /*0x118da*/ 1280,
- -1, -1, -1,
- /*0x1f76*/ 790,
- -1, -1,
- /*0x16e7f*/ 1317,
- /*0x1f74*/ 788,
- -1, -1, -1, -1,
- /*0xa799*/ 1084,
- -1, -1,
- /*0xa68f*/ 1027,
- -1,
- /*0x118dc*/ 1282,
- -1,
- /*0x118cc*/ 1266,
- -1, -1, -1, -1, -1, -1,
- /*0x01da*/ 147,
- /*0x0578*/ 463,
- /*0x2d15*/ 978,
- /*0x118d8*/ 1278,
- -1, -1, -1,
- /*0x16e7a*/ 1312,
- -1, -1, -1, -1, -1,
- /*0xa681*/ 1020,
- /*0x118d4*/ 1274,
- -1, -1, -1,
- /*0x01dc*/ 148,
- -1,
- /*0x01cc*/ 140,
- /*0x118d2*/ 1272,
- -1, -1, -1, -1, -1,
- /*0x10cde*/ 1233,
- -1, -1,
- /*0x01d8*/ 146,
- -1,
- /*0x10de*/ 492,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x01d4*/ 144,
- -1,
- /*0x16e72*/ 1304,
- -1, -1,
- /*0x057e*/ 469,
- -1,
- /*0x01d2*/ 143,
- -1,
- /*0x00e8*/ 33,
- -1, -1,
- /*0x0517*/ 427,
- -1,
- /*0x2d21*/ 990,
- -1, -1, -1, -1, -1,
- /*0x2d07*/ 964,
- /*0x0576*/ 461,
- /*0x00f0*/ 41,
- /*0xff42*/ 1102,
- -1,
- /*0x0574*/ 459,
- /*0x118c8*/ 1262,
- -1,
- /*0x2c5a*/ 891,
- -1, -1,
- /*0x2d13*/ 976,
- /*0xff50*/ 1116,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x020d*/ 171,
- /*0x1e93c*/ 1344,
- -1,
- /*0x2c5c*/ 893,
- -1,
- /*0x2c4c*/ 877,
- -1,
- /*0x1f36*/ 764,
- /*0x0209*/ 169,
- -1, -1, -1,
- /*0x16e7c*/ 1314,
- -1,
- /*0x1f34*/ 762,
- /*0x2c58*/ 889,
- -1, -1, -1,
- /*0x1fb1*/ 799,
- -1,
- /*0xa7a1*/ 1088,
- -1, -1, -1, -1,
- /*0x2c54*/ 885,
- /*0xa787*/ 1078,
- -1, -1, -1, -1, -1,
- /*0x2c52*/ 883,
- -1,
- /*0x021f*/ 180,
- -1, -1,
- /*0xa793*/ 1081,
- -1, -1, -1, -1, -1,
- /*0x1f30*/ 758,
- -1, -1, -1,
- /*0x0283*/ 226,
- -1, -1, -1,
- /*0x2c76*/ 903,
- /*0x118ca*/ 1264,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x2c3c*/ 861,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x2c48*/ 873,
- -1, -1, -1, -1, -1, -1,
- /*0x00ea*/ 35,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x2178*/ 814,
- /*0x16e77*/ 1309,
- -1,
- /*0x01b6*/ 134,
- -1, -1,
- /*0x1fd0*/ 800,
- /*0x1e936*/ 1338,
- -1, -1,
- /*0x01b4*/ 133,
- -1,
- /*0x050d*/ 422,
- /*0x2d17*/ 980,
- /*0x1e934*/ 1336,
- /*0x118de*/ 1284,
- -1, -1, -1, -1,
- /*0x0509*/ 420,
- -1, -1,
- /*0x16e68*/ 1294,
- -1, -1, -1, -1,
- /*0xff4e*/ 1114,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x16e70*/ 1302,
- -1, -1, -1,
- /*0x01b0*/ 132,
- -1, -1, -1,
- /*0x1e930*/ 1332,
- /*0x217e*/ 820,
- -1,
- /*0x051f*/ 431,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x2c4a*/ 875,
- -1,
- /*0x00e4*/ 29,
- -1,
- /*0xa685*/ 1022,
- -1,
- /*0x2176*/ 812,
- -1,
- /*0xa797*/ 1083,
- /*0xff46*/ 1106,
- /*0x2174*/ 810,
- -1, -1, -1, -1,
- /*0x00e2*/ 27,
- -1,
- /*0x2c36*/ 855,
- -1, -1, -1, -1, -1, -1,
- /*0x2c34*/ 853,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x00e0*/ 25,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x00f8*/ 48,
- -1, -1, -1, -1, -1, -1,
- /*0x2c30*/ 849,
- /*0xff44*/ 1104,
- /*0x2c5e*/ 895,
- -1, -1, -1, -1,
- /*0x0287*/ 227,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0xff56*/ 1122,
- -1, -1,
- /*0xa683*/ 1021,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x16e6a*/ 1296,
- -1, -1, -1,
- /*0x00fe*/ 54,
- -1, -1,
- /*0x2d0d*/ 970,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x2d09*/ 966,
- -1, -1, -1, -1,
- /*0x00f6*/ 47,
- -1, -1, -1,
- /*0x00f4*/ 45,
- -1, -1, -1, -1,
- /*0xa699*/ 1032,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x2d1f*/ 988,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0x16e64*/ 1290,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- /*0x16e62*/ 1288,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0xa79f*/ 1087,
- -1, -1,
- /*0xa695*/ 1030,
- -1, -1, -1, -1, -1, -1,
- /*0x16e60*/ 1286,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x16e78*/ 1310,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0xff5a*/ 1126,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0xa687*/ 1023,
- /*0x16e7e*/ 1316,
- -1, -1,
- /*0xff4c*/ 1112,
- -1, -1, -1, -1, -1, -1,
- /*0xa693*/ 1029,
- -1, -1,
- /*0xff58*/ 1124,
- -1, -1,
- /*0x16e76*/ 1308,
- -1, -1, -1,
- /*0x16e74*/ 1306,
- -1, -1, -1,
- /*0xff54*/ 1120,
- -1, -1, -1, -1, -1, -1,
- /*0xff52*/ 1118,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1,
- /*0xff48*/ 1108,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1,
- /*0x1fe0*/ 802,
- /*0x0289*/ 229,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0xa697*/ 1031,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1,
- /*0xff4a*/ 1110,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1,
- /*0xa68d*/ 1026,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0xa689*/ 1024,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1,
- -1,
- /*0x1fb0*/ 798
- };
-
- 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/12.1.0/name2ctype.h b/enc/unicode/12.1.0/name2ctype.h
deleted file mode 100644
index b2270d5cac..0000000000
--- a/enc/unicode/12.1.0/name2ctype.h
+++ /dev/null
@@ -1,41810 +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[] = {
- 679,
- 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,
- 0x0560, 0x0588,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 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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x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 0x0dbb,
- 0x0dbd, 0x0dbd,
- 0x0dc0, 0x0dc6,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e46,
- 0x0e4d, 0x0e4d,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x108f,
- 0x109a, 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,
- 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, 0x1878,
- 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, 0x1c36,
- 0x1c4d, 0x1c4f,
- 0x1c5a, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1cfa, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa674, 0xa67b,
- 0xa67f, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa805,
- 0xa807, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8c5, 0xa8c5,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 0xa8ff,
- 0xa90a, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9cf,
- 0xa9e0, 0xa9ef,
- 0xa9fa, 0xa9fe,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf5,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab67,
- 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, 0x10a35,
- 0x10a60, 0x10a7c,
- 0x10a80, 0x10a9c,
- 0x10ac0, 0x10ac7,
- 0x10ac9, 0x10ae4,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10b80, 0x10b91,
- 0x10c00, 0x10c48,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x10d00, 0x10d27,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x11045,
- 0x11082, 0x110b8,
- 0x110d0, 0x110e8,
- 0x11100, 0x11132,
- 0x11144, 0x11146,
- 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,
- 0x1145f, 0x1145f,
- 0x11480, 0x114c1,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115b5,
- 0x115b8, 0x115be,
- 0x115d8, 0x115dd,
- 0x11600, 0x1163e,
- 0x11640, 0x11640,
- 0x11644, 0x11644,
- 0x11680, 0x116b5,
- 0x116b8, 0x116b8,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172a,
- 0x11800, 0x11838,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119df,
- 0x119e1, 0x119e1,
- 0x119e3, 0x119e4,
- 0x11a00, 0x11a32,
- 0x11a35, 0x11a3e,
- 0x11a50, 0x11a97,
- 0x11a9d, 0x11a9d,
- 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d96,
- 0x11d98, 0x11d98,
- 0x11ee0, 0x11ef6,
- 0x12000, 0x12399,
- 0x12400, 0x1246e,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b40, 0x16b43,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e137, 0x1e13d,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2eb,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1e947, 0x1e947,
- 0x1e94b, 0x1e94b,
- 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[] = {
- 59,
- 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,
- 0x10d30, 0x10d39,
- 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,
- 0x11da0, 0x11da9,
- 0x16a60, 0x16a69,
- 0x16b50, 0x16b59,
- 0x1d7ce, 0x1d7ff,
- 0x1e140, 0x1e149,
- 0x1e2f0, 0x1e2f9,
- 0x1e950, 0x1e959,
-}; /* CR_Digit */
-
-/* 'Graph': [[:Graph:]] */
-static const OnigCodePoint CR_Graph[] = {
- 671,
- 0x0021, 0x007e,
- 0x00a1, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x07fd, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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, 0x09fe,
- 0x0a01, 0x0a03,
- 0x0a05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c,
- 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cc7,
- 0x1cd0, 0x1cfa,
- 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, 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, 0x2e4f,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3001, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 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, 0xab67,
- 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f59,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110cd, 0x110cd,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11146,
- 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145f,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x11800, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e4,
- 0x11a00, 0x11a47,
- 0x11a50, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef8,
- 0x11fc0, 0x11ff1,
- 0x11fff, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x13430, 0x13438,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
- 0x1e2c0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 0x1ec71, 0x1ecb4,
- 0x1ed01, 0x1ed3d,
- 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, 0x1f16c,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d5,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6fa,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d8,
- 0x1f7e0, 0x1f7eb,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 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[] = {
- 649,
- 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,
- 0x0560, 0x0588,
- 0x10d0, 0x10fa,
- 0x10fd, 0x10ff,
- 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,
- 0x1e4b, 0x1e4b,
- 0x1e4d, 0x1e4d,
- 0x1e4f, 0x1e4f,
- 0x1e51, 0x1e51,
- 0x1e53, 0x1e53,
- 0x1e55, 0x1e55,
- 0x1e57, 0x1e57,
- 0x1e59, 0x1e59,
- 0x1e5b, 0x1e5b,
-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0x1edb, 0x1edb,
- 0x1edd, 0x1edd,
- 0x1edf, 0x1edf,
- 0x1ee1, 0x1ee1,
- 0x1ee3, 0x1ee3,
- 0x1ee5, 0x1ee5,
- 0x1ee7, 0x1ee7,
- 0x1ee9, 0x1ee9,
- 0x1eeb, 0x1eeb,
- 0x1eed, 0x1eed,
- 0x1eef, 0x1eef,
- 0x1ef1, 0x1ef1,
- 0x1ef3, 0x1ef3,
- 0x1ef5, 0x1ef5,
- 0x1ef7, 0x1ef7,
- 0x1ef9, 0x1ef9,
- 0x1efb, 0x1efb,
- 0x1efd, 0x1efd,
- 0x1eff, 0x1f07,
- 0x1f10, 0x1f15,
- 0x1f20, 0x1f27,
- 0x1f30, 0x1f37,
- 0x1f40, 0x1f45,
- 0x1f50, 0x1f57,
- 0x1f60, 0x1f67,
- 0x1f70, 0x1f7d,
- 0x1f80, 0x1f87,
- 0x1f90, 0x1f97,
- 0x1fa0, 0x1fa7,
- 0x1fb0, 0x1fb4,
- 0x1fb6, 0x1fb7,
- 0x1fbe, 0x1fbe,
- 0x1fc2, 0x1fc4,
- 0x1fc6, 0x1fc7,
- 0x1fd0, 0x1fd3,
- 0x1fd6, 0x1fd7,
- 0x1fe0, 0x1fe7,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ff7,
- 0x2071, 0x2071,
- 0x207f, 0x207f,
- 0x2090, 0x209c,
- 0x210a, 0x210a,
- 0x210e, 0x210f,
- 0x2113, 0x2113,
- 0x212f, 0x212f,
- 0x2134, 0x2134,
- 0x2139, 0x2139,
- 0x213c, 0x213d,
- 0x2146, 0x2149,
- 0x214e, 0x214e,
- 0x2170, 0x217f,
- 0x2184, 0x2184,
- 0x24d0, 0x24e9,
- 0x2c30, 0x2c5e,
- 0x2c61, 0x2c61,
- 0x2c65, 0x2c66,
- 0x2c68, 0x2c68,
- 0x2c6a, 0x2c6a,
- 0x2c6c, 0x2c6c,
- 0x2c71, 0x2c71,
- 0x2c73, 0x2c74,
- 0x2c76, 0x2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xa647, 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,
- 0xa7af, 0xa7af,
- 0xa7b5, 0xa7b5,
- 0xa7b7, 0xa7b7,
- 0xa7b9, 0xa7b9,
- 0xa7bb, 0xa7bb,
- 0xa7bd, 0xa7bd,
- 0xa7bf, 0xa7bf,
- 0xa7c3, 0xa7c3,
- 0xa7f8, 0xa7fa,
- 0xab30, 0xab5a,
- 0xab5c, 0xab67,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x16e60, 0x16e7f,
- 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[] = {
- 668,
- 0x0020, 0x007e,
- 0x00a0, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x07fd, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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, 0x09fe,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x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,
- 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cc7,
- 0x1cd0, 0x1cfa,
- 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, 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, 0x2e4f,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 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, 0xab67,
- 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f59,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110cd, 0x110cd,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11146,
- 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145f,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x11800, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e4,
- 0x11a00, 0x11a47,
- 0x11a50, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef8,
- 0x11fc0, 0x11ff1,
- 0x11fff, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x13430, 0x13438,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
- 0x1e2c0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 0x1ec71, 0x1ecb4,
- 0x1ed01, 0x1ed3d,
- 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, 0x1f16c,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d5,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6fa,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d8,
- 0x1f7e0, 0x1f7eb,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 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[] = {
- 177,
- 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,
- 0x0a76, 0x0a76,
- 0x0af0, 0x0af0,
- 0x0c77, 0x0c77,
- 0x0c84, 0x0c84,
- 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,
- 0x166e, 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, 0x2e4f,
- 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,
- 0x10f55, 0x10f59,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x11140, 0x11143,
- 0x11174, 0x11175,
- 0x111c5, 0x111c8,
- 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,
- 0x1183b, 0x1183b,
- 0x119e2, 0x119e2,
- 0x11a3f, 0x11a46,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11c41, 0x11c45,
- 0x11c70, 0x11c71,
- 0x11ef7, 0x11ef8,
- 0x11fff, 0x11fff,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b3b,
- 0x16b44, 0x16b44,
- 0x16e97, 0x16e9a,
- 0x16fe2, 0x16fe2,
- 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[] = {
- 641,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1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 0x1ef8, 0x1ef8,
- 0x1efa, 0x1efa,
- 0x1efc, 0x1efc,
- 0x1efe, 0x1efe,
- 0x1f08, 0x1f0f,
- 0x1f18, 0x1f1d,
- 0x1f28, 0x1f2f,
- 0x1f38, 0x1f3f,
- 0x1f48, 0x1f4d,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f5f,
- 0x1f68, 0x1f6f,
- 0x1fb8, 0x1fbb,
- 0x1fc8, 0x1fcb,
- 0x1fd8, 0x1fdb,
- 0x1fe8, 0x1fec,
- 0x1ff8, 0x1ffb,
- 0x2102, 0x2102,
- 0x2107, 0x2107,
- 0x210b, 0x210d,
- 0x2110, 0x2112,
- 0x2115, 0x2115,
- 0x2119, 0x211d,
- 0x2124, 0x2124,
- 0x2126, 0x2126,
- 0x2128, 0x2128,
- 0x212a, 0x212d,
- 0x2130, 0x2133,
- 0x213e, 0x213f,
- 0x2145, 0x2145,
- 0x2160, 0x216f,
- 0x2183, 0x2183,
- 0x24b6, 0x24cf,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x2c82, 0x2c82,
- 0x2c84, 0x2c84,
- 0x2c86, 0x2c86,
- 0x2c88, 0x2c88,
- 0x2c8a, 0x2c8a,
- 0x2c8c, 0x2c8c,
- 0x2c8e, 0x2c8e,
- 0x2c90, 0x2c90,
- 0x2c92, 0x2c92,
- 0x2c94, 0x2c94,
- 0x2c96, 0x2c96,
- 0x2c98, 0x2c98,
- 0x2c9a, 0x2c9a,
- 0x2c9c, 0x2c9c,
- 0x2c9e, 0x2c9e,
- 0x2ca0, 0x2ca0,
- 0x2ca2, 0x2ca2,
- 0x2ca4, 0x2ca4,
- 0x2ca6, 0x2ca6,
- 0x2ca8, 0x2ca8,
- 0x2caa, 0x2caa,
- 0x2cac, 0x2cac,
- 0x2cae, 0x2cae,
- 0x2cb0, 0x2cb0,
- 0x2cb2, 0x2cb2,
- 0x2cb4, 0x2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0x2cf2, 0x2cf2,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 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,
- 0xa7b8, 0xa7b8,
- 0xa7ba, 0xa7ba,
- 0xa7bc, 0xa7bc,
- 0xa7be, 0xa7be,
- 0xa7c2, 0xa7c2,
- 0xa7c4, 0xa7c6,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x16e40, 0x16e5f,
- 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[] = {
- 716,
- 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,
- 0x0560, 0x0588,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x07fd, 0x07fd,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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,
- 0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 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa672,
- 0xa674, 0xa67d,
- 0xa67f, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c5,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 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, 0xab67,
- 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, 0x10a35,
- 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,
- 0x10d00, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f50,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x1107f, 0x110ba,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x1113f,
- 0x11144, 0x11146,
- 0x11150, 0x11173,
- 0x11176, 0x11176,
- 0x11180, 0x111c4,
- 0x111c9, 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x1144a,
- 0x11450, 0x11459,
- 0x1145e, 0x1145f,
- 0x11480, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115d8, 0x115dd,
- 0x11600, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x11739,
- 0x11800, 0x1183a,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e1,
- 0x119e3, 0x119e4,
- 0x11a00, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a50, 0x11a99,
- 0x11a9d, 0x11a9d,
- 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef6,
- 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,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2f9,
- 0x1e800, 0x1e8c4,
- 0x1e8d0, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 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[] = {
- 715,
- 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,
- 0x0560, 0x0588,
- 0x05b0, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 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,
- 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 0x0d10,
- 0x0d12, 0x0d3a,
- 0x0d3d, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4c,
- 0x0d4e, 0x0d4e,
- 0x0d54, 0x0d57,
- 0x0d5f, 0x0d63,
- 0x0d66, 0x0d6f,
- 0x0d7a, 0x0d7f,
- 0x0d82, 0x0d83,
- 0x0d85, 0x0d96,
- 0x0d9a, 0x0db1,
- 0x0db3, 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,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 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,
- 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, 0x1878,
- 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, 0x1c36,
- 0x1c40, 0x1c49,
- 0x1c4d, 0x1c7d,
- 0x1c80, 0x1c88,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1cfa, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66e,
- 0xa674, 0xa67b,
- 0xa67f, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa805,
- 0xa807, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c3,
- 0xa8c5, 0xa8c5,
- 0xa8d0, 0xa8d9,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 0xa92a,
- 0xa930, 0xa952,
- 0xa960, 0xa97c,
- 0xa980, 0xa9b2,
- 0xa9b4, 0xa9bf,
- 0xa9cf, 0xa9d9,
- 0xa9e0, 0xa9fe,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa60, 0xaa76,
- 0xaa7a, 0xaabe,
- 0xaac0, 0xaac0,
- 0xaac2, 0xaac2,
- 0xaadb, 0xaadd,
- 0xaae0, 0xaaef,
- 0xaaf2, 0xaaf5,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5a,
- 0xab5c, 0xab67,
- 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, 0x10a35,
- 0x10a60, 0x10a7c,
- 0x10a80, 0x10a9c,
- 0x10ac0, 0x10ac7,
- 0x10ac9, 0x10ae4,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10b80, 0x10b91,
- 0x10c00, 0x10c48,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x10d00, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x11045,
- 0x11066, 0x1106f,
- 0x11082, 0x110b8,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11132,
- 0x11136, 0x1113f,
- 0x11144, 0x11146,
- 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,
- 0x1145f, 0x1145f,
- 0x11480, 0x114c1,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115be,
- 0x115d8, 0x115dd,
- 0x11600, 0x1163e,
- 0x11640, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b5,
- 0x116b8, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172a,
- 0x11730, 0x11739,
- 0x11800, 0x11838,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119df,
- 0x119e1, 0x119e1,
- 0x119e3, 0x119e4,
- 0x11a00, 0x11a32,
- 0x11a35, 0x11a3e,
- 0x11a50, 0x11a97,
- 0x11a9d, 0x11a9d,
- 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d96,
- 0x11d98, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef6,
- 0x12000, 0x12399,
- 0x12400, 0x1246e,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b40, 0x16b43,
- 0x16b50, 0x16b59,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e137, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2eb,
- 0x1e2f0, 0x1e2f9,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1e947, 0x1e947,
- 0x1e94b, 0x1e94b,
- 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[] = {
- 182,
- 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,
- 0x0a76, 0x0a76,
- 0x0af0, 0x0af0,
- 0x0c77, 0x0c77,
- 0x0c84, 0x0c84,
- 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,
- 0x166e, 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, 0x2e4f,
- 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,
- 0x10f55, 0x10f59,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x11140, 0x11143,
- 0x11174, 0x11175,
- 0x111c5, 0x111c8,
- 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,
- 0x1183b, 0x1183b,
- 0x119e2, 0x119e2,
- 0x11a3f, 0x11a46,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11c41, 0x11c45,
- 0x11c70, 0x11c71,
- 0x11ef7, 0x11ef8,
- 0x11fff, 0x11fff,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b3b,
- 0x16b44, 0x16b44,
- 0x16e97, 0x16e9a,
- 0x16fe2, 0x16fe2,
- 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[] = {
- 666,
- 0x0000, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x07fd, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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, 0x09fe,
- 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, 0x0a76,
- 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,
-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- 0x0dd8, 0x0ddf,
- 0x0de6, 0x0def,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x1878,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 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 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e4f,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 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, 0xab67,
- 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f59,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110cd, 0x110cd,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11146,
- 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145f,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x11800, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e4,
- 0x11a00, 0x11a47,
- 0x11a50, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef8,
- 0x11fc0, 0x11ff1,
- 0x11fff, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x13430, 0x13438,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
- 0x1e2c0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 0x1ec71, 0x1ecb4,
- 0x1ed01, 0x1ed3d,
- 0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0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 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[] = {
- 668,
- 0x0000, 0x001f,
- 0x007f, 0x009f,
- 0x00ad, 0x00ad,
- 0x0378, 0x0379,
- 0x0380, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x0530, 0x0530,
- 0x0557, 0x0558,
- 0x058b, 0x058c,
- 0x0590, 0x0590,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ee,
- 0x05f5, 0x0605,
- 0x061c, 0x061d,
- 0x06dd, 0x06dd,
- 0x070e, 0x070f,
- 0x074b, 0x074c,
- 0x07b2, 0x07bf,
- 0x07fb, 0x07fc,
- 0x082e, 0x082f,
- 0x083f, 0x083f,
- 0x085c, 0x085d,
- 0x085f, 0x085f,
- 0x086b, 0x089f,
- 0x08b5, 0x08b5,
- 0x08be, 0x08d2,
- 0x08e2, 0x08e2,
- 0x0984, 0x0984,
- 0x098d, 0x098e,
- 0x0991, 0x0992,
- 0x09a9, 0x09a9,
- 0x09b1, 0x09b1,
- 0x09b3, 0x09b5,
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, 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,
- 0x1879, 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, 0x1aaf,
- 0x1abf, 0x1aff,
- 0x1b4c, 0x1b4f,
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 0x3097, 0x3098,
- 0x3100, 0x3104,
- 0x3130, 0x3130,
- 0x318f, 0x318f,
- 0x31bb, 0x31bf,
- 0x31e4, 0x31ef,
- 0x321f, 0x321f,
- 0x4db6, 0x4dbf,
- 0x9ff0, 0x9fff,
- 0xa48d, 0xa48f,
- 0xa4c7, 0xa4cf,
- 0xa62c, 0xa63f,
- 0xa6f8, 0xa6ff,
- 0xa7c0, 0xa7c1,
- 0xa7c7, 0xa7f6,
- 0xa82c, 0xa82f,
- 0xa83a, 0xa83f,
- 0xa878, 0xa87f,
- 0xa8c6, 0xa8cd,
- 0xa8da, 0xa8df,
- 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,
- 0xab68, 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, 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,
- 0x10a36, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a49, 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,
- 0x10d28, 0x10d2f,
- 0x10d3a, 0x10e5f,
- 0x10e7f, 0x10eff,
- 0x10f28, 0x10f2f,
- 0x10f5a, 0x10fdf,
- 0x10ff7, 0x10fff,
- 0x1104e, 0x11051,
- 0x11070, 0x1107e,
- 0x110bd, 0x110bd,
- 0x110c2, 0x110cf,
- 0x110e9, 0x110ef,
- 0x110fa, 0x110ff,
- 0x11135, 0x11135,
- 0x11147, 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, 0x1133a,
- 0x11345, 0x11346,
- 0x11349, 0x1134a,
- 0x1134e, 0x1134f,
- 0x11351, 0x11356,
- 0x11358, 0x1135c,
- 0x11364, 0x11365,
- 0x1136d, 0x1136f,
- 0x11375, 0x113ff,
- 0x1145a, 0x1145a,
- 0x1145c, 0x1145c,
- 0x11460, 0x1147f,
- 0x114c8, 0x114cf,
- 0x114da, 0x1157f,
- 0x115b6, 0x115b7,
- 0x115de, 0x115ff,
- 0x11645, 0x1164f,
- 0x1165a, 0x1165f,
- 0x1166d, 0x1167f,
- 0x116b9, 0x116bf,
- 0x116ca, 0x116ff,
- 0x1171b, 0x1171c,
- 0x1172c, 0x1172f,
- 0x11740, 0x117ff,
- 0x1183c, 0x1189f,
- 0x118f3, 0x118fe,
- 0x11900, 0x1199f,
- 0x119a8, 0x119a9,
- 0x119d8, 0x119d9,
- 0x119e5, 0x119ff,
- 0x11a48, 0x11a4f,
- 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, 0x11d5f,
- 0x11d66, 0x11d66,
- 0x11d69, 0x11d69,
- 0x11d8f, 0x11d8f,
- 0x11d92, 0x11d92,
- 0x11d99, 0x11d9f,
- 0x11daa, 0x11edf,
- 0x11ef9, 0x11fbf,
- 0x11ff2, 0x11ffe,
- 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, 0x16e3f,
- 0x16e9b, 0x16eff,
- 0x16f4b, 0x16f4e,
- 0x16f88, 0x16f8e,
- 0x16fa0, 0x16fdf,
- 0x16fe4, 0x16fff,
- 0x187f8, 0x187ff,
- 0x18af3, 0x1afff,
- 0x1b11f, 0x1b14f,
- 0x1b153, 0x1b163,
- 0x1b168, 0x1b16f,
- 0x1b2fc, 0x1bbff,
- 0x1bc6b, 0x1bc6f,
- 0x1bc7d, 0x1bc7f,
- 0x1bc89, 0x1bc8f,
- 0x1bc9a, 0x1bc9b,
- 0x1bca0, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d128,
- 0x1d173, 0x1d17a,
- 0x1d1e9, 0x1d1ff,
- 0x1d246, 0x1d2df,
- 0x1d2f4, 0x1d2ff,
- 0x1d357, 0x1d35f,
- 0x1d379, 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,
- 0x1da8c, 0x1da9a,
- 0x1daa0, 0x1daa0,
- 0x1dab0, 0x1dfff,
- 0x1e007, 0x1e007,
- 0x1e019, 0x1e01a,
- 0x1e022, 0x1e022,
- 0x1e025, 0x1e025,
- 0x1e02b, 0x1e0ff,
- 0x1e12d, 0x1e12f,
- 0x1e13e, 0x1e13f,
- 0x1e14a, 0x1e14d,
- 0x1e150, 0x1e2bf,
- 0x1e2fa, 0x1e2fe,
- 0x1e300, 0x1e7ff,
- 0x1e8c5, 0x1e8c6,
- 0x1e8d7, 0x1e8ff,
- 0x1e94c, 0x1e94f,
- 0x1e95a, 0x1e95d,
- 0x1e960, 0x1ec70,
- 0x1ecb5, 0x1ed00,
- 0x1ed3e, 0x1edff,
- 0x1ee04, 0x1ee04,
- 0x1ee20, 0x1ee20,
- 0x1ee23, 0x1ee23,
- 0x1ee25, 0x1ee26,
- 0x1ee28, 0x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x1f90c,
- 0x1f972, 0x1f972,
- 0x1f977, 0x1f979,
- 0x1f9a3, 0x1f9a4,
- 0x1f9ab, 0x1f9ad,
- 0x1f9cb, 0x1f9cc,
- 0x1fa54, 0x1fa5f,
- 0x1fa6e, 0x1fa6f,
- 0x1fa74, 0x1fa77,
- 0x1fa7b, 0x1fa7f,
- 0x1fa83, 0x1fa8f,
- 0x1fa96, 0x1ffff,
- 0x2a6d7, 0x2a6ff,
- 0x2b735, 0x2b73f,
- 0x2b81e, 0x2b81f,
- 0x2cea2, 0x2ceaf,
- 0x2ebe1, 0x2f7ff,
- 0x2fa1e, 0xe00ff,
- 0xe01f0, 0x10ffff,
-}; /* CR_C */
-
-/* 'Cc': General Category */
-#define CR_Cc CR_Cntrl
-
-/* 'Cf': General Category */
-static const OnigCodePoint CR_Cf[] = {
- 20,
- 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,
- 0x110cd, 0x110cd,
- 0x13430, 0x13438,
- 0x1bca0, 0x1bca3,
- 0x1d173, 0x1d17a,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
-}; /* CR_Cf */
-
-/* 'Cn': General Category */
-static const OnigCodePoint CR_Cn[] = {
- 666,
- 0x0378, 0x0379,
- 0x0380, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x0530, 0x0530,
- 0x0557, 0x0558,
- 0x058b, 0x058c,
- 0x0590, 0x0590,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ee,
- 0x05f5, 0x05ff,
- 0x061d, 0x061d,
- 0x070e, 0x070e,
- 0x074b, 0x074c,
- 0x07b2, 0x07bf,
- 0x07fb, 0x07fc,
- 0x082e, 0x082f,
- 0x083f, 0x083f,
- 0x085c, 0x085d,
- 0x085f, 0x085f,
- 0x086b, 0x089f,
- 0x08b5, 0x08b5,
- 0x08be, 0x08d2,
- 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,
- 0x09ff, 0x0a00,
- 0x0a04, 0x0a04,
- 0x0a0b, 0x0a0e,
- 0x0a11, 0x0a12,
- 0x0a29, 0x0a29,
- 0x0a31, 0x0a31,
- 0x0a34, 0x0a34,
- 0x0a37, 0x0a37,
- 0x0a3a, 0x0a3b,
- 0x0a3d, 0x0a3d,
- 0x0a43, 0x0a46,
- 0x0a49, 0x0a4a,
- 0x0a4e, 0x0a50,
- 0x0a52, 0x0a58,
- 0x0a5d, 0x0a5d,
- 0x0a5f, 0x0a65,
- 0x0a77, 0x0a80,
- 0x0a84, 0x0a84,
- 0x0a8e, 0x0a8e,
- 0x0a92, 0x0a92,
- 0x0aa9, 0x0aa9,
- 0x0ab1, 0x0ab1,
- 0x0ab4, 0x0ab4,
- 0x0aba, 0x0abb,
- 0x0ac6, 0x0ac6,
- 0x0aca, 0x0aca,
- 0x0ace, 0x0acf,
- 0x0ad1, 0x0adf,
- 0x0ae4, 0x0ae5,
- 0x0af2, 0x0af8,
- 0x0b00, 0x0b00,
- 0x0b04, 0x0b04,
- 0x0b0d, 0x0b0e,
- 0x0b11, 0x0b12,
- 0x0b29, 0x0b29,
- 0x0b31, 0x0b31,
- 0x0b34, 0x0b34,
- 0x0b3a, 0x0b3b,
- 0x0b45, 0x0b46,
- 0x0b49, 0x0b4a,
- 0x0b4e, 0x0b55,
- 0x0b58, 0x0b5b,
- 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x0de0, 0x0de5,
- 0x0df0, 0x0df1,
- 0x0df5, 0x0e00,
- 0x0e3b, 0x0e3e,
- 0x0e5c, 0x0e80,
- 0x0e83, 0x0e83,
- 0x0e85, 0x0e85,
- 0x0e8b, 0x0e8b,
- 0x0ea4, 0x0ea4,
- 0x0ea6, 0x0ea6,
- 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,
- 0x1879, 0x187f,
- 0x18ab, 0x18af,
- 0x18f6, 0x18ff,
- 0x191f, 0x191f,
- 0x192c, 0x192f,
- 0x193c, 0x193f,
- 0x1941, 0x1943,
- 0x196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,
- 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,
- 0x10a36, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a49, 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,
- 0x10d28, 0x10d2f,
- 0x10d3a, 0x10e5f,
- 0x10e7f, 0x10eff,
- 0x10f28, 0x10f2f,
- 0x10f5a, 0x10fdf,
- 0x10ff7, 0x10fff,
- 0x1104e, 0x11051,
- 0x11070, 0x1107e,
- 0x110c2, 0x110cc,
- 0x110ce, 0x110cf,
- 0x110e9, 0x110ef,
- 0x110fa, 0x110ff,
- 0x11135, 0x11135,
- 0x11147, 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, 0x1133a,
- 0x11345, 0x11346,
- 0x11349, 0x1134a,
- 0x1134e, 0x1134f,
- 0x11351, 0x11356,
- 0x11358, 0x1135c,
- 0x11364, 0x11365,
- 0x1136d, 0x1136f,
- 0x11375, 0x113ff,
- 0x1145a, 0x1145a,
- 0x1145c, 0x1145c,
- 0x11460, 0x1147f,
- 0x114c8, 0x114cf,
- 0x114da, 0x1157f,
- 0x115b6, 0x115b7,
- 0x115de, 0x115ff,
- 0x11645, 0x1164f,
- 0x1165a, 0x1165f,
- 0x1166d, 0x1167f,
- 0x116b9, 0x116bf,
- 0x116ca, 0x116ff,
- 0x1171b, 0x1171c,
- 0x1172c, 0x1172f,
- 0x11740, 0x117ff,
- 0x1183c, 0x1189f,
- 0x118f3, 0x118fe,
- 0x11900, 0x1199f,
- 0x119a8, 0x119a9,
- 0x119d8, 0x119d9,
- 0x119e5, 0x119ff,
- 0x11a48, 0x11a4f,
- 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, 0x11d5f,
- 0x11d66, 0x11d66,
- 0x11d69, 0x11d69,
- 0x11d8f, 0x11d8f,
- 0x11d92, 0x11d92,
- 0x11d99, 0x11d9f,
- 0x11daa, 0x11edf,
- 0x11ef9, 0x11fbf,
- 0x11ff2, 0x11ffe,
- 0x1239a, 0x123ff,
- 0x1246f, 0x1246f,
- 0x12475, 0x1247f,
- 0x12544, 0x12fff,
- 0x1342f, 0x1342f,
- 0x13439, 0x143ff,
- 0x14647, 0x167ff,
- 0x16a39, 0x16a3f,
- 0x16a5f, 0x16a5f,
- 0x16a6a, 0x16a6d,
- 0x16a70, 0x16acf,
- 0x16aee, 0x16aef,
- 0x16af6, 0x16aff,
- 0x16b46, 0x16b4f,
- 0x16b5a, 0x16b5a,
- 0x16b62, 0x16b62,
- 0x16b78, 0x16b7c,
- 0x16b90, 0x16e3f,
- 0x16e9b, 0x16eff,
- 0x16f4b, 0x16f4e,
- 0x16f88, 0x16f8e,
- 0x16fa0, 0x16fdf,
- 0x16fe4, 0x16fff,
- 0x187f8, 0x187ff,
- 0x18af3, 0x1afff,
- 0x1b11f, 0x1b14f,
- 0x1b153, 0x1b163,
- 0x1b168, 0x1b16f,
- 0x1b2fc, 0x1bbff,
- 0x1bc6b, 0x1bc6f,
- 0x1bc7d, 0x1bc7f,
- 0x1bc89, 0x1bc8f,
- 0x1bc9a, 0x1bc9b,
- 0x1bca4, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d128,
- 0x1d1e9, 0x1d1ff,
- 0x1d246, 0x1d2df,
- 0x1d2f4, 0x1d2ff,
- 0x1d357, 0x1d35f,
- 0x1d379, 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,
- 0x1da8c, 0x1da9a,
- 0x1daa0, 0x1daa0,
- 0x1dab0, 0x1dfff,
- 0x1e007, 0x1e007,
- 0x1e019, 0x1e01a,
- 0x1e022, 0x1e022,
- 0x1e025, 0x1e025,
- 0x1e02b, 0x1e0ff,
- 0x1e12d, 0x1e12f,
- 0x1e13e, 0x1e13f,
- 0x1e14a, 0x1e14d,
- 0x1e150, 0x1e2bf,
- 0x1e2fa, 0x1e2fe,
- 0x1e300, 0x1e7ff,
- 0x1e8c5, 0x1e8c6,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0x1f6ed, 0x1f6ef,
- 0x1f6fb, 0x1f6ff,
- 0x1f774, 0x1f77f,
- 0x1f7d9, 0x1f7df,
- 0x1f7ec, 0x1f7ff,
- 0x1f80c, 0x1f80f,
- 0x1f848, 0x1f84f,
- 0x1f85a, 0x1f85f,
- 0x1f888, 0x1f88f,
- 0x1f8ae, 0x1f8ff,
- 0x1f90c, 0x1f90c,
- 0x1f972, 0x1f972,
- 0x1f977, 0x1f979,
- 0x1f9a3, 0x1f9a4,
- 0x1f9ab, 0x1f9ad,
- 0x1f9cb, 0x1f9cc,
- 0x1fa54, 0x1fa5f,
- 0x1fa6e, 0x1fa6f,
- 0x1fa74, 0x1fa77,
- 0x1fa7b, 0x1fa7f,
- 0x1fa83, 0x1fa8f,
- 0x1fa96, 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[] = {
- 609,
- 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,
- 0x0560, 0x0588,
- 0x05d0, 0x05ea,
- 0x05ef, 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,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a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0e30,
- 0x0e32, 0x0e33,
- 0x0e40, 0x0e46,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1cfa, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa69d,
- 0xa6a0, 0xa6e5,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 0xa882, 0xa8b3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 0xa8fe,
- 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, 0xab67,
- 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, 0x10a35,
- 0x10a60, 0x10a7c,
- 0x10a80, 0x10a9c,
- 0x10ac0, 0x10ac7,
- 0x10ac9, 0x10ae4,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10b80, 0x10b91,
- 0x10c00, 0x10c48,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x10d00, 0x10d23,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10fe0, 0x10ff6,
- 0x11003, 0x11037,
- 0x11083, 0x110af,
- 0x110d0, 0x110e8,
- 0x11103, 0x11126,
- 0x11144, 0x11144,
- 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,
- 0x1145f, 0x1145f,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x116b8, 0x116b8,
- 0x11700, 0x1171a,
- 0x11800, 0x1182b,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d0,
- 0x119e1, 0x119e1,
- 0x119e3, 0x119e3,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a89,
- 0x11a9d, 0x11a9d,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d89,
- 0x11d98, 0x11d98,
- 0x11ee0, 0x11ef2,
- 0x12000, 0x12399,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b40, 0x16b43,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f50, 0x16f50,
- 0x16f93, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 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54, 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[] = {
- 131,
- 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,
- 0x0560, 0x0588,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fd, 0x10ff,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 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, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7fa, 0xa7fa,
- 0xab30, 0xab5a,
- 0xab60, 0xab67,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0x10400, 0x1044f,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x118a0, 0x118df,
- 0x16e40, 0x16e7f,
- 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[] = {
- 642,
- 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,
- 0x0560, 0x0588,
- 0x10d0, 0x10fa,
- 0x10fd, 0x10ff,
- 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, 0x1e2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 0x2cd3,
- 0x2cd5, 0x2cd5,
- 0x2cd7, 0x2cd7,
- 0x2cd9, 0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce4,
- 0x2cec, 0x2cec,
- 0x2cee, 0x2cee,
- 0x2cf3, 0x2cf3,
- 0x2d00, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0xa641, 0xa641,
- 0xa643, 0xa643,
- 0xa645, 0xa645,
- 0xa647, 0xa647,
- 0xa649, 0xa649,
- 0xa64b, 0xa64b,
- 0xa64d, 0xa64d,
- 0xa64f, 0xa64f,
- 0xa651, 0xa651,
- 0xa653, 0xa653,
- 0xa655, 0xa655,
- 0xa657, 0xa657,
- 0xa659, 0xa659,
- 0xa65b, 0xa65b,
- 0xa65d, 0xa65d,
- 0xa65f, 0xa65f,
- 0xa661, 0xa661,
- 0xa663, 0xa663,
- 0xa665, 0xa665,
- 0xa667, 0xa667,
- 0xa669, 0xa669,
- 0xa66b, 0xa66b,
- 0xa66d, 0xa66d,
- 0xa681, 0xa681,
- 0xa683, 0xa683,
- 0xa685, 0xa685,
- 0xa687, 0xa687,
- 0xa689, 0xa689,
- 0xa68b, 0xa68b,
- 0xa68d, 0xa68d,
- 0xa68f, 0xa68f,
- 0xa691, 0xa691,
- 0xa693, 0xa693,
- 0xa695, 0xa695,
- 0xa697, 0xa697,
- 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,
- 0xa7af, 0xa7af,
- 0xa7b5, 0xa7b5,
- 0xa7b7, 0xa7b7,
- 0xa7b9, 0xa7b9,
- 0xa7bb, 0xa7bb,
- 0xa7bd, 0xa7bd,
- 0xa7bf, 0xa7bf,
- 0xa7c3, 0xa7c3,
- 0xa7fa, 0xa7fa,
- 0xab30, 0xab5a,
- 0xab60, 0xab67,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x16e60, 0x16e7f,
- 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[] = {
- 60,
- 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,
- 0x16fe3, 0x16fe3,
- 0x1e137, 0x1e13d,
- 0x1e94b, 0x1e94b,
-}; /* CR_Lm */
-
-/* 'Lo': General Category */
-static const OnigCodePoint CR_Lo[] = {
- 476,
- 0x00aa, 0x00aa,
- 0x00ba, 0x00ba,
- 0x01bb, 0x01bb,
- 0x01c0, 0x01c3,
- 0x0294, 0x0294,
- 0x05d0, 0x05ea,
- 0x05ef, 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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- 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, 0x0e45,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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,
- 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,
- 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, 0x1878,
- 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, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1cfa, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 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, 0xa8fe,
- 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, 0x10a35,
- 0x10a60, 0x10a7c,
- 0x10a80, 0x10a9c,
- 0x10ac0, 0x10ac7,
- 0x10ac9, 0x10ae4,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10b80, 0x10b91,
- 0x10c00, 0x10c48,
- 0x10d00, 0x10d23,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10fe0, 0x10ff6,
- 0x11003, 0x11037,
- 0x11083, 0x110af,
- 0x110d0, 0x110e8,
- 0x11103, 0x11126,
- 0x11144, 0x11144,
- 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,
- 0x1145f, 0x1145f,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x116b8, 0x116b8,
- 0x11700, 0x1171a,
- 0x11800, 0x1182b,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d0,
- 0x119e1, 0x119e1,
- 0x119e3, 0x119e3,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a89,
- 0x11a9d, 0x11a9d,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d89,
- 0x11d98, 0x11d98,
- 0x11ee0, 0x11ef2,
- 0x12000, 0x12399,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16f00, 0x16f4a,
- 0x16f50, 0x16f50,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1e100, 0x1e12c,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2eb,
- 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[] = {
- 636,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 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,
- 0x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,
- 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,
- 0x2183, 0x2183,
- 0x2c00, 0x2c2e,
- 0x2c60, 0x2c60,
- 0x2c62, 0x2c64,
- 0x2c67, 0x2c67,
- 0x2c69, 0x2c69,
- 0x2c6b, 0x2c6b,
- 0x2c6d, 0x2c70,
- 0x2c72, 0x2c72,
- 0x2c75, 0x2c75,
- 0x2c7e, 0x2c80,
- 0x2c82, 0x2c82,
- 0x2c84, 0x2c84,
- 0x2c86,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a656, 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,
- 0xa7b8, 0xa7b8,
- 0xa7ba, 0xa7ba,
- 0xa7bc, 0xa7bc,
- 0xa7be, 0xa7be,
- 0xa7c2, 0xa7c2,
- 0xa7c4, 0xa7c6,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x16e40, 0x16e5f,
- 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[] = {
- 280,
- 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,
- 0x07fd, 0x07fd,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d3, 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,
- 0x09fe, 0x09fe,
- 0x0a01, 0x0a03,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a70, 0x0a71,
- 0x0a75, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0abc, 0x0abc,
- 0x0abe, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ae2, 0x0ae3,
- 0x0afa, 0x0aff,
- 0x0b01, 0x0b03,
- 0x0b3c, 0x0b3c,
- 0x0b3e, 0x0b44,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4d,
- 0x0b56, 0x0b57,
- 0x0b62, 0x0b63,
- 0x0b82, 0x0b82,
- 0x0bbe, 0x0bc2,
- 0x0bc6, 0x0bc8,
- 0x0bca, 0x0bcd,
- 0x0bd7, 0x0bd7,
- 0x0c00, 0x0c04,
- 0x0c3e, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c62, 0x0c63,
- 0x0c81, 0x0c83,
- 0x0cbc, 0x0cbc,
- 0x0cbe, 0x0cc4,
- 0x0cc6, 0x0cc8,
- 0x0cca, 0x0ccd,
- 0x0cd5, 0x0cd6,
- 0x0ce2, 0x0ce3,
- 0x0d00, 0x0d03,
- 0x0d3b, 0x0d3c,
- 0x0d3e, 0x0d44,
- 0x0d46, 0x0d48,
- 0x0d4a, 0x0d4d,
- 0x0d57, 0x0d57,
- 0x0d62, 0x0d63,
- 0x0d82, 0x0d83,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0df2, 0x0df3,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e47, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 0x0ebc,
- 0x0ec8, 0x0ecd,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f3f,
- 0x0f71, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0f8d, 0x0f97,
- 0x0f99, 0x0fbc,
- 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,
- 0x1cf4, 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,
- 0xa8ff, 0xa8ff,
- 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,
- 0x10d24, 0x10d27,
- 0x10f46, 0x10f50,
- 0x11000, 0x11002,
- 0x11038, 0x11046,
- 0x1107f, 0x11082,
- 0x110b0, 0x110ba,
- 0x11100, 0x11102,
- 0x11127, 0x11134,
- 0x11145, 0x11146,
- 0x11173, 0x11173,
- 0x11180, 0x11182,
- 0x111b3, 0x111c0,
- 0x111c9, 0x111cc,
- 0x1122c, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112ea,
- 0x11300, 0x11303,
- 0x1133b, 0x1133c,
- 0x1133e, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11357, 0x11357,
- 0x11362, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11435, 0x11446,
- 0x1145e, 0x1145e,
- 0x114b0, 0x114c3,
- 0x115af, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115dc, 0x115dd,
- 0x11630, 0x11640,
- 0x116ab, 0x116b7,
- 0x1171d, 0x1172b,
- 0x1182c, 0x1183a,
- 0x119d1, 0x119d7,
- 0x119da, 0x119e0,
- 0x119e4, 0x119e4,
- 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,
- 0x11d8a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d97,
- 0x11ef3, 0x11ef6,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16f4f, 0x16f4f,
- 0x16f51, 0x16f87,
- 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,
- 0x1e130, 0x1e136,
- 0x1e2ec, 0x1e2ef,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0xe0100, 0xe01ef,
-}; /* CR_M */
-
-/* 'Mc': General Category */
-static const OnigCodePoint CR_Mc[] = {
- 168,
- 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,
- 0x1cf7, 0x1cf7,
- 0x302e, 0x302f,
- 0xa823, 0xa824,
- 0xa827, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c3,
- 0xa952, 0xa953,
- 0xa983, 0xa983,
- 0xa9b4, 0xa9b5,
- 0xa9ba, 0xa9bb,
- 0xa9be, 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,
- 0x11145, 0x11146,
- 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,
- 0x1182c, 0x1182e,
- 0x11838, 0x11838,
- 0x119d1, 0x119d3,
- 0x119dc, 0x119df,
- 0x119e4, 0x119e4,
- 0x11a39, 0x11a39,
- 0x11a57, 0x11a58,
- 0x11a97, 0x11a97,
- 0x11c2f, 0x11c2f,
- 0x11c3e, 0x11c3e,
- 0x11ca9, 0x11ca9,
- 0x11cb1, 0x11cb1,
- 0x11cb4, 0x11cb4,
- 0x11d8a, 0x11d8e,
- 0x11d93, 0x11d94,
- 0x11d96, 0x11d96,
- 0x11ef5, 0x11ef6,
- 0x16f51, 0x16f87,
- 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[] = {
- 318,
- 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,
- 0x07fd, 0x07fd,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d3, 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,
- 0x09fe, 0x09fe,
- 0x0a01, 0x0a02,
- 0x0a3c, 0x0a3c,
- 0x0a41, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a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- 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,
- 0xa8ff, 0xa8ff,
- 0xa926, 0xa92d,
- 0xa947, 0xa951,
- 0xa980, 0xa982,
- 0xa9b3, 0xa9b3,
- 0xa9b6, 0xa9b9,
- 0xa9bc, 0xa9bd,
- 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,
- 0x10d24, 0x10d27,
- 0x10f46, 0x10f50,
- 0x11001, 0x11001,
- 0x11038, 0x11046,
- 0x1107f, 0x11081,
- 0x110b3, 0x110b6,
- 0x110b9, 0x110ba,
- 0x11100, 0x11102,
- 0x11127, 0x1112b,
- 0x1112d, 0x11134,
- 0x11173, 0x11173,
- 0x11180, 0x11181,
- 0x111b6, 0x111be,
- 0x111c9, 0x111cc,
- 0x1122f, 0x11231,
- 0x11234, 0x11234,
- 0x11236, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133b, 0x1133c,
- 0x11340, 0x11340,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 0x1145e, 0x1145e,
- 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,
- 0x1182f, 0x11837,
- 0x11839, 0x1183a,
- 0x119d4, 0x119d7,
- 0x119da, 0x119db,
- 0x119e0, 0x119e0,
- 0x11a01, 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,
- 0x11d90, 0x11d91,
- 0x11d95, 0x11d95,
- 0x11d97, 0x11d97,
- 0x11ef3, 0x11ef4,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16f4f, 0x16f4f,
- 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,
- 0x1e130, 0x1e136,
- 0x1e2ec, 0x1e2ef,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0xe0100, 0xe01ef,
-}; /* CR_Mn */
-
-/* 'N': Major Category */
-static const OnigCodePoint CR_N[] = {
- 130,
- 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, 0x10a48,
- 0x10a7d, 0x10a7e,
- 0x10a9d, 0x10a9f,
- 0x10aeb, 0x10aef,
- 0x10b58, 0x10b5f,
- 0x10b78, 0x10b7f,
- 0x10ba9, 0x10baf,
- 0x10cfa, 0x10cff,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f1d, 0x10f26,
- 0x10f51, 0x10f54,
- 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,
- 0x11da0, 0x11da9,
- 0x11fc0, 0x11fd4,
- 0x12400, 0x1246e,
- 0x16a60, 0x16a69,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16e80, 0x16e96,
- 0x1d2e0, 0x1d2f3,
- 0x1d360, 0x1d378,
- 0x1d7ce, 0x1d7ff,
- 0x1e140, 0x1e149,
- 0x1e2f0, 0x1e2f9,
- 0x1e8c7, 0x1e8cf,
- 0x1e950, 0x1e959,
- 0x1ec71, 0x1ecab,
- 0x1ecad, 0x1ecaf,
- 0x1ecb1, 0x1ecb4,
- 0x1ed01, 0x1ed2d,
- 0x1ed2f, 0x1ed3d,
- 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[] = {
- 70,
- 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, 0x10a48,
- 0x10a7d, 0x10a7e,
- 0x10a9d, 0x10a9f,
- 0x10aeb, 0x10aef,
- 0x10b58, 0x10b5f,
- 0x10b78, 0x10b7f,
- 0x10ba9, 0x10baf,
- 0x10cfa, 0x10cff,
- 0x10e60, 0x10e7e,
- 0x10f1d, 0x10f26,
- 0x10f51, 0x10f54,
- 0x11052, 0x11065,
- 0x111e1, 0x111f4,
- 0x1173a, 0x1173b,
- 0x118ea, 0x118f2,
- 0x11c5a, 0x11c6c,
- 0x11fc0, 0x11fd4,
- 0x16b5b, 0x16b61,
- 0x16e80, 0x16e96,
- 0x1d2e0, 0x1d2f3,
- 0x1d360, 0x1d378,
- 0x1e8c7, 0x1e8cf,
- 0x1ec71, 0x1ecab,
- 0x1ecad, 0x1ecaf,
- 0x1ecb1, 0x1ecb4,
- 0x1ed01, 0x1ed2d,
- 0x1ed2f, 0x1ed3d,
- 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[] = {
- 179,
- 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,
- 0x0a76, 0x0a76,
- 0x0af0, 0x0af0,
- 0x0c77, 0x0c77,
- 0x0c84, 0x0c84,
- 0x0df4, 0x0df4,
- 0x0e4f, 0x0e4f,
- 0x0e5a, 0x0e5b,
- 0x0f04, 0x0f12,
- 0x0f14, 0x0f14,
- 0x0f85, 0x0f85,
- 0x0fd0, 0x0fd4,
- 0x0fd9, 0x0fda,
- 0x104a, 0x104f,
- 0x10fb, 0x10fb,
- 0x1360, 0x1368,
- 0x166e, 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, 0x2e4f,
- 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,
- 0x10f55, 0x10f59,
- 0x11047, 0x1104d,
- 0x110bb, 0x110bc,
- 0x110be, 0x110c1,
- 0x11140, 0x11143,
- 0x11174, 0x11175,
- 0x111c5, 0x111c8,
- 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,
- 0x1183b, 0x1183b,
- 0x119e2, 0x119e2,
- 0x11a3f, 0x11a46,
- 0x11a9a, 0x11a9c,
- 0x11a9e, 0x11aa2,
- 0x11c41, 0x11c45,
- 0x11c70, 0x11c71,
- 0x11ef7, 0x11ef8,
- 0x11fff, 0x11fff,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b3b,
- 0x16b44, 0x16b44,
- 0x16e97, 0x16e9a,
- 0x16fe2, 0x16fe2,
- 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[] = {
- 226,
- 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,
- 0x07fe, 0x07ff,
- 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,
- 0x166d, 0x166d,
- 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, 0x2bff,
- 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, 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,
- 0x11fd5, 0x11ff1,
- 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,
- 0x1e14f, 0x1e14f,
- 0x1e2ff, 0x1e2ff,
- 0x1ecac, 0x1ecac,
- 0x1ecb0, 0x1ecb0,
- 0x1ed2e, 0x1ed2e,
- 0x1eef0, 0x1eef1,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f110, 0x1f16c,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d5,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6fa,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d8,
- 0x1f7e0, 0x1f7eb,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
-}; /* CR_S */
-
-/* 'Sc': General Category */
-static const OnigCodePoint CR_Sc[] = {
- 21,
- 0x0024, 0x0024,
- 0x00a2, 0x00a5,
- 0x058f, 0x058f,
- 0x060b, 0x060b,
- 0x07fe, 0x07ff,
- 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,
- 0x11fdd, 0x11fe0,
- 0x1e2ff, 0x1e2ff,
- 0x1ecb0, 0x1ecb0,
-}; /* 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[] = {
- 180,
- 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,
- 0x166d, 0x166d,
- 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, 0x2bff,
- 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, 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,
- 0x11fd5, 0x11fdc,
- 0x11fe1, 0x11ff1,
- 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,
- 0x1e14f, 0x1e14f,
- 0x1ecac, 0x1ecac,
- 0x1ed2e, 0x1ed2e,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f110, 0x1f16c,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f3fa,
- 0x1f400, 0x1f6d5,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6fa,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d8,
- 0x1f7e0, 0x1f7eb,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
-}; /* 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,
- 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-
-/* '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[] = {
- 140,
- 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,
- 0x0560, 0x0588,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fd, 0x10ff,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 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, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f8, 0xa7fa,
- 0xab30, 0xab5a,
- 0xab5c, 0xab67,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0x10400, 0x1044f,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x118a0, 0x118df,
- 0x16e40, 0x16e7f,
- 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[] = {
- 401,
- 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,
- 0x07fd, 0x07fd,
- 0x0816, 0x082d,
- 0x0859, 0x085b,
- 0x08d3, 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,
- 0x09fe, 0x09fe,
- 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,
- 0x0c04, 0x0c04,
- 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, 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,
- 0xa8ff, 0xa8ff,
- 0xa926, 0xa92d,
- 0xa947, 0xa951,
- 0xa980, 0xa982,
- 0xa9b3, 0xa9b3,
- 0xa9b6, 0xa9b9,
- 0xa9bc, 0xa9bd,
- 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,
- 0x10d24, 0x10d27,
- 0x10f46, 0x10f50,
- 0x11001, 0x11001,
- 0x11038, 0x11046,
- 0x1107f, 0x11081,
- 0x110b3, 0x110b6,
- 0x110b9, 0x110ba,
- 0x110bd, 0x110bd,
- 0x110cd, 0x110cd,
- 0x11100, 0x11102,
- 0x11127, 0x1112b,
- 0x1112d, 0x11134,
- 0x11173, 0x11173,
- 0x11180, 0x11181,
- 0x111b6, 0x111be,
- 0x111c9, 0x111cc,
- 0x1122f, 0x11231,
- 0x11234, 0x11234,
- 0x11236, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133b, 0x1133c,
- 0x11340, 0x11340,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 0x1145e, 0x1145e,
- 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,
- 0x1182f, 0x11837,
- 0x11839, 0x1183a,
- 0x119d4, 0x119d7,
- 0x119da, 0x119db,
- 0x119e0, 0x119e0,
- 0x11a01, 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,
- 0x11d90, 0x11d91,
- 0x11d95, 0x11d95,
- 0x11d97, 0x11d97,
- 0x11ef3, 0x11ef4,
- 0x13430, 0x13438,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16b40, 0x16b43,
- 0x16f4f, 0x16f4f,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 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,
- 0x1e130, 0x1e13d,
- 0x1e2ec, 0x1e2ef,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94b,
- 0x1f3fb, 0x1f3ff,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
-}; /* CR_Case_Ignorable */
-
-/* 'Changes_When_Lowercased': Derived Property */
-static const OnigCodePoint CR_Changes_When_Lowercased[] = {
- 599,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 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,
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2cca,
- 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,
- 0xa7b8, 0xa7b8,
- 0xa7ba, 0xa7ba,
- 0xa7bc, 0xa7bc,
- 0xa7be, 0xa7be,
- 0xa7c2, 0xa7c2,
- 0xa7c4, 0xa7c6,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x16e40, 0x16e5f,
- 0x1e900, 0x1e921,
-}; /* CR_Changes_When_Lowercased */
-
-/* 'Changes_When_Uppercased': Derived Property */
-static const OnigCodePoint CR_Changes_When_Uppercased[] = {
- 616,
- 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,
- 0x0282, 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,
- 0x0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
- 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, 0xa794,
- 0xa797, 0xa797,
- 0xa799, 0xa799,
- 0xa79b, 0xa79b,
- 0xa79d, 0xa79d,
- 0xa79f, 0xa79f,
- 0xa7a1, 0xa7a1,
- 0xa7a3, 0xa7a3,
- 0xa7a5, 0xa7a5,
- 0xa7a7, 0xa7a7,
- 0xa7a9, 0xa7a9,
- 0xa7b5, 0xa7b5,
- 0xa7b7, 0xa7b7,
- 0xa7b9, 0xa7b9,
- 0xa7bb, 0xa7bb,
- 0xa7bd, 0xa7bd,
- 0xa7bf, 0xa7bf,
- 0xa7c3, 0xa7c3,
- 0xab53, 0xab53,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x16e60, 0x16e7f,
- 0x1e922, 0x1e943,
-}; /* CR_Changes_When_Uppercased */
-
-/* 'Changes_When_Titlecased': Derived Property */
-static const OnigCodePoint CR_Changes_When_Titlecased[] = {
- 615,
- 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,
- 0x0282, 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,
- 0x1d8e, 0x1d8e,
- 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,
- 0x1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0x2cd9,
- 0x2cdb, 0x2cdb,
- 0x2cdd, 0x2cdd,
- 0x2cdf, 0x2cdf,
- 0x2ce1, 0x2ce1,
- 0x2ce3, 0x2ce3,
- 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, 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, 0xa794,
- 0xa797, 0xa797,
- 0xa799, 0xa799,
- 0xa79b, 0xa79b,
- 0xa79d, 0xa79d,
- 0xa79f, 0xa79f,
- 0xa7a1, 0xa7a1,
- 0xa7a3, 0xa7a3,
- 0xa7a5, 0xa7a5,
- 0xa7a7, 0xa7a7,
- 0xa7a9, 0xa7a9,
- 0xa7b5, 0xa7b5,
- 0xa7b7, 0xa7b7,
- 0xa7b9, 0xa7b9,
- 0xa7bb, 0xa7bb,
- 0xa7bd, 0xa7bd,
- 0xa7bf, 0xa7bf,
- 0xa7c3, 0xa7c3,
- 0xab53, 0xab53,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff41, 0xff5a,
- 0x10428, 0x1044f,
- 0x104d8, 0x104fb,
- 0x10cc0, 0x10cf2,
- 0x118c0, 0x118df,
- 0x16e60, 0x16e7f,
- 0x1e922, 0x1e943,
-}; /* CR_Changes_When_Titlecased */
-
-/* 'Changes_When_Casefolded': Derived Property */
-static const OnigCodePoint CR_Changes_When_Casefolded[] = {
- 612,
- 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,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- 0x2ca6, 0x2ca6,
- 0x2ca8, 0x2ca8,
- 0x2caa, 0x2caa,
- 0x2cac, 0x2cac,
- 0x2cae, 0x2cae,
- 0x2cb0, 0x2cb0,
- 0x2cb2, 0x2cb2,
- 0x2cb4, 0x2cb4,
- 0x2cb6, 0x2cb6,
- 0x2cb8, 0x2cb8,
- 0x2cba, 0x2cba,
- 0x2cbc, 0x2cbc,
- 0x2cbe, 0x2cbe,
- 0x2cc0, 0x2cc0,
- 0x2cc2, 0x2cc2,
- 0x2cc4, 0x2cc4,
- 0x2cc6, 0x2cc6,
- 0x2cc8, 0x2cc8,
- 0x2cca, 0x2cca,
- 0x2ccc, 0x2ccc,
- 0x2cce, 0x2cce,
- 0x2cd0, 0x2cd0,
- 0x2cd2, 0x2cd2,
- 0x2cd4, 0x2cd4,
- 0x2cd6, 0x2cd6,
- 0x2cd8, 0x2cd8,
- 0x2cda, 0x2cda,
- 0x2cdc, 0x2cdc,
- 0x2cde, 0x2cde,
- 0x2ce0, 0x2ce0,
- 0x2ce2, 0x2ce2,
- 0x2ceb, 0x2ceb,
- 0x2ced, 0x2ced,
- 0x2cf2, 0x2cf2,
- 0xa640, 0xa640,
- 0xa642, 0xa642,
- 0xa644, 0xa644,
- 0xa646, 0xa646,
- 0xa648, 0xa648,
- 0xa64a, 0xa64a,
- 0xa64c, 0xa64c,
- 0xa64e, 0xa64e,
- 0xa650, 0xa650,
- 0xa652, 0xa652,
- 0xa654, 0xa654,
- 0xa656, 0xa656,
- 0xa658, 0xa658,
- 0xa65a, 0xa65a,
- 0xa65c, 0xa65c,
- 0xa65e, 0xa65e,
- 0xa660, 0xa660,
- 0xa662, 0xa662,
- 0xa664, 0xa664,
- 0xa666, 0xa666,
- 0xa668, 0xa668,
- 0xa66a, 0xa66a,
- 0xa66c, 0xa66c,
- 0xa680, 0xa680,
- 0xa682, 0xa682,
- 0xa684, 0xa684,
- 0xa686, 0xa686,
- 0xa688, 0xa688,
- 0xa68a, 0xa68a,
- 0xa68c, 0xa68c,
- 0xa68e, 0xa68e,
- 0xa690, 0xa690,
- 0xa692, 0xa692,
- 0xa694, 0xa694,
- 0xa696, 0xa696,
- 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,
- 0xa7b8, 0xa7b8,
- 0xa7ba, 0xa7ba,
- 0xa7bc, 0xa7bc,
- 0xa7be, 0xa7be,
- 0xa7c2, 0xa7c2,
- 0xa7c4, 0xa7c6,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0x10400, 0x10427,
- 0x104b0, 0x104d3,
- 0x10c80, 0x10cb2,
- 0x118a0, 0x118bf,
- 0x16e40, 0x16e5f,
- 0x1e900, 0x1e921,
-}; /* CR_Changes_When_Casefolded */
-
-/* 'Changes_When_Casemapped': Derived Property */
-static const OnigCodePoint CR_Changes_When_Casemapped[] = {
- 123,
- 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,
- 0x0282, 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,
- 0x10d0, 0x10fa,
- 0x10fd, 0x10ff,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1c80, 0x1c88,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1d79, 0x1d79,
- 0x1d7d, 0x1d7d,
- 0x1d8e, 0x1d8e,
- 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, 0xa794,
- 0xa796, 0xa7ae,
- 0xa7b0, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xab53, 0xab53,
- 0xab70, 0xabbf,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xff21, 0xff3a,
- 0xff41, 0xff5a,
- 0x10400, 0x1044f,
- 0x104b0, 0x104d3,
- 0x104d8, 0x104fb,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x118a0, 0x118df,
- 0x16e40, 0x16e7f,
- 0x1e900, 0x1e943,
-}; /* CR_Changes_When_Casemapped */
-
-/* 'ID_Start': Derived Property */
-static const OnigCodePoint CR_ID_Start[] = {
- 609,
- 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,
- 0x0560, 0x0588,
- 0x05d0, 0x05ea,
- 0x05ef, 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,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0abd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae1,
- 0x0af9, 0x0af9,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b3d,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b71, 0x0b71,
- 0x0b83, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
- 0x0bae, 0x0bb9,
- 0x0bd0, 0x0bd0,
- 0x0c05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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,
- 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1cfa, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa69d,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 0xa882, 0xa8b3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 0xa8fe,
- 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, 0xab67,
- 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, 0x10a35,
- 0x10a60, 0x10a7c,
- 0x10a80, 0x10a9c,
- 0x10ac0, 0x10ac7,
- 0x10ac9, 0x10ae4,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10b80, 0x10b91,
- 0x10c00, 0x10c48,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x10d00, 0x10d23,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10fe0, 0x10ff6,
- 0x11003, 0x11037,
- 0x11083, 0x110af,
- 0x110d0, 0x110e8,
- 0x11103, 0x11126,
- 0x11144, 0x11144,
- 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,
- 0x1145f, 0x1145f,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x116b8, 0x116b8,
- 0x11700, 0x1171a,
- 0x11800, 0x1182b,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d0,
- 0x119e1, 0x119e1,
- 0x119e3, 0x119e3,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a89,
- 0x11a9d, 0x11a9d,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d89,
- 0x11d98, 0x11d98,
- 0x11ee0, 0x11ef2,
- 0x12000, 0x12399,
- 0x12400, 0x1246e,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b40, 0x16b43,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f50, 0x16f50,
- 0x16f93, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e137, 0x1e13d,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2eb,
- 0x1e800, 0x1e8c4,
- 0x1e900, 0x1e943,
- 0x1e94b, 0x1e94b,
- 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[] = {
- 713,
- 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,
- 0x0560, 0x0588,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x07fd, 0x07fd,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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,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- 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66f,
- 0xa674, 0xa67d,
- 0xa67f, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c5,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 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, 0xab67,
- 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, 0x10a35,
- 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,
- 0x10d00, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f50,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x1107f, 0x110ba,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x1113f,
- 0x11144, 0x11146,
- 0x11150, 0x11173,
- 0x11176, 0x11176,
- 0x11180, 0x111c4,
- 0x111c9, 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x1144a,
- 0x11450, 0x11459,
- 0x1145e, 0x1145f,
- 0x11480, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115d8, 0x115dd,
- 0x11600, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x11739,
- 0x11800, 0x1183a,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e1,
- 0x119e3, 0x119e4,
- 0x11a00, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a50, 0x11a99,
- 0x11a9d, 0x11a9d,
- 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef6,
- 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,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2f9,
- 0x1e800, 0x1e8c4,
- 0x1e8d0, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 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[] = {
- 616,
- 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,
- 0x0560, 0x0588,
- 0x05d0, 0x05ea,
- 0x05ef, 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,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0abd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae1,
- 0x0af9, 0x0af9,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b3d,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b71, 0x0b71,
- 0x0b83, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b8e, 0x0b90,
- 0x0b92, 0x0b95,
- 0x0b99, 0x0b9a,
- 0x0b9c, 0x0b9c,
- 0x0b9e, 0x0b9f,
- 0x0ba3, 0x0ba4,
- 0x0ba8, 0x0baa,
-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d,
- 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf6,
- 0x1cfa, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa61f,
- 0xa62a, 0xa62b,
- 0xa640, 0xa66e,
- 0xa67f, 0xa69d,
- 0xa6a0, 0xa6ef,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa822,
- 0xa840, 0xa873,
- 0xa882, 0xa8b3,
- 0xa8f2, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 0xa8fe,
- 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, 0xab67,
- 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, 0x10a35,
- 0x10a60, 0x10a7c,
- 0x10a80, 0x10a9c,
- 0x10ac0, 0x10ac7,
- 0x10ac9, 0x10ae4,
- 0x10b00, 0x10b35,
- 0x10b40, 0x10b55,
- 0x10b60, 0x10b72,
- 0x10b80, 0x10b91,
- 0x10c00, 0x10c48,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x10d00, 0x10d23,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10fe0, 0x10ff6,
- 0x11003, 0x11037,
- 0x11083, 0x110af,
- 0x110d0, 0x110e8,
- 0x11103, 0x11126,
- 0x11144, 0x11144,
- 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,
- 0x1145f, 0x1145f,
- 0x11480, 0x114af,
- 0x114c4, 0x114c5,
- 0x114c7, 0x114c7,
- 0x11580, 0x115ae,
- 0x115d8, 0x115db,
- 0x11600, 0x1162f,
- 0x11644, 0x11644,
- 0x11680, 0x116aa,
- 0x116b8, 0x116b8,
- 0x11700, 0x1171a,
- 0x11800, 0x1182b,
- 0x118a0, 0x118df,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d0,
- 0x119e1, 0x119e1,
- 0x119e3, 0x119e3,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a3a, 0x11a3a,
- 0x11a50, 0x11a50,
- 0x11a5c, 0x11a89,
- 0x11a9d, 0x11a9d,
- 0x11ac0, 0x11af8,
- 0x11c00, 0x11c08,
- 0x11c0a, 0x11c2e,
- 0x11c40, 0x11c40,
- 0x11c72, 0x11c8f,
- 0x11d00, 0x11d06,
- 0x11d08, 0x11d09,
- 0x11d0b, 0x11d30,
- 0x11d46, 0x11d46,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d89,
- 0x11d98, 0x11d98,
- 0x11ee0, 0x11ef2,
- 0x12000, 0x12399,
- 0x12400, 0x1246e,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16ad0, 0x16aed,
- 0x16b00, 0x16b2f,
- 0x16b40, 0x16b43,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f50, 0x16f50,
- 0x16f93, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
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- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2b820, 0x2cea1,
- 0x2ceb0, 0x2ebe0,
- 0x2f800, 0x2fa1d,
-}; /* CR_XID_Start */
-
-/* 'XID_Continue': Derived Property */
-static const OnigCodePoint CR_XID_Continue[] = {
- 720,
- 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,
- 0x0560, 0x0588,
- 0x0591, 0x05bd,
- 0x05bf, 0x05bf,
- 0x05c1, 0x05c2,
- 0x05c4, 0x05c5,
- 0x05c7, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f2,
- 0x0610, 0x061a,
- 0x0620, 0x0669,
- 0x066e, 0x06d3,
- 0x06d5, 0x06dc,
- 0x06df, 0x06e8,
- 0x06ea, 0x06fc,
- 0x06ff, 0x06ff,
- 0x0710, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07f5,
- 0x07fa, 0x07fa,
- 0x07fd, 0x07fd,
- 0x0800, 0x082d,
- 0x0840, 0x085b,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 0x08e1,
- 0x08e3, 0x0963,
- 0x0966, 0x096f,
- 0x0971, 0x0983,
- 0x0985, 0x098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x0df3,
- 0x0e01, 0x0e3a,
- 0x0e40, 0x0e4e,
- 0x0e50, 0x0e59,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 0x1cd0, 0x1cd2,
- 0x1cd4, 0x1cfa,
- 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, 0x312f,
- 0x3131, 0x318e,
- 0x31a0, 0x31ba,
- 0x31f0, 0x31ff,
- 0x3400, 0x4db5,
- 0x4e00, 0x9fef,
- 0xa000, 0xa48c,
- 0xa4d0, 0xa4fd,
- 0xa500, 0xa60c,
- 0xa610, 0xa62b,
- 0xa640, 0xa66f,
- 0xa674, 0xa67d,
- 0xa67f, 0xa6f1,
- 0xa717, 0xa71f,
- 0xa722, 0xa788,
- 0xa78b, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa827,
- 0xa840, 0xa873,
- 0xa880, 0xa8c5,
- 0xa8d0, 0xa8d9,
- 0xa8e0, 0xa8f7,
- 0xa8fb, 0xa8fb,
- 0xa8fd, 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, 0xab67,
- 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, 0x10a35,
- 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,
- 0x10d00, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10f00, 0x10f1c,
- 0x10f27, 0x10f27,
- 0x10f30, 0x10f50,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x11046,
- 0x11066, 0x1106f,
- 0x1107f, 0x110ba,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x1113f,
- 0x11144, 0x11146,
- 0x11150, 0x11173,
- 0x11176, 0x11176,
- 0x11180, 0x111c4,
- 0x111c9, 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x1144a,
- 0x11450, 0x11459,
- 0x1145e, 0x1145f,
- 0x11480, 0x114c5,
- 0x114c7, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c0,
- 0x115d8, 0x115dd,
- 0x11600, 0x11640,
- 0x11644, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x11739,
- 0x11800, 0x1183a,
- 0x118a0, 0x118e9,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e1,
- 0x119e3, 0x119e4,
- 0x11a00, 0x11a3e,
- 0x11a47, 0x11a47,
- 0x11a50, 0x11a99,
- 0x11a9d, 0x11a9d,
- 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef6,
- 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,
- 0x16e40, 0x16e7f,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x16fe3, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14e,
- 0x1e2c0, 0x1e2f9,
- 0x1e800, 0x1e8c4,
- 0x1e8d0, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 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[] = {
- 335,
- 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,
- 0x07fd, 0x07fd,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d3, 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,
- 0x09fe, 0x09fe,
- 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,
- 0x0c04, 0x0c04,
- 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, 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, 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,
- 0xa8ff, 0xa8ff,
- 0xa926, 0xa92d,
- 0xa947, 0xa951,
- 0xa980, 0xa982,
- 0xa9b3, 0xa9b3,
- 0xa9b6, 0xa9b9,
- 0xa9bc, 0xa9bd,
- 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,
- 0x10d24, 0x10d27,
- 0x10f46, 0x10f50,
- 0x11001, 0x11001,
- 0x11038, 0x11046,
- 0x1107f, 0x11081,
- 0x110b3, 0x110b6,
- 0x110b9, 0x110ba,
- 0x11100, 0x11102,
- 0x11127, 0x1112b,
- 0x1112d, 0x11134,
- 0x11173, 0x11173,
- 0x11180, 0x11181,
- 0x111b6, 0x111be,
- 0x111c9, 0x111cc,
- 0x1122f, 0x11231,
- 0x11234, 0x11234,
- 0x11236, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133b, 0x1133c,
- 0x1133e, 0x1133e,
- 0x11340, 0x11340,
- 0x11357, 0x11357,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 0x1145e, 0x1145e,
- 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,
- 0x1182f, 0x11837,
- 0x11839, 0x1183a,
- 0x119d4, 0x119d7,
- 0x119da, 0x119db,
- 0x119e0, 0x119e0,
- 0x11a01, 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,
- 0x11d90, 0x11d91,
- 0x11d95, 0x11d95,
- 0x11d97, 0x11d97,
- 0x11ef3, 0x11ef4,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16f4f, 0x16f4f,
- 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,
- 0x1e130, 0x1e136,
- 0x1e2ec, 0x1e2ef,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
-}; /* CR_Grapheme_Extend */
-
-/* 'Grapheme_Base': Derived Property */
-static const OnigCodePoint CR_Grapheme_Base[] = {
- 819,
- 0x0020, 0x007e,
- 0x00a0, 0x00ac,
- 0x00ae, 0x02ff,
- 0x0370, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0482,
- 0x048a, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x05be, 0x05be,
- 0x05c0, 0x05c0,
- 0x05c3, 0x05c3,
- 0x05c6, 0x05c6,
- 0x05d0, 0x05ea,
- 0x05ef, 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,
- 0x07fe, 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,
- 0x09e6, 0x09fd,
- 0x0a03, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3e, 0x0a40,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a6f,
- 0x0a72, 0x0a74,
- 0x0a76, 0x0a76,
- 0x0a83, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abd, 0x0ac0,
- 0x0ac9, 0x0ac9,
- 0x0acb, 0x0acc,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae1,
- 0x0ae6, 0x0af1,
- 0x0af9, 0x0af9,
- 0x0b02, 0x0b03,
- 0x0b05, 0x0b0c,
- 0x0b0f, 0x0b10,
- 0x0b13, 0x0b28,
- 0x0b2a, 0x0b30,
- 0x0b32, 0x0b33,
- 0x0b35, 0x0b39,
- 0x0b3d, 0x0b3d,
- 0x0b40, 0x0b40,
- 0x0b47, 0x0b48,
- 0x0b4b, 0x0b4c,
- 0x0b5c, 0x0b5d,
- 0x0b5f, 0x0b61,
- 0x0b66, 0x0b77,
- 0x0b83, 0x0b83,
- 0x0b85, 0x0b8a,
- 0x0b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0df2, 0x0df4,
- 0x0e01, 0x0e30,
- 0x0e32, 0x0e33,
- 0x0e3f, 0x0e46,
- 0x0e4f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x1878,
- 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,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cc7,
- 0x1cd3, 0x1cd3,
- 0x1ce1, 0x1ce1,
- 0x1ce9, 0x1cec,
- 0x1cee, 0x1cf3,
- 0x1cf5, 0x1cf7,
- 0x1cfa, 0x1cfa,
- 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, 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, 0x2e4f,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x3029,
- 0x3030, 0x303f,
- 0x3041, 0x3096,
- 0x309b, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa66e,
- 0xa673, 0xa673,
- 0xa67e, 0xa69d,
- 0xa6a0, 0xa6ef,
- 0xa6f2, 0xa6f7,
- 0xa700, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa801,
- 0xa803, 0xa805,
- 0xa807, 0xa80a,
- 0xa80c, 0xa824,
- 0xa827, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c3,
- 0xa8ce, 0xa8d9,
- 0xa8f2, 0xa8fe,
- 0xa900, 0xa925,
- 0xa92e, 0xa946,
- 0xa952, 0xa953,
- 0xa95f, 0xa97c,
- 0xa983, 0xa9b2,
- 0xa9b4, 0xa9b5,
- 0xa9ba, 0xa9bb,
- 0xa9be, 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, 0xab67,
- 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, 0x10a35,
- 0x10a40, 0x10a48,
- 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, 0x10d23,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f45,
- 0x10f51, 0x10f59,
- 0x10fe0, 0x10ff6,
- 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, 0x11146,
- 0x11150, 0x11172,
- 0x11174, 0x11176,
- 0x11182, 0x111b5,
- 0x111bf, 0x111c8,
- 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,
- 0x1145f, 0x1145f,
- 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,
- 0x116b8, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x11720, 0x11721,
- 0x11726, 0x11726,
- 0x11730, 0x1173f,
- 0x11800, 0x1182e,
- 0x11838, 0x11838,
- 0x1183b, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d3,
- 0x119dc, 0x119df,
- 0x119e1, 0x119e4,
- 0x11a00, 0x11a00,
- 0x11a0b, 0x11a32,
- 0x11a39, 0x11a3a,
- 0x11a3f, 0x11a46,
- 0x11a50, 0x11a50,
- 0x11a57, 0x11a58,
- 0x11a5c, 0x11a89,
- 0x11a97, 0x11a97,
- 0x11a9a, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d93, 0x11d94,
- 0x11d96, 0x11d96,
- 0x11d98, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef2,
- 0x11ef5, 0x11ef8,
- 0x11fc0, 0x11ff1,
- 0x11fff, 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,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f4a,
- 0x16f50, 0x16f87,
- 0x16f93, 0x16f9f,
- 0x16fe0, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 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,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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, 0x1d9ff,
- 0x1da37, 0x1da3a,
- 0x1da6d, 0x1da74,
- 0x1da76, 0x1da83,
- 0x1da85, 0x1da8b,
- 0x1e100, 0x1e12c,
- 0x1e137, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
- 0x1e2c0, 0x1e2eb,
- 0x1e2f0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8cf,
- 0x1e900, 0x1e943,
- 0x1e94b, 0x1e94b,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 0x1ec71, 0x1ecb4,
- 0x1ed01, 0x1ed3d,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0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, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 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[] = {
- 52,
- 0x094d, 0x094d,
- 0x09cd, 0x09cd,
- 0x0a4d, 0x0a4d,
- 0x0acd, 0x0acd,
- 0x0b4d, 0x0b4d,
- 0x0bcd, 0x0bcd,
- 0x0c4d, 0x0c4d,
- 0x0ccd, 0x0ccd,
- 0x0d3b, 0x0d3c,
- 0x0d4d, 0x0d4d,
- 0x0dca, 0x0dca,
- 0x0e3a, 0x0e3a,
- 0x0eba, 0x0eba,
- 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,
- 0x11839, 0x11839,
- 0x119e0, 0x119e0,
- 0x11a34, 0x11a34,
- 0x11a47, 0x11a47,
- 0x11a99, 0x11a99,
- 0x11c3f, 0x11c3f,
- 0x11d44, 0x11d45,
- 0x11d97, 0x11d97,
-}; /* CR_Grapheme_Link */
-
-/* 'Common': Script */
-static const OnigCodePoint CR_Common[] = {
- 172,
- 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,
- 0x1cfa, 0x1cfa,
- 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, 0x2bff,
- 0x2e00, 0x2e4f,
- 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,
- 0x32ff, 0x32ff,
- 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,
- 0x16fe2, 0x16fe3,
- 0x1bca0, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d166,
- 0x1d16a, 0x1d17a,
- 0x1d183, 0x1d184,
- 0x1d18c, 0x1d1a9,
- 0x1d1ae, 0x1d1e8,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
- 0x1ec71, 0x1ecb4,
- 0x1ed01, 0x1ed3d,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f100, 0x1f10c,
- 0x1f110, 0x1f16c,
- 0x1f170, 0x1f1ac,
- 0x1f1e6, 0x1f1ff,
- 0x1f201, 0x1f202,
- 0x1f210, 0x1f23b,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d5,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6fa,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d8,
- 0x1f7e0, 0x1f7eb,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
-}; /* CR_Common */
-
-/* 'Latin': Script */
-static const OnigCodePoint CR_Latin[] = {
- 32,
- 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, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa7ff,
- 0xab30, 0xab5a,
- 0xab5c, 0xab64,
- 0xab66, 0xab67,
- 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[] = {
- 5,
- 0x0531, 0x0556,
- 0x0559, 0x0588,
- 0x058a, 0x058a,
- 0x058d, 0x058f,
- 0xfb13, 0xfb17,
-}; /* CR_Armenian */
-
-/* 'Hebrew': Script */
-static const OnigCodePoint CR_Hebrew[] = {
- 9,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 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,
- 0x08d3, 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,
- 0x0955, 0x0963,
- 0x0966, 0x097f,
- 0xa8e0, 0xa8ff,
-}; /* 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, 0x09fe,
-}; /* 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, 0x0a76,
-}; /* 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[] = {
- 18,
- 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,
- 0x11fc0, 0x11ff1,
- 0x11fff, 0x11fff,
-}; /* CR_Tamil */
-
-/* 'Telugu': Script */
-static const OnigCodePoint CR_Telugu[] = {
- 12,
- 0x0c00, 0x0c0c,
- 0x0c0e, 0x0c10,
- 0x0c12, 0x0c28,
- 0x0c2a, 0x0c39,
- 0x0c3d, 0x0c44,
- 0x0c46, 0x0c48,
- 0x0c4a, 0x0c4d,
- 0x0c55, 0x0c56,
- 0x0c58, 0x0c5a,
- 0x0c60, 0x0c63,
- 0x0c66, 0x0c6f,
- 0x0c77, 0x0c7f,
-}; /* CR_Telugu */
-
-/* 'Kannada': Script */
-static const OnigCodePoint CR_Kannada[] = {
- 13,
- 0x0c80, 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[] = {
- 11,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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[] = {
- 10,
- 0x10a0, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x10fa,
- 0x10fc, 0x10ff,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cbf,
- 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, 0x1878,
- 0x1880, 0x18aa,
- 0x11660, 0x1166c,
-}; /* CR_Mongolian */
-
-/* 'Hiragana': Script */
-static const OnigCodePoint CR_Hiragana[] = {
- 5,
- 0x3041, 0x3096,
- 0x309d, 0x309f,
- 0x1b001, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1f200, 0x1f200,
-}; /* CR_Hiragana */
-
-/* 'Katakana': Script */
-static const OnigCodePoint CR_Katakana[] = {
- 9,
- 0x30a1, 0x30fa,
- 0x30fd, 0x30ff,
- 0x31f0, 0x31ff,
- 0x32d0, 0x32fe,
- 0x3300, 0x3357,
- 0xff66, 0xff6f,
- 0xff71, 0xff9d,
- 0x1b000, 0x1b000,
- 0x1b164, 0x1b167,
-}; /* CR_Katakana */
-
-/* 'Bopomofo': Script */
-static const OnigCodePoint CR_Bopomofo[] = {
- 3,
- 0x02ea, 0x02eb,
- 0x3105, 0x312f,
- 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, 0x9fef,
- 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[] = {
- 28,
- 0x0300, 0x036f,
- 0x0485, 0x0486,
- 0x064b, 0x0655,
- 0x0670, 0x0670,
- 0x0951, 0x0954,
- 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,
- 0x1133b, 0x1133b,
- 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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[] = {
- 2,
- 0x07c0, 0x07fa,
- 0x07fd, 0x07ff,
-}; /* 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[] = {
- 2,
- 0x13000, 0x1342e,
- 0x13430, 0x13438,
-}; /* 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[] = {
- 2,
- 0x11080, 0x110c1,
- 0x110cd, 0x110cd,
-}; /* 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, 0x11146,
-}; /* 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, 0x16f4a,
- 0x16f4f, 0x16f87,
- 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, 0x116b8,
- 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, 0x1171a,
- 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, 0x1e94b,
- 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, 0x1145f,
-}; /* 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, 0x187f7,
- 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[] = {
- 1,
- 0x11a50, 0x11aa2,
-}; /* CR_Soyombo */
-
-/* 'Zanabazar_Square': Script */
-static const OnigCodePoint CR_Zanabazar_Square[] = {
- 1,
- 0x11a00, 0x11a47,
-}; /* CR_Zanabazar_Square */
-
-/* 'Dogra': Script */
-static const OnigCodePoint CR_Dogra[] = {
- 1,
- 0x11800, 0x1183b,
-}; /* CR_Dogra */
-
-/* 'Gunjala_Gondi': Script */
-static const OnigCodePoint CR_Gunjala_Gondi[] = {
- 6,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
-}; /* CR_Gunjala_Gondi */
-
-/* 'Makasar': Script */
-static const OnigCodePoint CR_Makasar[] = {
- 1,
- 0x11ee0, 0x11ef8,
-}; /* CR_Makasar */
-
-/* 'Medefaidrin': Script */
-static const OnigCodePoint CR_Medefaidrin[] = {
- 1,
- 0x16e40, 0x16e9a,
-}; /* CR_Medefaidrin */
-
-/* 'Hanifi_Rohingya': Script */
-static const OnigCodePoint CR_Hanifi_Rohingya[] = {
- 2,
- 0x10d00, 0x10d27,
- 0x10d30, 0x10d39,
-}; /* CR_Hanifi_Rohingya */
-
-/* 'Sogdian': Script */
-static const OnigCodePoint CR_Sogdian[] = {
- 1,
- 0x10f30, 0x10f59,
-}; /* CR_Sogdian */
-
-/* 'Old_Sogdian': Script */
-static const OnigCodePoint CR_Old_Sogdian[] = {
- 1,
- 0x10f00, 0x10f27,
-}; /* CR_Old_Sogdian */
-
-/* 'Elymaic': Script */
-static const OnigCodePoint CR_Elymaic[] = {
- 1,
- 0x10fe0, 0x10ff6,
-}; /* CR_Elymaic */
-
-/* 'Nandinagari': Script */
-static const OnigCodePoint CR_Nandinagari[] = {
- 3,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e4,
-}; /* CR_Nandinagari */
-
-/* 'Nyiakeng_Puachue_Hmong': Script */
-static const OnigCodePoint CR_Nyiakeng_Puachue_Hmong[] = {
- 4,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
-}; /* CR_Nyiakeng_Puachue_Hmong */
-
-/* 'Wancho': Script */
-static const OnigCodePoint CR_Wancho[] = {
- 2,
- 0x1e2c0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
-}; /* CR_Wancho */
-
-/* '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[] = {
- 102,
- 0x0021, 0x0021,
- 0x002c, 0x002c,
- 0x002e, 0x002e,
- 0x003a, 0x003b,
- 0x003f, 0x003f,
- 0x037e, 0x037e,
- 0x0387, 0x0387,
- 0x0589, 0x0589,
- 0x05c3, 0x05c3,
- 0x060c, 0x060c,
- 0x061b, 0x061b,
- 0x061e, 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,
- 0x166e, 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,
- 0x2e4c, 0x2e4c,
- 0x2e4e, 0x2e4f,
- 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,
- 0x10f55, 0x10f59,
- 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,
- 0x11ef7, 0x11ef8,
- 0x12470, 0x12474,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b39,
- 0x16b44, 0x16b44,
- 0x16e97, 0x16e98,
- 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[] = {
- 221,
- 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, 0x1064,
- 0x1067, 0x106d,
- 0x1071, 0x1074,
- 0x1082, 0x108d,
- 0x108f, 0x108f,
- 0x109a, 0x109d,
- 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, 0x1c36,
- 0x1de7, 0x1df4,
- 0x24b6, 0x24e9,
- 0x2de0, 0x2dff,
- 0xa674, 0xa67b,
- 0xa69e, 0xa69f,
- 0xa802, 0xa802,
- 0xa80b, 0xa80b,
- 0xa823, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c3,
- 0xa8c5, 0xa8c5,
- 0xa8ff, 0xa8ff,
- 0xa926, 0xa92a,
- 0xa947, 0xa952,
- 0xa980, 0xa983,
- 0xa9b4, 0xa9bf,
- 0xa9e5, 0xa9e5,
- 0xaa29, 0xaa36,
- 0xaa43, 0xaa43,
- 0xaa4c, 0xaa4d,
- 0xaa7b, 0xaa7d,
- 0xaab0, 0xaab0,
- 0xaab2, 0xaab4,
- 0xaab7, 0xaab8,
- 0xaabe, 0xaabe,
- 0xaaeb, 0xaaef,
- 0xaaf5, 0xaaf5,
- 0xabe3, 0xabea,
- 0xfb1e, 0xfb1e,
- 0x10376, 0x1037a,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x10d24, 0x10d27,
- 0x11000, 0x11002,
- 0x11038, 0x11045,
- 0x11082, 0x11082,
- 0x110b0, 0x110b8,
- 0x11100, 0x11102,
- 0x11127, 0x11132,
- 0x11145, 0x11146,
- 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,
- 0x1182c, 0x11838,
- 0x119d1, 0x119d7,
- 0x119da, 0x119df,
- 0x119e4, 0x119e4,
- 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,
- 0x11d8a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d96,
- 0x11ef3, 0x11ef6,
- 0x16f4f, 0x16f4f,
- 0x16f51, 0x16f87,
- 0x16f8f, 0x16f92,
- 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, 0x9fef,
- 0xf900, 0xfa6d,
- 0xfa70, 0xfad9,
- 0x17000, 0x187f7,
- 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[] = {
- 171,
- 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,
- 0x0b4d, 0x0b4d,
- 0x0bcd, 0x0bcd,
- 0x0c4d, 0x0c4d,
- 0x0cbc, 0x0cbc,
- 0x0ccd, 0x0ccd,
- 0x0d3b, 0x0d3c,
- 0x0d4d, 0x0d4d,
- 0x0dca, 0x0dca,
- 0x0e47, 0x0e4c,
- 0x0e4e, 0x0e4e,
- 0x0eba, 0x0eba,
- 0x0ec8, 0x0ecc,
- 0x0f18, 0x0f19,
- 0x0f35, 0x0f35,
- 0x0f37, 0x0f37,
- 0x0f39, 0x0f39,
- 0x0f3e, 0x0f3f,
- 0x0f82, 0x0f84,
- 0x0f86, 0x0f87,
- 0x0fc6, 0x0fc6,
- 0x1037, 0x1037,
- 0x1039, 0x103a,
- 0x1063, 0x1064,
- 0x1069, 0x106d,
- 0x1087, 0x108d,
- 0x108f, 0x108f,
- 0x109a, 0x109b,
- 0x135d, 0x135f,
- 0x17c9, 0x17d3,
- 0x17dd, 0x17dd,
- 0x1939, 0x193b,
- 0x1a75, 0x1a7c,
- 0x1a7f, 0x1a7f,
- 0x1ab0, 0x1abd,
- 0x1b34, 0x1b34,
- 0x1b44, 0x1b44,
- 0x1b6b, 0x1b73,
- 0x1baa, 0x1bab,
- 0x1c36, 0x1c37,
- 0x1c78, 0x1c7d,
- 0x1cd0, 0x1ce8,
- 0x1ced, 0x1ced,
- 0x1cf4, 0x1cf4,
- 0x1cf7, 0x1cf9,
- 0x1d2c, 0x1d6a,
- 0x1dc4, 0x1dcf,
- 0x1df5, 0x1df9,
- 0x1dfd, 0x1dff,
- 0x1fbd, 0x1fbd,
- 0x1fbf, 0x1fc1,
- 0x1fcd, 0x1fcf,
- 0x1fdd, 0x1fdf,
- 0x1fed, 0x1fef,
- 0x1ffd, 0x1ffe,
- 0x2cef, 0x2cf1,
- 0x2e2f, 0x2e2f,
- 0x302a, 0x302f,
- 0x3099, 0x309c,
- 0x30fc, 0x30fc,
- 0xa66f, 0xa66f,
- 0xa67c, 0xa67d,
- 0xa67f, 0xa67f,
- 0xa69c, 0xa69d,
- 0xa6f0, 0xa6f1,
- 0xa700, 0xa721,
- 0xa788, 0xa78a,
- 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,
- 0x10d22, 0x10d27,
- 0x10f46, 0x10f50,
- 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,
- 0x11839, 0x1183a,
- 0x119e0, 0x119e0,
- 0x11a34, 0x11a34,
- 0x11a47, 0x11a47,
- 0x11a99, 0x11a99,
- 0x11c3f, 0x11c3f,
- 0x11d42, 0x11d42,
- 0x11d44, 0x11d45,
- 0x11d97, 0x11d97,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16f8f, 0x16f9f,
- 0x1d167, 0x1d169,
- 0x1d16d, 0x1d172,
- 0x1d17b, 0x1d182,
- 0x1d185, 0x1d18b,
- 0x1d1aa, 0x1d1ad,
- 0x1e130, 0x1e136,
- 0x1e2ec, 0x1e2ef,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e946,
- 0x1e948, 0x1e94a,
-}; /* CR_Diacritic */
-
-/* 'Extender': Binary Property */
-static const OnigCodePoint CR_Extender[] = {
- 31,
- 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,
- 0x16fe3, 0x16fe3,
- 0x1e13c, 0x1e13d,
- 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[] = {
- 24,
- 0x09be, 0x09be,
- 0x09d7, 0x09d7,
- 0x0b3e, 0x0b3e,
- 0x0b57, 0x0b57,
- 0x0bbe, 0x0bbe,
- 0x0bd7, 0x0bd7,
- 0x0cc2, 0x0cc2,
- 0x0cd5, 0x0cd6,
- 0x0d3e, 0x0d3e,
- 0x0d57, 0x0d57,
- 0x0dcf, 0x0dcf,
- 0x0ddf, 0x0ddf,
- 0x1b35, 0x1b35,
- 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, 0x9fef,
- 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[] = {
- 74,
- 0x0021, 0x0021,
- 0x002e, 0x002e,
- 0x003f, 0x003f,
- 0x0589, 0x0589,
- 0x061e, 0x061f,
- 0x06d4, 0x06d4,
- 0x0700, 0x0702,
- 0x07f9, 0x07f9,
- 0x0837, 0x0837,
- 0x0839, 0x0839,
- 0x083d, 0x083e,
- 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,
- 0x10f55, 0x10f59,
- 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,
- 0x11ef7, 0x11ef8,
- 0x16a6e, 0x16a6f,
- 0x16af5, 0x16af5,
- 0x16b37, 0x16b38,
- 0x16b44, 0x16b44,
- 0x16e98, 0x16e98,
- 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[] = {
- 6,
- 0x0600, 0x0605,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x08e2, 0x08e2,
- 0x110bd, 0x110bd,
- 0x110cd, 0x110cd,
-}; /* 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[] = {
- 151,
- 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,
- 0x265f, 0x2660,
- 0x2663, 0x2663,
- 0x2665, 0x2666,
- 0x2668, 0x2668,
- 0x267b, 0x267b,
- 0x267e, 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,
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0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1f9ff,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
-}; /* CR_Emoji */
-
-/* 'Emoji_Presentation': Emoji */
-static const OnigCodePoint CR_Emoji_Presentation[] = {
- 81,
- 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,
- 0x1f6d5, 0x1f6d5,
- 0x1f6eb, 0x1f6ec,
- 0x1f6f4, 0x1f6fa,
- 0x1f7e0, 0x1f7eb,
- 0x1f90d, 0x1f93a,
- 0x1f93c, 0x1f945,
- 0x1f947, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1f9ff,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
-}; /* 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[] = {
- 36,
- 0x261d, 0x261d,
- 0x26f9, 0x26f9,
- 0x270a, 0x270d,
- 0x1f385, 0x1f385,
- 0x1f3c2, 0x1f3c4,
- 0x1f3c7, 0x1f3c7,
- 0x1f3ca, 0x1f3cc,
- 0x1f442, 0x1f443,
- 0x1f446, 0x1f450,
- 0x1f466, 0x1f478,
- 0x1f47c, 0x1f47c,
- 0x1f481, 0x1f483,
- 0x1f485, 0x1f487,
- 0x1f48f, 0x1f48f,
- 0x1f491, 0x1f491,
- 0x1f4aa, 0x1f4aa,
- 0x1f574, 0x1f575,
- 0x1f57a, 0x1f57a,
- 0x1f590, 0x1f590,
- 0x1f595, 0x1f596,
- 0x1f645, 0x1f647,
- 0x1f64b, 0x1f64f,
- 0x1f6a3, 0x1f6a3,
- 0x1f6b4, 0x1f6b6,
- 0x1f6c0, 0x1f6c0,
- 0x1f6cc, 0x1f6cc,
- 0x1f90f, 0x1f90f,
- 0x1f918, 0x1f91f,
- 0x1f926, 0x1f926,
- 0x1f930, 0x1f939,
- 0x1f93c, 0x1f93e,
- 0x1f9b5, 0x1f9b6,
- 0x1f9b8, 0x1f9b9,
- 0x1f9bb, 0x1f9bb,
- 0x1f9cd, 0x1f9cf,
- 0x1f9d1, 0x1f9dd,
-}; /* CR_Emoji_Modifier_Base */
-
-/* 'Emoji_Component': Emoji */
-static const OnigCodePoint CR_Emoji_Component[] = {
- 10,
- 0x0023, 0x0023,
- 0x002a, 0x002a,
- 0x0030, 0x0039,
- 0x200d, 0x200d,
- 0x20e3, 0x20e3,
- 0xfe0f, 0xfe0f,
- 0x1f1e6, 0x1f1ff,
- 0x1f3fb, 0x1f3ff,
- 0x1f9b0, 0x1f9b3,
- 0xe0020, 0xe007f,
-}; /* CR_Emoji_Component */
-
-/* 'Extended_Pictographic': Emoji */
-static const OnigCodePoint CR_Extended_Pictographic[] = {
- 77,
- 0x00a9, 0x00a9,
- 0x00ae, 0x00ae,
- 0x203c, 0x203c,
- 0x2049, 0x2049,
- 0x2122, 0x2122,
- 0x2139, 0x2139,
- 0x2194, 0x2199,
- 0x21a9, 0x21aa,
- 0x231a, 0x231b,
- 0x2328, 0x2328,
- 0x2388, 0x2388,
- 0x23cf, 0x23cf,
- 0x23e9, 0x23f3,
- 0x23f8, 0x23fa,
- 0x24c2, 0x24c2,
- 0x25aa, 0x25ab,
- 0x25b6, 0x25b6,
- 0x25c0, 0x25c0,
- 0x25fb, 0x25fe,
- 0x2600, 0x2605,
- 0x2607, 0x2612,
- 0x2614, 0x2685,
- 0x2690, 0x2705,
- 0x2708, 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, 0x2767,
- 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,
- 0x1f000, 0x1f0ff,
- 0x1f10d, 0x1f10f,
- 0x1f12f, 0x1f12f,
- 0x1f16c, 0x1f171,
- 0x1f17e, 0x1f17f,
- 0x1f18e, 0x1f18e,
- 0x1f191, 0x1f19a,
- 0x1f1ad, 0x1f1e5,
- 0x1f201, 0x1f20f,
- 0x1f21a, 0x1f21a,
- 0x1f22f, 0x1f22f,
- 0x1f232, 0x1f23a,
- 0x1f23c, 0x1f23f,
- 0x1f249, 0x1f3fa,
- 0x1f400, 0x1f53d,
- 0x1f546, 0x1f64f,
- 0x1f680, 0x1f6ff,
- 0x1f774, 0x1f77f,
- 0x1f7d5, 0x1f7ff,
- 0x1f80c, 0x1f80f,
- 0x1f848, 0x1f84f,
- 0x1f85a, 0x1f85f,
- 0x1f888, 0x1f88f,
- 0x1f8ae, 0x1f8ff,
- 0x1f90c, 0x1f93a,
- 0x1f93c, 0x1f945,
- 0x1f947, 0x1fffd,
-}; /* CR_Extended_Pictographic */
-
-/* 'Unknown': Script */
-static const OnigCodePoint CR_Unknown[] = {
- 664,
- 0x0378, 0x0379,
- 0x0380, 0x0383,
- 0x038b, 0x038b,
- 0x038d, 0x038d,
- 0x03a2, 0x03a2,
- 0x0530, 0x0530,
- 0x0557, 0x0558,
- 0x058b, 0x058c,
- 0x0590, 0x0590,
- 0x05c8, 0x05cf,
- 0x05eb, 0x05ee,
- 0x05f5, 0x05ff,
- 0x061d, 0x061d,
- 0x070e, 0x070e,
- 0x074b, 0x074c,
- 0x07b2, 0x07bf,
- 0x07fb, 0x07fc,
- 0x082e, 0x082f,
- 0x083f, 0x083f,
- 0x085c, 0x085d,
- 0x085f, 0x085f,
- 0x086b, 0x089f,
- 0x08b5, 0x08b5,
- 0x08be, 0x08d2,
- 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,
- 0x09ff, 0x0a00,
- 0x0a04, 0x0a04,
- 0x0a0b, 0x0a0e,
- 0x0a11, 0x0a12,
- 0x0a29, 0x0a29,
- 0x0a31, 0x0a31,
- 0x0a34, 0x0a34,
- 0x0a37, 0x0a37,
- 0x0a3a, 0x0a3b,
- 0x0a3d, 0x0a3d,
- 0x0a43, 0x0a46,
- 0x0a49, 0x0a4a,
- 0x0a4e, 0x0a50,
- 0x0a52, 0x0a58,
- 0x0a5d, 0x0a5d,
- 0x0a5f, 0x0a65,
- 0x0a77, 0x0a80,
- 0x0a84, 0x0a84,
- 0x0a8e, 0x0a8e,
- 0x0a92, 0x0a92,
- 0x0aa9, 0x0aa9,
- 0x0ab1, 0x0ab1,
- 0x0ab4, 0x0ab4,
- 0x0aba, 0x0abb,
- 0x0ac6, 0x0ac6,
- 0x0aca, 0x0aca,
- 0x0ace, 0x0acf,
- 0x0ad1, 0x0adf,
- 0x0ae4, 0x0ae5,
- 0x0af2, 0x0af8,
- 0x0b00, 0x0b00,
- 0x0b04, 0x0b04,
- 0x0b0d, 0x0b0e,
-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 0x0d84,
- 0x0d97, 0x0d99,
- 0x0db2, 0x0db2,
- 0x0dbc, 0x0dbc,
- 0x0dbe, 0x0dbf,
- 0x0dc7, 0x0dc9,
- 0x0dcb, 0x0dce,
- 0x0dd5, 0x0dd5,
- 0x0dd7, 0x0dd7,
- 0x0de0, 0x0de5,
- 0x0df0, 0x0df1,
- 0x0df5, 0x0e00,
- 0x0e3b, 0x0e3e,
- 0x0e5c, 0x0e80,
- 0x0e83, 0x0e83,
- 0x0e85, 0x0e85,
- 0x0e8b, 0x0e8b,
- 0x0ea4, 0x0ea4,
- 0x0ea6, 0x0ea6,
- 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,
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- 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,
- 0x10a36, 0x10a37,
- 0x10a3b, 0x10a3e,
- 0x10a49, 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,
- 0x10d28, 0x10d2f,
- 0x10d3a, 0x10e5f,
- 0x10e7f, 0x10eff,
- 0x10f28, 0x10f2f,
- 0x10f5a, 0x10fdf,
- 0x10ff7, 0x10fff,
- 0x1104e, 0x11051,
- 0x11070, 0x1107e,
- 0x110c2, 0x110cc,
- 0x110ce, 0x110cf,
- 0x110e9, 0x110ef,
- 0x110fa, 0x110ff,
- 0x11135, 0x11135,
- 0x11147, 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, 0x1133a,
- 0x11345, 0x11346,
- 0x11349, 0x1134a,
- 0x1134e, 0x1134f,
- 0x11351, 0x11356,
- 0x11358, 0x1135c,
- 0x11364, 0x11365,
- 0x1136d, 0x1136f,
- 0x11375, 0x113ff,
- 0x1145a, 0x1145a,
- 0x1145c, 0x1145c,
- 0x11460, 0x1147f,
- 0x114c8, 0x114cf,
- 0x114da, 0x1157f,
- 0x115b6, 0x115b7,
- 0x115de, 0x115ff,
- 0x11645, 0x1164f,
- 0x1165a, 0x1165f,
- 0x1166d, 0x1167f,
- 0x116b9, 0x116bf,
- 0x116ca, 0x116ff,
- 0x1171b, 0x1171c,
- 0x1172c, 0x1172f,
- 0x11740, 0x117ff,
- 0x1183c, 0x1189f,
- 0x118f3, 0x118fe,
- 0x11900, 0x1199f,
- 0x119a8, 0x119a9,
- 0x119d8, 0x119d9,
- 0x119e5, 0x119ff,
- 0x11a48, 0x11a4f,
- 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, 0x11d5f,
- 0x11d66, 0x11d66,
- 0x11d69, 0x11d69,
- 0x11d8f, 0x11d8f,
- 0x11d92, 0x11d92,
- 0x11d99, 0x11d9f,
- 0x11daa, 0x11edf,
- 0x11ef9, 0x11fbf,
- 0x11ff2, 0x11ffe,
- 0x1239a, 0x123ff,
- 0x1246f, 0x1246f,
- 0x12475, 0x1247f,
- 0x12544, 0x12fff,
- 0x1342f, 0x1342f,
- 0x13439, 0x143ff,
- 0x14647, 0x167ff,
- 0x16a39, 0x16a3f,
- 0x16a5f, 0x16a5f,
- 0x16a6a, 0x16a6d,
- 0x16a70, 0x16acf,
- 0x16aee, 0x16aef,
- 0x16af6, 0x16aff,
- 0x16b46, 0x16b4f,
- 0x16b5a, 0x16b5a,
- 0x16b62, 0x16b62,
- 0x16b78, 0x16b7c,
- 0x16b90, 0x16e3f,
- 0x16e9b, 0x16eff,
- 0x16f4b, 0x16f4e,
- 0x16f88, 0x16f8e,
- 0x16fa0, 0x16fdf,
- 0x16fe4, 0x16fff,
- 0x187f8, 0x187ff,
- 0x18af3, 0x1afff,
- 0x1b11f, 0x1b14f,
- 0x1b153, 0x1b163,
- 0x1b168, 0x1b16f,
- 0x1b2fc, 0x1bbff,
- 0x1bc6b, 0x1bc6f,
- 0x1bc7d, 0x1bc7f,
- 0x1bc89, 0x1bc8f,
- 0x1bc9a, 0x1bc9b,
- 0x1bca4, 0x1cfff,
- 0x1d0f6, 0x1d0ff,
- 0x1d127, 0x1d128,
- 0x1d1e9, 0x1d1ff,
- 0x1d246, 0x1d2df,
- 0x1d2f4, 0x1d2ff,
- 0x1d357, 0x1d35f,
- 0x1d379, 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,
- 0x1da8c, 0x1da9a,
- 0x1daa0, 0x1daa0,
- 0x1dab0, 0x1dfff,
- 0x1e007, 0x1e007,
- 0x1e019, 0x1e01a,
- 0x1e022, 0x1e022,
- 0x1e025, 0x1e025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10f,
- 0x1f16d, 0x1f16f,
- 0x1f1ad, 0x1f1e5,
- 0x1f203, 0x1f20f,
- 0x1f23c, 0x1f23f,
- 0x1f249, 0x1f24f,
- 0x1f252, 0x1f25f,
- 0x1f266, 0x1f2ff,
- 0x1f6d6, 0x1f6df,
- 0x1f6ed, 0x1f6ef,
- 0x1f6fb, 0x1f6ff,
- 0x1f774, 0x1f77f,
- 0x1f7d9, 0x1f7df,
- 0x1f7ec, 0x1f7ff,
- 0x1f80c, 0x1f80f,
- 0x1f848, 0x1f84f,
- 0x1f85a, 0x1f85f,
- 0x1f888, 0x1f88f,
- 0x1f8ae, 0x1f8ff,
- 0x1f90c, 0x1f90c,
- 0x1f972, 0x1f972,
- 0x1f977, 0x1f979,
- 0x1f9a3, 0x1f9a4,
- 0x1f9ab, 0x1f9ad,
- 0x1f9cb, 0x1f9cc,
- 0x1fa54, 0x1fa5f,
- 0x1fa6e, 0x1fa6f,
- 0x1fa74, 0x1fa77,
- 0x1fa7b, 0x1fa7f,
- 0x1fa83, 0x1fa8f,
- 0x1fa96, 0x1ffff,
- 0x2a6d7, 0x2a6ff,
- 0x2b735, 0x2b73f,
- 0x2b81e, 0x2b81f,
- 0x2cea2, 0x2ceaf,
- 0x2ebe1, 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, 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, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,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1fb4,
- 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, 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,
- 0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2424,
- 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, 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,
- 0x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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,
- 0x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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, 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,
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eab,
- 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,
- 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, 0x0b4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dbd, 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, 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,
- 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, 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,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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,
- 0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x0ead, 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,
- 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,
- 0x0a4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0fcc,
- 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,
- 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,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x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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, 0x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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, 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,
- 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c, 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,
- 0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x0e88,
- 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, 0x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ce,
- 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, 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,
- 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7,
- 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,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0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa697,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xd800, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018a,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11143,
- 0x11180, 0x111c8,
- 0x111d0, 0x111d9,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f7e,
- 0x16f8f, 0x16f9f,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x1eef0, 0x1eef1,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f540, 0x1f543,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 0x1fffe, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_6_2 */
-
-/* 'Age_6_3': Derived Age 6.3 */
-static const OnigCodePoint CR_Age_6_3[] = {
- 549,
- 0x0000, 0x0377,
- 0x037a, 0x037e,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x0527,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x058f, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x0604,
- 0x0606, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x08a0, 0x08a0,
- 0x08a2, 0x08ac,
- 0x08e4, 0x08fe,
- 0x0900, 0x0977,
- 0x0979, 0x097f,
- 0x0981, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a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
- 0x0edc, 0x0edf,
- 0x0f00, 0x0f47,
- 0x0f49, 0x0f6c,
- 0x0f71, 0x0f97,
- 0x0f99, 0x0fbc,
- 0x0fbe, 0x0fcc,
- 0x0fce, 0x0fda,
- 0x1000, 0x10c5,
- 0x10c7, 0x10c7,
- 0x10cd, 0x10cd,
- 0x10d0, 0x1248,
- 0x124a, 0x124d,
- 0x1250, 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 0x169c,
- 0x16a0, 0x16f0,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191c,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf6,
- 0x1d00, 0x1de6,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x2064,
- 0x2066, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20ba,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23f3,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x26ff,
- 0x2701, 0x2b4c,
- 0x2b50, 0x2b59,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf3,
- 0x2cf9, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e3b,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa697,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa793,
- 0xa7a0, 0xa7aa,
- 0xa7f8, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9df,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaa7b,
- 0xaa80, 0xaac2,
- 0xaadb, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xd800, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe26,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018a,
- 0x10190, 0x1019b,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x10300, 0x1031e,
- 0x10320, 0x10323,
- 0x10330, 0x1034a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1085f,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a7f,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b7f,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x11080, 0x110c1,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11143,
- 0x11180, 0x111c8,
- 0x111d0, 0x111d9,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x12000, 0x1236e,
- 0x12400, 0x12462,
- 0x12470, 0x12473,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f7e,
- 0x16f8f, 0x16f9f,
- 0x1b000, 0x1b001,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49e, 0x1d49f,
- 0x1d4a2, 0x1d4a2,
- 0x1d4a5, 0x1d4a6,
- 0x1d4a9, 0x1d4ac,
- 0x1d4ae, 0x1d4b9,
- 0x1d4bb, 0x1d4bb,
- 0x1d4bd, 0x1d4c3,
- 0x1d4c5, 0x1d505,
- 0x1d507, 0x1d50a,
- 0x1d50d, 0x1d514,
- 0x1d516, 0x1d51c,
- 0x1d51e, 0x1d539,
- 0x1d53b, 0x1d53e,
- 0x1d540, 0x1d544,
- 0x1d546, 0x1d546,
- 0x1d54a, 0x1d550,
- 0x1d552, 0x1d6a5,
- 0x1d6a8, 0x1d7cb,
- 0x1d7ce, 0x1d7ff,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 0x1ee1f,
- 0x1ee21, 0x1ee22,
- 0x1ee24, 0x1ee24,
- 0x1ee27, 0x1ee27,
- 0x1ee29, 0x1ee32,
- 0x1ee34, 0x1ee37,
- 0x1ee39, 0x1ee39,
- 0x1ee3b, 0x1ee3b,
- 0x1ee42, 0x1ee42,
- 0x1ee47, 0x1ee47,
- 0x1ee49, 0x1ee49,
- 0x1ee4b, 0x1ee4b,
- 0x1ee4d, 0x1ee4f,
- 0x1ee51, 0x1ee52,
- 0x1ee54, 0x1ee54,
- 0x1ee57, 0x1ee57,
- 0x1ee59, 0x1ee59,
- 0x1ee5b, 0x1ee5b,
- 0x1ee5d, 0x1ee5d,
- 0x1ee5f, 0x1ee5f,
- 0x1ee61, 0x1ee62,
- 0x1ee64, 0x1ee64,
- 0x1ee67, 0x1ee6a,
- 0x1ee6c, 0x1ee72,
- 0x1ee74, 0x1ee77,
- 0x1ee79, 0x1ee7c,
- 0x1ee7e, 0x1ee7e,
- 0x1ee80, 0x1ee89,
- 0x1ee8b, 0x1ee9b,
- 0x1eea1, 0x1eea3,
- 0x1eea5, 0x1eea9,
- 0x1eeab, 0x1eebb,
- 0x1eef0, 0x1eef1,
- 0x1f000, 0x1f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0be,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0df,
- 0x1f100, 0x1f10a,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f320,
- 0x1f330, 0x1f335,
- 0x1f337, 0x1f37c,
- 0x1f380, 0x1f393,
- 0x1f3a0, 0x1f3c4,
- 0x1f3c6, 0x1f3ca,
- 0x1f3e0, 0x1f3f0,
- 0x1f400, 0x1f43e,
- 0x1f440, 0x1f440,
- 0x1f442, 0x1f4f7,
- 0x1f4f9, 0x1f4fc,
- 0x1f500, 0x1f53d,
- 0x1f540, 0x1f543,
- 0x1f550, 0x1f567,
- 0x1f5fb, 0x1f640,
- 0x1f645, 0x1f64f,
- 0x1f680, 0x1f6c5,
- 0x1f700, 0x1f773,
- 0x1fffe, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_6_3 */
-
-/* 'Age_7_0': Derived Age 7.0 */
-static const OnigCodePoint CR_Age_7_0[] = {
- 610,
- 0x0000, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x08a0, 0x08b2,
- 0x08e4, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0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 0x1256,
- 0x1258, 0x1258,
- 0x125a, 0x125d,
- 0x1260, 0x1288,
- 0x128a, 0x128d,
- 0x1290, 0x12b0,
- 0x12b2, 0x12b5,
- 0x12b8, 0x12be,
- 0x12c0, 0x12c0,
- 0x12c2, 0x12c5,
- 0x12c8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f4,
- 0x1400, 0x169c,
- 0x16a0, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1ab0, 0x1abe,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf6,
- 0x1cf8, 0x1cf9,
- 0x1d00, 0x1df5,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x2064,
- 0x2066, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20bd,
- 0x20d0, 0x20f0,
- 0x2100, 0x2189,
- 0x2190, 0x23fa,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd1,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf3,
- 0x2cf9, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e42,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fcc,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa69d,
- 0xa69f, 0xa6f7,
- 0xa700, 0xa78e,
- 0xa790, 0xa7ad,
- 0xa7b0, 0xa7b1,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fb,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9fe,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaac2,
- 0xaadb, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab5f,
- 0xab64, 0xab65,
- 0xabc0, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xd800, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe2d,
- 0xfe30, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018c,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102fb,
- 0x10300, 0x10323,
- 0x10330, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10500, 0x10527,
- 0x10530, 0x10563,
- 0x1056f, 0x1056f,
- 0x10600, 0x10736,
- 0x10740, 0x10755,
- 0x10760, 0x10767,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1089e,
- 0x108a7, 0x108af,
- 0x10900, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10980, 0x109b7,
- 0x109be, 0x109bf,
- 0x10a00, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a9f,
- 0x10ac0, 0x10ae6,
- 0x10aeb, 0x10af6,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b91,
- 0x10b99, 0x10b9c,
- 0x10ba9, 0x10baf,
- 0x10c00, 0x10c48,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11143,
- 0x11150, 0x11176,
- 0x11180, 0x111c8,
- 0x111cd, 0x111cd,
- 0x111d0, 0x111da,
- 0x111e1, 0x111f4,
- 0x11200, 0x11211,
- 0x11213, 0x1123d,
- 0x112b0, 0x112ea,
- 0x112f0, 0x112f9,
- 0x11301, 0x11303,
- 0x11305, 0x1130c,
- 0x1130f, 0x11310,
- 0x11313, 0x11328,
- 0x1132a, 0x11330,
- 0x11332, 0x11333,
- 0x11335, 0x11339,
- 0x1133c, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115c9,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11ac0, 0x11af8,
- 0x12000, 0x12398,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x13000, 0x1342e,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f7e,
- 0x16f8f, 0x16f9f,
- 0x1b000, 0x1b001,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1dd,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d371,
- 0x1d400, 0x1d454,
- 0x1d456, 0x1d49c,
- 0x1d49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f02b,
- 0x1f030, 0x1f093,
- 0x1f0a0, 0x1f0ae,
- 0x1f0b1, 0x1f0bf,
- 0x1f0c1, 0x1f0cf,
- 0x1f0d1, 0x1f0f5,
- 0x1f100, 0x1f10c,
- 0x1f110, 0x1f12e,
- 0x1f130, 0x1f16b,
- 0x1f170, 0x1f19a,
- 0x1f1e6, 0x1f202,
- 0x1f210, 0x1f23a,
- 0x1f240, 0x1f248,
- 0x1f250, 0x1f251,
- 0x1f300, 0x1f32c,
- 0x1f330, 0x1f37d,
- 0x1f380, 0x1f3ce,
- 0x1f3d4, 0x1f3f7,
- 0x1f400, 0x1f4fe,
- 0x1f500, 0x1f54a,
- 0x1f550, 0x1f579,
- 0x1f57b, 0x1f5a3,
- 0x1f5a5, 0x1f642,
- 0x1f645, 0x1f6cf,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f3,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d4,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1fffe, 0x2a6d6,
- 0x2a700, 0x2b734,
- 0x2b740, 0x2b81d,
- 0x2f800, 0x2fa1d,
- 0x2fffe, 0x2ffff,
- 0x3fffe, 0x3ffff,
- 0x4fffe, 0x4ffff,
- 0x5fffe, 0x5ffff,
- 0x6fffe, 0x6ffff,
- 0x7fffe, 0x7ffff,
- 0x8fffe, 0x8ffff,
- 0x9fffe, 0x9ffff,
- 0xafffe, 0xaffff,
- 0xbfffe, 0xbffff,
- 0xcfffe, 0xcffff,
- 0xdfffe, 0xdffff,
- 0xe0001, 0xe0001,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
- 0xefffe, 0x10ffff,
-}; /* CR_Age_7_0 */
-
-/* 'Age_8_0': Derived Age 8.0 */
-static const OnigCodePoint CR_Age_8_0[] = {
- 623,
- 0x0000, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x055f,
- 0x0561, 0x0587,
- 0x0589, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05f0, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x0800, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x08a0, 0x08b4,
- 0x08e3, 0x0983,
- 0x0985, 0x098c,
- 0x098f, 0x0990,
- 0x0993, 0x09a8,
- 0x09aa, 0x09b0,
- 0x09b2, 0x09b2,
- 0x09b6, 0x09b9,
- 0x09bc, 0x09c4,
- 0x09c7, 0x09c8,
- 0x09cb, 0x09ce,
- 0x09d7, 0x09d7,
- 0x09dc, 0x09dd,
- 0x09df, 0x09e3,
- 0x09e6, 0x09fb,
- 0x0a01, 0x0a03,
- 0x0a05, 0x0a0a,
- 0x0a0f, 0x0a10,
- 0x0a13, 0x0a28,
- 0x0a2a, 0x0a30,
- 0x0a32, 0x0a33,
- 0x0a35, 0x0a36,
- 0x0a38, 0x0a39,
- 0x0a3c, 0x0a3c,
- 0x0a3e, 0x0a42,
- 0x0a47, 0x0a48,
- 0x0a4b, 0x0a4d,
- 0x0a51, 0x0a51,
- 0x0a59, 0x0a5c,
- 0x0a5e, 0x0a5e,
- 0x0a66, 0x0a75,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x0ac7, 0x0ac9,
- 0x0acb, 0x0acd,
- 0x0ad0, 0x0ad0,
- 0x0ae0, 0x0ae3,
- 0x0ae6, 0x0af1,
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8, 0x12d6,
- 0x12d8, 0x1310,
- 0x1312, 0x1315,
- 0x1318, 0x135a,
- 0x135d, 0x137c,
- 0x1380, 0x1399,
- 0x13a0, 0x13f5,
- 0x13f8, 0x13fd,
- 0x1400, 0x169c,
- 0x16a0, 0x16f8,
- 0x1700, 0x170c,
- 0x170e, 0x1714,
- 0x1720, 0x1736,
- 0x1740, 0x1753,
- 0x1760, 0x176c,
- 0x176e, 0x1770,
- 0x1772, 0x1773,
- 0x1780, 0x17dd,
- 0x17e0, 0x17e9,
- 0x17f0, 0x17f9,
- 0x1800, 0x180e,
- 0x1810, 0x1819,
- 0x1820, 0x1877,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d,
- 0x1970, 0x1974,
- 0x1980, 0x19ab,
- 0x19b0, 0x19c9,
- 0x19d0, 0x19da,
- 0x19de, 0x1a1b,
- 0x1a1e, 0x1a5e,
- 0x1a60, 0x1a7c,
- 0x1a7f, 0x1a89,
- 0x1a90, 0x1a99,
- 0x1aa0, 0x1aad,
- 0x1ab0, 0x1abe,
- 0x1b00, 0x1b4b,
- 0x1b50, 0x1b7c,
- 0x1b80, 0x1bf3,
- 0x1bfc, 0x1c37,
- 0x1c3b, 0x1c49,
- 0x1c4d, 0x1c7f,
- 0x1cc0, 0x1cc7,
- 0x1cd0, 0x1cf6,
- 0x1cf8, 0x1cf9,
- 0x1d00, 0x1df5,
- 0x1dfc, 0x1f15,
- 0x1f18, 0x1f1d,
- 0x1f20, 0x1f45,
- 0x1f48, 0x1f4d,
- 0x1f50, 0x1f57,
- 0x1f59, 0x1f59,
- 0x1f5b, 0x1f5b,
- 0x1f5d, 0x1f5d,
- 0x1f5f, 0x1f7d,
- 0x1f80, 0x1fb4,
- 0x1fb6, 0x1fc4,
- 0x1fc6, 0x1fd3,
- 0x1fd6, 0x1fdb,
- 0x1fdd, 0x1fef,
- 0x1ff2, 0x1ff4,
- 0x1ff6, 0x1ffe,
- 0x2000, 0x2064,
- 0x2066, 0x2071,
- 0x2074, 0x208e,
- 0x2090, 0x209c,
- 0x20a0, 0x20be,
- 0x20d0, 0x20f0,
- 0x2100, 0x218b,
- 0x2190, 0x23fa,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd1,
- 0x2bec, 0x2bef,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf3,
- 0x2cf9, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e42,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fd5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7ad,
- 0xa7b0, 0xa7b7,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c4,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 0xa8fd,
- 0xa900, 0xa953,
- 0xa95f, 0xa97c,
- 0xa980, 0xa9cd,
- 0xa9cf, 0xa9d9,
- 0xa9de, 0xa9fe,
- 0xaa00, 0xaa36,
- 0xaa40, 0xaa4d,
- 0xaa50, 0xaa59,
- 0xaa5c, 0xaac2,
- 0xaadb, 0xaaf6,
- 0xab01, 0xab06,
- 0xab09, 0xab0e,
- 0xab11, 0xab16,
- 0xab20, 0xab26,
- 0xab28, 0xab2e,
- 0xab30, 0xab65,
- 0xab70, 0xabed,
- 0xabf0, 0xabf9,
- 0xac00, 0xd7a3,
- 0xd7b0, 0xd7c6,
- 0xd7cb, 0xd7fb,
- 0xd800, 0xfa6d,
- 0xfa70, 0xfad9,
- 0xfb00, 0xfb06,
- 0xfb13, 0xfb17,
- 0xfb1d, 0xfb36,
- 0xfb38, 0xfb3c,
- 0xfb3e, 0xfb3e,
- 0xfb40, 0xfb41,
- 0xfb43, 0xfb44,
- 0xfb46, 0xfbc1,
- 0xfbd3, 0xfd3f,
- 0xfd50, 0xfd8f,
- 0xfd92, 0xfdc7,
- 0xfdd0, 0xfdfd,
- 0xfe00, 0xfe19,
- 0xfe20, 0xfe52,
- 0xfe54, 0xfe66,
- 0xfe68, 0xfe6b,
- 0xfe70, 0xfe74,
- 0xfe76, 0xfefc,
- 0xfeff, 0xfeff,
- 0xff01, 0xffbe,
- 0xffc2, 0xffc7,
- 0xffca, 0xffcf,
- 0xffd2, 0xffd7,
- 0xffda, 0xffdc,
- 0xffe0, 0xffe6,
- 0xffe8, 0xffee,
- 0xfff9, 0x1000b,
- 0x1000d, 0x10026,
- 0x10028, 0x1003a,
- 0x1003c, 0x1003d,
- 0x1003f, 0x1004d,
- 0x10050, 0x1005d,
- 0x10080, 0x100fa,
- 0x10100, 0x10102,
- 0x10107, 0x10133,
- 0x10137, 0x1018c,
- 0x10190, 0x1019b,
- 0x101a0, 0x101a0,
- 0x101d0, 0x101fd,
- 0x10280, 0x1029c,
- 0x102a0, 0x102d0,
- 0x102e0, 0x102fb,
- 0x10300, 0x10323,
- 0x10330, 0x1034a,
- 0x10350, 0x1037a,
- 0x10380, 0x1039d,
- 0x1039f, 0x103c3,
- 0x103c8, 0x103d5,
- 0x10400, 0x1049d,
- 0x104a0, 0x104a9,
- 0x10500, 0x10527,
- 0x10530, 0x10563,
- 0x1056f, 0x1056f,
- 0x10600, 0x10736,
- 0x10740, 0x10755,
- 0x10760, 0x10767,
- 0x10800, 0x10805,
- 0x10808, 0x10808,
- 0x1080a, 0x10835,
- 0x10837, 0x10838,
- 0x1083c, 0x1083c,
- 0x1083f, 0x10855,
- 0x10857, 0x1089e,
- 0x108a7, 0x108af,
- 0x108e0, 0x108f2,
- 0x108f4, 0x108f5,
- 0x108fb, 0x1091b,
- 0x1091f, 0x10939,
- 0x1093f, 0x1093f,
- 0x10980, 0x109b7,
- 0x109bc, 0x109cf,
- 0x109d2, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a13,
- 0x10a15, 0x10a17,
- 0x10a19, 0x10a33,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a47,
- 0x10a50, 0x10a58,
- 0x10a60, 0x10a9f,
- 0x10ac0, 0x10ae6,
- 0x10aeb, 0x10af6,
- 0x10b00, 0x10b35,
- 0x10b39, 0x10b55,
- 0x10b58, 0x10b72,
- 0x10b78, 0x10b91,
- 0x10b99, 0x10b9c,
- 0x10ba9, 0x10baf,
- 0x10c00, 0x10c48,
- 0x10c80, 0x10cb2,
- 0x10cc0, 0x10cf2,
- 0x10cfa, 0x10cff,
- 0x10e60, 0x10e7e,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11143,
- 0x11150, 0x11176,
- 0x11180, 0x111cd,
- 0x111d0, 0x111df,
- 0x111e1, 0x111f4,
- 0x11200, 0x11211,
- 0x11213, 0x1123d,
- 0x11280, 0x11286,
- 0x11288, 0x11288,
- 0x1128a, 0x1128d,
- 0x1128f, 0x1129d,
- 0x1129f, 0x112a9,
- 0x112b0, 0x112ea,
- 0x112f0, 0x112f9,
- 0x11300, 0x11303,
- 0x11305, 0x1130c,
- 0x1130f, 0x11310,
- 0x11313, 0x11328,
- 0x1132a, 0x11330,
- 0x11332, 0x11333,
- 0x11335, 0x11339,
- 0x1133c, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x11719,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11ac0, 0x11af8,
- 0x12000, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f7e,
- 0x16f8f, 0x16f9f,
- 0x1b000, 0x1b001,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d300, 0x1d356,
- 0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9b,
- 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, 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,
- 0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8, 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, 0x1cf6,
- 0x1cf8, 0x1cf9,
- 0x1d00, 0x1df5,
- 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, 0x20be,
- 0x20d0, 0x20f0,
- 0x2100, 0x218b,
- 0x2190, 0x23fe,
- 0x2400, 0x2426,
- 0x2440, 0x244a,
- 0x2460, 0x2b73,
- 0x2b76, 0x2b95,
- 0x2b98, 0x2bb9,
- 0x2bbd, 0x2bc8,
- 0x2bca, 0x2bd1,
- 0x2bec, 0x2bef,
- 0x2c00, 0x2c2e,
- 0x2c30, 0x2c5e,
- 0x2c60, 0x2cf3,
- 0x2cf9, 0x2d25,
- 0x2d27, 0x2d27,
- 0x2d2d, 0x2d2d,
- 0x2d30, 0x2d67,
- 0x2d6f, 0x2d70,
- 0x2d7f, 0x2d96,
- 0x2da0, 0x2da6,
- 0x2da8, 0x2dae,
- 0x2db0, 0x2db6,
- 0x2db8, 0x2dbe,
- 0x2dc0, 0x2dc6,
- 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e44,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312d,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fd5,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 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,
- 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,
- 0x1f300, 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,
- 0x09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 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, 0x1a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, 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 */
-
-/* 'Age_11_0': Derived Age 11.0 */
-static const OnigCodePoint CR_Age_11_0[] = {
- 668,
- 0x0000, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x07fd, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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, 0x09fe,
- 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, 0x0a76,
- 0x0a81, 0x0a83,
- 0x0a85, 0x0a8d,
- 0x0a8f, 0x0a91,
- 0x0a93, 0x0aa8,
- 0x0aaa, 0x0ab0,
- 0x0ab2, 0x0ab3,
- 0x0ab5, 0x0ab9,
- 0x0abc, 0x0ac5,
- 0x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, 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 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, 0x2bc8,
- 0x2bca, 0x2bfe,
- 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, 0x2e4e,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7b9,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f59,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110cd, 0x110cd,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11146,
- 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145e,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b7,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x11800, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x11a00, 0x11a47,
- 0x11a50, 0x11a83,
- 0x11a86, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef8,
- 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,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f44,
- 0x16f50, 0x16f7e,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe1,
- 0x17000, 0x187f1,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
-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x1f250, 0x1f251,
- 0x1f260, 0x1f265,
- 0x1f300, 0x1f6d4,
- 0x1f6e0, 0x1f6ec,
- 0x1f6f0, 0x1f6f9,
- 0x1f700, 0x1f773,
- 0x1f780, 0x1f7d8,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f910, 0x1f93e,
- 0x1f940, 0x1f970,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f97a,
- 0x1f97c, 0x1f9a2,
- 0x1f9b0, 0x1f9b9,
- 0x1f9c0, 0x1f9c2,
- 0x1f9d0, 0x1f9ff,
- 0x1fa60, 0x1fa6d,
- 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_11_0 */
-
-/* 'Age_12_0': Derived Age 12.0 */
-static const OnigCodePoint CR_Age_12_0[] = {
- 677,
- 0x0000, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x07fd, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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, 0x09fe,
- 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, 0x0a76,
- 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, 0x0b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,
- 0x0dca, 0x0dca,
- 0x0dcf, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0dd8, 0x0ddf,
- 0x0de6, 0x0def,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x1878,
- 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,
- 0x1c90, 0x1cba,
- 0x1cbd, 0x1cc7,
- 0x1cd0, 0x1cfa,
- 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, 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, 0x2e4f,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x32fe,
- 0x3300, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 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, 0xab67,
- 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f59,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110cd, 0x110cd,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11146,
- 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145f,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x11800, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e4,
- 0x11a00, 0x11a47,
- 0x11a50, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef8,
- 0x11fc0, 0x11ff1,
- 0x11fff, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x13430, 0x13438,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
- 0x1e2c0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 0x1e950, 0x1e959,
- 0x1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 0x1f7e0, 0x1f7eb,
- 0x1f800, 0x1f80b,
- 0x1f810, 0x1f847,
- 0x1f850, 0x1f859,
- 0x1f860, 0x1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 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_12_0 */
-
-/* 'Age_12_1': Derived Age 12.1 */
-static const OnigCodePoint CR_Age_12_1[] = {
- 676,
- 0x0000, 0x0377,
- 0x037a, 0x037f,
- 0x0384, 0x038a,
- 0x038c, 0x038c,
- 0x038e, 0x03a1,
- 0x03a3, 0x052f,
- 0x0531, 0x0556,
- 0x0559, 0x058a,
- 0x058d, 0x058f,
- 0x0591, 0x05c7,
- 0x05d0, 0x05ea,
- 0x05ef, 0x05f4,
- 0x0600, 0x061c,
- 0x061e, 0x070d,
- 0x070f, 0x074a,
- 0x074d, 0x07b1,
- 0x07c0, 0x07fa,
- 0x07fd, 0x082d,
- 0x0830, 0x083e,
- 0x0840, 0x085b,
- 0x085e, 0x085e,
- 0x0860, 0x086a,
- 0x08a0, 0x08b4,
- 0x08b6, 0x08bd,
- 0x08d3, 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, 0x09fe,
- 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, 0x0a76,
- 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, 0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0x0ddf,
- 0x0de6, 0x0def,
- 0x0df2, 0x0df4,
- 0x0e01, 0x0e3a,
- 0x0e3f, 0x0e5b,
- 0x0e81, 0x0e82,
- 0x0e84, 0x0e84,
- 0x0e86, 0x0e8a,
- 0x0e8c, 0x0ea3,
- 0x0ea5, 0x0ea5,
- 0x0ea7, 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, 0x1878,
- 0x1880, 0x18aa,
- 0x18b0, 0x18f5,
- 0x1900, 0x191e,
- 0x1920, 0x192b,
- 0x1930, 0x193b,
- 0x1940, 0x1940,
- 0x1944, 0x196d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 0x2dc8, 0x2dce,
- 0x2dd0, 0x2dd6,
- 0x2dd8, 0x2dde,
- 0x2de0, 0x2e4f,
- 0x2e80, 0x2e99,
- 0x2e9b, 0x2ef3,
- 0x2f00, 0x2fd5,
- 0x2ff0, 0x2ffb,
- 0x3000, 0x303f,
- 0x3041, 0x3096,
- 0x3099, 0x30ff,
- 0x3105, 0x312f,
- 0x3131, 0x318e,
- 0x3190, 0x31ba,
- 0x31c0, 0x31e3,
- 0x31f0, 0x321e,
- 0x3220, 0x4db5,
- 0x4dc0, 0x9fef,
- 0xa000, 0xa48c,
- 0xa490, 0xa4c6,
- 0xa4d0, 0xa62b,
- 0xa640, 0xa6f7,
- 0xa700, 0xa7bf,
- 0xa7c2, 0xa7c6,
- 0xa7f7, 0xa82b,
- 0xa830, 0xa839,
- 0xa840, 0xa877,
- 0xa880, 0xa8c5,
- 0xa8ce, 0xa8d9,
- 0xa8e0, 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, 0xab67,
- 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, 0x10a35,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a48,
- 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, 0x10d27,
- 0x10d30, 0x10d39,
- 0x10e60, 0x10e7e,
- 0x10f00, 0x10f27,
- 0x10f30, 0x10f59,
- 0x10fe0, 0x10ff6,
- 0x11000, 0x1104d,
- 0x11052, 0x1106f,
- 0x1107f, 0x110c1,
- 0x110cd, 0x110cd,
- 0x110d0, 0x110e8,
- 0x110f0, 0x110f9,
- 0x11100, 0x11134,
- 0x11136, 0x11146,
- 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,
- 0x1133b, 0x11344,
- 0x11347, 0x11348,
- 0x1134b, 0x1134d,
- 0x11350, 0x11350,
- 0x11357, 0x11357,
- 0x1135d, 0x11363,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11400, 0x11459,
- 0x1145b, 0x1145b,
- 0x1145d, 0x1145f,
- 0x11480, 0x114c7,
- 0x114d0, 0x114d9,
- 0x11580, 0x115b5,
- 0x115b8, 0x115dd,
- 0x11600, 0x11644,
- 0x11650, 0x11659,
- 0x11660, 0x1166c,
- 0x11680, 0x116b8,
- 0x116c0, 0x116c9,
- 0x11700, 0x1171a,
- 0x1171d, 0x1172b,
- 0x11730, 0x1173f,
- 0x11800, 0x1183b,
- 0x118a0, 0x118f2,
- 0x118ff, 0x118ff,
- 0x119a0, 0x119a7,
- 0x119aa, 0x119d7,
- 0x119da, 0x119e4,
- 0x11a00, 0x11a47,
- 0x11a50, 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,
- 0x11d60, 0x11d65,
- 0x11d67, 0x11d68,
- 0x11d6a, 0x11d8e,
- 0x11d90, 0x11d91,
- 0x11d93, 0x11d98,
- 0x11da0, 0x11da9,
- 0x11ee0, 0x11ef8,
- 0x11fc0, 0x11ff1,
- 0x11fff, 0x12399,
- 0x12400, 0x1246e,
- 0x12470, 0x12474,
- 0x12480, 0x12543,
- 0x13000, 0x1342e,
- 0x13430, 0x13438,
- 0x14400, 0x14646,
- 0x16800, 0x16a38,
- 0x16a40, 0x16a5e,
- 0x16a60, 0x16a69,
- 0x16a6e, 0x16a6f,
- 0x16ad0, 0x16aed,
- 0x16af0, 0x16af5,
- 0x16b00, 0x16b45,
- 0x16b50, 0x16b59,
- 0x16b5b, 0x16b61,
- 0x16b63, 0x16b77,
- 0x16b7d, 0x16b8f,
- 0x16e40, 0x16e9a,
- 0x16f00, 0x16f4a,
- 0x16f4f, 0x16f87,
- 0x16f8f, 0x16f9f,
- 0x16fe0, 0x16fe3,
- 0x17000, 0x187f7,
- 0x18800, 0x18af2,
- 0x1b000, 0x1b11e,
- 0x1b150, 0x1b152,
- 0x1b164, 0x1b167,
- 0x1b170, 0x1b2fb,
- 0x1bc00, 0x1bc6a,
- 0x1bc70, 0x1bc7c,
- 0x1bc80, 0x1bc88,
- 0x1bc90, 0x1bc99,
- 0x1bc9c, 0x1bca3,
- 0x1d000, 0x1d0f5,
- 0x1d100, 0x1d126,
- 0x1d129, 0x1d1e8,
- 0x1d200, 0x1d245,
- 0x1d2e0, 0x1d2f3,
- 0x1d300, 0x1d356,
- 0x1d360, 0x1d378,
- 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,
- 0x1e100, 0x1e12c,
- 0x1e130, 0x1e13d,
- 0x1e140, 0x1e149,
- 0x1e14e, 0x1e14f,
- 0x1e2c0, 0x1e2f9,
- 0x1e2ff, 0x1e2ff,
- 0x1e800, 0x1e8c4,
- 0x1e8c7, 0x1e8d6,
- 0x1e900, 0x1e94b,
- 0x1e950, 0x1e959,
- 0x1e95e, 0x1e95f,
- 0x1ec71, 0x1ecb4,
- 0x1ed01, 0x1ed3d,
- 0x1ee00, 0x1ee03,
- 0x1ee05, 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1f887,
- 0x1f890, 0x1f8ad,
- 0x1f900, 0x1f90b,
- 0x1f90d, 0x1f971,
- 0x1f973, 0x1f976,
- 0x1f97a, 0x1f9a2,
- 0x1f9a5, 0x1f9aa,
- 0x1f9ae, 0x1f9ca,
- 0x1f9cd, 0x1fa53,
- 0x1fa60, 0x1fa6d,
- 0x1fa70, 0x1fa73,
- 0x1fa78, 0x1fa7a,
- 0x1fa80, 0x1fa82,
- 0x1fa90, 0x1fa95,
- 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_12_1 */
-
-#endif /* USE_UNICODE_AGE_PROPERTIES */
-/* 'Grapheme_Cluster_Break_Prepend': Grapheme_Cluster_Break=Prepend */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_Prepend[] = {
- 11,
- 0x0600, 0x0605,
- 0x06dd, 0x06dd,
- 0x070f, 0x070f,
- 0x08e2, 0x08e2,
- 0x0d4e, 0x0d4e,
- 0x110bd, 0x110bd,
- 0x110cd, 0x110cd,
- 0x111c2, 0x111c3,
- 0x11a3a, 0x11a3a,
- 0x11a84, 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,
- 0xfeff, 0xfeff,
- 0xfff0, 0xfffb,
- 0x13430, 0x13438,
- 0x1bca0, 0x1bca3,
- 0x1d173, 0x1d17a,
- 0xe0000, 0xe001f,
- 0xe0080, 0xe00ff,
- 0xe01f0, 0xe0fff,
-}; /* CR_Grapheme_Cluster_Break_Control */
-
-/* 'Grapheme_Cluster_Break_Extend': Grapheme_Cluster_Break=Extend */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_Extend[] = {
- 336,
- 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,
- 0x07fd, 0x07fd,
- 0x0816, 0x0819,
- 0x081b, 0x0823,
- 0x0825, 0x0827,
- 0x0829, 0x082d,
- 0x0859, 0x085b,
- 0x08d3, 0x08e1,
- 0x08e3, 0x0902,
- 0x093a, 0x093a,
- 0x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x0dca, 0x0dca,
- 0x0dcf, 0x0dcf,
- 0x0dd2, 0x0dd4,
- 0x0dd6, 0x0dd6,
- 0x0ddf, 0x0ddf,
- 0x0e31, 0x0e31,
- 0x0e34, 0x0e3a,
- 0x0e47, 0x0e4e,
- 0x0eb1, 0x0eb1,
- 0x0eb4, 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, 0x1b3a,
- 0x1b3c, 0x1b3c,
- 0x1b42, 0x1b42,
- 0x1b6b, 0x1b73,
- 0x1b80, 0x1b81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x101fd, 0x101fd,
- 0x102e0, 0x102e0,
- 0x10376, 0x1037a,
- 0x10a01, 0x10a03,
- 0x10a05, 0x10a06,
- 0x10a0c, 0x10a0f,
- 0x10a38, 0x10a3a,
- 0x10a3f, 0x10a3f,
- 0x10ae5, 0x10ae6,
- 0x10d24, 0x10d27,
- 0x10f46, 0x10f50,
- 0x11001, 0x11001,
- 0x11038, 0x11046,
- 0x1107f, 0x11081,
- 0x110b3, 0x110b6,
- 0x110b9, 0x110ba,
- 0x11100, 0x11102,
- 0x11127, 0x1112b,
- 0x1112d, 0x11134,
- 0x11173, 0x11173,
- 0x11180, 0x11181,
- 0x111b6, 0x111be,
- 0x111c9, 0x111cc,
- 0x1122f, 0x11231,
- 0x11234, 0x11234,
- 0x11236, 0x11237,
- 0x1123e, 0x1123e,
- 0x112df, 0x112df,
- 0x112e3, 0x112ea,
- 0x11300, 0x11301,
- 0x1133b, 0x1133c,
- 0x1133e, 0x1133e,
- 0x11340, 0x11340,
- 0x11357, 0x11357,
- 0x11366, 0x1136c,
- 0x11370, 0x11374,
- 0x11438, 0x1143f,
- 0x11442, 0x11444,
- 0x11446, 0x11446,
- 0x1145e, 0x1145e,
- 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,
- 0x1182f, 0x11837,
- 0x11839, 0x1183a,
- 0x119d4, 0x119d7,
- 0x119da, 0x119db,
- 0x119e0, 0x119e0,
- 0x11a01, 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,
- 0x11d90, 0x11d91,
- 0x11d95, 0x11d95,
- 0x11d97, 0x11d97,
- 0x11ef3, 0x11ef4,
- 0x16af0, 0x16af4,
- 0x16b30, 0x16b36,
- 0x16f4f, 0x16f4f,
- 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,
- 0x1e130, 0x1e136,
- 0x1e2ec, 0x1e2ef,
- 0x1e8d0, 0x1e8d6,
- 0x1e944, 0x1e94a,
- 0x1f3fb, 0x1f3ff,
- 0xe0020, 0xe007f,
- 0xe0100, 0xe01ef,
-}; /* CR_Grapheme_Cluster_Break_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[] = {
- 152,
- 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,
- 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,
- 0x1cf7, 0x1cf7,
- 0xa823, 0xa824,
- 0xa827, 0xa827,
- 0xa880, 0xa881,
- 0xa8b4, 0xa8c3,
- 0xa952, 0xa953,
- 0xa983, 0xa983,
- 0xa9b4, 0xa9b5,
- 0xa9ba, 0xa9bb,
- 0xa9be, 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,
- 0x11145, 0x11146,
- 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,
- 0x1182c, 0x1182e,
- 0x11838, 0x11838,
- 0x119d1, 0x119d3,
- 0x119dc, 0x119df,
- 0x119e4, 0x119e4,
- 0x11a39, 0x11a39,
- 0x11a57, 0x11a58,
- 0x11a97, 0x11a97,
- 0x11c2f, 0x11c2f,
- 0x11c3e, 0x11c3e,
- 0x11ca9, 0x11ca9,
- 0x11cb1, 0x11cb1,
- 0x11cb4, 0x11cb4,
- 0x11d8a, 0x11d8e,
- 0x11d93, 0x11d94,
- 0x11d96, 0x11d96,
- 0x11ef5, 0x11ef6,
- 0x16f51, 0x16f87,
- 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,
- 0xb8e8, 0xb8e8,
- 0xb904, 0xb904,
- 0xb920, 0xb920,
- 0xb93c, 0xb93c,
- 0xb958, 0xb958,
- 0xb974, 0xb974,
- 0xb990, 0xb990,
- 0xb9ac, 0xb9ac,
- 0xb9c8, 0xb9c8,
- 0xb9e4, 0xb9e4,
- 0xba00, 0xba00,
- 0xba1c, 0xba1c,
- 0xba38, 0xba38,
- 0xba54, 0xba54,
- 0xba70, 0xba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xc138,
- 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,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, 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_ZWJ': Grapheme_Cluster_Break=ZWJ */
-static const OnigCodePoint CR_Grapheme_Cluster_Break_ZWJ[] = {
- 1,
- 0x200d, 0x200d,
-}; /* CR_Grapheme_Cluster_Break_ZWJ */
-
-/* '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_Georgian_Extended': Block */
-static const OnigCodePoint CR_In_Georgian_Extended[] = {
- 1,
- 0x1c90, 0x1cbf,
-}; /* CR_In_Georgian_Extended */
-
-/* '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_Hanifi_Rohingya': Block */
-static const OnigCodePoint CR_In_Hanifi_Rohingya[] = {
- 1,
- 0x10d00, 0x10d3f,
-}; /* CR_In_Hanifi_Rohingya */
-
-/* 'In_Rumi_Numeral_Symbols': Block */
-static const OnigCodePoint CR_In_Rumi_Numeral_Symbols[] = {
- 1,
- 0x10e60, 0x10e7f,
-}; /* CR_In_Rumi_Numeral_Symbols */
-
-/* 'In_Old_Sogdian': Block */
-static const OnigCodePoint CR_In_Old_Sogdian[] = {
- 1,
- 0x10f00, 0x10f2f,
-}; /* CR_In_Old_Sogdian */
-
-/* 'In_Sogdian': Block */
-static const OnigCodePoint CR_In_Sogdian[] = {
- 1,
- 0x10f30, 0x10f6f,
-}; /* CR_In_Sogdian */
-
-/* 'In_Elymaic': Block */
-static const OnigCodePoint CR_In_Elymaic[] = {
- 1,
- 0x10fe0, 0x10fff,
-}; /* CR_In_Elymaic */
-
-/* '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_Dogra': Block */
-static const OnigCodePoint CR_In_Dogra[] = {
- 1,
- 0x11800, 0x1184f,
-}; /* CR_In_Dogra */
-
-/* 'In_Warang_Citi': Block */
-static const OnigCodePoint CR_In_Warang_Citi[] = {
- 1,
- 0x118a0, 0x118ff,
-}; /* CR_In_Warang_Citi */
-
-/* 'In_Nandinagari': Block */
-static const OnigCodePoint CR_In_Nandinagari[] = {
- 1,
- 0x119a0, 0x119ff,
-}; /* CR_In_Nandinagari */
-
-/* '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_Gunjala_Gondi': Block */
-static const OnigCodePoint CR_In_Gunjala_Gondi[] = {
- 1,
- 0x11d60, 0x11daf,
-}; /* CR_In_Gunjala_Gondi */
-
-/* 'In_Makasar': Block */
-static const OnigCodePoint CR_In_Makasar[] = {
- 1,
- 0x11ee0, 0x11eff,
-}; /* CR_In_Makasar */
-
-/* 'In_Tamil_Supplement': Block */
-static const OnigCodePoint CR_In_Tamil_Supplement[] = {
- 1,
- 0x11fc0, 0x11fff,
-}; /* CR_In_Tamil_Supplement */
-
-/* '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_Egyptian_Hieroglyph_Format_Controls': Block */
-static const OnigCodePoint CR_In_Egyptian_Hieroglyph_Format_Controls[] = {
- 1,
- 0x13430, 0x1343f,
-}; /* CR_In_Egyptian_Hieroglyph_Format_Controls */
-
-/* '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_Medefaidrin': Block */
-static const OnigCodePoint CR_In_Medefaidrin[] = {
- 1,
- 0x16e40, 0x16e9f,
-}; /* CR_In_Medefaidrin */
-
-/* '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_Small_Kana_Extension': Block */
-static const OnigCodePoint CR_In_Small_Kana_Extension[] = {
- 1,
- 0x1b130, 0x1b16f,
-}; /* CR_In_Small_Kana_Extension */
-
-/* '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_Mayan_Numerals': Block */
-static const OnigCodePoint CR_In_Mayan_Numerals[] = {
- 1,
- 0x1d2e0, 0x1d2ff,
-}; /* CR_In_Mayan_Numerals */
-
-/* '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_Nyiakeng_Puachue_Hmong': Block */
-static const OnigCodePoint CR_In_Nyiakeng_Puachue_Hmong[] = {
- 1,
- 0x1e100, 0x1e14f,
-}; /* CR_In_Nyiakeng_Puachue_Hmong */
-
-/* 'In_Wancho': Block */
-static const OnigCodePoint CR_In_Wancho[] = {
- 1,
- 0x1e2c0, 0x1e2ff,
-}; /* CR_In_Wancho */
-
-/* '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_Indic_Siyaq_Numbers': Block */
-static const OnigCodePoint CR_In_Indic_Siyaq_Numbers[] = {
- 1,
- 0x1ec70, 0x1ecbf,
-}; /* CR_In_Indic_Siyaq_Numbers */
-
-/* 'In_Ottoman_Siyaq_Numbers': Block */
-static const OnigCodePoint CR_In_Ottoman_Siyaq_Numbers[] = {
- 1,
- 0x1ed00, 0x1ed4f,
-}; /* CR_In_Ottoman_Siyaq_Numbers */
-
-/* '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_Chess_Symbols': Block */
-static const OnigCodePoint CR_In_Chess_Symbols[] = {
- 1,
- 0x1fa00, 0x1fa6f,
-}; /* CR_In_Chess_Symbols */
-
-/* 'In_Symbols_and_Pictographs_Extended_A': Block */
-static const OnigCodePoint CR_In_Symbols_and_Pictographs_Extended_A[] = {
- 1,
- 0x1fa70, 0x1faff,
-}; /* CR_In_Symbols_and_Pictographs_Extended_A */
-
-/* '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[] = {
- 53,
- 0x0870, 0x089f,
- 0x2fe0, 0x2fef,
- 0x10200, 0x1027f,
- 0x103e0, 0x103ff,
- 0x10570, 0x105ff,
- 0x10780, 0x107ff,
- 0x108b0, 0x108df,
- 0x10940, 0x1097f,
- 0x10aa0, 0x10abf,
- 0x10bb0, 0x10bff,
- 0x10c50, 0x10c7f,
- 0x10d40, 0x10e5f,
- 0x10e80, 0x10eff,
- 0x10f70, 0x10fdf,
- 0x11250, 0x1127f,
- 0x11380, 0x113ff,
- 0x114e0, 0x1157f,
- 0x116d0, 0x116ff,
- 0x11740, 0x117ff,
- 0x11850, 0x1189f,
- 0x11900, 0x1199f,
- 0x11ab0, 0x11abf,
- 0x11b00, 0x11bff,
- 0x11cc0, 0x11cff,
- 0x11db0, 0x11edf,
- 0x11f00, 0x11fbf,
- 0x12550, 0x12fff,
- 0x13440, 0x143ff,
- 0x14680, 0x167ff,
- 0x16a70, 0x16acf,
- 0x16b90, 0x16e3f,
- 0x16ea0, 0x16eff,
- 0x16fa0, 0x16fdf,
- 0x18b00, 0x1afff,
- 0x1b300, 0x1bbff,
- 0x1bcb0, 0x1cfff,
- 0x1d250, 0x1d2df,
- 0x1d380, 0x1d3ff,
- 0x1dab0, 0x1dfff,
- 0x1e030, 0x1e0ff,
- 0x1e150, 0x1e2bf,
- 0x1e300, 0x1e7ff,
- 0x1e8e0, 0x1e8ff,
- 0x1e960, 0x1ec6f,
- 0x1ecc0, 0x1ecff,
- 0x1ed50, 0x1edff,
- 0x1ef00, 0x1efff,
- 0x1fb00, 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_Dogra,
- CR_Gunjala_Gondi,
- CR_Makasar,
- CR_Medefaidrin,
- CR_Hanifi_Rohingya,
- CR_Sogdian,
- CR_Old_Sogdian,
- CR_Elymaic,
- CR_Nandinagari,
- CR_Nyiakeng_Puachue_Hmong,
- CR_Wancho,
- 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_Extended_Pictographic,
- 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,
- CR_Age_11_0,
- CR_Age_12_0,
- CR_Age_12_1,
-#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_ZWJ,
- 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_Georgian_Extended,
- 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_Hanifi_Rohingya,
- CR_In_Rumi_Numeral_Symbols,
- CR_In_Old_Sogdian,
- CR_In_Sogdian,
- CR_In_Elymaic,
- 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_Dogra,
- CR_In_Warang_Citi,
- CR_In_Nandinagari,
- CR_In_Zanabazar_Square,
- CR_In_Soyombo,
- CR_In_Pau_Cin_Hau,
- CR_In_Bhaiksuki,
- CR_In_Marchen,
- CR_In_Masaram_Gondi,
- CR_In_Gunjala_Gondi,
- CR_In_Makasar,
- CR_In_Tamil_Supplement,
- CR_In_Cuneiform,
- CR_In_Cuneiform_Numbers_and_Punctuation,
- CR_In_Early_Dynastic_Cuneiform,
- CR_In_Egyptian_Hieroglyphs,
- CR_In_Egyptian_Hieroglyph_Format_Controls,
- CR_In_Anatolian_Hieroglyphs,
- CR_In_Bamum_Supplement,
- CR_In_Mro,
- CR_In_Bassa_Vah,
- CR_In_Pahawh_Hmong,
- CR_In_Medefaidrin,
- 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_Small_Kana_Extension,
- 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_Mayan_Numerals,
- 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_Nyiakeng_Puachue_Hmong,
- CR_In_Wancho,
- CR_In_Mende_Kikakui,
- CR_In_Adlam,
- CR_In_Indic_Siyaq_Numbers,
- CR_In_Ottoman_Siyaq_Numbers,
- 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_Chess_Symbols,
- CR_In_Symbols_and_Pictographs_Extended_A,
- 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)
-
-static const struct uniname2ctype_struct *uniname2ctype_p(
-#if !(1+0) /* if ANSI, old style not to conflict with generated prototype */
- 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 814
-#else /* USE_UNICODE_AGE_PROPERTIES */
-#define TOTAL_KEYWORDS 836
-#endif /* USE_UNICODE_AGE_PROPERTIES */
-#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 44
-#define MIN_HASH_VALUE 11
-#define MAX_HASH_VALUE 6098
-/* maximum key range = 6088, 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 */
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
-#ifndef USE_UNICODE_AGE_PROPERTIES
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
-#else /* USE_UNICODE_AGE_PROPERTIES */
- 6099, 6099, 6099, 6099, 6099, 6099, 17, 6099, 3, 1,
- 4, 13, 3, 22, 9, 16, 12, 5, 6099, 6099,
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099, 6099,
- 6099, 6099, 6099, 6099, 6099, 6099, 6099, 1, 1425, 113,
- 437, 37, 1023, 1071, 1051, 4, 1492, 9, 500, 88,
- 8, 18, 1371, 797, 54, 203, 310, 619, 1608, 603,
- 364, 1438, 20, 1, 3, 6099, 6099, 6099, 6099, 6099
-#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_str11[sizeof("yi")];
- char uniname2ctype_pool_str17[sizeof("yiii")];
- char uniname2ctype_pool_str22[sizeof("lana")];
- char uniname2ctype_pool_str24[sizeof("z")];
- char uniname2ctype_pool_str25[sizeof("lina")];
- char uniname2ctype_pool_str33[sizeof("maka")];
- char uniname2ctype_pool_str35[sizeof("mani")];
- char uniname2ctype_pool_str36[sizeof("mn")];
- char uniname2ctype_pool_str45[sizeof("miao")];
- char uniname2ctype_pool_str46[sizeof("lo")];
- char uniname2ctype_pool_str47[sizeof("ci")];
- char uniname2ctype_pool_str48[sizeof("lao")];
- char uniname2ctype_pool_str49[sizeof("laoo")];
- char uniname2ctype_pool_str52[sizeof("inkannada")];
- char uniname2ctype_pool_str55[sizeof("cn")];
- char uniname2ctype_pool_str64[sizeof("pi")];
- char uniname2ctype_pool_str66[sizeof("innko")];
- char uniname2ctype_pool_str67[sizeof("zzzz")];
- char uniname2ctype_pool_str71[sizeof("gran")];
- char uniname2ctype_pool_str75[sizeof("co")];
- char uniname2ctype_pool_str83[sizeof("lineara")];
- char uniname2ctype_pool_str86[sizeof("mark")];
- char uniname2ctype_pool_str92[sizeof("po")];
- char uniname2ctype_pool_str94[sizeof("me")];
- char uniname2ctype_pool_str100[sizeof("cari")];
- char uniname2ctype_pool_str101[sizeof("inkharoshthi")];
- char uniname2ctype_pool_str102[sizeof("kana")];
- char uniname2ctype_pool_str103[sizeof("loe")];
- char uniname2ctype_pool_str107[sizeof("m")];
- char uniname2ctype_pool_str108[sizeof("grek")];
- char uniname2ctype_pool_str111[sizeof("mro")];
- char uniname2ctype_pool_str112[sizeof("mroo")];
- char uniname2ctype_pool_str115[sizeof("carian")];
- char uniname2ctype_pool_str117[sizeof("geor")];
- char uniname2ctype_pool_str118[sizeof("greek")];
- char uniname2ctype_pool_str122[sizeof("gonm")];
- char uniname2ctype_pool_str129[sizeof("mendekikakui")];
- char uniname2ctype_pool_str130[sizeof("pe")];
- char uniname2ctype_pool_str131[sizeof("mero")];
- char uniname2ctype_pool_str134[sizeof("inosmanya")];
- char uniname2ctype_pool_str139[sizeof("cakm")];
- char uniname2ctype_pool_str145[sizeof("inmanichaean")];
- char uniname2ctype_pool_str146[sizeof("inmro")];
- char uniname2ctype_pool_str148[sizeof("inmiao")];
- char uniname2ctype_pool_str149[sizeof("inchakma")];
- char uniname2ctype_pool_str151[sizeof("c")];
- char uniname2ctype_pool_str152[sizeof("mandaic")];
- char uniname2ctype_pool_str153[sizeof("meeteimayek")];
- char uniname2ctype_pool_str161[sizeof("inarmenian")];
- char uniname2ctype_pool_str177[sizeof("inmyanmar")];
- char uniname2ctype_pool_str178[sizeof("inmakasar")];
- char uniname2ctype_pool_str183[sizeof("common")];
- char uniname2ctype_pool_str186[sizeof("lm")];
- char uniname2ctype_pool_str190[sizeof("marc")];
- char uniname2ctype_pool_str203[sizeof("inrunic")];
- char uniname2ctype_pool_str204[sizeof("incarian")];
- char uniname2ctype_pool_str210[sizeof("inideographicsymbolsandpunctuation")];
- char uniname2ctype_pool_str212[sizeof("inkhmer")];
- char uniname2ctype_pool_str213[sizeof("qaai")];
- char uniname2ctype_pool_str218[sizeof("inahom")];
- char uniname2ctype_pool_str226[sizeof("merc")];
- char uniname2ctype_pool_str231[sizeof("combiningmark")];
- char uniname2ctype_pool_str236[sizeof("lc")];
- char uniname2ctype_pool_str237[sizeof("perm")];
- char uniname2ctype_pool_str246[sizeof("mc")];
- char uniname2ctype_pool_str250[sizeof("connectorpunctuation")];
- char uniname2ctype_pool_str253[sizeof("cans")];
- char uniname2ctype_pool_str260[sizeof("incuneiformnumbersandpunctuation")];
- char uniname2ctype_pool_str263[sizeof("armi")];
- char uniname2ctype_pool_str265[sizeof("cc")];
- char uniname2ctype_pool_str267[sizeof("armn")];
- char uniname2ctype_pool_str268[sizeof("incherokee")];
- char uniname2ctype_pool_str270[sizeof("prependedconcatenationmark")];
- char uniname2ctype_pool_str274[sizeof("incuneiform")];
- char uniname2ctype_pool_str275[sizeof("inavestan")];
- char uniname2ctype_pool_str281[sizeof("inipaextensions")];
- char uniname2ctype_pool_str282[sizeof("pc")];
- char uniname2ctype_pool_str283[sizeof("armenian")];
- char uniname2ctype_pool_str285[sizeof("insharada")];
- char uniname2ctype_pool_str289[sizeof("inmarchen")];
- char uniname2ctype_pool_str293[sizeof("makasar")];
- char uniname2ctype_pool_str297[sizeof("masaramgondi")];
- char uniname2ctype_pool_str301[sizeof("inarrows")];
- char uniname2ctype_pool_str311[sizeof("incyrillic")];
- char uniname2ctype_pool_str313[sizeof("incham")];
- char uniname2ctype_pool_str315[sizeof("qmark")];
- char uniname2ctype_pool_str320[sizeof("ri")];
- char uniname2ctype_pool_str322[sizeof("qaac")];
- char uniname2ctype_pool_str328[sizeof("insamaritan")];
- char uniname2ctype_pool_str331[sizeof("latn")];
- char uniname2ctype_pool_str335[sizeof("inmasaramgondi")];
- char uniname2ctype_pool_str338[sizeof("inthaana")];
- char uniname2ctype_pool_str340[sizeof("latin")];
- char uniname2ctype_pool_str342[sizeof("inthai")];
- char uniname2ctype_pool_str345[sizeof("lineseparator")];
- char uniname2ctype_pool_str346[sizeof("pcm")];
- char uniname2ctype_pool_str348[sizeof("inkatakana")];
- char uniname2ctype_pool_str352[sizeof("inkaithi")];
- char uniname2ctype_pool_str357[sizeof("inzanabazarsquare")];
- char uniname2ctype_pool_str362[sizeof("inscriptionalparthian")];
- char uniname2ctype_pool_str366[sizeof("initialpunctuation")];
- char uniname2ctype_pool_str373[sizeof("mtei")];
- char uniname2ctype_pool_str376[sizeof("vai")];
- char uniname2ctype_pool_str377[sizeof("vaii")];
- char uniname2ctype_pool_str386[sizeof("inkhmersymbols")];
- char uniname2ctype_pool_str399[sizeof("insyriac")];
- char uniname2ctype_pool_str401[sizeof("intakri")];
- char uniname2ctype_pool_str404[sizeof("arabic")];
- char uniname2ctype_pool_str411[sizeof("zs")];
- char uniname2ctype_pool_str418[sizeof("katakana")];
- char uniname2ctype_pool_str426[sizeof("prti")];
- char uniname2ctype_pool_str442[sizeof("ascii")];
- char uniname2ctype_pool_str445[sizeof("cs")];
- char uniname2ctype_pool_str462[sizeof("ps")];
- char uniname2ctype_pool_str468[sizeof("mand")];
- char uniname2ctype_pool_str470[sizeof("privateuse")];
- char uniname2ctype_pool_str475[sizeof("inruminumeralsymbols")];
- char uniname2ctype_pool_str480[sizeof("inmyanmarextendeda")];
- char uniname2ctype_pool_str481[sizeof("modi")];
- char uniname2ctype_pool_str486[sizeof("incjkcompatibilityforms")];
- char uniname2ctype_pool_str488[sizeof("inkanaextendeda")];
- char uniname2ctype_pool_str491[sizeof("incjkcompatibilityideographs")];
- char uniname2ctype_pool_str500[sizeof("brai")];
- char uniname2ctype_pool_str504[sizeof("mend")];
- char uniname2ctype_pool_str505[sizeof("ideo")];
- char uniname2ctype_pool_str506[sizeof("letter")];
- char uniname2ctype_pool_str509[sizeof("l")];
- char uniname2ctype_pool_str511[sizeof("inmeeteimayek")];
- char uniname2ctype_pool_str520[sizeof("inideographicdescriptioncharacters")];
- char uniname2ctype_pool_str535[sizeof("xidcontinue")];
- char uniname2ctype_pool_str538[sizeof("knda")];
- char uniname2ctype_pool_str541[sizeof("innandinagari")];
- char uniname2ctype_pool_str543[sizeof("kannada")];
- char uniname2ctype_pool_str556[sizeof("inmodi")];
- char uniname2ctype_pool_str558[sizeof("inlao")];
- char uniname2ctype_pool_str560[sizeof("inoldnortharabian")];
- char uniname2ctype_pool_str565[sizeof("intransportandmapsymbols")];
- char uniname2ctype_pool_str566[sizeof("letternumber")];
- char uniname2ctype_pool_str568[sizeof("gothic")];
- char uniname2ctype_pool_str572[sizeof("inlineara")];
- char uniname2ctype_pool_str577[sizeof("inmendekikakui")];
- char uniname2ctype_pool_str578[sizeof("xidc")];
- char uniname2ctype_pool_str579[sizeof("mongolian")];
- char uniname2ctype_pool_str582[sizeof("inmiscellaneousmathematicalsymbolsa")];
- char uniname2ctype_pool_str583[sizeof("inspecials")];
- char uniname2ctype_pool_str590[sizeof("grlink")];
- char uniname2ctype_pool_str594[sizeof("brahmi")];
- char uniname2ctype_pool_str596[sizeof("inemoticons")];
- char uniname2ctype_pool_str597[sizeof("kali")];
- char uniname2ctype_pool_str600[sizeof("inolditalic")];
- char uniname2ctype_pool_str604[sizeof("inmedefaidrin")];
- char uniname2ctype_pool_str605[sizeof("inchesssymbols")];
- char uniname2ctype_pool_str608[sizeof("incjkcompatibilityideographssupplement")];
- char uniname2ctype_pool_str614[sizeof("inadlam")];
- char uniname2ctype_pool_str624[sizeof("psalterpahlavi")];
- char uniname2ctype_pool_str625[sizeof("incommonindicnumberforms")];
- char uniname2ctype_pool_str630[sizeof("lt")];
- char uniname2ctype_pool_str636[sizeof("innewa")];
- char uniname2ctype_pool_str639[sizeof("sk")];
- char uniname2ctype_pool_str642[sizeof("control")];
- char uniname2ctype_pool_str645[sizeof("inancientsymbols")];
- char uniname2ctype_pool_str647[sizeof("palm")];
- char uniname2ctype_pool_str650[sizeof("inlycian")];
- char uniname2ctype_pool_str657[sizeof("so")];
- char uniname2ctype_pool_str660[sizeof("patternwhitespace")];
- char uniname2ctype_pool_str668[sizeof("xids")];
- char uniname2ctype_pool_str672[sizeof("inmandaic")];
- char uniname2ctype_pool_str675[sizeof("idc")];
- char uniname2ctype_pool_str678[sizeof("meroiticcursive")];
- char uniname2ctype_pool_str695[sizeof("inwarangciti")];
- char uniname2ctype_pool_str696[sizeof("sora")];
- char uniname2ctype_pool_str697[sizeof("inopticalcharacterrecognition")];
- char uniname2ctype_pool_str703[sizeof("inoldsogdian")];
- char uniname2ctype_pool_str705[sizeof("inmalayalam")];
- char uniname2ctype_pool_str707[sizeof("bamum")];
- char uniname2ctype_pool_str708[sizeof("inkanasupplement")];
- char uniname2ctype_pool_str713[sizeof("insundanese")];
- char uniname2ctype_pool_str720[sizeof("grext")];
- char uniname2ctype_pool_str737[sizeof("print")];
- char uniname2ctype_pool_str738[sizeof("intaitham")];
- char uniname2ctype_pool_str742[sizeof("lower")];
- char uniname2ctype_pool_str753[sizeof("joinc")];
- char uniname2ctype_pool_str755[sizeof("inoldsoutharabian")];
- char uniname2ctype_pool_str760[sizeof("incjkstrokes")];
- char uniname2ctype_pool_str761[sizeof("batk")];
- char uniname2ctype_pool_str766[sizeof("samr")];
- char uniname2ctype_pool_str767[sizeof("inwancho")];
- char uniname2ctype_pool_str771[sizeof("batak")];
- char uniname2ctype_pool_str772[sizeof("vs")];
- char uniname2ctype_pool_str776[sizeof("patws")];
- char uniname2ctype_pool_str783[sizeof("samaritan")];
- char uniname2ctype_pool_str787[sizeof("idsbinaryoperator")];
- char uniname2ctype_pool_str791[sizeof("pauc")];
- char uniname2ctype_pool_str794[sizeof("insmallkanaextension")];
- char uniname2ctype_pool_str797[sizeof("sm")];
- char uniname2ctype_pool_str799[sizeof("indominotiles")];
- char uniname2ctype_pool_str802[sizeof("alnum")];
- char uniname2ctype_pool_str809[sizeof("insylotinagri")];
- char uniname2ctype_pool_str814[sizeof("inugaritic")];
- char uniname2ctype_pool_str818[sizeof("incontrolpictures")];
- char uniname2ctype_pool_str821[sizeof("inlinearbideograms")];
- char uniname2ctype_pool_str822[sizeof("inmusicalsymbols")];
- char uniname2ctype_pool_str823[sizeof("s")];
- char uniname2ctype_pool_str824[sizeof("ital")];
- char uniname2ctype_pool_str825[sizeof("inmodifiertoneletters")];
- char uniname2ctype_pool_str828[sizeof("inancientgreekmusicalnotation")];
- char uniname2ctype_pool_str834[sizeof("patternsyntax")];
- char uniname2ctype_pool_str838[sizeof("lisu")];
- char uniname2ctype_pool_str842[sizeof("lowercase")];
- char uniname2ctype_pool_str845[sizeof("cwcm")];
- char uniname2ctype_pool_str847[sizeof("sc")];
- char uniname2ctype_pool_str848[sizeof("bass")];
- char uniname2ctype_pool_str855[sizeof("ids")];
- char uniname2ctype_pool_str857[sizeof("inlatinextendeda")];
- char uniname2ctype_pool_str862[sizeof("oriya")];
- char uniname2ctype_pool_str875[sizeof("intaile")];
- char uniname2ctype_pool_str886[sizeof("inmiscellaneoussymbols")];
- char uniname2ctype_pool_str895[sizeof("inmiscellaneoussymbolsandarrows")];
- char uniname2ctype_pool_str898[sizeof("incaucasianalbanian")];
- char uniname2ctype_pool_str900[sizeof("inmiscellaneoussymbolsandpictographs")];
- char uniname2ctype_pool_str906[sizeof("inoldturkic")];
- char uniname2ctype_pool_str907[sizeof("insaurashtra")];
- char uniname2ctype_pool_str924[sizeof("idcontinue")];
- char uniname2ctype_pool_str926[sizeof("intamil")];
- char uniname2ctype_pool_str928[sizeof("inmultani")];
- char uniname2ctype_pool_str929[sizeof("inlatinextendede")];
- char uniname2ctype_pool_str930[sizeof("pd")];
- char uniname2ctype_pool_str946[sizeof("bali")];
- char uniname2ctype_pool_str961[sizeof("blank")];
- char uniname2ctype_pool_str963[sizeof("idst")];
- char uniname2ctype_pool_str974[sizeof("inlydian")];
- char uniname2ctype_pool_str986[sizeof("innewtailue")];
- char uniname2ctype_pool_str994[sizeof("bengali")];
- char uniname2ctype_pool_str995[sizeof("runr")];
- char uniname2ctype_pool_str1005[sizeof("zl")];
- char uniname2ctype_pool_str1009[sizeof("incyrillicextendeda")];
- char uniname2ctype_pool_str1010[sizeof("ll")];
- char uniname2ctype_pool_str1013[sizeof("indeseret")];
- char uniname2ctype_pool_str1014[sizeof("intaixuanjingsymbols")];
- char uniname2ctype_pool_str1015[sizeof("inancientgreeknumbers")];
- char uniname2ctype_pool_str1021[sizeof("idstart")];
- char uniname2ctype_pool_str1025[sizeof("inmeeteimayekextensions")];
- char uniname2ctype_pool_str1028[sizeof("balinese")];
- char uniname2ctype_pool_str1032[sizeof("dia")];
- char uniname2ctype_pool_str1033[sizeof("di")];
- char uniname2ctype_pool_str1035[sizeof("inspacingmodifierletters")];
- char uniname2ctype_pool_str1036[sizeof("inearlydynasticcuneiform")];
- char uniname2ctype_pool_str1049[sizeof("plrd")];
- char uniname2ctype_pool_str1067[sizeof("canadianaboriginal")];
- char uniname2ctype_pool_str1070[sizeof("zinh")];
- char uniname2ctype_pool_str1072[sizeof("sind")];
- char uniname2ctype_pool_str1080[sizeof("osage")];
- char uniname2ctype_pool_str1081[sizeof("inlatinextendedc")];
- char uniname2ctype_pool_str1085[sizeof("uideo")];
- char uniname2ctype_pool_str1087[sizeof("incountingrodnumerals")];
- char uniname2ctype_pool_str1090[sizeof("xidstart")];
- char uniname2ctype_pool_str1091[sizeof("xdigit")];
- char uniname2ctype_pool_str1093[sizeof("osma")];
- char uniname2ctype_pool_str1097[sizeof("inkhudawadi")];
- char uniname2ctype_pool_str1102[sizeof("inhanifirohingya")];
- char uniname2ctype_pool_str1105[sizeof("gong")];
- char uniname2ctype_pool_str1107[sizeof("ingrantha")];
- char uniname2ctype_pool_str1109[sizeof("bidic")];
- char uniname2ctype_pool_str1119[sizeof("mong")];
- char uniname2ctype_pool_str1120[sizeof("cased")];
- char uniname2ctype_pool_str1121[sizeof("incyrillicextendedc")];
- char uniname2ctype_pool_str1134[sizeof("inhiragana")];
- char uniname2ctype_pool_str1140[sizeof("sinhala")];
- char uniname2ctype_pool_str1142[sizeof("adlm")];
- char uniname2ctype_pool_str1146[sizeof("glagolitic")];
- char uniname2ctype_pool_str1147[sizeof("sterm")];
- char uniname2ctype_pool_str1149[sizeof("bamu")];
- char uniname2ctype_pool_str1150[sizeof("georgian")];
- char uniname2ctype_pool_str1151[sizeof("inosage")];
- char uniname2ctype_pool_str1152[sizeof("gunjalagondi")];
- char uniname2ctype_pool_str1153[sizeof("phoenician")];
- char uniname2ctype_pool_str1157[sizeof("multani")];
- char uniname2ctype_pool_str1158[sizeof("kaithi")];
- char uniname2ctype_pool_str1164[sizeof("joincontrol")];
- char uniname2ctype_pool_str1168[sizeof("runic")];
- char uniname2ctype_pool_str1170[sizeof("ingeneralpunctuation")];
- char uniname2ctype_pool_str1171[sizeof("inmahajani")];
- char uniname2ctype_pool_str1174[sizeof("incyrillicsupplement")];
- char uniname2ctype_pool_str1175[sizeof("lowercaseletter")];
- char uniname2ctype_pool_str1176[sizeof("marchen")];
- char uniname2ctype_pool_str1177[sizeof("graphemelink")];
- char uniname2ctype_pool_str1178[sizeof("ingeorgian")];
- char uniname2ctype_pool_str1180[sizeof("khojki")];
- char uniname2ctype_pool_str1181[sizeof("cham")];
- char uniname2ctype_pool_str1182[sizeof("inogham")];
- char uniname2ctype_pool_str1183[sizeof("cher")];
- char uniname2ctype_pool_str1185[sizeof("chakma")];
- char uniname2ctype_pool_str1190[sizeof("emoji")];
- char uniname2ctype_pool_str1191[sizeof("insiddham")];
- char uniname2ctype_pool_str1197[sizeof("cherokee")];
- char uniname2ctype_pool_str1198[sizeof("khar")];
- char uniname2ctype_pool_str1203[sizeof("inmongolian")];
- char uniname2ctype_pool_str1207[sizeof("incherokeesupplement")];
- char uniname2ctype_pool_str1208[sizeof("diacritic")];
- char uniname2ctype_pool_str1209[sizeof("manichaean")];
- char uniname2ctype_pool_str1210[sizeof("xsux")];
- char uniname2ctype_pool_str1212[sizeof("inolchiki")];
- char uniname2ctype_pool_str1227[sizeof("quotationmark")];
- char uniname2ctype_pool_str1231[sizeof("adlam")];
- char uniname2ctype_pool_str1232[sizeof("inethiopic")];
- char uniname2ctype_pool_str1233[sizeof("graphemebase")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1234[sizeof("age=11.0")];
- char uniname2ctype_pool_str1235[sizeof("age=12.1")];
- char uniname2ctype_pool_str1236[sizeof("age=10.0")];
- char uniname2ctype_pool_str1237[sizeof("age=12.0")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1243[sizeof("casedletter")];
- char uniname2ctype_pool_str1244[sizeof("ingurmukhi")];
- char uniname2ctype_pool_str1245[sizeof("odi")];
- char uniname2ctype_pool_str1246[sizeof("incjkunifiedideographsextensiona")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1247[sizeof("age=1.1")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1248[sizeof("lu")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1249[sizeof("age=4.1")];
- char uniname2ctype_pool_str1250[sizeof("age=2.1")];
- char uniname2ctype_pool_str1251[sizeof("age=4.0")];
- char uniname2ctype_pool_str1252[sizeof("age=2.0")];
- char uniname2ctype_pool_str1253[sizeof("age=9.0")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1254[sizeof("intamilsupplement")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1255[sizeof("age=6.1")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1256[sizeof("unknown")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1257[sizeof("age=6.0")];
- char uniname2ctype_pool_str1258[sizeof("age=6.2")];
- char uniname2ctype_pool_str1259[sizeof("age=3.1")];
- char uniname2ctype_pool_str1260[sizeof("age=8.0")];
- char uniname2ctype_pool_str1261[sizeof("age=3.0")];
- char uniname2ctype_pool_str1262[sizeof("age=3.2")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1263[sizeof("cwt")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1264[sizeof("age=7.0")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1266[sizeof("unassigned")];
-#ifdef USE_UNICODE_AGE_PROPERTIES
- char uniname2ctype_pool_str1267[sizeof("age=6.3")];
- char uniname2ctype_pool_str1268[sizeof("age=5.1")];
- char uniname2ctype_pool_str1270[sizeof("age=5.0")];
- char uniname2ctype_pool_str1271[sizeof("age=5.2")];
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- char uniname2ctype_pool_str1274[sizeof("ahom")];
- char uniname2ctype_pool_str1282[sizeof("incjkunifiedideographsextensione")];
- char uniname2ctype_pool_str1285[sizeof("khmr")];
- char uniname2ctype_pool_str1289[sizeof("insinhala")];
- char uniname2ctype_pool_str1292[sizeof("inmiscellaneoustechnical")];
- char uniname2ctype_pool_str1297[sizeof("saur")];
- char uniname2ctype_pool_str1300[sizeof("guru")];
- char uniname2ctype_pool_str1301[sizeof("sundanese")];
- char uniname2ctype_pool_str1306[sizeof("punct")];
- char uniname2ctype_pool_str1314[sizeof("paucinhau")];
- char uniname2ctype_pool_str1317[sizeof("gurmukhi")];
- char uniname2ctype_pool_str1319[sizeof("variationselector")];
- char uniname2ctype_pool_str1331[sizeof("logicalorderexception")];
- char uniname2ctype_pool_str1340[sizeof("khmer")];
- char uniname2ctype_pool_str1343[sizeof("limbu")];
- char uniname2ctype_pool_str1354[sizeof("inscriptionalpahlavi")];
- char uniname2ctype_pool_str1355[sizeof("oidc")];
- char uniname2ctype_pool_str1358[sizeof("incjkunifiedideographsextensionc")];
- char uniname2ctype_pool_str1360[sizeof("cntrl")];
- char uniname2ctype_pool_str1365[sizeof("inlatinextendedadditional")];
- char uniname2ctype_pool_str1366[sizeof("decimalnumber")];
- char uniname2ctype_pool_str1367[sizeof("insorasompeng")];
- char uniname2ctype_pool_str1369[sizeof("radical")];
- char uniname2ctype_pool_str1373[sizeof("emojimodifier")];
- char uniname2ctype_pool_str1375[sizeof("kharoshthi")];
- char uniname2ctype_pool_str1380[sizeof("n")];
- char uniname2ctype_pool_str1384[sizeof("math")];
- char uniname2ctype_pool_str1387[sizeof("goth")];
- char uniname2ctype_pool_str1400[sizeof("anatolianhieroglyphs")];
- char uniname2ctype_pool_str1401[sizeof("inenclosedalphanumerics")];
- char uniname2ctype_pool_str1407[sizeof("nandinagari")];
- char uniname2ctype_pool_str1409[sizeof("no")];
- char uniname2ctype_pool_str1419[sizeof("nko")];
- char uniname2ctype_pool_str1420[sizeof("nkoo")];
- char uniname2ctype_pool_str1422[sizeof("ingreekandcoptic")];
- char uniname2ctype_pool_str1423[sizeof("olck")];
- char uniname2ctype_pool_str1426[sizeof("p")];
- char uniname2ctype_pool_str1428[sizeof("grantha")];
- char uniname2ctype_pool_str1434[sizeof("olchiki")];
- char uniname2ctype_pool_str1438[sizeof("incjkunifiedideographs")];
- char uniname2ctype_pool_str1441[sizeof("zanb")];
- char uniname2ctype_pool_str1442[sizeof("intirhuta")];
- char uniname2ctype_pool_str1445[sizeof("oids")];
- char uniname2ctype_pool_str1448[sizeof("inhatran")];
- char uniname2ctype_pool_str1449[sizeof("linb")];
- char uniname2ctype_pool_str1450[sizeof("xpeo")];
- char uniname2ctype_pool_str1451[sizeof("mult")];
- char uniname2ctype_pool_str1454[sizeof("saurashtra")];
- char uniname2ctype_pool_str1457[sizeof("kthi")];
- char uniname2ctype_pool_str1462[sizeof("inbhaiksuki")];
- char uniname2ctype_pool_str1466[sizeof("olower")];
- char uniname2ctype_pool_str1470[sizeof("innabataean")];
- char uniname2ctype_pool_str1471[sizeof("inphoenician")];
- char uniname2ctype_pool_str1475[sizeof("inkanbun")];
- char uniname2ctype_pool_str1476[sizeof("inmeroitichieroglyphs")];
- char uniname2ctype_pool_str1478[sizeof("inkayahli")];
- char uniname2ctype_pool_str1481[sizeof("phnx")];
- char uniname2ctype_pool_str1485[sizeof("inoriya")];
- char uniname2ctype_pool_str1489[sizeof("enclosingmark")];
- char uniname2ctype_pool_str1495[sizeof("sd")];
- char uniname2ctype_pool_str1497[sizeof("inelbasan")];
- char uniname2ctype_pool_str1498[sizeof("wara")];
- char uniname2ctype_pool_str1499[sizeof("inenclosedideographicsupplement")];
- char uniname2ctype_pool_str1501[sizeof("sidd")];
- char uniname2ctype_pool_str1507[sizeof("linearb")];
- char uniname2ctype_pool_str1509[sizeof("hani")];
- char uniname2ctype_pool_str1512[sizeof("han")];
- char uniname2ctype_pool_str1517[sizeof("inenclosedalphanumericsupplement")];
- char uniname2ctype_pool_str1519[sizeof("medf")];
- char uniname2ctype_pool_str1520[sizeof("bidicontrol")];
- char uniname2ctype_pool_str1523[sizeof("hano")];
- char uniname2ctype_pool_str1524[sizeof("inphaistosdisc")];
- char uniname2ctype_pool_str1529[sizeof("limb")];
- char uniname2ctype_pool_str1531[sizeof("inkangxiradicals")];
- char uniname2ctype_pool_str1533[sizeof("lepc")];
- char uniname2ctype_pool_str1535[sizeof("medefaidrin")];
- char uniname2ctype_pool_str1536[sizeof("braille")];
- char uniname2ctype_pool_str1537[sizeof("regionalindicator")];
- char uniname2ctype_pool_str1542[sizeof("inlowsurrogates")];
- char uniname2ctype_pool_str1544[sizeof("inshorthandformatcontrols")];
- char uniname2ctype_pool_str1547[sizeof("brah")];
- char uniname2ctype_pool_str1548[sizeof("inkhojki")];
- char uniname2ctype_pool_str1549[sizeof("inoldhungarian")];
- char uniname2ctype_pool_str1552[sizeof("hanunoo")];
- char uniname2ctype_pool_str1555[sizeof("hira")];
- char uniname2ctype_pool_str1557[sizeof("beng")];
- char uniname2ctype_pool_str1563[sizeof("emojimodifierbase")];
- char uniname2ctype_pool_str1565[sizeof("inarabic")];
- char uniname2ctype_pool_str1567[sizeof("lyci")];
- char uniname2ctype_pool_str1569[sizeof("ahex")];
- char uniname2ctype_pool_str1572[sizeof("inherited")];
- char uniname2ctype_pool_str1580[sizeof("glag")];
- char uniname2ctype_pool_str1582[sizeof("lycian")];
- char uniname2ctype_pool_str1587[sizeof("indogra")];
- char uniname2ctype_pool_str1594[sizeof("dsrt")];
- char uniname2ctype_pool_str1597[sizeof("arab")];
- char uniname2ctype_pool_str1602[sizeof("mymr")];
- char uniname2ctype_pool_str1607[sizeof("myanmar")];
- char uniname2ctype_pool_str1613[sizeof("phli")];
- char uniname2ctype_pool_str1617[sizeof("inimperialaramaic")];
- char uniname2ctype_pool_str1622[sizeof("ingreekextended")];
- char uniname2ctype_pool_str1623[sizeof("inanatolianhieroglyphs")];
- char uniname2ctype_pool_str1629[sizeof("punctuation")];
- char uniname2ctype_pool_str1631[sizeof("takri")];
- char uniname2ctype_pool_str1635[sizeof("graphemeextend")];
- char uniname2ctype_pool_str1638[sizeof("invai")];
- char uniname2ctype_pool_str1643[sizeof("cwl")];
- char uniname2ctype_pool_str1654[sizeof("ingeometricshapes")];
- char uniname2ctype_pool_str1655[sizeof("emojicomponent")];
- char uniname2ctype_pool_str1662[sizeof("coptic")];
- char uniname2ctype_pool_str1671[sizeof("deseret")];
- char uniname2ctype_pool_str1675[sizeof("inarabicpresentationformsa")];
- char uniname2ctype_pool_str1676[sizeof("takr")];
- char uniname2ctype_pool_str1677[sizeof("inbasiclatin")];
- char uniname2ctype_pool_str1682[sizeof("incjkunifiedideographsextensiond")];
- char uniname2ctype_pool_str1686[sizeof("sinh")];
- char uniname2ctype_pool_str1687[sizeof("sund")];
- char uniname2ctype_pool_str1691[sizeof("shavian")];
- char uniname2ctype_pool_str1692[sizeof("taile")];
- char uniname2ctype_pool_str1699[sizeof("insundanesesupplement")];
- char uniname2ctype_pool_str1702[sizeof("inelymaic")];
- char uniname2ctype_pool_str1703[sizeof("insoyombo")];
- char uniname2ctype_pool_str1704[sizeof("bhks")];
- char uniname2ctype_pool_str1714[sizeof("bhaiksuki")];
- char uniname2ctype_pool_str1716[sizeof("incjkcompatibility")];
- char uniname2ctype_pool_str1722[sizeof("inhanunoo")];
- char uniname2ctype_pool_str1724[sizeof("intangut")];
- char uniname2ctype_pool_str1728[sizeof("sogdian")];
- char uniname2ctype_pool_str1729[sizeof("inlatinextendedd")];
- char uniname2ctype_pool_str1730[sizeof("sogo")];
- char uniname2ctype_pool_str1731[sizeof("insinhalaarchaicnumbers")];
- char uniname2ctype_pool_str1732[sizeof("ideographic")];
- char uniname2ctype_pool_str1733[sizeof("ugar")];
- char uniname2ctype_pool_str1740[sizeof("copt")];
- char uniname2ctype_pool_str1742[sizeof("imperialaramaic")];
- char uniname2ctype_pool_str1745[sizeof("insogdian")];
- char uniname2ctype_pool_str1746[sizeof("indingbats")];
- char uniname2ctype_pool_str1750[sizeof("format")];
- char uniname2ctype_pool_str1752[sizeof("ininscriptionalpahlavi")];
- char uniname2ctype_pool_str1757[sizeof("ininscriptionalparthian")];
- char uniname2ctype_pool_str1766[sizeof("grbase")];
- char uniname2ctype_pool_str1769[sizeof("inbatak")];
- char uniname2ctype_pool_str1776[sizeof("cprt")];
- char uniname2ctype_pool_str1780[sizeof("cwcf")];
- char uniname2ctype_pool_str1788[sizeof("cuneiform")];
- char uniname2ctype_pool_str1791[sizeof("term")];
- char uniname2ctype_pool_str1806[sizeof("intibetan")];
- char uniname2ctype_pool_str1810[sizeof("intags")];
- char uniname2ctype_pool_str1811[sizeof("asciihexdigit")];
- char uniname2ctype_pool_str1813[sizeof("sentenceterminal")];
- char uniname2ctype_pool_str1816[sizeof("inmayannumerals")];
- char uniname2ctype_pool_str1821[sizeof("nand")];
- char uniname2ctype_pool_str1825[sizeof("patsyn")];
- char uniname2ctype_pool_str1826[sizeof("hatran")];
- char uniname2ctype_pool_str1828[sizeof("inblockelements")];
- char uniname2ctype_pool_str1838[sizeof("inornamentaldingbats")];
- char uniname2ctype_pool_str1842[sizeof("innumberforms")];
- char uniname2ctype_pool_str1843[sizeof("oldpersian")];
- char uniname2ctype_pool_str1846[sizeof("inshavian")];
- char uniname2ctype_pool_str1848[sizeof("bopo")];
- char uniname2ctype_pool_str1861[sizeof("hatr")];
- char uniname2ctype_pool_str1866[sizeof("caseignorable")];
- char uniname2ctype_pool_str1871[sizeof("inoldpersian")];
- char uniname2ctype_pool_str1878[sizeof("modifierletter")];
- char uniname2ctype_pool_str1881[sizeof("cwu")];
- char uniname2ctype_pool_str1891[sizeof("lydi")];
- char uniname2ctype_pool_str1892[sizeof("inbyzantinemusicalsymbols")];
- char uniname2ctype_pool_str1896[sizeof("ingeometricshapesextended")];
- char uniname2ctype_pool_str1904[sizeof("inmyanmarextendedb")];
- char uniname2ctype_pool_str1905[sizeof("innushu")];
- char uniname2ctype_pool_str1906[sizeof("lydian")];
- char uniname2ctype_pool_str1911[sizeof("inunifiedcanadianaboriginalsyllabics")];
- char uniname2ctype_pool_str1915[sizeof("orkh")];
- char uniname2ctype_pool_str1928[sizeof("inyiradicals")];
- char uniname2ctype_pool_str1929[sizeof("inkatakanaphoneticextensions")];
- char uniname2ctype_pool_str1930[sizeof("inethiopicextendeda")];
- char uniname2ctype_pool_str1932[sizeof("incoptic")];
- char uniname2ctype_pool_str1936[sizeof("inarabicextendeda")];
- char uniname2ctype_pool_str1947[sizeof("oldpermic")];
- char uniname2ctype_pool_str1950[sizeof("incjksymbolsandpunctuation")];
- char uniname2ctype_pool_str1951[sizeof("word")];
- char uniname2ctype_pool_str1958[sizeof("bopomofo")];
- char uniname2ctype_pool_str1961[sizeof("ogam")];
- char uniname2ctype_pool_str1964[sizeof("inlisu")];
- char uniname2ctype_pool_str1967[sizeof("inoldpermic")];
- char uniname2ctype_pool_str1968[sizeof("innoblock")];
- char uniname2ctype_pool_str1971[sizeof("taiviet")];
- char uniname2ctype_pool_str1985[sizeof("inbraillepatterns")];
- char uniname2ctype_pool_str1991[sizeof("alpha")];
- char uniname2ctype_pool_str1993[sizeof("inbalinese")];
- char uniname2ctype_pool_str1994[sizeof("sorasompeng")];
- char uniname2ctype_pool_str1996[sizeof("closepunctuation")];
- char uniname2ctype_pool_str2006[sizeof("inmiscellaneousmathematicalsymbolsb")];
- char uniname2ctype_pool_str2010[sizeof("inlepcha")];
- char uniname2ctype_pool_str2014[sizeof("insyriacsupplement")];
- char uniname2ctype_pool_str2016[sizeof("newa")];
- char uniname2ctype_pool_str2023[sizeof("spacingmark")];
- char uniname2ctype_pool_str2024[sizeof("inpalmyrene")];
- char uniname2ctype_pool_str2033[sizeof("cyrl")];
- char uniname2ctype_pool_str2043[sizeof("assigned")];
- char uniname2ctype_pool_str2048[sizeof("mlym")];
- char uniname2ctype_pool_str2055[sizeof("malayalam")];
- char uniname2ctype_pool_str2058[sizeof("ext")];
- char uniname2ctype_pool_str2062[sizeof("newtailue")];
- char uniname2ctype_pool_str2070[sizeof("space")];
- char uniname2ctype_pool_str2073[sizeof("intelugu")];
- char uniname2ctype_pool_str2078[sizeof("idsb")];
- char uniname2ctype_pool_str2083[sizeof("indevanagari")];
- char uniname2ctype_pool_str2084[sizeof("avestan")];
- char uniname2ctype_pool_str2085[sizeof("cf")];
- char uniname2ctype_pool_str2093[sizeof("palmyrene")];
- char uniname2ctype_pool_str2095[sizeof("inethiopicsupplement")];
- char uniname2ctype_pool_str2097[sizeof("soyo")];
- char uniname2ctype_pool_str2098[sizeof("xposixpunct")];
- char uniname2ctype_pool_str2102[sizeof("pf")];
- char uniname2ctype_pool_str2103[sizeof("sarb")];
- char uniname2ctype_pool_str2109[sizeof("zanabazarsquare")];
- char uniname2ctype_pool_str2110[sizeof("ugaritic")];
- char uniname2ctype_pool_str2112[sizeof("osge")];
- char uniname2ctype_pool_str2114[sizeof("java")];
- char uniname2ctype_pool_str2117[sizeof("sharada")];
- char uniname2ctype_pool_str2119[sizeof("dogra")];
- char uniname2ctype_pool_str2135[sizeof("bugi")];
- char uniname2ctype_pool_str2137[sizeof("meroitichieroglyphs")];
- char uniname2ctype_pool_str2145[sizeof("separator")];
- char uniname2ctype_pool_str2146[sizeof("ingeorgiansupplement")];
- char uniname2ctype_pool_str2149[sizeof("sogd")];
- char uniname2ctype_pool_str2150[sizeof("tale")];
- char uniname2ctype_pool_str2153[sizeof("inunifiedcanadianaboriginalsyllabicsextended")];
- char uniname2ctype_pool_str2161[sizeof("terminalpunctuation")];
- char uniname2ctype_pool_str2165[sizeof("shrd")];
- char uniname2ctype_pool_str2166[sizeof("graph")];
- char uniname2ctype_pool_str2167[sizeof("olditalic")];
- char uniname2ctype_pool_str2170[sizeof("dogr")];
- char uniname2ctype_pool_str2173[sizeof("gujr")];
- char uniname2ctype_pool_str2181[sizeof("phag")];
- char uniname2ctype_pool_str2182[sizeof("gujarati")];
- char uniname2ctype_pool_str2195[sizeof("inhanguljamo")];
- char uniname2ctype_pool_str2199[sizeof("javanese")];
- char uniname2ctype_pool_str2201[sizeof("taml")];
- char uniname2ctype_pool_str2204[sizeof("inphoneticextensions")];
- char uniname2ctype_pool_str2207[sizeof("siddham")];
- char uniname2ctype_pool_str2217[sizeof("buginese")];
- char uniname2ctype_pool_str2218[sizeof("inmongoliansupplement")];
- char uniname2ctype_pool_str2222[sizeof("invariationselectors")];
- char uniname2ctype_pool_str2224[sizeof("inhanguljamoextendeda")];
- char uniname2ctype_pool_str2225[sizeof("inverticalforms")];
- char uniname2ctype_pool_str2228[sizeof("syrc")];
- char uniname2ctype_pool_str2229[sizeof("number")];
- char uniname2ctype_pool_str2235[sizeof("incopticepactnumbers")];
- char uniname2ctype_pool_str2238[sizeof("avst")];
- char uniname2ctype_pool_str2244[sizeof("inbamum")];
- char uniname2ctype_pool_str2247[sizeof("nd")];
- char uniname2ctype_pool_str2248[sizeof("insuttonsignwriting")];
- char uniname2ctype_pool_str2252[sizeof("extender")];
- char uniname2ctype_pool_str2258[sizeof("intaiviet")];
- char uniname2ctype_pool_str2260[sizeof("hex")];
- char uniname2ctype_pool_str2268[sizeof("incjkunifiedideographsextensionf")];
- char uniname2ctype_pool_str2271[sizeof("other")];
- char uniname2ctype_pool_str2272[sizeof("otheridcontinue")];
- char uniname2ctype_pool_str2278[sizeof("shaw")];
- char uniname2ctype_pool_str2282[sizeof("dash")];
- char uniname2ctype_pool_str2285[sizeof("othernumber")];
- char uniname2ctype_pool_str2294[sizeof("orya")];
- char uniname2ctype_pool_str2302[sizeof("invedicextensions")];
- char uniname2ctype_pool_str2305[sizeof("sgnw")];
- char uniname2ctype_pool_str2312[sizeof("caucasianalbanian")];
- char uniname2ctype_pool_str2315[sizeof("inmathematicalalphanumericsymbols")];
- char uniname2ctype_pool_str2321[sizeof("inphoneticextensionssupplement")];
- char uniname2ctype_pool_str2339[sizeof("invariationselectorssupplement")];
- char uniname2ctype_pool_str2343[sizeof("induployan")];
- char uniname2ctype_pool_str2344[sizeof("syriac")];
- char uniname2ctype_pool_str2357[sizeof("oalpha")];
- char uniname2ctype_pool_str2361[sizeof("innyiakengpuachuehmong")];
- char uniname2ctype_pool_str2364[sizeof("incombiningdiacriticalmarks")];
- char uniname2ctype_pool_str2365[sizeof("inethiopicextended")];
- char uniname2ctype_pool_str2373[sizeof("nl")];
- char uniname2ctype_pool_str2374[sizeof("incombiningdiacriticalmarksforsymbols")];
- char uniname2ctype_pool_str2375[sizeof("khudawadi")];
- char uniname2ctype_pool_str2378[sizeof("otheralphabetic")];
- char uniname2ctype_pool_str2389[sizeof("oldhungarian")];
- char uniname2ctype_pool_str2396[sizeof("incurrencysymbols")];
- char uniname2ctype_pool_str2397[sizeof("incjkradicalssupplement")];
- char uniname2ctype_pool_str2398[sizeof("inglagolitic")];
- char uniname2ctype_pool_str2415[sizeof("intifinagh")];
- char uniname2ctype_pool_str2416[sizeof("ingeorgianextended")];
- char uniname2ctype_pool_str2427[sizeof("surrogate")];
- char uniname2ctype_pool_str2433[sizeof("incyrillicextendedb")];
- char uniname2ctype_pool_str2440[sizeof("ethi")];
- char uniname2ctype_pool_str2451[sizeof("titlecaseletter")];
- char uniname2ctype_pool_str2454[sizeof("rohg")];
- char uniname2ctype_pool_str2458[sizeof("inmeroiticcursive")];
- char uniname2ctype_pool_str2460[sizeof("idstrinaryoperator")];
- char uniname2ctype_pool_str2470[sizeof("inphagspa")];
- char uniname2ctype_pool_str2475[sizeof("lepcha")];
- char uniname2ctype_pool_str2479[sizeof("intagalog")];
- char uniname2ctype_pool_str2480[sizeof("mathsymbol")];
- char uniname2ctype_pool_str2481[sizeof("incombiningdiacriticalmarkssupplement")];
- char uniname2ctype_pool_str2506[sizeof("inbrahmi")];
- char uniname2ctype_pool_str2513[sizeof("insymbolsandpictographsextendeda")];
- char uniname2ctype_pool_str2519[sizeof("inlinearbsyllabary")];
- char uniname2ctype_pool_str2529[sizeof("oldturkic")];
- char uniname2ctype_pool_str2534[sizeof("inbengali")];
- char uniname2ctype_pool_str2540[sizeof("wancho")];
- char uniname2ctype_pool_str2542[sizeof("osmanya")];
- char uniname2ctype_pool_str2548[sizeof("buhd")];
- char uniname2ctype_pool_str2552[sizeof("insmallformvariants")];
- char uniname2ctype_pool_str2561[sizeof("indevanagariextended")];
- char uniname2ctype_pool_str2562[sizeof("softdotted")];
- char uniname2ctype_pool_str2564[sizeof("inbuginese")];
- char uniname2ctype_pool_str2566[sizeof("mahj")];
- char uniname2ctype_pool_str2567[sizeof("inlatin1supplement")];
- char uniname2ctype_pool_str2570[sizeof("ingothic")];
- char uniname2ctype_pool_str2575[sizeof("mahajani")];
- char uniname2ctype_pool_str2576[sizeof("hang")];
- char uniname2ctype_pool_str2579[sizeof("sylo")];
- char uniname2ctype_pool_str2586[sizeof("warangciti")];
- char uniname2ctype_pool_str2595[sizeof("ingujarati")];
- char uniname2ctype_pool_str2603[sizeof("tirhuta")];
- char uniname2ctype_pool_str2606[sizeof("incombiningdiacriticalmarksextended")];
- char uniname2ctype_pool_str2609[sizeof("spaceseparator")];
- char uniname2ctype_pool_str2614[sizeof("ingunjalagondi")];
- char uniname2ctype_pool_str2624[sizeof("wcho")];
- char uniname2ctype_pool_str2631[sizeof("hiragana")];
- char uniname2ctype_pool_str2634[sizeof("extendedpictographic")];
- char uniname2ctype_pool_str2643[sizeof("inrejang")];
- char uniname2ctype_pool_str2644[sizeof("inottomansiyaqnumbers")];
- char uniname2ctype_pool_str2648[sizeof("nchar")];
- char uniname2ctype_pool_str2650[sizeof("cyrillic")];
- char uniname2ctype_pool_str2653[sizeof("khoj")];
- char uniname2ctype_pool_str2656[sizeof("inlimbu")];
- char uniname2ctype_pool_str2663[sizeof("hmng")];
- char uniname2ctype_pool_str2665[sizeof("thaa")];
- char uniname2ctype_pool_str2668[sizeof("thai")];
- char uniname2ctype_pool_str2670[sizeof("incjkunifiedideographsextensionb")];
- char uniname2ctype_pool_str2673[sizeof("deva")];
- char uniname2ctype_pool_str2676[sizeof("thaana")];
- char uniname2ctype_pool_str2688[sizeof("phagspa")];
- char uniname2ctype_pool_str2691[sizeof("devanagari")];
- char uniname2ctype_pool_str2692[sizeof("tang")];
- char uniname2ctype_pool_str2694[sizeof("currencysymbol")];
- char uniname2ctype_pool_str2698[sizeof("tagbanwa")];
- char uniname2ctype_pool_str2701[sizeof("inenclosedcjklettersandmonths")];
- char uniname2ctype_pool_str2702[sizeof("tamil")];
- char uniname2ctype_pool_str2721[sizeof("tirh")];
- char uniname2ctype_pool_str2723[sizeof("digit")];
- char uniname2ctype_pool_str2732[sizeof("talu")];
- char uniname2ctype_pool_str2747[sizeof("zp")];
- char uniname2ctype_pool_str2750[sizeof("inpaucinhau")];
- char uniname2ctype_pool_str2760[sizeof("taitham")];
- char uniname2ctype_pool_str2764[sizeof("otherlowercase")];
- char uniname2ctype_pool_str2768[sizeof("telu")];
- char uniname2ctype_pool_str2769[sizeof("inaegeannumbers")];
- char uniname2ctype_pool_str2777[sizeof("otherletter")];
- char uniname2ctype_pool_str2780[sizeof("whitespace")];
- char uniname2ctype_pool_str2793[sizeof("nonspacingmark")];
- char uniname2ctype_pool_str2816[sizeof("graphemeclusterbreak=spacingmark")];
- char uniname2ctype_pool_str2821[sizeof("inletterlikesymbols")];
- char uniname2ctype_pool_str2834[sizeof("intagbanwa")];
- char uniname2ctype_pool_str2841[sizeof("oldsogdian")];
- char uniname2ctype_pool_str2848[sizeof("otheridstart")];
- char uniname2ctype_pool_str2852[sizeof("graphemeclusterbreak=cr")];
- char uniname2ctype_pool_str2855[sizeof("narb")];
- char uniname2ctype_pool_str2856[sizeof("changeswhencasemapped")];
- char uniname2ctype_pool_str2859[sizeof("inbopomofo")];
- char uniname2ctype_pool_str2862[sizeof("tangut")];
- char uniname2ctype_pool_str2867[sizeof("graphemeclusterbreak=regionalindicator")];
- char uniname2ctype_pool_str2871[sizeof("noncharactercodepoint")];
- char uniname2ctype_pool_str2883[sizeof("otheruppercase")];
- char uniname2ctype_pool_str2885[sizeof("rjng")];
- char uniname2ctype_pool_str2886[sizeof("sylotinagri")];
- char uniname2ctype_pool_str2904[sizeof("inhangulsyllables")];
- char uniname2ctype_pool_str2905[sizeof("emojipresentation")];
- char uniname2ctype_pool_str2906[sizeof("inindicsiyaqnumbers")];
- char uniname2ctype_pool_str2909[sizeof("inbassavah")];
- char uniname2ctype_pool_str2912[sizeof("ogrext")];
- char uniname2ctype_pool_str2926[sizeof("othersymbol")];
- char uniname2ctype_pool_str2938[sizeof("oupper")];
- char uniname2ctype_pool_str2941[sizeof("inbuhid")];
- char uniname2ctype_pool_str2963[sizeof("hmnp")];
- char uniname2ctype_pool_str2964[sizeof("inpsalterpahlavi")];
- char uniname2ctype_pool_str2967[sizeof("finalpunctuation")];
- char uniname2ctype_pool_str2980[sizeof("phlp")];
- char uniname2ctype_pool_str2984[sizeof("inbamumsupplement")];
- char uniname2ctype_pool_str2986[sizeof("buhid")];
- char uniname2ctype_pool_str2987[sizeof("paragraphseparator")];
- char uniname2ctype_pool_str2988[sizeof("inalphabeticpresentationforms")];
- char uniname2ctype_pool_str2993[sizeof("omath")];
- char uniname2ctype_pool_str3000[sizeof("any")];
- char uniname2ctype_pool_str3001[sizeof("elba")];
- char uniname2ctype_pool_str3002[sizeof("changeswhentitlecased")];
- char uniname2ctype_pool_str3005[sizeof("incombininghalfmarks")];
- char uniname2ctype_pool_str3006[sizeof("intangutcomponents")];
- char uniname2ctype_pool_str3012[sizeof("hebr")];
- char uniname2ctype_pool_str3028[sizeof("deprecated")];
- char uniname2ctype_pool_str3045[sizeof("inarabicmathematicalalphabeticsymbols")];
- char uniname2ctype_pool_str3055[sizeof("inprivateusearea")];
- char uniname2ctype_pool_str3089[sizeof("kayahli")];
- char uniname2ctype_pool_str3098[sizeof("inplayingcards")];
- char uniname2ctype_pool_str3099[sizeof("inarabicpresentationformsb")];
- char uniname2ctype_pool_str3100[sizeof("ogham")];
- char uniname2ctype_pool_str3101[sizeof("elym")];
- char uniname2ctype_pool_str3107[sizeof("graphemeclusterbreak=t")];
- char uniname2ctype_pool_str3109[sizeof("graphemeclusterbreak=lvt")];
- char uniname2ctype_pool_str3111[sizeof("nbat")];
- char uniname2ctype_pool_str3125[sizeof("nabataean")];
- char uniname2ctype_pool_str3126[sizeof("hangul")];
- char uniname2ctype_pool_str3134[sizeof("elymaic")];
- char uniname2ctype_pool_str3158[sizeof("inhebrew")];
- char uniname2ctype_pool_str3165[sizeof("injavanese")];
- char uniname2ctype_pool_str3169[sizeof("symbol")];
- char uniname2ctype_pool_str3176[sizeof("inmathematicaloperators")];
- char uniname2ctype_pool_str3180[sizeof("inarabicsupplement")];
- char uniname2ctype_pool_str3185[sizeof("cypriot")];
- char uniname2ctype_pool_str3194[sizeof("hung")];
- char uniname2ctype_pool_str3205[sizeof("wspace")];
- char uniname2ctype_pool_str3209[sizeof("changeswhenlowercased")];
- char uniname2ctype_pool_str3215[sizeof("elbasan")];
- char uniname2ctype_pool_str3218[sizeof("hluw")];
- char uniname2ctype_pool_str3237[sizeof("insuperscriptsandsubscripts")];
- char uniname2ctype_pool_str3239[sizeof("graphemeclusterbreak=extend")];
- char uniname2ctype_pool_str3240[sizeof("graphemeclusterbreak=prepend")];
- char uniname2ctype_pool_str3248[sizeof("nshu")];
- char uniname2ctype_pool_str3254[sizeof("oldnortharabian")];
- char uniname2ctype_pool_str3266[sizeof("inyijinghexagramsymbols")];
- char uniname2ctype_pool_str3286[sizeof("hexdigit")];
- char uniname2ctype_pool_str3297[sizeof("graphemeclusterbreak=l")];
- char uniname2ctype_pool_str3303[sizeof("graphemeclusterbreak=control")];
- char uniname2ctype_pool_str3309[sizeof("bassavah")];
- char uniname2ctype_pool_str3317[sizeof("otherdefaultignorablecodepoint")];
- char uniname2ctype_pool_str3328[sizeof("changeswhenuppercased")];
- char uniname2ctype_pool_str3329[sizeof("inalchemicalsymbols")];
- char uniname2ctype_pool_str3348[sizeof("insupplementalarrowsa")];
- char uniname2ctype_pool_str3349[sizeof("inyisyllables")];
- char uniname2ctype_pool_str3351[sizeof("tibt")];
- char uniname2ctype_pool_str3360[sizeof("othermath")];
- char uniname2ctype_pool_str3363[sizeof("tibetan")];
- char uniname2ctype_pool_str3365[sizeof("inmahjongtiles")];
- char uniname2ctype_pool_str3433[sizeof("signwriting")];
- char uniname2ctype_pool_str3436[sizeof("nushu")];
- char uniname2ctype_pool_str3439[sizeof("modifiersymbol")];
- char uniname2ctype_pool_str3442[sizeof("inhalfwidthandfullwidthforms")];
- char uniname2ctype_pool_str3458[sizeof("upper")];
- char uniname2ctype_pool_str3460[sizeof("insupplementalarrowsc")];
- char uniname2ctype_pool_str3511[sizeof("insupplementalmathematicaloperators")];
- char uniname2ctype_pool_str3512[sizeof("incypriotsyllabary")];
- char uniname2ctype_pool_str3517[sizeof("dupl")];
- char uniname2ctype_pool_str3531[sizeof("tavt")];
- char uniname2ctype_pool_str3532[sizeof("inpahawhhmong")];
- char uniname2ctype_pool_str3533[sizeof("alphabetic")];
- char uniname2ctype_pool_str3550[sizeof("dashpunctuation")];
- char uniname2ctype_pool_str3558[sizeof("uppercase")];
- char uniname2ctype_pool_str3613[sizeof("soyombo")];
- char uniname2ctype_pool_str3614[sizeof("hanifirohingya")];
- char uniname2ctype_pool_str3616[sizeof("otherpunctuation")];
- char uniname2ctype_pool_str3628[sizeof("defaultignorablecodepoint")];
- char uniname2ctype_pool_str3648[sizeof("inhanguljamoextendedb")];
- char uniname2ctype_pool_str3664[sizeof("aghb")];
- char uniname2ctype_pool_str3703[sizeof("tifinagh")];
- char uniname2ctype_pool_str3705[sizeof("inlatinextendedb")];
- char uniname2ctype_pool_str3714[sizeof("tfng")];
- char uniname2ctype_pool_str3766[sizeof("inhighprivateusesurrogates")];
- char uniname2ctype_pool_str3791[sizeof("changeswhencasefolded")];
- char uniname2ctype_pool_str3805[sizeof("dep")];
- char uniname2ctype_pool_str3819[sizeof("oldsoutharabian")];
- char uniname2ctype_pool_str3821[sizeof("graphemeclusterbreak=lf")];
- char uniname2ctype_pool_str3842[sizeof("pahawhhmong")];
- char uniname2ctype_pool_str3845[sizeof("unifiedideograph")];
- char uniname2ctype_pool_str3891[sizeof("uppercaseletter")];
- char uniname2ctype_pool_str3924[sizeof("insupplementalpunctuation")];
- char uniname2ctype_pool_str3942[sizeof("ethiopic")];
- char uniname2ctype_pool_str3976[sizeof("inglagoliticsupplement")];
- char uniname2ctype_pool_str3995[sizeof("rejang")];
- char uniname2ctype_pool_str4087[sizeof("inbopomofoextended")];
- char uniname2ctype_pool_str4109[sizeof("tagb")];
- char uniname2ctype_pool_str4137[sizeof("othergraphemeextend")];
- char uniname2ctype_pool_str4162[sizeof("inegyptianhieroglyphs")];
- char uniname2ctype_pool_str4175[sizeof("inegyptianhieroglyphformatcontrols")];
- char uniname2ctype_pool_str4203[sizeof("hebrew")];
- char uniname2ctype_pool_str4254[sizeof("tglg")];
- char uniname2ctype_pool_str4276[sizeof("tagalog")];
- char uniname2ctype_pool_str4291[sizeof("graphemeclusterbreak=zwj")];
- char uniname2ctype_pool_str4321[sizeof("zyyy")];
- char uniname2ctype_pool_str4360[sizeof("hyphen")];
- char uniname2ctype_pool_str4397[sizeof("inboxdrawing")];
- char uniname2ctype_pool_str4405[sizeof("graphemeclusterbreak=v")];
- char uniname2ctype_pool_str4406[sizeof("graphemeclusterbreak=lv")];
- char uniname2ctype_pool_str4460[sizeof("telugu")];
- char uniname2ctype_pool_str4485[sizeof("duployan")];
- char uniname2ctype_pool_str4528[sizeof("openpunctuation")];
- char uniname2ctype_pool_str4674[sizeof("insupplementaryprivateuseareaa")];
- char uniname2ctype_pool_str4683[sizeof("inhighsurrogates")];
- char uniname2ctype_pool_str4772[sizeof("insupplementalarrowsb")];
- char uniname2ctype_pool_str4948[sizeof("insupplementalsymbolsandpictographs")];
- char uniname2ctype_pool_str4955[sizeof("egyp")];
- char uniname2ctype_pool_str4986[sizeof("inhangulcompatibilityjamo")];
- char uniname2ctype_pool_str5114[sizeof("nyiakengpuachuehmong")];
- char uniname2ctype_pool_str5608[sizeof("egyptianhieroglyphs")];
- char uniname2ctype_pool_str6098[sizeof("insupplementaryprivateuseareab")];
-#endif /* USE_UNICODE_PROPERTIES */
- };
-static const struct uniname2ctype_pool_t uniname2ctype_pool_contents =
- {
-#ifndef USE_UNICODE_PROPERTIES
- "word",
-#else /* USE_UNICODE_PROPERTIES */
- "yi",
- "yiii",
- "lana",
- "z",
- "lina",
- "maka",
- "mani",
- "mn",
- "miao",
- "lo",
- "ci",
- "lao",
- "laoo",
- "inkannada",
- "cn",
- "pi",
- "innko",
- "zzzz",
- "gran",
- "co",
- "lineara",
- "mark",
- "po",
- "me",
- "cari",
- "inkharoshthi",
- "kana",
- "loe",
- "m",
- "grek",
- "mro",
- "mroo",
- "carian",
- "geor",
- "greek",
- "gonm",
- "mendekikakui",
- "pe",
- "mero",
- "inosmanya",
- "cakm",
- "inmanichaean",
- "inmro",
- "inmiao",
- "inchakma",
- "c",
- "mandaic",
- "meeteimayek",
- "inarmenian",
- "inmyanmar",
- "inmakasar",
- "common",
- "lm",
- "marc",
- "inrunic",
- "incarian",
- "inideographicsymbolsandpunctuation",
- "inkhmer",
- "qaai",
- "inahom",
- "merc",
- "combiningmark",
- "lc",
- "perm",
- "mc",
- "connectorpunctuation",
- "cans",
- "incuneiformnumbersandpunctuation",
- "armi",
- "cc",
- "armn",
- "incherokee",
- "prependedconcatenationmark",
- "incuneiform",
- "inavestan",
- "inipaextensions",
- "pc",
- "armenian",
- "insharada",
- "inmarchen",
- "makasar",
- "masaramgondi",
- "inarrows",
- "incyrillic",
- "incham",
- "qmark",
- "ri",
- "qaac",
- "insamaritan",
- "latn",
- "inmasaramgondi",
- "inthaana",
- "latin",
- "inthai",
- "lineseparator",
- "pcm",
- "inkatakana",
- "inkaithi",
- "inzanabazarsquare",
- "inscriptionalparthian",
- "initialpunctuation",
- "mtei",
- "vai",
- "vaii",
- "inkhmersymbols",
- "insyriac",
- "intakri",
- "arabic",
- "zs",
- "katakana",
- "prti",
- "ascii",
- "cs",
- "ps",
- "mand",
- "privateuse",
- "inruminumeralsymbols",
- "inmyanmarextendeda",
- "modi",
- "incjkcompatibilityforms",
- "inkanaextendeda",
- "incjkcompatibilityideographs",
- "brai",
- "mend",
- "ideo",
- "letter",
- "l",
- "inmeeteimayek",
- "inideographicdescriptioncharacters",
- "xidcontinue",
- "knda",
- "innandinagari",
- "kannada",
- "inmodi",
- "inlao",
- "inoldnortharabian",
- "intransportandmapsymbols",
- "letternumber",
- "gothic",
- "inlineara",
- "inmendekikakui",
- "xidc",
- "mongolian",
- "inmiscellaneousmathematicalsymbolsa",
- "inspecials",
- "grlink",
- "brahmi",
- "inemoticons",
- "kali",
- "inolditalic",
- "inmedefaidrin",
- "inchesssymbols",
- "incjkcompatibilityideographssupplement",
- "inadlam",
- "psalterpahlavi",
- "incommonindicnumberforms",
- "lt",
- "innewa",
- "sk",
- "control",
- "inancientsymbols",
- "palm",
- "inlycian",
- "so",
- "patternwhitespace",
- "xids",
- "inmandaic",
- "idc",
- "meroiticcursive",
- "inwarangciti",
- "sora",
- "inopticalcharacterrecognition",
- "inoldsogdian",
- "inmalayalam",
- "bamum",
- "inkanasupplement",
- "insundanese",
- "grext",
-#endif /* USE_UNICODE_PROPERTIES */
- "print",
-#ifndef USE_UNICODE_PROPERTIES
- "punct",
- "alpha",
-#else /* USE_UNICODE_PROPERTIES */
- "intaitham",
- "lower",
- "joinc",
- "inoldsoutharabian",
- "incjkstrokes",
- "batk",
- "samr",
- "inwancho",
- "batak",
- "vs",
- "patws",
- "samaritan",
- "idsbinaryoperator",
- "pauc",
- "insmallkanaextension",
- "sm",
- "indominotiles",
-#endif /* USE_UNICODE_PROPERTIES */
- "alnum",
-#ifdef USE_UNICODE_PROPERTIES
- "insylotinagri",
- "inugaritic",
- "incontrolpictures",
- "inlinearbideograms",
- "inmusicalsymbols",
- "s",
- "ital",
- "inmodifiertoneletters",
- "inancientgreekmusicalnotation",
- "patternsyntax",
- "lisu",
- "lowercase",
- "cwcm",
- "sc",
- "bass",
- "ids",
- "inlatinextendeda",
- "oriya",
- "intaile",
- "inmiscellaneoussymbols",
- "inmiscellaneoussymbolsandarrows",
- "incaucasianalbanian",
- "inmiscellaneoussymbolsandpictographs",
- "inoldturkic",
- "insaurashtra",
- "idcontinue",
- "intamil",
- "inmultani",
- "inlatinextendede",
- "pd",
- "bali",
- "blank",
- "idst",
- "inlydian",
- "innewtailue",
- "bengali",
- "runr",
- "zl",
- "incyrillicextendeda",
- "ll",
- "indeseret",
- "intaixuanjingsymbols",
- "inancientgreeknumbers",
- "idstart",
- "inmeeteimayekextensions",
- "balinese",
- "dia",
- "di",
- "inspacingmodifierletters",
- "inearlydynasticcuneiform",
- "plrd",
- "canadianaboriginal",
- "zinh",
- "sind",
- "osage",
- "inlatinextendedc",
- "uideo",
- "incountingrodnumerals",
- "xidstart",
-#endif /* USE_UNICODE_PROPERTIES */
- "xdigit",
-#ifndef USE_UNICODE_PROPERTIES
- "upper",
- "ascii",
-#else /* USE_UNICODE_PROPERTIES */
- "osma",
- "inkhudawadi",
- "inhanifirohingya",
- "gong",
- "ingrantha",
- "bidic",
- "mong",
- "cased",
- "incyrillicextendedc",
- "inhiragana",
- "sinhala",
- "adlm",
- "glagolitic",
- "sterm",
- "bamu",
- "georgian",
- "inosage",
- "gunjalagondi",
- "phoenician",
- "multani",
- "kaithi",
- "joincontrol",
- "runic",
- "ingeneralpunctuation",
- "inmahajani",
- "incyrillicsupplement",
- "lowercaseletter",
- "marchen",
- "graphemelink",
- "ingeorgian",
- "khojki",
- "cham",
- "inogham",
- "cher",
- "chakma",
- "emoji",
- "insiddham",
- "cherokee",
- "khar",
- "inmongolian",
- "incherokeesupplement",
- "diacritic",
- "manichaean",
- "xsux",
- "inolchiki",
- "quotationmark",
- "adlam",
- "inethiopic",
- "graphemebase",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=11.0",
- "age=12.1",
- "age=10.0",
- "age=12.0",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "casedletter",
- "ingurmukhi",
- "odi",
- "incjkunifiedideographsextensiona",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=1.1",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "lu",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=4.1",
- "age=2.1",
- "age=4.0",
- "age=2.0",
- "age=9.0",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "intamilsupplement",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=6.1",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "unknown",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=6.0",
- "age=6.2",
- "age=3.1",
- "age=8.0",
- "age=3.0",
- "age=3.2",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "cwt",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=7.0",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "unassigned",
-#ifdef USE_UNICODE_AGE_PROPERTIES
- "age=6.3",
- "age=5.1",
- "age=5.0",
- "age=5.2",
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- "ahom",
- "incjkunifiedideographsextensione",
- "khmr",
- "insinhala",
- "inmiscellaneoustechnical",
- "saur",
- "guru",
- "sundanese",
- "punct",
- "paucinhau",
- "gurmukhi",
- "variationselector",
- "logicalorderexception",
- "khmer",
- "limbu",
- "inscriptionalpahlavi",
- "oidc",
- "incjkunifiedideographsextensionc",
-#endif /* USE_UNICODE_PROPERTIES */
- "cntrl",
-#ifdef USE_UNICODE_PROPERTIES
- "inlatinextendedadditional",
- "decimalnumber",
- "insorasompeng",
- "radical",
- "emojimodifier",
- "kharoshthi",
- "n",
- "math",
- "goth",
- "anatolianhieroglyphs",
- "inenclosedalphanumerics",
- "nandinagari",
- "no",
- "nko",
- "nkoo",
- "ingreekandcoptic",
- "olck",
- "p",
- "grantha",
- "olchiki",
- "incjkunifiedideographs",
- "zanb",
- "intirhuta",
- "oids",
- "inhatran",
- "linb",
- "xpeo",
- "mult",
- "saurashtra",
- "kthi",
- "inbhaiksuki",
- "olower",
- "innabataean",
- "inphoenician",
- "inkanbun",
- "inmeroitichieroglyphs",
- "inkayahli",
- "phnx",
- "inoriya",
- "enclosingmark",
- "sd",
- "inelbasan",
- "wara",
- "inenclosedideographicsupplement",
- "sidd",
- "linearb",
- "hani",
- "han",
- "inenclosedalphanumericsupplement",
- "medf",
- "bidicontrol",
- "hano",
- "inphaistosdisc",
- "limb",
- "inkangxiradicals",
- "lepc",
- "medefaidrin",
- "braille",
- "regionalindicator",
- "inlowsurrogates",
- "inshorthandformatcontrols",
- "brah",
- "inkhojki",
- "inoldhungarian",
- "hanunoo",
- "hira",
- "beng",
- "emojimodifierbase",
- "inarabic",
- "lyci",
- "ahex",
- "inherited",
- "glag",
- "lycian",
- "indogra",
- "dsrt",
- "arab",
- "mymr",
- "myanmar",
- "phli",
- "inimperialaramaic",
- "ingreekextended",
- "inanatolianhieroglyphs",
- "punctuation",
- "takri",
- "graphemeextend",
- "invai",
- "cwl",
- "ingeometricshapes",
- "emojicomponent",
- "coptic",
- "deseret",
- "inarabicpresentationformsa",
- "takr",
- "inbasiclatin",
- "incjkunifiedideographsextensiond",
- "sinh",
- "sund",
- "shavian",
- "taile",
- "insundanesesupplement",
- "inelymaic",
- "insoyombo",
- "bhks",
- "bhaiksuki",
- "incjkcompatibility",
- "inhanunoo",
- "intangut",
- "sogdian",
- "inlatinextendedd",
- "sogo",
- "insinhalaarchaicnumbers",
- "ideographic",
- "ugar",
- "copt",
- "imperialaramaic",
- "insogdian",
- "indingbats",
- "format",
- "ininscriptionalpahlavi",
- "ininscriptionalparthian",
- "grbase",
- "inbatak",
- "cprt",
- "cwcf",
- "cuneiform",
- "term",
- "intibetan",
- "intags",
- "asciihexdigit",
- "sentenceterminal",
- "inmayannumerals",
- "nand",
- "patsyn",
- "hatran",
- "inblockelements",
- "inornamentaldingbats",
- "innumberforms",
- "oldpersian",
- "inshavian",
- "bopo",
- "hatr",
- "caseignorable",
- "inoldpersian",
- "modifierletter",
- "cwu",
- "lydi",
- "inbyzantinemusicalsymbols",
- "ingeometricshapesextended",
- "inmyanmarextendedb",
- "innushu",
- "lydian",
- "inunifiedcanadianaboriginalsyllabics",
- "orkh",
- "inyiradicals",
- "inkatakanaphoneticextensions",
- "inethiopicextendeda",
- "incoptic",
- "inarabicextendeda",
- "oldpermic",
- "incjksymbolsandpunctuation",
- "word",
- "bopomofo",
- "ogam",
- "inlisu",
- "inoldpermic",
- "innoblock",
- "taiviet",
- "inbraillepatterns",
- "alpha",
- "inbalinese",
- "sorasompeng",
- "closepunctuation",
- "inmiscellaneousmathematicalsymbolsb",
- "inlepcha",
- "insyriacsupplement",
- "newa",
- "spacingmark",
- "inpalmyrene",
- "cyrl",
- "assigned",
- "mlym",
- "malayalam",
- "ext",
- "newtailue",
-#endif /* USE_UNICODE_PROPERTIES */
- "space",
-#ifdef USE_UNICODE_PROPERTIES
- "intelugu",
- "idsb",
- "indevanagari",
- "avestan",
- "cf",
- "palmyrene",
- "inethiopicsupplement",
- "soyo",
-#endif /* USE_UNICODE_PROPERTIES */
- "xposixpunct",
-#ifndef USE_UNICODE_PROPERTIES
- "lower",
-#else /* USE_UNICODE_PROPERTIES */
- "pf",
- "sarb",
- "zanabazarsquare",
- "ugaritic",
- "osge",
- "java",
- "sharada",
- "dogra",
- "bugi",
- "meroitichieroglyphs",
- "separator",
- "ingeorgiansupplement",
- "sogd",
- "tale",
- "inunifiedcanadianaboriginalsyllabicsextended",
- "terminalpunctuation",
- "shrd",
-#endif /* USE_UNICODE_PROPERTIES */
- "graph",
-#ifdef USE_UNICODE_PROPERTIES
- "olditalic",
- "dogr",
- "gujr",
- "phag",
- "gujarati",
- "inhanguljamo",
- "javanese",
- "taml",
- "inphoneticextensions",
- "siddham",
- "buginese",
- "inmongoliansupplement",
- "invariationselectors",
- "inhanguljamoextendeda",
- "inverticalforms",
- "syrc",
- "number",
- "incopticepactnumbers",
- "avst",
- "inbamum",
- "nd",
- "insuttonsignwriting",
- "extender",
- "intaiviet",
- "hex",
- "incjkunifiedideographsextensionf",
- "other",
- "otheridcontinue",
- "shaw",
- "dash",
- "othernumber",
- "orya",
- "invedicextensions",
- "sgnw",
- "caucasianalbanian",
- "inmathematicalalphanumericsymbols",
- "inphoneticextensionssupplement",
- "invariationselectorssupplement",
- "induployan",
- "syriac",
- "oalpha",
- "innyiakengpuachuehmong",
- "incombiningdiacriticalmarks",
- "inethiopicextended",
- "nl",
- "incombiningdiacriticalmarksforsymbols",
- "khudawadi",
- "otheralphabetic",
- "oldhungarian",
- "incurrencysymbols",
- "incjkradicalssupplement",
- "inglagolitic",
- "intifinagh",
- "ingeorgianextended",
- "surrogate",
- "incyrillicextendedb",
- "ethi",
- "titlecaseletter",
- "rohg",
- "inmeroiticcursive",
- "idstrinaryoperator",
- "inphagspa",
- "lepcha",
- "intagalog",
- "mathsymbol",
- "incombiningdiacriticalmarkssupplement",
- "inbrahmi",
- "insymbolsandpictographsextendeda",
- "inlinearbsyllabary",
- "oldturkic",
- "inbengali",
- "wancho",
- "osmanya",
- "buhd",
- "insmallformvariants",
- "indevanagariextended",
- "softdotted",
- "inbuginese",
- "mahj",
- "inlatin1supplement",
- "ingothic",
- "mahajani",
- "hang",
- "sylo",
- "warangciti",
- "ingujarati",
- "tirhuta",
- "incombiningdiacriticalmarksextended",
- "spaceseparator",
- "ingunjalagondi",
- "wcho",
- "hiragana",
- "extendedpictographic",
- "inrejang",
- "inottomansiyaqnumbers",
- "nchar",
- "cyrillic",
- "khoj",
- "inlimbu",
- "hmng",
- "thaa",
- "thai",
- "incjkunifiedideographsextensionb",
- "deva",
- "thaana",
- "phagspa",
- "devanagari",
- "tang",
- "currencysymbol",
- "tagbanwa",
- "inenclosedcjklettersandmonths",
- "tamil",
- "tirh",
-#endif /* USE_UNICODE_PROPERTIES */
- "digit",
-#ifndef USE_UNICODE_PROPERTIES
- "blank"
-#else /* USE_UNICODE_PROPERTIES */
- "talu",
- "zp",
- "inpaucinhau",
- "taitham",
- "otherlowercase",
- "telu",
- "inaegeannumbers",
- "otherletter",
- "whitespace",
- "nonspacingmark",
- "graphemeclusterbreak=spacingmark",
- "inletterlikesymbols",
- "intagbanwa",
- "oldsogdian",
- "otheridstart",
- "graphemeclusterbreak=cr",
- "narb",
- "changeswhencasemapped",
- "inbopomofo",
- "tangut",
- "graphemeclusterbreak=regionalindicator",
- "noncharactercodepoint",
- "otheruppercase",
- "rjng",
- "sylotinagri",
- "inhangulsyllables",
- "emojipresentation",
- "inindicsiyaqnumbers",
- "inbassavah",
- "ogrext",
- "othersymbol",
- "oupper",
- "inbuhid",
- "hmnp",
- "inpsalterpahlavi",
- "finalpunctuation",
- "phlp",
- "inbamumsupplement",
- "buhid",
- "paragraphseparator",
- "inalphabeticpresentationforms",
- "omath",
- "any",
- "elba",
- "changeswhentitlecased",
- "incombininghalfmarks",
- "intangutcomponents",
- "hebr",
- "deprecated",
- "inarabicmathematicalalphabeticsymbols",
- "inprivateusearea",
- "kayahli",
- "inplayingcards",
- "inarabicpresentationformsb",
- "ogham",
- "elym",
- "graphemeclusterbreak=t",
- "graphemeclusterbreak=lvt",
- "nbat",
- "nabataean",
- "hangul",
- "elymaic",
- "inhebrew",
- "injavanese",
- "symbol",
- "inmathematicaloperators",
- "inarabicsupplement",
- "cypriot",
- "hung",
- "wspace",
- "changeswhenlowercased",
- "elbasan",
- "hluw",
- "insuperscriptsandsubscripts",
- "graphemeclusterbreak=extend",
- "graphemeclusterbreak=prepend",
- "nshu",
- "oldnortharabian",
- "inyijinghexagramsymbols",
- "hexdigit",
- "graphemeclusterbreak=l",
- "graphemeclusterbreak=control",
- "bassavah",
- "otherdefaultignorablecodepoint",
- "changeswhenuppercased",
- "inalchemicalsymbols",
- "insupplementalarrowsa",
- "inyisyllables",
- "tibt",
- "othermath",
- "tibetan",
- "inmahjongtiles",
- "signwriting",
- "nushu",
- "modifiersymbol",
- "inhalfwidthandfullwidthforms",
- "upper",
- "insupplementalarrowsc",
- "insupplementalmathematicaloperators",
- "incypriotsyllabary",
- "dupl",
- "tavt",
- "inpahawhhmong",
- "alphabetic",
- "dashpunctuation",
- "uppercase",
- "soyombo",
- "hanifirohingya",
- "otherpunctuation",
- "defaultignorablecodepoint",
- "inhanguljamoextendedb",
- "aghb",
- "tifinagh",
- "inlatinextendedb",
- "tfng",
- "inhighprivateusesurrogates",
- "changeswhencasefolded",
- "dep",
- "oldsoutharabian",
- "graphemeclusterbreak=lf",
- "pahawhhmong",
- "unifiedideograph",
- "uppercaseletter",
- "insupplementalpunctuation",
- "ethiopic",
- "inglagoliticsupplement",
- "rejang",
- "inbopomofoextended",
- "tagb",
- "othergraphemeextend",
- "inegyptianhieroglyphs",
- "inegyptianhieroglyphformatcontrols",
- "hebrew",
- "tglg",
- "tagalog",
- "graphemeclusterbreak=zwj",
- "zyyy",
- "hyphen",
- "inboxdrawing",
- "graphemeclusterbreak=v",
- "graphemeclusterbreak=lv",
- "telugu",
- "duployan",
- "openpunctuation",
- "insupplementaryprivateuseareaa",
- "inhighsurrogates",
- "insupplementalarrowsb",
- "insupplementalsymbolsandpictographs",
- "egyp",
- "inhangulcompatibilityjamo",
- "nyiakengpuachuehmong",
- "egyptianhieroglyphs",
- "insupplementaryprivateuseareab"
-#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}, {-1},
- {uniname2ctype_offset(str11), 111},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str17), 111},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str22), 152},
- {-1},
- {uniname2ctype_offset(str24), 52},
- {uniname2ctype_offset(str25), 184},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str33), 218},
- {-1},
- {uniname2ctype_offset(str35), 186},
- {uniname2ctype_offset(str36), 34},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str45), 173},
- {uniname2ctype_offset(str46), 28},
- {uniname2ctype_offset(str47), 61},
- {uniname2ctype_offset(str48), 95},
- {uniname2ctype_offset(str49), 95},
- {-1}, {-1},
- {uniname2ctype_offset(str52), 331},
- {-1}, {-1},
- {uniname2ctype_offset(str55), 21},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str64), 44},
- {-1},
- {uniname2ctype_offset(str66), 319},
- {uniname2ctype_offset(str67), 267},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str71), 181},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str75), 22},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str83), 184},
- {-1}, {-1},
- {uniname2ctype_offset(str86), 31},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str92), 45},
- {-1},
- {uniname2ctype_offset(str94), 33},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str100), 149},
- {uniname2ctype_offset(str101), 496},
- {uniname2ctype_offset(str102), 108},
- {uniname2ctype_offset(str103), 252},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str107), 31},
- {uniname2ctype_offset(str108), 77},
- {-1}, {-1},
- {uniname2ctype_offset(str111), 189},
- {uniname2ctype_offset(str112), 189},
- {-1}, {-1},
- {uniname2ctype_offset(str115), 149},
- {-1},
- {uniname2ctype_offset(str117), 98},
- {uniname2ctype_offset(str118), 77},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str122), 212},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str129), 187},
- {uniname2ctype_offset(str130), 42},
- {uniname2ctype_offset(str131), 172},
- {-1}, {-1},
- {uniname2ctype_offset(str134), 482},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str139), 170},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str145), 499},
- {uniname2ctype_offset(str146), 548},
- {-1},
- {uniname2ctype_offset(str148), 552},
- {uniname2ctype_offset(str149), 514},
- {-1},
- {uniname2ctype_offset(str151), 18},
- {uniname2ctype_offset(str152), 169},
- {uniname2ctype_offset(str153), 160},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str161), 313},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str177), 337},
- {uniname2ctype_offset(str178), 539},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str183), 75},
- {-1}, {-1},
- {uniname2ctype_offset(str186), 27},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str190), 208},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str203), 345},
- {uniname2ctype_offset(str204), 473},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str210), 553},
- {-1},
- {uniname2ctype_offset(str212), 350},
- {uniname2ctype_offset(str213), 115},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str218), 528},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str226), 171},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str231), 31},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str236), 25},
- {uniname2ctype_offset(str237), 194},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str246), 32},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str250), 40},
- {-1}, {-1},
- {uniname2ctype_offset(str253), 102},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str260), 542},
- {-1}, {-1},
- {uniname2ctype_offset(str263), 161},
- {-1},
- {uniname2ctype_offset(str265), 19},
- {-1},
- {uniname2ctype_offset(str267), 79},
- {uniname2ctype_offset(str268), 342},
- {-1},
- {uniname2ctype_offset(str270), 259},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str274), 541},
- {uniname2ctype_offset(str275), 500},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str281), 307},
- {uniname2ctype_offset(str282), 40},
- {uniname2ctype_offset(str283), 79},
- {-1},
- {uniname2ctype_offset(str285), 516},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str289), 536},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str293), 218},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str297), 212},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str301), 380},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str311), 311},
- {-1},
- {uniname2ctype_offset(str313), 441},
- {-1},
- {uniname2ctype_offset(str315), 232},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str320), 260},
- {-1},
- {uniname2ctype_offset(str322), 129},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str328), 320},
- {-1}, {-1},
- {uniname2ctype_offset(str331), 76},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str335), 537},
- {-1}, {-1},
- {uniname2ctype_offset(str338), 318},
- {-1},
- {uniname2ctype_offset(str340), 76},
- {-1},
- {uniname2ctype_offset(str342), 334},
- {-1}, {-1},
- {uniname2ctype_offset(str345), 53},
- {uniname2ctype_offset(str346), 259},
- {-1},
- {uniname2ctype_offset(str348), 411},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str352), 512},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str357), 532},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str362), 163},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str366), 44},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str373), 160},
- {-1}, {-1},
- {uniname2ctype_offset(str376), 144},
- {uniname2ctype_offset(str377), 144},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str386), 356},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str399), 316},
- {-1},
- {uniname2ctype_offset(str401), 527},
- {-1}, {-1},
- {uniname2ctype_offset(str404), 81},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str411), 55},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str418), 108},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str426), 163},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str442), 14},
- {-1}, {-1},
- {uniname2ctype_offset(str445), 23},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str462), 46},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str468), 169},
- {-1},
- {uniname2ctype_offset(str470), 22},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str475), 507},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str480), 442},
- {uniname2ctype_offset(str481), 188},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str486), 461},
- {-1},
- {uniname2ctype_offset(str488), 557},
- {-1}, {-1},
- {uniname2ctype_offset(str491), 455},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str500), 127},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str504), 187},
- {uniname2ctype_offset(str505), 238},
- {uniname2ctype_offset(str506), 24},
- {-1}, {-1},
- {uniname2ctype_offset(str509), 24},
- {-1},
- {uniname2ctype_offset(str511), 448},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str520), 408},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str535), 70},
- {-1}, {-1},
- {uniname2ctype_offset(str538), 91},
- {-1}, {-1},
- {uniname2ctype_offset(str541), 531},
- {-1},
- {uniname2ctype_offset(str543), 91},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str556), 525},
- {-1},
- {uniname2ctype_offset(str558), 335},
- {-1},
- {uniname2ctype_offset(str560), 498},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str565), 586},
- {uniname2ctype_offset(str566), 37},
- {-1},
- {uniname2ctype_offset(str568), 113},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str572), 486},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str577), 573},
- {uniname2ctype_offset(str578), 70},
- {uniname2ctype_offset(str579), 106},
- {-1}, {-1},
- {uniname2ctype_offset(str582), 391},
- {uniname2ctype_offset(str583), 465},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str590), 74},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str594), 168},
- {-1},
- {uniname2ctype_offset(str596), 584},
- {uniname2ctype_offset(str597), 146},
- {-1}, {-1},
- {uniname2ctype_offset(str600), 475},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str604), 551},
- {uniname2ctype_offset(str605), 591},
- {-1}, {-1},
- {uniname2ctype_offset(str608), 598},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str614), 574},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str624), 195},
- {uniname2ctype_offset(str625), 432},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str630), 29},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str636), 522},
- {-1}, {-1},
- {uniname2ctype_offset(str639), 49},
- {-1}, {-1},
- {uniname2ctype_offset(str642), 19},
- {-1}, {-1},
- {uniname2ctype_offset(str645), 470},
- {-1},
- {uniname2ctype_offset(str647), 192},
- {-1}, {-1},
- {uniname2ctype_offset(str650), 472},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str657), 51},
- {-1}, {-1},
- {uniname2ctype_offset(str660), 257},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str668), 69},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str672), 321},
- {-1}, {-1},
- {uniname2ctype_offset(str675), 68},
- {-1}, {-1},
- {uniname2ctype_offset(str678), 171},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str695), 530},
- {uniname2ctype_offset(str696), 175},
- {uniname2ctype_offset(str697), 384},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str703), 508},
- {-1},
- {uniname2ctype_offset(str705), 332},
- {-1},
- {uniname2ctype_offset(str707), 158},
- {uniname2ctype_offset(str708), 556},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str713), 361},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str720), 72},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str737), 7},
- {uniname2ctype_offset(str738), 358},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str742), 6},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str753), 229},
- {-1},
- {uniname2ctype_offset(str755), 497},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str760), 416},
- {uniname2ctype_offset(str761), 167},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str766), 156},
- {uniname2ctype_offset(str767), 572},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str771), 167},
- {uniname2ctype_offset(str772), 256},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str776), 257},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str783), 156},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str787), 245},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str791), 193},
- {-1}, {-1},
- {uniname2ctype_offset(str794), 558},
- {-1}, {-1},
- {uniname2ctype_offset(str797), 50},
- {-1},
- {uniname2ctype_offset(str799), 579},
- {-1}, {-1},
- {uniname2ctype_offset(str802), 13},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str809), 431},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str814), 478},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str818), 383},
- {-1}, {-1},
- {uniname2ctype_offset(str821), 467},
- {uniname2ctype_offset(str822), 563},
- {uniname2ctype_offset(str823), 47},
- {uniname2ctype_offset(str824), 112},
- {uniname2ctype_offset(str825), 429},
- {-1}, {-1},
- {uniname2ctype_offset(str828), 564},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str834), 258},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str838), 157},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str842), 58},
- {-1}, {-1},
- {uniname2ctype_offset(str845), 66},
- {-1},
- {uniname2ctype_offset(str847), 48},
- {uniname2ctype_offset(str848), 178},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str855), 67},
- {-1},
- {uniname2ctype_offset(str857), 305},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str862), 88},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str875), 354},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str886), 389},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str895), 397},
- {-1}, {-1},
- {uniname2ctype_offset(str898), 485},
- {-1},
- {uniname2ctype_offset(str900), 583},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str906), 504},
- {uniname2ctype_offset(str907), 434},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str924), 68},
- {-1},
- {uniname2ctype_offset(str926), 329},
- {-1},
- {uniname2ctype_offset(str928), 519},
- {uniname2ctype_offset(str929), 446},
- {uniname2ctype_offset(str930), 41},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str946), 136},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str961), 2},
- {-1},
- {uniname2ctype_offset(str963), 246},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str974), 493},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str986), 355},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str994), 85},
- {uniname2ctype_offset(str995), 104},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1005), 53},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1009), 404},
- {uniname2ctype_offset(str1010), 26},
- {-1}, {-1},
- {uniname2ctype_offset(str1013), 480},
- {uniname2ctype_offset(str1014), 566},
- {uniname2ctype_offset(str1015), 469},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1021), 67},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1025), 444},
- {-1}, {-1},
- {uniname2ctype_offset(str1028), 136},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1032), 239},
- {uniname2ctype_offset(str1033), 71},
- {-1},
- {uniname2ctype_offset(str1035), 308},
- {uniname2ctype_offset(str1036), 543},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1049), 173},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1067), 102},
- {-1}, {-1},
- {uniname2ctype_offset(str1070), 115},
- {-1},
- {uniname2ctype_offset(str1072), 197},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1080), 210},
- {uniname2ctype_offset(str1081), 399},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1085), 248},
- {-1},
- {uniname2ctype_offset(str1087), 567},
- {-1}, {-1},
- {uniname2ctype_offset(str1090), 69},
- {uniname2ctype_offset(str1091), 11},
- {-1},
- {uniname2ctype_offset(str1093), 125},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1097), 520},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1102), 506},
- {-1}, {-1},
- {uniname2ctype_offset(str1105), 217},
- {-1},
- {uniname2ctype_offset(str1107), 521},
- {-1},
- {uniname2ctype_offset(str1109), 228},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1119), 106},
- {uniname2ctype_offset(str1120), 60},
- {uniname2ctype_offset(str1121), 365},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1134), 410},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1140), 93},
- {-1},
- {uniname2ctype_offset(str1142), 206},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1146), 131},
- {uniname2ctype_offset(str1147), 255},
- {-1},
- {uniname2ctype_offset(str1149), 158},
- {uniname2ctype_offset(str1150), 98},
- {uniname2ctype_offset(str1151), 483},
- {uniname2ctype_offset(str1152), 217},
- {uniname2ctype_offset(str1153), 138},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1157), 203},
- {uniname2ctype_offset(str1158), 166},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1164), 229},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1168), 104},
- {-1},
- {uniname2ctype_offset(str1170), 374},
- {uniname2ctype_offset(str1171), 515},
- {-1}, {-1},
- {uniname2ctype_offset(str1174), 312},
- {uniname2ctype_offset(str1175), 26},
- {uniname2ctype_offset(str1176), 208},
- {uniname2ctype_offset(str1177), 74},
- {uniname2ctype_offset(str1178), 338},
- {-1},
- {uniname2ctype_offset(str1180), 183},
- {uniname2ctype_offset(str1181), 151},
- {uniname2ctype_offset(str1182), 344},
- {uniname2ctype_offset(str1183), 101},
- {-1},
- {uniname2ctype_offset(str1185), 170},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1190), 261},
- {uniname2ctype_offset(str1191), 524},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1197), 101},
- {uniname2ctype_offset(str1198), 135},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1203), 351},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1207), 447},
- {uniname2ctype_offset(str1208), 239},
- {uniname2ctype_offset(str1209), 186},
- {uniname2ctype_offset(str1210), 137},
- {-1},
- {uniname2ctype_offset(str1212), 364},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1227), 232},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1231), 206},
- {uniname2ctype_offset(str1232), 340},
- {uniname2ctype_offset(str1233), 73},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1234), 287},
- {uniname2ctype_offset(str1235), 289},
- {uniname2ctype_offset(str1236), 286},
- {uniname2ctype_offset(str1237), 288},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1243), 25},
- {uniname2ctype_offset(str1244), 326},
- {uniname2ctype_offset(str1245), 249},
- {uniname2ctype_offset(str1246), 420},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1247), 268},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1248), 30},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1249), 275},
- {uniname2ctype_offset(str1250), 270},
- {uniname2ctype_offset(str1251), 274},
- {uniname2ctype_offset(str1252), 269},
- {uniname2ctype_offset(str1253), 285},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1254), 540},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1255), 280},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1256), 267},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1257), 279},
- {uniname2ctype_offset(str1258), 281},
- {uniname2ctype_offset(str1259), 272},
- {uniname2ctype_offset(str1260), 284},
- {uniname2ctype_offset(str1261), 271},
- {uniname2ctype_offset(str1262), 273},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1263), 64},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1264), 283},
- {-1},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1266), 21},
-#ifndef USE_UNICODE_AGE_PROPERTIES
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#else /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1267), 282},
- {uniname2ctype_offset(str1268), 277},
- {-1},
- {uniname2ctype_offset(str1270), 276},
- {uniname2ctype_offset(str1271), 278},
- {-1}, {-1},
-#endif /* USE_UNICODE_AGE_PROPERTIES */
- {uniname2ctype_offset(str1274), 200},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1282), 596},
- {-1}, {-1},
- {uniname2ctype_offset(str1285), 105},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1289), 333},
- {-1}, {-1},
- {uniname2ctype_offset(str1292), 382},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1297), 145},
- {-1}, {-1},
- {uniname2ctype_offset(str1300), 86},
- {uniname2ctype_offset(str1301), 141},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1306), 15},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1314), 193},
- {-1}, {-1},
- {uniname2ctype_offset(str1317), 86},
- {-1},
- {uniname2ctype_offset(str1319), 256},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str1331), 252},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1340), 105},
- {-1}, {-1},
- {uniname2ctype_offset(str1343), 120},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1354), 164},
- {uniname2ctype_offset(str1355), 254},
- {-1}, {-1},
- {uniname2ctype_offset(str1358), 594},
- {-1},
- {uniname2ctype_offset(str1360), 3},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1365), 372},
- {uniname2ctype_offset(str1366), 36},
- {uniname2ctype_offset(str1367), 513},
- {-1},
- {uniname2ctype_offset(str1369), 247},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1373), 263},
- {-1},
- {uniname2ctype_offset(str1375), 135},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1380), 35},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1384), 56},
- {-1}, {-1},
- {uniname2ctype_offset(str1387), 113},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1400), 201},
- {uniname2ctype_offset(str1401), 385},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1407), 224},
- {-1},
- {uniname2ctype_offset(str1409), 38},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1419), 140},
- {uniname2ctype_offset(str1420), 140},
- {-1},
- {uniname2ctype_offset(str1422), 310},
- {uniname2ctype_offset(str1423), 143},
- {-1}, {-1},
- {uniname2ctype_offset(str1426), 39},
- {-1},
- {uniname2ctype_offset(str1428), 181},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1434), 143},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1438), 422},
- {-1}, {-1},
- {uniname2ctype_offset(str1441), 215},
- {uniname2ctype_offset(str1442), 523},
- {-1}, {-1},
- {uniname2ctype_offset(str1445), 253},
- {-1}, {-1},
- {uniname2ctype_offset(str1448), 491},
- {uniname2ctype_offset(str1449), 122},
- {uniname2ctype_offset(str1450), 134},
- {uniname2ctype_offset(str1451), 203},
- {-1}, {-1},
- {uniname2ctype_offset(str1454), 145},
- {-1}, {-1},
- {uniname2ctype_offset(str1457), 166},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1462), 535},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1466), 241},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1470), 490},
- {uniname2ctype_offset(str1471), 492},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1475), 414},
- {uniname2ctype_offset(str1476), 494},
- {-1},
- {uniname2ctype_offset(str1478), 436},
- {-1}, {-1},
- {uniname2ctype_offset(str1481), 138},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1485), 328},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1489), 33},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1495), 251},
- {-1},
- {uniname2ctype_offset(str1497), 484},
- {uniname2ctype_offset(str1498), 199},
- {uniname2ctype_offset(str1499), 582},
- {-1},
- {uniname2ctype_offset(str1501), 196},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1507), 122},
- {-1},
- {uniname2ctype_offset(str1509), 110},
- {-1}, {-1},
- {uniname2ctype_offset(str1512), 110},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1517), 581},
- {-1},
- {uniname2ctype_offset(str1519), 219},
- {uniname2ctype_offset(str1520), 228},
- {-1}, {-1},
- {uniname2ctype_offset(str1523), 117},
- {uniname2ctype_offset(str1524), 471},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1529), 120},
- {-1},
- {uniname2ctype_offset(str1531), 407},
- {-1},
- {uniname2ctype_offset(str1533), 142},
- {-1},
- {uniname2ctype_offset(str1535), 219},
- {uniname2ctype_offset(str1536), 127},
- {uniname2ctype_offset(str1537), 260},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1542), 453},
- {-1},
- {uniname2ctype_offset(str1544), 561},
- {-1}, {-1},
- {uniname2ctype_offset(str1547), 168},
- {uniname2ctype_offset(str1548), 518},
- {uniname2ctype_offset(str1549), 505},
- {-1}, {-1},
- {uniname2ctype_offset(str1552), 117},
- {-1}, {-1},
- {uniname2ctype_offset(str1555), 107},
- {-1},
- {uniname2ctype_offset(str1557), 85},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1563), 264},
- {-1},
- {uniname2ctype_offset(str1565), 315},
- {-1},
- {uniname2ctype_offset(str1567), 148},
- {-1},
- {uniname2ctype_offset(str1569), 236},
- {-1}, {-1},
- {uniname2ctype_offset(str1572), 115},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1580), 131},
- {-1},
- {uniname2ctype_offset(str1582), 148},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1587), 529},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1594), 114},
- {-1}, {-1},
- {uniname2ctype_offset(str1597), 81},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1602), 97},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1607), 97},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1613), 164},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1617), 488},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1622), 373},
- {uniname2ctype_offset(str1623), 546},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1629), 39},
- {-1},
- {uniname2ctype_offset(str1631), 176},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1635), 72},
- {-1}, {-1},
- {uniname2ctype_offset(str1638), 426},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1643), 62},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1654), 388},
- {uniname2ctype_offset(str1655), 265},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1662), 129},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1671), 114},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1675), 457},
- {uniname2ctype_offset(str1676), 176},
- {uniname2ctype_offset(str1677), 303},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1682), 595},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1686), 93},
- {uniname2ctype_offset(str1687), 141},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1691), 124},
- {uniname2ctype_offset(str1692), 121},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1699), 367},
- {-1}, {-1},
- {uniname2ctype_offset(str1702), 510},
- {uniname2ctype_offset(str1703), 533},
- {uniname2ctype_offset(str1704), 207},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1714), 207},
- {-1},
- {uniname2ctype_offset(str1716), 419},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1722), 347},
- {-1},
- {uniname2ctype_offset(str1724), 554},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1728), 221},
- {uniname2ctype_offset(str1729), 430},
- {uniname2ctype_offset(str1730), 222},
- {uniname2ctype_offset(str1731), 517},
- {uniname2ctype_offset(str1732), 238},
- {uniname2ctype_offset(str1733), 123},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1740), 129},
- {-1},
- {uniname2ctype_offset(str1742), 161},
- {-1}, {-1},
- {uniname2ctype_offset(str1745), 509},
- {uniname2ctype_offset(str1746), 390},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1750), 20},
- {-1},
- {uniname2ctype_offset(str1752), 502},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1757), 501},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1766), 73},
- {-1}, {-1},
- {uniname2ctype_offset(str1769), 362},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1776), 126},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1780), 65},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1788), 137},
- {-1}, {-1},
- {uniname2ctype_offset(str1791), 233},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1806), 336},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1810), 599},
- {uniname2ctype_offset(str1811), 236},
- {-1},
- {uniname2ctype_offset(str1813), 255},
- {-1}, {-1},
- {uniname2ctype_offset(str1816), 565},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1821), 224},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1825), 258},
- {uniname2ctype_offset(str1826), 202},
- {-1},
- {uniname2ctype_offset(str1828), 387},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1838), 585},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1842), 379},
- {uniname2ctype_offset(str1843), 134},
- {-1}, {-1},
- {uniname2ctype_offset(str1846), 481},
- {-1},
- {uniname2ctype_offset(str1848), 109},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1861), 202},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1866), 61},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1871), 479},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1878), 27},
- {-1}, {-1},
- {uniname2ctype_offset(str1881), 63},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1891), 150},
- {uniname2ctype_offset(str1892), 562},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1896), 588},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1904), 440},
- {uniname2ctype_offset(str1905), 559},
- {uniname2ctype_offset(str1906), 150},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1911), 343},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1915), 165},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1928), 424},
- {uniname2ctype_offset(str1929), 417},
- {uniname2ctype_offset(str1930), 445},
- {-1},
- {uniname2ctype_offset(str1932), 400},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1936), 323},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str1947), 194},
- {-1}, {-1},
- {uniname2ctype_offset(str1950), 409},
- {uniname2ctype_offset(str1951), 12},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1958), 109},
- {-1}, {-1},
- {uniname2ctype_offset(str1961), 103},
- {-1}, {-1},
- {uniname2ctype_offset(str1964), 425},
- {-1}, {-1},
- {uniname2ctype_offset(str1967), 477},
- {uniname2ctype_offset(str1968), 603},
- {-1}, {-1},
- {uniname2ctype_offset(str1971), 153},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1985), 393},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str1991), 1},
- {-1},
- {uniname2ctype_offset(str1993), 360},
- {uniname2ctype_offset(str1994), 175},
- {-1},
- {uniname2ctype_offset(str1996), 42},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2006), 395},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2010), 363},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2014), 322},
- {-1},
- {uniname2ctype_offset(str2016), 209},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2023), 32},
- {uniname2ctype_offset(str2024), 489},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2033), 78},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2043), 17},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2048), 92},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2055), 92},
- {-1}, {-1},
- {uniname2ctype_offset(str2058), 240},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2062), 130},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2070), 9},
- {-1}, {-1},
- {uniname2ctype_offset(str2073), 330},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2078), 245},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2083), 324},
- {uniname2ctype_offset(str2084), 154},
- {uniname2ctype_offset(str2085), 20},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2093), 192},
- {-1},
- {uniname2ctype_offset(str2095), 341},
- {-1},
- {uniname2ctype_offset(str2097), 214},
- {uniname2ctype_offset(str2098), 8},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2102), 43},
- {uniname2ctype_offset(str2103), 162},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2109), 215},
- {uniname2ctype_offset(str2110), 123},
- {-1},
- {uniname2ctype_offset(str2112), 210},
- {-1},
- {uniname2ctype_offset(str2114), 159},
- {-1}, {-1},
- {uniname2ctype_offset(str2117), 174},
- {-1},
- {uniname2ctype_offset(str2119), 216},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2135), 128},
- {-1},
- {uniname2ctype_offset(str2137), 172},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2145), 52},
- {uniname2ctype_offset(str2146), 401},
- {-1}, {-1},
- {uniname2ctype_offset(str2149), 221},
- {uniname2ctype_offset(str2150), 121},
- {-1}, {-1},
- {uniname2ctype_offset(str2153), 352},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2161), 233},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2165), 174},
- {uniname2ctype_offset(str2166), 5},
- {uniname2ctype_offset(str2167), 112},
- {-1}, {-1},
- {uniname2ctype_offset(str2170), 216},
- {-1}, {-1},
- {uniname2ctype_offset(str2173), 87},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2181), 139},
- {uniname2ctype_offset(str2182), 87},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2195), 339},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2199), 159},
- {-1},
- {uniname2ctype_offset(str2201), 89},
- {-1}, {-1},
- {uniname2ctype_offset(str2204), 369},
- {-1}, {-1},
- {uniname2ctype_offset(str2207), 196},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2217), 128},
- {uniname2ctype_offset(str2218), 526},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2222), 458},
- {-1},
- {uniname2ctype_offset(str2224), 438},
- {uniname2ctype_offset(str2225), 459},
- {-1}, {-1},
- {uniname2ctype_offset(str2228), 82},
- {uniname2ctype_offset(str2229), 35},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2235), 474},
- {-1}, {-1},
- {uniname2ctype_offset(str2238), 154},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2244), 428},
- {-1}, {-1},
- {uniname2ctype_offset(str2247), 36},
- {uniname2ctype_offset(str2248), 569},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2252), 240},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2258), 443},
- {-1},
- {uniname2ctype_offset(str2260), 235},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2268), 597},
- {-1}, {-1},
- {uniname2ctype_offset(str2271), 18},
- {uniname2ctype_offset(str2272), 254},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2278), 124},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2282), 230},
- {-1}, {-1},
- {uniname2ctype_offset(str2285), 38},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2294), 88},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2302), 368},
- {-1}, {-1},
- {uniname2ctype_offset(str2305), 205},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2312), 177},
- {-1}, {-1},
- {uniname2ctype_offset(str2315), 568},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2321), 370},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2339), 600},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2343), 560},
- {uniname2ctype_offset(str2344), 82},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2357), 237},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2361), 571},
- {-1}, {-1},
- {uniname2ctype_offset(str2364), 309},
- {uniname2ctype_offset(str2365), 403},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2373), 37},
- {uniname2ctype_offset(str2374), 377},
- {uniname2ctype_offset(str2375), 197},
- {-1}, {-1},
- {uniname2ctype_offset(str2378), 237},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str2389), 204},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2396), 376},
- {uniname2ctype_offset(str2397), 406},
- {uniname2ctype_offset(str2398), 398},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2415), 402},
- {uniname2ctype_offset(str2416), 366},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str2427), 23},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2433), 427},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2440), 100},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str2451), 29},
- {-1}, {-1},
- {uniname2ctype_offset(str2454), 220},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2458), 495},
- {-1},
- {uniname2ctype_offset(str2460), 246},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2470), 433},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2475), 142},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2479), 346},
- {uniname2ctype_offset(str2480), 50},
- {uniname2ctype_offset(str2481), 371},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2506), 511},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2513), 592},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2519), 466},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2529), 165},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2534), 325},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2540), 226},
- {-1},
- {uniname2ctype_offset(str2542), 125},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2548), 118},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2552), 462},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2561), 435},
- {uniname2ctype_offset(str2562), 251},
- {-1},
- {uniname2ctype_offset(str2564), 357},
- {-1},
- {uniname2ctype_offset(str2566), 185},
- {uniname2ctype_offset(str2567), 304},
- {-1}, {-1},
- {uniname2ctype_offset(str2570), 476},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2575), 185},
- {uniname2ctype_offset(str2576), 99},
- {-1}, {-1},
- {uniname2ctype_offset(str2579), 133},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2586), 199},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2595), 327},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2603), 198},
- {-1}, {-1},
- {uniname2ctype_offset(str2606), 359},
- {-1}, {-1},
- {uniname2ctype_offset(str2609), 55},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2614), 538},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2624), 226},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2631), 107},
- {-1}, {-1},
- {uniname2ctype_offset(str2634), 266},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2643), 437},
- {uniname2ctype_offset(str2644), 576},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2648), 243},
- {-1},
- {uniname2ctype_offset(str2650), 78},
- {-1}, {-1},
- {uniname2ctype_offset(str2653), 183},
- {-1}, {-1},
- {uniname2ctype_offset(str2656), 353},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2663), 182},
- {-1},
- {uniname2ctype_offset(str2665), 83},
- {-1}, {-1},
- {uniname2ctype_offset(str2668), 94},
- {-1},
- {uniname2ctype_offset(str2670), 593},
- {-1}, {-1},
- {uniname2ctype_offset(str2673), 84},
- {-1}, {-1},
- {uniname2ctype_offset(str2676), 83},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2688), 139},
- {-1}, {-1},
- {uniname2ctype_offset(str2691), 84},
- {uniname2ctype_offset(str2692), 211},
- {-1},
- {uniname2ctype_offset(str2694), 48},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2698), 119},
- {-1}, {-1},
- {uniname2ctype_offset(str2701), 418},
- {uniname2ctype_offset(str2702), 89},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2721), 198},
- {-1},
- {uniname2ctype_offset(str2723), 4},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2732), 130},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2747), 54},
- {-1}, {-1},
- {uniname2ctype_offset(str2750), 534},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2760), 152},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2764), 241},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2768), 90},
- {uniname2ctype_offset(str2769), 468},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2777), 28},
- {-1}, {-1},
- {uniname2ctype_offset(str2780), 227},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2793), 34},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2816), 296},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2821), 378},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2834), 349},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2841), 222},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2848), 253},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2852), 291},
- {-1}, {-1},
- {uniname2ctype_offset(str2855), 190},
- {uniname2ctype_offset(str2856), 66},
- {-1}, {-1},
- {uniname2ctype_offset(str2859), 412},
- {-1}, {-1},
- {uniname2ctype_offset(str2862), 211},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2867), 295},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2871), 243},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2883), 242},
- {-1},
- {uniname2ctype_offset(str2885), 147},
- {uniname2ctype_offset(str2886), 133},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2904), 449},
- {uniname2ctype_offset(str2905), 262},
- {uniname2ctype_offset(str2906), 575},
- {-1}, {-1},
- {uniname2ctype_offset(str2909), 549},
- {-1}, {-1},
- {uniname2ctype_offset(str2912), 244},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2926), 51},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str2938), 242},
- {-1}, {-1},
- {uniname2ctype_offset(str2941), 348},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2963), 225},
- {uniname2ctype_offset(str2964), 503},
- {-1}, {-1},
- {uniname2ctype_offset(str2967), 43},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2980), 195},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2984), 547},
- {-1},
- {uniname2ctype_offset(str2986), 118},
- {uniname2ctype_offset(str2987), 54},
- {uniname2ctype_offset(str2988), 456},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str2993), 234},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3000), 16},
- {uniname2ctype_offset(str3001), 180},
- {uniname2ctype_offset(str3002), 64},
- {-1}, {-1},
- {uniname2ctype_offset(str3005), 460},
- {uniname2ctype_offset(str3006), 555},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3012), 80},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3028), 250},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3045), 577},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3055), 454},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-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(str3089), 146},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3098), 580},
- {uniname2ctype_offset(str3099), 463},
- {uniname2ctype_offset(str3100), 103},
- {uniname2ctype_offset(str3101), 223},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3107), 299},
- {-1},
- {uniname2ctype_offset(str3109), 301},
- {-1},
- {uniname2ctype_offset(str3111), 191},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3125), 191},
- {uniname2ctype_offset(str3126), 99},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3134), 223},
- {-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(str3158), 314},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3165), 439},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3169), 47},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3176), 381},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3180), 317},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3185), 126},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3194), 204},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3205), 227},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3209), 62},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3215), 180},
- {-1}, {-1},
- {uniname2ctype_offset(str3218), 201},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3237), 375},
- {-1},
- {uniname2ctype_offset(str3239), 294},
- {uniname2ctype_offset(str3240), 290},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3248), 213},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3254), 190},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str3266), 421},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3286), 235},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3297), 297},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3303), 293},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3309), 178},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3317), 249},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3328), 63},
- {uniname2ctype_offset(str3329), 587},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3348), 392},
- {uniname2ctype_offset(str3349), 423},
- {-1},
- {uniname2ctype_offset(str3351), 96},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3360), 234},
- {-1}, {-1},
- {uniname2ctype_offset(str3363), 96},
- {-1},
- {uniname2ctype_offset(str3365), 578},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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(str3433), 205},
- {-1}, {-1},
- {uniname2ctype_offset(str3436), 213},
- {-1}, {-1},
- {uniname2ctype_offset(str3439), 49},
- {-1}, {-1},
- {uniname2ctype_offset(str3442), 464},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3458), 10},
- {-1},
- {uniname2ctype_offset(str3460), 589},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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(str3511), 396},
- {uniname2ctype_offset(str3512), 487},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3517), 179},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3531), 153},
- {uniname2ctype_offset(str3532), 550},
- {uniname2ctype_offset(str3533), 57},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3550), 41},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3558), 59},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-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(str3613), 214},
- {uniname2ctype_offset(str3614), 220},
- {-1},
- {uniname2ctype_offset(str3616), 45},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str3628), 71},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1},
- {uniname2ctype_offset(str3648), 450},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3664), 177},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-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(str3703), 132},
- {-1},
- {uniname2ctype_offset(str3705), 306},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3714), 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}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3766), 452},
- {-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), 65},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3805), 250},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3819), 162},
- {-1},
- {uniname2ctype_offset(str3821), 292},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1},
- {uniname2ctype_offset(str3842), 182},
- {-1}, {-1},
- {uniname2ctype_offset(str3845), 248},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-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(str3891), 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}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3924), 405},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3942), 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},
- {uniname2ctype_offset(str3976), 570},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str3995), 147},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-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(str4087), 415},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4109), 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},
- {uniname2ctype_offset(str4137), 244},
- {-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(str4162), 544},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4175), 545},
- {-1}, {-1}, {-1}, {-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(str4203), 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},
- {uniname2ctype_offset(str4254), 116},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4276), 116},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4291), 302},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-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(str4321), 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},
- {uniname2ctype_offset(str4360), 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},
- {uniname2ctype_offset(str4397), 386},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4405), 298},
- {uniname2ctype_offset(str4406), 300},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-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), 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},
- {uniname2ctype_offset(str4485), 179},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-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(str4528), 46},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-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(str4674), 601},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4683), 451},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {uniname2ctype_offset(str4772), 394},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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(str4948), 590},
-#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(str4955), 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},
- {uniname2ctype_offset(str4986), 413},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-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(str5114), 225},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-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(str5608), 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}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-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(str6098), 602}
-#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 == 12 && \
- ONIG_UNICODE_VERSION_MINOR == 1 && \
- ONIG_UNICODE_VERSION_TEENY == 0 && \
- 1)
-# error ONIG_UNICODE_VERSION_STRING mismatch
-#endif
-#define ONIG_UNICODE_VERSION_STRING "12.1.0"
-#define ONIG_UNICODE_VERSION_MAJOR 12
-#define ONIG_UNICODE_VERSION_MINOR 1
-#define ONIG_UNICODE_VERSION_TEENY 0
-#if defined ONIG_UNICODE_EMOJI_VERSION_STRING && !( \
- ONIG_UNICODE_EMOJI_VERSION_MAJOR == 12 && \
- ONIG_UNICODE_EMOJI_VERSION_MINOR == 0 && \
- 1)
-# error ONIG_UNICODE_EMOJI_VERSION_STRING mismatch
-#endif
-#define ONIG_UNICODE_EMOJI_VERSION_STRING "12.0"
-#define ONIG_UNICODE_EMOJI_VERSION_MAJOR 12
-#define ONIG_UNICODE_EMOJI_VERSION_MINOR 0
diff --git a/enc/unicode/case-folding.rb b/enc/unicode/case-folding.rb
index 362d6ebfd9..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,208 +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 = []
- 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
- flags += '|IT' # was unpredicted case 1
- 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 |file|
- file.print(s)
+ open(dest, "wb") do |f|
+ 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, 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, 0x08b2,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x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+ 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,
+ 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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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, 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,
+ 0x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ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ec8, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 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,
+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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,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 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,
+ 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_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 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,
+ 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, 0x1dbf,
+ 0x1e01, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x1e05,
+ 0x1e07, 0x1e07,
+ 0x1e09, 0x1e09,
+ 0x1e0b, 0x1e0b,
+ 0x1e0d, 0x1e0d,
+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+ 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, 0xa77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 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x169c,
+ 0x16a0, 0x16f8,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180e,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191e,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1ab0, 0x1abe,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b7c,
+ 0x1b80, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd0, 0x1cf6,
+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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, 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,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1f80b,
+ 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, 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,
+ 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xaadf,
+ 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,
+ 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ce0,
+ 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,
+ 0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 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, 0x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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, 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,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, 0xab65,
+ 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, 0xfe2d,
+ 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,
+ 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, 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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xe0100, 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, 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, 0x08b2,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0983,
+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cb, 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,
+ 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,
+ 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,
+ 0x16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 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,
+ 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[] = {
+ 600,
+ 0x0000, 0x0377,
+ 0x037a, 0x037f,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x052f,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0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,
+ 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,
+ 0x1b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 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,
+ 0x09c5, 0x09c6,
+ 0x09c9, 0x09ca,
+ 0x09cf, 0x09d6,
+ 0x09d8, 0x09db,
+ 0x09de, 0x09de,
+ 0x09e4, 0x09e5,
+ 0x09fc, 0x0a00,
+ 0x0a04, 0x0a04,
+ 0x0a0b, 0x0a0e,
+ 0x0a11, 0x0a12,
+ 0x0a29, 0x0a29,
+ 0x0a31, 0x0a31,
+ 0x0a34, 0x0a34,
+ 0x0a37, 0x0a37,
+ 0x0a3a, 0x0a3b,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,
+ 0x0a49, 0x0a4a,
+ 0x0a4e, 0x0a50,
+ 0x0a52, 0x0a58,
+ 0x0a5d, 0x0a5d,
+ 0x0a5f, 0x0a65,
+ 0x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f48, 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,
+ 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,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8f,
+ 0x1a9a, 0x1a9f,
+ 0x1aae, 0x1aaf,
+ 0x1abf, 0x1aff,
+ 0x1b4c, 0x1b4f,
+ 0x1b7d, 0x1b7f,
+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xfb42, 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, 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,
+ 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,
+ 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, 0x1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 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, 0xe00ff,
+ 0xe01f0, 0x10ffff,
+}; /* CR_C */
+
+/* 'Cc': General Category */
+#define CR_Cc CR_Cntrl
+
+/* 'Cf': General Category */
+static const OnigCodePoint CR_Cf[] = {
+ 17,
+ 0x00ad, 0x00ad,
+ 0x0600, 0x0605,
+ 0x061c, 0x061c,
+ 0x06dd, 0x06dd,
+ 0x070f, 0x070f,
+ 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[] = {
+ 600,
+ 0x0378, 0x0379,
+ 0x0380, 0x0383,
+ 0x038b, 0x038b,
+ 0x038d, 0x038d,
+ 0x03a2, 0x03a2,
+ 0x0530, 0x0530,
+ 0x0557, 0x0558,
+ 0x0560, 0x0560,
+ 0x0588, 0x0588,
+ 0x058b, 0x058c,
+ 0x0590, 0x0590,
+ 0x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7, 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, 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,
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+ 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,
+ 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,
+ 0x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a,
+ 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,
+ 0x16f1, 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, 0x1b33,
+ 0x1b45, 0x1b4b,
+ 0x1b83, 0x1ba0,
+ 0x1bae, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1c00, 0x1c23,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a, 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26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
+ 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, 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, 0x114af,
+ 0x114c4, 0x114c5,
+ 0x114c7, 0x114c7,
+ 0x11580, 0x115ae,
+ 0x11600, 0x1162f,
+ 0x11644, 0x11644,
+ 0x11680, 0x116aa,
+ 0x118a0, 0x118df,
+ 0x118ff, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b40, 0x16b43,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1bc00, 0x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5b,
+ 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[] = {
+ 117,
+ 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,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1d9a,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f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 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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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,
+ 0xa7fa, 0xa7fa,
+ 0xab30, 0xab5a,
+ 0xab64, 0xab65,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 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,
+}; /* 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,
+ 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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, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 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,
+ 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abe2,
+ 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,
+ 0x10330, 0x10340,
+ 0x10342, 0x10349,
+ 0x10350, 0x10375,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x10450, 0x1049d,
+ 0x10500, 0x10527,
+ 0x10530, 0x10563,
+ 0x10600, 0x10736,
+ 0x10740, 0x10755,
+ 0x10760, 0x10767,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10860, 0x10876,
+ 0x10880, 0x1089e,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 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, 0x118ff,
+ 0x11ac0, 0x11af8,
+ 0x12000, 0x12398,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16a40, 0x16a5e,
+ 0x16ad0, 0x16aed,
+ 0x16b00, 0x16b2f,
+ 0x16b63, 0x16b77,
+ 0x16b7d, 0x16b8f,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f50,
+ 0x1b000, 0x1b001,
+ 0x1bc00, 0x1bc6a,
+ 0x1bc70, 0x1bc7c,
+ 0x1bc80, 0x1bc88,
+ 0x1bc90, 0x1bc99,
+ 0x1e800, 0x1e8c4,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 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[] = {
+ 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,
+ 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,
+ 0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a64e, 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, 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x1d790, 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,
+ 0x09e2, 0x09e3,
+ 0x0a01, 0x0a03,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x0abc, 0x0abc,
+ 0x0abe, 0x0ac5,
+ 0x0ac7, 0x0ac9,
+ 0x0acb, 0x0acd,
+ 0x0ae2, 0x0ae3,
+ 0x0b01, 0x0b03,
+ 0x0b3c, 0x0b3c,
+ 0x0b3e, 0x0b44,
+ 0x0b47, 0x0b48,
+ 0x0b4b, 0x0b4d,
+ 0x0b56, 0x0b57,
+ 0x0b62, 0x0b63,
+ 0x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 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, 0x115c0,
+ 0x11630, 0x11640,
+ 0x116ab, 0x116b7,
+ 0x16af0, 0x16af4,
+ 0x16b30, 0x16b36,
+ 0x16f51, 0x16f7e,
+ 0x16f8f, 0x16f92,
+ 0x1bc9d, 0x1bc9e,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1e8d0, 0x1e8d6,
+ 0xe0100, 0xe01ef,
+}; /* CR_M */
+
+/* 'Mc': General Category */
+static const OnigCodePoint CR_Mc[] = {
+ 147,
+ 0x0903, 0x0903,
+ 0x093b, 0x093b,
+ 0x093e, 0x0940,
+ 0x0949, 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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,
+ 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, 0x0902,
+ 0x093a, 0x093a,
+ 0x093c, 0x093c,
+ 0x0941, 0x0948,
+ 0x094d, 0x094d,
+ 0x0951,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38, 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,
+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, 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,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,
+ 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, 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[] = {
+ 165,
+ 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,
+ 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, 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,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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[] = {
+ 127,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x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, 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, 0x06e8,
+ 0x06ea, 0x06ed,
+ 0x070f, 0x070f,
+ 0x0711, 0x0711,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,
+ 0x07eb, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0816, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 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,
+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,
+ 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, 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,
+ 0x1e00, 0x1e00,
+ 0x1e02, 0x1e02,
+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66c, 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,
+ 0x0529, 0x0529,
+ 0x052b, 0x052b,
+ 0x052d, 0x052d,
+ 0x052f, 0x052f,
+ 0x0561, 0x0587,
+ 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, 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xa699, 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,
+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 0x2cd3,
+ 0x2cd5, 0x2cd5,
+ 0x2cd7, 0x2cd7,
+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce3,
+ 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, 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,
+ 0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xa646,
+ 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,
+ 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, 0x026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 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,
+ 0x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 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, 0x1b33,
+ 0x1b45, 0x1b4b,
+ 0x1b83, 0x1ba0,
+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4,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
+ 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,
+ 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,
+ 0x16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,
+ 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_ID_Start */
+
+/* 'ID_Continue': Derived Property */
+static const OnigCodePoint CR_ID_Continue[] = {
+ 626,
+ 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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f99, 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, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1ab0, 0x1abd,
+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, 0xab26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab5a,
+ 0xab5c, 0xab5f,
+ 0xab64, 0xab65,
+ 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, 0xfe2d,
+ 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,
+ 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, 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, 0x1d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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,
+ 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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b3e, 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,
+ 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,
+ 0x1d4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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,
+ 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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,
+ 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, 0xfe2d,
+ 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,
+ 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, 0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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, 0x07b0,
+ 0x07eb, 0x07f3,
+ 0x0816, 0x0819,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 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, 0x0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10a3f,
+ 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,
+ 0x08a0, 0x08b2,
+ 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,
+ 0x09e6, 0x09fb,
+ 0x0a03, 0x0a03,
+ 0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e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xab30, 0xab5f,
+ 0xab64, 0xab65,
+ 0xabc0, 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, 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, 0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
+ 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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d550,
+ 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, 0x1f19a,
+ 0x1f1e6, 0x1f1ff,
+ 0x1f201, 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,
+ 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, 0x063f,
+ 0x0641, 0x064a,
+ 0x0656, 0x065f,
+ 0x066a, 0x066f,
+ 0x0671, 0x06dc,
+ 0x06de, 0x06ff,
+ 0x0750, 0x077f,
+ 0x08a0, 0x08b2,
+ 0x08e4, 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[] = {
+ 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[] = {
+ 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, 0x20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, 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,
+ 0x07a6, 0x07b0,
+ 0x0816, 0x0817,
+ 0x081b, 0x0823,
+ 0x0825, 0x0827,
+ 0x0829, 0x082c,
+ 0x08e4, 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,
+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, 0x1086,
+ 0x109c, 0x109d,
+ 0x135f, 0x135f,
+ 0x1712, 0x1713,
+ 0x1732, 0x1733,
+ 0x1752, 0x1753,
+ 0x1772, 0x1773,
+ 0x17b6, 0x17c8,
+ 0x18a9, 0x18a9,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x19b0, 0x19c0,
+ 0x19c8, 0x19c9,
+ 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,
+ 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,
+ 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, 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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,
+ 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,
+ 0x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+ 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, 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, 0x16b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 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, 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, 0x06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
+ 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,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,
+ 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,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d, 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, 0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4,
+ 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,
+ 0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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,
+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 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,
+ 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b,
+ 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,
+ 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,
+ 0x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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,
+ 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, 0x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x1320, 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,
+ 0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xffee,
+ 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,
+ 0x0a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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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 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,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x115f, 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, 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000b,
+ 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, 0x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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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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, 0x1baa,
+ 0x1bae, 0x1bb9,
+ 0x1bc0, 0x1bf3,
+ 0x1bfc, 0x1c37,
+ 0x1c3b, 0x1c49,
+ 0x1c4d, 0x1c7f,
+ 0x1cd0, 0x1cf2,
+ 0x1d00, 0x1de6,
+ 0x1dfc, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x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xffbe,
+ 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,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x1f5ff,
+ 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,
+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,
+ 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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01ef,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_1 */
+
+/* 'Age_6_2': Derived Age 6.2 */
+static const OnigCodePoint CR_Age_6_2[] = {
+ 549,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,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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, 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,
+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0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x1fffe, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0x2fffe, 0x2ffff,
+ 0x3fffe, 0x3ffff,
+ 0x4fffe, 0x4ffff,
+ 0x5fffe, 0x5ffff,
+ 0x6fffe, 0x6ffff,
+ 0x7fffe, 0x7ffff,
+ 0x8fffe, 0x8ffff,
+ 0x9fffe, 0x9ffff,
+ 0xafffe, 0xaffff,
+ 0xbfffe, 0xbffff,
+ 0xcfffe, 0xcffff,
+ 0xdfffe, 0xdffff,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xefffe, 0x10ffff,
+}; /* CR_Age_6_2 */
+
+/* 'Age_6_3': Derived Age 6.3 */
+static const OnigCodePoint CR_Age_6_3[] = {
+ 549,
+ 0x0000, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061c,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993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xaaf6,
+ 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, 0x1d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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,
+ 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c7,
+ 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,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+ 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,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0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 0x0e97,
+ 0x0e99, 0x0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0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0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x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odePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0a5c,
+ 0x0a5e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
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x0fbe, 0x0fcc,
+ 0x0fce, 0x0fda,
+ 0x1000, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x137c,
+ 0x1380, 0x1399,
+ 0x13a0, 0x13f4,
+ 0x1400, 0x167f,
+ 0x1681, 0x169c,
+ 0x16a0, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1736,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x17f0, 0x17f9,
+ 0x1800, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1940, 0x1940,
+ 0x1944, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19da,
+ 0x19de, 0x1a1b,
+ 0x1a1e, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa0, 0x1aad,
+ 0x1b00, 0x1b4b,
+ 0x1b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, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d7cb,
+ 0x1d7ce, 0x1d7ff,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 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+ 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, 0x04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xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
+ 0xa767, 0xa767,
+ 0xa769, 0xa769,
+ 0xa76b, 0xa76b,
+ 0xa76d, 0xa76d,
+ 0xa76f, 0xa778,
+ 0xa77a, 0xa77a,
+ 0xa77c, 0xa77c,
+ 0xa77f, 0xa77f,
+ 0xa781, 0xa781,
+ 0xa783, 0xa783,
+ 0xa785, 0xa785,
+ 0xa787, 0xa787,
+ 0xa78c, 0xa78c,
+ 0xa78e, 0xa78e,
+ 0xa791, 0xa791,
+ 0xa793, 0xa793,
+ 0xa7a1, 0xa7a1,
+ 0xa7a3, 0xa7a3,
+ 0xa7a5, 0xa7a5,
+ 0xa7a7, 0xa7a7,
+ 0xa7a9, 0xa7a9,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff41, 0xff5a,
+ 0x10428, 0x1044f,
+ 0x1d41a, 0x1d433,
+ 0x1d44e, 0x1d454,
+ 0x1d456, 0x1d467,
+ 0x1d482, 0x1d49b,
+ 0x1d4b6, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d4cf,
+ 0x1d4ea, 0x1d503,
+ 0x1d51e, 0x1d537,
+ 0x1d552, 0x1d56b,
+ 0x1d586, 0x1d59f,
+ 0x1d5ba, 0x1d5d3,
+ 0x1d5ee, 0x1d607,
+ 0x1d622, 0x1d63b,
+ 0x1d656, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098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5c, 0xaa7b,
+ 0xaa80, 0xaac2,
+ 0xaadb, 0xaaf6,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabed,
+ 0xabf0, 0xabf9,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xe000, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+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093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Print */
+
+/* 'Punct': [[:Punct:]] */
+static const OnigCodePoint CR_Punct[] = {
+ 140,
+ 0x0021, 0x0023,
+ 0x0025, 0x002a,
+ 0x002c, 0x002f,
+ 0x003a, 0x003b,
+ 0x003f, 0x0040,
+ 0x005b, 0x005d,
+ 0x005f, 0x005f,
+ 0x007b, 0x007b,
+ 0x007d, 0x007d,
+ 0x00a1, 0x00a1,
+ 0x00a7, 0x00a7,
+ 0x00ab, 0x00ab,
+ 0x00b6, 0x00b7,
+ 0x00bb, 0x00bb,
+ 0x00bf, 0x00bf,
+ 0x037e, 0x037e,
+ 0x0387, 0x0387,
+ 0x055a, 0x055f,
+ 0x0589, 0x058a,
+ 0x05be, 0x05be,
+ 0x05c0, 0x05c0,
+ 0x05c3, 0x05c3,
+ 0x05c6, 0x05c6,
+ 0x05f3, 0x05f4,
+ 0x0609, 0x060a,
+ 0x060c, 0x060d,
+ 0x061b, 0x061b,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4, 0x06d4,
+ 0x0700, 0x070d,
+ 0x07f7, 0x07f9,
+ 0x0830, 0x083e,
+ 0x085e, 0x085e,
+ 0x0964, 0x0965,
+ 0x0970, 0x0970,
+ 0x0af0, 0x0af0,
+ 0x0df4, 0x0df4,
+ 0x0e4f, 0x0e4f,
+ 0x0e5a, 0x0e5b,
+ 0x0f04, 0x0f12,
+ 0x0f14, 0x0f14,
+ 0x0f3a, 0x0f3d,
+ 0x0f85, 0x0f85,
+ 0x0fd0, 0x0fd4,
+ 0x0fd9, 0x0fda,
+ 0x104a, 0x104f,
+ 0x10fb, 0x10fb,
+ 0x1360, 0x1368,
+ 0x1400, 0x1400,
+ 0x166d, 0x166e,
+ 0x169b, 0x169c,
+ 0x16eb, 0x16ed,
+ 0x1735, 0x1736,
+ 0x17d4, 0x17d6,
+ 0x17d8, 0x17da,
+ 0x1800, 0x180a,
+ 0x1944, 0x1945,
+ 0x1a1e, 0x1a1f,
+ 0x1aa0, 0x1aa6,
+ 0x1aa8, 0x1aad,
+ 0x1b5a, 0x1b60,
+ 0x1bfc, 0x1bff,
+ 0x1c3b, 0x1c3f,
+ 0x1c7e, 0x1c7f,
+ 0x1cc0, 0x1cc7,
+ 0x1cd3, 0x1cd3,
+ 0x2010, 0x2027,
+ 0x2030, 0x2043,
+ 0x2045, 0x2051,
+ 0x2053, 0x205e,
+ 0x207d, 0x207e,
+ 0x208d, 0x208e,
+ 0x2329, 0x232a,
+ 0x2768, 0x2775,
+ 0x27c5, 0x27c6,
+ 0x27e6, 0x27ef,
+ 0x2983, 0x2998,
+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, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x0496, 0x0496,
+ 0x0498, 0x0498,
+ 0x049a, 0x049a,
+ 0x049c, 0x049c,
+ 0x049e, 0x049e,
+ 0x04a0, 0x04a0,
+ 0x04a2, 0x04a2,
+ 0x04a4, 0x04a4,
+ 0x04a6, 0x04a6,
+ 0x04a8, 0x04a8,
+ 0x04aa, 0x04aa,
+ 0x04ac, 0x04ac,
+ 0x04ae, 0x04ae,
+ 0x04b0, 0x04b0,
+ 0x04b2, 0x04b2,
+ 0x04b4, 0x04b4,
+ 0x04b6, 0x04b6,
+ 0x04b8, 0x04b8,
+ 0x04ba, 0x04ba,
+ 0x04bc, 0x04bc,
+ 0x04be, 0x04be,
+ 0x04c0, 0x04c1,
+ 0x04c3, 0x04c3,
+ 0x04c5, 0x04c5,
+ 0x04c7, 0x04c7,
+ 0x04c9, 0x04c9,
+ 0x04cb, 0x04cb,
+ 0x04cd, 0x04cd,
+ 0x04d0, 0x04d0,
+ 0x04d2, 0x04d2,
+ 0x04d4, 0x04d4,
+ 0x04d6, 0x04d6,
+ 0x04d8, 0x04d8,
+ 0x04da, 0x04da,
+ 0x04dc, 0x04dc,
+ 0x04de, 0x04de,
+ 0x04e0, 0x04e0,
+ 0x04e2, 0x04e2,
+ 0x04e4, 0x04e4,
+ 0x04e6, 0x04e6,
+ 0x04e8, 0x04e8,
+ 0x04ea, 0x04ea,
+ 0x04ec, 0x04ec,
+ 0x04ee, 0x04ee,
+ 0x04f0, 0x04f0,
+ 0x04f2, 0x04f2,
+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x2cce,
+ 0x2cd0, 0x2cd0,
+ 0x2cd2, 0x2cd2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 0xff21, 0xff3a,
+ 0x10400, 0x10427,
+ 0x1d400, 0x1d419,
+ 0x1d434, 0x1d44d,
+ 0x1d468, 0x1d481,
+ 0x1d49c, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b5,
+ 0x1d4d0, 0x1d4e9,
+ 0x1d504, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d538, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d56c, 0x1d585,
+ 0x1d5a0, 0x1d5b9,
+ 0x1d5d4, 0x1d5ed,
+ 0x1d608, 0x1d621,
+ 0x1d63c, 0x1d655,
+ 0x1d670, 0x1d689,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6e2, 0x1d6fa,
+ 0x1d71c, 0x1d734,
+ 0x1d756, 0x1d76e,
+ 0x1d790, 0x1d7a8,
+ 0x1d7ca, 0x1d7ca,
+}; /* CR_Upper */
+
+/* 'XDigit': [[:XDigit:]] */
+static const OnigCodePoint CR_XDigit[] = {
+ 3,
+ 0x0030, 0x0039,
+ 0x0041, 0x0046,
+ 0x0061, 0x0066,
+}; /* CR_XDigit */
+
+/* 'Word': [[:Word:]] */
+static const OnigCodePoint CR_Word[] = {
+ 564,
+ 0x0030, 0x0039,
+ 0x0041, 0x005a,
+ 0x005f, 0x005f,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0300, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x0483, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x0591, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0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 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135d, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1714,
+ 0x1720, 0x1734,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17d3,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dd,
+ 0x17e0, 0x17e9,
+ 0x180b, 0x180d,
+ 0x1810, 0x1819,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x193b,
+ 0x1946, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x19d0, 0x19d9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a60, 0x1a7c,
+ 0x1a7f, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b4b,
+ 0x1b50, 0x1b59,
+ 0x1b6b, 0x1b73,
+ 0x1b80, 0x1bf3,
+ 0x1c00, 0x1c37,
+ 0x1c40,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,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe00, 0xfe0f,
+ 0xfe20, 0xfe26,
+ 0xfe33, 0xfe34,
+ 0xfe4d, 0xfe4f,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff10, 0xff19,
+ 0xff21, 0xff3a,
+ 0xff3f, 0xff3f,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x101fd, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a3f,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11046,
+ 0x11066, 0x1106f,
+ 0x11080, 0x110ba,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x1113f,
+ 0x11180, 0x111c4,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d165, 0x1d169,
+ 0x1d16d, 0x1d172,
+ 0x1d17b, 0x1d182,
+ 0x1d185, 0x1d18b,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2,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0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x02c1,
+ 0x02c6, 0x02d1,
+ 0x02e0, 0x02e4,
+ 0x02ec, 0x02ec,
+ 0x02ee, 0x02ee,
+ 0x0345, 0x0345,
+ 0x0370, 0x0374,
+ 0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09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xfb40, 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,
+ 0x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ee49, 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, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1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 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, 0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c,
+ 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, 0x00ad,
+ 0x0378, 0x0379,
+ 0x037f, 0x0383,
+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,
+ 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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 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,
+ 0x08ff, 0x08ff,
+ 0x0978, 0x0978,
+ 0x0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f, 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,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+ 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,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0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+ 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,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1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,
+ 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,
+ 0x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+ 0x2cd9, 0x2cd9,
+ 0x2cdb, 0x2cdb,
+ 0x2cdd, 0x2cdd,
+ 0x2cdf, 0x2cdf,
+ 0x2ce1, 0x2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa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a, 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,
+ 0x0a5e, 0x0a5e,
+ 0x0a72, 0x0a74,
+ 0x0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 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,
+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 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, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+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dff,
+ 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,
+ 0x1d1aa, 0x1d1ad,
+ 0x1d242, 0x1d244,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8,
+ 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,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+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a67d,
+ 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,
+ 0x061e, 0x061f,
+ 0x066a, 0x066d,
+ 0x06d4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xa673, 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, 0xa716,
+ 0xa720, 0xa721,
+ 0xa789, 0xa78a,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f300, 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, 0x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+ 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,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00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0x2184,
+ 0x24b6, 0x24e9,
+ 0x2c00, 0x2c2e,
+ 0x2c30, 0x2c5e,
+ 0x2c60, 0x2ce4,
+ 0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa640, 0xa66d,
+ 0xa680, 0xa697,
+ 0xa722, 0xa787,
+ 0xa78b, 0xa78e,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_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, 0x0a42,
+ 0x0a47, 0x0a48,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a82,
+ 0x0abc, 0x0abc,
+ 0x0ac1, 0x0ac5,
+ 0x0ac7, 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af4,
+ 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, 0x0522,
+ 0x0524, 0x0524,
+ 0x0526, 0x0526,
+ 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+ 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,
+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xa735, 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, 0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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,
+ 0x04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726,
+ 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,
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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,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0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
+ 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,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d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3f, 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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ee4b,
+ 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,
+ 0x0620, 0x064a,
+ 0x066e, 0x066f,
+ 0x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+ 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,
+ 0x1900, 0x191c,
+ 0x1950, 0x196d,
+ 0x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3,
+ 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,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d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00b5, 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,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 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xfe7d, 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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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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9bc,
+ 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,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
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xabec,
+ 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,
+ 0x1d200, 0x1d241,
+ 0x1d245, 0x1d245,
+ 0x1d300,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eea1, 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,
+ 0x1d1ae, 0x1d1dd,
+ 0x1d300, 0x1d356,
+ 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f773,
+ 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, 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,
+ 0x25bc, 0x25c0,
+ 0x25c6, 0x25c7,
+ 0x25ca, 0x25cb,
+ 0x25cf, 0x25d3,
+ 0x25e2, 0x25e2,
+ 0x25e4, 0x25e4,
+ 0x25e7, 0x25ec,
+ 0x2605, 0x2606,
+ 0x2640, 0x2640,
+ 0x2642, 0x2642,
+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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,
+ 0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, 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, 0x06ec,
+ 0x0730, 0x074a,
+ 0x07a6, 0x07b0,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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,
+ 0x0a3d, 0x0a3d,
+ 0x0a43, 0x0a46,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 0x0ec5, 0x0ec5,
+ 0x0ec7, 0x0ec7,
+ 0x0ece, 0x0ecf,
+ 0x0eda, 0x0edb,
+ 0x0ee0, 0x0eff,
+ 0x0f48, 0x0f48,
+ 0x0f6d, 0x0f70,
+ 0x0f98, 0x0f98,
+ 0x0fbd, 0x0fbd,
+ 0x0fcd, 0x0fcd,
+ 0x0fdb, 0x0fff,
+ 0x10c6, 0x10c6,
+ 0x10c8, 0x10cc,
+ 0x10ce, 0x10cf,
+ 0x1249, 0x1249,
+ 0x124e, 0x124f,
+ 0x1257, 0x1257,
+ 0x1259, 0x1259,
+ 0x125e, 0x125f,
+ 0x1289, 0x1289,
+ 0x128e, 0x128f,
+ 0x12b1, 0x12b1,
+ 0x12b6, 0x12b7,
+ 0x12bf, 0x12bf,
+ 0x12c1, 0x12c1,
+ 0x12c6, 0x12c7,
+ 0x12d7, 0x12d7,
+ 0x1311, 0x1311,
+ 0x1316, 0x1317,
+ 0x135b, 0x135c,
+ 0x137d, 0x137f,
+ 0x139a, 0x139f,
+ 0x13f5, 0x13ff,
+ 0x169d, 0x169f,
+ 0x16f1, 0x16ff,
+ 0x170d, 0x170d,
+ 0x1715, 0x171f,
+ 0x1737, 0x173f,
+ 0x1754, 0x175f,
+ 0x176d, 0x176d,
+ 0x1771, 0x1771,
+ 0x1774, 0x177f,
+ 0x17de, 0x17df,
+ 0x17ea, 0x17ef,
+ 0x17fa, 0x17ff,
+ 0x180f, 0x180f,
+ 0x181a, 0x181f,
+ 0x1878, 0x187f,
+ 0x18ab, 0x18af,
+ 0x18f6, 0x18ff,
+ 0x191d, 0x191f,
+ 0x192c, 0x192f,
+ 0x193c, 0x193f,
+ 0x1941, 0x1943,
+ 0x196e, 0x196f,
+ 0x1975, 0x197f,
+ 0x19ac, 0x19af,
+ 0x19ca, 0x19cf,
+ 0x19db, 0x19dd,
+ 0x1a1c, 0x1a1d,
+ 0x1a5f, 0x1a5f,
+ 0x1a7d, 0x1a7e,
+ 0x1a8a, 0x1a8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, 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,
+ 0x1d7cc, 0x1d7cd,
+ 0x1d800, 0x1edff,
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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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a, 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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206a, 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, 0x04e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45,
+ 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, 0x0a3c,
+ 0x0a3e, 0x0a42,
+ 0x0a47, 0x0a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x0ed0, 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, 0x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CodePoint 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,
+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 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, 0x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12a, 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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
+ 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,
+ 0x3400, 0x4db5,
+ 0x4e00, 0x9fa5,
+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1d53e,
+ 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,
+ 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 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, 0x0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fd92, 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,
+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c,
+ 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,
+ 0x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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,
+ 0x0a66, 0x0a75,
+ 0x0a81, 0x0a83,
+ 0x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d,
+ 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, 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 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,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ffcf,
+ 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,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cffff,
+ 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, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a59, 0x0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ec8, 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,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50, 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, 0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e6,
+ 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,
+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
+ 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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
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1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 0xaabe,
+ 0xaac0, 0xaac0,
+ 0xaac2, 0xaac2,
+ 0xaadb, 0xaadd,
+ 0xaae0, 0xaaef,
+ 0xaaf2, 0xaaf5,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0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ffcf,
+ 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,
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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, 0x0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x2cd5, 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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, 0x1d66f,
+ 0x1d68a, 0x1d6a5,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6e1,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d71b,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05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
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544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+ 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,
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b,
+ 0xa4fe, 0xa4ff,
+ 0xa60d, 0xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+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+ 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,
+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 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, 0x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bb1,
+ 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,
+ 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0x0376, 0x0377,
+ 0x037a, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x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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,
+ 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,
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ee64,
+ 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, 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,
+ 0x09a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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,
+ 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, 0x1d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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, 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, 0x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, 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, 0x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': 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,
+ 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,
+ 0x09f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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,
+ 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,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x1f16f,
+ 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,
+ 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,
+ 0x0a5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003d,
+ 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,
+ 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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C': General Category */
+static const OnigCodePoint CR_LC[] = {
+ 113,
+ 0x0041, 0x005a,
+ 0x0061, 0x007a,
+ 0x00b5, 0x00b5,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00f6,
+ 0x00f8, 0x01ba,
+ 0x01bc, 0x01bf,
+ 0x01c4, 0x0293,
+ 0x0295, 0x02af,
+ 0x0370, 0x0373,
+ 0x0376, 0x0377,
+ 0x037b, 0x037d,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0561, 0x0587,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x1d00, 0x1d2b,
+ 0x1d6b, 0x1d77,
+ 0x1d79, 0x1d9a,
+ 0x1e00, 0x1f15,
+ 0x1f18, 0x1f1d,
+ 0x1f20, 0x1f45,
+ 0x1f48, 0x1f4d,
+ 0x1f50, 0x1f57,
+ 0x1f59, 0x1f59,
+ 0x1f5b, 0x1f5b,
+ 0x1f5d, 0x1f5d,
+ 0x1f5f, 0x1f7d,
+ 0x1f80, 0x1fb4,
+ 0x1fb6, 0x1fbc,
+ 0x1fbe, 0x1fbe,
+ 0x1fc2, 0x1fc4,
+ 0x1fc6, 0x1fcc,
+ 0x1fd0, 0x1fd3,
+ 0x1fd6, 0x1fdb,
+ 0x1fe0, 0x1fec,
+ 0x1ff2, 0x1ff4,
+ 0x1ff6, 0x1ffc,
+ 0x2102, 0x2102,
+ 0x2107, 0x2107,
+ 0x210a, 0x2113,
+ 0x2115, 0x2115,
+ 0x2119, 0x211d,
+ 0x2124, 0x2124,
+ 0x2126, 0x2126,
+ 0x2128, 0x2128,
+ 0x212a, 0x212d,
+ 0x212f, 0x2134,
+ 0x2139, 0x2139,
+ 0x213c, 0x213f,
+ 0x2145, 0x2149,
+ 0x214e, 0x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,
+ 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,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 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa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* 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, 0x01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ea3,
+ 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,
+ 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, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x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xaa7a,
+ 0xaa80, 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, 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, 0x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 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, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 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,
+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 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,
+ 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, 0x09d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x1a61,
+ 0x1a63, 0x1a64,
+ 0x1a6d, 0x1a72,
+ 0x1b04, 0x1b04,
+ 0x1b35, 0x1b35,
+ 0x1b3b, 0x1b3b,
+ 0x1b3d, 0x1b41,
+ 0x1b43, 0x1b44,
+ 0x1b82, 0x1b82,
+ 0x1ba1, 0x1ba1,
+ 0x1ba6, 0x1ba7,
+ 0x1baa, 0x1baa,
+ 0x1bac, 0x1bad,
+ 0x1be7, 0x1be7,
+ 0x1bea, 0x1bec,
+ 0x1bee, 0x1bee,
+ 0x1bf2, 0x1bf3,
+ 0x1c24, 0x1c2b,
+ 0x1c34, 0x1c35,
+ 0x1ce1, 0x1ce1,
+ 0x1cf2, 0x1cf3,
+ 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,
+ 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,
+ 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,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a82,
+ 0x0abc, 0x0abc,
+ 0x0ac1, 0x0ac5,
+ 0x0ac7, 0x0ac8,
+ 0x0acd, 0x0acd,
+ 0x0ae2, 0x0ae3,
+ 0x0b01, 0x0b01,
+ 0x0b3c, 0x0b3c,
+ 0x0b3f, 0x0b3f,
+ 0x0b41, 0x0b44,
+ 0x0b4d, 0x0b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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,
+ 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,
+ 0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xabeb, 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, 0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2114,
+ 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, 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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 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,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,
+ 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, 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,
+ 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,
+ 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, 0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,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_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, 0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
+ 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, 0x04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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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ce3, 0x2ce3,
+ 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, 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,
+ 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, 0x1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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_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,
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d2,
+ 0x2cd4, 0x2cd4,
+ 0x2cd6, 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 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,
+ 0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x2183, 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,
+ 0x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eb0,
+ 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, 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,
+ 0x1900, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a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xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 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,
+ 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,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
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x0374,
+ 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,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c, 0x0a3c,
+ 0x0a3e,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ead, 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, 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,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10140, 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, 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1ee6c, 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,
+ 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,
+ 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x102a,
+ 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,
+ 0x1900, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x1a20, 0x1a54,
+ 0x1aa7, 0x1aa7,
+ 0x1b05, 0x1b33,
+ 0x1b45, 0x1b4b,
+ 0x1b83, 0x1ba0,
+ 0x1bae, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1c00, 0x1c23,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a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7cb, 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, 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,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_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,
+ 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x0ec6, 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, 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,
+ 0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 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, 0x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1ee5f,
+ 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,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5,
+ 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,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3e, 0x0a40,
+ 0x0a59, 0x0a5c,
+ 0x0a5e, 0x0a5e,
+ 0x0a66, 0x0a6f,
+ 0x0a72, 0x0a74,
+ 0x0a83, 0x0a83,
+ 0x0a85, 0x0a8d,
+ 0x0a8f, 0x0a91,
+ 0x0a93, 0x0aa8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f3a, 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, 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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 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,
+ 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,
+ 0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1f130, 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,
+ 0x2b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a,
+ 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, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f1ff,
+ 0x1f201, 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,
+ 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, 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,
+ 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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x1ee6a,
+ 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, 0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
+ 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,
+ 0x18a9, 0x18a9,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x19b0, 0x19c0,
+ 0x19c8, 0x19c9,
+ 0x1a17, 0x1a1b,
+ 0x1a55, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1b00, 0x1b04,
+ 0x1b35, 0x1b43,
+ 0x1b80, 0x1b82,
+ 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, 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,
+ 0x08e4, 0x08fe,
+ 0x093c, 0x093c,
+ 0x094d, 0x094d,
+ 0x0951, 0x0954,
+ 0x0971, 0x0971,
+ 0x09bc, 0x09bc,
+ 0x09cd, 0x09cd,
+ 0x0a3c, 0x0a3c,
+ 0x0a4d, 0x0a4d,
+ 0x0abc, 0x0abc,
+ 0x0acd, 0x0acd,
+ 0x0b3c, 0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
+ 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,
+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ff00, 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,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6, 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, 0x0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+ 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,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
+ 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,
+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x1ff6, 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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2046,
+ 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,
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, 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,
+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1d505,
+ 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,
+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, 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,
+ 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5ffff,
+ 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, 0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, 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,
+ 0x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x10026,
+ 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,
+ 0x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ea7, 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,
+ 0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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,
+ 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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3e, 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,
+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x1200, 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,
+ 0x1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a,
+ 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,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018a,
+ 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,
+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xffcf,
+ 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, 0x1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, 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,
+ 0x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,
+ 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,
+ 0x1d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_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, 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103b, 0x103f,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1780, 0x17b3,
+ 0x17b6, 0x17c8,
+ 0x17d7, 0x17d7,
+ 0x17dc, 0x17dc,
+ 0x1820, 0x1877,
+ 0x1880, 0x18aa,
+ 0x18b0, 0x18f5,
+ 0x1900, 0x191c,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19b0, 0x19c9,
+ 0x1a00, 0x1a1b,
+ 0x1a20, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1aa7, 0x1aa7,
+ 0x1b00, 0x1b33,
+ 0x1b35, 0x1b43,
+ 0x1b45, 0x1b4b,
+ 0x1b80, 0x1ba9,
+ 0x1bac, 0x1baf,
+ 0x1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e,
+ 0xab11, 0xab16,
+ 0xab20, 0xab26,
+ 0xab28, 0xab2e,
+ 0xabc0, 0xabea,
+ 0xac00, 0xd7a3,
+ 0xd7b0, 0xd7c6,
+ 0xd7cb, 0xd7fb,
+ 0xf900, 0xfa6d,
+ 0xfa70, 0xfad9,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xfb1d, 0xfb28,
+ 0xfb2a, 0xfb36,
+ 0xfb38, 0xfb3c,
+ 0xfb3e, 0xfb3e,
+ 0xfb40, 0xfb41,
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbb1,
+ 0xfbd3, 0xfd3d,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfb,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0xff66, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10140, 0x10174,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x103a0, 0x103c3,
+ 0x103c8, 0x103cf,
+ 0x103d1, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10900, 0x10915,
+ 0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a60, 0x10a7c,
+ 0x10b00, 0x10b35,
+ 0x10b40, 0x10b55,
+ 0x10b60, 0x10b72,
+ 0x10c00, 0x10c48,
+ 0x11000, 0x11045,
+ 0x11082, 0x110b8,
+ 0x110d0, 0x110e8,
+ 0x11100, 0x11132,
+ 0x11180, 0x111bf,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116b5,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f93, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_Alpha */
+
+/* 'Blank': [[:Blank:]] */
+static const OnigCodePoint CR_Blank[] = {
+ 9,
+ 0x0009, 0x0009,
+ 0x0020, 0x0020,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Blank */
+
+/* 'Cntrl': [[:Cntrl:]] */
+static const OnigCodePoint CR_Cntrl[] = {
+ 2,
+ 0x0000, 0x001f,
+ 0x007f, 0x009f,
+}; /* CR_Cntrl */
+
+/* 'Digit': [[:Digit:]] */
+static const OnigCodePoint CR_Digit[] = {
+ 42,
+ 0x0030, 0x0039,
+ 0x0660, 0x0669,
+ 0x06f0, 0x06f9,
+ 0x07c0, 0x07c9,
+ 0x0966, 0x096f,
+ 0x09e6, 0x09ef,
+ 0x0a66, 0x0a6f,
+ 0x0ae6, 0x0aef,
+ 0x0b66, 0x0b6f,
+ 0x0be6, 0x0bef,
+ 0x0c66, 0x0c6f,
+ 0x0ce6, 0x0cef,
+ 0x0d66, 0x0d6f,
+ 0x0e50, 0x0e59,
+ 0x0ed0, 0x0ed9,
+ 0x0f20, 0x0f29,
+ 0x1040, 0x1049,
+ 0x1090, 0x1099,
+ 0x17e0, 0x17e9,
+ 0x1810, 0x1819,
+ 0x1946, 0x194f,
+ 0x19d0, 0x19d9,
+ 0x1a80, 0x1a89,
+ 0x1a90, 0x1a99,
+ 0x1b50, 0x1b59,
+ 0x1bb0, 0x1bb9,
+ 0x1c40, 0x1c49,
+ 0x1c50, 0x1c59,
+ 0xa620, 0xa629,
+ 0xa8d0, 0xa8d9,
+ 0xa900, 0xa909,
+ 0xa9d0, 0xa9d9,
+ 0xaa50, 0xaa59,
+ 0xabf0, 0xabf9,
+ 0xff10, 0xff19,
+ 0x104a0, 0x104a9,
+ 0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
+ 0x1d7ce, 0x1d7ff,
+}; /* CR_Digit */
+
+/* 'Graph': [[:Graph:]] */
+static const OnigCodePoint CR_Graph[] = {
+ 544,
+ 0x0021, 0x007e,
+ 0x00a1, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+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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, 0x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64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x1eef0, 0x1eef1,
+ 0x1f000, 0x1f02b,
+ 0x1f030, 0x1f093,
+ 0x1f0a0, 0x1f0ae,
+ 0x1f0b1, 0x1f0be,
+ 0x1f0c1, 0x1f0cf,
+ 0x1f0d1, 0x1f0df,
+ 0x1f100, 0x1f10a,
+ 0x1f110, 0x1f12e,
+ 0x1f130, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f202,
+ 0x1f210, 0x1f23a,
+ 0x1f240, 0x1f248,
+ 0x1f250, 0x1f251,
+ 0x1f300, 0x1f320,
+ 0x1f330, 0x1f335,
+ 0x1f337, 0x1f37c,
+ 0x1f380, 0x1f393,
+ 0x1f3a0, 0x1f3c4,
+ 0x1f3c6, 0x1f3ca,
+ 0x1f3e0, 0x1f3f0,
+ 0x1f400, 0x1f43e,
+ 0x1f440, 0x1f440,
+ 0x1f442, 0x1f4f7,
+ 0x1f4f9, 0x1f4fc,
+ 0x1f500, 0x1f53d,
+ 0x1f540, 0x1f543,
+ 0x1f550, 0x1f567,
+ 0x1f5fb, 0x1f640,
+ 0x1f645, 0x1f64f,
+ 0x1f680, 0x1f6c5,
+ 0x1f700, 0x1f773,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+ 0xe0001, 0xe0001,
+ 0xe0020, 0xe007f,
+ 0xe0100, 0xe01ef,
+ 0xf0000, 0xffffd,
+ 0x100000, 0x10fffd,
+}; /* CR_Graph */
+
+/* 'Lower': [[:Lower:]] */
+static const OnigCodePoint CR_Lower[] = {
+ 618,
+ 0x0061, 0x007a,
+ 0x00aa, 0x00aa,
+ 0x00b5, 0x00b5,
+ 0x00ba, 0x00ba,
+ 0x00df, 0x00f6,
+ 0x00f8, 0x00ff,
+ 0x0101, 0x0101,
+ 0x0103, 0x0103,
+ 0x0105, 0x0105,
+ 0x0107, 0x0107,
+ 0x0109, 0x0109,
+ 0x010b, 0x010b,
+ 0x010d, 0x010d,
+ 0x010f, 0x010f,
+ 0x0111, 0x0111,
+ 0x0113, 0x0113,
+ 0x0115, 0x0115,
+ 0x0117, 0x0117,
+ 0x0119, 0x0119,
+ 0x011b, 0x011b,
+ 0x011d, 0x011d,
+ 0x011f, 0x011f,
+ 0x0121, 0x0121,
+ 0x0123, 0x0123,
+ 0x0125, 0x0125,
+ 0x0127, 0x0127,
+ 0x0129, 0x0129,
+ 0x012b, 0x012b,
+ 0x012d, 0x012d,
+ 0x012f, 0x012f,
+ 0x0131, 0x0131,
+ 0x0133, 0x0133,
+ 0x0135, 0x0135,
+ 0x0137, 0x0138,
+ 0x013a, 0x013a,
+ 0x013c, 0x013c,
+ 0x013e, 0x013e,
+ 0x0140, 0x0140,
+ 0x0142, 0x0142,
+ 0x0144, 0x0144,
+ 0x0146, 0x0146,
+ 0x0148, 0x0149,
+ 0x014b, 0x014b,
+ 0x014d, 0x014d,
+ 0x014f, 0x014f,
+ 0x0151, 0x0151,
+ 0x0153, 0x0153,
+ 0x0155, 0x0155,
+ 0x0157, 0x0157,
+ 0x0159, 0x0159,
+ 0x015b, 0x015b,
+ 0x015d, 0x015d,
+ 0x015f, 0x015f,
+ 0x0161, 0x0161,
+ 0x0163, 0x0163,
+ 0x0165, 0x0165,
+ 0x0167, 0x0167,
+ 0x0169, 0x0169,
+ 0x016b, 0x016b,
+ 0x016d, 0x016d,
+ 0x016f, 0x016f,
+ 0x0171, 0x0171,
+ 0x0173, 0x0173,
+ 0x0175, 0x0175,
+ 0x0177, 0x0177,
+ 0x017a, 0x017a,
+ 0x017c, 0x017c,
+ 0x017e, 0x0180,
+ 0x0183, 0x0183,
+ 0x0185, 0x0185,
+ 0x0188, 0x0188,
+ 0x018c, 0x018d,
+ 0x0192, 0x0192,
+ 0x0195, 0x0195,
+ 0x0199, 0x019b,
+ 0x019e, 0x019e,
+ 0x01a1, 0x01a1,
+ 0x01a3, 0x01a3,
+ 0x01a5, 0x01a5,
+ 0x01a8, 0x01a8,
+ 0x01aa, 0x01ab,
+ 0x01ad, 0x01ad,
+ 0x01b0, 0x01b0,
+ 0x01b4, 0x01b4,
+ 0x01b6, 0x01b6,
+ 0x01b9, 0x01ba,
+ 0x01bd, 0x01bf,
+ 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9,
+ 0x01cc, 0x01cc,
+ 0x01ce, 0x01ce,
+ 0x01d0, 0x01d0,
+ 0x01d2, 0x01d2,
+ 0x01d4, 0x01d4,
+ 0x01d6, 0x01d6,
+ 0x01d8, 0x01d8,
+ 0x01da, 0x01da,
+ 0x01dc, 0x01dd,
+ 0x01df, 0x01df,
+ 0x01e1, 0x01e1,
+ 0x01e3, 0x01e3,
+ 0x01e5, 0x01e5,
+ 0x01e7, 0x01e7,
+ 0x01e9, 0x01e9,
+ 0x01eb, 0x01eb,
+ 0x01ed, 0x01ed,
+ 0x01ef, 0x01f0,
+ 0x01f3, 0x01f3,
+ 0x01f5, 0x01f5,
+ 0x01f9, 0x01f9,
+ 0x01fb, 0x01fb,
+ 0x01fd, 0x01fd,
+ 0x01ff, 0x01ff,
+ 0x0201, 0x0201,
+ 0x0203, 0x0203,
+ 0x0205, 0x0205,
+ 0x0207, 0x0207,
+ 0x0209, 0x0209,
+ 0x020b, 0x020b,
+ 0x020d, 0x020d,
+ 0x020f, 0x020f,
+ 0x0211, 0x0211,
+ 0x0213, 0x0213,
+ 0x0215, 0x0215,
+ 0x0217, 0x0217,
+ 0x0219, 0x0219,
+ 0x021b, 0x021b,
+ 0x021d, 0x021d,
+ 0x021f, 0x021f,
+ 0x0221, 0x0221,
+ 0x0223, 0x0223,
+ 0x0225, 0x0225,
+ 0x0227, 0x0227,
+ 0x0229, 0x0229,
+ 0x022b, 0x022b,
+ 0x022d, 0x022d,
+ 0x022f, 0x022f,
+ 0x0231, 0x0231,
+ 0x0233, 0x0239,
+ 0x023c, 0x023c,
+ 0x023f, 0x0240,
+ 0x0242, 0x0242,
+ 0x0247, 0x0247,
+ 0x0249, 0x0249,
+ 0x024b, 0x024b,
+ 0x024d, 0x024d,
+ 0x024f, 0x0293,
+ 0x0295, 0x02b8,
+ 0x02c0, 0x02c1,
+ 0x02e0, 0x02e4,
+ 0x0345, 0x0345,
+ 0x0371, 0x0371,
+ 0x0373, 0x0373,
+ 0x0377, 0x0377,
+ 0x037a, 0x037d,
+ 0x0390, 0x0390,
+ 0x03ac, 0x03ce,
+ 0x03d0, 0x03d1,
+ 0x03d5, 0x03d7,
+ 0x03d9, 0x03d9,
+ 0x03db, 0x03db,
+ 0x03dd, 0x03dd,
+ 0x03df, 0x03df,
+ 0x03e1, 0x03e1,
+ 0x03e3, 0x03e3,
+ 0x03e5, 0x03e5,
+ 0x03e7, 0x03e7,
+ 0x03e9, 0x03e9,
+ 0x03eb, 0x03eb,
+ 0x03ed, 0x03ed,
+ 0x03ef, 0x03f3,
+ 0x03f5, 0x03f5,
+ 0x03f8, 0x03f8,
+ 0x03fb, 0x03fc,
+ 0x0430, 0x045f,
+ 0x0461, 0x0461,
+ 0x0463, 0x0463,
+ 0x0465, 0x0465,
+ 0x0467, 0x0467,
+ 0x0469, 0x0469,
+ 0x046b, 0x046b,
+ 0x046d, 0x046d,
+ 0x046f, 0x046f,
+ 0x0471, 0x0471,
+ 0x0473, 0x0473,
+ 0x0475, 0x0475,
+ 0x0477, 0x0477,
+ 0x0479, 0x0479,
+ 0x047b, 0x047b,
+ 0x047d, 0x047d,
+ 0x047f, 0x047f,
+ 0x0481, 0x0481,
+ 0x048b, 0x048b,
+ 0x048d, 0x048d,
+ 0x048f, 0x048f,
+ 0x0491, 0x0491,
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2ce1,
+ 0x2ce3, 0x2ce4,
+ 0x2cec, 0x2cec,
+ 0x2cee, 0x2cee,
+ 0x2cf3, 0x2cf3,
+ 0x2d00, 0x2d25,
+ 0x2d27, 0x2d27,
+ 0x2d2d, 0x2d2d,
+ 0xa641, 0xa641,
+ 0xa643, 0xa643,
+ 0xa645, 0xa645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,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e,
+ 0x1d750, 0x1d755,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d78f,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7c9,
+ 0x1d7cb, 0x1d7cb,
+}; /* CR_Lower */
+
+/* 'Print': [[:Print:]] */
+static const OnigCodePoint CR_Print[] = {
+ 541,
+ 0x0020, 0x007e,
+ 0x00a0, 0x0377,
+ 0x037a, 0x037e,
+ 0x0384, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x055f,
+ 0x0561, 0x0587,
+ 0x0589, 0x058a,
+ 0x058f, 0x058f,
+ 0x0591, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f4,
+ 0x0600, 0x0604,
+ 0x0606, 0x061b,
+ 0x061e, 0x070d,
+ 0x070f, 0x074a,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07fa,
+ 0x0800, 0x082d,
+ 0x0830, 0x083e,
+ 0x0840, 0x085b,
+ 0x085e, 0x085e,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08fe,
+ 0x0900, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bc, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09fb,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 0x0a30,
+ 0x0a32, 0x0a33,
+ 0x0a35, 0x0a36,
+ 0x0a38, 0x0a39,
+ 0x0a3c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x0ead, 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,
+ 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
+ 0xfb43, 0xfb44,
+ 0xfb46, 0xfbc1,
+ 0xfbd3, 0xfd3f,
+ 0xfd50, 0xfd8f,
+ 0xfd92, 0xfdc7,
+ 0xfdf0, 0xfdfd,
+ 0xfe00, 0xfe19,
+ 0xfe20, 0xfe26,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe66,
+ 0xfe68, 0xfe6b,
+ 0xfe70, 0xfe74,
+ 0xfe76, 0xfefc,
+ 0xfeff, 0xfeff,
+ 0xff01, 0xffbe,
+ 0xffc2, 0xffc7,
+ 0xffca, 0xffcf,
+ 0xffd2, 0xffd7,
+ 0xffda, 0xffdc,
+ 0xffe0, 0xffe6,
+ 0xffe8, 0xffee,
+ 0xfff9, 0xfffd,
+ 0x10000, 0x1000b,
+ 0x1000d, 0x10026,
+ 0x10028, 0x1003a,
+ 0x1003c, 0x1003d,
+ 0x1003f, 0x1004d,
+ 0x10050, 0x1005d,
+ 0x10080, 0x100fa,
+ 0x10100, 0x10102,
+ 0x10107, 0x10133,
+ 0x10137, 0x1018a,
+ 0x10190, 0x1019b,
+ 0x101d0, 0x101fd,
+ 0x10280, 0x1029c,
+ 0x102a0, 0x102d0,
+ 0x10300, 0x1031e,
+ 0x10320, 0x10323,
+ 0x10330, 0x1034a,
+ 0x10380, 0x1039d,
+ 0x1039f, 0x103c3,
+ 0x103c8, 0x103d5,
+ 0x10400, 0x1049d,
+ 0x104a0, 0x104a9,
+ 0x10800, 0x10805,
+ 0x10808, 0x10808,
+ 0x1080a, 0x10835,
+ 0x10837, 0x10838,
+ 0x1083c, 0x1083c,
+ 0x1083f, 0x10855,
+ 0x10857, 0x1085f,
+ 0x10900, 0x1091b,
+ 0x1091f, 0x10939,
+ 0x1093f, 0x1093f,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
+ 0x10a00, 0x10a03,
+ 0x10a05, 0x10a06,
+ 0x10a0c, 0x10a13,
+ 0x10a15, 0x10a17,
+ 0x10a19, 0x10a33,
+ 0x10a38, 0x10a3a,
+ 0x10a3f, 0x10a47,
+ 0x10a50, 0x10a58,
+ 0x10a60, 0x10a7f,
+ 0x10b00, 0x10b35,
+ 0x10b39, 0x10b55,
+ 0x10b58, 0x10b72,
+ 0x10b78, 0x10b7f,
+ 0x10c00, 0x10c48,
+ 0x10e60, 0x10e7e,
+ 0x11000, 0x1104d,
+ 0x11052, 0x1106f,
+ 0x11080, 0x110c1,
+ 0x110d0, 0x110e8,
+ 0x110f0, 0x110f9,
+ 0x11100, 0x11134,
+ 0x11136, 0x11143,
+ 0x11180, 0x111c8,
+ 0x111d0, 0x111d9,
+ 0x11680, 0x116b7,
+ 0x116c0, 0x116c9,
+ 0x12000, 0x1236e,
+ 0x12400, 0x12462,
+ 0x12470, 0x12473,
+ 0x13000, 0x1342e,
+ 0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f50, 0x16f7e,
+ 0x16f8f, 0x16f9f,
+ 0x1b000, 0x1b001,
+ 0x1d000, 0x1d0f5,
+ 0x1d100, 0x1d126,
+ 0x1d129, 0x1d1dd,
+ 0x1d200, 0x1d245,
+ 0x1d300, 0x1d356,
+ 0x1d360, 0x1d371,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1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
+ 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,
+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xa60f,
+ 0xa673, 0xa673,
+ 0xa67e, 0xa67e,
+ 0xa6f2, 0xa6f7,
+ 0xa874, 0xa877,
+ 0xa8ce, 0xa8cf,
+ 0xa8f8, 0xa8fa,
+ 0xa92e, 0xa92f,
+ 0xa95f, 0xa95f,
+ 0xa9c1, 0xa9cd,
+ 0xa9de, 0xa9df,
+ 0xaa5c, 0xaa5f,
+ 0xaade, 0xaadf,
+ 0xaaf0, 0xaaf1,
+ 0xabeb, 0xabeb,
+ 0xfd3e, 0xfd3f,
+ 0xfe10, 0xfe19,
+ 0xfe30, 0xfe52,
+ 0xfe54, 0xfe61,
+ 0xfe63, 0xfe63,
+ 0xfe68, 0xfe68,
+ 0xfe6a, 0xfe6b,
+ 0xff01, 0xff03,
+ 0xff05, 0xff0a,
+ 0xff0c, 0xff0f,
+ 0xff1a, 0xff1b,
+ 0xff1f, 0xff20,
+ 0xff3b, 0xff3d,
+ 0xff3f, 0xff3f,
+ 0xff5b, 0xff5b,
+ 0xff5d, 0xff5d,
+ 0xff5f, 0xff65,
+ 0x10100, 0x10102,
+ 0x1039f, 0x1039f,
+ 0x103d0, 0x103d0,
+ 0x10857, 0x10857,
+ 0x1091f, 0x1091f,
+ 0x1093f, 0x1093f,
+ 0x10a50, 0x10a58,
+ 0x10a7f, 0x10a7f,
+ 0x10b39, 0x10b3f,
+ 0x11047, 0x1104d,
+ 0x110bb, 0x110bc,
+ 0x110be, 0x110c1,
+ 0x11140, 0x11143,
+ 0x111c5, 0x111c8,
+ 0x12470, 0x12473,
+}; /* CR_Punct */
+
+/* 'Space': [[:Space:]] */
+static const OnigCodePoint CR_Space[] = {
+ 11,
+ 0x0009, 0x000d,
+ 0x0020, 0x0020,
+ 0x0085, 0x0085,
+ 0x00a0, 0x00a0,
+ 0x1680, 0x1680,
+ 0x180e, 0x180e,
+ 0x2000, 0x200a,
+ 0x2028, 0x2029,
+ 0x202f, 0x202f,
+ 0x205f, 0x205f,
+ 0x3000, 0x3000,
+}; /* CR_Space */
+
+/* 'Upper': [[:Upper:]] */
+static const OnigCodePoint CR_Upper[] = {
+ 610,
+ 0x0041, 0x005a,
+ 0x00c0, 0x00d6,
+ 0x00d8, 0x00de,
+ 0x0100, 0x0100,
+ 0x0102, 0x0102,
+ 0x0104, 0x0104,
+ 0x0106, 0x0106,
+ 0x0108, 0x0108,
+ 0x010a, 0x010a,
+ 0x010c, 0x010c,
+ 0x010e, 0x010e,
+ 0x0110, 0x0110,
+ 0x0112, 0x0112,
+ 0x0114, 0x0114,
+ 0x0116, 0x0116,
+ 0x0118, 0x0118,
+ 0x011a, 0x011a,
+ 0x011c, 0x011c,
+ 0x011e, 0x011e,
+ 0x0120, 0x0120,
+ 0x0122, 0x0122,
+ 0x0124, 0x0124,
+ 0x0126, 0x0126,
+ 0x0128, 0x0128,
+ 0x012a, 0x012a,
+ 0x012c, 0x012c,
+ 0x012e, 0x012e,
+ 0x0130, 0x0130,
+ 0x0132, 0x0132,
+ 0x0134, 0x0134,
+ 0x0136, 0x0136,
+ 0x0139, 0x0139,
+ 0x013b, 0x013b,
+ 0x013d, 0x013d,
+ 0x013f, 0x013f,
+ 0x0141, 0x0141,
+ 0x0143, 0x0143,
+ 0x0145, 0x0145,
+ 0x0147, 0x0147,
+ 0x014a, 0x014a,
+ 0x014c, 0x014c,
+ 0x014e, 0x014e,
+ 0x0150, 0x0150,
+ 0x0152, 0x0152,
+ 0x0154, 0x0154,
+ 0x0156, 0x0156,
+ 0x0158, 0x0158,
+ 0x015a, 0x015a,
+ 0x015c, 0x015c,
+ 0x015e, 0x015e,
+ 0x0160, 0x0160,
+ 0x0162, 0x0162,
+ 0x0164, 0x0164,
+ 0x0166, 0x0166,
+ 0x0168, 0x0168,
+ 0x016a, 0x016a,
+ 0x016c, 0x016c,
+ 0x016e, 0x016e,
+ 0x0170, 0x0170,
+ 0x0172, 0x0172,
+ 0x0174, 0x0174,
+ 0x0176, 0x0176,
+ 0x0178, 0x0179,
+ 0x017b, 0x017b,
+ 0x017d, 0x017d,
+ 0x0181, 0x0182,
+ 0x0184, 0x0184,
+ 0x0186, 0x0187,
+ 0x0189, 0x018b,
+ 0x018e, 0x0191,
+ 0x0193, 0x0194,
+ 0x0196, 0x0198,
+ 0x019c, 0x019d,
+ 0x019f, 0x01a0,
+ 0x01a2, 0x01a2,
+ 0x01a4, 0x01a4,
+ 0x01a6, 0x01a7,
+ 0x01a9, 0x01a9,
+ 0x01ac, 0x01ac,
+ 0x01ae, 0x01af,
+ 0x01b1, 0x01b3,
+ 0x01b5, 0x01b5,
+ 0x01b7, 0x01b8,
+ 0x01bc, 0x01bc,
+ 0x01c4, 0x01c4,
+ 0x01c7, 0x01c7,
+ 0x01ca, 0x01ca,
+ 0x01cd, 0x01cd,
+ 0x01cf, 0x01cf,
+ 0x01d1, 0x01d1,
+ 0x01d3, 0x01d3,
+ 0x01d5, 0x01d5,
+ 0x01d7, 0x01d7,
+ 0x01d9, 0x01d9,
+ 0x01db, 0x01db,
+ 0x01de, 0x01de,
+ 0x01e0, 0x01e0,
+ 0x01e2, 0x01e2,
+ 0x01e4, 0x01e4,
+ 0x01e6, 0x01e6,
+ 0x01e8, 0x01e8,
+ 0x01ea, 0x01ea,
+ 0x01ec, 0x01ec,
+ 0x01ee, 0x01ee,
+ 0x01f1, 0x01f1,
+ 0x01f4, 0x01f4,
+ 0x01f6, 0x01f8,
+ 0x01fa, 0x01fa,
+ 0x01fc, 0x01fc,
+ 0x01fe, 0x01fe,
+ 0x0200, 0x0200,
+ 0x0202, 0x0202,
+ 0x0204, 0x0204,
+ 0x0206, 0x0206,
+ 0x0208, 0x0208,
+ 0x020a, 0x020a,
+ 0x020c, 0x020c,
+ 0x020e, 0x020e,
+ 0x0210, 0x0210,
+ 0x0212, 0x0212,
+ 0x0214, 0x0214,
+ 0x0216, 0x0216,
+ 0x0218, 0x0218,
+ 0x021a, 0x021a,
+ 0x021c, 0x021c,
+ 0x021e, 0x021e,
+ 0x0220, 0x0220,
+ 0x0222, 0x0222,
+ 0x0224, 0x0224,
+ 0x0226, 0x0226,
+ 0x0228, 0x0228,
+ 0x022a, 0x022a,
+ 0x022c, 0x022c,
+ 0x022e, 0x022e,
+ 0x0230, 0x0230,
+ 0x0232, 0x0232,
+ 0x023a, 0x023b,
+ 0x023d, 0x023e,
+ 0x0241, 0x0241,
+ 0x0243, 0x0246,
+ 0x0248, 0x0248,
+ 0x024a, 0x024a,
+ 0x024c, 0x024c,
+ 0x024e, 0x024e,
+ 0x0370, 0x0370,
+ 0x0372, 0x0372,
+ 0x0376, 0x0376,
+ 0x0386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x038f,
+ 0x0391, 0x03a1,
+ 0x03a3, 0x03ab,
+ 0x03cf, 0x03cf,
+ 0x03d2, 0x03d4,
+ 0x03d8, 0x03d8,
+ 0x03da, 0x03da,
+ 0x03dc, 0x03dc,
+ 0x03de, 0x03de,
+ 0x03e0, 0x03e0,
+ 0x03e2, 0x03e2,
+ 0x03e4, 0x03e4,
+ 0x03e6, 0x03e6,
+ 0x03e8, 0x03e8,
+ 0x03ea, 0x03ea,
+ 0x03ec, 0x03ec,
+ 0x03ee, 0x03ee,
+ 0x03f4, 0x03f4,
+ 0x03f7, 0x03f7,
+ 0x03f9, 0x03fa,
+ 0x03fd, 0x042f,
+ 0x0460, 0x0460,
+ 0x0462, 0x0462,
+ 0x0464, 0x0464,
+ 0x0466, 0x0466,
+ 0x0468, 0x0468,
+ 0x046a, 0x046a,
+ 0x046c, 0x046c,
+ 0x046e, 0x046e,
+ 0x0470, 0x0470,
+ 0x0472, 0x0472,
+ 0x0474, 0x0474,
+ 0x0476, 0x0476,
+ 0x0478, 0x0478,
+ 0x047a, 0x047a,
+ 0x047c, 0x047c,
+ 0x047e, 0x047e,
+ 0x0480, 0x0480,
+ 0x048a, 0x048a,
+ 0x048c, 0x048c,
+ 0x048e, 0x048e,
+ 0x0490, 0x0490,
+ 0x0492, 0x0492,
+ 0x0494, 0x0494,
+ 0x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
+ 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,
+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+
+/* '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,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 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,
+ 0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386, 0x0386,
+ 0x0388, 0x038a,
+ 0x038c, 0x038c,
+ 0x038e, 0x03a1,
+ 0x03a3, 0x03f5,
+ 0x03f7, 0x0481,
+ 0x048a, 0x0527,
+ 0x0531, 0x0556,
+ 0x0559, 0x0559,
+ 0x0561, 0x0587,
+ 0x05b0, 0x05bd,
+ 0x05bf, 0x05bf,
+ 0x05c1, 0x05c2,
+ 0x05c4, 0x05c5,
+ 0x05c7, 0x05c7,
+ 0x05d0, 0x05ea,
+ 0x05f0, 0x05f2,
+ 0x0610, 0x061a,
+ 0x0620, 0x0657,
+ 0x0659, 0x0669,
+ 0x066e, 0x06d3,
+ 0x06d5, 0x06dc,
+ 0x06e1, 0x06e8,
+ 0x06ed, 0x06fc,
+ 0x06ff, 0x06ff,
+ 0x0710, 0x073f,
+ 0x074d, 0x07b1,
+ 0x07c0, 0x07ea,
+ 0x07f4, 0x07f5,
+ 0x07fa, 0x07fa,
+ 0x0800, 0x0817,
+ 0x081a, 0x082c,
+ 0x0840, 0x0858,
+ 0x08a0, 0x08a0,
+ 0x08a2, 0x08ac,
+ 0x08e4, 0x08e9,
+ 0x08f0, 0x08fe,
+ 0x0900, 0x093b,
+ 0x093d, 0x094c,
+ 0x094e, 0x0950,
+ 0x0955, 0x0963,
+ 0x0966, 0x096f,
+ 0x0971, 0x0977,
+ 0x0979, 0x097f,
+ 0x0981, 0x0983,
+ 0x0985, 0x098c,
+ 0x098f, 0x0990,
+ 0x0993, 0x09a8,
+ 0x09aa, 0x09b0,
+ 0x09b2, 0x09b2,
+ 0x09b6, 0x09b9,
+ 0x09bd, 0x09c4,
+ 0x09c7, 0x09c8,
+ 0x09cb, 0x09cc,
+ 0x09ce, 0x09ce,
+ 0x09d7, 0x09d7,
+ 0x09dc, 0x09dd,
+ 0x09df, 0x09e3,
+ 0x09e6, 0x09f1,
+ 0x0a01, 0x0a03,
+ 0x0a05, 0x0a0a,
+ 0x0a0f, 0x0a10,
+ 0x0a13, 0x0a28,
+ 0x0a2a, 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0e9f,
+ 0x0ea1, 0x0ea3,
+ 0x0ea5, 0x0ea5,
+ 0x0ea7, 0x0ea7,
+ 0x0eaa, 0x0eab,
+ 0x0ead, 0x0eb9,
+ 0x0ebb, 0x0ebd,
+ 0x0ec0, 0x0ec4,
+ 0x0ec6, 0x0ec6,
+ 0x0ecd, 0x0ecd,
+ 0x0ed0, 0x0ed9,
+ 0x0edc, 0x0edf,
+ 0x0f00, 0x0f00,
+ 0x0f20, 0x0f29,
+ 0x0f40, 0x0f47,
+ 0x0f49, 0x0f6c,
+ 0x0f71, 0x0f81,
+ 0x0f88, 0x0f97,
+ 0x0f99, 0x0fbc,
+ 0x1000, 0x1036,
+ 0x1038, 0x1038,
+ 0x103b, 0x1049,
+ 0x1050, 0x1062,
+ 0x1065, 0x1068,
+ 0x106e, 0x1086,
+ 0x108e, 0x108e,
+ 0x1090, 0x1099,
+ 0x109c, 0x109d,
+ 0x10a0, 0x10c5,
+ 0x10c7, 0x10c7,
+ 0x10cd, 0x10cd,
+ 0x10d0, 0x10fa,
+ 0x10fc, 0x1248,
+ 0x124a, 0x124d,
+ 0x1250, 0x1256,
+ 0x1258, 0x1258,
+ 0x125a, 0x125d,
+ 0x1260, 0x1288,
+ 0x128a, 0x128d,
+ 0x1290, 0x12b0,
+ 0x12b2, 0x12b5,
+ 0x12b8, 0x12be,
+ 0x12c0, 0x12c0,
+ 0x12c2, 0x12c5,
+ 0x12c8, 0x12d6,
+ 0x12d8, 0x1310,
+ 0x1312, 0x1315,
+ 0x1318, 0x135a,
+ 0x135f, 0x135f,
+ 0x1380, 0x138f,
+ 0x13a0, 0x13f4,
+ 0x1401, 0x166c,
+ 0x166f, 0x167f,
+ 0x1681, 0x169a,
+ 0x16a0, 0x16ea,
+ 0x16ee, 0x16f0,
+ 0x1700, 0x170c,
+ 0x170e, 0x1713,
+ 0x1720, 0x1733,
+ 0x1740, 0x1753,
+ 0x1760, 0x176c,
+ 0x176e, 0x1770,
+ 0x1772, 0x1773,
+ 0x1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 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, 0x1d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c, 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, 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,
+ 0x09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ab16,
+ 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,
+ 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,
+ 0x1d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x1f100, 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, 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, 0x07b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e, 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, 0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f': 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,
+ 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,
+ 0x0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,
+ 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,
+ 0x1d51d, 0x1d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f203, 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,
+ 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,
+ 0x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005d,
+ 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,
+ 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, 0x1d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
+ 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,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a645,
+ 0xa647, 0xa647,
+ 0xa649, 0xa649,
+ 0xa64b, 0xa64b,
+ 0xa64d, 0xa64d,
+ 0xa64f, 0xa64f,
+ 0xa651, 0xa651,
+ 0xa653, 0xa653,
+ 0xa655, 0xa655,
+ 0xa657, 0xa657,
+ 0xa659, 0xa659,
+ 0xa65b, 0xa65b,
+ 0xa65d, 0xa65d,
+ 0xa65f, 0xa65f,
+ 0xa661, 0xa661,
+ 0xa663, 0xa663,
+ 0xa665, 0xa665,
+ 0xa667, 0xa667,
+ 0xa669, 0xa669,
+ 0xa66b, 0xa66b,
+ 0xa66d, 0xa66d,
+ 0xa681, 0xa681,
+ 0xa683, 0xa683,
+ 0xa685, 0xa685,
+ 0xa687, 0xa687,
+ 0xa689, 0xa689,
+ 0xa68b, 0xa68b,
+ 0xa68d, 0xa68d,
+ 0xa68f, 0xa68f,
+ 0xa691, 0xa691,
+ 0xa693, 0xa693,
+ 0xa695, 0xa695,
+ 0xa697, 0xa697,
+ 0xa723, 0xa723,
+ 0xa725, 0xa725,
+ 0xa727, 0xa727,
+ 0xa729, 0xa729,
+ 0xa72b, 0xa72b,
+ 0xa72d, 0xa72d,
+ 0xa72f, 0xa731,
+ 0xa733, 0xa733,
+ 0xa735, 0xa735,
+ 0xa737, 0xa737,
+ 0xa739, 0xa739,
+ 0xa73b, 0xa73b,
+ 0xa73d, 0xa73d,
+ 0xa73f, 0xa73f,
+ 0xa741, 0xa741,
+ 0xa743, 0xa743,
+ 0xa745, 0xa745,
+ 0xa747, 0xa747,
+ 0xa749, 0xa749,
+ 0xa74b, 0xa74b,
+ 0xa74d, 0xa74d,
+ 0xa74f, 0xa74f,
+ 0xa751, 0xa751,
+ 0xa753, 0xa753,
+ 0xa755, 0xa755,
+ 0xa757, 0xa757,
+ 0xa759, 0xa759,
+ 0xa75b, 0xa75b,
+ 0xa75d, 0xa75d,
+ 0xa75f, 0xa75f,
+ 0xa761, 0xa761,
+ 0xa763, 0xa763,
+ 0xa765, 0xa765,
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ePoint 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, 0x0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, 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,
+ 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, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x1a20, 0x1a54,
+ 0x1b05, 0x1b33,
+ 0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, 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, 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, 0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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, 0x082d,
+ 0x0859, 0x085b,
+ 0x08e4, 0x08fe,
+ 0x0900, 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,
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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,
+ 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, 0x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 0x1a72,
+ 0x1b04, 0x1b04,
+ 0x1b35, 0x1b35,
+ 0x1b3b, 0x1b3b,
+ 0x1b3d, 0x1b41,
+ 0x1b43, 0x1b44,
+ 0x1b82, 0x1b82,
+ 0x1ba1, 0x1ba1,
+ 0x1ba6, 0x1ba7,
+ 0x1baa, 0x1baa,
+ 0x1bac, 0x1bad,
+ 0x1be7, 0x1be7,
+ 0x1bea, 0x1bec,
+ 0x1bee, 0x1bee,
+ 0x1bf2, 0x1bf3,
+ 0x1c24, 0x1c2b,
+ 0x1c34, 0x1c35,
+ 0x1ce1, 0x1ce1,
+ 0x1cf2, 0x1cf3,
+ 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,
+ 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,
+ 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,
+ 0x0a4b, 0x0a4d,
+ 0x0a51, 0x0a51,
+ 0x0a70, 0x0a71,
+ 0x0a75, 0x0a75,
+ 0x0a81, 0x0a82,
+ 0x0abc, 0x0abc,
+ 0x0ac1, 0x0ac5,
+ 0x0ac7, 0x0ac8,
+ 0x0acd, 0x0acd,
+ 0x0ae2, 0x0ae3,
+ 0x0b01, 0x0b01,
+ 0x0b3c, 0x0b3c,
+ 0x0b3f, 0x0b3f,
+ 0x0b41, 0x0b44,
+ 0x0b4d, 0x0b4d,
+ 0x0b56, 0x0b56,
+ 0x0b62, 0x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
+ 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,
+ 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,
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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, 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
+ 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, 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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fb, 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, 0x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 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,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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,
+ 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, 0x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a,
+ 0xa7f8, 0xa7fa,
+ 0xfb00, 0xfb06,
+ 0xfb13, 0xfb17,
+ 0xff21, 0xff3a,
+ 0xff41, 0xff5a,
+ 0x10400, 0x1044f,
+ 0x1d400, 0x1d454,
+ 0x1d456, 0x1d49c,
+ 0x1d49e, 0x1d49f,
+ 0x1d4a2, 0x1d4a2,
+ 0x1d4a5, 0x1d4a6,
+ 0x1d4a9, 0x1d4ac,
+ 0x1d4ae, 0x1d4b9,
+ 0x1d4bb, 0x1d4bb,
+ 0x1d4bd, 0x1d4c3,
+ 0x1d4c5, 0x1d505,
+ 0x1d507, 0x1d50a,
+ 0x1d50d, 0x1d514,
+ 0x1d516, 0x1d51c,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+}; /* CR_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, 0x05b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,
+ 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, 0x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a692,
+ 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,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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_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,
+ 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, 0x1e01,
+ 0x1e03, 0x1e03,
+ 0x1e05, 0x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669,
+ 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,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 0x2cd6,
+ 0x2cd8, 0x2cd8,
+ 0x2cda, 0x2cda,
+ 0x2cdc, 0x2cdc,
+ 0x2cde, 0x2cde,
+ 0x2ce0, 0x2ce0,
+ 0x2ce2, 0x2ce2,
+ 0x2ceb, 0x2ceb,
+ 0x2ced, 0x2ced,
+ 0x2cf2, 0x2cf2,
+ 0xa640, 0xa640,
+ 0xa642, 0xa642,
+ 0xa644, 0xa644,
+ 0xa646, 0xa646,
+ 0xa648, 0xa648,
+ 0xa64a, 0xa64a,
+ 0xa64c, 0xa64c,
+ 0xa64e, 0xa64e,
+ 0xa650, 0xa650,
+ 0xa652, 0xa652,
+ 0xa654, 0xa654,
+ 0xa656, 0xa656,
+ 0xa658, 0xa658,
+ 0xa65a, 0xa65a,
+ 0xa65c, 0xa65c,
+ 0xa65e, 0xa65e,
+ 0xa660, 0xa660,
+ 0xa662, 0xa662,
+ 0xa664, 0xa664,
+ 0xa666, 0xa666,
+ 0xa668, 0xa668,
+ 0xa66a, 0xa66a,
+ 0xa66c, 0xa66c,
+ 0xa680, 0xa680,
+ 0xa682, 0xa682,
+ 0xa684, 0xa684,
+ 0xa686, 0xa686,
+ 0xa688, 0xa688,
+ 0xa68a, 0xa68a,
+ 0xa68c, 0xa68c,
+ 0xa68e, 0xa68e,
+ 0xa690, 0xa690,
+ 0xa692, 0xa692,
+ 0xa694, 0xa694,
+ 0xa696, 0xa696,
+ 0xa722, 0xa722,
+ 0xa724, 0xa724,
+ 0xa726, 0xa726,
+ 0xa728, 0xa728,
+ 0xa72a, 0xa72a,
+ 0xa72c, 0xa72c,
+ 0xa72e, 0xa72e,
+ 0xa732, 0xa732,
+ 0xa734, 0xa734,
+ 0xa736, 0xa736,
+ 0xa738, 0xa738,
+ 0xa73a, 0xa73a,
+ 0xa73c, 0xa73c,
+ 0xa73e, 0xa73e,
+ 0xa740, 0xa740,
+ 0xa742, 0xa742,
+ 0xa744, 0xa744,
+ 0xa746, 0xa746,
+ 0xa748, 0xa748,
+ 0xa74a, 0xa74a,
+ 0xa74c, 0xa74c,
+ 0xa74e, 0xa74e,
+ 0xa750, 0xa750,
+ 0xa752, 0xa752,
+ 0xa754, 0xa754,
+ 0xa756, 0xa756,
+ 0xa758, 0xa758,
+ 0xa75a, 0xa75a,
+ 0xa75c, 0xa75c,
+ 0xa75e, 0xa75e,
+ 0xa760, 0xa760,
+ 0xa762, 0xa762,
+ 0xa764, 0xa764,
+ 0xa766, 0xa766,
+ 0xa768, 0xa768,
+ 0xa76a, 0xa76a,
+ 0xa76c, 0xa76c,
+ 0xa76e, 0xa76e,
+ 0xa779, 0xa779,
+ 0xa77b, 0xa77b,
+ 0xa77d, 0xa77e,
+ 0xa780, 0xa780,
+ 0xa782, 0xa782,
+ 0xa784, 0xa784,
+ 0xa786, 0xa786,
+ 0xa78b, 0xa78b,
+ 0xa78d, 0xa78d,
+ 0xa790, 0xa790,
+ 0xa792, 0xa792,
+ 0xa7a0, 0xa7a0,
+ 0xa7a2, 0xa7a2,
+ 0xa7a4, 0xa7a4,
+ 0xa7a6, 0xa7a6,
+ 0xa7a8, 0xa7a8,
+ 0xa7aa, 0xa7aa,
+ 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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2c00, 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,
+ 0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, 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,
+ 0x1900, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x1a20, 0x1a54,
+ 0x1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 0xaaf4,
+ 0xab01, 0xab06,
+ 0xab09, 0xab0e,
+ 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,
+ 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,
+ 0x1d51e, 0x1d539,
+ 0x1d53b, 0x1d53e,
+ 0x1d540, 0x1d544,
+ 0x1d546, 0x1d546,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_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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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, 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,
+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280, 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,
+ 0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
+ 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,
+ 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,
+ 0x0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,
+ 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,
+ 0x1900, 0x191c,
+ 0x1950, 0x196d,
+ 0x1970, 0x1974,
+ 0x1980, 0x19ab,
+ 0x19c1, 0x19c7,
+ 0x1a00, 0x1a16,
+ 0x1a20, 0x1a54,
+ 0x1aa7, 0x1aa7,
+ 0x1b05, 0x1b33,
+ 0x1b45, 0x1b4b,
+ 0x1b83, 0x1ba0,
+ 0x1bae, 0x1baf,
+ 0x1bba, 0x1be5,
+ 0x1c00, 0x1c23,
+ 0x1c4d, 0x1c4f,
+ 0x1c5a, 0x1c7d,
+ 0x1ce9, 0x1cec,
+ 0x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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, 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,
+ 0x1d54a, 0x1d550,
+ 0x1d552, 0x1d6a5,
+ 0x1d6a8, 0x1d6c0,
+ 0x1d6c2, 0x1d6da,
+ 0x1d6dc, 0x1d6fa,
+ 0x1d6fc, 0x1d714,
+ 0x1d716, 0x1d734,
+ 0x1d736, 0x1d74e,
+ 0x1d750, 0x1d76e,
+ 0x1d770, 0x1d788,
+ 0x1d78a, 0x1d7a8,
+ 0x1d7aa, 0x1d7c2,
+ 0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee24, 0x1ee24,
+ 0x1ee27, 0x1ee27,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee39, 0x1ee39,
+ 0x1ee3b, 0x1ee3b,
+ 0x1ee42, 0x1ee42,
+ 0x1ee47, 0x1ee47,
+ 0x1ee49, 0x1ee49,
+ 0x1ee4b, 0x1ee4b,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee54, 0x1ee54,
+ 0x1ee57, 0x1ee57,
+ 0x1ee59, 0x1ee59,
+ 0x1ee5b, 0x1ee5b,
+ 0x1ee5d, 0x1ee5d,
+ 0x1ee5f, 0x1ee5f,
+ 0x1ee61, 0x1ee62,
+ 0x1ee64, 0x1ee64,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee7e, 0x1ee7e,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
+ 0x20000, 0x2a6d6,
+ 0x2a700, 0x2b734,
+ 0x2b740, 0x2b81d,
+ 0x2f800, 0x2fa1d,
+}; /* CR_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,
+ 0x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
+ 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, 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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+ 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,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ee64, 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, 0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,
+ 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,
+ 0x0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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, 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, 0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, 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,
+ 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,
+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 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,
+ 0x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1d51c,
+ 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, 0x1f16b,
+ 0x1f170, 0x1f19a,
+ 0x1f1e6, 0x1f1ff,
+ 0x1f201, 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,
+ 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, 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,
+ 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, 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1ee74, 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,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 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,
+ 0x18a9, 0x18a9,
+ 0x1920, 0x192b,
+ 0x1930, 0x1938,
+ 0x19b0, 0x19c0,
+ 0x19c8, 0x19c9,
+ 0x1a17, 0x1a1b,
+ 0x1a55, 0x1a5e,
+ 0x1a61, 0x1a74,
+ 0x1b00, 0x1b04,
+ 0x1b35, 0x1b43,
+ 0x1b80, 0x1b82,
+ 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, 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,
+ 0x08e4, 0x08fe,
+ 0x093c, 0x093c,
+ 0x094d, 0x094d,
+ 0x0951, 0x0954,
+ 0x0971, 0x0971,
+ 0x09bc, 0x09bc,
+ 0x09cd, 0x09cd,
+ 0x0a3c, 0x0a3c,
+ 0x0a4d, 0x0a4d,
+ 0x0abc, 0x0abc,
+ 0x0acd, 0x0acd,
+ 0x0b3c, 0x0b3c,
+ 0x0b4d, 0x0b4d,
+ 0x0b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a8f1,
+ 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,
+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c8, 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,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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,
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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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 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,
+ 0x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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,
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
+ 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, 0x0a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f71, 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,
+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 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,
+ 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+ 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,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e, 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, 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 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,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1003d,
+ 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,
+ 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 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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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, 0x09b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xfb43, 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,
+ 0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, 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,
+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004d,
+ 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,
+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fd,
+ 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,
+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xffdc,
+ 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, 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618, 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,
+ 0x08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,
+ 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,
+ 0x1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b,
+ 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 */
+
+/* '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
index d2cf7b16bc..cb8e2233a2 100644
--- a/enc/windows_1250.c
+++ b/enc/windows_1250.c
@@ -1,5 +1,5 @@
/**********************************************************************
- windows_1250.c - Oniguruma (regular expression library)
+ cp1250.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
@@ -29,7 +29,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_CP1250_TO_LOWER_CASE(c) EncCP1250_ToLowerCaseTable[c]
#define ENC_IS_CP1250_CTYPE(code,ctype) \
@@ -102,7 +101,7 @@ static const unsigned short EncCP1250_CtypeTable[256] = {
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,
+ 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2,
};
static int
@@ -190,56 +189,6 @@ cp1250_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 ((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 */
@@ -257,7 +206,6 @@ OnigEncodingDefine(windows_1250, Windows_1250) = {
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,
};
@@ -269,3 +217,4 @@ OnigEncodingDefine(windows_1250, Windows_1250) = {
* 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
index 5f90c15601..85f2cfbc25 100644
--- a/enc/windows_1252.c
+++ b/enc/windows_1252.c
@@ -1,5 +1,5 @@
/**********************************************************************
- windows_1252.c - Oniguruma (regular expression library)
+ cp1252.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
* Copyright (c) 2006-2007 Byte <byte AT mail DOT kna DOT ru>
@@ -29,7 +29,6 @@
*/
#include "regenc.h"
-#include "iso_8859.h"
#define ENC_CP1252_TO_LOWER_CASE(c) EncCP1252_ToLowerCaseTable[c]
#define ENC_IS_CP1252_CTYPE(code,ctype) \
@@ -115,6 +114,7 @@ cp1252_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
(*pp)++;
return 1;
}
+
static int
cp1252_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
{
@@ -181,54 +181,6 @@ cp1252_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 ((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 */
@@ -246,7 +198,6 @@ OnigEncodingDefine(windows_1252, Windows_1252) = {
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_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 c0a3613f1b..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/service/developer/make/content/pictograph/basic/index.html
- * Link: https://www.nttdocomo.co.jp/service/developer/make/content/pictograph/extent%69on/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 69015cc8fd..07b32f5f83 100644
--- a/encoding.c
+++ b/encoding.c
@@ -9,20 +9,11 @@
**********************************************************************/
-#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(expr) RUBY_ASSERT_WHEN(ENC_DEBUG, expr)
-#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
@@ -66,6 +57,8 @@ static struct {
#define ENC_DUMMY_P(enc) ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
#define ENC_SET_DUMMY(enc) ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
+void rb_enc_init(void);
+
#define ENCODING_COUNT ENCINDEX_BUILTIN_MAX
#define UNSPECIFIED_ENCODING INT_MAX
@@ -85,12 +78,6 @@ static const rb_data_type_t encoding_data_type = {
#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)
{
@@ -258,6 +245,11 @@ rb_find_encoding(VALUE enc)
return rb_enc_from_index(idx);
}
+void
+rb_gc_mark_encodings(void)
+{
+}
+
static int
enc_table_expand(int newsize)
{
@@ -266,7 +258,8 @@ enc_table_expand(int newsize)
if (enc_table.size >= newsize) return newsize;
newsize = (newsize + 7) / 8 * 8;
- ent = REALLOC_N(enc_table.list, struct rb_encoding_entry, newsize);
+ ent = realloc(enc_table.list, sizeof(*enc_table.list) * newsize);
+ if (!ent) return -1;
memset(ent + enc_table.size, 0, sizeof(*ent)*(newsize - enc_table.size));
enc_table.list = ent;
enc_table.size = newsize;
@@ -440,9 +433,6 @@ enc_replicate_with_index(const char *name, rb_encoding *origenc, int idx)
set_base_encoding(idx, origenc);
set_encoding_const(name, rb_enc_from_index(idx));
}
- else {
- rb_raise(rb_eArgError, "failed to replicate encoding");
- }
return idx;
}
@@ -515,7 +505,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)
@@ -555,6 +545,9 @@ rb_enc_alias(const char *alias, const char *orig)
int idx;
enc_check_duplication(alias);
+ if (!enc_table.list) {
+ rb_enc_init();
+ }
if ((idx = rb_enc_find_index(orig)) < 0) {
return -1;
}
@@ -608,7 +601,10 @@ rb_enc_init(void)
rb_encoding *
rb_enc_from_index(int index)
{
- if (UNLIKELY(index < 0 || enc_table.count <= (index &= ENC_INDEX_MASK))) {
+ if (!enc_table.list) {
+ rb_enc_init();
+ }
+ if (index < 0 || enc_table.count <= (index &= ENC_INDEX_MASK)) {
return 0;
}
return enc_table.list[index].enc;
@@ -649,11 +645,12 @@ load_encoding(const char *name)
else if (ISUPPER(*s)) *s = (char)TOLOWER(*s);
++s;
}
- enclib = rb_fstring(enclib);
+ FL_UNSET(enclib, FL_TAINT);
+ OBJ_FREEZE(enclib);
ruby_verbose = Qfalse;
ruby_debug = Qfalse;
errinfo = rb_errinfo();
- loaded = rb_require_internal(enclib);
+ loaded = rb_require_internal(enclib, rb_safe_level());
ruby_verbose = verbose;
ruby_debug = debug;
rb_set_errinfo(errinfo);
@@ -680,7 +677,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));
@@ -713,17 +709,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)
{
@@ -749,12 +734,6 @@ enc_capable(VALUE obj)
}
}
-int
-rb_enc_capable(VALUE obj)
-{
- return enc_capable(obj);
-}
-
ID
rb_id_encoding(void)
{
@@ -762,19 +741,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)
{
@@ -786,26 +752,30 @@ rb_enc_get_index(VALUE obj)
obj = rb_sym2str(obj);
}
switch (BUILTIN_TYPE(obj)) {
+ as_default:
+ default:
case T_STRING:
- case T_SYMBOL:
case T_REGEXP:
- i = enc_get_index_str(obj);
- break;
- case T_FILE:
- tmp = rb_funcallv(obj, rb_intern("internal_encoding"), 0, 0);
- if (NIL_P(tmp)) {
- tmp = rb_funcallv(obj, rb_intern("external_encoding"), 0, 0);
- }
- if (is_obj_encoding(tmp)) {
- i = enc_check_encoding(tmp);
+ 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_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:
if (is_data_encoding(obj)) {
i = enc_check_encoding(obj);
}
- break;
- default:
+ else {
+ goto as_default;
+ }
break;
}
return i;
@@ -814,10 +784,6 @@ rb_enc_get_index(VALUE obj)
static void
enc_set_index(VALUE obj, int idx)
{
- if (!enc_capable(obj)) {
- rb_raise(rb_eArgError, "cannot set encoding on non-encoding capable object");
- }
-
if (idx < ENCODING_INLINE_MAX) {
ENCODING_SET_INLINED(obj, idx);
return;
@@ -874,19 +840,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)
{
@@ -898,12 +851,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)
@@ -953,39 +918,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)
{
@@ -1043,8 +975,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)) {
@@ -1153,7 +1084,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
@@ -1162,7 +1093,8 @@ enc_names_i(st_data_t name, st_data_t idx, st_data_t args)
VALUE *arg = (VALUE *)args;
if ((int)idx == (int)arg[0]) {
- VALUE str = rb_fstring_cstr((char *)name);
+ VALUE str = rb_usascii_str_new2((char *)name);
+ OBJ_FREEZE(str);
rb_ary_push(arg[1], str);
}
return ST_CONTINUE;
@@ -1174,7 +1106,7 @@ enc_names_i(st_data_t name, st_data_t idx, st_data_t args)
*
* Returns the list of name and aliases of the encoding.
*
- * Encoding::WINDOWS_31J.names #=> ["Windows-31J", "CP932", "csWindows31J", "SJIS", "PCK"]
+ * Encoding::WINDOWS_31J.names #=> ["Windows-31J", "CP932", "csWindows31J"]
*/
static VALUE
enc_names(VALUE self)
@@ -1294,7 +1226,7 @@ enc_s_alloc(VALUE klass)
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);
}
@@ -1315,6 +1247,9 @@ enc_m_loader(VALUE klass, VALUE str)
rb_encoding *
rb_ascii8bit_encoding(void)
{
+ if (!enc_table.list) {
+ rb_enc_init();
+ }
return enc_table.list[ENCINDEX_ASCII].enc;
}
@@ -1327,6 +1262,9 @@ rb_ascii8bit_encindex(void)
rb_encoding *
rb_utf8_encoding(void)
{
+ if (!enc_table.list) {
+ rb_enc_init();
+ }
return enc_table.list[ENCINDEX_UTF_8].enc;
}
@@ -1339,6 +1277,9 @@ rb_utf8_encindex(void)
rb_encoding *
rb_usascii_encoding(void)
{
+ if (!enc_table.list) {
+ rb_enc_init();
+ }
return enc_table.list[ENCINDEX_US_ASCII].enc;
}
@@ -1348,14 +1289,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
@@ -1547,7 +1490,7 @@ rb_enc_default_internal(void)
* Additionally String#encode and String#encode! use the default internal
* encoding if no encoding is given.
*
- * The script encoding (__ENCODING__), not default_internal, is used as the
+ * The locale encoding (__ENCODING__), not default_internal, is used as the
* encoding of created strings.
*
* Encoding::default_internal is initialized by the source file's
@@ -1587,6 +1530,31 @@ 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.
+ *
+ */
static void
set_encoding_const(const char *name, rb_encoding *enc)
{
@@ -1642,7 +1610,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;
}
@@ -1684,10 +1653,12 @@ 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_fstring_cstr((char *)name);
+ key = rb_usascii_str_new2((char *)name);
+ OBJ_FREEZE(key);
rb_hash_aset(aliases, key, str);
return ST_CONTINUE;
}
@@ -1699,8 +1670,8 @@ rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg)
* Returns the hash of available encoding alias and original encoding name.
*
* Encoding.aliases
- * #=> {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1968"=>"US-ASCII",
- * "SJIS"=>"Windows-31J", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
+ * #=> {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1986"=>"US-ASCII",
+ * "SJIS"=>"Shift_JIS", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
*
*/
@@ -1740,11 +1711,11 @@ rb_enc_aliases(VALUE klass)
* "some string".encode "ISO-8859-1"
* #=> "some string"
*
- * Encoding::ASCII_8BIT is a special encoding that is usually used for
- * a byte string, not a character string. But as the name insists, its
- * characters in the range of ASCII are considered as ASCII
- * characters. This is useful when you use ASCII-8BIT characters with
- * other ASCII compatible characters.
+ * <code>Encoding::ASCII_8BIT</code> is a special encoding that is usually
+ * used for a byte string, not a character string. But as the name insists,
+ * its characters in the range of ASCII are considered as ASCII characters.
+ * This is useful when you use ASCII-8BIT characters with other ASCII
+ * compatible characters.
*
* == Changing an encoding
*
@@ -1782,12 +1753,11 @@ rb_enc_aliases(VALUE klass)
* All Ruby script code has an associated Encoding which any String literal
* created in the source code will be associated to.
*
- * The default script encoding is Encoding::UTF_8 after v2.0, but it
- * can be changed by a magic comment on the first line of the source
- * code file (or second line, if there is a shebang line on the
- * first). The comment must contain the word <code>coding</code> or
- * <code>encoding</code>, followed by a colon, space and the Encoding
- * name or alias:
+ * The default script encoding is <code>Encoding::UTF-8</code> after v2.0, but it can
+ * be changed by a magic comment on the first line of the source code file (or
+ * second line, if there is a shebang line on the first). The comment must
+ * contain the word <code>coding</code> or <code>encoding</code>, followed
+ * by a colon, space and the Encoding name or alias:
*
* # encoding: UTF-8
*
@@ -1946,7 +1916,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);
@@ -1960,13 +1930,35 @@ Init_Encoding(void)
rb_marshal_define_compat(rb_cEncoding, Qnil, NULL, enc_m_loader);
}
-void
-Init_encodings(void)
+/* 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)
{
- rb_enc_init();
+ return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) : c;
}
-/* locale insensitive ctype functions */
+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 cc77964ff9..7c06458e5a 100644
--- a/enum.c
+++ b/enum.c
@@ -9,25 +9,22 @@
**********************************************************************/
-#include "ruby/encoding.h"
#include "internal.h"
#include "ruby/util.h"
+#include "node.h"
#include "id.h"
-#include "symbol.h"
-
-#include <assert.h>
VALUE rb_mEnumerable;
static ID id_next;
+static ID id_div;
+static ID id_call;
+static ID id_size;
-#define id_div idDiv
#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)
@@ -41,36 +38,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;
}
@@ -78,11 +55,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;
}
@@ -109,76 +86,22 @@ static VALUE
enum_grep(VALUE obj, VALUE pat)
{
VALUE ary = rb_ary_new();
- struct MEMO *memo = MEMO_NEW(pat, ary, Qtrue);
-
- rb_block_call(obj, id_each, 0, 0, rb_block_given_p() ? grep_iter_i : grep_i, (VALUE)memo);
-
- return ary;
-}
-
-/*
- * call-seq:
- * enum.grep_v(pattern) -> array
- * enum.grep_v(pattern) { |obj| block } -> array
- *
- * Inverted version of Enumerable#grep.
- * Returns an array of every element in <i>enum</i> for which
- * not <code>Pattern === element</code>.
- *
- * (1..10).grep_v 2..5 #=> [1, 6, 7, 8, 9, 10]
- * res =(1..10).grep_v(2..5) { |v| v * 2 }
- * res #=> [2, 12, 14, 16, 18, 20]
- *
- */
-
-static VALUE
-enum_grep_v(VALUE obj, VALUE pat)
-{
- VALUE ary = rb_ary_new();
- struct MEMO *memo = MEMO_NEW(pat, ary, Qfalse);
+ 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;
}
-#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;
}
@@ -186,10 +109,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;
}
@@ -197,9 +120,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;
}
@@ -225,7 +148,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) {
@@ -244,9 +167,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
@@ -254,9 +177,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();
}
@@ -277,33 +200,26 @@ 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 && i % 7 == 0 } #=> nil
- * (1..10).find { |i| i % 5 == 0 && i % 7 == 0 } #=> nil
- * (1..10).detect(-> {0}) { |i| i % 5 == 0 && i % 7 == 0 } #=> 0
- * (1..10).find(-> {0}) { |i| i % 5 == 0 && i % 7 == 0 } #=> 0
- * (1..100).detect { |i| i % 5 == 0 && i % 7 == 0 } #=> 35
- * (1..100).find { |i| i % 5 == 0 && i % 7 == 0 } #=> 35
+ * (1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
+ * (1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
*
*/
static VALUE
enum_find(int argc, VALUE *argv, VALUE obj)
{
- struct MEMO *memo;
+ NODE *memo;
VALUE if_none;
- if_none = rb_check_arity(argc, 0, 1) ? argv[0] : Qnil;
+ 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;
}
@@ -311,28 +227,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;
}
@@ -349,16 +265,16 @@ find_index_iter_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, memop))
*
* If neither block nor argument is given, an enumerator is returned instead.
*
- * (1..10).find_index { |i| i % 5 == 0 && i % 7 == 0 } #=> nil
- * (1..100).find_index { |i| i % 5 == 0 && i % 7 == 0 } #=> 34
- * (1..100).find_index(50) #=> 49
+ * (1..10).find_index { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
+ * (1..100).find_index { |i| i % 5 == 0 and i % 7 == 0 } #=> 34
+ * (1..100).find_index(50) #=> 49
*
*/
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;
@@ -374,9 +290,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
@@ -384,7 +300,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;
@@ -393,42 +309,21 @@ 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;
}
/*
* call-seq:
* enum.find_all { |obj| block } -> array
* enum.select { |obj| block } -> array
- * enum.filter { |obj| block } -> array
* enum.find_all -> an_enumerator
* enum.select -> an_enumerator
- * enum.filter -> an_enumerator
*
* Returns an array containing all elements of +enum+
* for which the given +block+ returns a true value.
*
- * The <i>find_all</i> and <i>select</i> methods are aliases.
- * There is no performance benefit to either.
- *
* If no block is given, an Enumerator is returned instead.
*
*
@@ -436,9 +331,7 @@ enum_size_over_p(VALUE obj, long n)
*
* [1,2,3,4,5].select { |num| num.even? } #=> [2, 4]
*
- * [:foo, :bar].filter { |x| x == :foo } #=> [:foo]
- *
- * See also Enumerable#reject, Enumerable#grep.
+ * See also Enumerable#reject.
*/
static VALUE
@@ -455,51 +348,11 @@ enum_find_all(VALUE obj)
}
static VALUE
-filter_map_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
-{
- i = rb_yield_values2(argc, argv);
-
- if (RTEST(i)) {
- rb_ary_push(ary, i);
- }
-
- return Qnil;
-}
-
-/*
- * call-seq:
- * enum.filter_map { |obj| block } -> array
- * enum.filter_map -> an_enumerator
- *
- * Returns a new array containing the truthy results (everything except
- * +false+ or +nil+) of running the +block+ for every element in +enum+.
- *
- * If no block is given, an Enumerator is returned instead.
- *
- *
- * (1..10).filter_map { |i| i * 2 if i.even? } #=> [4, 8, 12, 16, 20]
- *
- */
-static VALUE
-enum_filter_map(VALUE obj)
-{
- VALUE ary;
-
- RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
-
- ary = rb_ary_new();
- rb_block_call(obj, id_each, 0, 0, filter_map_i, ary);
-
- return ary;
-}
-
-
-static VALUE
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;
@@ -511,7 +364,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.
*
@@ -538,7 +391,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;
}
@@ -546,6 +399,7 @@ collect_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
static VALUE
collect_all(RB_BLOCK_CALL_FUNC_ARGLIST(i, ary))
{
+ rb_thread_check_ints();
rb_ary_push(ary, rb_enum_values_pack(argc, argv));
return Qnil;
@@ -572,13 +426,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;
}
@@ -588,7 +440,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)) {
@@ -649,68 +501,62 @@ enum_to_a(int argc, VALUE *argv, VALUE obj)
VALUE ary = rb_ary_new();
rb_block_call(obj, id_each, argc, argv, collect_all, ary);
+ OBJ_INFECT(ary, obj);
return ary;
}
static VALUE
-enum_hashify(VALUE obj, int argc, const VALUE *argv, rb_block_call_func *iter)
-{
- VALUE hash = rb_hash_new();
- rb_block_call(obj, id_each, argc, argv, iter, hash);
- return hash;
-}
-
-static VALUE
enum_to_h_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
{
+ VALUE key_value_pair;
ENUM_WANT_SVALUE();
- return rb_hash_set_pair(hash, i);
-}
-
-static VALUE
-enum_to_h_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
-{
- return rb_hash_set_pair(hash, rb_yield_values2(argc, argv));
+ rb_thread_check_ints();
+ key_value_pair = rb_check_array_type(i);
+ if (NIL_P(key_value_pair)) {
+ rb_raise(rb_eTypeError, "wrong element type %s (expected array)",
+ rb_builtin_class_name(i));
+ }
+ if (RARRAY_LEN(key_value_pair) != 2) {
+ rb_raise(rb_eArgError, "element has wrong array length (expected 2, was %ld)",
+ RARRAY_LEN(key_value_pair));
+ }
+ rb_hash_aset(hash, RARRAY_AREF(key_value_pair, 0), RARRAY_AREF(key_value_pair, 1));
+ return Qnil;
}
/*
* call-seq:
- * enum.to_h(*args) -> hash
- * enum.to_h(*args) {...} -> hash
+ * enum.to_h(*args) -> hash
*
* Returns the result of interpreting <i>enum</i> as a list of
* <tt>[key, value]</tt> pairs.
*
* %i[hello world].each_with_index.to_h
* # => {:hello => 0, :world => 1}
- *
- * If a block is given, the results of the block on each element of
- * the enum will be used as pairs.
- *
- * (1..5).to_h {|x| [x, x ** 2]}
- * #=> {1=>1, 2=>4, 3=>9, 4=>16, 5=>25}
*/
static VALUE
enum_to_h(int argc, VALUE *argv, VALUE obj)
{
- rb_block_call_func *iter = rb_block_given_p() ? enum_to_h_ii : enum_to_h_i;
- return enum_hashify(obj, argc, argv, iter);
+ VALUE hash = rb_hash_new();
+ rb_block_call(obj, id_each, argc, argv, enum_to_h_i, hash);
+ OBJ_INFECT(hash, obj);
+ return hash;
}
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->u1.value == Qundef) {
+ 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;
}
@@ -718,84 +564,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->u1.value == Qundef) {
+ 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, mid, 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++) {
- VALUE arg = RARRAY_AREF(ary, i);
- v = rb_funcallv_public(v, id, 1, &arg);
- }
- return v;
-}
-
/*
* call-seq:
* enum.inject(initial, sym) -> obj
@@ -811,9 +600,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
@@ -845,7 +631,7 @@ 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;
@@ -872,32 +658,24 @@ 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, Qnil, op);
rb_block_call(obj, id_each, 0, 0, iter, (VALUE)memo);
- if (memo->v1 == Qundef) return Qnil;
- return memo->v1;
+ if (memo->u1.value == Qundef) return Qnil;
+ 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;
@@ -921,14 +699,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
@@ -939,7 +717,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);
@@ -969,62 +747,27 @@ group_by_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
static VALUE
enum_group_by(VALUE obj)
{
- RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
-
- return enum_hashify(obj, 0, 0, group_by_i);
-}
+ VALUE hash;
-static void
-tally_up(VALUE hash, VALUE group)
-{
- VALUE tally = rb_hash_aref(hash, group);
- if (NIL_P(tally)) {
- tally = INT2FIX(1);
- }
- else if (FIXNUM_P(tally) && tally < INT2FIX(FIXNUM_MAX)) {
- tally += INT2FIX(1) & ~FIXNUM_FLAG;
- }
- else {
- tally = rb_big_plus(tally, INT2FIX(1));
- }
- rb_hash_aset(hash, group, tally);
-}
-
-static VALUE
-tally_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, hash))
-{
- ENUM_WANT_SVALUE();
- tally_up(hash, i);
- return Qnil;
-}
+ RETURN_SIZED_ENUMERATOR(obj, 0, 0, enum_size);
-/*
- * call-seq:
- * enum.tally -> a_hash
- *
- * Tallies the collection, i.e., counts the occurrences of each element.
- * Returns a hash with the elements of the collection as keys and the
- * corresponding counts as values.
- *
- * ["a", "b", "c", "b"].tally #=> {"a"=>1, "b"=>2, "c"=>1}
- */
+ hash = rb_hash_new();
+ rb_block_call(obj, id_each, 0, 0, group_by_i, hash);
+ OBJ_INFECT(hash, obj);
-static VALUE
-enum_tally(VALUE obj)
-{
- return enum_hashify(obj, 0, 0, tally_i);
+ return hash;
}
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_RETURN(Qnil);
+ UNREACHABLE;
}
static VALUE enum_take(VALUE obj, VALUE n);
@@ -1042,22 +785,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;
}
}
@@ -1067,48 +809,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");
@@ -1130,7 +865,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;
@@ -1142,7 +876,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);
}
/*
@@ -1153,18 +887,15 @@ 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 #sort_by generates an array of
- * tuples containing the original collection element and the mapped
- * value. This makes #sort_by fairly expensive when the keysets are
- * simple.
+ * The current implementation of <code>sort_by</code> generates an
+ * array of tuples containing the original collection element and the
+ * mapped value. This makes <code>sort_by</code> fairly expensive when
+ * the keysets are simple.
*
* require 'benchmark'
*
@@ -1183,15 +914,15 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
*
* However, consider the case where comparing the keys is a non-trivial
* operation. The following code sorts some files on modification time
- * using the basic #sort method.
+ * using the basic <code>sort</code> method.
*
* files = Dir["*"]
* sorted = files.sort { |a, b| File.new(a).mtime <=> File.new(b).mtime }
* sorted #=> ["mon", "tues", "wed", "thurs"]
*
- * This sort is inefficient: it generates two new File
+ * This sort is inefficient: it generates two new <code>File</code>
* objects during every comparison. A slightly better technique is to
- * use the Kernel#test method to generate the modification
+ * use the <code>Kernel#test</code> method to generate the modification
* times directly.
*
* files = Dir["*"]
@@ -1200,34 +931,30 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
* }
* sorted #=> ["mon", "tues", "wed", "thurs"]
*
- * This still generates many unnecessary Time 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 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.
+ * 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
+ * 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.
*
* sorted = Dir["*"].collect { |f|
* [test(?M, f), f]
* }.sort.collect { |f| f[1] }
* sorted #=> ["mon", "tues", "wed", "thurs"]
*
- * This is exactly what #sort_by does internally.
+ * This is exactly what <code>sort_by</code> does internally.
*
* sorted = Dir["*"].sort_by { |f| test(?M, f) }
* sorted #=> ["mon", "tues", "wed", "thurs"]
- *
- * To produce the reverse of a specific order, the following can be used:
- *
- * ary.sort_by { ... }.reverse!
*/
static VALUE
enum_sort_by(VALUE obj)
{
VALUE ary, buf;
- struct MEMO *memo;
+ NODE *memo;
long i;
struct sort_by_data *data;
@@ -1242,10 +969,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);
- data = (struct sort_by_data *)&memo->v1;
- RB_OBJ_WRITE(memo, &data->ary, ary);
- RB_OBJ_WRITE(memo, &data->buf, buf);
+ memo = NEW_MEMO(0, 0, 0);
+ OBJ_INFECT(memo, obj);
+ data = (struct sort_by_data *)&memo->u1;
+ data->ary = ary;
+ data->buf = buf;
data->n = 0;
rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
ary = data->ary;
@@ -1255,9 +983,9 @@ enum_sort_by(VALUE obj)
rb_ary_concat(ary, buf);
}
if (RARRAY_LEN(ary) > 2) {
- RARRAY_PTR_USE(ary, ptr,
- ruby_qsort(ptr, RARRAY_LEN(ary)/2, 2*sizeof(VALUE),
- sort_by_cmp, (void *)ary));
+ RARRAY_PTR_USE(ary, ptr,
+ ruby_qsort(ptr, RARRAY_LEN(ary)/2, 2*sizeof(VALUE),
+ sort_by_cmp, (void *)ary));
}
if (RBASIC(ary)->klass) {
rb_raise(rb_eRuntimeError, "sort_by reentered");
@@ -1267,49 +995,35 @@ enum_sort_by(VALUE obj)
}
rb_ary_resize(ary, RARRAY_LEN(ary)/2);
RBASIC_SET_CLASS_RAW(ary, rb_cArray);
+ OBJ_INFECT(ary, memo);
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)); \
+ return enum_##name##_func(enum_yield(argc, argv), RNODE(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)); \
-} \
-\
-static VALUE \
-enum_##name##_func(VALUE result, struct MEMO *memo)
-
-#define WARN_UNUSED_BLOCK(argc) do { \
- if ((argc) > 0 && rb_block_given_p()) { \
- rb_warn("given block not used"); \
- } \
-} while (0)
+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;
@@ -1318,7 +1032,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
@@ -1327,31 +1040,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);
- WARN_UNUSED_BLOCK(argc);
+ 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;
@@ -1360,7 +1066,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
@@ -1369,35 +1074,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);
- WARN_UNUSED_BLOCK(argc);
+ 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();
}
}
@@ -1405,36 +1103,27 @@ DEFINE_ENUMFUNCS(one)
}
struct nmin_data {
- long n;
- long bufmax;
- long curlen;
- VALUE buf;
- VALUE limit;
- int (*cmpfunc)(const void *, const void *, void *);
- int rev: 1; /* max if 1 */
- int by: 1; /* min_by if 1 */
+ long n;
+ long bufmax;
+ long curlen;
+ VALUE buf;
+ VALUE limit;
+ int (*cmpfunc)(const void *, const void *, void *);
+ int rev; /* max if 1 */
+ int by; /* min_by if 1 */
+ const char *method;
};
-static VALUE
-cmpint_reenter_check(struct nmin_data *data, VALUE val)
-{
- if (RBASIC(data->buf)->klass) {
- rb_raise(rb_eRuntimeError, "%s%s reentered",
- data->rev ? "max" : "min",
- data->by ? "_by" : "");
- }
- 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
@@ -1443,10 +1132,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)
{
@@ -1525,13 +1217,13 @@ nmin_filter(struct nmin_data *data)
#undef GETPTR
#undef SWAP
- data->limit = RARRAY_AREF(data->buf, store_index*eltsize); /* the last pivot */
+ data->limit = RARRAY_PTR(data->buf)[store_index*eltsize];
data->curlen = data->n;
rb_ary_resize(data->buf, data->n * eltsize);
}
static VALUE
-nmin_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
+nmin_i(VALUE i, VALUE *_data, int argc, VALUE *argv)
{
struct nmin_data *data = (struct nmin_data *)_data;
VALUE cmpv;
@@ -1539,7 +1231,7 @@ nmin_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
ENUM_WANT_SVALUE();
if (data->by)
- cmpv = enum_yield(argc, i);
+ cmpv = rb_yield(i);
else
cmpv = i;
@@ -1564,8 +1256,8 @@ nmin_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, _data))
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;
@@ -1586,42 +1278,30 @@ rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary)
nmin_cmp;
data.rev = rev;
data.by = by;
- 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, Qundef);
- }
- }
- else {
- rb_block_call(obj, id_each, 0, 0, nmin_i, (VALUE)&data);
- }
+ data.method = rev ? (by ? "max_by" : "max")
+ : (by ? "min_by" : "min");
+ rb_block_call(obj, id_each, 0, 0, nmin_i, (VALUE)&data);
nmin_filter(&data);
result = data.buf;
if (by) {
long i;
- RARRAY_PTR_USE(result, ptr, {
- ruby_qsort(ptr,
- RARRAY_LEN(result)/2,
- sizeof(VALUE)*2,
- data.cmpfunc, (void *)&data);
- for (i=1; i<RARRAY_LEN(result); i+=2) {
- ptr[i/2] = ptr[i];
- }
- });
+ ruby_qsort(RARRAY_PTR(result),
+ RARRAY_LEN(result)/2,
+ sizeof(VALUE)*2,
+ data.cmpfunc, (void *)&data);
+ for (i=1; i<RARRAY_LEN(result); i+=2) {
+ RARRAY_PTR(result)[i/2] = RARRAY_PTR(result)[i];
+ }
rb_ary_resize(result, RARRAY_LEN(result)/2);
}
else {
- RARRAY_PTR_USE(result, ptr, {
- ruby_qsort(ptr, RARRAY_LEN(result), sizeof(VALUE),
- data.cmpfunc, (void *)&data);
- });
+ 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;
}
@@ -1629,7 +1309,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>
@@ -1637,28 +1316,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;
- WARN_UNUSED_BLOCK(argc);
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;
}
@@ -1666,7 +1338,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;
@@ -1675,53 +1347,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);
-
- WARN_UNUSED_BLOCK(argc);
+ 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;
@@ -1731,17 +1391,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;
@@ -1751,12 +1411,12 @@ 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
- * first form assumes all objects implement Comparable;
+ * Returns the object in <i>enum</i> with the minimum value. The
+ * first form assumes all objects implement <code>Comparable</code>;
* the second uses the block to return <em>a <=> b</em>.
*
* a = %w(albatross dog horse)
@@ -1764,57 +1424,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;
- if (rb_check_arity(argc, 0, 1) && !NIL_P(num = argv[0]))
- return rb_nmin_run(obj, num, 0, 0, 0);
+ rb_scan_args(argc, argv, "01", &num);
+
+ if (!NIL_P(num))
+ 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;
@@ -1823,18 +1477,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;
@@ -1842,13 +1496,13 @@ 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 Comparable;
+ * first form assumes all objects implement <code>Comparable</code>;
* the second uses the block to return <em>a <=> b</em>.
*
* a = %w(albatross dog horse)
@@ -1856,35 +1510,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]
*/
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;
- if (rb_check_arity(argc, 0, 1) && !NIL_P(num = argv[0]))
- return rb_nmin_run(obj, num, 0, 1, 0);
+ rb_scan_args(argc, argv, "01", &num);
+
+ if (!NIL_P(num))
+ 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;
}
@@ -1893,9 +1544,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)
{
@@ -1906,11 +1558,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;
}
@@ -1920,7 +1572,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;
@@ -1933,7 +1585,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) {
@@ -1972,7 +1624,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;
@@ -2005,9 +1657,9 @@ 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 Comparable; the second uses the
+ * objects implement <code>Comparable</code>; the second uses the
* block to return <em>a <=> b</em>.
*
* a = %w(albatross dog horse)
@@ -2018,46 +1670,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;
}
@@ -2078,8 +1729,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"]
@@ -2088,38 +1738,37 @@ 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_check_arity(argc, 0, 1);
+ rb_scan_args(argc, argv, "01", &num);
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
- if (argc && !NIL_P(num = argv[0]))
- return rb_nmin_run(obj, num, 1, 0, 0);
+ if (!NIL_P(num))
+ 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;
}
@@ -2139,9 +1788,8 @@ 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"]
@@ -2195,19 +1843,19 @@ 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_check_arity(argc, 0, 1);
+ rb_scan_args(argc, argv, "01", &num);
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
- if (argc && !NIL_P(num = argv[0]))
- return rb_nmin_run(obj, num, 1, 1, 0);
+ if (!NIL_P(num))
+ 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 {
@@ -2222,8 +1870,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;
@@ -2231,11 +1877,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;
}
@@ -2245,14 +1891,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;
@@ -2263,7 +1908,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;
@@ -2322,10 +1967,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;
@@ -2339,30 +1984,26 @@ member_i(RB_BLOCK_CALL_FUNC_ARGLIST(iter, args))
* Returns <code>true</code> if any member of <i>enum</i> equals
* <i>obj</i>. Equality is tested using <code>==</code>.
*
- * (1..10).include? 5 #=> true
- * (1..10).include? 15 #=> false
- * (1..10).member? 5 #=> true
- * (1..10).member? 15 #=> false
+ * IO.constants.include? :SEEK_SET #=> true
+ * IO.constants.include? :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));
}
/*
@@ -2387,11 +2028,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;
}
@@ -2406,33 +2047,27 @@ enum_each_with_index(int argc, VALUE *argv, VALUE obj)
*
* If no block is given, an enumerator is returned instead.
*
- * (1..3).reverse_each { |v| p v }
+ * (1..3).reverse_each { |v| p v }
*
- * produces:
+ * produces:
*
- * 3
- * 2
- * 1
+ * 3
+ * 2
+ * 1
*/
static VALUE
enum_reverse_each(int argc, VALUE *argv, VALUE obj)
{
VALUE ary;
- long len;
+ long i;
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_size);
ary = enum_to_a(argc, argv, obj);
- len = RARRAY_LEN(ary);
- while (len--) {
- long nlen;
- rb_yield(RARRAY_AREF(ary, len));
- nlen = RARRAY_LEN(ary);
- if (nlen < len) {
- len = nlen;
- }
+ for (i = RARRAY_LEN(ary); --i >= 0; ) {
+ rb_yield(RARRAY_AREF(ary, i));
}
return obj;
@@ -2443,7 +2078,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;
}
@@ -2484,29 +2119,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();
@@ -2516,8 +2136,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);
@@ -2532,18 +2152,13 @@ enum_each_slice_size(VALUE obj, VALUE args, VALUE eobj)
{
VALUE n, size;
long slice_size = NUM2LONG(RARRAY_AREF(args, 0));
- ID infinite_p;
- CONST_ID(infinite_p, "infinite?");
if (slice_size <= 0) rb_raise(rb_eArgError, "invalid slice size");
size = enum_size(obj, 0, 0);
if (size == Qnil) return Qnil;
- if (RB_FLOAT_TYPE_P(size) && RTEST(rb_funcall(size, infinite_p, 0))) {
- return size;
- }
- 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));
}
/*
@@ -2567,17 +2182,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;
@@ -2586,8 +2200,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();
@@ -2597,7 +2211,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);
@@ -2608,8 +2222,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");
@@ -2617,8 +2229,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;
}
/*
@@ -2646,14 +2258,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;
@@ -2693,11 +2304,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);
@@ -2713,38 +2324,33 @@ 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 w)
+call_next(VALUE *v)
{
- VALUE *v = (VALUE *)w;
- return v[0] = rb_funcallv(v[1], id_next, 0, 0);
+ return v[0] = rb_funcall(v[1], id_next, 0, 0);
}
static VALUE
-call_stop(VALUE w, VALUE _)
+call_stop(VALUE *v)
{
- VALUE *v = (VALUE *)w;
return v[0] = Qundef;
}
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);
@@ -2766,14 +2372,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;
}
@@ -2799,10 +2402,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
@@ -2810,7 +2409,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;
@@ -2825,22 +2424,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;
@@ -2849,8 +2446,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;
}
@@ -2870,7 +2467,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);
@@ -2880,7 +2477,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;
}
@@ -2889,14 +2486,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+,
@@ -2923,9 +2520,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--;
@@ -2949,7 +2546,7 @@ static VALUE
enum_drop(VALUE obj, VALUE n)
{
VALUE result;
- struct MEMO *memo;
+ NODE *memo;
long len = NUM2LONG(n);
if (len < 0) {
@@ -2957,7 +2554,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;
}
@@ -2966,21 +2563,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
@@ -2998,11 +2595,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;
}
@@ -3012,30 +2609,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(HUGE_VAL);
+ 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));
}
/*
@@ -3066,10 +2660,10 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
VALUE nv = Qnil;
long n, i, len;
- rb_check_arity(argc, 0, 1);
+ rb_scan_args(argc, argv, "01", &nv);
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enum_cycle_size);
- if (!argc || NIL_P(nv = argv[0])) {
+ if (NIL_P(nv)) {
n = -1;
}
else {
@@ -3083,7 +2677,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;
@@ -3091,6 +2685,7 @@ enum_cycle(int argc, VALUE *argv, VALUE obj)
struct chunk_arg {
VALUE categorize;
+ VALUE state;
VALUE prev_value;
VALUE prev_elts;
VALUE yielder;
@@ -3106,21 +2701,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;
}
}
@@ -3137,8 +2732,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);
}
@@ -3156,22 +2750,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 (deprecated)
*
* Enumerates over the items, chunking them together based on the return
* value of the block.
@@ -3255,18 +2852,24 @@ chunk_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* }
* }
*
- * If no block is given, an enumerator to `chunk` is returned instead.
*/
static VALUE
-enum_chunk(VALUE enumerable)
+enum_chunk(int argc, VALUE *argv, VALUE enumerable)
{
+ VALUE initial_state;
VALUE enumerator;
+ int n;
- RETURN_SIZED_ENUMERATOR(enumerable, 0, 0, enum_size);
+ if (!rb_block_given_p())
+ rb_raise(rb_eArgError, "no block given");
+ n = rb_scan_args(argc, argv, "01", &initial_state);
+ if (n != 0)
+ rb_warn("initial_state given for chunk. (Use local variables.)");
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;
}
@@ -3275,6 +2878,7 @@ enum_chunk(VALUE enumerable)
struct slicebefore_arg {
VALUE sep_pred;
VALUE sep_pat;
+ VALUE state;
VALUE prev_elts;
VALUE yielder;
};
@@ -3288,12 +2892,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 {
@@ -3316,13 +2922,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;
}
@@ -3330,6 +2940,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 (deprecated)
*
* Creates an enumerator for each chunked elements.
* The beginnings of chunks are defined by _pattern_ and the block.
@@ -3348,7 +2959,7 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* enum.slice_before { |elt| 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:
@@ -3379,7 +2990,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]
@@ -3458,10 +3069,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"
@@ -3476,10 +3086,14 @@ 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;
+ int n;
+ n = rb_scan_args(argc, argv, "01", &initial_state);
+ if (n != 0)
+ rb_warn("initial_state given for slice_before. (Use local variables.)");
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;
@@ -3518,16 +3132,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;
}
@@ -3552,7 +3166,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;
}
@@ -3600,7 +3214,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 {
@@ -3621,7 +3235,6 @@ struct slicewhen_arg {
VALUE prev_elt;
VALUE prev_elts;
VALUE yielder;
- int inverted; /* 0 for slice_when and 1 for chunk_while. */
};
static VALUE
@@ -3640,17 +3253,11 @@ slicewhen_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo))
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));
+ split_p = RTEST(rb_funcall(memo->pred, id_call, 2, memo->prev_elt, i));
UPDATE_MEMO;
- if (memo->inverted)
- split_p = !split_p;
-
if (split_p) {
- rb_funcallv(memo->yielder, id_lshift, 1, &memo->prev_elts);
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
UPDATE_MEMO;
memo->prev_elts = rb_ary_new3(1, i);
}
@@ -3670,20 +3277,18 @@ 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);
+ struct slicewhen_arg *memo = NEW_MEMO_FOR(struct slicewhen_arg, arg);
enumerable = rb_ivar_get(enumerator, rb_intern("slicewhen_enum"));
memo->pred = rb_attr_get(enumerator, rb_intern("slicewhen_pred"));
memo->prev_elt = Qundef;
memo->prev_elts = Qnil;
memo->yielder = yielder;
- memo->inverted = RTEST(rb_attr_get(enumerator, rb_intern("slicewhen_inverted")));
rb_block_call(enumerable, id_each, 0, 0, slicewhen_ii, arg);
memo = MEMO_FOR(struct slicewhen_arg, arg);
if (!NIL_P(memo->prev_elts))
- rb_funcallv(memo->yielder, id_lshift, 1, &memo->prev_elts);
+ rb_funcall(memo->yielder, id_lshift, 1, memo->prev_elts);
return Qnil;
}
@@ -3698,7 +3303,7 @@ slicewhen_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* _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 returns true.
*
* The block is called the length of the receiver enumerator minus one.
*
@@ -3720,7 +3325,7 @@ slicewhen_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* 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:
+ * Near elements (threshold: 6) in sorted array can be chunked as follwos:
*
* a = [3, 11, 14, 25, 28, 29, 29, 41, 55, 57]
* p a.slice_when {|i, j| 6 < j - i }.to_a
@@ -3746,8 +3351,6 @@ slicewhen_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
* 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)
@@ -3760,384 +3363,20 @@ enum_slice_when(VALUE enumerable)
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
- * ('a'..'z').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"
- *
- * If the method is applied to an Integer range without a block,
- * the sum is not done by iteration, but instead using Gauss's summation
- * formula.
- *
- * Enumerable#sum method may not respect method redefinition of "+"
- * methods such as Integer#+, or "each" methods such as Range#each.
- */
-static VALUE
-enum_sum(int argc, VALUE* argv, VALUE obj)
-{
- struct enum_sum_memo memo;
- VALUE beg, end;
- int excl;
-
- memo.v = (rb_check_arity(argc, 0, 1) == 0) ? LONG2FIX(0) : argv[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;
- }
- else {
- memo.f = 0.0;
- 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 Enumerable mixin provides collection classes with several
- * traversal and searching methods, and with the ability to sort. The
- * class must provide a method #each, which yields
- * successive members of the collection. If Enumerable#max, #min, or
- * #sort is used, the objects in the collection must also implement a
- * meaningful <code><=></code> operator, as these methods rely on an
- * ordering between members of the collection.
+ * The <code>Enumerable</code> mixin provides collection classes with
+ * several traversal and searching methods, and with the ability to
+ * sort. The class must provide a method <code>each</code>, which
+ * yields successive members of the collection. If
+ * <code>Enumerable#max</code>, <code>#min</code>, or
+ * <code>#sort</code> is used, the objects in the collection must also
+ * implement a meaningful <code><=></code> operator, as these methods
+ * rely on an ordering between members of the collection.
*/
void
@@ -4155,15 +3394,12 @@ 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);
rb_define_method(rb_mEnumerable, "find_index", enum_find_index, -1);
rb_define_method(rb_mEnumerable, "find_all", enum_find_all, 0);
rb_define_method(rb_mEnumerable, "select", enum_find_all, 0);
- rb_define_method(rb_mEnumerable, "filter", enum_find_all, 0);
- rb_define_method(rb_mEnumerable, "filter_map", enum_filter_map, 0);
rb_define_method(rb_mEnumerable, "reject", enum_reject, 0);
rb_define_method(rb_mEnumerable, "collect", enum_collect, 0);
rb_define_method(rb_mEnumerable, "map", enum_collect, 0);
@@ -4173,12 +3409,11 @@ Init_Enumerable(void)
rb_define_method(rb_mEnumerable, "reduce", enum_inject, -1);
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, "tally", enum_tally, 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);
@@ -4199,13 +3434,13 @@ 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 9d0547da05..4d989c3941 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -12,13 +12,8 @@
************************************************/
-#include "ruby/ruby.h"
#include "internal.h"
-#include "id.h"
-
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
+#include "node.h"
/*
* Document-class: Enumerator
@@ -26,8 +21,8 @@
* A class which allows both internal and external iteration.
*
* An Enumerator can be created by the following methods.
- * - Object#to_enum
- * - Object#enum_for
+ * - Kernel#to_enum
+ * - Kernel#enum_for
* - Enumerator.new
*
* Most methods have two forms: a block form where the contents
@@ -107,19 +102,10 @@
*
*/
VALUE rb_cEnumerator;
-static VALUE rb_cLazy;
-static ID id_rewind, id_new, id_to_enum;
-static ID id_next, id_result, id_receiver, id_arguments, id_memo, id_method, id_force;
-static ID id_begin, id_end, id_step, id_exclude_end;
-static VALUE sym_each, sym_cycle, sym_yield;
-
-static VALUE lazy_use_super_method;
-
-#define id_call idCall
-#define id_each idEach
-#define id_eqq idEqq
-#define id_initialize idInitialize
-#define id_size idSize
+VALUE rb_cLazy;
+static ID id_rewind, id_each, id_new, id_initialize, id_yield, id_call, id_size, id_to_enum;
+static ID id_eqq, id_next, id_result, id_lazy, id_receiver, id_arguments, id_memo, id_method, id_force;
+static VALUE sym_each, sym_cycle;
VALUE rb_eStopIteration;
@@ -133,52 +119,22 @@ struct enumerator {
VALUE feedvalue;
VALUE stop_exc;
VALUE size;
- VALUE procs;
rb_enumerator_size_func *size_fn;
- int kw_splat;
};
-static VALUE rb_cGenerator, rb_cYielder, rb_cEnumProducer;
+static VALUE rb_cGenerator, rb_cYielder;
struct generator {
VALUE proc;
- VALUE obj;
};
struct yielder {
VALUE proc;
};
-struct producer {
- VALUE init;
- 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);
-static VALUE rb_cEnumChain;
-
-struct enum_chain {
- VALUE enums;
- long pos;
-};
-
-VALUE rb_cArithSeq;
-
/*
* Enumerator
*/
@@ -186,30 +142,14 @@ static void
enumerator_mark(void *p)
{
struct enumerator *ptr = p;
- rb_gc_mark_movable(ptr->obj);
- rb_gc_mark_movable(ptr->args);
- rb_gc_mark_movable(ptr->fib);
- rb_gc_mark_movable(ptr->dst);
- rb_gc_mark_movable(ptr->lookahead);
- rb_gc_mark_movable(ptr->feedvalue);
- rb_gc_mark_movable(ptr->stop_exc);
- rb_gc_mark_movable(ptr->size);
- rb_gc_mark_movable(ptr->procs);
-}
-
-static void
-enumerator_compact(void *p)
-{
- struct enumerator *ptr = p;
- ptr->obj = rb_gc_location(ptr->obj);
- ptr->args = rb_gc_location(ptr->args);
- ptr->fib = rb_gc_location(ptr->fib);
- ptr->dst = rb_gc_location(ptr->dst);
- ptr->lookahead = rb_gc_location(ptr->lookahead);
- ptr->feedvalue = rb_gc_location(ptr->feedvalue);
- ptr->stop_exc = rb_gc_location(ptr->stop_exc);
- ptr->size = rb_gc_location(ptr->size);
- ptr->procs = rb_gc_location(ptr->procs);
+ rb_gc_mark(ptr->obj);
+ rb_gc_mark(ptr->args);
+ rb_gc_mark(ptr->fib);
+ rb_gc_mark(ptr->dst);
+ rb_gc_mark(ptr->lookahead);
+ rb_gc_mark(ptr->feedvalue);
+ rb_gc_mark(ptr->stop_exc);
+ rb_gc_mark(ptr->size);
}
#define enumerator_free RUBY_TYPED_DEFAULT_FREE
@@ -217,7 +157,7 @@ enumerator_compact(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 = {
@@ -226,7 +166,6 @@ static const rb_data_type_t enumerator_data_type = {
enumerator_mark,
enumerator_free,
enumerator_memsize,
- enumerator_compact,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
@@ -243,50 +182,6 @@ enumerator_ptr(VALUE obj)
return ptr;
}
-static void
-proc_entry_mark(void *p)
-{
- struct proc_entry *ptr = p;
- rb_gc_mark_movable(ptr->proc);
- rb_gc_mark_movable(ptr->memo);
-}
-
-static void
-proc_entry_compact(void *p)
-{
- struct proc_entry *ptr = p;
- ptr->proc = rb_gc_location(ptr->proc);
- ptr->memo = rb_gc_location(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,
- proc_entry_compact,
- },
-};
-
-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
@@ -295,8 +190,7 @@ proc_entry_ptr(VALUE proc_entry)
* obj.enum_for(method = :each, *args){|*args| block} -> enum
*
* Creates a new Enumerator which will enumerate by calling +method+ on
- * +obj+, passing +args+ if any. What was _yielded_ by method becomes
- * values of enumerator.
+ * +obj+, passing +args+ if any.
*
* If a block is given, it will be used to calculate the size of
* the enumerator without the need to iterate it (see Enumerator#size).
@@ -315,11 +209,6 @@ proc_entry_ptr(VALUE proc_entry)
* a = [1, 2, 3]
* some_method(a.to_enum)
*
- * # String#split in block form is more memory-effective:
- * very_large_string.split("|") { |chunk| return chunk if chunk.include?('DATE') }
- * # This could be rewritten more idiomatically with to_enum:
- * very_large_string.to_enum(:split, "|").lazy.grep(/DATE/).first
- *
* It is typical to call to_enum when defining methods for
* a generic Enumerable, in case no block is passed.
*
@@ -376,10 +265,8 @@ enumerator_allocate(VALUE klass)
return enum_obj;
}
-#define PASS_KW_SPLAT (rb_empty_keyword_given_p() ? RB_PASS_EMPTY_KEYWORDS : rb_keyword_given_p())
-
static VALUE
-enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn, VALUE size, int kw_splat)
+enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn, VALUE size)
{
struct enumerator *ptr;
@@ -400,7 +287,6 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, const VALUE *ar
ptr->stop_exc = Qfalse;
ptr->size = size;
ptr->size_fn = size_fn;
- ptr->kw_splat = kw_splat;
return enum_obj;
}
@@ -415,7 +301,7 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, const VALUE *ar
*
* In the first form, iteration is defined by the given block, in
* which a "yielder" object, given as block parameter, can be used to
- * yield a value by calling the +yield+ method (aliased as <code><<</code>):
+ * yield a value by calling the +yield+ method (aliased as +<<+):
*
* fib = Enumerator.new do |y|
* a = b = 1
@@ -425,22 +311,22 @@ enumerator_init(VALUE enum_obj, VALUE obj, VALUE meth, int argc, const VALUE *ar
* end
* end
*
- * fib.take(10) # => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
+ * p fib.take(10) # => [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
*
* The optional parameter can be used to specify how to calculate the size
* in a lazy fashion (see Enumerator#size). It can either be a value or
* a callable object.
*
- * In the deprecated second form, a generated Enumerator iterates over the
+ * In the second, deprecated, form, a generated Enumerator iterates over the
* given object using the given method with the given arguments passed.
*
- * Use of this form is discouraged. Use Object#enum_for or Object#to_enum
+ * Use of this form is discouraged. Use Kernel#enum_for or Kernel#to_enum
* instead.
*
* e = Enumerator.new(ObjectSpace, :each_object)
* #-> ObjectSpace.enum_for(:each_object)
*
- * e.select { |obj| obj.is_a?(Class) } # => array of all classes
+ * e.select { |obj| obj.is_a?(Class) } #=> array of all classes
*
*/
static VALUE
@@ -448,14 +334,13 @@ enumerator_initialize(int argc, VALUE *argv, VALUE obj)
{
VALUE recv, meth = sym_each;
VALUE size = Qnil;
- int kw_splat = 0;
if (rb_block_given_p()) {
rb_check_arity(argc, 0, 1);
recv = generator_init(generator_allocate(rb_cGenerator), rb_block_proc());
if (argc) {
if (NIL_P(argv[0]) || rb_respond_to(argv[0], id_call) ||
- (RB_TYPE_P(argv[0], T_FLOAT) && RFLOAT_VALUE(argv[0]) == HUGE_VAL)) {
+ (RB_TYPE_P(argv[0], T_FLOAT) && RFLOAT_VALUE(argv[0]) == INFINITY)) {
size = argv[0];
}
else {
@@ -466,16 +351,15 @@ enumerator_initialize(int argc, VALUE *argv, VALUE obj)
}
else {
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
- rb_warn_deprecated("Enumerator.new without a block", "Object#to_enum");
+ rb_warn("Enumerator.new without a block is deprecated; use Object#to_enum");
recv = *argv++;
if (--argc) {
meth = *argv++;
--argc;
}
- kw_splat = PASS_KW_SPLAT;
}
- return enumerator_init(obj, recv, meth, argc, argv, 0, size, kw_splat);
+ return enumerator_init(obj, recv, meth, argc, argv, 0, size);
}
/* :nodoc: */
@@ -519,7 +403,7 @@ rb_enumeratorize(VALUE obj, VALUE meth, int argc, const VALUE *argv)
}
static VALUE
-lazy_to_enum_i(VALUE self, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn, int kw_splat);
+lazy_to_enum_i(VALUE self, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn);
VALUE
rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn)
@@ -527,22 +411,10 @@ rb_enumeratorize_with_size(VALUE obj, VALUE meth, int argc, const VALUE *argv, r
/* Similar effect as calling obj.to_enum, i.e. dispatching to either
Kernel#to_enum vs Lazy#to_enum */
if (RTEST(rb_obj_is_kind_of(obj, rb_cLazy)))
- return lazy_to_enum_i(obj, meth, argc, argv, size_fn, PASS_KW_SPLAT);
+ return lazy_to_enum_i(obj, meth, argc, argv, size_fn);
else
return enumerator_init(enumerator_allocate(rb_cEnumerator),
- obj, meth, argc, argv, size_fn, Qnil, PASS_KW_SPLAT);
-}
-
-VALUE
-rb_enumeratorize_with_size_kw(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn, int kw_splat)
-{
- /* Similar effect as calling obj.to_enum, i.e. dispatching to either
- Kernel#to_enum vs Lazy#to_enum */
- if (RTEST(rb_obj_is_kind_of(obj, rb_cLazy)))
- return lazy_to_enum_i(obj, meth, argc, argv, size_fn, kw_splat);
- else
- return enumerator_init(enumerator_allocate(rb_cEnumerator),
- obj, meth, argc, argv, size_fn, Qnil, kw_splat);
+ obj, meth, argc, argv, size_fn, Qnil);
}
static VALUE
@@ -557,7 +429,7 @@ enumerator_block_call(VALUE obj, rb_block_call_func *func, VALUE arg)
argc = RARRAY_LENINT(e->args);
argv = RARRAY_CONST_PTR(e->args);
}
- return rb_block_call_kw(e->obj, meth, argc, argv, func, arg, e->kw_splat);
+ return rb_block_call(e->obj, meth, argc, argv, func, arg);
}
/*
@@ -614,8 +486,6 @@ enumerator_each(int argc, VALUE *argv, VALUE obj)
args = rb_ary_new4(argc, argv);
}
e->args = args;
- e->size = Qnil;
- e->size_fn = 0;
}
if (!rb_block_given_p()) return obj;
return enumerator_block_call(obj, 0, obj);
@@ -624,9 +494,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);
@@ -660,10 +530,13 @@ enumerator_with_index(int argc, VALUE *argv, VALUE obj)
{
VALUE memo;
- rb_check_arity(argc, 0, 1);
+ rb_scan_args(argc, argv, "01", &memo);
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_enum_size);
- memo = (!argc || NIL_P(memo = argv[0])) ? INT2FIX(0) : rb_to_int(memo);
- return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)MEMO_NEW(memo, 0, 0));
+ if (NIL_P(memo))
+ memo = INT2FIX(0);
+ else
+ memo = rb_to_int(memo);
+ return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)NEW_MEMO(memo, 0, 0));
}
/*
@@ -744,7 +617,7 @@ next_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, obj))
}
static VALUE
-next_i(RB_BLOCK_CALL_FUNC_ARGLIST(_, obj))
+next_i(VALUE curr, VALUE obj)
{
struct enumerator *e = enumerator_ptr(obj);
VALUE nil = Qnil;
@@ -1058,7 +931,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
@@ -1077,25 +949,7 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
if (recur) {
str = rb_sprintf("#<%"PRIsVALUE": ...>", rb_class_path(cname));
- 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, ">");
- }
+ OBJ_TAINT(str);
return str;
}
@@ -1113,22 +967,6 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
return str;
}
-static int
-key_symbol_p(VALUE key, VALUE val, VALUE arg)
-{
- if (SYMBOL_P(key)) return ST_CONTINUE;
- *(int *)arg = FALSE;
- return ST_STOP;
-}
-
-static int
-kwd_append(VALUE key, VALUE val, VALUE str)
-{
- if (!SYMBOL_P(key)) rb_raise(rb_eRuntimeError, "non-symbol key inserted");
- rb_str_catf(str, "% "PRIsVALUE": %"PRIsVALUE", ", key, val);
- return ST_CONTINUE;
-}
-
static VALUE
append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args)
{
@@ -1156,27 +994,15 @@ append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args)
const VALUE *argv = RARRAY_CONST_PTR(eargs); /* WB: no new reference */
if (argc > 0) {
- VALUE kwds = Qnil;
-
rb_str_buf_cat2(str, "(");
- if (RB_TYPE_P(argv[argc-1], T_HASH) && !RHASH_EMPTY_P(argv[argc-1])) {
- int all_key = TRUE;
- rb_hash_foreach(argv[argc-1], key_symbol_p, (VALUE)&all_key);
- if (all_key) kwds = argv[--argc];
- }
-
while (argc--) {
VALUE arg = *argv++;
rb_str_append(str, rb_inspect(arg));
- rb_str_buf_cat2(str, ", ");
+ rb_str_buf_cat2(str, argc > 0 ? ", " : ")");
+ OBJ_INFECT(str, arg);
}
- if (!NIL_P(kwds)) {
- rb_hash_foreach(kwds, kwd_append, str);
- }
- rb_str_set_len(str, RSTRING_LEN(str)-2);
- rb_str_buf_cat2(str, ")");
}
}
@@ -1215,23 +1041,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);
}
@@ -1239,7 +1048,7 @@ enumerator_size(VALUE obj)
argc = (int)RARRAY_LEN(e->args);
argv = RARRAY_CONST_PTR(e->args);
}
- size = rb_check_funcall_kw(e->size, id_call, argc, argv, e->kw_splat);
+ size = rb_check_funcall(e->size, id_call, argc, argv);
if (size != Qundef) return size;
return e->size;
}
@@ -1251,14 +1060,7 @@ static void
yielder_mark(void *p)
{
struct yielder *ptr = p;
- rb_gc_mark_movable(ptr->proc);
-}
-
-static void
-yielder_compact(void *p)
-{
- struct yielder *ptr = p;
- ptr->proc = rb_gc_location(ptr->proc);
+ rb_gc_mark(ptr->proc);
}
#define yielder_free RUBY_TYPED_DEFAULT_FREE
@@ -1266,7 +1068,7 @@ yielder_compact(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 = {
@@ -1275,7 +1077,6 @@ static const rb_data_type_t yielder_data_type = {
yielder_mark,
yielder_free,
yielder_memsize,
- yielder_compact,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
@@ -1336,44 +1137,21 @@ yielder_yield(VALUE obj, VALUE args)
{
struct yielder *ptr = yielder_ptr(obj);
- return rb_proc_call_kw(ptr->proc, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_proc_call(ptr->proc, args);
}
/* :nodoc: */
static VALUE
-yielder_yield_push(VALUE obj, VALUE arg)
+yielder_yield_push(VALUE obj, VALUE args)
{
- struct yielder *ptr = yielder_ptr(obj);
-
- rb_proc_call_with_block(ptr->proc, 1, &arg, Qnil);
-
+ yielder_yield(obj, args);
return obj;
}
-/*
- * Returns a Proc object that takes an argument and yields it.
- *
- * This method is implemented so that a Yielder object can be directly
- * passed to another method as a block argument.
- *
- * enum = Enumerator.new { |y|
- * Dir.glob("*.rb") { |file|
- * File.open(file) { |f| f.each_line(&y) }
- * }
- * }
- */
-static VALUE
-yielder_to_proc(VALUE obj)
-{
- VALUE method = rb_obj_method(obj, sym_yield);
-
- return rb_funcall(method, idTo_proc, 0);
-}
-
static VALUE
yielder_yield_i(RB_BLOCK_CALL_FUNC_ARGLIST(obj, memo))
{
- return rb_yield_values_kw(argc, argv, RB_PASS_CALLED_KEYWORDS);
+ return rb_yield_values2(argc, argv);
}
static VALUE
@@ -1389,16 +1167,7 @@ static void
generator_mark(void *p)
{
struct generator *ptr = p;
- rb_gc_mark_movable(ptr->proc);
- rb_gc_mark_movable(ptr->obj);
-}
-
-static void
-generator_compact(void *p)
-{
- struct generator *ptr = p;
- ptr->proc = rb_gc_location(ptr->proc);
- ptr->obj = rb_gc_location(ptr->obj);
+ rb_gc_mark(ptr->proc);
}
#define generator_free RUBY_TYPED_DEFAULT_FREE
@@ -1406,7 +1175,7 @@ generator_compact(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 = {
@@ -1415,7 +1184,6 @@ static const rb_data_type_t generator_data_type = {
generator_mark,
generator_free,
generator_memsize,
- generator_compact,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
@@ -1478,8 +1246,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");
@@ -1522,7 +1290,7 @@ generator_each(int argc, VALUE *argv, VALUE obj)
rb_ary_cat(args, argv, argc);
}
- return rb_proc_call_kw(ptr->proc, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_proc_call(ptr->proc, args);
}
/* Lazy Enumerator methods */
@@ -1564,14 +1332,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;
@@ -1584,174 +1352,33 @@ 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(RB_BLOCK_CALL_FUNC_ARGLIST(_, m))
-{
- 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, idLTLT, 1, &(result->memo_value));
- }
- if (LAZY_MEMO_BREAK_P(result)) {
- rb_iter_break();
- }
- return result->memo_value;
-}
-
-static VALUE
-lazy_init_block(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
-{
- 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;
-}
-
-/*
- * Document-class: Enumerator::Lazy
- *
- * Enumerator::Lazy is a special type of Enumerator, that allows constructing
- * chains of operations without evaluating them immediately, and evaluating
- * values on as-needed basis. In order to do so it redefines most of Enumerable
- * methods so that they just construct another lazy enumerator.
- *
- * Enumerator::Lazy can be constructed from any Enumerable with the
- * Enumerable#lazy method.
- *
- * lazy = (1..Float::INFINITY).lazy.select(&:odd?).drop(10).take_while { |i| i < 30 }
- * # => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:select>:drop(10)>:take_while>
- *
- * The real enumeration is performed when any non-redefined Enumerable method
- * is called, like Enumerable#first or Enumerable#to_a (the latter is aliased
- * as #force for more semantic code):
- *
- * lazy.first(2)
- * #=> [21, 23]
- *
- * lazy.force
- * #=> [21, 23, 25, 27, 29]
- *
- * Note that most Enumerable methods that could be called with or without
- * a block, on Enumerator::Lazy will always require a block:
- *
- * [1, 2, 3].map #=> #<Enumerator: [1, 2, 3]:map>
- * [1, 2, 3].lazy.map # ArgumentError: tried to call lazy map without a block
- *
- * This class allows idiomatic calculations on long or infinite sequences, as well
- * as chaining of calculations without constructing intermediate arrays.
- *
- * Example for working with a slowly calculated sequence:
- *
- * require 'open-uri'
- *
- * # This will fetch all URLs before selecting
- * # necessary data
- * URLS.map { |u| JSON.parse(open(u).read) }
- * .select { |data| data.key?('stats') }
- * .first(5)
- *
- * # This will fetch URLs one-by-one, only till
- * # there is enough data to satisfy the condition
- * URLS.lazy.map { |u| JSON.parse(open(u).read) }
- * .select { |data| data.key?('stats') }
- * .first(5)
- *
- * Ending a chain with ".eager" generates a non-lazy enumerator, which
- * is suitable for returning or passing to another method that expects
- * a normal enumerator.
- *
- * def active_items
- * groups
- * .lazy
- * .flat_map(&:items)
- * .reject(&:disabled)
- * .eager
- * end
- *
- * # This works lazily; if a checked item is found, it stops
- * # iteration and does not look into remaining groups.
- * first_checked = active_items.find(&:checked)
- *
- * # This returns an array of items like a normal enumerator does.
- * all_checked = active_items.select(&:checked)
- *
- */
-
/*
* call-seq:
- * Lazy.new(obj, size=nil) { |yielder, *values| block }
+ * Lazy.new(obj, size=nil) { |yielder, *values| ... }
*
* Creates a new Lazy enumerator. When the enumerator is actually enumerated
* (e.g. by calling #force), +obj+ will be enumerated and each value passed
* to the given block. The block can yield values back using +yielder+.
- * For example, to create a "filter+map" enumerator:
+ * For example, to create a method +filter_map+ in both lazy and
+ * non-lazy fashions:
+ *
+ * module Enumerable
+ * def filter_map(&block)
+ * map(&block).compact
+ * end
+ * end
*
- * def filter_map(sequence)
- * Lazy.new(sequence) do |yielder, *values|
- * result = yield *values
- * yielder << result if result
+ * class Enumerator::Lazy
+ * def filter_map
+ * Lazy.new(self) do |yielder, *values|
+ * result = yield *values
+ * yielder << result if result
+ * end
* end
* end
*
- * filter_map(1..Float::INFINITY) {|i| i*i if i.even?}.first(5)
- * #=> [4, 16, 36, 64, 100]
+ * (1..Float::INFINITY).lazy.filter_map{|i| i*i if i.even?}.first(5)
+ * # => [4, 16, 36, 64, 100]
*/
static VALUE
lazy_initialize(int argc, VALUE *argv, VALUE self)
@@ -1769,30 +1396,17 @@ lazy_initialize(int argc, VALUE *argv, VALUE self)
}
generator = generator_allocate(rb_cGenerator);
rb_block_call(generator, id_initialize, 0, 0, lazy_init_block_i, obj);
- enumerator_init(self, generator, sym_each, 0, 0, 0, size, 0);
+ enumerator_init(self, generator, sym_each, 0, 0, 0, size);
rb_ivar_set(self, id_receiver, obj);
return self;
}
-#if 0 /* for RDoc */
-/*
- * call-seq:
- * lazy.to_a -> array
- * lazy.force -> array
- *
- * Expands +lazy+ enumerator to an array.
- * See Enumerable#to_a.
- */
-static VALUE lazy_to_a(VALUE self)
-{
-}
-#endif
-
-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 */
@@ -1801,64 +1415,19 @@ 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 an Enumerator::Lazy, which redefines most Enumerable
- * methods to postpone enumeration and enumerate values only on an
- * as-needed basis.
+ * Returns a lazy enumerator, whose methods map/collect,
+ * 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.
*
* === Example
*
@@ -1884,33 +1453,33 @@ lazy_add_method(VALUE obj, int argc, VALUE *argv, VALUE args, VALUE memo,
static VALUE
enumerable_lazy(VALUE obj)
{
- VALUE result = lazy_to_enum_i(obj, sym_each, 0, 0, lazyenum_size, PASS_KW_SPLAT);
+ VALUE result = lazy_to_enum_i(obj, sym_each, 0, 0, lazyenum_size);
/* Qfalse indicates that the Enumerator::Lazy has no method name */
rb_ivar_set(result, id_method, Qfalse);
return result;
}
static VALUE
-lazy_to_enum_i(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn, int kw_splat)
+lazy_to_enum_i(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator_size_func *size_fn)
{
return enumerator_init(enumerator_allocate(rb_cLazy),
- obj, meth, argc, argv, size_fn, Qnil, kw_splat);
+ obj, meth, argc, argv, size_fn, Qnil);
}
/*
* call-seq:
- * lzy.to_enum(method = :each, *args) -> lazy_enum
- * lzy.enum_for(method = :each, *args) -> lazy_enum
- * lzy.to_enum(method = :each, *args) {|*args| block } -> lazy_enum
- * lzy.enum_for(method = :each, *args) {|*args| block } -> lazy_enum
+ * lzy.to_enum(method = :each, *args) -> lazy_enum
+ * lzy.enum_for(method = :each, *args) -> lazy_enum
+ * lzy.to_enum(method = :each, *args) {|*args| block} -> lazy_enum
+ * lzy.enum_for(method = :each, *args){|*args| block} -> lazy_enum
*
- * Similar to Object#to_enum, except it returns a lazy enumerator.
+ * Similar to Kernel#to_enum, except it returns a lazy enumerator.
* This makes it easy to define Enumerable methods that will
* naturally remain lazy if called from a lazy enumerator.
*
- * For example, continuing from the example in Object#to_enum:
+ * For example, continuing from the example in Kernel#to_enum:
*
- * # See Object#to_enum for the definition of repeat
+ * # See Kernel#to_enum for the definition of repeat
* r = 1..Float::INFINITY
* r.repeat(2).first(5) # => [1, 1, 2, 2, 3]
* r.repeat(2).class # => Enumerator
@@ -1923,16 +1492,13 @@ lazy_to_enum_i(VALUE obj, VALUE meth, int argc, const VALUE *argv, rb_enumerator
static VALUE
lazy_to_enum(int argc, VALUE *argv, VALUE self)
{
- VALUE lazy, meth = sym_each, super_meth;
+ VALUE lazy, meth = sym_each;
if (argc > 0) {
--argc;
meth = *argv++;
}
- if (RTEST((super_meth = rb_hash_aref(lazy_use_super_method, meth)))) {
- meth = super_meth;
- }
- lazy = lazy_to_enum_i(self, meth, argc, argv, 0, PASS_KW_SPLAT);
+ lazy = lazy_to_enum_i(self, meth, argc, argv, 0);
if (rb_block_given_p()) {
enumerator_ptr(lazy)->size = rb_block_proc();
}
@@ -1940,78 +1506,14 @@ lazy_to_enum(int argc, VALUE *argv, VALUE self)
}
static VALUE
-lazy_eager_size(VALUE self, VALUE args, VALUE eobj)
-{
- return enum_size(self);
-}
-
-/*
- * call-seq:
- * lzy.eager -> enum
- *
- * Returns a non-lazy Enumerator converted from the lazy enumerator.
- */
-
-static VALUE
-lazy_eager(VALUE self)
-{
- return enumerator_init(enumerator_allocate(rb_cEnumerator),
- self, sym_each, 0, 0, lazy_eager_size, Qnil, 0);
-}
-
-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)
+lazy_map_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- 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)
-{
- 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,
-};
-
-/*
- * call-seq:
- * lazy.collect { |obj| block } -> lazy_enumerator
- * lazy.map { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#map, but chains operation to be lazy-evaluated.
- *
- * (1..Float::INFINITY).lazy.map {|i| i**2 }
- * #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map>
- * (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3)
- * #=> [1, 4, 9]
- */
-
static VALUE
lazy_map(VALUE obj)
{
@@ -2019,15 +1521,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))
{
- VALUE arg = rb_enum_values_pack(argc, argv);
-
- return rb_funcallv(yielder, idLTLT, 1, &arg);
+ return rb_funcall2(yielder, id_yield, argc, argv);
}
static VALUE
@@ -2042,25 +1544,25 @@ lazy_flat_map_to_ary(VALUE obj, VALUE yielder)
{
VALUE ary = rb_check_array_type(obj);
if (NIL_P(ary)) {
- rb_funcall(yielder, idLTLT, 1, obj);
+ rb_funcall(yielder, id_yield, 1, obj);
}
else {
long i;
for (i = 0; i < RARRAY_LEN(ary); i++) {
- rb_funcall(yielder, idLTLT, 1, RARRAY_AREF(ary, i));
+ rb_funcall(yielder, id_yield, 1, RARRAY_AREF(ary, i));
}
}
return Qnil;
}
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)) {
long i;
for (i = 0; i < RARRAY_LEN(result); i++) {
- rb_funcall(argv[0], idLTLT, 1, RARRAY_AREF(result, i));
+ rb_funcall(argv[0], id_yield, 1, RARRAY_AREF(result, i));
}
}
else {
@@ -2080,19 +1582,19 @@ lazy_flat_map_proc(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
* lazy.flat_map { |obj| block } -> a_lazy_enumerator
*
* Returns a new lazy enumerator with the concatenated results of running
- * +block+ once for every element in the lazy enumerator.
+ * <i>block</i> once for every element in <i>lazy</i>.
*
* ["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
* #=> ["f", "o", "o", "b", "a", "r"]
*
- * A value +x+ returned by +block+ is decomposed if either of
+ * A value <i>x</i> returned by <i>block</i> is decomposed if either of
* the following conditions is true:
*
- * * +x+ responds to both each and force, which means that
- * +x+ is a lazy enumerator.
- * * +x+ is an array or responds to to_ary.
+ * a) <i>x</i> responds to both each and force, which means that
+ * <i>x</i> is a lazy enumerator.
+ * b) <i>x</i> is an array or responds to to_ary.
*
- * Otherwise, +x+ is contained as-is in the return value.
+ * Otherwise, <i>x</i> is contained as-is in the return value.
*
* [{a:1}, {b:2}].lazy.flat_map {|i| i}.force
* #=> [{:a=>1}, {:b=>2}]
@@ -2105,30 +1607,21 @@ 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;
+}
-/*
- * call-seq:
- * lazy.find_all { |obj| block } -> lazy_enumerator
- * lazy.select { |obj| block } -> lazy_enumerator
- * lazy.filter { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#select, but chains operation to be lazy-evaluated.
- */
static VALUE
lazy_select(VALUE obj)
{
@@ -2136,62 +1629,22 @@ 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);
-}
-
-static struct MEMO *
-lazy_filter_map_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
-{
- VALUE value = lazyenum_yield_values(proc_entry, result);
- if (!RTEST(value)) return 0;
- LAZY_MEMO_SET_VALUE(result, value);
- LAZY_MEMO_RESET_PACKED(result);
- return result;
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_select_func, 0),
+ Qnil, 0);
}
-static const lazyenum_funcs lazy_filter_map_funcs = {
- lazy_filter_map_proc, 0,
-};
-
-/*
- * call-seq:
- * lazy.filter_map { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#filter_map, but chains operation to be lazy-evaluated.
- *
- * (1..).lazy.filter_map { |i| i * 2 if i.even? }.first(5)
- * #=> [4, 8, 12, 16, 20]
- */
-
static VALUE
-lazy_filter_map(VALUE obj)
+lazy_reject_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- if (!rb_block_given_p()) {
- rb_raise(rb_eArgError, "tried to call lazy filter_map without a block");
- }
-
- return lazy_add_method(obj, 0, 0, Qnil, Qnil, &lazy_filter_map_funcs);
-}
+ VALUE element = rb_enum_values_pack(argc - 1, argv + 1);
-static struct MEMO *
-lazy_reject_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
-{
- VALUE chain = lazyenum_yield(proc_entry, result);
- if (RTEST(chain)) return 0;
- return result;
+ if (!RTEST(rb_yield(element))) {
+ return rb_funcall(argv[0], id_yield, 1, element);
+ }
+ return Qnil;
}
-static const lazyenum_funcs lazy_reject_funcs = {
- lazy_reject_proc, 0,
-};
-
-/*
- * call-seq:
- * lazy.reject { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#reject, but chains operation to be lazy-evaluated.
- */
-
static VALUE
lazy_reject(VALUE obj)
{
@@ -2199,101 +1652,43 @@ 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;
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_reject_func, 0),
+ Qnil, 0);
}
-static const lazyenum_funcs lazy_grep_iter_funcs = {
- lazy_grep_iter_proc, 0,
-};
-
-static const lazyenum_funcs lazy_grep_funcs = {
- lazy_grep_proc, 0,
-};
-
-/*
- * call-seq:
- * lazy.grep(pattern) -> lazy_enumerator
- * lazy.grep(pattern) { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#grep, but chains operation to be lazy-evaluated.
- */
-
static VALUE
-lazy_grep(VALUE obj, VALUE pattern)
+lazy_grep_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- 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);
-}
+ VALUE i = rb_enum_values_pack(argc - 1, argv + 1);
+ VALUE result = rb_funcall(m, id_eqq, 1, i);
-static struct MEMO *
-lazy_grep_v_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;
+ if (RTEST(result)) {
+ rb_funcall(argv[0], id_yield, 1, i);
+ }
+ return Qnil;
}
-static struct MEMO *
-lazy_grep_v_iter_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
+static VALUE
+lazy_grep_iter(RB_BLOCK_CALL_FUNC_ARGLIST(val, m))
{
- 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);
+ VALUE i = rb_enum_values_pack(argc - 1, argv + 1);
+ VALUE result = rb_funcall(m, id_eqq, 1, i);
- return result;
+ if (RTEST(result)) {
+ rb_funcall(argv[0], id_yield, 1, rb_yield(i));
+ }
+ return Qnil;
}
-static const lazyenum_funcs lazy_grep_v_iter_funcs = {
- lazy_grep_v_iter_proc, 0,
-};
-
-static const lazyenum_funcs lazy_grep_v_funcs = {
- lazy_grep_v_proc, 0,
-};
-
-/*
- * call-seq:
- * lazy.grep_v(pattern) -> lazy_enumerator
- * lazy.grep_v(pattern) { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#grep_v, but chains operation to be lazy-evaluated.
- */
-
static VALUE
-lazy_grep_v(VALUE obj, VALUE pattern)
+lazy_grep(VALUE obj, VALUE pattern)
{
- const lazyenum_funcs *const funcs = rb_block_given_p() ?
- &lazy_grep_v_iter_funcs : &lazy_grep_v_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,
+ rb_block_given_p() ?
+ lazy_grep_iter : lazy_grep_func,
+ pattern),
+ rb_ary_new3(1, pattern), 0);
}
static VALUE
@@ -2303,7 +1698,7 @@ call_next(VALUE obj)
}
static VALUE
-next_stopped(VALUE obj, VALUE _)
+next_stopped(VALUE obj)
{
return Qnil;
}
@@ -2323,7 +1718,7 @@ lazy_zip_arrays_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, arrays))
for (i = 0; i < RARRAY_LEN(arrays); i++) {
rb_ary_push(ary, rb_ary_entry(RARRAY_AREF(arrays, i), count));
}
- rb_funcall(yielder, idLTLT, 1, ary);
+ rb_funcall(yielder, id_yield, 1, ary);
rb_ivar_set(yielder, id_memo, LONG2NUM(++count));
return Qnil;
}
@@ -2356,18 +1751,10 @@ lazy_zip_func(RB_BLOCK_CALL_FUNC_ARGLIST(val, zip_args))
rb_eStopIteration, (VALUE)0);
rb_ary_push(ary, v);
}
- rb_funcall(yielder, idLTLT, 1, ary);
+ rb_funcall(yielder, id_yield, 1, ary);
return Qnil;
}
-/*
- * call-seq:
- * lazy.zip(arg, ...) -> lazy_enumerator
- * lazy.zip(arg, ...) { |arr| block } -> nil
- *
- * Like Enumerable#zip, but chains operation to be lazy-evaluated.
- * However, if a block is given to zip, values are enumerated immediately.
- */
static VALUE
lazy_zip(int argc, VALUE *argv, VALUE obj)
{
@@ -2385,8 +1772,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);
@@ -2401,104 +1788,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,
-};
-
-/*
- * call-seq:
- * lazy.take(n) -> lazy_enumerator
- *
- * Like Enumerable#take, but chains operation to be lazy-evaluated.
- */
-
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,
-};
-
-/*
- * call-seq:
- * lazy.take_while { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#take_while, but chains operation to be lazy-evaluated.
- */
-
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)) {
@@ -2508,254 +1871,59 @@ 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,
-};
-
-/*
- * call-seq:
- * lazy.drop(n) -> lazy_enumerator
- *
- * Like Enumerable#drop, but chains operation to be lazy-evaluated.
- */
-
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,
-};
-
-/*
- * call-seq:
- * lazy.drop_while { |obj| block } -> lazy_enumerator
- *
- * Like Enumerable#drop_while, but chains operation to be lazy-evaluated.
- */
-
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 int
-lazy_uniq_check(VALUE chain, VALUE memos, long memo_index)
-{
- VALUE hash = rb_ary_entry(memos, memo_index);
-
- if (NIL_P(hash)) {
- hash = rb_obj_hide(rb_hash_new());
- rb_ary_store(memos, memo_index, hash);
- }
-
- return rb_hash_add_new_element(hash, chain, Qfalse);
-}
-
-static struct MEMO *
-lazy_uniq_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
-{
- if (lazy_uniq_check(result->memo_value, memos, memo_index)) return 0;
- return result;
-}
-
-static struct MEMO *
-lazy_uniq_iter_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_index)
-{
- VALUE chain = lazyenum_yield(proc_entry, result);
-
- if (lazy_uniq_check(chain, memos, memo_index)) return 0;
- return result;
-}
-
-static const lazyenum_funcs lazy_uniq_iter_funcs = {
- lazy_uniq_iter_proc, 0,
-};
-
-static const lazyenum_funcs lazy_uniq_funcs = {
- lazy_uniq_proc, 0,
-};
-
-/*
- * call-seq:
- * lazy.uniq -> lazy_enumerator
- * lazy.uniq { |item| block } -> lazy_enumerator
- *
- * Like Enumerable#uniq, but chains operation to be lazy-evaluated.
- */
-
-static VALUE
-lazy_uniq(VALUE obj)
-{
- const lazyenum_funcs *const funcs =
- rb_block_given_p() ? &lazy_uniq_iter_funcs : &lazy_uniq_funcs;
- return lazy_add_method(obj, 0, 0, Qnil, Qnil, funcs);
-}
-
-static struct MEMO *
-lazy_with_index_proc(VALUE proc_entry, struct MEMO* result, VALUE memos, long memo_index)
-{
- struct proc_entry *entry = proc_entry_ptr(proc_entry);
- VALUE memo = rb_ary_entry(memos, memo_index);
- VALUE argv[2];
-
- if (NIL_P(memo)) {
- memo = entry->memo;
- }
-
- argv[0] = result->memo_value;
- argv[1] = memo;
- if (entry->proc) {
- rb_proc_call_with_block(entry->proc, 2, argv, Qnil);
- LAZY_MEMO_RESET_PACKED(result);
- } else {
- LAZY_MEMO_SET_VALUE(result, rb_ary_new_from_values(2, argv));
- LAZY_MEMO_SET_PACKED(result);
- }
- rb_ary_store(memos, memo_index, LONG2NUM(NUM2LONG(memo) + 1));
- return result;
-}
-
-static const lazyenum_funcs lazy_with_index_funcs = {
- lazy_with_index_proc, 0,
-};
-
-/*
- * call-seq:
- * lazy.with_index(offset = 0) {|(*args), idx| block }
- * lazy.with_index(offset = 0)
- *
- * If a block is given, iterates the given block for each element
- * with an index, which starts from +offset+, and returns a
- * lazy enumerator that yields the same values (without the index).
- *
- * If a block is not given, returns a new lazy enumerator that
- * includes the index, starting from +offset+.
- *
- * +offset+:: the starting index to use
- *
- * See Enumerator#with_index.
- */
-static VALUE
-lazy_with_index(int argc, VALUE *argv, VALUE obj)
-{
- VALUE memo;
-
- rb_scan_args(argc, argv, "01", &memo);
- if (NIL_P(memo))
- memo = LONG2NUM(0);
-
- return lazy_add_method(obj, 0, 0, memo, rb_ary_new_from_values(1, &memo), &lazy_with_index_funcs);
-}
-
-#if 0 /* for RDoc */
-
-/*
- * call-seq:
- * lazy.chunk { |elt| ... } -> lazy_enumerator
- *
- * Like Enumerable#chunk, but chains operation to be lazy-evaluated.
- */
-static VALUE lazy_chunk(VALUE self)
-{
-}
-
-/*
- * call-seq:
- * lazy.chunk_while {|elt_before, elt_after| bool } -> lazy_enumerator
- *
- * Like Enumerable#chunk_while, but chains operation to be lazy-evaluated.
- */
-static VALUE lazy_chunk_while(VALUE self)
-{
-}
-
-/*
- * call-seq:
- * lazy.slice_after(pattern) -> lazy_enumerator
- * lazy.slice_after { |elt| bool } -> lazy_enumerator
- *
- * Like Enumerable#slice_after, but chains operation to be lazy-evaluated.
- */
-static VALUE lazy_slice_after(VALUE self)
-{
-}
-
-/*
- * call-seq:
- * lazy.slice_before(pattern) -> lazy_enumerator
- * lazy.slice_before { |elt| bool } -> lazy_enumerator
- *
- * Like Enumerable#slice_before, but chains operation to be lazy-evaluated.
- */
-static VALUE lazy_slice_before(VALUE self)
-{
-}
-
-/*
- * call-seq:
- * lazy.slice_when {|elt_before, elt_after| bool } -> lazy_enumerator
- *
- * Like Enumerable#slice_when, but chains operation to be lazy-evaluated.
- */
-static VALUE lazy_slice_when(VALUE self)
-{
+ return lazy_set_method(rb_block_call(rb_cLazy, id_new, 1, &obj,
+ lazy_drop_while_func, 0),
+ Qnil, 0);
}
-# endif
static VALUE
lazy_super(int argc, VALUE *argv, VALUE lazy)
@@ -2763,13 +1931,6 @@ lazy_super(int argc, VALUE *argv, VALUE lazy)
return enumerable_lazy(rb_call_super(argc, argv));
}
-/*
- * call-seq:
- * enum.lazy -> lazy_enumerator
- *
- * Returns self.
- */
-
static VALUE
lazy_lazy(VALUE obj)
{
@@ -2829,1078 +1990,9 @@ stop_result(VALUE self)
return rb_attr_get(self, id_result);
}
-/*
- * Producer
- */
-
-static void
-producer_mark(void *p)
-{
- struct producer *ptr = p;
- rb_gc_mark_movable(ptr->init);
- rb_gc_mark_movable(ptr->proc);
-}
-
-static void
-producer_compact(void *p)
-{
- struct producer *ptr = p;
- ptr->init = rb_gc_location(ptr->init);
- ptr->proc = rb_gc_location(ptr->proc);
-}
-
-#define producer_free RUBY_TYPED_DEFAULT_FREE
-
-static size_t
-producer_memsize(const void *p)
-{
- return sizeof(struct producer);
-}
-
-static const rb_data_type_t producer_data_type = {
- "producer",
- {
- producer_mark,
- producer_free,
- producer_memsize,
- producer_compact,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
-};
-
-static struct producer *
-producer_ptr(VALUE obj)
-{
- struct producer *ptr;
-
- TypedData_Get_Struct(obj, struct producer, &producer_data_type, ptr);
- if (!ptr || ptr->proc == Qundef) {
- rb_raise(rb_eArgError, "uninitialized producer");
- }
- return ptr;
-}
-
-/* :nodoc: */
-static VALUE
-producer_allocate(VALUE klass)
-{
- struct producer *ptr;
- VALUE obj;
-
- obj = TypedData_Make_Struct(klass, struct producer, &producer_data_type, ptr);
- ptr->init = Qundef;
- ptr->proc = Qundef;
-
- return obj;
-}
-
-static VALUE
-producer_init(VALUE obj, VALUE init, VALUE proc)
-{
- struct producer *ptr;
-
- TypedData_Get_Struct(obj, struct producer, &producer_data_type, ptr);
-
- if (!ptr) {
- rb_raise(rb_eArgError, "unallocated producer");
- }
-
- ptr->init = init;
- ptr->proc = proc;
-
- return obj;
-}
-
-static VALUE
-producer_each_stop(VALUE dummy, VALUE exc)
-{
- return rb_attr_get(exc, id_result);
-}
-
-static VALUE
-producer_each_i(VALUE obj)
-{
- struct producer *ptr;
- VALUE init, proc, curr;
-
- ptr = producer_ptr(obj);
- init = ptr->init;
- proc = ptr->proc;
-
- if (init == Qundef) {
- curr = Qnil;
- } else {
- rb_yield(init);
- curr = init;
- }
-
- for (;;) {
- curr = rb_funcall(proc, id_call, 1, curr);
- rb_yield(curr);
- }
-
- return Qnil;
-}
-
-/* :nodoc: */
-static VALUE
-producer_each(VALUE obj)
-{
- rb_need_block();
-
- return rb_rescue2(producer_each_i, obj, producer_each_stop, (VALUE)0, rb_eStopIteration, (VALUE)0);
-}
-
-static VALUE
-producer_size(VALUE obj, VALUE args, VALUE eobj)
-{
- return DBL2NUM(HUGE_VAL);
-}
-
-/*
- * call-seq:
- * Enumerator.produce(initial = nil) { |prev| block } -> enumerator
- *
- * Creates an infinite enumerator from any block, just called over and
- * over. The result of the previous iteration is passed to the next one.
- * If +initial+ is provided, it is passed to the first iteration, and
- * becomes the first element of the enumerator; if it is not provided,
- * the first iteration receives +nil+, and its result becomes the first
- * element of the iterator.
- *
- * Raising StopIteration from the block stops an iteration.
- *
- * Enumerator.produce(1, &:succ) # => enumerator of 1, 2, 3, 4, ....
- *
- * Enumerator.produce { rand(10) } # => infinite random number sequence
- *
- * ancestors = Enumerator.produce(node) { |prev| node = prev.parent or raise StopIteration }
- * enclosing_section = ancestors.find { |n| n.type == :section }
- *
- * Using ::produce together with Enumerable methods like Enumerable#detect,
- * Enumerable#slice, Enumerable#take_while can provide Enumerator-based alternatives
- * for +while+ and +until+ cycles:
- *
- * # Find next Tuesday
- * require "date"
- * Enumerator.produce(Date.today, &:succ).detect(&:tuesday?)
- *
- * # Simple lexer:
- * require "strscan"
- * scanner = StringScanner.new("7+38/6")
- * PATTERN = %r{\d+|[-/+*]}
- * Enumerator.produce { scanner.scan(PATTERN) }.slice_after { scanner.eos? }.first
- * # => ["7", "+", "38", "/", "6"]
- */
-static VALUE
-enumerator_s_produce(int argc, VALUE *argv, VALUE klass)
-{
- VALUE init, producer;
-
- if (!rb_block_given_p()) rb_raise(rb_eArgError, "no block given");
-
- if (rb_scan_args(argc, argv, "01", &init) == 0) {
- init = Qundef;
- }
-
- producer = producer_init(producer_allocate(rb_cEnumProducer), init, rb_block_proc());
-
- return rb_enumeratorize_with_size_kw(producer, sym_each, 0, 0, producer_size, RB_NO_KEYWORDS);
-}
-
-/*
- * Document-class: Enumerator::Chain
- *
- * Enumerator::Chain is a subclass of Enumerator, which represents a
- * chain of enumerables that works as a single enumerator.
- *
- * This type of objects can be created by Enumerable#chain and
- * Enumerator#+.
- */
-
-static void
-enum_chain_mark(void *p)
-{
- struct enum_chain *ptr = p;
- rb_gc_mark_movable(ptr->enums);
-}
-
-static void
-enum_chain_compact(void *p)
-{
- struct enum_chain *ptr = p;
- ptr->enums = rb_gc_location(ptr->enums);
-}
-
-#define enum_chain_free RUBY_TYPED_DEFAULT_FREE
-
-static size_t
-enum_chain_memsize(const void *p)
-{
- return sizeof(struct enum_chain);
-}
-
-static const rb_data_type_t enum_chain_data_type = {
- "chain",
- {
- enum_chain_mark,
- enum_chain_free,
- enum_chain_memsize,
- enum_chain_compact,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
-};
-
-static struct enum_chain *
-enum_chain_ptr(VALUE obj)
-{
- struct enum_chain *ptr;
-
- TypedData_Get_Struct(obj, struct enum_chain, &enum_chain_data_type, ptr);
- if (!ptr || ptr->enums == Qundef) {
- rb_raise(rb_eArgError, "uninitialized chain");
- }
- return ptr;
-}
-
-/* :nodoc: */
-static VALUE
-enum_chain_allocate(VALUE klass)
-{
- struct enum_chain *ptr;
- VALUE obj;
-
- obj = TypedData_Make_Struct(klass, struct enum_chain, &enum_chain_data_type, ptr);
- ptr->enums = Qundef;
- ptr->pos = -1;
-
- return obj;
-}
-
-/*
- * call-seq:
- * Enumerator::Chain.new(*enums) -> enum
- *
- * Generates a new enumerator object that iterates over the elements
- * of given enumerable objects in sequence.
- *
- * e = Enumerator::Chain.new(1..3, [4, 5])
- * e.to_a #=> [1, 2, 3, 4, 5]
- * e.size #=> 5
- */
-static VALUE
-enum_chain_initialize(VALUE obj, VALUE enums)
-{
- struct enum_chain *ptr;
-
- rb_check_frozen(obj);
- TypedData_Get_Struct(obj, struct enum_chain, &enum_chain_data_type, ptr);
-
- if (!ptr) rb_raise(rb_eArgError, "unallocated chain");
-
- ptr->enums = rb_obj_freeze(enums);
- ptr->pos = -1;
-
- return obj;
-}
-
-/* :nodoc: */
-static VALUE
-enum_chain_init_copy(VALUE obj, VALUE orig)
-{
- struct enum_chain *ptr0, *ptr1;
-
- if (!OBJ_INIT_COPY(obj, orig)) return obj;
- ptr0 = enum_chain_ptr(orig);
-
- TypedData_Get_Struct(obj, struct enum_chain, &enum_chain_data_type, ptr1);
-
- if (!ptr1) rb_raise(rb_eArgError, "unallocated chain");
-
- ptr1->enums = ptr0->enums;
- ptr1->pos = ptr0->pos;
-
- return obj;
-}
-
-static VALUE
-enum_chain_total_size(VALUE enums)
-{
- VALUE total = INT2FIX(0);
- long i;
-
- for (i = 0; i < RARRAY_LEN(enums); i++) {
- VALUE size = enum_size(RARRAY_AREF(enums, i));
-
- if (NIL_P(size) || (RB_TYPE_P(size, T_FLOAT) && isinf(NUM2DBL(size)))) {
- return size;
- }
- if (!RB_INTEGER_TYPE_P(size)) {
- return Qnil;
- }
-
- total = rb_funcall(total, '+', 1, size);
- }
-
- return total;
-}
-
-/*
- * call-seq:
- * obj.size -> int, Float::INFINITY or nil
- *
- * Returns the total size of the enumerator chain calculated by
- * summing up the size of each enumerable in the chain. If any of the
- * enumerables reports its size as nil or Float::INFINITY, that value
- * is returned as the total size.
- */
-static VALUE
-enum_chain_size(VALUE obj)
-{
- return enum_chain_total_size(enum_chain_ptr(obj)->enums);
-}
-
-static VALUE
-enum_chain_enum_size(VALUE obj, VALUE args, VALUE eobj)
-{
- return enum_chain_size(obj);
-}
-
-static VALUE
-enum_chain_enum_no_size(VALUE obj, VALUE args, VALUE eobj)
-{
- return Qnil;
-}
-
-/*
- * call-seq:
- * obj.each(*args) { |...| ... } -> obj
- * obj.each(*args) -> enumerator
- *
- * Iterates over the elements of the first enumerable by calling the
- * "each" method on it with the given arguments, then proceeds to the
- * following enumerables in sequence until all of the enumerables are
- * exhausted.
- *
- * If no block is given, returns an enumerator.
- */
-static VALUE
-enum_chain_each(int argc, VALUE *argv, VALUE obj)
-{
- VALUE enums, block;
- struct enum_chain *objptr;
- long i;
-
- RETURN_SIZED_ENUMERATOR(obj, argc, argv, argc > 0 ? enum_chain_enum_no_size : enum_chain_enum_size);
-
- objptr = enum_chain_ptr(obj);
- enums = objptr->enums;
- block = rb_block_proc();
-
- for (i = 0; i < RARRAY_LEN(enums); i++) {
- objptr->pos = i;
- rb_funcall_with_block(RARRAY_AREF(enums, i), id_each, argc, argv, block);
- }
-
- return obj;
-}
-
-/*
- * call-seq:
- * obj.rewind -> obj
- *
- * Rewinds the enumerator chain by calling the "rewind" method on each
- * enumerable in reverse order. Each call is performed only if the
- * enumerable responds to the method.
- */
-static VALUE
-enum_chain_rewind(VALUE obj)
-{
- struct enum_chain *objptr = enum_chain_ptr(obj);
- VALUE enums = objptr->enums;
- long i;
-
- for (i = objptr->pos; 0 <= i && i < RARRAY_LEN(enums); objptr->pos = --i) {
- rb_check_funcall(RARRAY_AREF(enums, i), id_rewind, 0, 0);
- }
-
- return obj;
-}
-
-static VALUE
-inspect_enum_chain(VALUE obj, VALUE dummy, int recur)
-{
- VALUE klass = rb_obj_class(obj);
- struct enum_chain *ptr;
-
- TypedData_Get_Struct(obj, struct enum_chain, &enum_chain_data_type, ptr);
-
- if (!ptr || ptr->enums == Qundef) {
- return rb_sprintf("#<%"PRIsVALUE": uninitialized>", rb_class_path(klass));
- }
-
- if (recur) {
- return rb_sprintf("#<%"PRIsVALUE": ...>", rb_class_path(klass));
- }
-
- return rb_sprintf("#<%"PRIsVALUE": %+"PRIsVALUE">", rb_class_path(klass), ptr->enums);
-}
-
-/*
- * call-seq:
- * obj.inspect -> string
- *
- * Returns a printable version of the enumerator chain.
- */
-static VALUE
-enum_chain_inspect(VALUE obj)
-{
- return rb_exec_recursive(inspect_enum_chain, obj, 0);
-}
-
-/*
- * call-seq:
- * e.chain(*enums) -> enumerator
- *
- * Returns an enumerator object generated from this enumerator and
- * given enumerables.
- *
- * e = (1..3).chain([4, 5])
- * e.to_a #=> [1, 2, 3, 4, 5]
- */
-static VALUE
-enum_chain(int argc, VALUE *argv, VALUE obj)
-{
- VALUE enums = rb_ary_new_from_values(1, &obj);
- rb_ary_cat(enums, argv, argc);
-
- return enum_chain_initialize(enum_chain_allocate(rb_cEnumChain), enums);
-}
-
-/*
- * call-seq:
- * e + enum -> enumerator
- *
- * Returns an enumerator object generated from this enumerator and a
- * given enumerable.
- *
- * e = (1..3).each + [4, 5]
- * e.to_a #=> [1, 2, 3, 4, 5]
- */
-static VALUE
-enumerator_plus(VALUE obj, VALUE eobj)
-{
- VALUE enums = rb_ary_new_from_args(2, obj, eobj);
-
- return enum_chain_initialize(enum_chain_allocate(rb_cEnumChain), enums);
-}
-
-/*
- * Document-class: Enumerator::ArithmeticSequence
- *
- * Enumerator::ArithmeticSequence is a subclass of Enumerator,
- * that is a representation of sequences of numbers with common difference.
- * Instances of this class can be generated by the Range#step and Numeric#step
- * methods.
- */
-
-VALUE
-rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv,
- rb_enumerator_size_func *size_fn,
- VALUE beg, VALUE end, VALUE step, int excl)
-{
- VALUE aseq = enumerator_init(enumerator_allocate(rb_cArithSeq),
- obj, meth, argc, argv, size_fn, Qnil, PASS_KW_SPLAT);
- rb_ivar_set(aseq, id_begin, beg);
- rb_ivar_set(aseq, id_end, end);
- rb_ivar_set(aseq, id_step, step);
- rb_ivar_set(aseq, id_exclude_end, excl ? Qtrue : Qfalse);
- return aseq;
-}
-
-/*
- * call-seq: aseq.begin -> num or nil
- *
- * Returns the number that defines the first element of this arithmetic
- * sequence.
- */
-static inline VALUE
-arith_seq_begin(VALUE self)
-{
- return rb_ivar_get(self, id_begin);
-}
-
-/*
- * call-seq: aseq.end -> num or nil
- *
- * Returns the number that defines the end of this arithmetic sequence.
- */
-static inline VALUE
-arith_seq_end(VALUE self)
-{
- return rb_ivar_get(self, id_end);
-}
-
-/*
- * call-seq: aseq.step -> num
- *
- * Returns the number that defines the common difference between
- * two adjacent elements in this arithmetic sequence.
- */
-static inline VALUE
-arith_seq_step(VALUE self)
-{
- return rb_ivar_get(self, id_step);
-}
-
-/*
- * call-seq: aseq.exclude_end? -> true or false
- *
- * Returns <code>true</code> if this arithmetic sequence excludes its end value.
- */
-static inline VALUE
-arith_seq_exclude_end(VALUE self)
-{
- return rb_ivar_get(self, id_exclude_end);
-}
-
-static inline int
-arith_seq_exclude_end_p(VALUE self)
-{
- return RTEST(arith_seq_exclude_end(self));
-}
-
-int
-rb_arithmetic_sequence_extract(VALUE obj, rb_arithmetic_sequence_components_t *component)
-{
- if (rb_obj_is_kind_of(obj, rb_cArithSeq)) {
- component->begin = arith_seq_begin(obj);
- component->end = arith_seq_end(obj);
- component->step = arith_seq_step(obj);
- component->exclude_end = arith_seq_exclude_end_p(obj);
- return 1;
- }
- else if (rb_obj_is_kind_of(obj, rb_cRange)) {
- component->begin = RANGE_BEG(obj);
- component->end = RANGE_END(obj);
- component->step = INT2FIX(1);
- component->exclude_end = RTEST(RANGE_EXCL(obj));
- return 1;
- }
-
- return 0;
-}
-
-/*
- * call-seq:
- * aseq.first -> num or nil
- * aseq.first(n) -> an_array
- *
- * Returns the first number in this arithmetic sequence,
- * or an array of the first +n+ elements.
- */
-static VALUE
-arith_seq_first(int argc, VALUE *argv, VALUE self)
-{
- VALUE b, e, s, ary;
- long n;
- int x;
-
- rb_check_arity(argc, 0, 1);
-
- b = arith_seq_begin(self);
- e = arith_seq_end(self);
- s = arith_seq_step(self);
- if (argc == 0) {
- if (NIL_P(b)) {
- return Qnil;
- }
- if (!NIL_P(e)) {
- VALUE zero = INT2FIX(0);
- int r = rb_cmpint(rb_num_coerce_cmp(s, zero, idCmp), s, zero);
- if (r > 0 && RTEST(rb_funcall(b, '>', 1, e))) {
- return Qnil;
- }
- if (r < 0 && RTEST(rb_funcall(b, '<', 1, e))) {
- return Qnil;
- }
- }
- return b;
- }
-
- // TODO: the following code should be extracted as arith_seq_take
-
- n = NUM2LONG(argv[0]);
- if (n < 0) {
- rb_raise(rb_eArgError, "attempt to take negative size");
- }
- if (n == 0) {
- return rb_ary_new_capa(0);
- }
-
- x = arith_seq_exclude_end_p(self);
-
- if (FIXNUM_P(b) && NIL_P(e) && FIXNUM_P(s)) {
- long i = FIX2LONG(b), unit = FIX2LONG(s);
- ary = rb_ary_new_capa(n);
- while (n > 0 && FIXABLE(i)) {
- rb_ary_push(ary, LONG2FIX(i));
- i += unit; // FIXABLE + FIXABLE never overflow;
- --n;
- }
- if (n > 0) {
- b = LONG2NUM(i);
- while (n > 0) {
- rb_ary_push(ary, b);
- b = rb_big_plus(b, s);
- --n;
- }
- }
- return ary;
- }
- else if (FIXNUM_P(b) && FIXNUM_P(e) && FIXNUM_P(s)) {
- long i = FIX2LONG(b);
- long end = FIX2LONG(e);
- long unit = FIX2LONG(s);
- long len;
-
- if (unit >= 0) {
- if (!x) end += 1;
-
- len = end - i;
- if (len < 0) len = 0;
- ary = rb_ary_new_capa((n < len) ? n : len);
- while (n > 0 && i < end) {
- rb_ary_push(ary, LONG2FIX(i));
- if (i + unit < i) break;
- i += unit;
- --n;
- }
- }
- else {
- if (!x) end -= 1;
-
- len = i - end;
- if (len < 0) len = 0;
- ary = rb_ary_new_capa((n < len) ? n : len);
- while (n > 0 && i > end) {
- rb_ary_push(ary, LONG2FIX(i));
- if (i + unit > i) break;
- i += unit;
- --n;
- }
- }
- return ary;
- }
- else if (RB_FLOAT_TYPE_P(b) || RB_FLOAT_TYPE_P(e) || RB_FLOAT_TYPE_P(s)) {
- /* generate values like ruby_float_step */
-
- double unit = NUM2DBL(s);
- double beg = NUM2DBL(b);
- double end = NIL_P(e) ? (unit < 0 ? -1 : 1)*HUGE_VAL : NUM2DBL(e);
- double len = ruby_float_step_size(beg, end, unit, x);
- long i;
-
- if (n > len)
- n = (long)len;
-
- if (isinf(unit)) {
- if (len > 0) {
- ary = rb_ary_new_capa(1);
- rb_ary_push(ary, DBL2NUM(beg));
- }
- else {
- ary = rb_ary_new_capa(0);
- }
- }
- else if (unit == 0) {
- VALUE val = DBL2NUM(beg);
- ary = rb_ary_new_capa(n);
- for (i = 0; i < len; ++i) {
- rb_ary_push(ary, val);
- }
- }
- else {
- ary = rb_ary_new_capa(n);
- for (i = 0; i < n; ++i) {
- double d = i*unit+beg;
- if (unit >= 0 ? end < d : d < end) d = end;
- rb_ary_push(ary, DBL2NUM(d));
- }
- }
-
- return ary;
- }
-
- return rb_call_super(argc, argv);
-}
-
-/*
- * call-seq:
- * aseq.last -> num or nil
- * aseq.last(n) -> an_array
- *
- * Returns the last number in this arithmetic sequence,
- * or an array of the last +n+ elements.
- */
-static VALUE
-arith_seq_last(int argc, VALUE *argv, VALUE self)
-{
- VALUE b, e, s, len_1, len, last, nv, ary;
- int last_is_adjusted;
- long n;
-
- e = arith_seq_end(self);
- if (NIL_P(e)) {
- rb_raise(rb_eRangeError,
- "cannot get the last element of endless arithmetic sequence");
- }
-
- b = arith_seq_begin(self);
- s = arith_seq_step(self);
-
- len_1 = rb_int_idiv(rb_int_minus(e, b), s);
- if (rb_num_negative_int_p(len_1)) {
- if (argc == 0) {
- return Qnil;
- }
- return rb_ary_new_capa(0);
- }
-
- last = rb_int_plus(b, rb_int_mul(s, len_1));
- if ((last_is_adjusted = arith_seq_exclude_end_p(self) && rb_equal(last, e))) {
- last = rb_int_minus(last, s);
- }
-
- if (argc == 0) {
- return last;
- }
-
- if (last_is_adjusted) {
- len = len_1;
- }
- else {
- len = rb_int_plus(len_1, INT2FIX(1));
- }
-
- rb_scan_args(argc, argv, "1", &nv);
- if (!RB_INTEGER_TYPE_P(nv)) {
- nv = rb_to_int(nv);
- }
- if (RTEST(rb_int_gt(nv, len))) {
- nv = len;
- }
- n = NUM2LONG(nv);
- if (n < 0) {
- rb_raise(rb_eArgError, "negative array size");
- }
-
- ary = rb_ary_new_capa(n);
- b = rb_int_minus(last, rb_int_mul(s, nv));
- while (n) {
- b = rb_int_plus(b, s);
- rb_ary_push(ary, b);
- --n;
- }
-
- return ary;
-}
-
-/*
- * call-seq:
- * aseq.inspect -> string
- *
- * Convert this arithmetic sequence to a printable form.
- */
-static VALUE
-arith_seq_inspect(VALUE self)
-{
- struct enumerator *e;
- VALUE eobj, str, eargs;
- int range_p;
-
- TypedData_Get_Struct(self, struct enumerator, &enumerator_data_type, e);
-
- eobj = rb_attr_get(self, id_receiver);
- if (NIL_P(eobj)) {
- eobj = e->obj;
- }
-
- range_p = RTEST(rb_obj_is_kind_of(eobj, rb_cRange));
- str = rb_sprintf("(%s%"PRIsVALUE"%s.", range_p ? "(" : "", eobj, range_p ? ")" : "");
-
- rb_str_buf_append(str, rb_id2str(e->meth));
-
- eargs = rb_attr_get(eobj, id_arguments);
- if (NIL_P(eargs)) {
- eargs = e->args;
- }
- if (eargs != Qfalse) {
- long argc = RARRAY_LEN(eargs);
- const VALUE *argv = RARRAY_CONST_PTR(eargs); /* WB: no new reference */
-
- if (argc > 0) {
- VALUE kwds = Qnil;
-
- rb_str_buf_cat2(str, "(");
-
- if (RB_TYPE_P(argv[argc-1], T_HASH)) {
- int all_key = TRUE;
- rb_hash_foreach(argv[argc-1], key_symbol_p, (VALUE)&all_key);
- if (all_key) kwds = argv[--argc];
- }
-
- while (argc--) {
- VALUE arg = *argv++;
-
- rb_str_append(str, rb_inspect(arg));
- rb_str_buf_cat2(str, ", ");
- }
- if (!NIL_P(kwds)) {
- rb_hash_foreach(kwds, kwd_append, str);
- }
- rb_str_set_len(str, RSTRING_LEN(str)-2); /* drop the last ", " */
- rb_str_buf_cat2(str, ")");
- }
- }
-
- rb_str_buf_cat2(str, ")");
-
- return str;
-}
-
-/*
- * call-seq:
- * aseq == obj -> true or false
- *
- * Returns <code>true</code> only if +obj+ is an Enumerator::ArithmeticSequence,
- * has equivalent begin, end, step, and exclude_end? settings.
- */
-static VALUE
-arith_seq_eq(VALUE self, VALUE other)
-{
- if (!RTEST(rb_obj_is_kind_of(other, rb_cArithSeq))) {
- return Qfalse;
- }
-
- if (!rb_equal(arith_seq_begin(self), arith_seq_begin(other))) {
- return Qfalse;
- }
-
- if (!rb_equal(arith_seq_end(self), arith_seq_end(other))) {
- return Qfalse;
- }
-
- if (!rb_equal(arith_seq_step(self), arith_seq_step(other))) {
- return Qfalse;
- }
-
- if (arith_seq_exclude_end_p(self) != arith_seq_exclude_end_p(other)) {
- return Qfalse;
- }
-
- return Qtrue;
-}
-
-/*
- * call-seq:
- * aseq.hash -> integer
- *
- * Compute a hash-value for this arithmetic sequence.
- * Two arithmetic sequences with same begin, end, step, and exclude_end?
- * values will generate the same hash-value.
- *
- * See also Object#hash.
- */
-static VALUE
-arith_seq_hash(VALUE self)
-{
- st_index_t hash;
- VALUE v;
-
- hash = rb_hash_start(arith_seq_exclude_end_p(self));
- v = rb_hash(arith_seq_begin(self));
- hash = rb_hash_uint(hash, NUM2LONG(v));
- v = rb_hash(arith_seq_end(self));
- hash = rb_hash_uint(hash, NUM2LONG(v));
- v = rb_hash(arith_seq_step(self));
- hash = rb_hash_uint(hash, NUM2LONG(v));
- hash = rb_hash_end(hash);
-
- return ST2FIX(hash);
-}
-
-#define NUM_GE(x, y) RTEST(rb_num_coerce_relop((x), (y), idGE))
-
-struct arith_seq_gen {
- VALUE current;
- VALUE end;
- VALUE step;
- int excl;
-};
-
-/*
- * call-seq:
- * aseq.each {|i| block } -> aseq
- * aseq.each -> aseq
- */
-static VALUE
-arith_seq_each(VALUE self)
-{
- VALUE c, e, s, len_1, last;
- int x;
-
- if (!rb_block_given_p()) return self;
-
- c = arith_seq_begin(self);
- e = arith_seq_end(self);
- s = arith_seq_step(self);
- x = arith_seq_exclude_end_p(self);
-
- if (!RB_TYPE_P(s, T_COMPLEX) && ruby_float_step(c, e, s, x, TRUE)) {
- return self;
- }
-
- if (NIL_P(e)) {
- while (1) {
- rb_yield(c);
- c = rb_int_plus(c, s);
- }
-
- return self;
- }
-
- if (rb_equal(s, INT2FIX(0))) {
- while (1) {
- rb_yield(c);
- }
-
- return self;
- }
-
- len_1 = rb_int_idiv(rb_int_minus(e, c), s);
- last = rb_int_plus(c, rb_int_mul(s, len_1));
- if (x && rb_equal(last, e)) {
- last = rb_int_minus(last, s);
- }
-
- if (rb_num_negative_int_p(s)) {
- while (NUM_GE(c, last)) {
- rb_yield(c);
- c = rb_int_plus(c, s);
- }
- }
- else {
- while (NUM_GE(last, c)) {
- rb_yield(c);
- c = rb_int_plus(c, s);
- }
- }
-
- return self;
-}
-
-static double
-arith_seq_float_step_size(double beg, double end, double step, int excl)
-{
- double const epsilon = DBL_EPSILON;
- double n, err;
-
- if (step == 0) {
- return HUGE_VAL;
- }
- n = (end - beg) / step;
- err = (fabs(beg) + fabs(end) + fabs(end - beg)) / fabs(step) * epsilon;
- if (isinf(step)) {
- return step > 0 ? beg <= end : beg >= end;
- }
- if (err > 0.5) err = 0.5;
- if (excl) {
- if (n <= 0) return 0;
- if (n < 1)
- n = 0;
- else
- n = floor(n - err);
- }
- else {
- if (n < 0) return 0;
- n = floor(n + err);
- }
- return n + 1;
-}
-
-/*
- * call-seq:
- * aseq.size -> num or nil
- *
- * Returns the number of elements in this arithmetic sequence if it is a finite
- * sequence. Otherwise, returns <code>nil</code>.
- */
-static VALUE
-arith_seq_size(VALUE self)
-{
- VALUE b, e, s, len_1, len, last;
- int x;
-
- b = arith_seq_begin(self);
- e = arith_seq_end(self);
- s = arith_seq_step(self);
- x = arith_seq_exclude_end_p(self);
-
- if (RB_FLOAT_TYPE_P(b) || RB_FLOAT_TYPE_P(e) || RB_FLOAT_TYPE_P(s)) {
- double ee, n;
-
- if (NIL_P(e)) {
- if (rb_num_negative_int_p(s)) {
- ee = -HUGE_VAL;
- }
- else {
- ee = HUGE_VAL;
- }
- }
- else {
- ee = NUM2DBL(e);
- }
-
- n = arith_seq_float_step_size(NUM2DBL(b), ee, NUM2DBL(s), x);
- if (isinf(n)) return DBL2NUM(n);
- if (POSFIXABLE(n)) return LONG2FIX(n);
- return rb_dbl2big(n);
- }
-
- if (NIL_P(e)) {
- return DBL2NUM(HUGE_VAL);
- }
-
- if (!rb_obj_is_kind_of(s, rb_cNumeric)) {
- s = rb_to_int(s);
- }
-
- if (rb_equal(s, INT2FIX(0))) {
- return DBL2NUM(HUGE_VAL);
- }
-
- len_1 = rb_int_idiv(rb_int_minus(e, b), s);
- if (rb_num_negative_int_p(len_1)) {
- return INT2FIX(0);
- }
-
- last = rb_int_plus(b, rb_int_mul(s, len_1));
- if (x && rb_equal(last, e)) {
- len = len_1;
- }
- else {
- len = rb_int_plus(len_1, INT2FIX(1));
- }
-
- return len;
-}
-
void
InitVM_Enumerator(void)
{
- ID id_private = rb_intern("private");
-
rb_define_method(rb_mKernel, "to_enum", obj_to_enum, -1);
rb_define_method(rb_mKernel, "enum_for", obj_to_enum, -1);
@@ -3923,65 +2015,21 @@ InitVM_Enumerator(void)
rb_define_method(rb_cEnumerator, "rewind", enumerator_rewind, 0);
rb_define_method(rb_cEnumerator, "inspect", enumerator_inspect, 0);
rb_define_method(rb_cEnumerator, "size", enumerator_size, 0);
- rb_define_method(rb_cEnumerator, "+", enumerator_plus, 1);
- rb_define_method(rb_mEnumerable, "chain", enum_chain, -1);
/* Lazy */
rb_cLazy = rb_define_class_under(rb_cEnumerator, "Lazy", rb_cEnumerator);
rb_define_method(rb_mEnumerable, "lazy", enumerable_lazy, 0);
-
- rb_define_alias(rb_cLazy, "_enumerable_map", "map");
- rb_define_alias(rb_cLazy, "_enumerable_collect", "collect");
- rb_define_alias(rb_cLazy, "_enumerable_flat_map", "flat_map");
- rb_define_alias(rb_cLazy, "_enumerable_collect_concat", "collect_concat");
- rb_define_alias(rb_cLazy, "_enumerable_select", "select");
- rb_define_alias(rb_cLazy, "_enumerable_find_all", "find_all");
- rb_define_alias(rb_cLazy, "_enumerable_filter", "filter");
- rb_define_alias(rb_cLazy, "_enumerable_filter_map", "filter_map");
- rb_define_alias(rb_cLazy, "_enumerable_reject", "reject");
- rb_define_alias(rb_cLazy, "_enumerable_grep", "grep");
- rb_define_alias(rb_cLazy, "_enumerable_grep_v", "grep_v");
- rb_define_alias(rb_cLazy, "_enumerable_zip", "zip");
- rb_define_alias(rb_cLazy, "_enumerable_take", "take");
- rb_define_alias(rb_cLazy, "_enumerable_take_while", "take_while");
- rb_define_alias(rb_cLazy, "_enumerable_drop", "drop");
- rb_define_alias(rb_cLazy, "_enumerable_drop_while", "drop_while");
- rb_define_alias(rb_cLazy, "_enumerable_uniq", "uniq");
- rb_define_private_method(rb_cLazy, "_enumerable_with_index", enumerator_with_index, -1);
-
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_map")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_collect")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_flat_map")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_collect_concat")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_select")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_find_all")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_filter")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_filter_map")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_reject")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_grep")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_grep_v")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_zip")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_take")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_take_while")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_drop")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_drop_while")));
- rb_funcall(rb_cLazy, id_private, 1, ID2SYM(rb_intern("_enumerable_uniq")));
-
rb_define_method(rb_cLazy, "initialize", lazy_initialize, -1);
rb_define_method(rb_cLazy, "to_enum", lazy_to_enum, -1);
rb_define_method(rb_cLazy, "enum_for", lazy_to_enum, -1);
- rb_define_method(rb_cLazy, "eager", lazy_eager, 0);
rb_define_method(rb_cLazy, "map", lazy_map, 0);
rb_define_method(rb_cLazy, "collect", lazy_map, 0);
rb_define_method(rb_cLazy, "flat_map", lazy_flat_map, 0);
rb_define_method(rb_cLazy, "collect_concat", lazy_flat_map, 0);
rb_define_method(rb_cLazy, "select", lazy_select, 0);
rb_define_method(rb_cLazy, "find_all", lazy_select, 0);
- rb_define_method(rb_cLazy, "filter", lazy_select, 0);
- rb_define_method(rb_cLazy, "filter_map", lazy_filter_map, 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);
@@ -3992,40 +2040,7 @@ InitVM_Enumerator(void)
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_method(rb_cLazy, "with_index", lazy_with_index, -1);
-
- lazy_use_super_method = rb_hash_new_with_size(18);
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("map")), ID2SYM(rb_intern("_enumerable_map")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("collect")), ID2SYM(rb_intern("_enumerable_collect")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("flat_map")), ID2SYM(rb_intern("_enumerable_flat_map")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("collect_concat")), ID2SYM(rb_intern("_enumerable_collect_concat")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("select")), ID2SYM(rb_intern("_enumerable_select")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("find_all")), ID2SYM(rb_intern("_enumerable_find_all")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("filter")), ID2SYM(rb_intern("_enumerable_filter")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("filter_map")), ID2SYM(rb_intern("_enumerable_filter_map")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("reject")), ID2SYM(rb_intern("_enumerable_reject")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("grep")), ID2SYM(rb_intern("_enumerable_grep")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("grep_v")), ID2SYM(rb_intern("_enumerable_grep_v")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("zip")), ID2SYM(rb_intern("_enumerable_zip")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("take")), ID2SYM(rb_intern("_enumerable_take")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("take_while")), ID2SYM(rb_intern("_enumerable_take_while")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("drop")), ID2SYM(rb_intern("_enumerable_drop")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("drop_while")), ID2SYM(rb_intern("_enumerable_drop_while")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("uniq")), ID2SYM(rb_intern("_enumerable_uniq")));
- rb_hash_aset(lazy_use_super_method, ID2SYM(rb_intern("with_index")), ID2SYM(rb_intern("_enumerable_with_index")));
- rb_obj_freeze(lazy_use_super_method);
- rb_gc_register_mark_object(lazy_use_super_method);
-
-#if 0 /* for RDoc */
- rb_define_method(rb_cLazy, "to_a", lazy_to_a, 0);
- rb_define_method(rb_cLazy, "chunk", lazy_chunk, 0);
- rb_define_method(rb_cLazy, "chunk_while", lazy_chunk_while, 0);
- rb_define_method(rb_cLazy, "slice_after", lazy_slice_after, 0);
- rb_define_method(rb_cLazy, "slice_before", lazy_slice_before, 0);
- rb_define_method(rb_cLazy, "slice_when", lazy_slice_when, 0);
-#endif
+
rb_define_alias(rb_cLazy, "force", "to_a");
rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);
@@ -4044,42 +2059,7 @@ InitVM_Enumerator(void)
rb_define_alloc_func(rb_cYielder, yielder_allocate);
rb_define_method(rb_cYielder, "initialize", yielder_initialize, 0);
rb_define_method(rb_cYielder, "yield", yielder_yield, -2);
- rb_define_method(rb_cYielder, "<<", yielder_yield_push, 1);
- rb_define_method(rb_cYielder, "to_proc", yielder_to_proc, 0);
-
- /* Producer */
- rb_cEnumProducer = rb_define_class_under(rb_cEnumerator, "Producer", rb_cObject);
- rb_define_alloc_func(rb_cEnumProducer, producer_allocate);
- rb_define_method(rb_cEnumProducer, "each", producer_each, 0);
- rb_define_singleton_method(rb_cEnumerator, "produce", enumerator_s_produce, -1);
-
- /* Chain */
- rb_cEnumChain = rb_define_class_under(rb_cEnumerator, "Chain", rb_cEnumerator);
- rb_define_alloc_func(rb_cEnumChain, enum_chain_allocate);
- rb_define_method(rb_cEnumChain, "initialize", enum_chain_initialize, -2);
- rb_define_method(rb_cEnumChain, "initialize_copy", enum_chain_init_copy, 1);
- rb_define_method(rb_cEnumChain, "each", enum_chain_each, -1);
- rb_define_method(rb_cEnumChain, "size", enum_chain_size, 0);
- rb_define_method(rb_cEnumChain, "rewind", enum_chain_rewind, 0);
- rb_define_method(rb_cEnumChain, "inspect", enum_chain_inspect, 0);
-
- /* ArithmeticSequence */
- rb_cArithSeq = rb_define_class_under(rb_cEnumerator, "ArithmeticSequence", rb_cEnumerator);
- rb_undef_alloc_func(rb_cArithSeq);
- rb_undef_method(CLASS_OF(rb_cArithSeq), "new");
- rb_define_method(rb_cArithSeq, "begin", arith_seq_begin, 0);
- rb_define_method(rb_cArithSeq, "end", arith_seq_end, 0);
- rb_define_method(rb_cArithSeq, "exclude_end?", arith_seq_exclude_end, 0);
- rb_define_method(rb_cArithSeq, "step", arith_seq_step, 0);
- rb_define_method(rb_cArithSeq, "first", arith_seq_first, -1);
- rb_define_method(rb_cArithSeq, "last", arith_seq_last, -1);
- rb_define_method(rb_cArithSeq, "inspect", arith_seq_inspect, 0);
- rb_define_method(rb_cArithSeq, "==", arith_seq_eq, 1);
- rb_define_method(rb_cArithSeq, "===", arith_seq_eq, 1);
- rb_define_method(rb_cArithSeq, "eql?", arith_seq_eq, 1);
- rb_define_method(rb_cArithSeq, "hash", arith_seq_hash, 0);
- rb_define_method(rb_cArithSeq, "each", arith_seq_each, 0);
- rb_define_method(rb_cArithSeq, "size", arith_seq_size, 0);
+ rb_define_method(rb_cYielder, "<<", yielder_yield_push, -2);
rb_provide("enumerator.so"); /* for backward compatibility */
}
@@ -4089,22 +2069,24 @@ void
Init_Enumerator(void)
{
id_rewind = rb_intern("rewind");
+ id_each = rb_intern("each");
+ id_call = rb_intern("call");
+ id_size = rb_intern("size");
+ id_yield = rb_intern("yield");
id_new = rb_intern("new");
+ id_initialize = rb_intern("initialize");
id_next = rb_intern("next");
id_result = rb_intern("result");
+ id_lazy = rb_intern("lazy");
+ id_eqq = rb_intern("===");
id_receiver = rb_intern("receiver");
id_arguments = rb_intern("arguments");
id_memo = rb_intern("memo");
id_method = rb_intern("method");
id_force = rb_intern("force");
id_to_enum = rb_intern("to_enum");
- id_begin = rb_intern("begin");
- id_end = rb_intern("end");
- id_step = rb_intern("step");
- id_exclude_end = rb_intern("exclude_end");
sym_each = ID2SYM(id_each);
sym_cycle = ID2SYM(rb_intern("cycle"));
- sym_yield = ID2SYM(rb_intern("yield"));
InitVM(Enumerator);
}
diff --git a/error.c b/error.c
index 9557d8552b..6b13c234b9 100644
--- a/error.c
+++ b/error.c
@@ -9,12 +9,9 @@
**********************************************************************/
-#include "ruby/encoding.h"
-#include "ruby/st.h"
#include "internal.h"
-#include "ruby_assert.h"
+#include "ruby/st.h"
#include "vm_core.h"
-#include "builtin.h"
#include <stdio.h>
#include <stdarg.h>
@@ -26,15 +23,6 @@
#include <unistd.h>
#endif
-#if defined __APPLE__
-# include <AvailabilityMacros.h>
-#endif
-
-/*!
- * \defgroup exception Exception handlings
- * \{
- */
-
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
@@ -47,20 +35,24 @@
#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;
-static VALUE rb_mWarning;
-static VALUE rb_cWarningBuffer;
-
-static ID id_warn;
extern const char ruby_description[];
+static const char REPORTBUG_MSG[] =
+ "[NOTE]\n" \
+ "You may have encountered a bug in the Ruby interpreter" \
+ " or extension libraries.\n" \
+ "Bug reports are welcome.\n" \
+ ""
+#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" \
+ ;
+
static const char *
rb_strerrno(int err)
{
@@ -87,9 +79,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);
@@ -100,344 +93,212 @@ 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);
- }
- else {
- mesg = rb_attr_get(exc, idMesg);
- if (RSTRING_LEN(mesg) > 0 && *(RSTRING_END(mesg)-1) != '\n')
- rb_str_cat_cstr(mesg, "\n");
+ if (!RTEST(err)) {
+ err = rb_exc_new2(rb_eSyntaxError, "compile error");
+ th->errinfo = err;
}
- err_vcatf(mesg, NULL, fn, line, fmt, args);
+ rb_str_cat2(mesg, "\n");
+ rb_write_error_str(mesg);
}
- return exc;
-}
-
-static unsigned int warning_disabled_categories;
-
-static unsigned int
-rb_warning_category_mask(VALUE category)
-{
- return 1U << rb_warning_category_from_name(category);
-}
-
-rb_warning_category_t
-rb_warning_category_from_name(VALUE category)
-{
- rb_warning_category_t cat = RB_WARN_CATEGORY_NONE;
- Check_Type(category, T_SYMBOL);
- if (category == ID2SYM(rb_intern("deprecated"))) {
- cat = RB_WARN_CATEGORY_DEPRECATED;
- }
- else if (category == ID2SYM(rb_intern("experimental"))) {
- cat = RB_WARN_CATEGORY_EXPERIMENTAL;
- }
- else {
- rb_raise(rb_eArgError, "unknown category: %"PRIsVALUE, category);
- }
- return cat;
+ /* returned to the parser world */
+ th->base_block = prev_base_block;
}
void
-rb_warning_category_update(unsigned int mask, unsigned int bits)
+rb_compile_error_with_enc(const char *file, int line, void *enc, const char *fmt, ...)
{
- warning_disabled_categories &= ~mask;
- warning_disabled_categories |= mask & ~bits;
-}
+ va_list args;
+ VALUE str;
-MJIT_FUNC_EXPORTED bool
-rb_warning_category_enabled_p(rb_warning_category_t category)
-{
- return !(warning_disabled_categories & (1U << category));
+ va_start(args, fmt);
+ str = compile_snprintf(enc, NULL, file, line, fmt, args);
+ va_end(args);
+ compile_err_append(str);
}
-/*
- * call-seq
- * Warning[category] -> true or false
- *
- * Returns the flag to show the warning messages for +category+.
- * Supported categories are:
- *
- * +:deprecated+ :: deprecation warnings
- * * assignment of non-nil value to <code>$,</code> and <code>$;</code>
- * * keyword arguments
- * * proc/lambda without block
- * etc.
- *
- * +:experimental+ :: experimental features
- * * Pattern matching
- */
-
-static VALUE
-rb_warning_s_aref(VALUE mod, VALUE category)
+void
+rb_compile_error(const char *file, int line, const char *fmt, ...)
{
- rb_warning_category_t cat = rb_warning_category_from_name(category);
- if (rb_warning_category_enabled_p(cat))
- return Qtrue;
- return Qfalse;
-}
-
-/*
- * call-seq
- * Warning[category] = flag -> flag
- *
- * Sets the warning flags for +category+.
- * See Warning.[] for the categories.
- */
+ va_list args;
+ VALUE str;
-static VALUE
-rb_warning_s_aset(VALUE mod, VALUE category, VALUE flag)
-{
- unsigned int mask = rb_warning_category_mask(category);
- unsigned int disabled = warning_disabled_categories;
- if (!RTEST(flag))
- disabled |= mask;
- else
- disabled &= ~mask;
- warning_disabled_categories = disabled;
- return flag;
+ va_start(args, fmt);
+ str = compile_snprintf(NULL, NULL, file, line, fmt, args);
+ va_end(args);
+ compile_err_append(str);
}
-/*
- * call-seq:
- * warn(msg) -> nil
- *
- * Writes warning message +msg+ to $stderr. This method is called by
- * Ruby for all emitted warnings.
- */
-
-static VALUE
-rb_warning_s_warn(VALUE mod, VALUE str)
+void
+rb_compile_error_append(const char *fmt, ...)
{
- Check_Type(str, T_STRING);
- rb_must_asciicompat(str);
- rb_write_error_str(str);
- return Qnil;
-}
-
-/*
- * Document-module: Warning
- *
- * The Warning module contains a single method named #warn, and the
- * module extends itself, making Warning.warn 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.
- */
+ va_list args;
+ VALUE str;
-static VALUE
-rb_warning_warn(VALUE mod, VALUE str)
-{
- return rb_funcallv(mod, id_warn, 1, &str);
+ va_start(args, fmt);
+ str = rb_vsprintf(fmt, args);
+ va_end(args);
+ compile_err_append(str);
}
static void
-rb_write_warning_str(VALUE str)
-{
- rb_warning_warn(rb_mWarning, str);
-}
-
-static VALUE
-warn_vsprintf(rb_encoding *enc, const char *file, int line, const char *fmt, va_list args)
+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)
{
- int line;
- const char *file = rb_source_location_cstr(&line);
- return warn_vsprintf(enc, file, line, fmt, args);
-}
+ VALUE str = rb_enc_str_new(0, 0, enc);
+ 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);
+ 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, ": ");
+ }
+
+ rb_str_cat2(str, "warning: ");
+ rb_str_vcatf(str, fmt, args);
+ rb_str_cat2(str, "\n");
+ return str;
+}
void
rb_warn(const char *fmt, ...)
{
- if (!NIL_P(ruby_verbose)) {
- with_warning_string(mesg, 0, fmt) {
- rb_write_warning_str(mesg);
- }
- }
+ VALUE mesg;
+ va_list args;
+
+ if (NIL_P(ruby_verbose)) return;
+
+ va_start(args, fmt);
+ mesg = warning_string(0, fmt, args);
+ va_end(args);
+ rb_write_error_str(mesg);
}
+#if 0
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);
- }
- }
+ VALUE mesg;
+ va_list args;
+
+ if (NIL_P(ruby_verbose)) return;
+
+ va_start(args, fmt);
+ mesg = warning_string(enc, fmt, args);
+ va_end(args);
+ rb_write_error_str(mesg);
}
+#endif
/* rb_warning() reports only in verbose mode */
void
rb_warning(const char *fmt, ...)
{
- if (RTEST(ruby_verbose)) {
- with_warning_string(mesg, 0, fmt) {
- rb_write_warning_str(mesg);
- }
- }
-}
+ VALUE mesg;
+ va_list args;
-VALUE
-rb_warning_string(const char *fmt, ...)
-{
- with_warning_string(mesg, 0, fmt) {
- }
- return mesg;
+ if (!RTEST(ruby_verbose)) return;
+
+ va_start(args, fmt);
+ mesg = warning_string(0, fmt, args);
+ va_end(args);
+ rb_write_error_str(mesg);
}
#if 0
void
rb_enc_warning(rb_encoding *enc, const char *fmt, ...)
{
- if (RTEST(ruby_verbose)) {
- with_warning_string(mesg, enc, fmt) {
- rb_write_warning_str(mesg);
- }
- }
-}
-#endif
-
-void
-rb_warn_deprecated(const char *fmt, const char *suggest, ...)
-{
- if (NIL_P(ruby_verbose)) return;
- if (!rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) return;
+ VALUE mesg;
va_list args;
- va_start(args, suggest);
- VALUE mesg = warning_string(0, fmt, args);
- va_end(args);
- rb_str_set_len(mesg, RSTRING_LEN(mesg) - 1);
- rb_str_cat_cstr(mesg, " is deprecated");
- if (suggest) rb_str_catf(mesg, "; use %s instead", suggest);
- rb_str_cat_cstr(mesg, "\n");
- rb_write_warning_str(mesg);
-}
-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;
-/* :nodoc: */
-static VALUE
-warning_write(int argc, VALUE *argv, VALUE buf)
-{
- while (argc-- > 0) {
- rb_str_append(buf, *argv++);
- }
- return buf;
+ va_start(args, fmt);
+ mesg = warning_string(enc, fmt, args);
+ va_end(args);
+ rb_write_error_str(mesg);
}
+#endif
+
+/*
+ * call-seq:
+ * warn(msg, ...) -> nil
+ *
+ * Displays each of the given messages followed by a record separator on
+ * STDERR unless warnings have been disabled (for example with the
+ * <code>-W0</code> flag).
+ *
+ * warn("warning 1", "warning 2")
+ *
+ * <em>produces:</em>
+ *
+ * warning 1
+ * warning 2
+ */
-VALUE rb_ec_backtrace_location_ary(rb_execution_context_t *ec, long lev, long n);
static VALUE
-rb_warn_m(rb_execution_context_t *ec, VALUE exc, VALUE msgs, VALUE uplevel)
+rb_warn_m(int argc, VALUE *argv, VALUE exc)
{
- VALUE location = Qnil;
- int argc = RARRAY_LENINT(msgs);
- const VALUE *argv = RARRAY_CONST_PTR(msgs);
-
if (!NIL_P(ruby_verbose) && argc > 0) {
- VALUE str = argv[0];
- if (!NIL_P(uplevel)) {
- long lev = NUM2LONG(uplevel);
- if (lev < 0) {
- rb_raise(rb_eArgError, "negative level (%ld)", lev);
- }
- location = rb_ec_backtrace_location_ary(ec, lev + 1, 1);
- 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);
- }
+ rb_io_puts(argc, argv, rb_stderr);
}
return Qnil;
}
@@ -476,88 +337,13 @@ bug_report_file(const char *file, int line)
if ((ssize_t)fwrite(buf, 1, len, out) == (ssize_t)len ||
(ssize_t)fwrite(buf, 1, len, (out = stdout)) == (ssize_t)len) {
- return out;
+ return out;
}
-
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];
@@ -566,24 +352,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);
-
-#if RUBY_DEVEL
- const char *cmd = getenv("RUBY_ON_BUG");
- if (cmd) {
- snprintf(buf, sizeof(buf), "%s %"PRI_PIDT_PREFIX"d", cmd, getpid());
- int r = system(buf);
- if (r == -1) {
- snprintf(buf, sizeof(buf), "Launching RUBY_ON_BUG command failed.");
- }
- }
-#endif
}
#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)
@@ -598,7 +372,7 @@ bug_report_end(FILE *out)
(*reporter->func)(out, reporter->data);
}
}
- postscript_dump(out);
+ fprintf(out, REPORTBUG_MSG);
}
#define report_bug(file, line, fmt, ctx) do { \
@@ -610,15 +384,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)
@@ -636,8 +401,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);
@@ -646,19 +412,18 @@ rb_bug(const char *fmt, ...)
}
void
-rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *ctx, const char *fmt, ...)
+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);
- if (default_sighandler) default_sighandler(sig);
-
die();
}
@@ -703,26 +468,17 @@ rb_async_bug_errno(const char *mesg, int errno_arg)
}
WRITE_CONST(2, "\n\n");
write_or_abort(2, ruby_description, strlen(ruby_description));
+ WRITE_CONST(2, "\n\n");
+ WRITE_CONST(2, REPORTBUG_MSG);
abort();
}
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);
-MJIT_FUNC_EXPORTED 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] = {
@@ -748,11 +504,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 */
};
@@ -767,8 +524,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;
@@ -776,7 +534,7 @@ builtin_class_name(VALUE x)
etype = "nil";
}
else if (FIXNUM_P(x)) {
- etype = "Integer";
+ etype = "Fixnum";
}
else if (SYMBOL_P(x)) {
etype = "Symbol";
@@ -788,74 +546,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
@@ -878,34 +594,23 @@ rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
return 1;
}
-#undef rb_typeddata_is_instance_of
-int
-rb_typeddata_is_instance_of(VALUE obj, const rb_data_type_t *data_type)
-{
- return rb_typeddata_is_instance_of_inline(obj, data_type);
-}
-
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);
}
@@ -918,7 +623,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;
@@ -932,7 +636,6 @@ VALUE rb_eSecurityError;
VALUE rb_eNotImpError;
VALUE rb_eNoMemError;
VALUE rb_cNameErrorMesg;
-VALUE rb_eNoMatchingPatternError;
VALUE rb_eScriptError;
VALUE rb_eSyntaxError;
@@ -942,24 +645,12 @@ VALUE rb_eSystemCallError;
VALUE rb_mErrno;
static VALUE rb_eNOERROR;
-ID ruby_static_id_cause;
-#define id_cause ruby_static_id_cause
-static ID id_message, id_backtrace;
-static ID id_key, id_args, id_Errno, id_errno, id_i_path;
-static ID id_receiver, id_recv, id_iseq, id_local_variables;
-static ID id_private_call_p, id_top, id_bottom;
-#define id_bt idBt
-#define id_bt_locations idBt_locations
-#define id_mesg idMesg
-#define id_name idName
-
#undef rb_exc_new_cstr
VALUE
rb_exc_new(VALUE etype, const char *ptr, long len)
{
- VALUE mesg = rb_str_new(ptr, len);
- return rb_class_new_instance(1, &mesg, etype);
+ return rb_funcall(etype, rb_intern("new"), 1, rb_str_new(ptr, len));
}
VALUE
@@ -972,16 +663,7 @@ VALUE
rb_exc_new_str(VALUE etype, VALUE str)
{
StringValue(str);
- return rb_class_new_instance(1, &str, etype);
-}
-
-static VALUE
-exc_init(VALUE exc, VALUE mesg)
-{
- rb_ivar_set(exc, id_mesg, mesg);
- rb_ivar_set(exc, id_bt, Qnil);
-
- return exc;
+ return rb_funcall(etype, rb_intern("new"), 1, str);
}
/*
@@ -997,8 +679,11 @@ exc_initialize(int argc, VALUE *argv, VALUE exc)
{
VALUE arg;
- arg = (!rb_check_arity(argc, 0, 1) ? Qnil : argv[0]);
- return exc_init(exc, arg);
+ rb_scan_args(argc, argv, "01", &arg);
+ rb_iv_set(exc, "mesg", arg);
+ rb_iv_set(exc, "bt", Qnil);
+
+ return exc;
}
/*
@@ -1019,11 +704,11 @@ exc_exception(int argc, VALUE *argv, VALUE self)
{
VALUE exc;
- argc = rb_check_arity(argc, 0, 1);
if (argc == 0) return self;
if (argc == 1 && self == argv[0]) return self;
exc = rb_obj_clone(self);
- rb_ivar_set(exc, id_mesg, argv[0]);
+ exc_initialize(argc, argv, exc);
+
return exc;
}
@@ -1038,118 +723,33 @@ 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 :bottom 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);
}
/*
* call-seq:
* exception.inspect -> string
*
- * Return this exception's class name and message.
+ * Return this exception's class name and message
*/
static VALUE
@@ -1160,7 +760,7 @@ exc_inspect(VALUE exc)
klass = CLASS_OF(exc);
exc = rb_obj_as_string(exc);
if (RSTRING_LEN(exc) == 0) {
- return rb_class_name(klass);
+ return rb_str_dup(rb_class_name(klass));
}
str = rb_str_buf_new2("#<");
@@ -1175,7 +775,7 @@ exc_inspect(VALUE exc)
/*
* call-seq:
- * exception.backtrace -> array or nil
+ * exception.backtrace -> array
*
* Returns any backtrace associated with the exception. The backtrace
* is an array of strings, each containing either ``filename:lineNo: in
@@ -1200,75 +800,70 @@ exc_inspect(VALUE exc)
* prog.rb:2:in `a'
* prog.rb:6:in `b'
* prog.rb:10
- *
- * In the case no backtrace has been set, +nil+ is returned
- *
- * ex = StandardError.new
- * ex.backtrace
- * #=> nil
*/
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;
}
-static VALUE rb_check_backtrace(VALUE);
-
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();
+ ID mid;
+ CONST_ID(mid, "backtrace");
+ if (rb_method_basic_definition_p(CLASS_OF(exc), mid)) {
+ VALUE info, klass = rb_eException;
+ rb_thread_t *th = GET_THREAD();
if (NIL_P(exc))
return Qnil;
- EXEC_EVENT_HOOK(ec, RUBY_EVENT_C_CALL, exc, mid, mid, klass, Qundef);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, exc, 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);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, exc, mid, klass, info);
+ if (NIL_P(info))
+ return Qnil;
+ return rb_check_backtrace(info);
}
- if (NIL_P(info)) return Qnil;
- return rb_check_backtrace(info);
+ return rb_funcall(exc, mid, 0, 0);
}
/*
* call-seq:
- * exception.backtrace_locations -> array or nil
+ * 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.
*
- * This method is not affected by Exception#set_backtrace().
+ * 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);
}
return obj;
}
-static VALUE
+VALUE
rb_check_backtrace(VALUE bt)
{
long i;
@@ -1303,10 +898,10 @@ 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));
}
-MJIT_FUNC_EXPORTED VALUE
+VALUE
rb_exc_set_backtrace(VALUE exc, VALUE bt)
{
return exc_set_backtrace(exc, bt);
@@ -1321,9 +916,11 @@ 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);
}
@@ -1337,7 +934,7 @@ try_convert_to_exception(VALUE obj)
* call-seq:
* exc == obj -> true or false
*
- * Equality---If <i>obj</i> is not an Exception, returns
+ * Equality---If <i>obj</i> is not an <code>Exception</code>, returns
* <code>false</code>. Otherwise, returns <code>true</code> if <i>exc</i> and
* <i>obj</i> share same class, messages, and backtrace.
*/
@@ -1346,14 +943,18 @@ static VALUE
exc_equal(VALUE exc, VALUE obj)
{
VALUE mesg, backtrace;
+ const ID id_mesg = idMesg;
if (exc == obj) return Qtrue;
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;
}
@@ -1425,14 +1026,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.
*/
@@ -1440,7 +1041,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"));
}
@@ -1454,7 +1055,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))
@@ -1466,49 +1067,6 @@ exit_success_p(VALUE exc)
return Qfalse;
}
-static VALUE
-err_init_recv(VALUE exc, VALUE recv)
-{
- if (recv != Qundef) rb_ivar_set(exc, id_recv, recv);
- return exc;
-}
-
-/*
- * call-seq:
- * FrozenError.new(msg=nil, receiver: nil) -> frozen_error
- *
- * Construct a new FrozenError exception. If given the <i>receiver</i>
- * parameter may subsequently be examined using the FrozenError#receiver
- * method.
- *
- * a = [].freeze
- * raise FrozenError.new("can't modify frozen array", receiver: a)
- */
-
-static VALUE
-frozen_err_initialize(int argc, VALUE *argv, VALUE self)
-{
- ID keywords[1];
- VALUE values[numberof(keywords)], options;
-
- argc = rb_scan_args(argc, argv, "*:", NULL, &options);
- keywords[0] = id_receiver;
- rb_get_kwargs(options, keywords, 0, numberof(values), values);
- rb_call_super(argc, argv);
- err_init_recv(self, values[0]);
- return self;
-}
-
-/*
- * Document-method: FrozenError#receiver
- * call-seq:
- * frozen_error.receiver -> object
- *
- * Return the receiver associated with this FrozenError exception.
- */
-
-#define frozen_err_receiver name_err_receiver
-
void
rb_name_error(ID id, const char *fmt, ...)
{
@@ -1539,62 +1097,26 @@ rb_name_error_str(VALUE str, const char *fmt, ...)
rb_exc_raise(exc);
}
-static VALUE
-name_err_init_attr(VALUE exc, VALUE recv, VALUE method)
-{
- const rb_execution_context_t *ec = GET_EC();
- rb_control_frame_t *cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(ec->cfp);
- cfp = rb_vm_get_ruby_level_next_cfp(ec, cfp);
- rb_ivar_set(exc, id_name, method);
- err_init_recv(exc, recv);
- if (cfp) rb_ivar_set(exc, id_iseq, rb_iseqw_new(cfp->iseq));
- return exc;
-}
-
/*
* call-seq:
- * NameError.new(msg=nil, name=nil, receiver: nil) -> 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 NameError#name
- * method. <i>receiver</i> parameter allows to pass object in
- * context of which the error happened. Example:
- *
- * [1, 2, 3].method(:rject) # NameError with name "rject" and receiver: Array
- * [1, 2, 3].singleton_method(:rject) # NameError with name "rject" and receiver: [1, 2, 3]
+ * parameter may subsequently be examined using the <code>NameError.name</code>
+ * method.
*/
static VALUE
name_err_initialize(int argc, VALUE *argv, VALUE self)
{
- ID keywords[1];
- VALUE values[numberof(keywords)], name, options;
+ VALUE name;
- argc = rb_scan_args(argc, argv, "*:", NULL, &options);
- keywords[0] = id_receiver;
- rb_get_kwargs(options, keywords, 0, numberof(values), values);
name = (argc > 1) ? argv[--argc] : Qnil;
rb_call_super(argc, argv);
- name_err_init_attr(self, values[0], name);
+ rb_iv_set(self, "name", name);
return self;
}
-static VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method);
-
-static VALUE
-name_err_init(VALUE exc, VALUE mesg, VALUE recv, VALUE method)
-{
- exc_init(exc, rb_name_err_mesg_new(mesg, recv, method));
- return name_err_init_attr(exc, recv, method);
-}
-
-VALUE
-rb_name_err_new(VALUE mesg, VALUE recv, VALUE method)
-{
- VALUE exc = rb_obj_alloc(rb_eNameError);
- return name_err_init(exc, mesg, recv, method);
-}
-
/*
* call-seq:
* name_error.name -> string or nil
@@ -1605,85 +1127,30 @@ rb_name_err_new(VALUE mesg, VALUE recv, VALUE method)
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;
-}
-
-static VALUE
-nometh_err_init_attr(VALUE exc, VALUE args, int priv)
-{
- rb_ivar_set(exc, id_args, args);
- rb_ivar_set(exc, id_private_call_p, priv ? Qtrue : Qfalse);
- return exc;
+ return rb_attr_get(self, rb_intern("name"));
}
/*
* call-seq:
- * NoMethodError.new(msg=nil, name=nil, args=nil, private=false, receiver: nil) -> 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
* the <code>#name</code> method on the resulting object, and the
* arguments using the <code>#args</code> method.
- *
- * If <i>private</i> argument were passed, it designates method was
- * attempted to call in private context, and can be accessed with
- * <code>#private_call?</code> method.
- *
- * <i>receiver</i> argument stores an object whose method was called.
*/
static VALUE
nometh_err_initialize(int argc, VALUE *argv, VALUE self)
{
- int priv;
- VALUE args, options;
- argc = rb_scan_args(argc, argv, "*:", NULL, &options);
- priv = (argc > 3) && (--argc, RTEST(argv[argc]));
- args = (argc > 2) ? argv[--argc] : Qnil;
- if (!NIL_P(options)) argv[argc++] = options;
- rb_call_super_kw(argc, argv, RB_PASS_CALLED_KEYWORDS);
- return nometh_err_init_attr(self, args, priv);
-}
-
-VALUE
-rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv)
-{
- VALUE exc = rb_obj_alloc(rb_eNoMethodError);
- name_err_init(exc, mesg, recv, method);
- return nometh_err_init_attr(exc, args, priv);
+ VALUE args = (argc > 2) ? argv[--argc] : Qnil;
+ name_err_initialize(argc, argv, self);
+ 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)
@@ -1697,7 +1164,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 = {
@@ -1711,16 +1178,19 @@ static const rb_data_type_t name_err_mesg_data_type = {
};
/* :nodoc: */
-static VALUE
-rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method)
+VALUE
+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;
}
@@ -1751,25 +1221,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);
@@ -1778,21 +1246,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] == '#');
+ desc = RSTRING_PTR(d);
break;
}
- if (!singleton) {
- s = FAKE_CSTR(&s_str, ":");
- c = rb_class_name(CLASS_OF(obj));
- }
- else {
- c = s = FAKE_CSTR(&s_str, "");
+ 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)));
}
- args[0] = 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;
}
@@ -1813,29 +1278,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_recv, 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
@@ -1845,20 +1287,7 @@ name_err_receiver(VALUE self)
static VALUE
nometh_err_args(VALUE self)
{
- return rb_attr_get(self, id_args);
-}
-
-/*
- * call-seq:
- * no_method_error.private_call? -> true or false
- *
- * Return true if the caused method was called as private.
- */
-
-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
@@ -1870,116 +1299,21 @@ 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:
- * KeyError.new(message=nil, receiver: nil, key: nil) -> key_error
- *
- * Construct a new +KeyError+ exception with the given message,
- * receiver and key.
- */
-
-static VALUE
-key_err_initialize(int argc, VALUE *argv, VALUE self)
-{
- VALUE options;
-
- rb_call_super(rb_scan_args(argc, argv, "01:", NULL, &options), argv);
-
- if (!NIL_P(options)) {
- ID keywords[2];
- VALUE values[numberof(keywords)];
- int i;
- keywords[0] = id_receiver;
- keywords[1] = id_key;
- rb_get_kwargs(options, keywords, 0, numberof(values), values);
- for (i = 0; i < numberof(values); ++i) {
- if (values[i] != Qundef) {
- rb_ivar_set(self, keywords[i], values[i]);
- }
- }
- }
-
- return self;
-}
-
-/*
- * 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_lit("compile error");
- argc = 1;
- argv = &mesg;
- }
- return rb_call_super(argc, argv);
-}
-
-/*
* Document-module: Errno
*
- * Ruby exception objects are subclasses of Exception. However,
- * operating systems typically report errors using plain
- * integers. Module Errno is created dynamically to map these
- * operating system errors to Ruby classes, with each error number
- * generating its own subclass of SystemCallError. As the subclass
- * is created in module Errno, its name will start
- * <code>Errno::</code>.
+ * Ruby exception objects are subclasses of <code>Exception</code>.
+ * However, operating systems typically report errors using plain
+ * integers. Module <code>Errno</code> is created dynamically to map
+ * these operating system errors to Ruby classes, with each error
+ * number generating its own subclass of <code>SystemCallError</code>.
+ * As the subclass is created in module <code>Errno</code>, its name
+ * will start <code>Errno::</code>.
*
- * The names of the <code>Errno::</code> classes depend on the
- * environment in which Ruby runs. On a typical Unix or Windows
- * platform, there are Errno classes such as Errno::EACCES,
- * Errno::EAGAIN, Errno::EINTR, and so on.
+ * The names of the <code>Errno::</code> classes depend on
+ * the environment in which Ruby runs. On a typical Unix or Windows
+ * platform, there are <code>Errno</code> classes such as
+ * <code>Errno::EACCES</code>, <code>Errno::EAGAIN</code>,
+ * <code>Errno::EINTR</code>, and so on.
*
* The integer operating system error number corresponding to a
* particular error is available as the class constant
@@ -1990,7 +1324,7 @@ syntax_error_initialize(int argc, VALUE *argv, VALUE self)
* Errno::EINTR::Errno #=> 4
*
* The full list of operating system errors on your particular platform
- * are available as the constants of Errno.
+ * are available as the constants of <code>Errno</code>.
*
* Errno.constants #=> :E2BIG, :EACCES, :EADDRINUSE, :EADDRNOTAVAIL, ...
*/
@@ -2049,10 +1383,11 @@ get_syserr(int n)
* call-seq:
* SystemCallError.new(msg, errno) -> system_call_error_subclass
*
- * If _errno_ corresponds to a known system error code, constructs the
- * appropriate Errno class for that error, otherwise constructs a
- * generic SystemCallError object. The error number is subsequently
- * available via the #errno method.
+ * If _errno_ corresponds to a known system error code, constructs
+ * the appropriate <code>Errno</code> class for that error, otherwise
+ * constructs a generic <code>SystemCallError</code> object. The
+ * error number is subsequently available via the <code>errno</code>
+ * method.
*/
static VALUE
@@ -2082,7 +1417,7 @@ 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";
@@ -2093,17 +1428,18 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
if (!NIL_P(func)) rb_str_catf(errmsg, " @ %"PRIsVALUE, func);
rb_str_catf(errmsg, " - %"PRIsVALUE, str);
+ OBJ_INFECT(errmsg, mesg);
}
mesg = errmsg;
rb_call_super(1, &mesg);
- rb_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.
*/
@@ -2111,7 +1447,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"));
}
/*
@@ -2126,17 +1462,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;
@@ -2191,8 +1530,8 @@ syserr_eqq(VALUE self, VALUE exc)
/*
* Document-class: Interrupt
*
- * Raised when the interrupt signal is received, typically because the
- * user has pressed Control-C (on most posix platforms). As such, it is a
+ * Raised with the interrupt signal is received, typically because the
+ * user pressed on Control-C (on most posix platforms). As such, it is a
* subclass of +SignalException+.
*
* begin
@@ -2236,7 +1575,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:
*
@@ -2344,7 +1683,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>
*
@@ -2365,22 +1704,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"
@@ -2393,7 +1727,19 @@ syserr_eqq(VALUE self, VALUE exc)
/*
* Document-class: SecurityError
*
- * No longer used by internal code.
+ * Raised when attempting a potential unsafe operation, typically when
+ * the $SAFE level is raised above 0.
+ *
+ * foo = "bar"
+ * proc = Proc.new do
+ * $SAFE = 3
+ * foo.untaint
+ * end
+ * proc.call
+ *
+ * <em>raises the exception:</em>
+ *
+ * SecurityError: Insecure: Insecure operation `untaint' at level 3
*/
/*
@@ -2434,8 +1780,8 @@ syserr_eqq(VALUE self, VALUE exc)
/*
* Document-class: fatal
*
- * fatal is an Exception that is raised when Ruby has encountered a fatal
- * error and must exit.
+ * fatal is an Exception that is raised when ruby has encountered a fatal
+ * error and must exit. You are not able to rescue fatal.
*/
/*
@@ -2444,46 +1790,32 @@ syserr_eqq(VALUE self, VALUE exc)
*/
/*
- * \Class Exception and its subclasses are used to communicate between
+ * Descendants of class Exception are used to communicate between
* Kernel#raise and +rescue+ statements in <code>begin ... end</code> blocks.
+ * Exception objects carry information about the exception -- its type (the
+ * exception's class name), an optional descriptive string, and optional
+ * traceback information. Exception subclasses may add additional
+ * information like NameError#name.
*
- * An Exception object carries information about an exception:
- * - Its type (the exception's class).
- * - An optional descriptive message.
- * - Optional backtrace information.
- *
- * Some built-in subclasses of Exception have additional methods: e.g., NameError#name.
- *
- * == Defaults
- *
- * Two Ruby statements have default exception classes:
- * - +raise+: defaults to RuntimeError.
- * - +rescue+: defaults to StandardError.
- *
- * == Global Variables
+ * Programs may make subclasses of Exception, typically of StandardError or
+ * RuntimeError, to provide custom classes and add additional information.
+ * See the subclass list below for defaults for +raise+ and +rescue+.
*
* When an exception has been raised but not yet handled (in +rescue+,
- * +ensure+, +at_exit+ and +END+ blocks), two global variables are set:
- * - <code>$!</code> contains the current exception.
- * - <code>$@</code> contains its backtrace.
- *
- * == Custom Exceptions
- *
- * To provide additional or alternate information,
- * a program may create custom exception classes
- * that derive from the built-in exception classes.
+ * +ensure+, +at_exit+ and +END+ blocks) the global variable <code>$!</code>
+ * will contain the current exception and <code>$@</code> contains the
+ * current exception's backtrace.
*
- * A good practice is for a library to create a single "generic" exception class
- * (typically a subclass of StandardError or RuntimeError)
- * and have its other exception classes derive from that class.
- * This allows the user to rescue the generic exception, thus catching all exceptions
+ * It is recommended that a library should have one subclass of StandardError
+ * or RuntimeError and have specific exception types inherit from it. This
+ * allows the user to rescue a generic exception type to catch all exceptions
* the library may raise even if future versions of the library add new
* exception subclasses.
*
* For example:
*
* class MyLibrary
- * class Error < ::StandardError
+ * class Error < RuntimeError
* end
*
* class WidgetError < Error
@@ -2494,10 +1826,8 @@ syserr_eqq(VALUE self, VALUE exc)
*
* end
*
- * To handle both MyLibrary::WidgetError and MyLibrary::FrobError the library
- * user can rescue MyLibrary::Error.
- *
- * == Built-In Exception Classes
+ * To handle both WidgetError and FrobError the library user can rescue
+ * MyLibrary::Error.
*
* The built-in subclasses of Exception are:
*
@@ -2509,7 +1839,7 @@ syserr_eqq(VALUE self, VALUE exc)
* * SecurityError
* * SignalException
* * Interrupt
- * * StandardError
+ * * StandardError -- default for +rescue+
* * ArgumentError
* * UncaughtThrowError
* * EncodingError
@@ -2519,15 +1849,13 @@ syserr_eqq(VALUE self, VALUE exc)
* * IndexError
* * KeyError
* * StopIteration
- * * ClosedQueueError
* * LocalJumpError
* * NameError
* * NoMethodError
* * RangeError
* * FloatDomainError
* * RegexpError
- * * RuntimeError
- * * FrozenError
+ * * RuntimeError -- default for +raise+
* * SystemCallError
* * Errno::*
* * ThreadError
@@ -2535,7 +1863,7 @@ syserr_eqq(VALUE self, VALUE exc)
* * ZeroDivisionError
* * SystemExit
* * SystemStackError
- * * fatal
+ * * fatal -- impossible to rescue
*/
void
@@ -2543,13 +1871,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);
@@ -2570,14 +1896,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, "initialize", key_err_initialize, -1);
- 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 */
@@ -2588,9 +1910,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);
@@ -2598,17 +1919,12 @@ 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_define_method(rb_eFrozenError, "initialize", frozen_err_initialize, -1);
- rb_define_method(rb_eFrozenError, "receiver", frozen_err_receiver, 0);
rb_eSecurityError = rb_define_class("SecurityError", rb_eException);
rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException);
rb_eEncodingError = rb_define_class("EncodingError", rb_eStandardError);
rb_eEncCompatError = rb_define_class_under(rb_cEncoding, "CompatibilityError", rb_eEncodingError);
- rb_eNoMatchingPatternError = rb_define_class("NoMatchingPatternError", rb_eRuntimeError);
syserr_tbl = st_init_numtable();
rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError);
@@ -2618,32 +1934,7 @@ Init_Exception(void)
rb_mErrno = rb_define_module("Errno");
- rb_mWarning = rb_define_module("Warning");
- rb_define_singleton_method(rb_mWarning, "[]", rb_warning_s_aref, 1);
- rb_define_singleton_method(rb_mWarning, "[]=", rb_warning_s_aset, 2);
- rb_define_method(rb_mWarning, "warn", rb_warning_s_warn, 1);
- rb_extend_object(rb_mWarning, rb_mWarning);
-
- /* :nodoc: */
- rb_cWarningBuffer = rb_define_class_under(rb_mWarning, "buffer", rb_cString);
- rb_define_method(rb_cWarningBuffer, "write", warning_write, -1);
-
- id_cause = rb_intern_const("cause");
- id_message = rb_intern_const("message");
- id_backtrace = rb_intern_const("backtrace");
- 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();
- id_recv = rb_make_internal_id();
+ rb_define_global_function("warn", rb_warn_m, -1);
}
void
@@ -2660,18 +1951,15 @@ rb_enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
}
void
-rb_vraise(VALUE exc, const char *fmt, va_list ap)
-{
- rb_exc_raise(rb_exc_new3(exc, rb_vsprintf(fmt, ap)));
-}
-
-void
rb_raise(VALUE exc, const char *fmt, ...)
{
va_list args;
+ VALUE mesg;
+
va_start(args, fmt);
- rb_vraise(exc, fmt, args);
+ mesg = rb_vsprintf(fmt, args);
va_end(args);
+ rb_exc_raise(rb_exc_new3(exc, mesg));
}
NORETURN(static void raise_loaderror(VALUE path, VALUE mesg));
@@ -2680,7 +1968,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);
}
@@ -2722,14 +2010,6 @@ rb_fatal(const char *fmt, ...)
va_list args;
VALUE mesg;
- if (! ruby_thread_has_gvl_p()) {
- /* The thread has no GVL. Object allocation impossible (cant run GC),
- * thus no message can be printed out. */
- fprintf(stderr, "[FATAL] rb_fatal() outside of GVL\n");
- rb_print_backtrace();
- die();
- }
-
va_start(args, fmt);
mesg = rb_vsprintf(fmt, args);
va_end(args);
@@ -2861,104 +2141,44 @@ 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, ...)
+rb_sys_warning(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;
- }
-}
+ VALUE mesg;
+ va_list args;
+ int 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);
- }
- }
-}
+ errno_save = errno;
-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;
- }
-}
+ if (!RTEST(ruby_verbose)) return;
-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);
- }
- }
+ va_start(args, fmt);
+ mesg = warning_string(0, fmt, args);
+ va_end(args);
+ rb_str_set_len(mesg, RSTRING_LEN(mesg)-1);
+ rb_str_catf(mesg, ": %s\n", strerror(errno_save));
+ rb_write_error_str(mesg);
+ errno = errno_save;
}
-#endif
void
-rb_sys_warning(const char *fmt, ...)
+rb_sys_enc_warning(rb_encoding *enc, 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;
- }
-}
+ VALUE mesg;
+ 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);
- }
- }
+ va_start(args, fmt);
+ mesg = warning_string(enc, fmt, args);
+ va_end(args);
+ rb_str_set_len(mesg, RSTRING_LEN(mesg)-1);
+ rb_str_catf(mesg, ": %s\n", strerror(errno_save));
+ rb_write_error_str(mesg);
+ errno = errno_save;
}
void
@@ -2973,54 +2193,14 @@ 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_frozen_error_raise(VALUE frozen_obj, const char *fmt, ...)
-{
- va_list args;
- VALUE exc, mesg;
-
- va_start(args, fmt);
- mesg = rb_vsprintf(fmt, args);
- va_end(args);
- exc = rb_exc_new3(rb_eFrozenError, mesg);
- rb_ivar_set(exc, id_recv, frozen_obj);
- rb_exc_raise(exc);
-}
-
-static VALUE
-inspect_frozen_obj(VALUE obj, VALUE mesg, int recur)
-{
- if (recur) {
- rb_str_cat_cstr(mesg, " ...");
- }
- else {
- rb_str_append(mesg, rb_inspect(obj));
- }
- return mesg;
+ rb_raise(rb_eRuntimeError, "can't modify frozen %s", what);
}
void
rb_error_frozen_object(VALUE frozen_obj)
{
- VALUE debug_info;
- const ID created_info = id_debug_created_info;
- VALUE mesg = rb_sprintf("can't modify frozen %"PRIsVALUE": ",
- CLASS_OF(frozen_obj));
- VALUE exc = rb_exc_new_str(rb_eFrozenError, mesg);
-
- rb_ivar_set(exc, id_recv, frozen_obj);
- rb_exec_recursive(inspect_frozen_obj, frozen_obj, mesg);
-
- 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_str_catf(mesg, ", created at %"PRIsVALUE":%"PRIsVALUE, path, line);
- }
- rb_exc_raise(exc);
+ rb_raise(rb_eRuntimeError, "can't modify frozen %"PRIsVALUE,
+ CLASS_OF(frozen_obj));
}
#undef rb_check_frozen
@@ -3033,14 +2213,12 @@ rb_check_frozen(VALUE obj)
void
rb_error_untrusted(VALUE obj)
{
- rb_warning("rb_error_untrusted is deprecated and will be removed in Ruby 3.2.");
}
#undef rb_check_trusted
void
rb_check_trusted(VALUE obj)
{
- rb_warning("rb_check_trusted is deprecated and will be removed in Ruby 3.2.");
}
void
@@ -3049,6 +2227,12 @@ rb_check_copyable(VALUE obj, VALUE orig)
if (!FL_ABLE(obj)) return;
rb_check_frozen_internal(obj);
if (!FL_ABLE(orig)) return;
+ if ((~RBASIC(obj)->flags & RBASIC(orig)->flags) & FL_TAINT) {
+ if (rb_safe_level() > 0) {
+ rb_raise(rb_eSecurityError, "Insecure: can't modify %"PRIsVALUE,
+ RBASIC(obj)->klass);
+ }
+ }
}
void
@@ -3061,15 +2245,3 @@ Init_syserr(void)
#undef defined_error
#undef undefined_error
}
-
-#include "warning.rbinc"
-
-void
-Init_warning(void)
-{
- load_warning();
-}
-
-/*!
- * \}
- */
diff --git a/eval.c b/eval.c
index f2fde81e19..9fb819ae84 100644
--- a/eval.c
+++ b/eval.c
@@ -17,25 +17,14 @@
#include "gc.h"
#include "ruby/vm.h"
#include "vm_core.h"
-#include "mjit.h"
-#include "probes.h"
#include "probes_helper.h"
-#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
-#endif
NORETURN(void rb_raise_jump(VALUE, VALUE));
-void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec);
-
-static int rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex);
-static int rb_ec_exec_node(rb_execution_context_t *ec, void *n);
VALUE rb_eLocalJumpError;
VALUE rb_eSysStackError;
-ID ruby_static_id_signo, ruby_static_id_status;
-extern ID ruby_static_id_cause;
-#define id_cause ruby_static_id_cause
+static ID id_cause;
#define exception_error GET_VM()->special_exceptions[ruby_error_reenter]
@@ -46,46 +35,38 @@ extern ID ruby_static_id_cause;
(!SPECIAL_CONST_P(obj) && \
(BUILTIN_TYPE(obj) == T_CLASS || BUILTIN_TYPE(obj) == T_MODULE))
-/*!
- * Initializes the 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);
-
- /*
- * Disable THP early before mallocs happen because we want this to
- * affect as many future pages as possible for CoW-friendliness
- */
-#if defined(__linux__) && defined(PR_SET_THP_DISABLE)
- prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0);
-#endif
Init_BareVM();
Init_heap();
- rb_vm_encoded_insn_data_table_init();
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.
*/
@@ -94,8 +75,7 @@ ruby_init(void)
{
int state = ruby_setup();
if (state) {
- if (RTEST(ruby_debug))
- error_print(GET_EC());
+ error_print();
exit(EXIT_FAILURE);
}
}
@@ -113,42 +93,41 @@ ruby_init(void)
void *
ruby_options(int argc, char **argv)
{
- rb_execution_context_t *ec = GET_EC();
- enum ruby_tag_type state;
+ int state;
void *volatile iseq = 0;
ruby_init_stack((void *)&iseq);
- EC_PUSH_TAG(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 {
- rb_ec_clear_current_thread_trace_func(ec);
- state = error_handle(ec, state);
+ rb_clear_trace_func();
+ state = error_handle(state);
iseq = (void *)INT2FIX(state);
}
- EC_POP_TAG();
+ POP_TAG();
return iseq;
}
static void
-rb_ec_teardown(rb_execution_context_t *ec)
+ruby_finalize_0(void)
{
- EC_PUSH_TAG(ec);
- if (EC_EXEC_TAG() == TAG_NONE) {
- rb_vm_trap_exit(rb_ec_vm_ptr(ec));
+ PUSH_TAG();
+ if (EXEC_TAG() == 0) {
+ rb_trap_exit();
}
- EC_POP_TAG();
- rb_ec_exec_end_proc(ec);
- rb_ec_clear_current_thread_trace_func(ec);
+ POP_TAG();
+ rb_exec_end_proc();
+ rb_clear_trace_func();
}
static void
-rb_ec_finalize(rb_execution_context_t *ec)
+ruby_finalize_1(void)
{
ruby_sig_finalize();
- ec->errinfo = Qnil;
- rb_objspace_call_finalizer(rb_ec_vm_ptr(ec)->objspace);
+ GET_THREAD()->errinfo = Qnil;
+ rb_gc_call_finalizer_at_exit();
}
/** Runs the VM finalization processes.
@@ -161,9 +140,8 @@ rb_ec_finalize(rb_execution_context_t *ec)
void
ruby_finalize(void)
{
- rb_execution_context_t *ec = GET_EC();
- rb_ec_teardown(ec);
- rb_ec_finalize(ec);
+ ruby_finalize_0();
+ ruby_finalize_1();
}
/** Destructs the VM.
@@ -179,106 +157,106 @@ ruby_finalize(void)
int
ruby_cleanup(volatile int ex)
{
- return rb_ec_cleanup(GET_EC(), ex);
-}
-
-static int
-rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex)
-{
int state;
- volatile VALUE errs[2] = { Qundef, Qundef };
+ volatile VALUE errs[2];
+ rb_thread_t *th = GET_THREAD();
int nerr;
- rb_thread_t *th = rb_ec_thread_ptr(ec);
- rb_thread_t *const volatile th0 = th;
- volatile int sysex = EXIT_SUCCESS;
- volatile int step = 0;
rb_threadptr_interrupt(th);
rb_threadptr_check_signal(th);
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- th = th0;
- SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(ec); });
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
+ SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(th); });
+ }
+ POP_TAG();
- step_0: step++;
- th = th0;
- errs[1] = ec->errinfo;
- if (THROW_DATA_P(ec->errinfo)) ec->errinfo = Qnil;
- 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)]);
- SAVE_ROOT_JMPBUF(th, rb_ec_teardown(ec));
+ PUSH_TAG();
+ if ((state = EXEC_TAG()) == 0) {
+ SAVE_ROOT_JMPBUF(th, ruby_finalize_0());
+ }
+ POP_TAG();
- step_1: step++;
- th = th0;
- /* protect from Thread#raise */
- th->status = THREAD_KILLED;
+ /* protect from Thread#raise */
+ th->status = THREAD_KILLED;
- errs[0] = 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 = th0;
- ec->errinfo = errs[1];
- sysex = error_handle(ec, 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;
- /* 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;
}
}
- mjit_finish(true); // We still need ISeqs here.
-
- rb_ec_finalize(ec);
+ ruby_finalize_1();
/* unlock again if finalizer took mutexes. */
- rb_threadptr_unlock_all_locking_mutexes(th);
- EC_POP_TAG();
- rb_thread_stop_timer_thread();
- ruby_vm_destruct(th->vm);
+ rb_threadptr_unlock_all_locking_mutexes(GET_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
-rb_ec_exec_node(rb_execution_context_t *ec, void *n)
+ruby_exec_internal(void *n)
{
volatile int state;
- rb_iseq_t *iseq = (rb_iseq_t *)n;
+ VALUE iseq = (VALUE)n;
+ rb_thread_t *th = GET_THREAD();
+
if (!n) return 0;
- EC_PUSH_TAG(ec);
- if ((state = EC_EXEC_TAG()) == TAG_NONE) {
- rb_thread_t *const th = rb_ec_thread_ptr(ec);
+ 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;
}
@@ -325,14 +303,12 @@ ruby_executable_node(void *n, int *status)
int
ruby_run_node(void *n)
{
- rb_execution_context_t *ec = GET_EC();
int status;
if (!ruby_executable_node(n, &status)) {
- rb_ec_cleanup(ec, 0);
+ ruby_cleanup(0);
return status;
}
- ruby_init_stack((void *)&status);
- return rb_ec_cleanup(ec, rb_ec_exec_node(ec, n));
+ return ruby_cleanup(ruby_exec_node(n));
}
/*! Runs the given compiled source */
@@ -340,7 +316,7 @@ int
ruby_exec_node(void *n)
{
ruby_init_stack((void *)&n);
- return rb_ec_exec_node(GET_EC(), n);
+ return ruby_exec_internal(n);
}
/*
@@ -359,18 +335,18 @@ ruby_exec_node(void *n)
*/
static VALUE
-rb_mod_nesting(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;
}
@@ -400,7 +376,7 @@ rb_mod_nesting(VALUE _)
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;
@@ -410,15 +386,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) {
@@ -427,14 +403,8 @@ 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_class_modify_check(VALUE klass)
+rb_frozen_class_p(VALUE klass)
{
if (SPECIAL_CONST_P(klass)) {
noclass:
@@ -471,18 +441,18 @@ rb_class_modify_check(VALUE klass)
goto noclass;
}
}
- rb_frozen_error_raise(klass, "can't modify frozen %s: %"PRIsVALUE, desc, klass);
+ rb_error_frozen(desc);
}
}
-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);
-#define get_ec_errinfo(ec) rb_ec_get_errinfo(ec)
+static VALUE get_thread_errinfo(rb_thread_t *th);
static VALUE
exc_setup_cause(VALUE exc, VALUE cause)
{
-#if OPT_SUPPORT_JOKE
+#if SUPPORT_JOKE
if (NIL_P(cause)) {
ID id_true_cause;
CONST_ID(id_true_cause, "true_cause");
@@ -498,210 +468,172 @@ 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;
- int nocircular = 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;
- nocircular = 1;
}
- if (*cause == Qundef) {
- if (nocause) {
- *cause = Qnil;
- nocircular = 1;
- }
- else if (!rb_ivar_defined(mesg, id_cause)) {
- *cause = get_ec_errinfo(ec);
- }
- else {
- nocircular = 1;
- }
+ if (cause != Qundef) {
+ exc_setup_cause(mesg, cause);
}
- else if (!NIL_P(*cause) && !rb_obj_is_kind_of(*cause, rb_eException)) {
- rb_raise(rb_eTypeError, "exception object expected");
+ else if (nocause) {
+ exc_setup_cause(mesg, Qnil);
}
-
- if (!nocircular && !NIL_P(*cause) && *cause != Qundef && *cause != mesg) {
- VALUE c = *cause;
- while (!NIL_P(c = rb_attr_get(c, id_cause))) {
- if (c == mesg) {
- rb_raise(rb_eArgError, "circular causes");
- }
- }
+ else if (!rb_ivar_defined(mesg, id_cause)) {
+ exc_setup_cause(mesg, get_thread_errinfo(th));
}
- return mesg;
-}
-static void
-setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE cause)
-{
- VALUE e;
- int line;
- const char *file = rb_source_location_cstr(&line);
- const char *const volatile file0 = file;
-
- 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);
+ 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) {
+ 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();
- file = file0;
- if (state) goto fatal;
+ else {
+ int status;
+
+ TH_PUSH_TAG(th);
+ if ((status = EXEC_TAG()) == 0) {
+ VALUE bt;
+ if (rb_threadptr_set_raised(th)) goto fatal;
+ bt = rb_get_backtrace(mesg);
+ if (NIL_P(bt)) {
+ at = rb_vm_backtrace_object();
+ if (OBJ_FROZEN(mesg)) {
+ mesg = rb_obj_dup(mesg);
+ }
+ rb_ivar_set(mesg, idBt_locations, at);
+ set_backtrace(mesg, at);
+ }
+ rb_threadptr_reset_raised(th);
+ }
+ TH_POP_TAG();
+ }
}
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)) {
+ if (rb_threadptr_set_raised(th)) {
fatal:
- ec->errinfo = exception_error;
- rb_ec_reset_raised(ec);
- EC_JUMP_TAG(ec, TAG_FATAL);
+ 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_exc_raise(rb_exc_new(rb_eInterrupt, 0, 0));
+ 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) {
@@ -722,61 +654,50 @@ extract_raise_opts(int argc, const VALUE *argv, VALUE *opts)
return argc;
}
-VALUE
-rb_f_raise(int argc, VALUE *argv)
-{
- VALUE err;
- VALUE opts[raise_max_opt], *const cause = &opts[raise_opt_cause];
-
- argc = extract_raise_opts(argc, argv, opts);
- if (argc == 0) {
- if (*cause != Qundef) {
- rb_raise(rb_eArgError, "only cause is given with no arguments");
- }
- err = get_errinfo();
- if (!NIL_P(err)) {
- argc = 1;
- argv = &err;
- }
- }
- rb_raise_jump(rb_make_exception(argc, argv), *cause);
-
- UNREACHABLE_RETURN(Qnil);
-}
-
/*
* call-seq:
* raise
- * raise(string, cause: $!)
- * raise(exception [, string [, array]], cause: $!)
+ * raise(string)
+ * raise(exception [, string [, array]])
* fail
- * fail(string, cause: $!)
- * fail(exception [, string [, array]], cause: $!)
+ * fail(string)
+ * fail(exception [, string [, array]])
*
* With no arguments, raises the exception in <code>$!</code> or raises
- * a RuntimeError if <code>$!</code> is +nil+. With a single +String+
- * argument, raises a +RuntimeError+ with the string as a message. Otherwise,
- * the first parameter should be an +Exception+ class (or another
- * object that returns an +Exception+ object when sent an +exception+
- * message). The optional second parameter sets the message associated with
- * the exception (accessible via Exception#message), and the third parameter
- * is an array of callback information (accessible via Exception#backtrace).
- * The +cause+ of the generated exception (accessible via Exception#cause)
- * is automatically set to the "current" exception (<code>$!</code>), if any.
- * An alternative value, either an +Exception+ object or +nil+, can be
- * specified via the +:cause+ argument.
- *
- * Exceptions are caught by the +rescue+ clause of
- * <code>begin...end</code> blocks.
+ * a <code>RuntimeError</code> if <code>$!</code> is +nil+.
+ * With a single +String+ argument, raises a
+ * +RuntimeError+ with the string as a message. Otherwise,
+ * the first parameter should be the name of an +Exception+
+ * class (or an object that returns an +Exception+ object when sent
+ * an +exception+ message). The optional second parameter sets the
+ * message associated with the exception, and the third parameter is an
+ * array of callback information. Exceptions are caught by the
+ * +rescue+ clause of <code>begin...end</code> blocks.
*
* raise "Failed to create socket"
* raise ArgumentError, "No parameters", caller
*/
static VALUE
-f_raise(int c, VALUE *v, VALUE _)
+rb_f_raise(int argc, VALUE *argv)
{
- return rb_f_raise(c, v);
+ VALUE err;
+ VALUE opts[raise_max_opt], *const cause = &opts[raise_opt_cause];
+
+ argc = extract_raise_opts(argc, argv, opts);
+ if (argc == 0) {
+ if (*cause != Qundef) {
+ rb_raise(rb_eArgError, "only cause is given with no arguments");
+ }
+ err = get_errinfo();
+ if (!NIL_P(err)) {
+ argc = 1;
+ argv = &err;
+ }
+ }
+ rb_raise_jump(rb_make_exception(argc, argv), *cause);
+
+ UNREACHABLE;
}
static VALUE
@@ -808,13 +729,15 @@ make_exception(int argc, const VALUE *argv, int isstr)
exc = argv[0];
n = 1;
exception_call:
+ if (sysstack_error_p(exc)) return exc;
mesg = rb_check_funcall(exc, idException, n, argv+1);
if (mesg == Qundef) {
rb_raise(rb_eTypeError, "exception class/object expected");
}
break;
default:
- rb_error_arity(argc, 0, 3);
+ rb_check_arity(argc, 0, 3);
+ break;
}
if (argc > 0) {
if (!rb_obj_is_kind_of(mesg, rb_eException))
@@ -826,107 +749,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_vm_cframe_keyword_p(const rb_control_frame_t *cfp);
-
int
-rb_keyword_given_p(void)
+rb_iterator_p(void)
{
- return rb_vm_cframe_keyword_p(GET_EC()->cfp);
-}
-
-/* -- Remove In 3.0 -- */
-int rb_vm_cframe_empty_keyword_p(const rb_control_frame_t *cfp);
-int
-rb_empty_keyword_given_p(void)
-{
- return rb_vm_cframe_empty_keyword_p(GET_EC()->cfp);
+ 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)
{
@@ -935,56 +808,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) (VALUE), VALUE data1,
- VALUE (* r_proc) (VALUE, VALUE), VALUE data2, ...)
-{
- va_list ap;
- va_start(ap, data2);
- VALUE ret = rb_vrescue2(b_proc, data1, r_proc, data2, ap);
- va_end(ap);
- return ret;
-}
-
-/*!
- * \copydoc rb_rescue2
- * \param[in] args exception classes, terminated by 0.
- */
VALUE
-rb_vrescue2(VALUE (* b_proc) (VALUE), VALUE data1,
- VALUE (* r_proc) (VALUE, VALUE), VALUE data2,
- va_list args)
+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);
}
@@ -992,221 +828,204 @@ rb_vrescue2(VALUE (* b_proc) (VALUE), 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;
VALUE eclass;
+ 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;
}
}
+ va_end(args);
if (handle) {
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)(VALUE), VALUE data1,
- VALUE (* r_proc)(VALUE, VALUE), VALUE data2)
+rb_rescue(VALUE (* b_proc)(ANYARGS), VALUE data1,
+ VALUE (* r_proc)(ANYARGS), VALUE data2)
{
return rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError,
(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)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2)
+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();
+ 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;
@@ -1215,7 +1034,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);
}
@@ -1223,27 +1042,21 @@ 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;
+ rb_thread_t *th = GET_THREAD();
+ rb_control_frame_t *cfp = th->cfp;
ID mid;
while (!(mid = frame_func_id(cfp)) &&
(cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp),
- !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(ec, cfp)));
+ !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)));
return mid;
}
@@ -1252,11 +1065,11 @@ rb_frame_last_func(void)
* append_features(mod) -> mod
*
* When this module is included in another, Ruby calls
- * #append_features in this module, passing it the receiving module
- * in _mod_. Ruby's default implementation is to add the constants,
- * methods, and module variables of this module to _mod_ if this
- * module has not already been added to _mod_ or one of its
- * ancestors. See also Module#include.
+ * <code>append_features</code> in this module, passing it the
+ * receiving module in _mod_. Ruby's default implementation is
+ * to add the constants, methods, and module variables of this module
+ * to _mod_ if this module has not already been added to
+ * _mod_ or one of its ancestors. See also <code>Module#include</code>.
*/
static VALUE
@@ -1274,7 +1087,7 @@ rb_mod_append_features(VALUE module, VALUE include)
* call-seq:
* include(module, ...) -> self
*
- * Invokes Module.append_features on each parameter in reverse order.
+ * Invokes <code>Module.append_features</code> on each parameter in reverse order.
*/
static VALUE
@@ -1286,7 +1099,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--) {
@@ -1301,11 +1113,11 @@ rb_mod_include(int argc, VALUE *argv, VALUE module)
* prepend_features(mod) -> mod
*
* When this module is prepended in another, Ruby calls
- * #prepend_features in this module, passing it the receiving module
- * in _mod_. Ruby's default implementation is to overlay the
- * constants, methods, and module variables of this module to _mod_
- * if this module has not already been added to _mod_ or one of its
- * ancestors. See also Module#prepend.
+ * <code>prepend_features</code> in this module, passing it the
+ * receiving module in _mod_. Ruby's default implementation is
+ * to overlay the constants, methods, and module variables of this module
+ * to _mod_ if this module has not already been added to
+ * _mod_ or one of its ancestors. See also <code>Module#prepend</code>.
*/
static VALUE
@@ -1323,7 +1135,7 @@ rb_mod_prepend_features(VALUE module, VALUE prepend)
* call-seq:
* prepend(module, ...) -> self
*
- * Invokes Module.prepend_features on each parameter in reverse order.
+ * Invokes <code>Module.prepend_features</code> on each parameter in reverse order.
*/
static VALUE
@@ -1334,8 +1146,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--) {
@@ -1345,57 +1155,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)
{
- 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) {
@@ -1407,34 +1192,33 @@ 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);
- RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
+ 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) {
FL_SET(module, RMODULE_IS_OVERLAID);
c = RCLASS_SET_SUPER(c, rb_include_class_new(module, RCLASS_SUPER(c)));
- RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
- module = RCLASS_SUPER(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;
@@ -1463,19 +1247,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)
{
@@ -1502,14 +1281,13 @@ add_activated_refinement(VALUE activated_refinements,
}
}
FL_SET(refinement, RMODULE_IS_OVERLAID);
- superclass = refinement_superclass(superclass);
c = iclass = rb_include_class_new(refinement, superclass);
- RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
+ 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)));
- RB_OBJ_WRITE(c, &RCLASS_REFINED_CLASS(c), klass);
+ RCLASS_REFINED_CLASS(c) = klass;
refinement = RCLASS_SUPER(refinement);
}
rb_hash_aset(activated_refinements, klass, iclass);
@@ -1517,11 +1295,11 @@ add_activated_refinement(VALUE activated_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
@@ -1532,19 +1310,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");
- }
-
- ensure_class_or_module(klass);
- if (RB_TYPE_P(klass, T_MODULE)) {
- FL_SET(klass, RCLASS_REFINED_BY_ANY);
+ if (block->proc) {
+ rb_raise(rb_eArgError,
+ "can't pass a Proc as a block to Module#refine");
}
+ Check_Type(klass, T_CLASS);
CONST_ID(id_refinements, "__refinements__");
refinements = rb_attr_get(module, id_refinements);
if (NIL_P(refinements)) {
@@ -1560,9 +1335,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);
@@ -1575,17 +1349,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
@@ -1597,7 +1360,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,
@@ -1606,96 +1370,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(VALUE _)
-{
- 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_kw(obj, idInitialize, argc, argv, RB_NO_KEYWORDS);
-}
-
-void
-rb_obj_call_init_kw(VALUE obj, int argc, const VALUE *argv, int kw_splat)
-{
- PASS_PASSED_BLOCK_HANDLER();
- rb_funcallv_kw(obj, idInitialize, argc, argv, kw_splat);
+ 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)
{
@@ -1708,7 +1393,7 @@ rb_extend_object(VALUE obj, VALUE module)
*
* Extends the specified object by adding this module's constants and
* methods (which are added as singleton methods). This is the callback
- * method used by Object#extend.
+ * method used by <code>Object#extend</code>.
*
* module Picky
* def Picky.extend_object(o)
@@ -1784,9 +1469,9 @@ rb_obj_extend(int argc, VALUE *argv, VALUE obj)
* call-seq:
* include(module, ...) -> self
*
- * Invokes Module.append_features on each parameter in turn.
- * Effectively adds the methods and constants in each module to the
- * receiver.
+ * Invokes <code>Module.append_features</code>
+ * on each parameter in turn. Effectively adds the methods and constants
+ * in each module to the receiver.
*/
static VALUE
@@ -1806,40 +1491,38 @@ top_include(int argc, VALUE *argv, VALUE self)
* using(module) -> self
*
* Import class refinements from <i>module</i> into the scope where
- * #using is called.
+ * <code>using</code> is called.
*/
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);
@@ -1847,61 +1530,73 @@ errinfo_place(const rb_execution_context_t *ec)
return 0;
}
-VALUE
-rb_ec_get_errinfo(const rb_execution_context_t *ec)
+static VALUE
+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
-errinfo_getter(ID id, VALUE *_)
+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
-errat_getter(ID id, VALUE *_)
+errat_getter(ID id)
{
VALUE err = get_errinfo();
if (!NIL_P(err)) {
@@ -1933,7 +1628,7 @@ errat_setter(VALUE val, ID id, VALUE *var)
*/
static VALUE
-rb_f_method_name(VALUE _)
+rb_f_method_name(void)
{
ID fname = prev_frame_func(); /* need *method* ID */
@@ -1955,7 +1650,7 @@ rb_f_method_name(VALUE _)
*/
static VALUE
-rb_f_callee_name(VALUE _)
+rb_f_callee_name(void)
{
ID fname = prev_frame_callee(); /* need *callee* ID */
@@ -1978,7 +1673,7 @@ rb_f_callee_name(VALUE _)
*
*/
static VALUE
-f_current_dirname(VALUE _)
+f_current_dirname(void)
{
VALUE base = rb_current_realfilepath();
if (NIL_P(base)) {
@@ -1988,76 +1683,16 @@ f_current_dirname(VALUE _)
return base;
}
-/*
- * call-seq:
- * global_variables -> array
- *
- * Returns an array of the names of global variables.
- *
- * global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]
- */
-
-static VALUE
-f_global_variables(VALUE _)
-{
- return rb_f_global_variables();
-}
-
-/*
- * call-seq:
- * trace_var(symbol, cmd ) -> nil
- * trace_var(symbol) {|val| block } -> nil
- *
- * Controls tracing of assignments to global variables. The parameter
- * +symbol+ identifies the variable (as either a string name or a
- * symbol identifier). _cmd_ (which may be a string or a
- * +Proc+ object) or block is executed whenever the variable
- * is assigned. The block or +Proc+ object receives the
- * variable's new value as a parameter. Also see
- * Kernel::untrace_var.
- *
- * trace_var :$_, proc {|v| puts "$_ is now '#{v}'" }
- * $_ = "hello"
- * $_ = ' there'
- *
- * <em>produces:</em>
- *
- * $_ is now 'hello'
- * $_ is now ' there'
- */
-
-static VALUE
-f_trace_var(int c, const VALUE *a, VALUE _)
-{
- return rb_f_trace_var(c, a);
-}
-
-/*
- * call-seq:
- * untrace_var(symbol [, cmd] ) -> array or nil
- *
- * Removes tracing for the specified command on the given global
- * variable and returns +nil+. If no command is specified,
- * removes all tracing for that variable and returns an array
- * containing the commands actually removed.
- */
-
-static VALUE
-f_untrace_var(int c, const VALUE *a, VALUE _)
-{
- return rb_f_untrace_var(c, a);
-}
-
void
Init_eval(void)
{
rb_define_virtual_variable("$@", errat_getter, errat_setter);
rb_define_virtual_variable("$!", errinfo_getter, 0);
- rb_define_global_function("raise", f_raise, -1);
- rb_define_global_function("fail", f_raise, -1);
+ rb_define_global_function("raise", rb_f_raise, -1);
+ rb_define_global_function("fail", rb_f_raise, -1);
- rb_define_global_function("global_variables", f_global_variables, 0);
+ rb_define_global_function("global_variables", rb_f_global_variables, 0); /* in variable.c */
rb_define_global_function("__method__", rb_f_method_name, 0);
rb_define_global_function("__callee__", rb_f_callee_name, 0);
@@ -2071,8 +1706,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");
@@ -2090,12 +1723,10 @@ Init_eval(void)
rb_define_method(rb_mKernel, "extend", rb_obj_extend, -1);
- rb_define_global_function("trace_var", f_trace_var, -1);
- rb_define_global_function("untrace_var", f_untrace_var, -1);
+ rb_define_global_function("trace_var", rb_f_trace_var, -1); /* in variable.c */
+ rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
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 847072ab98..241c90c36f 100644
--- a/eval_error.c
+++ b/eval_error.c
@@ -3,59 +3,45 @@
* included by eval.c
*/
-#define write_warn(str, x) \
- (NIL_P(str) ? warn_print(x) : (void)rb_str_cat_cstr(str, x))
-#define write_warn2(str, x, l) \
- (NIL_P(str) ? warn_print2(x, l) : (void)rb_str_cat(str, x, l))
-#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-#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 warn_print(x) rb_write_error(x)
-#endif
+static void
+warn_printf(const char *fmt, ...)
+{
+ VALUE str;
+ va_list args;
-#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);
- }
-}
+ VALUE sourcefile = rb_sourcefilename();
+ 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("%"PRIsVALUE, sourcefile);
}
else if ((caller_name = rb_frame_callee()) != 0) {
- return rb_sprintf("%"PRIsVALUE":%d:in `%"PRIsVALUE"': ",
- sourcefile, sourceline,
- rb_id2str(caller_name));
+ warn_printf("%"PRIsVALUE":%d:in `%"PRIsVALUE"'", sourcefile, sourceline,
+ rb_id2str(caller_name));
}
else {
- return rb_sprintf("%"PRIsVALUE":%d: ", sourcefile, sourceline);
+ warn_printf("%"PRIsVALUE":%d", sourcefile, sourceline);
}
}
- return Qnil;
}
+VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
+
static void
set_backtrace(VALUE info, VALUE bt)
{
@@ -74,366 +60,195 @@ set_backtrace(VALUE info, VALUE bt)
}
static void
-error_print(rb_execution_context_t *ec)
+error_print(void)
{
- rb_ec_error_print(ec, ec->errinfo);
-}
+ 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 void
-write_warnq(VALUE out, VALUE str, const char *ptr, long len)
-{
- if (NIL_P(out)) {
- const char *beg = ptr;
- const long olen = len;
- for (; len > 0; --len, ++ptr) {
- unsigned char c = *ptr;
- switch (c) {
- case '\n': case '\t': continue;
- }
- if (rb_iscntrl(c)) {
- char buf[5];
- const char *cc = 0;
- if (ptr > beg) rb_write_error2(beg, ptr - beg);
- beg = ptr + 1;
- cc = ruby_escaped_char(c);
- if (cc) {
- rb_write_error2(cc, strlen(cc));
- }
- else {
- rb_write_error2(buf, snprintf(buf, sizeof(buf), "\\x%02X", c));
- }
- }
- else if (c == '\\') {
- rb_write_error2(beg, ptr - beg + 1);
- beg = ptr;
- }
- }
- if (ptr > beg) {
- if (beg == RSTRING_PTR(str) && olen == RSTRING_LEN(str))
- rb_write_error_str(str);
- else
- rb_write_error2(beg, ptr - beg);
- }
+ if (NIL_P(errinfo))
+ return;
+ rb_thread_raised_clear(th);
+
+ TH_PUSH_TAG(th);
+ if (TH_EXEC_TAG() == 0) {
+ errat = rb_get_backtrace(errinfo);
+ }
+ else if (errat == Qundef) {
+ errat = Qnil;
+ }
+ else if (eclass == Qundef || e != Qundef) {
+ goto error;
}
else {
- rb_str_cat(out, ptr, len);
+ goto no_message;
}
-}
-
-#define CSI_BEGIN "\033["
-#define CSI_SGR "m"
-
-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;
-
-static void
-print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int highlight)
-{
- const char *einfo = "";
- long elen = 0;
- VALUE mesg;
+ 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 (!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 (highlight) write_warn(str, underline);
- write_warn(str, "unhandled exception");
- if (highlight) write_warn(str, reset);
- write_warn2(str, "\n", 1);
+ warn_print(": unhandled exception\n");
}
else {
VALUE epath;
epath = rb_class_name(eclass);
if (elen == 0) {
- if (highlight) write_warn(str, underline);
- write_warn_str(str, epath);
- if (highlight) write_warn(str, reset);
- write_warn(str, "\n");
+ warn_print(": ");
+ warn_print_str(epath);
+ warn_print("\n");
}
else {
- /* emesg is a String instance */
- const char *tail = 0;
+ char *tail = 0;
+ long len = elen;
- if (highlight) write_warn(str, bold);
if (RSTRING_PTR(epath)[0] == '#')
epath = 0;
if ((tail = memchr(einfo, '\n', elen)) != 0) {
- write_warnq(str, emesg, einfo, tail - einfo);
+ len = tail - einfo;
tail++; /* skip newline */
}
- else {
- write_warnq(str, emesg, einfo, elen);
- }
+ warn_print(": ");
+ warn_print_str(tail ? rb_str_subseq(e, 0, len) : e);
if (epath) {
- write_warn(str, " (");
- if (highlight) write_warn(str, underline);
- write_warn_str(str, epath);
- if (highlight) {
- write_warn(str, reset);
- write_warn(str, bold);
- }
- write_warn2(str, ")", 1);
- if (highlight) write_warn(str, reset);
- write_warn2(str, "\n", 1);
- }
- if (tail && einfo+elen > tail) {
- if (!highlight) {
- write_warnq(str, emesg, tail, einfo+elen-tail);
- if (einfo[elen-1] != '\n') write_warn2(str, "\n", 1);
- }
- else {
- elen -= tail - einfo;
- einfo = tail;
- while (elen > 0) {
- tail = memchr(einfo, '\n', elen);
- if (!tail || tail > einfo) {
- write_warn(str, bold);
- write_warnq(str, emesg, einfo, tail ? tail-einfo : elen);
- write_warn(str, reset);
- if (!tail) {
- write_warn2(str, "\n", 1);
- break;
- }
- }
- elen -= tail - einfo;
- einfo = tail;
- do ++tail; while (tail < einfo+elen && *tail == '\n');
- write_warnq(str, emesg, einfo, tail-einfo);
- elen -= tail - einfo;
- einfo = tail;
- }
- }
+ warn_print(" (");
+ warn_print_str(epath);
+ warn_print(")\n");
}
- else if (!epath) {
- write_warn2(str, "\n", 1);
+ if (tail) {
+ warn_print_str(rb_str_subseq(e, tail - einfo, elen - len - 1));
}
+ if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
}
}
-}
-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 = (len <= 1) ? INT_MIN : ((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;
}
}
}
-}
-
-VALUE rb_get_message(VALUE exc);
-
-static int
-shown_cause_p(VALUE cause, VALUE *shown_causes)
-{
- VALUE shown = *shown_causes;
- if (!shown) {
- *shown_causes = shown = rb_obj_hide(rb_ident_hash_new());
- }
- if (rb_hash_has_key(shown, cause)) return TRUE;
- rb_hash_aset(shown, cause, Qtrue);
- return FALSE;
-}
-
-static void
-show_cause(VALUE errinfo, VALUE str, VALUE highlight, VALUE reverse, VALUE *shown_causes)
-{
- VALUE cause = rb_attr_get(errinfo, id_cause);
- if (!NIL_P(cause) && rb_obj_is_kind_of(cause, rb_eException) &&
- !shown_cause_p(cause, shown_causes)) {
- volatile VALUE eclass = CLASS_OF(cause);
- VALUE errat = rb_get_backtrace(cause);
- VALUE emesg = rb_get_message(cause);
- if (reverse) {
- show_cause(cause, str, highlight, reverse, shown_causes);
- 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);
- show_cause(cause, str, highlight, reverse, shown_causes);
- }
- }
+ 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;
- VALUE shown_causes = 0;
-
- 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);
- show_cause(errinfo, str, highlight, reverse, &shown_causes);
- 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);
- show_cause(errinfo, str, highlight, reverse, &shown_causes);
- }
+ error_print();
}
-void
-rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo)
+static const char *
+method_scope_name(int scope)
{
- volatile uint8_t 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_lit("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_lit("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(rb_execution_context_t *ec, int ex)
+error_handle(int ex)
{
int status = EXIT_FAILURE;
+ 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:
@@ -441,51 +256,51 @@ error_handle(rb_execution_context_t *ec, 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 aa07ce30ed..9dc6f7841a 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -4,23 +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_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>
@@ -97,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) { \
@@ -127,141 +119,115 @@ 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.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 TH_REPUSH_TAG() (void)(_th->tag = &_tag)
-#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag)
+#define PUSH_TAG() TH_PUSH_TAG(GET_THREAD())
+#define POP_TAG() TH_POP_TAG()
-#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || __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.)
- */
+#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
-/* 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 TH_EXEC_TAG() \
+ (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0))
-#define EC_JUMP_TAG(ec, st) rb_ec_tag_jump(ec, st)
+#define EXEC_TAG() \
+ TH_EXEC_TAG()
-#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc)
-
-/* CREF operators */
+#define TH_JUMP_TAG(th, st) rb_threadptr_tag_jump(th, st)
-#define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1
-#define CREF_FL_OMOD_SHARED IMEMO_FL_USER2
+#define JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), (st))
-static inline VALUE
-CREF_CLASS(const rb_cref_t *cref)
-{
- return cref->klass;
-}
-
-static inline rb_cref_t *
-CREF_NEXT(const rb_cref_t *cref)
-{
- return cref->next;
-}
-
-static inline const rb_scope_visibility_t *
-CREF_SCOPE_VISI(const rb_cref_t *cref)
-{
- return &cref->scope_visi;
-}
-
-static inline VALUE
-CREF_REFINEMENTS(const rb_cref_t *cref)
-{
- return cref->refinements;
-}
-
-static inline void
-CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs)
-{
- RB_OBJ_WRITE(cref, &cref->refinements, refs);
-}
-
-static inline int
-CREF_PUSHED_BY_EVAL(const rb_cref_t *cref)
-{
- return cref->flags & CREF_FL_PUSHED_BY_EVAL;
-}
-
-static inline void
-CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref)
-{
- cref->flags |= CREF_FL_PUSHED_BY_EVAL;
-}
-
-static inline int
-CREF_OMOD_SHARED(const rb_cref_t *cref)
-{
- return cref->flags & CREF_FL_OMOD_SHARED;
-}
-
-static inline void
-CREF_OMOD_SHARED_SET(rb_cref_t *cref)
-{
- cref->flags |= CREF_FL_OMOD_SHARED;
-}
+#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) ((rb_control_frame_t*)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);
enum {
RAISED_EXCEPTION = 1,
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);
@@ -270,25 +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));
NORETURN(void rb_vm_jump_tag_but_local_jump(int));
+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);
-VALUE rb_ec_backtrace_location_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 75d4ad0207..82c39ede11 100644
--- a/eval_jump.c
+++ b/eval_jump.c
@@ -35,7 +35,7 @@ rb_call_end_proc(VALUE data)
*/
static VALUE
-rb_f_at_exit(VALUE _)
+rb_f_at_exit(void)
{
VALUE proc;
@@ -50,6 +50,7 @@ rb_f_at_exit(VALUE _)
struct end_proc_data {
void (*func) ();
VALUE data;
+ int safe;
struct end_proc_data *next;
};
@@ -71,6 +72,7 @@ rb_set_end_proc(void (*func)(VALUE), VALUE data)
link->next = *list;
link->func = func;
link->data = data;
+ link->safe = rb_safe_level();
*list = link;
}
@@ -102,33 +104,38 @@ exec_end_procs_chain(struct end_proc_data *volatile *procs, VALUE *errp)
*procs = link->next;
endproc = *link;
xfree(link);
+ rb_set_safe_level_force(endproc.safe);
(*endproc.func) (endproc.data);
*errp = errinfo;
}
}
-static void
-rb_ec_exec_end_proc(rb_execution_context_t * ec)
+void
+rb_exec_end_proc(void)
{
- enum ruby_tag_type state;
- volatile VALUE errinfo = ec->errinfo;
+ int status;
+ volatile int safe = rb_safe_level();
+ 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, &th->errinfo);
+ exec_end_procs_chain(&end_procs, &th->errinfo);
}
else {
- EC_TMPPOP_TAG();
- error_handle(ec, 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();
- ec->errinfo = errinfo;
+ rb_set_safe_level_force(safe);
+ th->errinfo = errinfo;
}
void
diff --git a/ext/-test-/arith_seq/extract/depend b/ext/-test-/arith_seq/extract/depend
deleted file mode 100644
index bb0719941f..0000000000
--- a/ext/-test-/arith_seq/extract/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-extract.o: $(RUBY_EXTCONF_H)
-extract.o: $(arch_hdrdir)/ruby/config.h
-extract.o: $(hdrdir)/ruby/assert.h
-extract.o: $(hdrdir)/ruby/backward.h
-extract.o: $(hdrdir)/ruby/defines.h
-extract.o: $(hdrdir)/ruby/intern.h
-extract.o: $(hdrdir)/ruby/missing.h
-extract.o: $(hdrdir)/ruby/ruby.h
-extract.o: $(hdrdir)/ruby/st.h
-extract.o: $(hdrdir)/ruby/subst.h
-extract.o: extract.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/arith_seq/extract/extconf.rb b/ext/-test-/arith_seq/extract/extconf.rb
deleted file mode 100644
index 9c368bf50e..0000000000
--- a/ext/-test-/arith_seq/extract/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# frozen_string_literal: false
-create_makefile("-test-/arith_seq/extract")
diff --git a/ext/-test-/arith_seq/extract/extract.c b/ext/-test-/arith_seq/extract/extract.c
deleted file mode 100644
index 93b89c239a..0000000000
--- a/ext/-test-/arith_seq/extract/extract.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "ruby/ruby.h"
-
-static VALUE
-arith_seq_s_extract(VALUE mod, VALUE obj)
-{
- rb_arithmetic_sequence_components_t x;
- VALUE ret;
- int r;
-
- r = rb_arithmetic_sequence_extract(obj, &x);
-
- ret = rb_ary_new2(5);
- rb_ary_store(ret, 0, r ? x.begin : Qnil);
- rb_ary_store(ret, 1, r ? x.end : Qnil);
- rb_ary_store(ret, 2, r ? x.step : Qnil);
- rb_ary_store(ret, 3, r ? INT2FIX(x.exclude_end) : Qnil);
- rb_ary_store(ret, 4, INT2FIX(r));
-
- return ret;
-}
-
-void
-Init_extract(void)
-{
- VALUE cArithSeq = rb_path2class("Enumerator::ArithmeticSequence");
- rb_define_singleton_method(cArithSeq, "__extract__", arith_seq_s_extract, 1);
-}
diff --git a/ext/-test-/array/resize/depend b/ext/-test-/array/resize/depend
deleted file mode 100644
index a03cc47d51..0000000000
--- a/ext/-test-/array/resize/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-resize.o: $(RUBY_EXTCONF_H)
-resize.o: $(arch_hdrdir)/ruby/config.h
-resize.o: $(hdrdir)/ruby/assert.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/depend b/ext/-test-/bignum/depend
index 38c9f6114e..26cb890dbf 100644
--- a/ext/-test-/bignum/depend
+++ b/ext/-test-/bignum/depend
@@ -1,92 +1,102 @@
+big2str.o: big2str.c
+div.o: div.c
+intpack.o: intpack.c
+mul.o: mul.c
+str2big.o: str2big.c
+
# AUTOGENERATED DEPENDENCIES START
big2str.o: $(RUBY_EXTCONF_H)
big2str.o: $(arch_hdrdir)/ruby/config.h
-big2str.o: $(hdrdir)/ruby.h
-big2str.o: $(hdrdir)/ruby/assert.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/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.h
-bigzero.o: $(hdrdir)/ruby/assert.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/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.h
-div.o: $(hdrdir)/ruby/assert.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/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.h
-init.o: $(hdrdir)/ruby/assert.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.h
-intpack.o: $(hdrdir)/ruby/assert.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/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.h
-mul.o: $(hdrdir)/ruby/assert.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/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.h
-str2big.o: $(hdrdir)/ruby/assert.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/oniguruma.h
str2big.o: $(hdrdir)/ruby/ruby.h
str2big.o: $(hdrdir)/ruby/st.h
str2big.o: $(hdrdir)/ruby/subst.h
+str2big.o: $(top_srcdir)/include/ruby.h
str2big.o: $(top_srcdir)/internal.h
str2big.o: str2big.c
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/bignum/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/mul.c b/ext/-test-/bignum/mul.c
index b922f34437..d34e98fabb 100644
--- a/ext/-test-/bignum/mul.c
+++ b/ext/-test-/bignum/mul.c
@@ -54,8 +54,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-/bug-14834/bug-14384.c b/ext/-test-/bug-14834/bug-14384.c
deleted file mode 100644
index 3a16a2d222..0000000000
--- a/ext/-test-/bug-14834/bug-14384.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <ruby/ruby.h>
-#include <ruby/debug.h>
-
-#ifndef MAYBE_UNUSED
-# define MAYBE_UNUSED(x) x
-#endif
-
-static NOINLINE(VALUE f(VALUE));
-static NOINLINE(void g(VALUE, void*));
-extern NOINLINE(void Init_bug_14384(void));
-
-void
-Init_bug_14834(void)
-{
- VALUE q = rb_define_module("Bug");
- rb_define_module_function(q, "bug_14834", f, 0);
-}
-
-VALUE
-f(VALUE q)
-{
- int w[] = { 0, 1024 };
- VALUE e = rb_tracepoint_new(Qnil, RUBY_INTERNAL_EVENT_NEWOBJ, g, w);
-
- rb_tracepoint_enable(e);
- return rb_ensure(rb_yield, q, rb_tracepoint_disable, e);
-}
-
-void
-g(MAYBE_UNUSED(VALUE q), void* w)
-{
- const int *e = (const int *)w;
- const int r = *e++;
- const int t = *e++;
- VALUE *y = ALLOCA_N(VALUE, t);
- int *u = ALLOCA_N(int, t);
-
- rb_profile_frames(r, t, y, u);
-}
diff --git a/ext/-test-/bug-14834/depend b/ext/-test-/bug-14834/depend
deleted file mode 100644
index 5206f995be..0000000000
--- a/ext/-test-/bug-14834/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-bug-14384.o: $(RUBY_EXTCONF_H)
-bug-14384.o: $(arch_hdrdir)/ruby/config.h
-bug-14384.o: $(hdrdir)/ruby/assert.h
-bug-14384.o: $(hdrdir)/ruby/backward.h
-bug-14384.o: $(hdrdir)/ruby/debug.h
-bug-14384.o: $(hdrdir)/ruby/defines.h
-bug-14384.o: $(hdrdir)/ruby/intern.h
-bug-14384.o: $(hdrdir)/ruby/missing.h
-bug-14384.o: $(hdrdir)/ruby/ruby.h
-bug-14384.o: $(hdrdir)/ruby/st.h
-bug-14384.o: $(hdrdir)/ruby/subst.h
-bug-14384.o: bug-14384.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/bug-14834/extconf.rb b/ext/-test-/bug-14834/extconf.rb
deleted file mode 100644
index e8f3f1f437..0000000000
--- a/ext/-test-/bug-14834/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-# frozen_string_literal: true
-create_makefile("-test-/bug_14834")
diff --git a/ext/-test-/bug-3571/bug.c b/ext/-test-/bug-3571/bug.c
index dd3c85cd79..87a5df0588 100644
--- a/ext/-test-/bug-3571/bug.c
+++ b/ext/-test-/bug-3571/bug.c
@@ -8,7 +8,7 @@ bug_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arg))
}
static VALUE
-bug_start(VALUE self)
+bug_start(VALUE self, VALUE hash)
{
VALUE ary = rb_ary_new3(1, Qnil);
rb_block_call(ary, rb_intern("map"), 0, 0, bug_i, self);
@@ -16,7 +16,7 @@ bug_start(VALUE self)
}
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/depend b/ext/-test-/bug-3571/depend
deleted file mode 100644
index 74911f0af4..0000000000
--- a/ext/-test-/bug-3571/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-bug.o: $(RUBY_EXTCONF_H)
-bug.o: $(arch_hdrdir)/ruby/config.h
-bug.o: $(hdrdir)/ruby.h
-bug.o: $(hdrdir)/ruby/assert.h
-bug.o: $(hdrdir)/ruby/backward.h
-bug.o: $(hdrdir)/ruby/defines.h
-bug.o: $(hdrdir)/ruby/intern.h
-bug.o: $(hdrdir)/ruby/missing.h
-bug.o: $(hdrdir)/ruby/ruby.h
-bug.o: $(hdrdir)/ruby/st.h
-bug.o: $(hdrdir)/ruby/subst.h
-bug.o: bug.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/bug-5832/depend
deleted file mode 100644
index 74911f0af4..0000000000
--- a/ext/-test-/bug-5832/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-bug.o: $(RUBY_EXTCONF_H)
-bug.o: $(arch_hdrdir)/ruby/config.h
-bug.o: $(hdrdir)/ruby.h
-bug.o: $(hdrdir)/ruby/assert.h
-bug.o: $(hdrdir)/ruby/backward.h
-bug.o: $(hdrdir)/ruby/defines.h
-bug.o: $(hdrdir)/ruby/intern.h
-bug.o: $(hdrdir)/ruby/missing.h
-bug.o: $(hdrdir)/ruby/ruby.h
-bug.o: $(hdrdir)/ruby/st.h
-bug.o: $(hdrdir)/ruby/subst.h
-bug.o: bug.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/bug_reporter/depend
deleted file mode 100644
index 62bac03566..0000000000
--- a/ext/-test-/bug_reporter/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-bug_reporter.o: $(RUBY_EXTCONF_H)
-bug_reporter.o: $(arch_hdrdir)/ruby/config.h
-bug_reporter.o: $(hdrdir)/ruby.h
-bug_reporter.o: $(hdrdir)/ruby/assert.h
-bug_reporter.o: $(hdrdir)/ruby/backward.h
-bug_reporter.o: $(hdrdir)/ruby/defines.h
-bug_reporter.o: $(hdrdir)/ruby/intern.h
-bug_reporter.o: $(hdrdir)/ruby/missing.h
-bug_reporter.o: $(hdrdir)/ruby/ruby.h
-bug_reporter.o: $(hdrdir)/ruby/st.h
-bug_reporter.o: $(hdrdir)/ruby/subst.h
-bug_reporter.o: bug_reporter.c
-# AUTOGENERATED DEPENDENCIES END
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 451256cc75..0000000000
--- a/ext/-test-/class/depend
+++ /dev/null
@@ -1,25 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-class2name.o: $(RUBY_EXTCONF_H)
-class2name.o: $(arch_hdrdir)/ruby/config.h
-class2name.o: $(hdrdir)/ruby/assert.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.h
-init.o: $(hdrdir)/ruby/assert.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: 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-/cxxanyargs/cxxanyargs.cpp b/ext/-test-/cxxanyargs/cxxanyargs.cpp
deleted file mode 100644
index efe35fa359..0000000000
--- a/ext/-test-/cxxanyargs/cxxanyargs.cpp
+++ /dev/null
@@ -1,619 +0,0 @@
-#include <ruby/ruby.h>
-
-#if 0 // Warnings expected, should just suppress them
-
-#elif defined(_MSC_VER)
-#pragma warning(disable : 4996)
-
-#elif defined(__clang__)
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-
-#elif defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-
-#else
-// :FIXME: improve here for your compiler.
-
-#endif
-
-namespace test_rb_define_virtual_variable {
- VALUE
- getter(ID, VALUE *data)
- {
- return *data;
- }
-
- void
- setter(VALUE val, ID, VALUE *data)
- {
- *data = val;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_define_virtual_variable("test",
- RUBY_METHOD_FUNC(getter),
- reinterpret_cast<void(*)(ANYARGS)>(setter)); // old
- rb_define_virtual_variable("test", getter, setter); // new
- return self;
- }
-}
-
-struct test_rb_define_hooked_variable {
- static VALUE v;
-
- static VALUE
- getter(ID, VALUE *data)
- {
- return *data;
- }
-
- static void
- setter(VALUE val, ID, VALUE *data)
- {
- *data = val;
- }
-
- static VALUE
- test(VALUE self)
- {
- rb_define_hooked_variable("test", &v,
- RUBY_METHOD_FUNC(getter),
- reinterpret_cast<void(*)(ANYARGS)>(setter)); // old
- rb_define_hooked_variable("test", &v, getter, setter); // new
- return self;
- }
-};
-VALUE test_rb_define_hooked_variable::v = Qundef;
-
-namespace test_rb_iterate {
- VALUE
- iter(VALUE self)
- {
- return rb_funcall(self, rb_intern("yield"), 0);
- }
-
- VALUE
- block(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
- {
- return rb_funcall(arg, rb_intern("=="), 1, param);
- }
-
- VALUE
- test(VALUE self)
- {
- rb_iterate(iter, self, RUBY_METHOD_FUNC(block), self); // old
- return rb_iterate(iter, self, block, self); // new
- }
-}
-
-namespace test_rb_block_call {
- VALUE
- block(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
- {
- return rb_funcall(arg, rb_intern("=="), 1, param);
- }
-
- VALUE
- test(VALUE self)
- {
- const ID mid = rb_intern("each");
- const VALUE argv[] = { Qundef };
- rb_block_call(self, mid, 0, argv, RUBY_METHOD_FUNC(block), self); // old
- return rb_block_call(self, mid, 0, argv, block, self); // new
- }
-}
-
-namespace test_rb_rescue {
- VALUE
- begin(VALUE arg)
- {
- return arg;
- }
-
- VALUE
- rescue(VALUE arg, VALUE exc)
- {
- return exc;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_rescue(RUBY_METHOD_FUNC(begin), self, RUBY_METHOD_FUNC(rescue), self); // old
- return rb_rescue(begin, self, rescue, self); // new
- }
-}
-
-namespace test_rb_rescue2 {
- VALUE
- begin(VALUE arg)
- {
- return arg;
- }
-
- VALUE
- rescue(VALUE arg, VALUE exc)
- {
- return exc;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_rescue2(RUBY_METHOD_FUNC(begin), self, RUBY_METHOD_FUNC(rescue), self,
- rb_eStandardError, rb_eFatal, 0); // old
- return rb_rescue2(begin, self, rescue, self, rb_eStandardError, rb_eFatal, 0); // new
- }
-}
-
-namespace test_rb_ensure {
- VALUE
- begin(VALUE arg)
- {
- return arg;
- }
-
- VALUE
- ensure(VALUE arg)
- {
- return arg;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_ensure(RUBY_METHOD_FUNC(begin), self, RUBY_METHOD_FUNC(ensure), self); // old
- return rb_ensure(begin, self, ensure, self); // new
- }
-}
-
-namespace test_rb_catch {
- VALUE
- catcher(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
- {
- return arg;
- }
-
- VALUE
- test(VALUE self)
- {
- static const char *zero = 0;
- rb_catch(zero, RUBY_METHOD_FUNC(catcher), self); // old
- return rb_catch(zero, catcher, self); // new
- }
-}
-
-namespace test_rb_catch_obj {
- VALUE
- catcher(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
- {
- return arg;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_catch_obj(self, RUBY_METHOD_FUNC(catcher), self); // old
- return rb_catch_obj(self, catcher, self); // new
- }
-}
-
-namespace test_rb_fiber_new {
- VALUE
- fiber(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
- {
- return arg;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_fiber_new(RUBY_METHOD_FUNC(fiber), self); // old
- return rb_fiber_new(fiber, self); // new
- }
-}
-
-namespace test_rb_proc_new {
- VALUE
- proc(RB_BLOCK_CALL_FUNC_ARGLIST(arg, param))
- {
- return arg;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_fiber_new(RUBY_METHOD_FUNC(proc), self); // old
- return rb_fiber_new(proc, self); // new
- }
-}
-
-struct test_rb_thread_create {
- static VALUE v;
-
- static VALUE
- thread(void *ptr)
- {
- const VALUE *w = reinterpret_cast<const VALUE*>(ptr);
- return *w;
- }
-
- static VALUE
- test(VALUE self)
- {
- v = self;
- rb_thread_create(RUBY_METHOD_FUNC(thread), &v); // old
- return rb_thread_create(thread, &v); // new
- }
-};
-VALUE test_rb_thread_create::v = Qundef;
-
-namespace test_st_foreach {
- static int
- iter(st_data_t, st_data_t, st_data_t)
- {
- return ST_CONTINUE;
- }
-
- VALUE
- test(VALUE self)
- {
- st_data_t data = 0;
- st_table *st = st_init_numtable();
- st_foreach(st, reinterpret_cast<int(*)(ANYARGS)>(iter), data); // old
- st_foreach(st, iter, data); // new
- return self;
- }
-}
-
-namespace test_st_foreach_check {
- static int
- iter(st_data_t, st_data_t, st_data_t, int x)
- {
- return x ? ST_STOP : ST_CONTINUE;
- }
-
- VALUE
- test(VALUE self)
- {
- st_data_t data = 0;
- st_table *st = st_init_numtable();
- st_foreach_check(st, reinterpret_cast<int(*)(ANYARGS)>(iter), data, data); // old
- st_foreach_check(st, iter, data, data); // new
- return self;
- }
-}
-
-namespace test_st_foreach_safe {
- static int
- iter(st_data_t, st_data_t, st_data_t)
- {
- return ST_CONTINUE;
- }
-
- VALUE
- test(VALUE self)
- {
- st_data_t data = 0;
- st_table *st = st_init_numtable();
- st_foreach_safe(st, reinterpret_cast<int(*)(ANYARGS)>(iter), data); // old
- st_foreach_safe(st, iter, data); // new
- return self;
- }
-}
-
-namespace test_rb_hash_foreach {
- static int
- iter(VALUE, VALUE, VALUE)
- {
- return ST_CONTINUE;
- }
-
- VALUE
- test(VALUE self)
- {
- VALUE h = rb_hash_new();
- rb_hash_foreach(h, reinterpret_cast<int(*)(ANYARGS)>(iter), self); // old
- rb_hash_foreach(h, iter, self); // new
- return self;
- }
-}
-
-namespace test_rb_ivar_foreach {
- static int
- iter(VALUE, VALUE, VALUE)
- {
- return ST_CONTINUE;
- }
-
- VALUE
- test(VALUE self)
- {
- rb_ivar_foreach(self, reinterpret_cast<int(*)(ANYARGS)>(iter), self); // old
- rb_ivar_foreach(self, iter, self); // new
- return self;
- }
-}
-
-namespace test_rb_define_method {
- static VALUE
- m1(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- m2(VALUE, VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- ma(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- mv(int, VALUE*, VALUE)
- {
- return Qnil;
- }
-
- VALUE
- test(VALUE self)
- {
- // No cast
- rb_define_method(self, "m1", m1, 1);
- rb_define_method(self, "m2", m2, 2);
- rb_define_method(self, "ma", ma, -2);
- rb_define_method(self, "mv", mv, -1);
-
- // Cast by RUBY_METHOD_FUNC
- rb_define_method(self, "m1", RUBY_METHOD_FUNC(m1), 1);
- rb_define_method(self, "m2", RUBY_METHOD_FUNC(m2), 2);
- rb_define_method(self, "ma", RUBY_METHOD_FUNC(ma), -2);
- rb_define_method(self, "mv", RUBY_METHOD_FUNC(mv), -1);
-
- // Explicit cast instead of RUBY_METHOD_FUNC
- rb_define_method(self, "m1", (VALUE (*)(...))(m1), 1);
- rb_define_method(self, "m2", (VALUE (*)(...))(m2), 2);
- rb_define_method(self, "ma", (VALUE (*)(...))(ma), -2);
- rb_define_method(self, "mv", (VALUE (*)(...))(mv), -1);
-
- return self;
- }
-}
-
-namespace test_rb_define_module_function {
- static VALUE
- m1(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- m2(VALUE, VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- ma(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- mv(int, VALUE*, VALUE)
- {
- return Qnil;
- }
-
- VALUE
- test(VALUE self)
- {
- // No cast
- rb_define_module_function(self, "m1", m1, 1);
- rb_define_module_function(self, "m2", m2, 2);
- rb_define_module_function(self, "ma", ma, -2);
- rb_define_module_function(self, "mv", mv, -1);
-
- // Cast by RUBY_METHOD_FUNC
- rb_define_module_function(self, "m1", RUBY_METHOD_FUNC(m1), 1);
- rb_define_module_function(self, "m2", RUBY_METHOD_FUNC(m2), 2);
- rb_define_module_function(self, "ma", RUBY_METHOD_FUNC(ma), -2);
- rb_define_module_function(self, "mv", RUBY_METHOD_FUNC(mv), -1);
-
- // Explicit cast instead of RUBY_METHOD_FUNC
- rb_define_module_function(self, "m1", (VALUE (*)(...))(m1), 1);
- rb_define_module_function(self, "m2", (VALUE (*)(...))(m2), 2);
- rb_define_module_function(self, "ma", (VALUE (*)(...))(ma), -2);
- rb_define_module_function(self, "mv", (VALUE (*)(...))(mv), -1);
-
- return self;
- }
-}
-
-namespace test_rb_define_singleton_method {
- static VALUE
- m1(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- m2(VALUE, VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- ma(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- mv(int, VALUE*, VALUE)
- {
- return Qnil;
- }
-
- VALUE
- test(VALUE self)
- {
- // No cast
- rb_define_singleton_method(self, "m1", m1, 1);
- rb_define_singleton_method(self, "m2", m2, 2);
- rb_define_singleton_method(self, "ma", ma, -2);
- rb_define_singleton_method(self, "mv", mv, -1);
-
- // Cast by RUBY_METHOD_FUNC
- rb_define_singleton_method(self, "m1", RUBY_METHOD_FUNC(m1), 1);
- rb_define_singleton_method(self, "m2", RUBY_METHOD_FUNC(m2), 2);
- rb_define_singleton_method(self, "ma", RUBY_METHOD_FUNC(ma), -2);
- rb_define_singleton_method(self, "mv", RUBY_METHOD_FUNC(mv), -1);
-
- // Explicit cast instead of RUBY_METHOD_FUNC
- rb_define_singleton_method(self, "m1", (VALUE (*)(...))(m1), 1);
- rb_define_singleton_method(self, "m2", (VALUE (*)(...))(m2), 2);
- rb_define_singleton_method(self, "ma", (VALUE (*)(...))(ma), -2);
- rb_define_singleton_method(self, "mv", (VALUE (*)(...))(mv), -1);
-
- return self;
- }
-}
-
-namespace test_rb_define_protected_method {
- static VALUE
- m1(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- m2(VALUE, VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- ma(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- mv(int, VALUE*, VALUE)
- {
- return Qnil;
- }
-
- VALUE
- test(VALUE self)
- {
- // No cast
- rb_define_protected_method(self, "m1", m1, 1);
- rb_define_protected_method(self, "m2", m2, 2);
- rb_define_protected_method(self, "ma", ma, -2);
- rb_define_protected_method(self, "mv", mv, -1);
-
- // Cast by RUBY_METHOD_FUNC
- rb_define_protected_method(self, "m1", RUBY_METHOD_FUNC(m1), 1);
- rb_define_protected_method(self, "m2", RUBY_METHOD_FUNC(m2), 2);
- rb_define_protected_method(self, "ma", RUBY_METHOD_FUNC(ma), -2);
- rb_define_protected_method(self, "mv", RUBY_METHOD_FUNC(mv), -1);
-
- // Explicit cast instead of RUBY_METHOD_FUNC
- rb_define_protected_method(self, "m1", (VALUE (*)(...))(m1), 1);
- rb_define_protected_method(self, "m2", (VALUE (*)(...))(m2), 2);
- rb_define_protected_method(self, "ma", (VALUE (*)(...))(ma), -2);
- rb_define_protected_method(self, "mv", (VALUE (*)(...))(mv), -1);
-
- return self;
- }
-}
-
-namespace test_rb_define_private_method {
- static VALUE
- m1(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- m2(VALUE, VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- ma(VALUE, VALUE)
- {
- return Qnil;
- }
-
- static VALUE
- mv(int, VALUE*, VALUE)
- {
- return Qnil;
- }
-
- VALUE
- test(VALUE self)
- {
- // No cast
- rb_define_private_method(self, "m1", m1, 1);
- rb_define_private_method(self, "m2", m2, 2);
- rb_define_private_method(self, "ma", ma, -2);
- rb_define_private_method(self, "mv", mv, -1);
-
- // Cast by RUBY_METHOD_FUNC
- rb_define_private_method(self, "m1", RUBY_METHOD_FUNC(m1), 1);
- rb_define_private_method(self, "m2", RUBY_METHOD_FUNC(m2), 2);
- rb_define_private_method(self, "ma", RUBY_METHOD_FUNC(ma), -2);
- rb_define_private_method(self, "mv", RUBY_METHOD_FUNC(mv), -1);
-
- // Explicit cast instead of RUBY_METHOD_FUNC
- rb_define_private_method(self, "m1", (VALUE (*)(...))(m1), 1);
- rb_define_private_method(self, "m2", (VALUE (*)(...))(m2), 2);
- rb_define_private_method(self, "ma", (VALUE (*)(...))(ma), -2);
- rb_define_private_method(self, "mv", (VALUE (*)(...))(mv), -1);
-
- return self;
- }
-}
-
-extern "C" void
-Init_cxxanyargs(void)
-{
- VALUE b = rb_define_module("Bug");
-#define test(sym) \
- rb_define_module_function(b, #sym, RUBY_METHOD_FUNC(test_ ## sym::test), 0)
-
- test(rb_define_virtual_variable);
- test(rb_define_hooked_variable);
- test(rb_iterate);
- test(rb_block_call);
- test(rb_rescue);
- test(rb_rescue2);
- test(rb_ensure);
- test(rb_catch);
- test(rb_catch_obj);
- test(rb_fiber_new);
- test(rb_proc_new);
- test(rb_thread_create);
- test(st_foreach);
- test(st_foreach_check);
- test(st_foreach_safe);
- test(rb_hash_foreach);
- test(rb_ivar_foreach);
- test(rb_define_method);
- test(rb_define_module_function);
- test(rb_define_singleton_method);
- test(rb_define_protected_method);
- test(rb_define_private_method);
-}
diff --git a/ext/-test-/cxxanyargs/depend b/ext/-test-/cxxanyargs/depend
deleted file mode 100644
index 02113b6c26..0000000000
--- a/ext/-test-/cxxanyargs/depend
+++ /dev/null
@@ -1,25 +0,0 @@
-$(TARGET_SO) $(STATIC_LIB): $(FAILURES:.cpp=.failed)
-
-.SUFFIXES: .failed
-
-.cpp.failed:
- $(Q)$(RUBY) -rfileutils \
- -e "t = ARGV.shift" \
- -e "err = IO.popen(ARGV, err:[:child, :out], &:read)" \
- -e "abort err unless /rb_define_method/ =~ err" \
- -e "File.write(t, err)" $@ $(MAKE) $(*F).o
-
-# AUTOGENERATED DEPENDENCIES START
-cxxanyargs.o: $(RUBY_EXTCONF_H)
-cxxanyargs.o: $(arch_hdrdir)/ruby/config.h
-cxxanyargs.o: $(hdrdir)/ruby/assert.h
-cxxanyargs.o: $(hdrdir)/ruby/backward.h
-cxxanyargs.o: $(hdrdir)/ruby/backward/cxxanyargs.hpp
-cxxanyargs.o: $(hdrdir)/ruby/defines.h
-cxxanyargs.o: $(hdrdir)/ruby/intern.h
-cxxanyargs.o: $(hdrdir)/ruby/missing.h
-cxxanyargs.o: $(hdrdir)/ruby/ruby.h
-cxxanyargs.o: $(hdrdir)/ruby/st.h
-cxxanyargs.o: $(hdrdir)/ruby/subst.h
-cxxanyargs.o: cxxanyargs.cpp
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/cxxanyargs/extconf.rb b/ext/-test-/cxxanyargs/extconf.rb
deleted file mode 100644
index d2a740b989..0000000000
--- a/ext/-test-/cxxanyargs/extconf.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: false
-
-cxx = MakeMakefile["C++"]
-
-ok = cxx.try_compile(<<~'begin', "") do |x|
- #include "ruby/config.h"
-
- namespace {
- typedef int conftest[SIZEOF_LONG == sizeof(long) ? 1 : -1];
- typedef int conftest[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
- }
-
- int
- main(int argc, const char** argv)
- {
- return !!argv[argc];
- }
-begin
- # We are wiping ruby.h from the source because that header file is the
- # subject we are going to test in this extension library.
- x.sub! %<#include "ruby.h">, ''
-end
-
-if ok
- $srcs = %w[cxxanyargs.cpp]
- failures = Dir.glob($srcdir + "/failure*.cpp").map {|n| File.basename(n)}
- $cleanfiles << "$(FAILURES:.cpp=.failed)"
- create_makefile("-test-/cxxanyargs") do |mk|
- mk << "FAILURES #{['=', failures].join(' ')}\n"
- end
-end
diff --git a/ext/-test-/cxxanyargs/failure.cpp b/ext/-test-/cxxanyargs/failure.cpp
deleted file mode 100644
index 039beb1633..0000000000
--- a/ext/-test-/cxxanyargs/failure.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <ruby/ruby.h>
-
-static VALUE
-func_arg1(VALUE self, VALUE arg1)
-{
- return arg1;
-}
-
-extern "C" void
-Init_failure(void)
-{
- rb_define_method(rb_cObject, "arg1", func_arg1, 0);
-}
diff --git a/ext/-test-/cxxanyargs/failurem1.cpp b/ext/-test-/cxxanyargs/failurem1.cpp
deleted file mode 100644
index e58a0f4e0d..0000000000
--- a/ext/-test-/cxxanyargs/failurem1.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <ruby/ruby.h>
-
-static VALUE
-func_argm1(int argc, VALUE *argv, VALUE self)
-{
- return argc > 0 ? argv[0] : Qnil;
-}
-
-extern "C" void
-Init_failure(void)
-{
- rb_define_method(rb_cObject, "argm1", func_argm1, 0);
-}
diff --git a/ext/-test-/debug/depend b/ext/-test-/debug/depend
index 662ed87510..5178d85673 100644
--- a/ext/-test-/debug/depend
+++ b/ext/-test-/debug/depend
@@ -1,20 +1,16 @@
# AUTOGENERATED DEPENDENCIES START
init.o: $(RUBY_EXTCONF_H)
init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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/assert.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
@@ -25,8 +21,6 @@ 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/assert.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
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
index 20310b6dde..6110887b3d 100644
--- a/ext/-test-/dln/empty/extconf.rb
+++ b/ext/-test-/dln/empty/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
create_makefile("-test-/dln/empty")
diff --git a/ext/-test-/enumerator_kw/depend b/ext/-test-/enumerator_kw/depend
deleted file mode 100644
index b7489eaf73..0000000000
--- a/ext/-test-/enumerator_kw/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-enumerator_kw.o: $(RUBY_EXTCONF_H)
-enumerator_kw.o: $(arch_hdrdir)/ruby/config.h
-enumerator_kw.o: $(hdrdir)/ruby.h
-enumerator_kw.o: $(hdrdir)/ruby/assert.h
-enumerator_kw.o: $(hdrdir)/ruby/backward.h
-enumerator_kw.o: $(hdrdir)/ruby/defines.h
-enumerator_kw.o: $(hdrdir)/ruby/intern.h
-enumerator_kw.o: $(hdrdir)/ruby/missing.h
-enumerator_kw.o: $(hdrdir)/ruby/ruby.h
-enumerator_kw.o: $(hdrdir)/ruby/st.h
-enumerator_kw.o: $(hdrdir)/ruby/subst.h
-enumerator_kw.o: enumerator_kw.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/enumerator_kw/enumerator_kw.c b/ext/-test-/enumerator_kw/enumerator_kw.c
deleted file mode 100644
index 947d2b37e6..0000000000
--- a/ext/-test-/enumerator_kw/enumerator_kw.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <ruby.h>
-
-static VALUE
-enumerator_kw(int argc, VALUE *argv, VALUE self)
-{
- VALUE opt, enum_args[4];
- enum_args[0] = Qnil;
- enum_args[1] = Qnil;
- rb_scan_args(argc, argv, "01*:", enum_args, enum_args+1, &opt);
- enum_args[3] = self;
- enum_args[2] = opt;
- RETURN_SIZED_ENUMERATOR_KW(self, 4, enum_args, 0, RB_NO_KEYWORDS);
- return rb_yield_values_kw(4, enum_args, RB_NO_KEYWORDS);
-}
-
-void
-Init_enumerator_kw(void) {
- VALUE module = rb_define_module("Bug");
- module = rb_define_module_under(module, "EnumeratorKw");
- rb_define_method(module, "m", enumerator_kw, -1);
-}
diff --git a/ext/-test-/enumerator_kw/extconf.rb b/ext/-test-/enumerator_kw/extconf.rb
deleted file mode 100644
index ab2be73fa8..0000000000
--- a/ext/-test-/enumerator_kw/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-create_makefile("-test-/enumerator_kw")
diff --git a/ext/-test-/exception/depend b/ext/-test-/exception/depend
index d0958de9b8..a89ecf7a4f 100644
--- a/ext/-test-/exception/depend
+++ b/ext/-test-/exception/depend
@@ -1,8 +1,6 @@
# AUTOGENERATED DEPENDENCIES START
dataerror.o: $(RUBY_EXTCONF_H)
dataerror.o: $(arch_hdrdir)/ruby/config.h
-dataerror.o: $(hdrdir)/ruby/assert.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
@@ -12,41 +10,34 @@ 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.h
-enc_raise.o: $(hdrdir)/ruby/assert.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.h
-ensured.o: $(hdrdir)/ruby/assert.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.h
-init.o: $(hdrdir)/ruby/assert.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-/exception/enc_raise.c b/ext/-test-/exception/enc_raise.c
index 68d7b4ebc1..dc8a42cf3f 100644
--- a/ext/-test-/exception/enc_raise.c
+++ b/ext/-test-/exception/enc_raise.c
@@ -5,7 +5,7 @@ static VALUE
enc_raise(VALUE exc, VALUE encoding, VALUE mesg)
{
rb_enc_raise(rb_to_encoding(encoding), exc, "%s", StringValueCStr(mesg));
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
void
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/depend b/ext/-test-/fatal/depend
deleted file mode 100644
index c74360fdf9..0000000000
--- a/ext/-test-/fatal/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-rb_fatal.o: $(RUBY_EXTCONF_H)
-rb_fatal.o: $(arch_hdrdir)/ruby/config.h
-rb_fatal.o: $(hdrdir)/ruby.h
-rb_fatal.o: $(hdrdir)/ruby/assert.h
-rb_fatal.o: $(hdrdir)/ruby/backward.h
-rb_fatal.o: $(hdrdir)/ruby/defines.h
-rb_fatal.o: $(hdrdir)/ruby/intern.h
-rb_fatal.o: $(hdrdir)/ruby/missing.h
-rb_fatal.o: $(hdrdir)/ruby/ruby.h
-rb_fatal.o: $(hdrdir)/ruby/st.h
-rb_fatal.o: $(hdrdir)/ruby/subst.h
-rb_fatal.o: rb_fatal.c
-# AUTOGENERATED DEPENDENCIES END
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 afdf116a9d..a43b4275dc 100644
--- a/ext/-test-/file/depend
+++ b/ext/-test-/file/depend
@@ -1,14 +1,11 @@
# AUTOGENERATED DEPENDENCIES START
fs.o: $(RUBY_EXTCONF_H)
fs.o: $(arch_hdrdir)/ruby/config.h
-fs.o: $(hdrdir)/ruby/assert.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
@@ -16,26 +13,21 @@ 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.h
-init.o: $(hdrdir)/ruby/assert.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/assert.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
diff --git a/ext/-test-/file/extconf.rb b/ext/-test-/file/extconf.rb
index 9027ed1c3e..44aa828b25 100644
--- a/ext/-test-/file/extconf.rb
+++ b/ext/-test-/file/extconf.rb
@@ -1,5 +1,4 @@
-# frozen_string_literal: false
-require_relative "../auto_ext.rb"
+$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
headers = %w[sys/param.h sys/mount.h sys/vfs.h].select {|h| have_header(h)}
if have_type("struct statfs", headers)
@@ -15,4 +14,9 @@ if have_type("struct statvfs", headers)
have_struct_member("struct statvfs", "f_type", headers)
end
-auto_ext(inc: true)
+$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 63d2356d76..657a7d20a5 100644
--- a/ext/-test-/file/fs.c
+++ b/ext/-test-/file/fs.c
@@ -1,9 +1,6 @@
#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
@@ -89,9 +86,6 @@ get_noatime_p(VALUE self, VALUE str)
rb_sys_fail_str(str);
}
# ifdef HAVE_STRUCT_STATFS_F_FLAGS
-# ifdef MNT_STRICTATIME
- if (!(st.f_flags & MNT_STRICTATIME)) return Qtrue;
-# endif
# ifdef MNT_NOATIME
return st.f_flags & MNT_NOATIME ? Qtrue : Qfalse;
# elif defined(ST_NOATIME)
diff --git a/ext/-test-/float/depend b/ext/-test-/float/depend
index 6007bd3c0b..dff14550f7 100644
--- a/ext/-test-/float/depend
+++ b/ext/-test-/float/depend
@@ -1,30 +1,3 @@
-# for FreeBSD make
-nextafter.o: nextafter.c $(top_srcdir)/missing/nextafter.c
+$(OBJS): $(HDRS) $(ruby_headers)
-# AUTOGENERATED DEPENDENCIES START
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-nextafter.o: $(RUBY_EXTCONF_H)
-nextafter.o: $(arch_hdrdir)/ruby/config.h
-nextafter.o: $(hdrdir)/ruby.h
-nextafter.o: $(hdrdir)/ruby/assert.h
-nextafter.o: $(hdrdir)/ruby/backward.h
-nextafter.o: $(hdrdir)/ruby/defines.h
-nextafter.o: $(hdrdir)/ruby/intern.h
-nextafter.o: $(hdrdir)/ruby/missing.h
-nextafter.o: $(hdrdir)/ruby/ruby.h
-nextafter.o: $(hdrdir)/ruby/st.h
-nextafter.o: $(hdrdir)/ruby/subst.h
-nextafter.o: $(top_srcdir)/missing/nextafter.c
-nextafter.o: nextafter.c
-# AUTOGENERATED DEPENDENCIES END
+nextafter.o: nextafter.c $(top_srcdir)/missing/nextafter.c
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/depend b/ext/-test-/funcall/depend
deleted file mode 100644
index a5f43a8046..0000000000
--- a/ext/-test-/funcall/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-funcall.o: $(RUBY_EXTCONF_H)
-funcall.o: $(arch_hdrdir)/ruby/config.h
-funcall.o: $(hdrdir)/ruby.h
-funcall.o: $(hdrdir)/ruby/assert.h
-funcall.o: $(hdrdir)/ruby/backward.h
-funcall.o: $(hdrdir)/ruby/defines.h
-funcall.o: $(hdrdir)/ruby/intern.h
-funcall.o: $(hdrdir)/ruby/missing.h
-funcall.o: $(hdrdir)/ruby/ruby.h
-funcall.o: $(hdrdir)/ruby/st.h
-funcall.o: $(hdrdir)/ruby/subst.h
-funcall.o: funcall.c
-# AUTOGENERATED DEPENDENCIES END
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 43521bf2e9..0000000000
--- a/ext/-test-/funcall/funcall.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include "ruby.h"
-
-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
-with_funcall_passing_block_kw(int argc, VALUE *argv, VALUE self)
-{
- return rb_funcall_passing_block_kw(self, rb_intern("target"), argc-1, argv+1, FIX2INT(argv[0]));
-}
-
-static VALUE
-with_funcallv_public_kw(int argc, VALUE *argv, VALUE self)
-{
- return rb_funcallv_public_kw(argv[0], SYM2ID(argv[1]), argc-3, argv+3, FIX2INT(argv[2]));
-}
-
-static VALUE
-with_yield_splat_kw(int argc, VALUE *argv, VALUE self)
-{
- return rb_yield_splat_kw(argv[1], FIX2INT(argv[0]));
-}
-
-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_kw",
- with_funcall_passing_block_kw,
- -1);
- rb_define_singleton_method(cRelay,
- "with_funcall_passing_block",
- with_funcall_passing_block,
- -1);
- rb_define_singleton_method(cRelay,
- "with_funcallv_public_kw",
- with_funcallv_public_kw,
- -1);
- rb_define_singleton_method(cRelay,
- "with_yield_splat_kw",
- with_yield_splat_kw,
- -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 d77c2f323e..0000000000
--- a/ext/-test-/gvl/call_without_gvl/call_without_gvl.c
+++ /dev/null
@@ -1,76 +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;
-}
-
-struct loop_ctl {
- int notify_fd;
- volatile int stop;
-};
-
-static void *
-do_loop(void *p)
-{
- struct loop_ctl *ctl = p;
-
- /* tell the waiting process they can interrupt us, now */
- ssize_t err = write(ctl->notify_fd, "", 1);
- if (err == -1) rb_bug("write error");
-
- while (!ctl->stop) {
- struct timeval tv = { 0, 10000 };
- select(0, NULL, NULL, NULL, &tv);
- }
- return 0;
-}
-
-static void
-stop_set(void *p)
-{
- struct loop_ctl *ctl = p;
-
- ctl->stop = 1;
-}
-
-static VALUE
-thread_ubf_async_safe(VALUE thread, VALUE notify_fd)
-{
- struct loop_ctl ctl;
-
- ctl.notify_fd = NUM2INT(notify_fd);
- ctl.stop = 0;
-
- rb_nogvl(do_loop, &ctl, stop_set, &ctl, RB_NOGVL_UBF_ASYNC_SAFE);
- return thread;
-}
-
-void
-Init_call_without_gvl(void)
-{
- rb_define_method(rb_cThread, "__runnable_sleep__", thread_runnable_sleep, 1);
- rb_define_method(rb_cThread, "__ubf_async_safe__", thread_ubf_async_safe, 1);
-}
diff --git a/ext/-test-/gvl/call_without_gvl/depend b/ext/-test-/gvl/call_without_gvl/depend
deleted file mode 100644
index 3d4253b977..0000000000
--- a/ext/-test-/gvl/call_without_gvl/depend
+++ /dev/null
@@ -1,14 +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/assert.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/depend b/ext/-test-/hash/depend
deleted file mode 100644
index 5e2b8056c8..0000000000
--- a/ext/-test-/hash/depend
+++ /dev/null
@@ -1,26 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-delete.o: $(RUBY_EXTCONF_H)
-delete.o: $(arch_hdrdir)/ruby/config.h
-delete.o: $(hdrdir)/ruby.h
-delete.o: $(hdrdir)/ruby/assert.h
-delete.o: $(hdrdir)/ruby/backward.h
-delete.o: $(hdrdir)/ruby/defines.h
-delete.o: $(hdrdir)/ruby/intern.h
-delete.o: $(hdrdir)/ruby/missing.h
-delete.o: $(hdrdir)/ruby/ruby.h
-delete.o: $(hdrdir)/ruby/st.h
-delete.o: $(hdrdir)/ruby/subst.h
-delete.o: delete.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/hash/extconf.rb b/ext/-test-/hash/extconf.rb
index d786b15db9..9d4ef4f935 100644
--- a/ext/-test-/hash/extconf.rb
+++ b/ext/-test-/hash/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-/hash")
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 5c9d581389..0000000000
--- a/ext/-test-/integer/depend
+++ /dev/null
@@ -1,39 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-core_ext.o: $(RUBY_EXTCONF_H)
-core_ext.o: $(arch_hdrdir)/ruby/config.h
-core_ext.o: $(hdrdir)/ruby.h
-core_ext.o: $(hdrdir)/ruby/assert.h
-core_ext.o: $(hdrdir)/ruby/backward.h
-core_ext.o: $(hdrdir)/ruby/defines.h
-core_ext.o: $(hdrdir)/ruby/intern.h
-core_ext.o: $(hdrdir)/ruby/missing.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)/internal.h
-core_ext.o: core_ext.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-my_integer.o: $(RUBY_EXTCONF_H)
-my_integer.o: $(arch_hdrdir)/ruby/config.h
-my_integer.o: $(hdrdir)/ruby.h
-my_integer.o: $(hdrdir)/ruby/assert.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: 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/depend b/ext/-test-/iseq_load/depend
deleted file mode 100644
index ac549546ec..0000000000
--- a/ext/-test-/iseq_load/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-iseq_load.o: $(RUBY_EXTCONF_H)
-iseq_load.o: $(arch_hdrdir)/ruby/config.h
-iseq_load.o: $(hdrdir)/ruby.h
-iseq_load.o: $(hdrdir)/ruby/assert.h
-iseq_load.o: $(hdrdir)/ruby/backward.h
-iseq_load.o: $(hdrdir)/ruby/defines.h
-iseq_load.o: $(hdrdir)/ruby/intern.h
-iseq_load.o: $(hdrdir)/ruby/missing.h
-iseq_load.o: $(hdrdir)/ruby/ruby.h
-iseq_load.o: $(hdrdir)/ruby/st.h
-iseq_load.o: $(hdrdir)/ruby/subst.h
-iseq_load.o: iseq_load.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/iseq_load/extconf.rb b/ext/-test-/iseq_load/extconf.rb
index 5858870138..860f30befd 100644
--- a/ext/-test-/iseq_load/extconf.rb
+++ b/ext/-test-/iseq_load/extconf.rb
@@ -1,2 +1 @@
-# frozen_string_literal: false
-create_makefile("-test-/iseq_load")
+create_makefile("-test-/iseq_load/iseq_load")
diff --git a/ext/-test-/iter/break.c b/ext/-test-/iter/break.c
index 4d43c5d0cf..66ed26a9b8 100644
--- a/ext/-test-/iter/break.c
+++ b/ext/-test-/iter/break.c
@@ -5,7 +5,7 @@ iter_break(VALUE self)
{
rb_iter_break();
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
static VALUE
@@ -13,7 +13,7 @@ iter_break_value(VALUE self, VALUE val)
{
rb_iter_break_value(val);
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
void
diff --git a/ext/-test-/iter/depend b/ext/-test-/iter/depend
deleted file mode 100644
index 5e754950c1..0000000000
--- a/ext/-test-/iter/depend
+++ /dev/null
@@ -1,38 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-break.o: $(RUBY_EXTCONF_H)
-break.o: $(arch_hdrdir)/ruby/config.h
-break.o: $(hdrdir)/ruby.h
-break.o: $(hdrdir)/ruby/assert.h
-break.o: $(hdrdir)/ruby/backward.h
-break.o: $(hdrdir)/ruby/defines.h
-break.o: $(hdrdir)/ruby/intern.h
-break.o: $(hdrdir)/ruby/missing.h
-break.o: $(hdrdir)/ruby/ruby.h
-break.o: $(hdrdir)/ruby/st.h
-break.o: $(hdrdir)/ruby/subst.h
-break.o: break.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-yield.o: $(RUBY_EXTCONF_H)
-yield.o: $(arch_hdrdir)/ruby/config.h
-yield.o: $(hdrdir)/ruby.h
-yield.o: $(hdrdir)/ruby/assert.h
-yield.o: $(hdrdir)/ruby/backward.h
-yield.o: $(hdrdir)/ruby/defines.h
-yield.o: $(hdrdir)/ruby/intern.h
-yield.o: $(hdrdir)/ruby/missing.h
-yield.o: $(hdrdir)/ruby/ruby.h
-yield.o: $(hdrdir)/ruby/st.h
-yield.o: $(hdrdir)/ruby/subst.h
-yield.o: yield.c
-# AUTOGENERATED DEPENDENCIES END
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-/iter/yield.c b/ext/-test-/iter/yield.c
index 0f6f3e87eb..3cd408a928 100644
--- a/ext/-test-/iter/yield.c
+++ b/ext/-test-/iter/yield.c
@@ -4,7 +4,7 @@ static VALUE
yield_block(int argc, VALUE *argv, VALUE self)
{
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
- return rb_block_call_kw(self, rb_to_id(argv[0]), argc-1, argv+1, rb_yield_block, 0, RB_PASS_CALLED_KEYWORDS);
+ return rb_block_call(self, rb_to_id(argv[0]), argc-1, argv+1, rb_yield_block, 0);
}
void
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/depend b/ext/-test-/load/protect/depend
deleted file mode 100644
index b62393f1cb..0000000000
--- a/ext/-test-/load/protect/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-protect.o: $(RUBY_EXTCONF_H)
-protect.o: $(arch_hdrdir)/ruby/config.h
-protect.o: $(hdrdir)/ruby.h
-protect.o: $(hdrdir)/ruby/assert.h
-protect.o: $(hdrdir)/ruby/backward.h
-protect.o: $(hdrdir)/ruby/defines.h
-protect.o: $(hdrdir)/ruby/intern.h
-protect.o: $(hdrdir)/ruby/missing.h
-protect.o: $(hdrdir)/ruby/ruby.h
-protect.o: $(hdrdir)/ruby/st.h
-protect.o: $(hdrdir)/ruby/subst.h
-protect.o: protect.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/marshal/compat/depend
deleted file mode 100644
index f159506960..0000000000
--- a/ext/-test-/marshal/compat/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-usrcompat.o: $(RUBY_EXTCONF_H)
-usrcompat.o: $(arch_hdrdir)/ruby/config.h
-usrcompat.o: $(hdrdir)/ruby.h
-usrcompat.o: $(hdrdir)/ruby/assert.h
-usrcompat.o: $(hdrdir)/ruby/backward.h
-usrcompat.o: $(hdrdir)/ruby/defines.h
-usrcompat.o: $(hdrdir)/ruby/intern.h
-usrcompat.o: $(hdrdir)/ruby/missing.h
-usrcompat.o: $(hdrdir)/ruby/ruby.h
-usrcompat.o: $(hdrdir)/ruby/st.h
-usrcompat.o: $(hdrdir)/ruby/subst.h
-usrcompat.o: usrcompat.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/marshal/internal_ivar/depend
deleted file mode 100644
index f280347c01..0000000000
--- a/ext/-test-/marshal/internal_ivar/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-internal_ivar.o: $(RUBY_EXTCONF_H)
-internal_ivar.o: $(arch_hdrdir)/ruby/config.h
-internal_ivar.o: $(hdrdir)/ruby.h
-internal_ivar.o: $(hdrdir)/ruby/assert.h
-internal_ivar.o: $(hdrdir)/ruby/backward.h
-internal_ivar.o: $(hdrdir)/ruby/defines.h
-internal_ivar.o: $(hdrdir)/ruby/intern.h
-internal_ivar.o: $(hdrdir)/ruby/missing.h
-internal_ivar.o: $(hdrdir)/ruby/ruby.h
-internal_ivar.o: $(hdrdir)/ruby/st.h
-internal_ivar.o: $(hdrdir)/ruby/subst.h
-internal_ivar.o: internal_ivar.c
-# AUTOGENERATED DEPENDENCIES END
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 de0cf711aa..0000000000
--- a/ext/-test-/marshal/internal_ivar/internal_ivar.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <ruby.h>
-
-static ID id_normal_ivar, id_internal_ivar, id_encoding_short;
-
-static VALUE
-init(VALUE self, VALUE arg1, VALUE arg2, VALUE arg3)
-{
- rb_ivar_set(self, id_normal_ivar, arg1);
- rb_ivar_set(self, id_internal_ivar, arg2);
- rb_ivar_set(self, id_encoding_short, arg3);
- 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);
-}
-
-static VALUE
-get_encoding_short(VALUE self)
-{
- return rb_attr_get(self, id_encoding_short);
-}
-
-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
- id_encoding_short = rb_intern_const("E");
- rb_define_method(newclass, "initialize", init, 3);
- rb_define_method(newclass, "normal", get_normal, 0);
- rb_define_method(newclass, "internal", get_internal, 0);
- rb_define_method(newclass, "encoding_short", get_encoding_short, 0);
-}
diff --git a/ext/-test-/marshal/usr/depend b/ext/-test-/marshal/usr/depend
deleted file mode 100644
index 21c0c2d744..0000000000
--- a/ext/-test-/marshal/usr/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-usrmarshal.o: $(RUBY_EXTCONF_H)
-usrmarshal.o: $(arch_hdrdir)/ruby/config.h
-usrmarshal.o: $(hdrdir)/ruby.h
-usrmarshal.o: $(hdrdir)/ruby/assert.h
-usrmarshal.o: $(hdrdir)/ruby/backward.h
-usrmarshal.o: $(hdrdir)/ruby/defines.h
-usrmarshal.o: $(hdrdir)/ruby/intern.h
-usrmarshal.o: $(hdrdir)/ruby/missing.h
-usrmarshal.o: $(hdrdir)/ruby/ruby.h
-usrmarshal.o: $(hdrdir)/ruby/st.h
-usrmarshal.o: $(hdrdir)/ruby/subst.h
-usrmarshal.o: usrmarshal.c
-# AUTOGENERATED DEPENDENCIES END
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-/memory_status/depend b/ext/-test-/memory_status/depend
deleted file mode 100644
index 657ef59c35..0000000000
--- a/ext/-test-/memory_status/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-memory_status.o: $(RUBY_EXTCONF_H)
-memory_status.o: $(arch_hdrdir)/ruby/config.h
-memory_status.o: $(hdrdir)/ruby.h
-memory_status.o: $(hdrdir)/ruby/assert.h
-memory_status.o: $(hdrdir)/ruby/backward.h
-memory_status.o: $(hdrdir)/ruby/defines.h
-memory_status.o: $(hdrdir)/ruby/intern.h
-memory_status.o: $(hdrdir)/ruby/missing.h
-memory_status.o: $(hdrdir)/ruby/ruby.h
-memory_status.o: $(hdrdir)/ruby/st.h
-memory_status.o: $(hdrdir)/ruby/subst.h
-memory_status.o: memory_status.c
-# AUTOGENERATED DEPENDENCIES END
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 5775fa56f3..0000000000
--- a/ext/-test-/memory_status/memory_status.c
+++ /dev/null
@@ -1,69 +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;
-#ifndef ULL2NUM
-/* "long long" does not exist here, use size_t instead. */
-#define ULL2NUM SIZET2NUM
-#endif
- 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/depend b/ext/-test-/method/depend
deleted file mode 100644
index 028d97e1a9..0000000000
--- a/ext/-test-/method/depend
+++ /dev/null
@@ -1,26 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-arity.o: $(RUBY_EXTCONF_H)
-arity.o: $(arch_hdrdir)/ruby/config.h
-arity.o: $(hdrdir)/ruby.h
-arity.o: $(hdrdir)/ruby/assert.h
-arity.o: $(hdrdir)/ruby/backward.h
-arity.o: $(hdrdir)/ruby/defines.h
-arity.o: $(hdrdir)/ruby/intern.h
-arity.o: $(hdrdir)/ruby/missing.h
-arity.o: $(hdrdir)/ruby/ruby.h
-arity.o: $(hdrdir)/ruby/st.h
-arity.o: $(hdrdir)/ruby/subst.h
-arity.o: arity.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-# AUTOGENERATED DEPENDENCIES END
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 82e243a81d..0000000000
--- a/ext/-test-/notimplement/bug.c
+++ /dev/null
@@ -1,18 +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");
- VALUE klass = rb_define_class_under(mBug, "NotImplement", rb_cObject);
- rb_define_module_function(mBug, "funcall", bug_funcall, -1);
- rb_define_module_function(mBug, "notimplement", rb_f_notimplement, -1);
- rb_define_method(klass, "notimplement", rb_f_notimplement, -1);
-}
diff --git a/ext/-test-/notimplement/depend b/ext/-test-/notimplement/depend
deleted file mode 100644
index 74911f0af4..0000000000
--- a/ext/-test-/notimplement/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-bug.o: $(RUBY_EXTCONF_H)
-bug.o: $(arch_hdrdir)/ruby/config.h
-bug.o: $(hdrdir)/ruby.h
-bug.o: $(hdrdir)/ruby/assert.h
-bug.o: $(hdrdir)/ruby/backward.h
-bug.o: $(hdrdir)/ruby/defines.h
-bug.o: $(hdrdir)/ruby/intern.h
-bug.o: $(hdrdir)/ruby/missing.h
-bug.o: $(hdrdir)/ruby/ruby.h
-bug.o: $(hdrdir)/ruby/st.h
-bug.o: $(hdrdir)/ruby/subst.h
-bug.o: bug.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/num2int/depend
deleted file mode 100644
index 76b69de851..0000000000
--- a/ext/-test-/num2int/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-num2int.o: $(RUBY_EXTCONF_H)
-num2int.o: $(arch_hdrdir)/ruby/config.h
-num2int.o: $(hdrdir)/ruby.h
-num2int.o: $(hdrdir)/ruby/assert.h
-num2int.o: $(hdrdir)/ruby/backward.h
-num2int.o: $(hdrdir)/ruby/defines.h
-num2int.o: $(hdrdir)/ruby/intern.h
-num2int.o: $(hdrdir)/ruby/missing.h
-num2int.o: $(hdrdir)/ruby/ruby.h
-num2int.o: $(hdrdir)/ruby/st.h
-num2int.o: $(hdrdir)/ruby/subst.h
-num2int.o: num2int.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/path_to_class/depend
deleted file mode 100644
index 9a7f7d0176..0000000000
--- a/ext/-test-/path_to_class/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-path_to_class.o: $(RUBY_EXTCONF_H)
-path_to_class.o: $(arch_hdrdir)/ruby/config.h
-path_to_class.o: $(hdrdir)/ruby.h
-path_to_class.o: $(hdrdir)/ruby/assert.h
-path_to_class.o: $(hdrdir)/ruby/backward.h
-path_to_class.o: $(hdrdir)/ruby/defines.h
-path_to_class.o: $(hdrdir)/ruby/intern.h
-path_to_class.o: $(hdrdir)/ruby/missing.h
-path_to_class.o: $(hdrdir)/ruby/ruby.h
-path_to_class.o: $(hdrdir)/ruby/st.h
-path_to_class.o: $(hdrdir)/ruby/subst.h
-path_to_class.o: path_to_class.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/popen_deadlock/depend
deleted file mode 100644
index 4c3f3853fd..0000000000
--- a/ext/-test-/popen_deadlock/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-infinite_loop_dlsym.o: $(RUBY_EXTCONF_H)
-infinite_loop_dlsym.o: $(arch_hdrdir)/ruby/config.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/assert.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/backward.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/defines.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/intern.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/missing.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/ruby.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/st.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/subst.h
-infinite_loop_dlsym.o: $(hdrdir)/ruby/thread.h
-infinite_loop_dlsym.o: infinite_loop_dlsym.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/postponed_job/depend
index 998e2dcc9e..d672e53f00 100644
--- a/ext/-test-/postponed_job/depend
+++ b/ext/-test-/postponed_job/depend
@@ -1,15 +1 @@
-# AUTOGENERATED DEPENDENCIES START
-postponed_job.o: $(RUBY_EXTCONF_H)
-postponed_job.o: $(arch_hdrdir)/ruby/config.h
-postponed_job.o: $(hdrdir)/ruby.h
-postponed_job.o: $(hdrdir)/ruby/assert.h
-postponed_job.o: $(hdrdir)/ruby/backward.h
-postponed_job.o: $(hdrdir)/ruby/debug.h
-postponed_job.o: $(hdrdir)/ruby/defines.h
-postponed_job.o: $(hdrdir)/ruby/intern.h
-postponed_job.o: $(hdrdir)/ruby/missing.h
-postponed_job.o: $(hdrdir)/ruby/ruby.h
-postponed_job.o: $(hdrdir)/ruby/st.h
-postponed_job.o: $(hdrdir)/ruby/subst.h
-postponed_job.o: postponed_job.c
-# AUTOGENERATED DEPENDENCIES END
+postponed_job.o: $(HDRS) $(ruby_headers) $(hdrdir)/ruby/debug.h
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-/postponed_job/postponed_job.c b/ext/-test-/postponed_job/postponed_job.c
index d8684d475a..157230e33b 100644
--- a/ext/-test-/postponed_job/postponed_job.c
+++ b/ext/-test-/postponed_job/postponed_job.c
@@ -1,28 +1,19 @@
#include "ruby.h"
#include "ruby/debug.h"
-static int counter;
-
static void
pjob_callback(void *data)
{
VALUE ary = (VALUE)data;
Check_Type(ary, T_ARRAY);
- rb_ary_push(ary, INT2FIX(counter));
+ rb_ary_replace(ary, rb_funcall(Qnil, rb_intern("caller"), 0));
}
static VALUE
pjob_register(VALUE self, VALUE obj)
{
- counter = 0;
rb_postponed_job_register(0, pjob_callback, (void *)obj);
- rb_gc_start();
- counter++;
- rb_gc_start();
- counter++;
- rb_gc_start();
- counter++;
return self;
}
@@ -47,14 +38,7 @@ pjob_register_one(VALUE self, VALUE obj)
static VALUE
pjob_call_direct(VALUE self, VALUE obj)
{
- counter = 0;
pjob_callback((void *)obj);
- rb_gc_start();
- counter++;
- rb_gc_start();
- counter++;
- rb_gc_start();
- counter++;
return self;
}
diff --git a/ext/-test-/printf/depend b/ext/-test-/printf/depend
index 7860797f50..79b6c53f50 100644
--- a/ext/-test-/printf/depend
+++ b/ext/-test-/printf/depend
@@ -1,17 +1,3 @@
-# AUTOGENERATED DEPENDENCIES START
-printf.o: $(RUBY_EXTCONF_H)
-printf.o: $(arch_hdrdir)/ruby/config.h
-printf.o: $(hdrdir)/ruby.h
-printf.o: $(hdrdir)/ruby/assert.h
-printf.o: $(hdrdir)/ruby/backward.h
-printf.o: $(hdrdir)/ruby/defines.h
-printf.o: $(hdrdir)/ruby/encoding.h
-printf.o: $(hdrdir)/ruby/intern.h
-printf.o: $(hdrdir)/ruby/missing.h
-printf.o: $(hdrdir)/ruby/onigmo.h
-printf.o: $(hdrdir)/ruby/oniguruma.h
-printf.o: $(hdrdir)/ruby/ruby.h
-printf.o: $(hdrdir)/ruby/st.h
-printf.o: $(hdrdir)/ruby/subst.h
-printf.o: printf.c
-# AUTOGENERATED DEPENDENCIES END
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
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..666f5592e5 100644
--- a/ext/-test-/printf/printf.c
+++ b/ext/-test-/printf/printf.c
@@ -90,13 +90,6 @@ 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)
{
@@ -105,5 +98,4 @@ Init_printf(void)
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/depend b/ext/-test-/proc/depend
deleted file mode 100644
index 5946e4ca0d..0000000000
--- a/ext/-test-/proc/depend
+++ /dev/null
@@ -1,38 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-receiver.o: $(RUBY_EXTCONF_H)
-receiver.o: $(arch_hdrdir)/ruby/config.h
-receiver.o: $(hdrdir)/ruby.h
-receiver.o: $(hdrdir)/ruby/assert.h
-receiver.o: $(hdrdir)/ruby/backward.h
-receiver.o: $(hdrdir)/ruby/defines.h
-receiver.o: $(hdrdir)/ruby/intern.h
-receiver.o: $(hdrdir)/ruby/missing.h
-receiver.o: $(hdrdir)/ruby/ruby.h
-receiver.o: $(hdrdir)/ruby/st.h
-receiver.o: $(hdrdir)/ruby/subst.h
-receiver.o: receiver.c
-super.o: $(RUBY_EXTCONF_H)
-super.o: $(arch_hdrdir)/ruby/config.h
-super.o: $(hdrdir)/ruby.h
-super.o: $(hdrdir)/ruby/assert.h
-super.o: $(hdrdir)/ruby/backward.h
-super.o: $(hdrdir)/ruby/defines.h
-super.o: $(hdrdir)/ruby/intern.h
-super.o: $(hdrdir)/ruby/missing.h
-super.o: $(hdrdir)/ruby/ruby.h
-super.o: $(hdrdir)/ruby/st.h
-super.o: $(hdrdir)/ruby/subst.h
-super.o: super.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/proc/extconf.rb b/ext/-test-/proc/extconf.rb
index d786b15db9..40741d07cc 100644
--- a/ext/-test-/proc/extconf.rb
+++ b/ext/-test-/proc/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-/proc")
diff --git a/ext/-test-/rational/depend b/ext/-test-/rational/depend
index 39e65933f3..bff4981ed6 100644
--- a/ext/-test-/rational/depend
+++ b/ext/-test-/rational/depend
@@ -5,15 +5,16 @@ 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.h
-rat.o: $(hdrdir)/ruby/assert.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/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-/rb_call_super_kw/depend b/ext/-test-/rb_call_super_kw/depend
deleted file mode 100644
index f65dcf9694..0000000000
--- a/ext/-test-/rb_call_super_kw/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-rb_call_super_kw.o: $(RUBY_EXTCONF_H)
-rb_call_super_kw.o: $(arch_hdrdir)/ruby/config.h
-rb_call_super_kw.o: $(hdrdir)/ruby.h
-rb_call_super_kw.o: $(hdrdir)/ruby/assert.h
-rb_call_super_kw.o: $(hdrdir)/ruby/backward.h
-rb_call_super_kw.o: $(hdrdir)/ruby/defines.h
-rb_call_super_kw.o: $(hdrdir)/ruby/intern.h
-rb_call_super_kw.o: $(hdrdir)/ruby/missing.h
-rb_call_super_kw.o: $(hdrdir)/ruby/ruby.h
-rb_call_super_kw.o: $(hdrdir)/ruby/st.h
-rb_call_super_kw.o: $(hdrdir)/ruby/subst.h
-rb_call_super_kw.o: rb_call_super_kw.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/rb_call_super_kw/extconf.rb b/ext/-test-/rb_call_super_kw/extconf.rb
deleted file mode 100644
index c6a5c720d7..0000000000
--- a/ext/-test-/rb_call_super_kw/extconf.rb
+++ /dev/null
@@ -1 +0,0 @@
-create_makefile("-test-/rb_call_super_kw")
diff --git a/ext/-test-/rb_call_super_kw/rb_call_super_kw.c b/ext/-test-/rb_call_super_kw/rb_call_super_kw.c
deleted file mode 100644
index 7f094545d2..0000000000
--- a/ext/-test-/rb_call_super_kw/rb_call_super_kw.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <ruby.h>
-
-static VALUE
-rb_call_super_kw_m(int argc, VALUE *argv, VALUE self)
-{
- return rb_call_super_kw(argc, argv, RB_PASS_CALLED_KEYWORDS);
-}
-
-void
-Init_rb_call_super_kw(void) {
- VALUE module = rb_define_module("Bug");
- module = rb_define_module_under(module, "RbCallSuperKw");
- rb_define_method(module, "m", rb_call_super_kw_m, -1);
-}
diff --git a/ext/-test-/recursion/depend b/ext/-test-/recursion/depend
deleted file mode 100644
index bf8005724a..0000000000
--- a/ext/-test-/recursion/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-recursion.o: $(RUBY_EXTCONF_H)
-recursion.o: $(arch_hdrdir)/ruby/config.h
-recursion.o: $(hdrdir)/ruby.h
-recursion.o: $(hdrdir)/ruby/assert.h
-recursion.o: $(hdrdir)/ruby/backward.h
-recursion.o: $(hdrdir)/ruby/defines.h
-recursion.o: $(hdrdir)/ruby/intern.h
-recursion.o: $(hdrdir)/ruby/missing.h
-recursion.o: $(hdrdir)/ruby/ruby.h
-recursion.o: $(hdrdir)/ruby/st.h
-recursion.o: $(hdrdir)/ruby/subst.h
-recursion.o: recursion.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/regexp/depend
deleted file mode 100644
index 7c88e1235c..0000000000
--- a/ext/-test-/regexp/depend
+++ /dev/null
@@ -1,27 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-parse_depth_limit.o: $(RUBY_EXTCONF_H)
-parse_depth_limit.o: $(arch_hdrdir)/ruby/config.h
-parse_depth_limit.o: $(hdrdir)/ruby.h
-parse_depth_limit.o: $(hdrdir)/ruby/assert.h
-parse_depth_limit.o: $(hdrdir)/ruby/backward.h
-parse_depth_limit.o: $(hdrdir)/ruby/defines.h
-parse_depth_limit.o: $(hdrdir)/ruby/intern.h
-parse_depth_limit.o: $(hdrdir)/ruby/missing.h
-parse_depth_limit.o: $(hdrdir)/ruby/onigmo.h
-parse_depth_limit.o: $(hdrdir)/ruby/ruby.h
-parse_depth_limit.o: $(hdrdir)/ruby/st.h
-parse_depth_limit.o: $(hdrdir)/ruby/subst.h
-parse_depth_limit.o: parse_depth_limit.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/scan_args/depend
deleted file mode 100644
index c230961ae3..0000000000
--- a/ext/-test-/scan_args/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-scan_args.o: $(RUBY_EXTCONF_H)
-scan_args.o: $(arch_hdrdir)/ruby/config.h
-scan_args.o: $(hdrdir)/ruby.h
-scan_args.o: $(hdrdir)/ruby/assert.h
-scan_args.o: $(hdrdir)/ruby/backward.h
-scan_args.o: $(hdrdir)/ruby/defines.h
-scan_args.o: $(hdrdir)/ruby/intern.h
-scan_args.o: $(hdrdir)/ruby/missing.h
-scan_args.o: $(hdrdir)/ruby/ruby.h
-scan_args.o: $(hdrdir)/ruby/st.h
-scan_args.o: $(hdrdir)/ruby/subst.h
-scan_args.o: scan_args.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/scan_args/extconf.rb b/ext/-test-/scan_args/extconf.rb
deleted file mode 100644
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 9c374da66f..0000000000
--- a/ext/-test-/scan_args/scan_args.c
+++ /dev/null
@@ -1,315 +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);
-}
-
-static VALUE
-scan_args_k_lead_opt_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args_kw(RB_SCAN_ARGS_KEYWORDS, 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_e_lead_opt_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args_kw(RB_SCAN_ARGS_EMPTY_KEYWORDS, 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_n_lead_opt_hash(int argc, VALUE *argv, VALUE self)
-{
- VALUE args[4];
- int n = rb_scan_args_kw(RB_SCAN_ARGS_LAST_HASH_KEYWORDS, argc, argv, "11:", args+1, args+2, args+3);
- 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);
- rb_define_singleton_method(module, "k_lead_opt_hash", scan_args_k_lead_opt_hash, -1);
- rb_define_singleton_method(module, "e_lead_opt_hash", scan_args_e_lead_opt_hash, -1);
- rb_define_singleton_method(module, "n_lead_opt_hash", scan_args_n_lead_opt_hash, -1);
-}
diff --git a/ext/-test-/st/foreach/depend b/ext/-test-/st/foreach/depend
deleted file mode 100644
index 42d3909f49..0000000000
--- a/ext/-test-/st/foreach/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-foreach.o: $(RUBY_EXTCONF_H)
-foreach.o: $(arch_hdrdir)/ruby/config.h
-foreach.o: $(hdrdir)/ruby.h
-foreach.o: $(hdrdir)/ruby/assert.h
-foreach.o: $(hdrdir)/ruby/backward.h
-foreach.o: $(hdrdir)/ruby/defines.h
-foreach.o: $(hdrdir)/ruby/intern.h
-foreach.o: $(hdrdir)/ruby/missing.h
-foreach.o: $(hdrdir)/ruby/ruby.h
-foreach.o: $(hdrdir)/ruby/st.h
-foreach.o: $(hdrdir)/ruby/subst.h
-foreach.o: foreach.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/-test-/st/foreach/extconf.rb b/ext/-test-/st/foreach/extconf.rb
index a7346203c4..969f386ff9 100644
--- a/ext/-test-/st/foreach/extconf.rb
+++ b/ext/-test-/st/foreach/extconf.rb
@@ -1,2 +1 @@
-# 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
index 27ac18046f..1e0fd515c9 100644
--- a/ext/-test-/st/foreach/foreach.c
+++ b/ext/-test-/st/foreach/foreach.c
@@ -14,13 +14,13 @@ 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");
+ if (!c->tbl->entries_packed) rb_bug("should be packed\n");
/* force unpacking during iteration: */
for (i = 1; i < expect_size; i++)
st_add_direct(c->tbl, i, i);
- if (c->tbl->bins == NULL) rb_bug("should be unpacked\n");
+ if (c->tbl->entries_packed) rb_bug("should be unpacked\n");
}
if (key != c->nr) {
@@ -84,7 +84,7 @@ unp_fec(VALUE self, VALUE test)
st_add_direct(tbl, 0, 0);
- if (tbl->bins != NULL) rb_bug("should still be packed\n");
+ if (!tbl->entries_packed) rb_bug("should still be packed\n");
st_foreach_check(tbl, unp_fec_i, (st_data_t)&c, -1);
@@ -98,7 +98,7 @@ unp_fec(VALUE self, VALUE test)
(VALUE)c.nr, (VALUE)expect_size);
}
- if (tbl->bins == NULL) rb_bug("should be unpacked\n");
+ if (tbl->entries_packed) rb_bug("should be unpacked\n");
st_free_table(tbl);
@@ -106,7 +106,7 @@ unp_fec(VALUE self, VALUE test)
}
static int
-unp_fe_i(st_data_t key, st_data_t val, st_data_t args)
+unp_fe_i(st_data_t key, st_data_t val, st_data_t args, int error)
{
struct checker *c = (struct checker *)args;
@@ -145,7 +145,7 @@ unp_fe(VALUE self, VALUE test)
st_add_direct(tbl, 0, 0);
- if (tbl->bins != NULL) rb_bug("should still be packed\n");
+ if (!tbl->entries_packed) rb_bug("should still be packed\n");
st_foreach(tbl, unp_fe_i, (st_data_t)&c);
@@ -159,7 +159,7 @@ unp_fe(VALUE self, VALUE test)
(VALUE)c.nr, (VALUE)expect_size);
}
- if (tbl->bins == NULL) rb_bug("should be unpacked\n");
+ if (tbl->entries_packed) rb_bug("should be unpacked\n");
st_free_table(tbl);
diff --git a/ext/-test-/st/numhash/depend b/ext/-test-/st/numhash/depend
deleted file mode 100644
index 98dcef881b..0000000000
--- a/ext/-test-/st/numhash/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-numhash.o: $(RUBY_EXTCONF_H)
-numhash.o: $(arch_hdrdir)/ruby/config.h
-numhash.o: $(hdrdir)/ruby.h
-numhash.o: $(hdrdir)/ruby/assert.h
-numhash.o: $(hdrdir)/ruby/backward.h
-numhash.o: $(hdrdir)/ruby/defines.h
-numhash.o: $(hdrdir)/ruby/intern.h
-numhash.o: $(hdrdir)/ruby/missing.h
-numhash.o: $(hdrdir)/ruby/ruby.h
-numhash.o: $(hdrdir)/ruby/st.h
-numhash.o: $(hdrdir)/ruby/subst.h
-numhash.o: numhash.c
-# AUTOGENERATED DEPENDENCIES END
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 71eeed4910..e033886f9d 100644
--- a/ext/-test-/st/numhash/numhash.c
+++ b/ext/-test-/st/numhash/numhash.c
@@ -10,7 +10,7 @@ numhash_free(void *ptr)
static size_t
numhash_memsize(const void *ptr)
{
- return st_memsize(ptr);
+ return ptr ? st_memsize(ptr) : 0;
}
static const rb_data_type_t numhash_type = {
@@ -57,7 +57,7 @@ numhash_aset(VALUE self, VALUE key, VALUE data)
}
static int
-numhash_i(st_data_t key, st_data_t value, st_data_t arg, int _)
+numhash_i(st_data_t key, st_data_t value, st_data_t arg)
{
VALUE ret;
ret = rb_yield_values(3, (VALUE)key, (VALUE)value, (VALUE)arg);
@@ -135,3 +135,4 @@ Init_numhash(void)
rb_define_method(st, "size", numhash_size, 0);
rb_define_method(st, "delete_safe", numhash_delete_safe, 1);
}
+
diff --git a/ext/-test-/st/update/depend b/ext/-test-/st/update/depend
deleted file mode 100644
index 241e6f9e6d..0000000000
--- a/ext/-test-/st/update/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-update.o: $(RUBY_EXTCONF_H)
-update.o: $(arch_hdrdir)/ruby/config.h
-update.o: $(hdrdir)/ruby.h
-update.o: $(hdrdir)/ruby/assert.h
-update.o: $(hdrdir)/ruby/backward.h
-update.o: $(hdrdir)/ruby/defines.h
-update.o: $(hdrdir)/ruby/intern.h
-update.o: $(hdrdir)/ruby/missing.h
-update.o: $(hdrdir)/ruby/ruby.h
-update.o: $(hdrdir)/ruby/st.h
-update.o: $(hdrdir)/ruby/subst.h
-update.o: update.c
-# AUTOGENERATED DEPENDENCIES END
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 1342ce20da..b93172d72d 100644
--- a/ext/-test-/string/coderange.c
+++ b/ext/-test-/string/coderange.c
@@ -17,7 +17,7 @@ coderange_int2sym(int coderange)
return sym_broken;
}
rb_bug("wrong condition of coderange");
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
/* return coderange without scan */
@@ -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 71eafdb703..ba2e46bc55 100644
--- a/ext/-test-/string/cstr.c
+++ b/ext/-test-/string/cstr.c
@@ -1,5 +1,5 @@
+#include "ruby.h"
#include "ruby/encoding.h"
-#include "internal.h"
static VALUE
bug_str_cstr_term(VALUE str)
@@ -9,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);
@@ -18,17 +20,6 @@ bug_str_cstr_term(VALUE str)
}
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;
@@ -51,97 +42,16 @@ bug_str_cstr_term_char(VALUE str)
}
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 f6888b5da7..ef13e44df5 100644
--- a/ext/-test-/string/depend
+++ b/ext/-test-/string/depend
@@ -1,26 +1,10 @@
# AUTOGENERATED DEPENDENCIES START
-capacity.o: $(RUBY_EXTCONF_H)
-capacity.o: $(arch_hdrdir)/ruby/config.h
-capacity.o: $(hdrdir)/ruby.h
-capacity.o: $(hdrdir)/ruby/assert.h
-capacity.o: $(hdrdir)/ruby/backward.h
-capacity.o: $(hdrdir)/ruby/defines.h
-capacity.o: $(hdrdir)/ruby/intern.h
-capacity.o: $(hdrdir)/ruby/missing.h
-capacity.o: $(hdrdir)/ruby/ruby.h
-capacity.o: $(hdrdir)/ruby/st.h
-capacity.o: $(hdrdir)/ruby/subst.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/assert.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
@@ -28,175 +12,104 @@ 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.h
-cstr.o: $(hdrdir)/ruby/assert.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/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)/internal.h
+cstr.o: $(top_srcdir)/include/ruby.h
cstr.o: cstr.c
ellipsize.o: $(RUBY_EXTCONF_H)
ellipsize.o: $(arch_hdrdir)/ruby/config.h
-ellipsize.o: $(hdrdir)/ruby.h
-ellipsize.o: $(hdrdir)/ruby/assert.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.h
-enc_associate.o: $(hdrdir)/ruby/assert.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/assert.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.h
-fstring.o: $(hdrdir)/ruby/assert.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: fstring.c
init.o: $(RUBY_EXTCONF_H)
init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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.h
-modify.o: $(hdrdir)/ruby/assert.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.h
-new.o: $(hdrdir)/ruby/assert.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/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: new.c
-nofree.o: $(RUBY_EXTCONF_H)
-nofree.o: $(arch_hdrdir)/ruby/config.h
-nofree.o: $(hdrdir)/ruby.h
-nofree.o: $(hdrdir)/ruby/assert.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: nofree.c
normalize.o: $(RUBY_EXTCONF_H)
normalize.o: $(arch_hdrdir)/ruby/config.h
-normalize.o: $(hdrdir)/ruby.h
-normalize.o: $(hdrdir)/ruby/assert.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/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.h
-qsort.o: $(hdrdir)/ruby/assert.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
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/assert.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.h
-set_len.o: $(hdrdir)/ruby/assert.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
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
index fdf810c741..d3d8071ff9 100644
--- a/ext/-test-/string/nofree.c
+++ b/ext/-test-/string/nofree.c
@@ -7,7 +7,7 @@ bug_str_nofree(VALUE self)
}
void
-Init_string_nofree(VALUE klass)
+Init_nofree(VALUE klass)
{
rb_define_singleton_method(klass, "nofree", bug_str_nofree, 0);
}
diff --git a/ext/-test-/string/normalize.c b/ext/-test-/string/normalize.c
index 0ba1797631..2e16a4616f 100644
--- a/ext/-test-/string/normalize.c
+++ b/ext/-test-/string/normalize.c
@@ -11,7 +11,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 552daf0ac5..0000000000
--- a/ext/-test-/struct/depend
+++ /dev/null
@@ -1,50 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-duplicate.o: $(RUBY_EXTCONF_H)
-duplicate.o: $(arch_hdrdir)/ruby/config.h
-duplicate.o: $(hdrdir)/ruby.h
-duplicate.o: $(hdrdir)/ruby/assert.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: duplicate.c
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-len.o: $(RUBY_EXTCONF_H)
-len.o: $(arch_hdrdir)/ruby/config.h
-len.o: $(hdrdir)/ruby.h
-len.o: $(hdrdir)/ruby/assert.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: len.c
-member.o: $(RUBY_EXTCONF_H)
-member.o: $(arch_hdrdir)/ruby/config.h
-member.o: $(hdrdir)/ruby.h
-member.o: $(hdrdir)/ruby/assert.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: member.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/symbol/depend
deleted file mode 100644
index bccb4afc15..0000000000
--- a/ext/-test-/symbol/depend
+++ /dev/null
@@ -1,26 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-type.o: $(RUBY_EXTCONF_H)
-type.o: $(arch_hdrdir)/ruby/config.h
-type.o: $(hdrdir)/ruby.h
-type.o: $(hdrdir)/ruby/assert.h
-type.o: $(hdrdir)/ruby/backward.h
-type.o: $(hdrdir)/ruby/defines.h
-type.o: $(hdrdir)/ruby/intern.h
-type.o: $(hdrdir)/ruby/missing.h
-type.o: $(hdrdir)/ruby/ruby.h
-type.o: $(hdrdir)/ruby/st.h
-type.o: $(hdrdir)/ruby/subst.h
-type.o: type.c
-# AUTOGENERATED DEPENDENCIES END
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 4038701ac9..9e42e1a38b 100644
--- a/ext/-test-/symbol/init.c
+++ b/ext/-test-/symbol/init.c
@@ -11,20 +11,7 @@ sym_find(VALUE dummy, VALUE 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
-}
-
-static VALUE
-sym_iv_get(VALUE dummy, VALUE obj, VALUE name)
-{
- const char *n = StringValueCStr(name);
- return rb_iv_get(obj, n);
+ return rb_check_id(&sym) ? Qtrue : Qfalse;
}
void
@@ -34,6 +21,5 @@ Init_symbol(void)
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);
- rb_define_singleton_method(klass, "iv_get", sym_iv_get, 2);
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 8c49c2d4fe..0000000000
--- a/ext/-test-/thread_fd_close/depend
+++ /dev/null
@@ -1,13 +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/assert.h
-thread_fd_close.o: $(hdrdir)/ruby/backward.h
-thread_fd_close.o: $(hdrdir)/ruby/defines.h
-thread_fd_close.o: $(hdrdir)/ruby/intern.h
-thread_fd_close.o: $(hdrdir)/ruby/missing.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/depend b/ext/-test-/time/depend
deleted file mode 100644
index 2f4b8d1f13..0000000000
--- a/ext/-test-/time/depend
+++ /dev/null
@@ -1,38 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-init.o: $(RUBY_EXTCONF_H)
-init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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: init.c
-leap_second.o: $(RUBY_EXTCONF_H)
-leap_second.o: $(arch_hdrdir)/ruby/config.h
-leap_second.o: $(hdrdir)/ruby.h
-leap_second.o: $(hdrdir)/ruby/assert.h
-leap_second.o: $(hdrdir)/ruby/backward.h
-leap_second.o: $(hdrdir)/ruby/defines.h
-leap_second.o: $(hdrdir)/ruby/intern.h
-leap_second.o: $(hdrdir)/ruby/missing.h
-leap_second.o: $(hdrdir)/ruby/ruby.h
-leap_second.o: $(hdrdir)/ruby/st.h
-leap_second.o: $(hdrdir)/ruby/subst.h
-leap_second.o: leap_second.c
-new.o: $(RUBY_EXTCONF_H)
-new.o: $(arch_hdrdir)/ruby/config.h
-new.o: $(hdrdir)/ruby.h
-new.o: $(hdrdir)/ruby/assert.h
-new.o: $(hdrdir)/ruby/backward.h
-new.o: $(hdrdir)/ruby/defines.h
-new.o: $(hdrdir)/ruby/intern.h
-new.o: $(hdrdir)/ruby/missing.h
-new.o: $(hdrdir)/ruby/ruby.h
-new.o: $(hdrdir)/ruby/st.h
-new.o: $(hdrdir)/ruby/subst.h
-new.o: new.c
-# AUTOGENERATED DEPENDENCIES END
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/leap_second.c b/ext/-test-/time/leap_second.c
deleted file mode 100644
index 7eed421b73..0000000000
--- a/ext/-test-/time/leap_second.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "ruby.h"
-
-void ruby_reset_leap_second_info(void);
-static VALUE
-bug_time_s_reset_leap_second_info(VALUE klass)
-{
- ruby_reset_leap_second_info();
- return Qnil;
-}
-
-void
-Init_time_leap_second(VALUE klass)
-{
- rb_define_singleton_method(klass, "reset_leap_second_info", bug_time_s_reset_leap_second_info, 0);
-}
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 b811df4472..741bad0386 100644
--- a/ext/-test-/tracepoint/depend
+++ b/ext/-test-/tracepoint/depend
@@ -1,8 +1,6 @@
# AUTOGENERATED DEPENDENCIES START
gc_hook.o: $(RUBY_EXTCONF_H)
gc_hook.o: $(arch_hdrdir)/ruby/config.h
-gc_hook.o: $(hdrdir)/ruby/assert.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
@@ -13,8 +11,6 @@ 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/assert.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
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-/tracepoint/gc_hook.c b/ext/-test-/tracepoint/gc_hook.c
index 2e695a9fba..6d8485ecb1 100644
--- a/ext/-test-/tracepoint/gc_hook.c
+++ b/ext/-test-/tracepoint/gc_hook.c
@@ -4,7 +4,7 @@
static int invoking; /* TODO: should not be global variable */
static VALUE
-invoke_proc_ensure(VALUE _)
+invoke_proc_ensure(void *dmy)
{
invoking = 0;
return Qnil;
diff --git a/ext/-test-/typeddata/depend b/ext/-test-/typeddata/depend
deleted file mode 100644
index e0dd0653a8..0000000000
--- a/ext/-test-/typeddata/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-typeddata.o: $(RUBY_EXTCONF_H)
-typeddata.o: $(arch_hdrdir)/ruby/config.h
-typeddata.o: $(hdrdir)/ruby.h
-typeddata.o: $(hdrdir)/ruby/assert.h
-typeddata.o: $(hdrdir)/ruby/backward.h
-typeddata.o: $(hdrdir)/ruby/defines.h
-typeddata.o: $(hdrdir)/ruby/intern.h
-typeddata.o: $(hdrdir)/ruby/missing.h
-typeddata.o: $(hdrdir)/ruby/ruby.h
-typeddata.o: $(hdrdir)/ruby/st.h
-typeddata.o: $(hdrdir)/ruby/subst.h
-typeddata.o: typeddata.c
-# AUTOGENERATED DEPENDENCIES END
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/depend b/ext/-test-/vm/depend
deleted file mode 100644
index 0f85d69bb0..0000000000
--- a/ext/-test-/vm/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-at_exit.o: $(RUBY_EXTCONF_H)
-at_exit.o: $(arch_hdrdir)/ruby/config.h
-at_exit.o: $(hdrdir)/ruby/assert.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-/wait_for_single_fd/depend b/ext/-test-/wait_for_single_fd/depend
index 8549fca781..fddd41053f 100644
--- a/ext/-test-/wait_for_single_fd/depend
+++ b/ext/-test-/wait_for_single_fd/depend
@@ -1,14 +1,11 @@
# 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/assert.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
diff --git a/ext/-test-/wait_for_single_fd/extconf.rb b/ext/-test-/wait_for_single_fd/extconf.rb
index 2a976c8f4b..1a28b23da3 100644
--- a/ext/-test-/wait_for_single_fd/extconf.rb
+++ b/ext/-test-/wait_for_single_fd/extconf.rb
@@ -1,4 +1 @@
-# frozen_string_literal: false
-headers = %w(sys/types.h sys/time.h sys/event.h).select { |h| have_header(h) }
-have_func('kqueue', headers)
-create_makefile("-test-/wait_for_single_fd")
+create_makefile("-test-/wait_for_single_fd/wait_for_single_fd")
diff --git a/ext/-test-/wait_for_single_fd/wait_for_single_fd.c b/ext/-test-/wait_for_single_fd/wait_for_single_fd.c
index b8a33979bc..d406724a3f 100644
--- a/ext/-test-/wait_for_single_fd/wait_for_single_fd.c
+++ b/ext/-test-/wait_for_single_fd/wait_for_single_fd.c
@@ -19,67 +19,6 @@ wait_for_single_fd(VALUE ign, VALUE fd, VALUE events, VALUE timeout)
return INT2NUM(rc);
}
-#ifdef HAVE_KQUEUE
-/* ensure rb_wait_for_single_fd works on kqueue descriptors */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/event.h>
-static VALUE
-kqueue_test_wait(VALUE klass)
-{
- int kqfd = -1;
- int p[2] = { -1, -1 };
- struct timeval tv = { 0, 0 };
- const struct timespec ts = { 1, 0 };
- struct kevent kev;
- const char *msg;
- VALUE ret = Qfalse;
- int e = 0;
- int n;
-
- msg = "pipe";
- if (rb_cloexec_pipe(p) < 0) goto err;
-
- msg = "kqueue";
- kqfd = kqueue();
- if (kqfd < 0) goto err;
-
- n = rb_wait_for_single_fd(kqfd, RB_WAITFD_IN, &tv);
- if (n != 0) {
- msg = "spurious wakeup";
- errno = 0;
- goto err;
- }
-
- msg = "write";
- if (write(p[1], "", 1) < 0) goto err;
-
- EV_SET(&kev, p[0], EVFILT_READ, EV_ADD, 0, 0, 0);
-
- msg = "kevent";
- n = kevent(kqfd, &kev, 1, &kev, 1, &ts);
- if (n < 0) goto err;
- msg = NULL;
- if (n == 1) {
- n = rb_wait_for_single_fd(kqfd, RB_WAITFD_IN, &tv);
- ret = INT2NUM(n);
- }
- else {
- rb_warn("kevent did not return readiness");
- }
-err:
- if (msg) e = errno;
- if (p[0] >= 0) close(p[0]);
- if (p[1] >= 0) close(p[1]);
- if (kqfd >= 0) close(kqfd);
- if (msg) {
- if (e) rb_syserr_fail(e, msg);
- rb_raise(rb_eRuntimeError, "%s", msg);
- }
- return ret;
-}
-#endif /* HAVE_KQUEUE */
-
void
Init_wait_for_single_fd(void)
{
@@ -88,7 +27,4 @@ Init_wait_for_single_fd(void)
rb_define_const(rb_cObject, "RB_WAITFD_PRI", INT2NUM(RB_WAITFD_PRI));
rb_define_singleton_method(rb_cIO, "wait_for_single_fd",
wait_for_single_fd, 3);
-#ifdef HAVE_KQUEUE
- rb_define_singleton_method(rb_cIO, "kqueue_test_wait", kqueue_test_wait, 0);
-#endif
}
diff --git a/ext/-test-/win32/console/attribute.c b/ext/-test-/win32/console/attribute.c
index a5f80fcaff..a2c07fc4fe 100644
--- a/ext/-test-/win32/console/attribute.c
+++ b/ext/-test-/win32/console/attribute.c
@@ -2,37 +2,29 @@
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);
+ if (h == (HANDLE)-1) rb_raise(rb_eIOError, "invalid io");
SetConsoleTextAttribute(h, (WORD)NUM2INT(attr));
return Qnil;
}
@@ -61,9 +53,4 @@ Init_attribute(VALUE m)
rb_define_const(m, "BACKGROUND_GREEN", INT2FIX(BACKGROUND_GREEN));
rb_define_const(m, "BACKGROUND_RED", INT2FIX(BACKGROUND_RED));
rb_define_const(m, "BACKGROUND_INTENSITY", INT2FIX(BACKGROUND_INTENSITY));
-
-#ifndef COMMON_LVB_REVERSE_VIDEO
-#define COMMON_LVB_REVERSE_VIDEO 0x4000
-#endif
- rb_define_const(m, "REVERSE_VIDEO", INT2FIX(COMMON_LVB_REVERSE_VIDEO));
}
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-/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..98ffffd2b6 100644
--- a/ext/Setup
+++ b/ext/Setup
@@ -1,12 +1,8 @@
#option nodynamic
+#Win32API
#bigdecimal
-#cgi/escape
-#continuation
-#coverage
-#date
#dbm
-#digest/bubblebabble
#digest
#digest/md5
#digest/rmd160
@@ -14,23 +10,12 @@
#digest/sha2
#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 +23,6 @@
#stringio
#strscan
#syslog
-#win32
+#tk
#win32ole
#zlib
diff --git a/ext/Setup.atheos b/ext/Setup.atheos
index 90a7d01348..41eecd161f 100644
--- a/ext/Setup.atheos
+++ b/ext/Setup.atheos
@@ -2,7 +2,6 @@ option nodynamic
#Win32API
bigdecimal
-cgi/escape
dbm
digest
digest/md5
@@ -25,5 +24,6 @@ socket
stringio
strscan
syslog
+#tk
#win32ole
zlib
diff --git a/ext/Setup.emx b/ext/Setup.emx
new file mode 100644
index 0000000000..d976a1854e
--- /dev/null
+++ b/ext/Setup.emx
@@ -0,0 +1,31 @@
+# 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
+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..ce65ebcf0a
--- /dev/null
+++ b/ext/Setup.nacl
@@ -0,0 +1,45 @@
+# #option nodynamic
+#
+# #Win32API
+# bigdecimal
+# continuation
+# coverage
+# date
+# #dbm
+# digest/bubblebabble
+# digest
+# digest/md5
+# digest/rmd160
+# digest/sha1
+# digest/sha2
+# 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..285b1edcb6 100644
--- a/ext/Setup.nt
+++ b/ext/Setup.nt
@@ -3,7 +3,6 @@
Win32API
bigdecimal
-cgi/escape
#dbm
digest
digest/md5
@@ -26,5 +25,6 @@ socket
stringio
strscan
#syslog
+#tk
win32ole
#zlib
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 7ac883730d..b4166ae376 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -62,7 +62,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,39 +102,26 @@ 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"), 0);
-#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"), 0);
-#endif
-}
-#endif
-
-#define BIGDECIMAL_POSITIVE_P(bd) ((bd)->sign > 0)
-#define BIGDECIMAL_NEGATIVE_P(bd) ((bd)->sign < 0)
-
/*
* ================== Ruby Interface part ==========================
*/
#define DoSomeOne(x,y,f) rb_num_coerce_bin(x,y,f)
/*
+ * Returns the BigDecimal version number.
+ */
+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
+ */
+ return rb_str_new2("1.1.0");
+}
+
+/*
* VP routines used in BigDecimal part
*/
static unsigned short VpGetException(void);
@@ -162,7 +148,7 @@ 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 = {
@@ -217,7 +203,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];
@@ -231,8 +216,9 @@ again:
if (prec > DBL_DIG+1) goto SomeOneMayDoIt;
d = RFLOAT_VALUE(v);
if (!isfinite(d)) {
- pv = VpCreateRbObject(1, NULL);
- VpDtoV(pv, d);
+ pv = VpCreateRbObject(prec, NULL);
+ pv->sign = isnan(d) ? VP_SIGN_NaN :
+ d > 0 ? VP_SIGN_POSITIVE_INFINITE : VP_SIGN_NEGATIVE_FINITE;
return pv;
}
if (d != 0.0) {
@@ -275,14 +261,13 @@ again:
#ifdef ENABLE_NUMERIC_STRING
case T_STRING:
- StringValueCStr(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:
@@ -323,18 +308,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)
{
@@ -370,7 +352,7 @@ BigDecimal_hash(VALUE self)
hash ^= rb_memhash(p->frac, sizeof(BDIGIT)*p->Prec);
hash += p->exponent;
}
- return ST2FIX(hash);
+ return INT2FIX(hash);
}
/*
@@ -378,10 +360,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.
*/
@@ -416,7 +398,8 @@ BigDecimal_load(VALUE self, VALUE str)
unsigned char ch;
unsigned long m=0;
- pch = (unsigned char *)StringValueCStr(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)) {
@@ -434,55 +417,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;
@@ -510,7 +444,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");
}
@@ -563,7 +498,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 */
@@ -604,7 +540,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;
}
@@ -630,12 +566,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;
}
@@ -643,18 +580,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, 1, 1);
- RTYPEDDATA_DATA(obj) = pv;
- pv->obj = obj;
- RB_OBJ_FREEZE(obj);
+ Real *pv = VpAlloc(mx,str);
+ 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))
@@ -676,7 +612,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)
{
@@ -697,7 +633,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)
{
@@ -723,9 +659,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)
@@ -745,12 +681,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) {
@@ -805,17 +741,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);
}
@@ -834,7 +770,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);
@@ -861,8 +797,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.
@@ -893,14 +829,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)
{
@@ -921,8 +856,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)
@@ -966,7 +901,7 @@ BigDecimal_add(VALUE self, VALUE r)
}
/* call-seq:
- * a - b -> bigdecimal
+ * value - digits -> bigdecimal
*
* Subtract the specified value.
*
@@ -1150,7 +1085,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)
@@ -1211,14 +1146,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)
{
@@ -1242,8 +1177,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)
@@ -1306,14 +1241,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 */
@@ -1485,10 +1431,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
*/
@@ -1502,24 +1445,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.
@@ -1556,7 +1496,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);
}
@@ -1566,7 +1506,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;
@@ -1579,37 +1519,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)
{
@@ -1625,7 +1534,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);
@@ -1637,7 +1546,7 @@ BigDecimal_add2(VALUE self, VALUE b, VALUE n)
}
}
-/* call-seq:
+/*
* sub(value, digits) -> bigdecimal
*
* Subtract the specified value.
@@ -1646,8 +1555,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
@@ -1655,7 +1564,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);
@@ -1673,7 +1582,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);
@@ -1685,16 +1594,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)
{
@@ -1727,14 +1632,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)
@@ -1753,15 +1658,10 @@ BigDecimal_fix(VALUE self)
/* call-seq:
* round(n, mode)
*
- * Round to the nearest integer (by default), returning the result as a
- * BigDecimal if n is specified, or as an Integer if it isn't.
+ * 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
- *
- * BigDecimal('3.14159').round(2).class.name #=> "BigDecimal"
- * BigDecimal('3.14159').round.class.name #=> "Integer"
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
@@ -1792,21 +1692,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;
@@ -1827,12 +1719,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.
@@ -1856,7 +1746,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));
@@ -1870,7 +1761,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)
@@ -1916,7 +1807,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));
@@ -1962,7 +1854,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));
@@ -2000,34 +1893,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);
+ SafeStringValue(f);
+ psz = RSTRING_PTR(f);
if (*psz == ' ') {
fPlus = 1;
psz++;
@@ -2050,11 +1943,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) {
@@ -2148,26 +2037,38 @@ BigDecimal_exponent(VALUE self)
return INT2NUM(e);
}
-/* Returns a string representation of self.
+/* Returns debugging information about the value as a string of comma-separated
+ * values in angle brackets with a leading #:
+ *
+ * BigDecimal.new("1234.5678").inspect ->
+ * "#<BigDecimal:b7ea1130,'0.12345678E4',8(12)>"
*
- * BigDecimal("1234.5678").inspect
- * #=> "0.12345678e4"
+ * 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
+ * maximum number of significant digits, respectively.
*/
static VALUE
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);
@@ -2294,7 +2195,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)
@@ -2313,7 +2214,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
n = NIL_P(prec) ? (ssize_t)(x->Prec*VpBaseFig()) : NUM2SSIZET(prec);
if (VpIsNaN(x)) {
- y = VpCreateRbObject(n, "0");
+ y = VpCreateRbObject(n, "0#");
RB_GC_GUARD(y->obj);
VpSetNaN(y);
return ToValue(y);
@@ -2377,7 +2278,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 */
@@ -2416,7 +2317,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 */
@@ -2437,8 +2338,8 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
}
else {
- y = VpCreateRbObject(n, "0");
- if (BIGDECIMAL_NEGATIVE_P(x)) {
+ y = VpCreateRbObject(n, "0#");
+ if (VpGetSign(x) < 0) {
if (is_integer(vexp)) {
if (is_even(vexp)) {
VpSetPosInf(y);
@@ -2470,7 +2371,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
else if (RTEST(rb_funcall(abs_value, '<', 1, INT2FIX(1)))) {
if (is_negative(vexp)) {
- y = VpCreateRbObject(n, "0");
+ y = VpCreateRbObject(n, "0#");
if (is_even(vexp)) {
VpSetInf(y, VpGetSign(x));
}
@@ -2479,7 +2380,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 {
@@ -2488,7 +2389,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
else {
if (is_positive(vexp)) {
- y = VpCreateRbObject(n, "0");
+ y = VpCreateRbObject(n, "0#");
if (is_even(vexp)) {
VpSetInf(y, VpGetSign(x));
}
@@ -2497,7 +2398,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 {
@@ -2526,11 +2427,9 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
}
/* call-seq:
- * a ** n -> bigdecimal
- *
- * Returns the value raised to the power of n.
+ * big_decimal ** exp -> big_decimal
*
- * See BigDecimal#power.
+ * It is a synonym of BigDecimal#power(exp).
*/
static VALUE
BigDecimal_power_op(VALUE self, VALUE exp)
@@ -2538,94 +2437,93 @@ BigDecimal_power_op(VALUE self, VALUE exp)
return BigDecimal_power(1, &exp, self);
}
-/* :nodoc:
+static VALUE
+BigDecimal_s_allocate(VALUE klass)
+{
+ return VpNewRbClass(0, NULL, klass)->obj;
+}
+
+static Real *BigDecimal_new(int argc, VALUE *argv);
+
+/* call-seq:
+ * new(initial, digits)
+ *
+ * Create a new BigDecimal object.
*
- * private method for dup and clone the provided BigDecimal +other+
+ * initial:: The initial value, as an Integer, a Float, a Rational,
+ * a BigDecimal, or a String.
+ *
+ * If it is a String, spaces are ignored and unrecognized characters
+ * terminate the value.
+ *
+ * digits:: The number of significant digits, as a Fixnum. If omitted or 0,
+ * the number of significant digits is determined from the initial
+ * value.
+ *
+ * The actual number of significant digits used in computation is usually
+ * larger than the specified number.
+ *
+ * ==== Exceptions
+ *
+ * TypeError:: If the +initial+ type is neither Fixnum, Bignum, Float,
+ * Rational, nor BigDecimal, this exception is raised.
+ *
+ * TypeError:: If the +digits+ is not a Fixnum, this exception is raised.
+ *
+ * ArgumentError:: If +initial+ is a Float, and the +digits+ is larger than
+ * Float::DIG + 1, this exception is raised.
+ *
+ * ArgumentError:: If the +initial+ is a Float or Rational, and the +digits+
+ * value is omitted, this exception is raised.
*/
static VALUE
-BigDecimal_initialize_copy(VALUE self, VALUE other)
+BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
{
+ ENTER(1);
Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
- Real *x = rb_check_typeddata(other, &BigDecimal_data_type);
+ Real *x;
- if (self != other) {
- DATA_PTR(self) = VpCopy(pv, x);
+ GUARD_OBJ(x, BigDecimal_new(argc, argv));
+ if (ToValue(x)) {
+ pv = VpCopy(pv, x);
}
+ else {
+ VpFree(pv);
+ pv = x;
+ }
+ DATA_PTR(self) = pv;
+ pv->obj = self;
return self;
}
+/* :nodoc:
+ *
+ * private method to dup and clone the provided BigDecimal +other+
+ */
static VALUE
-BigDecimal_clone(VALUE self)
+BigDecimal_initialize_copy(VALUE self, VALUE other)
{
- return self;
-}
+ Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
+ Real *x = rb_check_typeddata(other, &BigDecimal_data_type);
-#ifdef HAVE_RB_OPTS_EXCEPTION_P
-int rb_opts_exception_p(VALUE opts, int default_value);
-#define opts_exception_p(opts) rb_opts_exception_p((opts), 1)
-#else
-static int
-opts_exception_p(VALUE opts)
-{
- static ID kwds[1];
- VALUE exception;
- if (!kwds[0]) {
- kwds[0] = rb_intern_const("exception");
- }
- if (!rb_get_kwargs(opts, kwds, 0, 1, &exception)) return 1;
- switch (exception) {
- case Qtrue: case Qfalse:
- break;
- default:
- rb_raise(rb_eArgError, "true or false is expected as exception: %+"PRIsVALUE,
- exception);
+ if (self != other) {
+ DATA_PTR(self) = VpCopy(pv, x);
}
- return exception != Qfalse;
+ return self;
}
-#endif
static Real *
-VpNewVarArg(int argc, VALUE *argv)
+BigDecimal_new(int argc, VALUE *argv)
{
size_t mf;
- VALUE opts = Qnil;
VALUE nFig;
VALUE iniValue;
- double d;
- int exc;
- argc = rb_scan_args(argc, argv, "11:", &iniValue, &nFig, &opts);
- exc = opts_exception_p(opts);
-
- if (argc == 1) {
+ if (rb_scan_args(argc, argv, "11", &iniValue, &nFig) == 1) {
mf = 0;
}
else {
- /* expand GetPrecisionInt for exception suppression */
- ssize_t n = NUM2INT(nFig);
- if (n < 0) {
- if (!exc) {
- return NULL;
- }
- rb_raise(rb_eArgError, "negative precision");
- }
- mf = (size_t)n;
- }
-
- if (SPECIAL_CONST_P(iniValue)) {
- switch (iniValue) {
- case Qnil:
- if (!exc) return NULL;
- rb_raise(rb_eTypeError, "can't convert nil into BigDecimal");
- case Qtrue:
- if (!exc) return NULL;
- rb_raise(rb_eTypeError, "can't convert true into BigDecimal");
- case Qfalse:
- if (!exc) return NULL;
- rb_raise(rb_eTypeError, "can't convert false into BigDecimal");
- default:
- break;
- }
+ mf = GetPositiveInt(nFig);
}
switch (TYPE(iniValue)) {
@@ -2641,24 +2539,12 @@ VpNewVarArg(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) {
- if (!exc) {
- return NULL;
- }
rb_raise(rb_eArgError, "precision too large.");
}
/* fall through */
case T_RATIONAL:
if (NIL_P(nFig)) {
- if (!exc) {
- return NULL;
- }
rb_raise(rb_eArgError,
"can't omit precision for a %"PRIsVALUE".",
RB_OBJ_CLASSNAME(iniValue));
@@ -2670,82 +2556,20 @@ VpNewVarArg(int argc, VALUE *argv)
default:
break;
}
- /* TODO: support to_d */
- if (!exc) {
- iniValue = rb_check_convert_type(iniValue, T_STRING, "String", "to_str");
- if (NIL_P(iniValue)) return NULL;
- }
StringValueCStr(iniValue);
- return VpAlloc(mf, RSTRING_PTR(iniValue), 1, exc);
+ return VpAlloc(mf, RSTRING_PTR(iniValue));
}
-/* call-seq:
- * BigDecimal(initial, digits, exception: true)
- *
- * Create a new BigDecimal object.
- *
- * initial:: The initial value, as an Integer, a Float, a Rational,
- * a BigDecimal, or a String.
- *
- * If it is a String, spaces are ignored and unrecognized characters
- * terminate the value.
- *
- * digits:: The number of significant digits, as an Integer. If omitted or 0,
- * the number of significant digits is determined from the initial
- * value.
- *
- * The actual number of significant digits used in computation is
- * usually larger than the specified number.
- *
- * exception:: Whether an exception should be raised on invalid arguments.
- * +true+ by default, if passed +false+, just returns +nil+
- * for invalid.
- *
- *
- * ==== Exceptions
- *
- * TypeError:: If the +initial+ type is neither Integer, Float,
- * Rational, nor BigDecimal, this exception is raised.
- *
- * TypeError:: If the +digits+ is not an Integer, this exception is raised.
- *
- * ArgumentError:: If +initial+ is a Float, and the +digits+ is larger than
- * Float::DIG + 1, this exception is raised.
- *
- * ArgumentError:: If the +initial+ is a Float or Rational, and the +digits+
- * value is omitted, this exception is raised.
- */
+/* See also BigDecimal.new */
static VALUE
-f_BigDecimal(int argc, VALUE *argv, VALUE self)
+BigDecimal_global_new(int argc, VALUE *argv, VALUE self)
{
ENTER(1);
Real *pv;
- VALUE obj;
- if (argc > 0 && CLASS_OF(argv[0]) == rb_cBigDecimal) {
- if (argc == 1 || (argc == 2 && RB_TYPE_P(argv[1], T_HASH))) return argv[0];
- }
- obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, 0);
- pv = VpNewVarArg(argc, argv);
- if (pv == NULL) return Qnil;
- SAVE(pv);
+ GUARD_OBJ(pv, BigDecimal_new(argc, argv));
if (ToValue(pv)) pv = VpCopy(NULL, pv);
- RTYPEDDATA_DATA(obj) = pv;
- RB_OBJ_FREEZE(obj);
- return pv->obj = obj;
-}
-
-static VALUE
-BigDecimal_s_interpret_loosely(VALUE klass, VALUE str)
-{
- ENTER(1);
- char const *c_str;
- Real *pv;
-
- c_str = StringValueCStr(str);
- GUARD_OBJ(pv, VpAlloc(0, c_str, 0, 1));
- pv->obj = TypedData_Wrap_Struct(klass, &BigDecimal_data_type, pv);
- RB_OBJ_FREEZE(pv->obj);
+ pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
return pv->obj;
}
@@ -2770,7 +2594,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");
}
@@ -2811,9 +2636,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_*
@@ -2907,13 +2732,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;
@@ -2966,12 +2791,8 @@ 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) {
- VALUE x_zero = INT2NUM(1);
- VALUE x_copy = f_BigDecimal(1, &x_zero, klass);
- x = BigDecimal_initialize_copy(x_copy, x);
- vx = DATA_PTR(x);
VpSetSign(vx, 1);
}
@@ -3049,14 +2870,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;
@@ -3204,15 +3025,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
*
@@ -3226,8 +3047,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
@@ -3240,13 +3061,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
*
@@ -3259,11 +3080,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.)
*
@@ -3273,25 +3094,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.
*
@@ -3312,18 +3121,17 @@ Init_bigdecimal(void)
/* Class and method registration */
rb_cBigDecimal = rb_define_class("BigDecimal", rb_cNumeric);
+ rb_define_alloc_func(rb_cBigDecimal, BigDecimal_s_allocate);
/* Global function */
- rb_define_global_function("BigDecimal", f_BigDecimal, -1);
+ rb_define_global_function("BigDecimal", BigDecimal_global_new, -1);
/* Class methods */
- rb_undef_method(CLASS_OF(rb_cBigDecimal), "allocate");
- rb_undef_method(CLASS_OF(rb_cBigDecimal), "new");
- rb_define_singleton_method(rb_cBigDecimal, "interpret_loosely", BigDecimal_s_interpret_loosely, 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);
rb_define_singleton_method(rb_cBigDecimal, "_load", BigDecimal_load, 1);
+ rb_define_singleton_method(rb_cBigDecimal, "ver", BigDecimal_version, 0);
rb_define_singleton_method(rb_cBigDecimal, "save_exception_mode", BigDecimal_save_exception_mode, 0);
rb_define_singleton_method(rb_cBigDecimal, "save_rounding_mode", BigDecimal_save_rounding_mode, 0);
@@ -3331,14 +3139,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.
@@ -3381,7 +3181,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));
@@ -3443,13 +3243,14 @@ Init_bigdecimal(void)
arg = rb_str_new2("+Infinity");
/* Positive infinity value. */
- rb_define_const(rb_cBigDecimal, "INFINITY", f_BigDecimal(1, &arg, rb_cBigDecimal));
+ rb_define_const(rb_cBigDecimal, "INFINITY", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
arg = rb_str_new2("NaN");
/* 'Not a Number' value. */
- rb_define_const(rb_cBigDecimal, "NAN", f_BigDecimal(1, &arg, rb_cBigDecimal));
+ rb_define_const(rb_cBigDecimal, "NAN", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
/* instance methods */
+ rb_define_method(rb_cBigDecimal, "initialize", BigDecimal_initialize, -1);
rb_define_method(rb_cBigDecimal, "initialize_copy", BigDecimal_initialize_copy, 1);
rb_define_method(rb_cBigDecimal, "precs", BigDecimal_prec, 0);
@@ -3474,8 +3275,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);
@@ -3523,7 +3323,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");
}
/*
@@ -3551,14 +3350,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);
@@ -3585,7 +3377,7 @@ VpMemAlloc(size_t mb)
return p;
}
-VP_EXPORT void *
+ VP_EXPORT void *
VpMemRealloc(void *ptr, size_t mb)
{
void *p = xrealloc(ptr, mb);
@@ -3603,12 +3395,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 */
}
@@ -3638,7 +3430,7 @@ VpGetException (void)
return RMPD_EXCEPTION_MODE_DEFAULT;
}
- return NUM2USHORT(vmode);
+ return (unsigned short)FIX2UINT(vmode);
}
static void
@@ -3708,7 +3500,7 @@ VpGetRoundMode(void)
return RMPD_ROUNDING_MODE_DEFAULT;
}
- return NUM2USHORT(vmode);
+ return (unsigned short)FIX2INT(vmode);
}
VP_EXPORT int
@@ -3748,7 +3540,13 @@ VpSetRoundMode(unsigned short n)
* (to let the compiler know they may be changed in outside
* (... but not actually..)).
*/
+volatile const double gZero_ABCED9B1_CE73__00400511F31D = 0.0;
volatile const double gOne_ABCED9B4_CE73__00400511F31D = 1.0;
+static double
+Zero(void)
+{
+ return gZero_ABCED9B1_CE73__00400511F31D;
+}
static double
One(void)
@@ -3773,19 +3571,25 @@ One(void)
VP_EXPORT double
VpGetDoubleNaN(void) /* Returns the value of NaN */
{
- return nan("");
+ static double fNaN = 0.0;
+ if (fNaN == 0.0) fNaN = Zero()/Zero();
+ return fNaN;
}
VP_EXPORT double
VpGetDoublePosInf(void) /* Returns the value of +Infinity */
{
- return HUGE_VAL;
+ static double fInf = 0.0;
+ if (fInf == 0.0) fInf = One()/Zero();
+ return fInf;
}
VP_EXPORT double
VpGetDoubleNegInf(void) /* Returns the value of -Infinity */
{
- return -HUGE_VAL;
+ static double fInf = 0.0;
+ if (fInf == 0.0) fInf = -(One()/Zero());
+ return fInf;
}
VP_EXPORT double
@@ -3833,7 +3637,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 */
@@ -3844,7 +3648,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;
@@ -3853,7 +3657,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;
@@ -3862,10 +3666,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;
}
@@ -3874,18 +3680,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;
@@ -3893,20 +3699,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;
@@ -3914,13 +3720,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);
}
@@ -3980,11 +3780,14 @@ VP_EXPORT size_t
VpInit(BDIGIT BaseVal)
{
/* Setup +/- Inf NaN -0 */
+ VpGetDoubleNaN();
+ VpGetDoublePosInf();
+ VpGetDoubleNegInf();
VpGetDoubleNegZero();
/* Allocates Vp constants. */
- VpConstOne = VpAlloc(1UL, "1", 1, 1);
- VpPt5 = VpAlloc(1UL, ".5", 1, 1);
+ VpConstOne = VpAlloc(1UL, "1");
+ VpPt5 = VpAlloc(1UL, ".5");
#ifdef BIGDECIMAL_DEBUG
gnAlloc = 0;
@@ -3992,12 +3795,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 */
@@ -4024,7 +3827,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) {
@@ -4033,7 +3836,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;
@@ -4048,52 +3851,6 @@ overflow:
return VpException(VP_EXCEPTION_OVERFLOW, "Exponent overflow", 0);
}
-Real *
-rmpd_parse_special_string(const char *str)
-{
- static const struct {
- const char *str;
- size_t len;
- int sign;
- } table[] = {
- { SZ_INF, sizeof(SZ_INF) - 1, VP_SIGN_POSITIVE_INFINITE },
- { SZ_PINF, sizeof(SZ_PINF) - 1, VP_SIGN_POSITIVE_INFINITE },
- { SZ_NINF, sizeof(SZ_NINF) - 1, VP_SIGN_NEGATIVE_INFINITE },
- { SZ_NaN, sizeof(SZ_NaN) - 1, VP_SIGN_NaN }
- };
- static const size_t table_length = sizeof(table) / sizeof(table[0]);
- size_t i;
-
- for (i = 0; i < table_length; ++i) {
- const char *p;
- if (strncmp(str, table[i].str, table[i].len) != 0) {
- continue;
- }
-
- p = str + table[i].len;
- while (*p && ISSPACE(*p)) ++p;
- if (*p == '\0') {
- Real *vp = VpAllocReal(1);
- vp->MaxPrec = 1;
- switch (table[i].sign) {
- default:
- UNREACHABLE; break;
- case VP_SIGN_POSITIVE_INFINITE:
- VpSetPosInf(vp);
- return vp;
- case VP_SIGN_NEGATIVE_INFINITE:
- VpSetNegInf(vp);
- return vp;
- case VP_SIGN_NaN:
- VpSetNaN(vp);
- return vp;
- }
- }
- }
-
- return NULL;
-}
-
/*
* Allocates variable.
* [Input]
@@ -4108,10 +3865,9 @@ rmpd_parse_special_string(const char *str)
* NULL be returned if memory allocation is failed,or any error.
*/
VP_EXPORT Real *
-VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
+VpAlloc(size_t mx, const char *szVal)
{
- const char *orig_szVal = szVal;
- size_t i, j, ni, 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;
@@ -4122,198 +3878,123 @@ VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
if (mx == 0) ++mx;
if (szVal) {
- /* Skipping leading spaces */
- while (ISSPACE(*szVal)) szVal++;
-
- /* Processing the leading one `#` */
- 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 {
- return_zero:
- /* 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;
- }
-
- /* Check on Inf & NaN */
- if ((vp = rmpd_parse_special_string(szVal)) != NULL) {
- return vp;
- }
-
- /* Scanning digits */
-
- /* A buffer for keeping scanned digits */
+ /* 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 */
+ ni = 0;
buf = rb_str_tmp_new(strlen(szVal) + 1);
psz = RSTRING_PTR(buf);
-
- /* cursor: i for psz, and j for szVal */
- i = j = 0;
-
- /* Scanning: sign part */
- v = psz[i] = szVal[j];
- if ((v == '-') || (v == '+')) {
- sign = -(v == '-');
- ++i;
- ++j;
+ i = 0;
+ ipn = 0;
+ while ((psz[i] = szVal[ipn]) != 0) {
+ if (ISDIGIT(psz[i])) ++ni;
+ if (psz[i] == '_') {
+ if (ni > 0) {
+ ipn++;
+ continue;
+ }
+ psz[i] = 0;
+ break;
+ }
+ ++i;
+ ++ipn;
}
-
- /* Scanning: integer part */
- ni = 0; /* number of digits in the integer part */
- while ((v = psz[i] = szVal[j]) != '\0') {
- if (!strict_p && ISSPACE(v)) {
- v = psz[i] = '\0';
- break;
- }
- if (v == '_') {
- if (ni > 0) {
- v = szVal[j+1];
- if (v == '\0' || ISSPACE(v) || ISDIGIT(v)) {
- ++j;
- continue;
- }
- if (!strict_p) {
- v = psz[i] = '\0';
- break;
- }
- }
- goto invalid_value;
- }
- if (!ISDIGIT(v)) {
- break;
- }
- ++ni;
- ++i;
- ++j;
- }
-
- /* Scanning: fractional part */
- nf = 0; /* number of digits in the fractional part */
- ne = 0; /* number of digits in the exponential part */
- ipf = 0; /* index of the beginning of the fractional part */
- ipe = 0; /* index of the beginning of the exponential part */
- dot_seen = 0;
- exp_seen = 0;
-
- if (v != '\0') {
- /* Scanning fractional part */
- if ((psz[i] = szVal[j]) == '.') {
- dot_seen = 1;
- ++i;
- ++j;
- ipf = i;
- while ((v = psz[i] = szVal[j]) != '\0') {
- if (!strict_p && ISSPACE(v)) {
- v = psz[i] = '\0';
- break;
- }
- if (v == '_') {
- if (nf > 0 && ISDIGIT(szVal[j+1])) {
- ++j;
- continue;
- }
- if (!strict_p) {
- v = psz[i] = '\0';
- if (nf == 0) {
- dot_seen = 0;
- }
- break;
- }
- goto invalid_value;
- }
- if (!ISDIGIT(v)) break;
- ++i;
- ++j;
- ++nf;
- }
- }
-
- /* Scanning exponential part */
- if (v != '\0') {
- switch ((psz[i] = szVal[j])) {
- case '\0':
- break;
- case 'e': case 'E':
- case 'd': case 'D':
- exp_seen = 1;
- ++i;
- ++j;
- ipe = i;
- v = psz[i] = szVal[j];
- if ((v == '-') || (v == '+')) {
- ++i;
- ++j;
- }
- while ((v = psz[i] = szVal[j]) != '\0') {
- if (!strict_p && ISSPACE(v)) {
- v = psz[i] = '\0';
- break;
- }
- if (v == '_') {
- if (ne > 0 && ISDIGIT(szVal[j+1])) {
- ++j;
- continue;
- }
- if (!strict_p) {
- v = psz[i] = '\0';
- if (ne == 0) {
- exp_seen = 0;
- }
- break;
- }
- goto invalid_value;
- }
- if (!ISDIGIT(v)) break;
- ++i;
- ++j;
- ++ne;
- }
- break;
- default:
- break;
- }
- }
-
- if (v != '\0') {
- /* Scanning trailing spaces */
- while (ISSPACE(szVal[j])) ++j;
-
- /* Invalid character */
- if (szVal[j] && strict_p) {
- goto invalid_value;
- }
- }
+ /* Skip trailing spaces */
+ while (--i > 0) {
+ if (ISSPACE(psz[i])) psz[i] = 0;
+ else break;
}
+ szVal = psz;
- psz[i] = '\0';
+ /* 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;
+ }
+ if (StrCmp(szVal, SZ_NINF) == 0) {
+ 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;
+ }
+
+ /* check on number szVal[] */
+ ipn = i = 0;
+ if (szVal[i] == '-') { sign=-1; ++i; }
+ else if (szVal[i] == '+') ++i;
+ /* Skip digits */
+ ni = 0; /* digits in mantissa */
+ while ((v = szVal[i]) != 0) {
+ if (!ISDIGIT(v)) break;
+ ++i;
+ ++ni;
+ }
+ nf = 0;
+ ipf = 0;
+ ipe = 0;
+ ne = 0;
+ if (v) {
+ /* other than digit nor \0 */
+ if (szVal[i] == '.') { /* xxx. */
+ ++i;
+ ipf = i;
+ while ((v = szVal[i]) != 0) { /* get fraction part. */
+ if (!ISDIGIT(v)) break;
+ ++i;
+ ++nf;
+ }
+ }
+ ipe = 0; /* Exponent */
- if (strict_p && (((ni == 0 || dot_seen) && nf == 0) || (exp_seen && ne == 0))) {
- VALUE str;
- invalid_value:
- if (!strict_p) {
- goto return_zero;
- }
- if (!exc) {
- return NULL;
- }
- str = rb_str_new2(orig_szVal);
- rb_raise(rb_eArgError, "invalid value for BigDecimal(): \"%"PRIsVALUE"\"", str);
+ 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;
@@ -4323,7 +4004,7 @@ VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
/* xmalloc() alway returns(or throw interruption) */
vp->MaxPrec = mx; /* set max precision */
VpSetZero(vp, sign);
- VpCtoV(vp, psz, ni, psz + ipf, nf, psz + ipe, ne);
+ VpCtoV(vp, &szVal[ipn], ni, &szVal[ipf], nf, &szVal[ipe], ne);
rb_str_resize(buf, 0);
return vp;
}
@@ -4381,7 +4062,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
@@ -4400,7 +4081,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)) {
@@ -4514,7 +4195,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|
*/
@@ -4856,7 +4537,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 */
@@ -4886,7 +4567,7 @@ VpMult(Real *c, Real *a, Real *b)
if (MxIndC < MxIndAB) { /* The Max. prec. of c < Prec(a)+Prec(b) */
w = c;
- c = VpAlloc((size_t)((MxIndAB + 1) * BASE_FIG), "#0", 1, 1);
+ c = VpAlloc((size_t)((MxIndAB + 1) * BASE_FIG), "#0");
MxIndC = MxIndAB;
}
@@ -4968,7 +4649,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;
@@ -4986,14 +4667,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 */
@@ -5160,11 +4841,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.");
@@ -5273,7 +4954,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) {
@@ -5314,8 +4995,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
@@ -5325,6 +5006,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). */
@@ -5333,20 +5032,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;
}
@@ -5435,7 +5122,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);
@@ -5484,7 +5171,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;
@@ -5512,7 +5199,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);
@@ -5547,7 +5234,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;
@@ -5558,7 +5245,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++ = '+';
@@ -5589,13 +5276,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;
@@ -5604,7 +5291,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++ = '+';
@@ -6026,22 +5713,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 ? */
@@ -6054,8 +5740,8 @@ VpSqrt(Real *y, Real *x)
if (x->MaxPrec > (size_t)n) n = (ssize_t)x->MaxPrec;
/* allocate temporally variables */
- f = VpAlloc(y->MaxPrec * (BASE_FIG + 2), "#1", 1, 1);
- r = VpAlloc((n + n) * (BASE_FIG + 2), "#1", 1, 1);
+ f = VpAlloc(y->MaxPrec * (BASE_FIG + 2), "#1");
+ r = VpAlloc((n + n) * (BASE_FIG + 2), "#1");
nr = 0;
y_prec = y->MaxPrec;
@@ -6120,12 +5806,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? */
@@ -6227,10 +5918,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;
@@ -6349,10 +6040,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,
@@ -6489,7 +6180,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;
@@ -6507,8 +6198,8 @@ VpPower(Real *y, Real *x, SIGNED_VALUE n)
/* Allocate working variables */
- w1 = VpAlloc((y->MaxPrec + 2) * BASE_FIG, "#0", 1, 1);
- w2 = VpAlloc((w1->MaxPrec * 2 + 1) * BASE_FIG, "#0", 1, 1);
+ w1 = VpAlloc((y->MaxPrec + 2) * BASE_FIG, "#0");
+ w2 = VpAlloc((w1->MaxPrec * 2 + 1) * BASE_FIG, "#0");
/* calculation start */
VpAsgn(y, x, 1);
@@ -6534,7 +6225,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);
@@ -6569,10 +6260,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 7d767f598b..7eb628c657 100644
--- a/ext/bigdecimal/bigdecimal.gemspec
+++ b/ext/bigdecimal/bigdecimal.gemspec
@@ -1,25 +1,23 @@
-# coding: utf-8
-
-bigdecimal_version = '2.0.0'
+# -*- ruby -*-
+_VERSION = "1.2.6"
+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.license = 'ruby'
+ s.summary = "Arbitrary-precision decimal floating-point number library."
+ s.homepage = "http://www.ruby-lang.org"
+ s.email = "mrkn@mrkn.jp"
+ s.description = "This library provides arbitrary-precision decimal floating-point number class."
+ s.authors = ["Kenta Murata", "Zachary Scott", "Shigeo Kobayashi"]
+ s.require_path = %[lib]
+ s.files = %w[
bigdecimal.gemspec
- ext/bigdecimal/bigdecimal.c
- ext/bigdecimal/bigdecimal.h
- lib/bigdecimal.rb
+ bigdecimal.c
+ bigdecimal.h
+ depend extconf.rb
lib/bigdecimal/jacobian.rb
lib/bigdecimal/ludcmp.rb
lib/bigdecimal/math.rb
@@ -29,11 +27,5 @@ Gem::Specification.new do |s|
sample/nlsolve.rb
sample/pi.rb
]
-
- s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
-
- s.add_development_dependency "rake", "~> 10.0"
- s.add_development_dependency "rake-compiler", ">= 0.9"
- s.add_development_dependency "minitest", "< 5.0.0"
- s.add_development_dependency "pry"
+ s.extensions = %w[extconf.rb]
end
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h
index e3eae06e67..e8adea64bd 100644
--- a/ext/bigdecimal/bigdecimal.h
+++ b/ext/bigdecimal/bigdecimal.h
@@ -9,8 +9,6 @@
#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 +36,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 +68,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
@@ -227,9 +147,7 @@ extern VALUE rb_cBigDecimal;
#define VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */
#define VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#define FLEXIBLE_ARRAY_SIZE /* */
-#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#ifdef __GNUC__
#define FLEXIBLE_ARRAY_SIZE 0
#else
#define FLEXIBLE_ARRAY_SIZE 1
@@ -242,11 +160,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. */
/*
@@ -308,7 +226,7 @@ VP_EXPORT size_t VpInit(BDIGIT BaseVal);
VP_EXPORT void *VpMemAlloc(size_t mb);
VP_EXPORT void *VpMemRealloc(void *ptr, size_t mb);
VP_EXPORT void VpFree(Real *pv);
-VP_EXPORT Real *VpAlloc(size_t mx, const char *szVal, int strict_p, int exc);
+VP_EXPORT Real *VpAlloc(size_t mx, const char *szVal);
VP_EXPORT size_t VpAsgn(Real *c, Real *a, int isw);
VP_EXPORT size_t VpAddSub(Real *c,Real *a,Real *b,int operation);
VP_EXPORT size_t VpMult(Real *c,Real *a,Real *b);
diff --git a/ext/bigdecimal/depend b/ext/bigdecimal/depend
index ffd61b8960..d9c6600b80 100644
--- a/ext/bigdecimal/depend
+++ b/ext/bigdecimal/depend
@@ -1,17 +1,13 @@
-extconf.h: $(srcdir)/$(GEMSPEC)
-Makefile: $(BIGDECIMAL_RB)
-
# AUTOGENERATED DEPENDENCIES START
bigdecimal.o: $(RUBY_EXTCONF_H)
bigdecimal.o: $(arch_hdrdir)/ruby/config.h
-bigdecimal.o: $(hdrdir)/ruby/assert.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: $(hdrdir)/ruby/ruby.h
bigdecimal.o: bigdecimal.c
bigdecimal.o: bigdecimal.h
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index b4098fdacf..d6be3e584e 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -1,52 +1,6 @@
-# frozen_string_literal: false
require 'mkmf'
-def check_bigdecimal_version(gemspec_path)
- message "checking RUBY_BIGDECIMAL_VERSION... "
-
- bigdecimal_version =
- IO.readlines(gemspec_path)
- .grep(/\Abigdecimal_version\s+=\s+/)[0][/\'([^\']+)\'/, 1]
-
- version_components = bigdecimal_version.split('.')
- bigdecimal_version = version_components[0, 3].join('.')
- bigdecimal_version << "-#{version_components[3]}" if version_components[3]
- $defs << %Q[-DRUBY_BIGDECIMAL_VERSION=\\"#{bigdecimal_version}\\"]
-
- message "#{bigdecimal_version}\n"
-end
-
-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
-
-check_bigdecimal_version(gemspec_path)
-
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")
-have_func("rb_opts_exception_p", "ruby.h")
-
-if File.file?(File.expand_path('../lib/bigdecimal.rb', __FILE__))
- bigdecimal_rb = "$(srcdir)/lib/bigdecimal.rb"
-else
- bigdecimal_rb = "$(srcdir)/../../lib/bigdecimal.rb"
-end
-create_makefile('bigdecimal') {|mf|
- mf << "GEMSPEC = #{gemspec_name}\n"
- mf << "BIGDECIMAL_RB = #{bigdecimal_rb}\n"
-}
+create_makefile('bigdecimal')
diff --git a/ext/bigdecimal/lib/bigdecimal.rb b/ext/bigdecimal/lib/bigdecimal.rb
deleted file mode 100644
index 8fd2587c84..0000000000
--- a/ext/bigdecimal/lib/bigdecimal.rb
+++ /dev/null
@@ -1 +0,0 @@
-require 'bigdecimal.so'
diff --git a/ext/bigdecimal/lib/bigdecimal/jacobian.rb b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
index 5e29304299..d56caab0d3 100644
--- a/ext/bigdecimal/lib/bigdecimal/jacobian.rb
+++ b/ext/bigdecimal/lib/bigdecimal/jacobian.rb
@@ -1,7 +1,4 @@
-# frozen_string_literal: false
-
-require 'bigdecimal'
-
+#
# require 'bigdecimal/jacobian'
#
# Provides methods to compute the Jacobian matrix of a set of equations at a
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 4ece8347bd..82c82c8e1e 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -1,76 +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.
-#++
-
-require 'bigdecimal'
-
+# 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
+ # 0.5.to_d
+ # # => #<BigDecimal:1dc69e0,'0.5E0',9(18)>
#
- # See also BigDecimal::new.
- #
- def to_d(precision=Float::DIG)
- BigDecimal(self, precision)
+ 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
- BigDecimal.interpret_loosely(self)
+ 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
@@ -78,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
@@ -97,52 +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
- #
- # Returns the value as a BigDecimal.
- #
- # The required +precision+ parameter is used to determine the number of
- # significant digits for the result.
- #
- # require 'bigdecimal'
- # require 'bigdecimal/util'
+ # r.to_d(precision) -> bigdecimal
#
- # Rational(22, 7).to_d(3) # => 0.314e1
+ # Converts a Rational to a BigDecimal.
#
- # 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)
- end
-end
-
-
-class NilClass
- # call-seq:
- # nil.to_d -> bigdecimal
- #
- # Returns nil represented as a BigDecimal.
- #
- # require 'bigdecimal'
- # require 'bigdecimal/util'
- #
- # nil.to_d # => 0.0
- #
- def to_d
- BigDecimal(0)
+ 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 516c2473be..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
@@ -28,8 +27,8 @@ def rd_order(na)
end
na = ARGV.size
-zero = BigDecimal("0.0")
-one = BigDecimal("1.0")
+zero = BigDecimal.new("0.0")
+one = BigDecimal.new("1.0")
while (n=rd_order(na))>0
a = []
@@ -37,28 +36,27 @@ while (n=rd_order(na))>0
b = []
if na <= 0
# Read data from console.
- printf("\nEnter coefficient matrix element A[i,j]\n")
+ printf("\nEnter coefficient matrix element A[i,j]\n");
for i in 0...n do
for j in 0...n do
printf("A[%d,%d]? ",i,j); s = ARGF.gets
- a << BigDecimal(s)
- as << BigDecimal(s)
+ a << BigDecimal.new(s);
+ as << BigDecimal.new(s);
end
- printf("Contatant vector element b[%d] ? ",i)
- b << BigDecimal(ARGF.gets)
+ printf("Contatant vector element b[%d] ? ",i); b << BigDecimal.new(ARGF.gets);
end
else
# Read data from specified file.
- printf("Coefficient matrix and constant vector.\n")
+ printf("Coefficient matrix and constant vector.\n");
for i in 0...n do
s = ARGF.gets
printf("%d) %s",i,s)
s = s.split
for j in 0...n do
- a << BigDecimal(s[j])
- as << BigDecimal(s[j])
+ a << BigDecimal.new(s[j]);
+ as << BigDecimal.new(s[j]);
end
- b << BigDecimal(s[n])
+ b << BigDecimal.new(s[n]);
end
end
x = lusolve(a,b,ludecomp(a,n,zero,one),zero)
diff --git a/ext/bigdecimal/sample/nlsolve.rb b/ext/bigdecimal/sample/nlsolve.rb
index c2227dac73..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
@@ -12,11 +11,11 @@ include Newton
class Function # :nodoc: all
def initialize()
- @zero = BigDecimal("0.0")
- @one = BigDecimal("1.0")
- @two = BigDecimal("2.0")
- @ten = BigDecimal("10.0")
- @eps = BigDecimal("1.0e-16")
+ @zero = BigDecimal.new("0.0")
+ @one = BigDecimal.new("1.0")
+ @two = BigDecimal.new("2.0")
+ @ten = BigDecimal.new("10.0")
+ @eps = BigDecimal.new("1.0e-16")
end
def zero;@zero;end
def one ;@one ;end
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/bigdecimal/util/depend b/ext/bigdecimal/util/depend
deleted file mode 100644
index 96b6a7fea0..0000000000
--- a/ext/bigdecimal/util/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-util.o: $(RUBY_EXTCONF_H)
-util.o: $(arch_hdrdir)/ruby/config.h
-util.o: $(hdrdir)/ruby.h
-util.o: $(hdrdir)/ruby/assert.h
-util.o: $(hdrdir)/ruby/backward.h
-util.o: $(hdrdir)/ruby/defines.h
-util.o: $(hdrdir)/ruby/intern.h
-util.o: $(hdrdir)/ruby/missing.h
-util.o: $(hdrdir)/ruby/ruby.h
-util.o: $(hdrdir)/ruby/st.h
-util.o: $(hdrdir)/ruby/subst.h
-util.o: util.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/cgi/escape/depend b/ext/cgi/escape/depend
deleted file mode 100644
index 8d4736616f..0000000000
--- a/ext/cgi/escape/depend
+++ /dev/null
@@ -1,17 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-escape.o: $(RUBY_EXTCONF_H)
-escape.o: $(arch_hdrdir)/ruby/config.h
-escape.o: $(hdrdir)/ruby.h
-escape.o: $(hdrdir)/ruby/assert.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: escape.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c
deleted file mode 100644
index 47188819cd..0000000000
--- a/ext/cgi/escape/escape.c
+++ /dev/null
@@ -1,407 +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;
-
-#define HTML_ESCAPE_MAX_LEN 6
-
-static const struct {
- uint8_t len;
- char str[HTML_ESCAPE_MAX_LEN+1];
-} html_escape_table[UCHAR_MAX+1] = {
-#define HTML_ESCAPE(c, str) [c] = {rb_strlen_lit(str), str}
- HTML_ESCAPE('\'', "&#39;"),
- HTML_ESCAPE('&', "&amp;"),
- HTML_ESCAPE('"', "&quot;"),
- HTML_ESCAPE('<', "&lt;"),
- HTML_ESCAPE('>', "&gt;"),
-#undef HTML_ESCAPE
-};
-
-static inline void
-preserve_original_state(VALUE orig, VALUE dest)
-{
- rb_enc_associate(dest, rb_enc_get(orig));
-}
-
-static VALUE
-optimized_escape_html(VALUE str)
-{
- VALUE vbuf;
- char *buf = ALLOCV_N(char, vbuf, RSTRING_LEN(str) * HTML_ESCAPE_MAX_LEN);
- const char *cstr = RSTRING_PTR(str);
- const char *end = cstr + RSTRING_LEN(str);
-
- char *dest = buf;
- while (cstr < end) {
- const unsigned char c = *cstr++;
- uint8_t len = html_escape_table[c].len;
- if (len) {
- memcpy(dest, html_escape_table[c].str, len);
- dest += len;
- }
- else {
- *dest++ = c;
- }
- }
-
- VALUE escaped;
- if (RSTRING_LEN(str) < (dest - buf)) {
- escaped = rb_str_new(buf, dest - buf);
- preserve_original_state(str, escaped);
- }
- else {
- escaped = rb_str_dup(str);
- }
- ALLOCV_END(vbuf);
- return escaped;
-}
-
-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/depend b/ext/continuation/depend
deleted file mode 100644
index 08844aa6bb..0000000000
--- a/ext/continuation/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-continuation.o: $(RUBY_EXTCONF_H)
-continuation.o: $(arch_hdrdir)/ruby/config.h
-continuation.o: $(hdrdir)/ruby/assert.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 8503c9d6c6..e15357e734 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,286 +20,59 @@ 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 (RTEST(rb_hash_lookup(opt, ID2SYM(rb_intern("oneshot_lines"))))) {
- if (mode & COVERAGE_TARGET_LINES)
- rb_raise(rb_eRuntimeError, "cannot enable lines and oneshot_lines simultaneously");
- mode |= COVERAGE_TARGET_LINES;
- mode |= COVERAGE_TARGET_ONESHOT_LINES;
- }
- }
-
- if (mode & COVERAGE_TARGET_METHODS) {
- me2counter = rb_ident_hash_new();
- }
- 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");
- }
- 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));
+ if (!RTEST(rb_get_coverages())) {
+ if (rb_coverages == Qundef) {
+ rb_coverages = rb_hash_new();
+ rb_obj_hide(rb_coverages);
}
+ rb_set_coverages(rb_coverages);
}
-
- 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;
+ return Qnil;
}
+/* Make coverage arrays empty so old covered files are no longer tracked. */
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);
- const char *kw = (current_mode & COVERAGE_TARGET_ONESHOT_LINES) ? "oneshot_lines" : "lines";
- lines = rb_ary_dup(lines);
- rb_ary_freeze(lines);
- rb_hash_aset(h, ID2SYM(rb_intern(kw)), 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.
- * This is the same as `Coverage.result(stop: false, clear: false)`.
+ * 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);
+ rb_reset_coverages();
return ncoverages;
}
-
-static int
-clear_me2counter_i(VALUE key, VALUE value, VALUE unused)
-{
- rb_hash_aset(me2counter, key, INT2FIX(0));
- return ST_CONTINUE;
-}
-
-/*
- * call-seq:
- * Coverage.result(stop: true, clear: true) => hash
- *
- * Returns a hash that contains filename as key and coverage array as value.
- * If +clear+ is true, it clears the counters to zero.
- * If +stop+ is true, it disables coverage measurement.
- */
-static VALUE
-rb_coverage_result(int argc, VALUE *argv, VALUE klass)
-{
- VALUE ncoverages;
- VALUE opt;
- int stop = 1, clear = 1;
-
- rb_scan_args(argc, argv, "01", &opt);
-
- if (argc == 1) {
- opt = rb_convert_type(opt, T_HASH, "Hash", "to_hash");
- stop = RTEST(rb_hash_lookup(opt, ID2SYM(rb_intern("stop"))));
- clear = RTEST(rb_hash_lookup(opt, ID2SYM(rb_intern("clear"))));
- }
-
- ncoverages = rb_coverage_peek_result(klass);
- if (stop && !clear) {
- rb_warn("stop implies clear");
- clear = 1;
- }
- if (clear) {
- rb_clear_coverages();
- if (!NIL_P(me2counter)) rb_hash_foreach(me2counter, clear_me2counter_i, Qnil);
- }
- if (stop) {
- 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
@@ -324,7 +95,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]}
@@ -333,9 +104,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, "result", rb_coverage_result, -1);
- 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_define_module_function(rb_mCoverage, "start", rb_coverage_start, 0);
+ rb_define_module_function(rb_mCoverage, "result", rb_coverage_result, 0);
+ rb_gc_register_address(&rb_coverages);
}
diff --git a/ext/coverage/depend b/ext/coverage/depend
index 20b76be04c..04eaf10d0a 100644
--- a/ext/coverage/depend
+++ b/ext/coverage/depend
@@ -1,12 +1,24 @@
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(top_srcdir)/vm_core.h \
+ $(top_srcdir)/node.h \
+ $(top_srcdir)/vm_debug.h \
+ $(top_srcdir)/vm_opts.h \
+ {$(VPATH)}id.h \
+ $(top_srcdir)/method.h \
+ $(top_srcdir)/ruby_atomic.h \
+ $(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.h
-coverage.o: $(hdrdir)/ruby/assert.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/oniguruma.h
coverage.o: $(hdrdir)/ruby/ruby.h
coverage.o: $(hdrdir)/ruby/st.h
coverage.o: $(hdrdir)/ruby/subst.h
@@ -15,14 +27,14 @@ 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)/gc.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
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/coverage/lib/coverage.rb b/ext/coverage/lib/coverage.rb
deleted file mode 100644
index f1923ef366..0000000000
--- a/ext/coverage/lib/coverage.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "coverage.so"
-
-module Coverage
- def self.line_stub(file)
- lines = File.foreach(file).map { nil }
- iseqs = [RubyVM::InstructionSequence.compile_file(file)]
- until iseqs.empty?
- iseq = iseqs.pop
- iseq.trace_points.each {|n, type| lines[n - 1] = 0 if type == :line }
- iseq.each_child {|child| iseqs << child }
- end
- lines
- end
-end
diff --git a/ext/date/date.gemspec b/ext/date/date.gemspec
deleted file mode 100644
index bd323b7a06..0000000000
--- a/ext/date/date.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |s|
- s.name = "date"
- s.version = '3.0.0'
- 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"
-end
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index ccac90a32e..d005045178 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)
@@ -22,7 +21,6 @@
static ID id_cmp, id_le_p, id_ge_p, id_eqeq_p;
static VALUE cDate, cDateTime;
-static VALUE eDateError;
static VALUE half_days_in_day, day_in_nanoseconds;
static double positive_inf, negative_inf;
@@ -52,29 +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)
-static VALUE date_initialize(int argc, VALUE *argv, VALUE self);
-static VALUE datetime_initialize(int argc, VALUE *argv, VALUE self);
-
-#define RETURN_FALSE_UNLESS_NUMERIC(obj) if(!RTEST(rb_obj_is_kind_of((obj), rb_cNumeric))) return Qfalse
-inline static void
-check_numeric(VALUE obj, const char* field) {
- if(!RTEST(rb_obj_is_kind_of(obj, rb_cNumeric))) {
- rb_raise(rb_eTypeError, "invalid %s (not numeric)", field);
- }
-}
-
-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
@@ -106,7 +93,7 @@ f_ge_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
return f_boolcast(FIX2LONG(x) >= FIX2LONG(y));
- return rb_funcall(x, id_ge_p, 1, y);
+ return rb_funcall(x, rb_intern(">="), 1, y);
}
inline static VALUE
@@ -114,7 +101,7 @@ f_eqeq_p(VALUE x, VALUE y)
{
if (FIXNUM_P(x) && FIXNUM_P(y))
return f_boolcast(FIX2LONG(x) == FIX2LONG(y));
- return rb_funcall(x, id_eqeq_p, 1, y);
+ return rb_funcall(x, rb_intern("=="), 1, y);
}
inline static VALUE
@@ -248,8 +235,11 @@ f_negative_p(VALUE x)
struct SimpleDateData
{
unsigned flags;
- int jd; /* as utc */
VALUE nth; /* not always canonicalized */
+ int jd; /* as utc */
+ /* df is zero */
+ /* sf is zero */
+ /* of is zero */
date_sg_t sg; /* 2298874..2426355 or -/+oo -- at most 22 bits */
/* decoded as utc=local */
int year; /* truncated */
@@ -268,8 +258,11 @@ struct SimpleDateData
struct ComplexDateData
{
unsigned flags;
- int jd; /* as utc */
VALUE nth; /* not always canonicalized */
+ int jd; /* as utc */
+ int df; /* as utc, in secs */
+ VALUE sf; /* in nano secs */
+ int of; /* in secs */
date_sg_t sg; /* 2298874..2426355 or -/+oo -- at most 22 bits */
/* decoded as local */
int year; /* truncated */
@@ -283,9 +276,6 @@ struct ComplexDateData
/* packed civil */
unsigned pc;
#endif
- int df; /* as utc, in secs */
- int of; /* in secs */
- VALUE sf; /* in nano secs */
};
union DateData {
@@ -324,31 +314,31 @@ canon(VALUE x)
#ifndef USE_PACK
#define set_to_simple(obj, x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth)); \
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->mon = _mon;\
(x)->mday = _mday;\
- (x)->flags = (_flags) & ~COMPLEX_DAT;\
-} while (0)
+ (x)->flags = _flags;\
+}
#else
#define set_to_simple(obj, x, _nth, _jd ,_sg, _year, _mon, _mday, _flags) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth)); \
(x)->jd = _jd;\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->pc = PACK2(_mon, _mday);\
- (x)->flags = (_flags) & ~COMPLEX_DAT;\
-} while (0)
+ (x)->flags = _flags;\
+}
#endif
#ifndef USE_PACK
#define set_to_complex(obj, x, _nth, _jd ,_df, _sf, _of, _sg,\
_year, _mon, _mday, _hour, _min, _sec, _flags) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth));\
(x)->jd = _jd;\
(x)->df = _df;\
@@ -361,12 +351,12 @@ do {\
(x)->hour = _hour;\
(x)->min = _min;\
(x)->sec = _sec;\
- (x)->flags = (_flags) | COMPLEX_DAT;\
-} while (0)
+ (x)->flags = _flags;\
+}
#else
#define set_to_complex(obj, x, _nth, _jd ,_df, _sf, _of, _sg,\
_year, _mon, _mday, _hour, _min, _sec, _flags) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, canon(_nth));\
(x)->jd = _jd;\
(x)->df = _df;\
@@ -375,13 +365,13 @@ do {\
(x)->sg = (date_sg_t)(_sg);\
(x)->year = _year;\
(x)->pc = PACK5(_mon, _mday, _hour, _min, _sec);\
- (x)->flags = (_flags) | COMPLEX_DAT;\
-} while (0)
+ (x)->flags = _flags;\
+}
#endif
#ifndef USE_PACK
#define copy_simple_to_complex(obj, x, y) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->df = 0;\
@@ -395,10 +385,10 @@ do {\
(x)->min = 0;\
(x)->sec = 0;\
(x)->flags = (y)->flags;\
-} while (0)
+}
#else
#define copy_simple_to_complex(obj, x, y) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->df = 0;\
@@ -408,12 +398,12 @@ do {\
(x)->year = (y)->year;\
(x)->pc = PACK5(EX_MON((y)->pc), EX_MDAY((y)->pc), 0, 0, 0);\
(x)->flags = (y)->flags;\
-} while (0)
+}
#endif
#ifndef USE_PACK
#define copy_complex_to_simple(obj, x, y) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
@@ -421,17 +411,17 @@ do {\
(x)->mon = (y)->mon;\
(x)->mday = (y)->mday;\
(x)->flags = (y)->flags;\
-} while (0)
+}
#else
#define copy_complex_to_simple(obj, x, y) \
-do {\
+{\
RB_OBJ_WRITE((obj), &(x)->nth, (y)->nth);\
(x)->jd = (y)->jd;\
(x)->sg = (date_sg_t)((y)->sg);\
(x)->year = (y)->year;\
(x)->pc = PACK2(EX_MON((y)->pc), EX_MDAY((y)->pc));\
(x)->flags = (y)->flags;\
-} while (0)
+}
#endif
/* base */
@@ -1118,7 +1108,7 @@ m_virtual_sg(union DateData *x)
}
#define canonicalize_jd(_nth, _jd) \
-do {\
+{\
if (_jd < 0) {\
_nth = f_sub(_nth, INT2FIX(1));\
_jd += CM_PERIOD;\
@@ -1127,7 +1117,7 @@ do {\
_nth = f_add(_nth, INT2FIX(1));\
_jd -= CM_PERIOD;\
}\
-} while (0)
+}
inline static void
canonicalize_s_jd(VALUE obj, union DateData *x)
@@ -1369,8 +1359,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;
}
@@ -1937,13 +1929,13 @@ m_sec(union DateData *x)
}
#define decode_offset(of,s,h,m)\
-do {\
+{\
int a;\
s = (of < 0) ? '-' : '+';\
a = (of < 0) ? -of : of;\
h = a / HOUR_IN_SECONDS;\
m = a % HOUR_IN_SECONDS / MINUTE_IN_SECONDS;\
-} while (0)
+}
static VALUE
of2str(int of)
@@ -1986,13 +1978,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,
@@ -2342,9 +2327,6 @@ VALUE date_zone_to_diff(VALUE);
static int
offset_to_sec(VALUE vof, int *rof)
{
- int try_rational = 1;
-
- again:
switch (TYPE(vof)) {
case T_FIXNUM:
{
@@ -2369,13 +2351,13 @@ 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);
- if (!k_rational_p(vof)) {
- if (!try_rational) Check_Type(vof, T_RATIONAL);
- try_rational = 0;
- goto again;
- }
+#ifdef CANONICALIZATION_FOR_MATHN
+ if (!k_rational_p(vof))
+ return offset_to_sec(vof, rof);
+#endif
/* fall through */
case T_RATIONAL:
{
@@ -2384,10 +2366,17 @@ offset_to_sec(VALUE vof, int *rof)
vs = day_to_sec(vof);
+#ifdef CANONICALIZATION_FOR_MATHN
if (!k_rational_p(vs)) {
- vn = vs;
- goto rounded;
+ if (!FIXNUM_P(vs))
+ return 0;
+ n = FIX2LONG(vs);
+ if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS)
+ return 0;
+ *rof = (int)n;
+ return 1;
}
+#endif
vn = rb_rational_num(vs);
vd = rb_rational_den(vs);
@@ -2397,7 +2386,6 @@ offset_to_sec(VALUE vof, int *rof)
vn = f_round(vs);
if (!f_eqeq_p(vn, vs))
rb_warning("fraction of offset is ignored");
- rounded:
if (!FIXNUM_P(vn))
return 0;
n = FIX2LONG(vn);
@@ -2427,12 +2415,12 @@ offset_to_sec(VALUE vof, int *rof)
/* date */
#define valid_sg(sg) \
-do {\
+{\
if (!c_valid_start_p(sg)) {\
sg = 0;\
rb_warning("invalid start is ignored");\
}\
-} while (0)
+}
static VALUE
valid_jd_sub(int argc, VALUE *argv, VALUE klass, int need_jd)
@@ -2469,7 +2457,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)
@@ -2479,7 +2467,6 @@ date_s_valid_jd_p(int argc, VALUE *argv, VALUE klass)
rb_scan_args(argc, argv, "11", &vjd, &vsg);
- RETURN_FALSE_UNLESS_NUMERIC(vjd);
argv2[0] = vjd;
if (argc < 2)
argv2[1] = INT2FIX(DEFAULT_SG);
@@ -2555,14 +2542,11 @@ date_s__valid_civil_p(int argc, VALUE *argv, VALUE klass)
* Date.valid_date?(year, month, mday[, start=Date::ITALY]) -> bool
*
* Returns true if the given calendar date is valid, and false if not.
- * Valid in this context is whether the arguments passed to this
- * method would be accepted by ::new.
*
* Date.valid_date?(2001,2,3) #=> true
* Date.valid_date?(2001,2,29) #=> false
- * Date.valid_date?(2001,2,-1) #=> true
*
- * See also ::jd and ::civil.
+ * See also jd and civil.
*/
static VALUE
date_s_valid_civil_p(int argc, VALUE *argv, VALUE klass)
@@ -2572,9 +2556,6 @@ date_s_valid_civil_p(int argc, VALUE *argv, VALUE klass)
rb_scan_args(argc, argv, "31", &vy, &vm, &vd, &vsg);
- RETURN_FALSE_UNLESS_NUMERIC(vy);
- RETURN_FALSE_UNLESS_NUMERIC(vm);
- RETURN_FALSE_UNLESS_NUMERIC(vd);
argv2[0] = vy;
argv2[1] = vm;
argv2[2] = vd;
@@ -2646,7 +2627,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)
@@ -2656,8 +2637,6 @@ date_s_valid_ordinal_p(int argc, VALUE *argv, VALUE klass)
rb_scan_args(argc, argv, "21", &vy, &vd, &vsg);
- RETURN_FALSE_UNLESS_NUMERIC(vy);
- RETURN_FALSE_UNLESS_NUMERIC(vd);
argv2[0] = vy;
argv2[1] = vd;
if (argc < 3)
@@ -2730,7 +2709,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)
@@ -2740,9 +2719,6 @@ date_s_valid_commercial_p(int argc, VALUE *argv, VALUE klass)
rb_scan_args(argc, argv, "31", &vy, &vw, &vd, &vsg);
- RETURN_FALSE_UNLESS_NUMERIC(vy);
- RETURN_FALSE_UNLESS_NUMERIC(vw);
- RETURN_FALSE_UNLESS_NUMERIC(vd);
argv2[0] = vy;
argv2[1] = vw;
argv2[2] = vd;
@@ -2924,7 +2900,6 @@ date_s_julian_leap_p(VALUE klass, VALUE y)
VALUE nth;
int ry;
- check_numeric(y, "year");
decode_year(y, +1, &nth, &ry);
return f_boolcast(c_julian_leap_p(ry));
}
@@ -2946,7 +2921,6 @@ date_s_gregorian_leap_p(VALUE klass, VALUE y)
VALUE nth;
int ry;
- check_numeric(y, "year");
decode_year(y, -1, &nth, &ry);
return f_boolcast(c_gregorian_leap_p(ry));
}
@@ -2989,7 +2963,7 @@ d_simple_new_internal(VALUE klass,
obj = TypedData_Make_Struct(klass, struct SimpleDateData,
&d_lite_type, dat);
- set_to_simple(obj, dat, nth, jd, sg, y, m, d, flags);
+ set_to_simple(obj, dat, nth, jd, sg, y, m, d, flags & ~COMPLEX_DAT);
assert(have_jd_p(dat) || have_civil_p(dat));
@@ -3011,7 +2985,7 @@ d_complex_new_internal(VALUE klass,
obj = TypedData_Make_Struct(klass, struct ComplexDateData,
&d_lite_type, dat);
set_to_complex(obj, dat, nth, jd, df, sf, of, sg,
- y, m, d, h, min, s, flags);
+ y, m, d, h, min, s, flags | COMPLEX_DAT);
assert(have_jd_p(dat) || have_civil_p(dat));
assert(have_df_p(dat) || have_time_p(dat));
@@ -3070,7 +3044,7 @@ old_to_new(VALUE ajd, VALUE of, VALUE sg,
*rsg = NUM2DBL(sg);
if (*rdf < 0 || *rdf >= DAY_IN_SECONDS)
- rb_raise(eDateError, "invalid day fraction");
+ rb_raise(rb_eArgError, "invalid day fraction");
if (f_lt_p(*rsf, INT2FIX(0)) ||
f_ge_p(*rsf, INT2FIX(SECOND_IN_NANOSECONDS)))
@@ -3152,7 +3126,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);
}
@@ -3228,47 +3202,47 @@ s_trunc(VALUE s, VALUE *fr)
}
#define num2num_with_frac(s,n) \
-do {\
+{\
s = s##_trunc(v##s, &fr);\
if (f_nonzero_p(fr)) {\
if (argc > n)\
- rb_raise(eDateError, "invalid fraction");\
+ rb_raise(rb_eArgError, "invalid fraction");\
fr2 = fr;\
}\
-} while (0)
+}
#define num2int_with_frac(s,n) \
-do {\
+{\
s = NUM2INT(s##_trunc(v##s, &fr));\
if (f_nonzero_p(fr)) {\
if (argc > n)\
- rb_raise(eDateError, "invalid fraction");\
+ rb_raise(rb_eArgError, "invalid fraction");\
fr2 = fr;\
}\
-} while (0)
+}
#define canon24oc() \
-do {\
+{\
if (rh == 24) {\
rh = 0;\
fr2 = f_add(fr2, INT2FIX(1));\
}\
-} while (0)
+}
#define add_frac() \
-do {\
+{\
if (f_nonzero_p(fr2))\
ret = d_lite_plus(ret, fr2);\
-} while (0)
+}
#define val2sg(vsg,dsg) \
-do {\
+{\
dsg = NUM2DBL(vsg);\
if (!c_valid_start_p(dsg)) {\
dsg = DEFAULT_SG;\
rb_warning("invalid start is ignored");\
}\
-} while (0)
+}
static VALUE d_lite_plus(VALUE, VALUE);
@@ -3283,7 +3257,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)
@@ -3301,7 +3275,6 @@ date_s_jd(int argc, VALUE *argv, VALUE klass)
case 2:
val2sg(vsg, sg);
case 1:
- check_numeric(vjd, "jd");
num2num_with_frac(jd, positive_inf);
}
@@ -3334,7 +3307,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)
@@ -3354,10 +3327,8 @@ date_s_ordinal(int argc, VALUE *argv, VALUE klass)
case 3:
val2sg(vsg, sg);
case 2:
- check_numeric(vd, "yday");
num2int_with_frac(d, positive_inf);
case 1:
- check_numeric(vy, "year");
y = vy;
}
@@ -3369,7 +3340,7 @@ date_s_ordinal(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
ret = d_simple_new_internal(klass,
nth, rjd,
@@ -3404,25 +3375,14 @@ 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)
{
- return date_initialize(argc, argv, d_lite_s_alloc_simple(klass));
-}
-
-static VALUE
-date_initialize(int argc, VALUE *argv, VALUE self)
-{
VALUE vy, vm, vd, vsg, y, fr, fr2, ret;
int m, d;
double sg;
- struct SimpleDateData *dat = rb_check_typeddata(self, &d_lite_type);
-
- if (!simple_dat_p(dat)) {
- rb_raise(rb_eTypeError, "Date expected");
- }
rb_scan_args(argc, argv, "04", &vy, &vm, &vd, &vsg);
@@ -3436,13 +3396,10 @@ date_initialize(int argc, VALUE *argv, VALUE self)
case 4:
val2sg(vsg, sg);
case 3:
- check_numeric(vd, "day");
num2int_with_frac(d, positive_inf);
case 2:
- check_numeric(vm, "month");
m = NUM2INT(vm);
case 1:
- check_numeric(vy, "year");
y = vy;
}
@@ -3453,9 +3410,13 @@ date_initialize(int argc, VALUE *argv, VALUE self)
if (!valid_gregorian_p(y, m, d,
&nth, &ry,
&rm, &rd))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
- set_to_simple(self, dat, nth, 0, sg, ry, rm, rd, HAVE_CIVIL);
+ ret = d_simple_new_internal(klass,
+ nth, 0,
+ sg,
+ ry, rm, rd,
+ HAVE_CIVIL);
}
else {
VALUE nth;
@@ -3465,11 +3426,14 @@ date_initialize(int argc, VALUE *argv, VALUE self)
&nth, &ry,
&rm, &rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
- set_to_simple(self, dat, nth, rjd, sg, ry, rm, rd, HAVE_JD | HAVE_CIVIL);
+ ret = d_simple_new_internal(klass,
+ nth, rjd,
+ sg,
+ ry, rm, rd,
+ HAVE_JD | HAVE_CIVIL);
}
- ret = self;
add_frac();
return ret;
}
@@ -3488,7 +3452,7 @@ date_initialize(int argc, VALUE *argv, VALUE self)
* 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)
@@ -3509,13 +3473,10 @@ date_s_commercial(int argc, VALUE *argv, VALUE klass)
case 4:
val2sg(vsg, sg);
case 3:
- check_numeric(vd, "cwday");
num2int_with_frac(d, positive_inf);
case 2:
- check_numeric(vw, "cweek");
w = NUM2INT(vw);
case 1:
- check_numeric(vy, "year");
y = vy;
}
@@ -3527,7 +3488,7 @@ date_s_commercial(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rw, &rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
ret = d_simple_new_internal(klass,
nth, rjd,
@@ -3577,7 +3538,7 @@ date_s_weeknum(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rw, &rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
ret = d_simple_new_internal(klass,
nth, rjd,
@@ -3626,7 +3587,7 @@ date_s_nth_kday(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rm, &rn, &rk, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
ret = d_simple_new_internal(klass,
nth, rjd,
@@ -3665,9 +3626,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)
@@ -3713,18 +3674,16 @@ date_s_today(int argc, VALUE *argv, VALUE klass)
#define ref_hash0(k) rb_hash_aref(hash, k)
#define del_hash0(k) rb_hash_delete(hash, k)
-#define sym(x) ID2SYM(rb_intern(x""))
-
-#define set_hash(k,v) set_hash0(sym(k), v)
-#define ref_hash(k) ref_hash0(sym(k))
-#define del_hash(k) del_hash0(sym(k))
+#define set_hash(k,v) rb_hash_aset(hash, ID2SYM(rb_intern(k)), v)
+#define ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k)))
+#define del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k)))
static VALUE
rt_rewrite_frags(VALUE hash)
{
VALUE seconds;
- seconds = del_hash("seconds");
+ seconds = ref_hash("seconds");
if (!NIL_P(seconds)) {
VALUE offset, d, h, min, s, fr;
@@ -3749,10 +3708,13 @@ rt_rewrite_frags(VALUE hash)
set_hash("min", min);
set_hash("sec", s);
set_hash("sec_fraction", fr);
+ del_hash("seconds");
}
return hash;
}
+#define sym(x) ID2SYM(rb_intern(x))
+
static VALUE d_lite_year(VALUE);
static VALUE d_lite_wday(VALUE);
static VALUE d_lite_jd(VALUE);
@@ -3761,8 +3723,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)) {
@@ -3859,19 +3820,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;
@@ -3883,15 +3844,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))
@@ -3902,10 +3863,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;
@@ -3919,10 +3880,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;
@@ -3943,10 +3904,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;
@@ -3960,10 +3921,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;
@@ -4173,7 +4134,7 @@ d_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
}
if (NIL_P(hash))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (NIL_P(ref_hash("jd")) &&
NIL_P(ref_hash("yday")) &&
@@ -4190,7 +4151,7 @@ d_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
}
if (NIL_P(jd))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
{
VALUE nth;
int rjd;
@@ -4245,10 +4206,12 @@ date_s__strptime_internal(int argc, VALUE *argv, VALUE klass,
if (!NIL_P(zone)) {
rb_enc_copy(zone, vstr);
+ OBJ_INFECT(zone, vstr);
set_hash("zone", zone);
}
if (!NIL_P(left)) {
rb_enc_copy(left, vstr);
+ OBJ_INFECT(left, vstr);
set_hash("leftover", left);
}
}
@@ -4267,7 +4230,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)
@@ -4277,7 +4240,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
@@ -4291,7 +4254,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)
@@ -4336,6 +4299,16 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
hash = date__parse(vstr, vcomp);
+ {
+ VALUE zone = ref_hash("zone");
+
+ if (!NIL_P(zone)) {
+ rb_enc_copy(zone, vstr);
+ OBJ_INFECT(zone, vstr);
+ set_hash("zone", zone);
+ }
+ }
+
return hash;
}
@@ -4361,7 +4334,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.
@@ -4421,7 +4394,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.
@@ -4464,7 +4437,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.
@@ -4505,7 +4478,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.
@@ -4547,8 +4520,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.
@@ -4590,7 +4563,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.
@@ -4632,16 +4605,12 @@ 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.
*
* Date.jisx0301('H13.02.03') #=> #<Date: 2001-02-03 ...>
- *
- * For no-era year, legacy format, Heisei is assumed.
- *
- * Date.jisx0301('13.02.03') #=> #<Date: 2001-02-03 ...>
*/
static VALUE
date_s_jisx0301(int argc, VALUE *argv, VALUE klass)
@@ -4716,14 +4685,14 @@ dup_obj_as_complex(VALUE self)
}
#define val2off(vof,iof) \
-do {\
+{\
if (!offset_to_sec(vof, &iof)) {\
iof = 0;\
rb_warning("invalid offset is ignored");\
}\
-} while (0)
+}
-#if 0
+#ifndef NDEBUG
static VALUE
d_lite_initialize(int argc, VALUE *argv, VALUE self)
{
@@ -4732,6 +4701,7 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
double sg;
rb_check_frozen(self);
+ rb_check_trusted(self);
rb_scan_args(argc, argv, "05", &vjd, &vdf, &vsf, &vof, &vsg);
@@ -4750,11 +4720,11 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
sf = vsf;
if (f_lt_p(sf, INT2FIX(0)) ||
f_ge_p(sf, INT2FIX(SECOND_IN_NANOSECONDS)))
- rb_raise(eDateError, "invalid second fraction");
+ rb_raise(rb_eArgError, "invalid second fraction");
case 2:
df = NUM2INT(vdf);
if (df < 0 || df >= DAY_IN_SECONDS)
- rb_raise(eDateError, "invalid day fraction");
+ rb_raise(rb_eArgError, "invalid day fraction");
case 1:
jd = vjd;
}
@@ -4774,8 +4744,8 @@ d_lite_initialize(int argc, VALUE *argv, VALUE self)
rb_raise(rb_eArgError,
"cannot load complex into simple");
- set_to_complex(self, &dat->c, nth, rjd, df, sf, of, sg,
- 0, 0, 0, 0, 0, 0, HAVE_JD | HAVE_DF);
+ set_to_complex(&dat->c, nth, rjd, df, sf, of, sg,
+ 0, 0, 0, 0, 0, 0, HAVE_JD | HAVE_DF | COMPLEX_DAT);
}
}
return self;
@@ -4787,34 +4757,15 @@ static VALUE
d_lite_initialize_copy(VALUE copy, VALUE date)
{
rb_check_frozen(copy);
+ rb_check_trusted(copy);
if (copy == date)
return copy;
{
get_d2(copy, date);
if (simple_dat_p(bdat)) {
- if (simple_dat_p(adat)) {
- adat->s = bdat->s;
- }
- else {
- adat->c.flags = bdat->s.flags | COMPLEX_DAT;
- adat->c.nth = bdat->s.nth;
- adat->c.jd = bdat->s.jd;
- adat->c.df = 0;
- adat->c.sf = INT2FIX(0);
- adat->c.of = 0;
- adat->c.sg = bdat->s.sg;
- adat->c.year = bdat->s.year;
-#ifndef USE_PACK
- adat->c.mon = bdat->s.mon;
- adat->c.mday = bdat->s.mday;
- adat->c.hour = bdat->s.hour;
- adat->c.min = bdat->s.min;
- adat->c.sec = bdat->s.sec;
-#else
- adat->c.pc = bdat->s.pc;
-#endif
- }
+ adat->s = bdat->s;
+ adat->s.flags &= ~COMPLEX_DAT;
}
else {
if (!complex_dat_p(adat))
@@ -4822,6 +4773,7 @@ d_lite_initialize_copy(VALUE copy, VALUE date)
"cannot load complex into simple");
adat->c = bdat->c;
+ adat->c.flags |= COMPLEX_DAT;
}
}
return copy;
@@ -5296,7 +5248,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
@@ -5312,7 +5264,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
@@ -5422,7 +5374,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 ...>
@@ -5540,9 +5492,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)
@@ -5555,10 +5507,8 @@ d_lite_new_offset(int argc, VALUE *argv, VALUE self)
static VALUE
d_lite_plus(VALUE self, VALUE other)
{
- int try_rational = 1;
get_d1(self);
- again:
switch (TYPE(other)) {
case T_FIXNUM:
{
@@ -5766,23 +5716,21 @@ 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);
- if (!k_rational_p(other)) {
- if (!try_rational) Check_Type(other, T_RATIONAL);
- try_rational = 0;
- goto again;
- }
+#ifdef CANONICALIZATION_FOR_MATHN
+ if (!k_rational_p(other))
+ return d_lite_plus(self, other);
+#endif
/* fall through */
case T_RATIONAL:
{
VALUE nth, sf, t;
int jd, df, s;
- if (wholenum_p(other)) {
- other = rb_rational_num(other);
- goto again;
- }
+ if (wholenum_p(other))
+ return d_lite_plus(self, rb_rational_num(other));
if (f_positive_p(other))
s = +1;
@@ -5930,8 +5878,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)
@@ -5953,7 +5901,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:
@@ -6012,24 +5961,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 ...>
- *
- * 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 ...>
+ * Returns a date object pointing n months after self. The n should
+ * be a numeric value.
*
- * 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)
@@ -6064,7 +6001,7 @@ d_lite_rshift(VALUE self, VALUE other)
&rm, &rd, &rjd, &ns))
break;
if (--d < 1)
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
}
encode_jd(nth, rjd, &rjd2);
return d_lite_plus(self, f_sub(rjd2, m_real_local_jd(dat)));
@@ -6074,29 +6011,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.
+ * Returns a date object pointing n months before self. The 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 ...>
- *
- * 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));
}
@@ -6104,9 +6028,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)
@@ -6123,9 +6045,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)
@@ -6142,13 +6062,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)
@@ -6165,13 +6079,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)
@@ -6201,7 +6109,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);
@@ -6216,22 +6123,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;
}
@@ -6286,10 +6196,10 @@ 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 rb_num_coerce_cmp(self, other, id_cmp);
+ return f_cmp(m_ajd(dat), f_ajd(other));
+ return rb_num_coerce_cmp(self, other, rb_intern("<=>"));
}
static VALUE
@@ -6357,11 +6267,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.
*/
@@ -6418,7 +6328,7 @@ equal_gen(VALUE self, VALUE other)
return f_eqeq_p(m_real_local_jd(dat), other);
else if (k_date_p(other))
return f_eqeq_p(m_real_local_jd(dat), f_jd(other));
- return rb_num_coerce_cmp(self, other, id_eqeq_p);
+ return rb_num_coerce_cmp(self, other, rb_intern("=="));
}
/*
@@ -6489,7 +6399,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"
@@ -6501,8 +6411,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"
*/
@@ -6514,40 +6424,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[6];
-
- 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,
@@ -6558,7 +6482,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));
}
}
@@ -6566,18 +6490,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));
}
@@ -6588,15 +6517,20 @@ mk_inspect(union DateData *x, VALUE klass, VALUE to_s)
* Returns the value as a string for inspection.
*
* Date.new(2001,2,3).inspect
- * #=> "#<Date: 2001-02-03>"
+ * #=> "#<Date: 2001-02-03 ((2451944j,0s,0n),+0s,2299161j)>"
* DateTime.new(2001,2,3,4,5,6,'-7').inspect
- * #=> "#<DateTime: 2001-02-03T04:05:06-07:00>"
+ * #=> "#<DateTime: 2001-02-03T04:05:06-07:00 ((2451944j,39906s,0n),-25200s,2299161j)>"
*/
static VALUE
d_lite_inspect(VALUE self)
{
get_d1(self);
- return mk_inspect(dat, rb_obj_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>
@@ -6682,12 +6616,10 @@ tmx_m_of(union DateData *x)
static char *
tmx_m_zone(union DateData *x)
{
- VALUE zone = m_zone(x);
- /* TODO: fix potential dangling pointer */
- return RSTRING_PTR(zone);
+ 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,
@@ -6759,6 +6691,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
if (p > fmt) rb_str_cat(str, fmt, p - fmt);
}
rb_enc_copy(str, vfmt);
+ OBJ_INFECT(str, vfmt);
return str;
}
else
@@ -6767,6 +6700,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
str = rb_str_new(buf, len);
if (buf != buffer) xfree(buf);
rb_enc_copy(str, vfmt);
+ OBJ_INFECT(str, vfmt);
return str;
}
@@ -6774,32 +6708,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)
@@ -6832,7 +6766,7 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
*
* %M - Minute of the hour (00..59)
*
- * %S - Second of the minute (00..60)
+ * %S - Second of the minute (00..59)
*
* %L - Millisecond of the second (000..999)
* %N - Fractional seconds digits, default is 9 digits (nanosecond)
@@ -6847,7 +6781,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'')
@@ -6892,24 +6826,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
@@ -6945,7 +6878,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)
@@ -6965,7 +6898,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;
@@ -7039,44 +6971,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 if (d < 2458605) {
- c = 'H';
- s = 1988;
- }
- else {
- c = 'R';
- s = 2018;
- }
- 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));
+ }
+ 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 "%Y-%m-%d";
+ return rb_f_sprintf(2, a);
}
/*
@@ -7090,14 +7008,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
@@ -7150,13 +7066,10 @@ d_lite_marshal_dump(VALUE self)
static VALUE
d_lite_marshal_load(VALUE self, VALUE a)
{
- VALUE nth, sf;
- int jd, df, of;
- double sg;
-
get_d1(self);
rb_check_frozen(self);
+ rb_check_trusted(self);
if (!RB_TYPE_P(a, T_ARRAY))
rb_raise(rb_eTypeError, "expected an array");
@@ -7165,33 +7078,63 @@ d_lite_marshal_load(VALUE self, VALUE a)
case 2: /* 1.6.x */
case 3: /* 1.8.x, 1.9.2 */
{
- VALUE ajd, vof, vsg;
+ VALUE ajd, of, sg, nth, sf;
+ int jd, df, rof;
+ double rsg;
+
if (RARRAY_LEN(a) == 2) {
- ajd = f_sub(RARRAY_AREF(a, 0), half_days_in_day);
- vof = INT2FIX(0);
- vsg = RARRAY_AREF(a, 1);
- if (!k_numeric_p(vsg))
- vsg = DBL2NUM(RTEST(vsg) ? GREGORIAN : JULIAN);
+ ajd = f_sub(RARRAY_PTR(a)[0], half_days_in_day);
+ of = INT2FIX(0);
+ sg = RARRAY_PTR(a)[1];
+ if (!k_numeric_p(sg))
+ sg = DBL2NUM(RTEST(sg) ? GREGORIAN : JULIAN);
}
else {
- ajd = RARRAY_AREF(a, 0);
- vof = RARRAY_AREF(a, 1);
- vsg = RARRAY_AREF(a, 2);
+ ajd = RARRAY_PTR(a)[0];
+ of = RARRAY_PTR(a)[1];
+ sg = RARRAY_PTR(a)[2];
}
- old_to_new(ajd, vof, vsg,
- &nth, &jd, &df, &sf, &of, &sg);
+ 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);
+ } 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,
+ 0, 0, 0, 0, 0, 0,
+ HAVE_JD | HAVE_DF | COMPLEX_DAT);
+ }
}
break;
case 6:
{
- 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));
+ VALUE nth, sf;
+ int jd, df, of;
+ double sg;
+
+ nth = RARRAY_PTR(a)[0];
+ jd = NUM2INT(RARRAY_PTR(a)[1]);
+ df = NUM2INT(RARRAY_PTR(a)[2]);
+ sf = RARRAY_PTR(a)[3];
+ of = NUM2INT(RARRAY_PTR(a)[4]);
+ sg = NUM2DBL(RARRAY_PTR(a)[5]);
+ if (!df && f_zero_p(sf) && !of) {
+ set_to_simple(self, &dat->s, nth, jd, sg, 0, 0, 0, HAVE_JD);
+ } else {
+ if (!complex_dat_p(dat))
+ rb_raise(rb_eArgError,
+ "cannot load complex into simple");
+
+ set_to_complex(self, &dat->c, nth, jd, df, sf, of, sg,
+ 0, 0, 0, 0, 0, 0,
+ HAVE_JD | HAVE_DF | COMPLEX_DAT);
+ }
}
break;
default:
@@ -7199,18 +7142,6 @@ d_lite_marshal_load(VALUE self, VALUE a)
break;
}
- if (simple_dat_p(dat)) {
- if (df || !f_zero_p(sf) || of) {
- rb_raise(rb_eArgError,
- "cannot load complex into simple");
- }
- set_to_simple(self, &dat->s, nth, jd, sg, 0, 0, 0, HAVE_JD);
- } else {
- set_to_complex(self, &dat->c, nth, jd, df, sf, of, sg,
- 0, 0, 0, 0, 0, 0,
- HAVE_JD | HAVE_DF);
- }
-
if (FL_TEST(a, FL_EXIVAR)) {
rb_copy_generic_ivar(self, a);
FL_SET(self, FL_EXIVAR);
@@ -7236,7 +7167,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 ...>
@@ -7266,16 +7197,12 @@ datetime_s_jd(int argc, VALUE *argv, VALUE klass)
case 5:
val2off(vof, rof);
case 4:
- check_numeric(vs, "second");
num2int_with_frac(s, positive_inf);
case 3:
- check_numeric(vmin, "minute");
num2int_with_frac(min, 3);
case 2:
- check_numeric(vh, "hour");
num2int_with_frac(h, 2);
case 1:
- check_numeric(vjd, "jd");
num2num_with_frac(jd, 1);
}
@@ -7284,7 +7211,7 @@ datetime_s_jd(int argc, VALUE *argv, VALUE klass)
int rh, rmin, rs, rjd, rjd2;
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
decode_jd(jd, &nth, &rjd);
@@ -7308,7 +7235,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')
@@ -7339,19 +7266,14 @@ datetime_s_ordinal(int argc, VALUE *argv, VALUE klass)
case 6:
val2off(vof, rof);
case 5:
- check_numeric(vs, "second");
num2int_with_frac(s, positive_inf);
case 4:
- check_numeric(vmin, "minute");
num2int_with_frac(min, 4);
case 3:
- check_numeric(vh, "hour");
num2int_with_frac(h, 3);
case 2:
- check_numeric(vd, "yday");
num2int_with_frac(d, 2);
case 1:
- check_numeric(vy, "year");
y = vy;
}
@@ -7363,9 +7285,9 @@ datetime_s_ordinal(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
rjd2 = jd_local_to_utc(rjd,
@@ -7389,7 +7311,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')
@@ -7400,20 +7322,9 @@ datetime_s_ordinal(int argc, VALUE *argv, VALUE klass)
static VALUE
datetime_s_civil(int argc, VALUE *argv, VALUE klass)
{
- return datetime_initialize(argc, argv, d_lite_s_alloc_complex(klass));
-}
-
-static VALUE
-datetime_initialize(int argc, VALUE *argv, VALUE self)
-{
VALUE vy, vm, vd, vh, vmin, vs, vof, vsg, y, fr, fr2, ret;
int m, d, h, min, s, rof;
double sg;
- struct ComplexDateData *dat = rb_check_typeddata(self, &d_lite_type);
-
- if (!complex_dat_p(dat)) {
- rb_raise(rb_eTypeError, "DateTime expected");
- }
rb_scan_args(argc, argv, "08", &vy, &vm, &vd, &vh, &vmin, &vs, &vof, &vsg);
@@ -7432,22 +7343,16 @@ datetime_initialize(int argc, VALUE *argv, VALUE self)
case 7:
val2off(vof, rof);
case 6:
- check_numeric(vs, "second");
num2int_with_frac(s, positive_inf);
case 5:
- check_numeric(vmin, "minute");
num2int_with_frac(min, 5);
case 4:
- check_numeric(vh, "hour");
num2int_with_frac(h, 4);
case 3:
- check_numeric(vd, "day");
num2int_with_frac(d, 3);
case 2:
- check_numeric(vm, "month");
m = NUM2INT(vm);
case 1:
- check_numeric(vy, "year");
y = vy;
}
@@ -7458,18 +7363,18 @@ datetime_initialize(int argc, VALUE *argv, VALUE self)
if (!valid_gregorian_p(y, m, d,
&nth, &ry,
&rm, &rd))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
- set_to_complex(self, dat,
- nth, 0,
- 0, INT2FIX(0),
- rof, sg,
- ry, rm, rd,
- rh, rmin, rs,
- HAVE_CIVIL | HAVE_TIME);
+ ret = d_complex_new_internal(klass,
+ nth, 0,
+ 0, INT2FIX(0),
+ rof, sg,
+ ry, rm, rd,
+ rh, rmin, rs,
+ HAVE_CIVIL | HAVE_TIME);
}
else {
VALUE nth;
@@ -7479,24 +7384,23 @@ datetime_initialize(int argc, VALUE *argv, VALUE self)
&nth, &ry,
&rm, &rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
rjd2 = jd_local_to_utc(rjd,
time_to_df(rh, rmin, rs),
rof);
- set_to_complex(self, dat,
- nth, rjd2,
- 0, INT2FIX(0),
- rof, sg,
- ry, rm, rd,
- rh, rmin, rs,
- HAVE_JD | HAVE_CIVIL | HAVE_TIME);
+ ret = d_complex_new_internal(klass,
+ nth, rjd2,
+ 0, INT2FIX(0),
+ rof, sg,
+ ry, rm, rd,
+ rh, rmin, rs,
+ HAVE_JD | HAVE_CIVIL | HAVE_TIME);
}
- ret = self;
add_frac();
return ret;
}
@@ -7505,7 +7409,7 @@ datetime_initialize(int argc, VALUE *argv, VALUE self)
* 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 ...>
@@ -7536,22 +7440,16 @@ datetime_s_commercial(int argc, VALUE *argv, VALUE klass)
case 7:
val2off(vof, rof);
case 6:
- check_numeric(vs, "second");
num2int_with_frac(s, positive_inf);
case 5:
- check_numeric(vmin, "minute");
num2int_with_frac(min, 5);
case 4:
- check_numeric(vh, "hour");
num2int_with_frac(h, 4);
case 3:
- check_numeric(vd, "cwday");
num2int_with_frac(d, 3);
case 2:
- check_numeric(vw, "cweek");
w = NUM2INT(vw);
case 1:
- check_numeric(vy, "year");
y = vy;
}
@@ -7563,9 +7461,9 @@ datetime_s_commercial(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rw, &rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
rjd2 = jd_local_to_utc(rjd,
@@ -7634,9 +7532,9 @@ datetime_s_weeknum(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rw, &rd, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
rjd2 = jd_local_to_utc(rjd,
@@ -7703,9 +7601,9 @@ datetime_s_nth_kday(int argc, VALUE *argv, VALUE klass)
&nth, &ry,
&rm, &rn, &rk, &rjd,
&ns))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (!c_valid_time_p(h, min, s, &rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
canon24oc();
rjd2 = jd_local_to_utc(rjd,
@@ -7728,7 +7626,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 ...>
*/
@@ -7777,8 +7675,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;
@@ -7848,7 +7746,7 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
}
if (NIL_P(hash))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
if (NIL_P(ref_hash("jd")) &&
NIL_P(ref_hash("yday")) &&
@@ -7875,7 +7773,7 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
}
if (NIL_P(jd))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
{
int rh, rmin, rs;
@@ -7884,7 +7782,7 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
NUM2INT(ref_hash("min")),
NUM2INT(ref_hash("sec")),
&rh, &rmin, &rs))
- rb_raise(eDateError, "invalid date");
+ rb_raise(rb_eArgError, "invalid date");
df = time_to_df(rh, rmin, rs);
}
@@ -7931,7 +7829,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)
@@ -7941,10 +7839,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')
@@ -7964,7 +7862,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)
@@ -7994,10 +7892,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.
@@ -8037,9 +7935,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')
@@ -8071,9 +7969,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')
@@ -8101,9 +7999,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')
@@ -8131,10 +8029,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')
@@ -8162,9 +8060,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')
@@ -8192,18 +8090,13 @@ 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')
* #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
- *
- * For no-era year, legacy format, Heisei is assumed.
- *
- * DateTime.jisx0301('13.02.03T04:05:06+07:00')
- * #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
*/
static VALUE
datetime_s_jisx0301(int argc, VALUE *argv, VALUE klass)
@@ -8229,8 +8122,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"
@@ -8245,20 +8138,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.
@@ -8266,12 +8159,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)
@@ -8304,7 +8197,7 @@ dt_lite_to_s(VALUE self)
*
* %M - Minute of the hour (00..59)
*
- * %S - Second of the minute (00..60)
+ * %S - Second of the minute (00..59)
*
* %L - Millisecond of the second (000..999)
* %N - Fractional seconds digits, default is 9 digits (nanosecond)
@@ -8319,7 +8212,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'')
@@ -8364,24 +8257,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
@@ -8417,7 +8309,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)
@@ -8427,19 +8319,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;
- 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);
+ 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);
+
+ 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);
}
/*
@@ -8447,8 +8346,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"
@@ -8456,22 +8355,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"
@@ -8486,8 +8386,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"
@@ -8495,32 +8395,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);
- return rb_str_append(d_lite_jisx0301(self),
- iso8601_timediv(self, n));
+ if (argc < 1)
+ n = INT2FIX(0);
+
+ {
+ 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);
}
/*
@@ -8598,31 +8507,24 @@ time_to_datetime(VALUE self)
* call-seq:
* d.to_time -> time
*
- * Returns a Time object which denotes self. If self is a julian date,
- * convert it to a gregorian date before converting it to Time.
+ * Returns a Time object which denotes self.
*/
static VALUE
date_to_time(VALUE self)
{
- get_d1a(self);
-
- if (m_julian_p(adat)) {
- VALUE tmp = d_lite_gregorian(self);
- get_d1b(tmp);
- adat = bdat;
- }
+ get_d1(self);
return f_local3(rb_cTime,
- m_real_year(adat),
- INT2FIX(m_mon(adat)),
- INT2FIX(m_mday(adat)));
+ m_real_year(dat),
+ INT2FIX(m_mon(dat)),
+ INT2FIX(m_mday(dat)));
}
/*
* call-seq:
* d.to_date -> self
*
- * Returns self.
+ * Returns self;
*/
static VALUE
date_to_date(VALUE self)
@@ -8679,24 +8581,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);
}
}
@@ -8724,7 +8623,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(new, &bdat->s, &adat->c)
bdat->s.jd = m_local_jd(adat);
bdat->s.flags &= ~(HAVE_DF | HAVE_TIME | COMPLEX_DAT);
return new;
@@ -9089,18 +8988,14 @@ mk_ary_of_str(long len, const char *a[])
return o;
}
-static VALUE
-d_lite_zero(VALUE x)
-{
- return INT2FIX(0);
-}
-
void
Init_date_core(void)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+ assert(fprintf(stderr, "assert() is now active\n"));
+
id_cmp = rb_intern("<=>");
id_le_p = rb_intern("<=");
id_ge_p = rb_intern(">=");
@@ -9128,13 +9023,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
@@ -9142,14 +9037,14 @@ 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.
*
@@ -9159,15 +9054,15 @@ Init_date_core(void)
* 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
+ * 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.
*
@@ -9177,14 +9072,14 @@ 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
* time.
@@ -9193,16 +9088,16 @@ Init_date_core(void)
* 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 that includes Comparable module and 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'
*
@@ -9223,7 +9118,7 @@ Init_date_core(void)
*
* 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
@@ -9238,11 +9133,10 @@ Init_date_core(void)
* 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
@@ -9259,7 +9153,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 ...>
@@ -9272,7 +9166,6 @@ Init_date_core(void)
*
*/
cDate = rb_define_class("Date", rb_cObject);
- eDateError = rb_define_class_under(cDate, "Error", rb_eArgError);
rb_include_module(cDate, rb_mComparable);
@@ -9308,31 +9201,32 @@ 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));
- rb_define_alloc_func(cDate, d_lite_s_alloc_simple);
+ rb_define_alloc_func(cDate, d_lite_s_alloc);
#ifndef NDEBUG
- rb_define_private_method(CLASS_OF(cDate), "_valid_jd?",
+#define de_define_private_method rb_define_private_method
+ de_define_private_method(CLASS_OF(cDate), "_valid_jd?",
date_s__valid_jd_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "_valid_ordinal?",
+ de_define_private_method(CLASS_OF(cDate), "_valid_ordinal?",
date_s__valid_ordinal_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "_valid_civil?",
+ de_define_private_method(CLASS_OF(cDate), "_valid_civil?",
date_s__valid_civil_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "_valid_date?",
+ de_define_private_method(CLASS_OF(cDate), "_valid_date?",
date_s__valid_civil_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "_valid_commercial?",
+ de_define_private_method(CLASS_OF(cDate), "_valid_commercial?",
date_s__valid_commercial_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "_valid_weeknum?",
+ de_define_private_method(CLASS_OF(cDate), "_valid_weeknum?",
date_s__valid_weeknum_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "_valid_nth_kday?",
+ de_define_private_method(CLASS_OF(cDate), "_valid_nth_kday?",
date_s__valid_nth_kday_p, -1);
#endif
@@ -9345,11 +9239,11 @@ Init_date_core(void)
date_s_valid_commercial_p, -1);
#ifndef NDEBUG
- rb_define_private_method(CLASS_OF(cDate), "valid_weeknum?",
+ de_define_private_method(CLASS_OF(cDate), "valid_weeknum?",
date_s_valid_weeknum_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "valid_nth_kday?",
+ de_define_private_method(CLASS_OF(cDate), "valid_nth_kday?",
date_s_valid_nth_kday_p, -1);
- rb_define_private_method(CLASS_OF(cDate), "zone_to_diff",
+ de_define_private_method(CLASS_OF(cDate), "zone_to_diff",
date_s_zone_to_diff, 1);
#endif
@@ -9360,18 +9254,21 @@ Init_date_core(void)
date_s_gregorian_leap_p, 1);
#ifndef NDEBUG
- rb_define_singleton_method(cDate, "new!", date_s_new_bang, -1);
- rb_define_alias(rb_singleton_class(cDate), "new_l!", "new");
+#define de_define_singleton_method rb_define_singleton_method
+#define de_define_alias rb_define_alias
+ de_define_singleton_method(cDate, "new!", date_s_new_bang, -1);
+ de_define_alias(rb_singleton_class(cDate), "new_l!", "new");
#endif
rb_define_singleton_method(cDate, "jd", date_s_jd, -1);
rb_define_singleton_method(cDate, "ordinal", date_s_ordinal, -1);
rb_define_singleton_method(cDate, "civil", date_s_civil, -1);
+ rb_define_singleton_method(cDate, "new", date_s_civil, -1);
rb_define_singleton_method(cDate, "commercial", date_s_commercial, -1);
#ifndef NDEBUG
- rb_define_singleton_method(cDate, "weeknum", date_s_weeknum, -1);
- rb_define_singleton_method(cDate, "nth_kday", date_s_nth_kday, -1);
+ de_define_singleton_method(cDate, "weeknum", date_s_weeknum, -1);
+ de_define_singleton_method(cDate, "nth_kday", date_s_nth_kday, -1);
#endif
rb_define_singleton_method(cDate, "today", date_s_today, -1);
@@ -9394,11 +9291,14 @@ Init_date_core(void)
rb_define_singleton_method(cDate, "_jisx0301", date_s__jisx0301, 1);
rb_define_singleton_method(cDate, "jisx0301", date_s_jisx0301, -1);
- rb_define_method(cDate, "initialize", date_initialize, -1);
+#ifndef NDEBUG
+#define de_define_method rb_define_method
+ de_define_method(cDate, "initialize", d_lite_initialize, -1);
+#endif
rb_define_method(cDate, "initialize_copy", d_lite_initialize_copy, 1);
#ifndef NDEBUG
- rb_define_method(cDate, "fill", d_lite_fill, 0);
+ de_define_method(cDate, "fill", d_lite_fill, 0);
#endif
rb_define_method(cDate, "ajd", d_lite_ajd, 0);
@@ -9420,8 +9320,8 @@ Init_date_core(void)
rb_define_method(cDate, "cwday", d_lite_cwday, 0);
#ifndef NDEBUG
- rb_define_private_method(cDate, "wnum0", d_lite_wnum0, 0);
- rb_define_private_method(cDate, "wnum1", d_lite_wnum1, 0);
+ de_define_private_method(cDate, "wnum0", d_lite_wnum0, 0);
+ de_define_private_method(cDate, "wnum1", d_lite_wnum1, 0);
#endif
rb_define_method(cDate, "wday", d_lite_wday, 0);
@@ -9435,14 +9335,18 @@ Init_date_core(void)
rb_define_method(cDate, "saturday?", d_lite_saturday_p, 0);
#ifndef NDEBUG
- rb_define_method(cDate, "nth_kday?", d_lite_nth_kday_p, 2);
+ de_define_method(cDate, "nth_kday?", d_lite_nth_kday_p, 2);
#endif
- rb_define_private_method(cDate, "hour", d_lite_zero, 0);
- rb_define_private_method(cDate, "min", d_lite_zero, 0);
- rb_define_private_method(cDate, "minute", d_lite_zero, 0);
- rb_define_private_method(cDate, "sec", d_lite_zero, 0);
- rb_define_private_method(cDate, "second", d_lite_zero, 0);
+ rb_define_private_method(cDate, "hour", d_lite_hour, 0);
+ rb_define_private_method(cDate, "min", d_lite_min, 0);
+ rb_define_private_method(cDate, "minute", d_lite_min, 0);
+ rb_define_private_method(cDate, "sec", d_lite_sec, 0);
+ rb_define_private_method(cDate, "second", d_lite_sec, 0);
+ rb_define_private_method(cDate, "sec_fraction", d_lite_sec_fraction, 0);
+ rb_define_private_method(cDate, "second_fraction", d_lite_sec_fraction, 0);
+ rb_define_private_method(cDate, "offset", d_lite_offset, 0);
+ rb_define_private_method(cDate, "zone", d_lite_zone, 0);
rb_define_method(cDate, "julian?", d_lite_julian_p, 0);
rb_define_method(cDate, "gregorian?", d_lite_gregorian_p, 0);
@@ -9455,6 +9359,8 @@ Init_date_core(void)
rb_define_method(cDate, "julian", d_lite_julian, 0);
rb_define_method(cDate, "gregorian", d_lite_gregorian, 0);
+ rb_define_private_method(cDate, "new_offset", d_lite_new_offset, -1);
+
rb_define_method(cDate, "+", d_lite_plus, 1);
rb_define_method(cDate, "-", d_lite_minus, 1);
@@ -9482,7 +9388,7 @@ Init_date_core(void)
rb_define_method(cDate, "to_s", d_lite_to_s, 0);
#ifndef NDEBUG
- rb_define_method(cDate, "inspect_raw", d_lite_inspect_raw, 0);
+ de_define_method(cDate, "inspect_raw", d_lite_inspect_raw, 0);
#endif
rb_define_method(cDate, "inspect", d_lite_inspect, 0);
@@ -9499,7 +9405,7 @@ Init_date_core(void)
rb_define_method(cDate, "jisx0301", d_lite_jisx0301, 0);
#ifndef NDEBUG
- rb_define_method(cDate, "marshal_dump_old", d_lite_marshal_dump_old, 0);
+ de_define_method(cDate, "marshal_dump_old", d_lite_marshal_dump_old, 0);
#endif
rb_define_method(cDate, "marshal_dump", d_lite_marshal_dump, 0);
rb_define_method(cDate, "marshal_load", d_lite_marshal_load, 1);
@@ -9508,49 +9414,48 @@ Init_date_core(void)
/*
* == DateTime
*
- * A subclass of Date that easily handles date, hour, minute, second,
- * and offset.
+ * 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 object is created with DateTime::new, DateTime::jd,
* DateTime::ordinal, DateTime::commercial, DateTime::parse,
- * DateTime::strptime, DateTime::now, Time#to_datetime, etc.
+ * DateTime::strptime, DateTime::now, Time#to_datetime or etc.
*
* require 'date'
*
* DateTime.new(2001,2,3,4,5,6)
* #=> #<DateTime: 2001-02-03T04:05:06+00:00 ...>
*
- * The last element of day, hour, minute, or second can be a
+ * The last element of day, hour, minute or second can be
* fractional number. The fractional number's precision is assumed
* at most nanosecond.
*
* DateTime.new(2001,2,3.5)
* #=> #<DateTime: 2001-02-03T12:00:00+00:00 ...>
*
- * An optional argument, the offset, indicates the difference
+ * 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).
+ * 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:
+ * 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
+ * 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).
+ * -/+oo. The default value is +Date::ITALY+ (2299161=1582-10-15).
*
- * A DateTime object has various methods. See each reference.
+ * 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 ...>
@@ -9577,22 +9482,22 @@ Init_date_core(void)
* 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
+ * However because England hadn't yet adopted
* {Gregorian Calendar Reform}[http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform]
* (and wouldn't until {1752}[http://en.wikipedia.org/wiki/Calendar_(New_Style)_Act_1750])
* their deaths are actually 10 days apart.
* Since Ruby's Time class implements a
* {proleptic Gregorian calendar}[http://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar]
- * and has no concept of calendar reform there's no way
- * to express this with Time objects. This is where DateTime steps in:
+ * and has no concept of calendar reform then there's no way
+ * to express this. This is where DateTime steps in:
*
* shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
* #=> Tue, 23 Apr 1616 00:00:00 +0000
* cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
* #=> Sat, 23 Apr 1616 00:00:00 +0000
*
- * Already you can see something is weird - the days of the week
- * are different. Taking this further:
+ * Already you can see something's weird - the days of the week
+ * are different, taking this further:
*
* cervantes == shakespeare
* #=> false
@@ -9646,7 +9551,6 @@ Init_date_core(void)
*/
cDateTime = rb_define_class("DateTime", cDate);
- rb_define_alloc_func(cDateTime, d_lite_s_alloc_complex);
rb_define_singleton_method(cDateTime, "jd", datetime_s_jd, -1);
rb_define_singleton_method(cDateTime, "ordinal", datetime_s_ordinal, -1);
@@ -9656,9 +9560,9 @@ Init_date_core(void)
datetime_s_commercial, -1);
#ifndef NDEBUG
- rb_define_singleton_method(cDateTime, "weeknum",
+ de_define_singleton_method(cDateTime, "weeknum",
datetime_s_weeknum, -1);
- rb_define_singleton_method(cDateTime, "nth_kday",
+ de_define_singleton_method(cDateTime, "nth_kday",
datetime_s_nth_kday, -1);
#endif
@@ -9686,16 +9590,19 @@ Init_date_core(void)
rb_define_singleton_method(cDateTime, "jisx0301",
datetime_s_jisx0301, -1);
- rb_define_method(cDateTime, "hour", d_lite_hour, 0);
- rb_define_method(cDateTime, "min", d_lite_min, 0);
- rb_define_method(cDateTime, "minute", d_lite_min, 0);
- rb_define_method(cDateTime, "sec", d_lite_sec, 0);
- rb_define_method(cDateTime, "second", d_lite_sec, 0);
- rb_define_method(cDateTime, "sec_fraction", d_lite_sec_fraction, 0);
- rb_define_method(cDateTime, "second_fraction", d_lite_sec_fraction, 0);
- rb_define_method(cDateTime, "offset", d_lite_offset, 0);
- rb_define_method(cDateTime, "zone", d_lite_zone, 0);
- rb_define_method(cDateTime, "new_offset", d_lite_new_offset, -1);
+#define f_public(m,s) rb_funcall(m, rb_intern("public"), 1,\
+ ID2SYM(rb_intern(s)))
+
+ f_public(cDateTime, "hour");
+ f_public(cDateTime, "min");
+ f_public(cDateTime, "minute");
+ f_public(cDateTime, "sec");
+ f_public(cDateTime, "second");
+ f_public(cDateTime, "sec_fraction");
+ f_public(cDateTime, "second_fraction");
+ f_public(cDateTime, "offset");
+ f_public(cDateTime, "zone");
+ f_public(cDateTime, "new_offset");
rb_define_method(cDateTime, "to_s", dt_lite_to_s, 0);
@@ -9723,15 +9630,15 @@ Init_date_core(void)
#ifndef NDEBUG
/* tests */
- rb_define_singleton_method(cDate, "test_civil", date_s_test_civil, 0);
- rb_define_singleton_method(cDate, "test_ordinal", date_s_test_ordinal, 0);
- rb_define_singleton_method(cDate, "test_commercial",
+ de_define_singleton_method(cDate, "test_civil", date_s_test_civil, 0);
+ de_define_singleton_method(cDate, "test_ordinal", date_s_test_ordinal, 0);
+ de_define_singleton_method(cDate, "test_commercial",
date_s_test_commercial, 0);
- rb_define_singleton_method(cDate, "test_weeknum", date_s_test_weeknum, 0);
- rb_define_singleton_method(cDate, "test_nth_kday", date_s_test_nth_kday, 0);
- rb_define_singleton_method(cDate, "test_unit_conv",
+ de_define_singleton_method(cDate, "test_weeknum", date_s_test_weeknum, 0);
+ de_define_singleton_method(cDate, "test_nth_kday", date_s_test_nth_kday, 0);
+ de_define_singleton_method(cDate, "test_unit_conv",
date_s_test_unit_conv, 0);
- rb_define_singleton_method(cDate, "test_all", date_s_test_all, 0);
+ de_define_singleton_method(cDate, "test_all", date_s_test_all, 0);
#endif
}
diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c
index 519f29cbcb..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])
@@ -40,19 +37,19 @@ RUBY_EXTERN unsigned long ruby_scan_digits(const char *str, ssize_t len, int bas
#define f_sub_bang(s,r,x) rb_funcall(s, rb_intern("sub!"), 2, r, x)
#define f_gsub_bang(s,r,x) rb_funcall(s, rb_intern("gsub!"), 2, r, x)
-#define set_hash(k,v) rb_hash_aset(hash, ID2SYM(rb_intern(k"")), v)
-#define ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k"")))
-#define del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k"")))
+#define set_hash(k,v) rb_hash_aset(hash, ID2SYM(rb_intern(k)), v)
+#define ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k)))
+#define del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k)))
#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"
};
@@ -66,18 +63,11 @@ static const char abbr_months[][4] = {
#define asubt_string() rb_str_new("\024", 1)
#endif
-static size_t
-digit_span(const char *s, const char *e)
-{
- size_t i = 0;
- while (s + i < e && isdigit(s[i])) i++;
- return i;
-}
+#define DECDIGIT "0123456789"
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))
@@ -98,7 +88,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
y = d;
d = Qnil;
}
- if (!NIL_P(d) && RSTRING_LEN(d) > 0 && *RSTRING_PTR(d) == '\'') {
+ if (!NIL_P(d) && *RSTRING_PTR(d) == '\'') {
y = d;
d = Qnil;
}
@@ -109,20 +99,17 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
size_t l;
s = RSTRING_PTR(y);
- ep = RSTRING_END(y);
- while (s < ep && !issign(*s) && !isdigit(*s))
+ while (!issign((unsigned char)*s) && !isdigit((unsigned char)*s))
s++;
- if (s >= ep) goto no_date;
bp = s;
if (issign((unsigned char)*s))
s++;
- l = digit_span(s, ep);
+ l = strspn(s, DECDIGIT);
ep = s + l;
if (*ep) {
y = d;
d = rb_str_new(bp, ep - bp);
}
- no_date:;
}
if (!NIL_P(m)) {
@@ -161,10 +148,8 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
VALUE iy;
s = RSTRING_PTR(y);
- ep = RSTRING_END(y);
- while (s < ep && !issign(*s) && !isdigit(*s))
+ while (!issign((unsigned char)*s) && !isdigit((unsigned char)*s))
s++;
- if (s >= ep) goto no_year;
bp = s;
if (issign(*s)) {
s++;
@@ -172,21 +157,19 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
}
if (sign)
c = Qfalse;
- l = digit_span(s, ep);
+ l = strspn(s, DECDIGIT);
ep = s + l;
if (l > 2)
c = Qfalse;
{
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);
- no_year:;
}
if (bc)
@@ -198,24 +181,20 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
VALUE im;
s = RSTRING_PTR(m);
- ep = RSTRING_END(m);
- while (s < ep && !isdigit(*s))
+ while (!isdigit((unsigned char)*s))
s++;
- if (s >= ep) goto no_month;
bp = s;
- l = digit_span(s, ep);
+ l = strspn(s, DECDIGIT);
ep = s + l;
{
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);
- no_month:;
}
if (!NIL_P(d)) {
@@ -224,24 +203,20 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
VALUE id;
s = RSTRING_PTR(d);
- ep = RSTRING_END(d);
- while (s < ep && !isdigit(*s))
+ while (!isdigit((unsigned char)*s))
s++;
- if (s >= ep) goto no_mday;
bp = s;
- l = digit_span(s, ep);
+ l = strspn(s, DECDIGIT);
ep = s + l;
{
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);
- no_mday:;
}
if (!NIL_P(c))
@@ -281,18 +256,18 @@ regcomp(const char *source, long len, int opt)
}
#define REGCOMP(pat,opt) \
-do { \
+{ \
if (NIL_P(pat)) \
pat = regcomp(pat##_source, sizeof pat##_source - 1, opt); \
-} while (0)
+}
#define REGCOMP_0(pat) REGCOMP(pat, 0)
#define REGCOMP_I(pat) REGCOMP(pat, ONIG_OPTION_IGNORECASE)
#define MATCH(s,p,c) \
-do { \
+{ \
return match(s, p, hash, c); \
-} while (0)
+}
static int
match(VALUE str, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
@@ -332,189 +307,304 @@ subx(VALUE str, VALUE rep, VALUE pat, VALUE hash, int (*cb)(VALUE, VALUE))
}
#define SUBS(s,p,c) \
-do { \
+{ \
return subx(s, asp_string(), p, hash, c); \
-} while (0)
+}
#ifdef TIGHT_PARSER
#define SUBA(s,p,c) \
-do { \
+{ \
return subx(s, asuba_string(), p, hash, c); \
-} while (0)
+}
#define SUBB(s,p,c) \
-do { \
+{ \
return subx(s, asubb_string(), p, hash, c); \
-} while (0)
+}
#define SUBW(s,p,c) \
-do { \
+{ \
return subx(s, asubw_string(), p, hash, c); \
-} while (0)
+}
#define SUBT(s,p,c) \
-do { \
+{ \
return subx(s, asubt_string(), p, hash, c); \
-} while (0)
+}
#endif
-#include "zonetab.h"
+struct zone {
+ const char *name;
+ int offset;
+};
-static int
-str_end_with_word(const char *s, long l, const char *w)
-{
- int n = (int)strlen(w);
- if (l <= n || !isspace(s[l - n - 1])) return 0;
- if (strncasecmp(&s[l - n], w, n)) return 0;
- do ++n; while (l > n && isspace(s[l - n - 1]));
- return n;
-}
+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}
+};
-static long
-shrunk_size(const char *s, long l)
+VALUE
+date_zone_to_diff(VALUE str)
{
- long i, ni;
- int sp = 0;
- for (i = ni = 0; i < l; ++i) {
- if (!isspace(s[i])) {
- if (sp) ni++;
- sp = 0;
- ni++;
+ VALUE offset = Qnil;
+
+ long l, i;
+ char *s, *dest, *d;
+ int sp = 1;
+
+ l = RSTRING_LEN(str);
+ s = RSTRING_PTR(str);
+
+ dest = d = ALLOCA_N(char, l + 1);
+
+ for (i = 0; i < l; i++) {
+ if (isspace((unsigned char)s[i]) || s[i] == '\0') {
+ if (!sp)
+ *d++ = ' ';
+ sp = 1;
}
else {
- sp = 1;
+ if (isalpha((unsigned char)s[i]))
+ *d++ = tolower((unsigned char)s[i]);
+ else
+ *d++ = s[i];
+ sp = 0;
}
}
- return ni < l ? ni : 0;
-}
+ if (d > dest) {
+ if (*(d - 1) == ' ')
+ --d;
+ *d = '\0';
+ }
+ str = rb_str_new2(dest);
+ {
+#define STD " standard time"
+#define DST " daylight time"
+ char *ss, *ds;
+ long sl, dl;
+ int dst = 0;
-static long
-shrink_space(char *d, const char *s, long l)
-{
- long i, ni;
- int sp = 0;
- for (i = ni = 0; i < l; ++i) {
- if (!isspace(s[i])) {
- if (sp) d[ni++] = ' ';
- sp = 0;
- d[ni++] = s[i];
+ 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 {
- sp = 1;
+ else if (dl >= 0 && strcmp(ds, DST) == 0) {
+ str = rb_str_new(RSTRING_PTR(str), dl);
+ dst = 1;
}
- }
- return ni;
-}
-
-VALUE
-date_zone_to_diff(VALUE str)
-{
- VALUE offset = Qnil;
- VALUE vbuf = 0;
- long l = RSTRING_LEN(str);
- const char *s = RSTRING_PTR(str);
+#undef STD
+#undef DST
+ else {
+#define DST " dst"
+ char *ds;
+ long dl;
- {
- int dst = 0;
- int w;
+ dl = RSTRING_LEN(str) - (sizeof DST - 1);
+ ds = RSTRING_PTR(str) + dl;
- if ((w = str_end_with_word(s, l, "time")) > 0) {
- int wtime = w;
- l -= w;
- if ((w = str_end_with_word(s, l, "standard")) > 0) {
- l -= w;
- }
- else if ((w = str_end_with_word(s, l, "daylight")) > 0) {
- l -= w;
+ if (dl >= 0 && strcmp(ds, DST) == 0) {
+ str = rb_str_new(RSTRING_PTR(str), dl);
dst = 1;
}
- else {
- l += wtime;
- }
- }
- else if ((w = str_end_with_word(s, l, "dst")) > 0) {
- l -= w;
- dst = 1;
+#undef DST
}
{
- long sl = shrunk_size(s, l);
- if (sl > 0 && sl <= MAX_WORD_LENGTH) {
- char *d = ALLOCV_N(char, vbuf, sl);
- l = shrink_space(d, s, l);
- s = d;
+ 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);
+ }
}
- }
- if (l > 0 && l <= MAX_WORD_LENGTH) {
- const struct zone *z = zonetab(s, (unsigned int)l);
- if (z) {
- int d = z->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;
- if (l > 3 &&
- (strncasecmp(s, "gmt", 3) == 0 ||
- strncasecmp(s, "utc", 3) == 0)) {
+ s = RSTRING_PTR(str);
+ str_orig = str;
+
+ 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;
}
@@ -748,14 +838,16 @@ parse_era(VALUE str, VALUE hash)
static int
check_year_width(VALUE y)
{
- const char *s;
- long l;
+ char *s;
+ size_t l;
- l = RSTRING_LEN(y);
- if (l < 2) return 0;
s = RSTRING_PTR(y);
- if (!isdigit(s[1])) return 0;
- return (l == 2 || !isdigit(s[2]));
+ l = strcspn(s, DECDIGIT);
+ s += l;
+ l = strspn(s, DECDIGIT);
+ if (l != 2)
+ return 0;
+ return 1;
}
static int
@@ -1236,9 +1328,6 @@ parse_iso2(VALUE str, VALUE hash)
return 1;
}
-#define JISX0301_ERA_INITIALS "mtshr"
-#define JISX0301_DEFAULT_ERA 'H' /* obsolete */
-
static int
gengo(int c)
{
@@ -1249,7 +1338,6 @@ gengo(int c)
case 'T': case 't': e = 1911; break;
case 'S': case 's': e = 1925; break;
case 'H': case 'h': e = 1988; break;
- case 'R': case 'r': e = 2018; break;
default: e = 0; break;
}
return e;
@@ -1280,11 +1368,11 @@ parse_jis(VALUE str, VALUE hash)
{
static const char pat_source[] =
#ifndef TIGHT_PARSER
- "\\b([" JISX0301_ERA_INITIALS "])(\\d+)\\.(\\d+)\\.(\\d+)"
+ "\\b([mtsh])(\\d+)\\.(\\d+)\\.(\\d+)"
#else
BOS
FPW_COM FPT_COM
- "([" JISX0301_ERA_INITIALS "])(\\d+)\\.(\\d+)\\.(\\d+)"
+ "([mtsh])(\\d+)\\.(\\d+)\\.(\\d+)"
TEE_FPT COM_FPW
EOS
#endif
@@ -1887,26 +1975,28 @@ parse_ddd_cb(VALUE m, VALUE hash)
set_hash("zone", s5);
if (*cs5 == '[') {
- const char *s1, *s2;
+ char *buf = ALLOCA_N(char, l5 + 1);
+ char *s1, *s2, *s3;
VALUE zone;
- l5 -= 2;
- s1 = cs5 + 1;
- s2 = memchr(s1, ':', l5);
+ memcpy(buf, cs5, l5);
+ buf[l5 - 1] = '\0';
+
+ s1 = buf + 1;
+ s2 = strchr(buf, ':');
if (s2) {
+ *s2 = '\0';
s2++;
- zone = rb_str_subseq(s5, s2 - cs5, l5 - (s2 - s1));
- s5 = rb_str_subseq(s5, 1, s2 - s1);
}
- else {
- zone = rb_str_subseq(s5, 1, l5);
- if (isdigit((unsigned char)*s1))
- s5 = rb_str_append(rb_str_new_cstr("+"), zone);
- else
- s5 = zone;
- }
+ if (s2)
+ s3 = s2;
+ else
+ s3 = s1;
+ zone = rb_str_new2(s3);
set_hash("zone", zone);
- set_hash("offset", date_zone_to_diff(s5));
+ if (isdigit((unsigned char)*s1))
+ *--s1 = '+';
+ set_hash("offset", date_zone_to_diff(rb_str_new2(s1)));
}
RB_GC_GUARD(s5);
}
@@ -2199,7 +2289,7 @@ date__parse(VALUE str, VALUE comp)
#endif
{
- if (RTEST(del_hash("_bc"))) {
+ if (RTEST(ref_hash("_bc"))) {
VALUE y;
y = ref_hash("cwyear");
@@ -2214,7 +2304,7 @@ date__parse(VALUE str, VALUE comp)
}
}
- if (RTEST(del_hash("_comp"))) {
+ if (RTEST(ref_hash("_comp"))) {
VALUE y;
y = ref_hash("cwyear");
@@ -2237,6 +2327,9 @@ date__parse(VALUE str, VALUE comp)
}
+ del_hash("_bc");
+ del_hash("_comp");
+
{
VALUE zone = ref_hash("zone");
if (!NIL_P(zone) && NIL_P(ref_hash("offset")))
@@ -2286,8 +2379,8 @@ iso8601_ext_datetime_cb(VALUE m, VALUE hash)
s[i] = rb_reg_nth_match(i, m);
}
- if (!NIL_P(s[1])) {
- if (!NIL_P(s[3])) set_hash("mday", str2num(s[3]));
+ if (!NIL_P(s[3])) {
+ set_hash("mday", str2num(s[3]));
if (strcmp(RSTRING_PTR(s[1]), "-") != 0) {
y = str2num(s[1]);
if (RSTRING_LEN(s[1]) < 4)
@@ -2344,7 +2437,7 @@ static int
iso8601_ext_datetime(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "\\A\\s*(?:([-+]?\\d{2,}|-)-(\\d{2})?(?:-(\\d{2}))?|"
+ "\\A\\s*(?:([-+]?\\d{2,}|-)-(\\d{2})?-(\\d{2})|"
"([-+]?\\d{2,})?-(\\d{3})|"
"(\\d{4}|\\d{2})?-w(\\d{2})-(\\d)|"
"-w-(\\d))"
@@ -2975,7 +3068,7 @@ jisx0301_cb(VALUE m, VALUE hash)
s[i] = rb_reg_nth_match(i, m);
}
- ep = gengo(NIL_P(s[1]) ? JISX0301_DEFAULT_ERA : *RSTRING_PTR(s[1]));
+ ep = gengo(NIL_P(s[1]) ? 'h' : *RSTRING_PTR(s[1]));
set_hash("year", f_add(str2num(s[2]), INT2FIX(ep)));
set_hash("mon", str2num(s[3]));
set_hash("mday", str2num(s[4]));
@@ -3000,7 +3093,7 @@ static int
jisx0301(VALUE str, VALUE hash)
{
static const char pat_source[] =
- "\\A\\s*([" JISX0301_ERA_INITIALS "])?(\\d{2})\\.(\\d{2})\\.(\\d{2})"
+ "\\A\\s*([mtsh])?(\\d{2})\\.(\\d{2})\\.(\\d{2})"
"(?:t"
"(?:(\\d{2}):(\\d{2})(?::(\\d{2})(?:[,.](\\d*))?)?"
"(z|[-+]\\d{2}(?::?\\d{2})?)?)?)?\\s*\\z";
diff --git a/ext/date/date_strptime.c b/ext/date/date_strptime.c
index 26d9fd11bf..e318af19f3 100644
--- a/ext/date/date_strptime.c
+++ b/ext/date/date_strptime.c
@@ -79,17 +79,14 @@ read_digits(const char *s, VALUE *n, size_t width)
{
size_t l;
- if (!width)
- return 0;
-
- l = 0;
- while (ISDIGIT(s[l])) {
- if (++l == width) break;
- }
+ l = strspn(s, "0123456789");
if (l == 0)
return 0;
+ if (width < l)
+ l = width;
+
if ((4 * l * sizeof(char)) <= (sizeof(long)*CHAR_BIT)) {
const char *os = s;
long v;
@@ -106,36 +103,34 @@ 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;
}
}
-#define set_hash(k,v) rb_hash_aset(hash, ID2SYM(rb_intern(k"")), v)
-#define ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k"")))
-#define del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k"")))
+#define set_hash(k,v) rb_hash_aset(hash, ID2SYM(rb_intern(k)), v)
+#define ref_hash(k) rb_hash_aref(hash, ID2SYM(rb_intern(k)))
+#define del_hash(k) rb_hash_delete(hash, ID2SYM(rb_intern(k)))
#define fail() \
-do { \
+{ \
set_hash("_fail", Qtrue); \
return 0; \
-} while (0)
+}
#define fail_p() (!NIL_P(ref_hash("_fail")))
#define READ_DIGITS(n,w) \
-do { \
+{ \
size_t l; \
l = read_digits(&str[si], &n, w); \
if (l == 0) \
fail(); \
si += l; \
-} while (0)
+}
#define READ_DIGITS_MAX(n) READ_DIGITS(n, LONG_MAX)
@@ -150,14 +145,14 @@ valid_range_p(VALUE v, int a, int b)
}
#define recur(fmt) \
-do { \
+{ \
size_t l; \
l = date__strptime_internal(&str[si], slen - si, \
fmt, sizeof fmt - 1, hash); \
if (fail_p()) \
return 0; \
si += l; \
-} while (0)
+}
VALUE date_zone_to_diff(VALUE);
@@ -240,9 +235,9 @@ date__strptime_internal(const char *str, size_t slen,
VALUE n;
if (NUM_PATTERN_P())
- READ_DIGITS(n, 2);
+ READ_DIGITS(n, 2)
else
- READ_DIGITS_MAX(n);
+ READ_DIGITS_MAX(n)
set_hash("_cent", n);
goto matched;
}
@@ -281,9 +276,9 @@ date__strptime_internal(const char *str, size_t slen,
VALUE n;
if (NUM_PATTERN_P())
- READ_DIGITS(n, 4);
+ READ_DIGITS(n, 4)
else
- READ_DIGITS_MAX(n);
+ READ_DIGITS_MAX(n)
set_hash("cwyear", n);
goto matched;
}
@@ -361,9 +356,9 @@ date__strptime_internal(const char *str, size_t slen,
}
osi = si;
if (NUM_PATTERN_P())
- READ_DIGITS(n, c == 'L' ? 3 : 9);
+ READ_DIGITS(n, c == 'L' ? 3 : 9)
else
- READ_DIGITS_MAX(n);
+ READ_DIGITS_MAX(n)
if (sign == -1)
n = f_negate(n);
set_hash("sec_fraction",
@@ -429,7 +424,9 @@ date__strptime_internal(const char *str, size_t slen,
if (sign == -1)
n = f_negate(n);
set_hash("seconds",
- rb_rational_new2(n, INT2FIX(1000)));
+ rb_rational_new2(n,
+ f_expt(INT2FIX(10),
+ INT2FIX(3))));
goto matched;
}
@@ -530,24 +527,24 @@ date__strptime_internal(const char *str, size_t slen,
goto matched;
case 'Y':
- {
- VALUE n;
- int sign = 1;
-
- if (issign(str[si])) {
- if (str[si] == '-')
- sign = -1;
- si++;
- }
- if (NUM_PATTERN_P())
- READ_DIGITS(n, 4);
- else
- READ_DIGITS_MAX(n);
+ {
+ VALUE n;
+ int sign = 1;
+
+ if (issign(str[si])) {
+ if (str[si] == '-')
+ sign = -1;
+ si++;
+ }
+ if (NUM_PATTERN_P())
+ READ_DIGITS(n, 4)
+ else
+ READ_DIGITS_MAX(n)
if (sign == -1)
n = f_negate(n);
- set_hash("year", n);
- goto matched;
- }
+ set_hash("year", n);
+ goto matched;
+ }
case 'y':
{
@@ -669,7 +666,7 @@ date__strptime(const char *str, size_t slen,
if (fail_p())
return Qnil;
- cent = del_hash("_cent");
+ cent = ref_hash("_cent");
if (!NIL_P(cent)) {
VALUE year;
@@ -679,9 +676,10 @@ date__strptime(const char *str, size_t slen,
year = ref_hash("year");
if (!NIL_P(year))
set_hash("year", f_add(year, f_mul(cent, INT2FIX(100))));
+ del_hash("_cent");
}
- merid = del_hash("_merid");
+ merid = ref_hash("_merid");
if (!NIL_P(merid)) {
VALUE hour;
@@ -690,6 +688,7 @@ date__strptime(const char *str, size_t slen,
hour = f_mod(hour, INT2FIX(12));
set_hash("hour", f_add(hour, merid));
}
+ del_hash("_merid");
}
return hash;
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 28847bef13..a5444e3ed9 100644
--- a/ext/date/depend
+++ b/ext/date/depend
@@ -1,44 +1,33 @@
# AUTOGENERATED DEPENDENCIES START
date_core.o: $(RUBY_EXTCONF_H)
date_core.o: $(arch_hdrdir)/ruby/config.h
-date_core.o: $(hdrdir)/ruby.h
-date_core.o: $(hdrdir)/ruby/assert.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.h
-date_parse.o: $(hdrdir)/ruby/assert.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/assert.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
@@ -49,19 +38,16 @@ date_strftime.o: date_strftime.c
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.h
-date_strptime.o: $(hdrdir)/ruby/assert.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
diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb
index 8938df13b3..6f479eaa26 100644
--- a/ext/date/extconf.rb
+++ b/ext/date/extconf.rb
@@ -1,9 +1,5 @@
-# frozen_string_literal: true
require 'mkmf'
-
-config_string("strict_warnflags") {|w| $warnflags += " #{w}"}
-
-have_var("timezone", "time.h")
-have_var("altzone", "time.h")
-
+if try_cflags("-std=iso9899:1999")
+ $CFLAGS += " " << "-std=iso9899:1999"
+end
create_makefile('date_core')
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index b72b4157f2..4268661cb2 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -1,14 +1,9 @@
-# frozen_string_literal: true
# date.rb: Written by Tadayoshi Funaba 1998-2011
require 'date_core'
class Date
- def infinite?
- false
- end
-
class Infinity < Numeric # :nodoc:
include Comparable
@@ -19,17 +14,17 @@ 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
diff --git a/ext/date/prereq.mk b/ext/date/prereq.mk
deleted file mode 100644
index fa371e0d47..0000000000
--- a/ext/date/prereq.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-.SUFFIXES: .list
-
-.list.h:
- gperf --ignore-case -C -c -P -p -j1 -i 1 -g -o -t -N $(*F) $< \
- | sed -f $(top_srcdir)/tool/gperf.sed \
- > $(@F)
-
-zonetab.h: zonetab.list
-
-.PHONY: update-zonetab
-update-zonetab:
- $(RUBY) -C $(srcdir) update-abbr.rb
diff --git a/ext/date/update-abbr b/ext/date/update-abbr
deleted file mode 100644
index e5f6a78c82..0000000000
--- a/ext/date/update-abbr
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- mode: ruby -*-
-require 'nokogiri'
-require 'open-uri'
-
-doc = Nokogiri::HTML(URI.open('https://www.timeanddate.com/time/zones/'))
-
-h = {}
-
-doc.css('#tz-abb tbody tr').each do |tr|
- tds = tr.css('td')
- abbr = tds[0].text.strip.downcase
- offset = tds[3].text.strip.gsub(/UTC\s*/, '')
- next if offset.include?('/') # skip ambiguous timezones
- next if offset.empty?
-
-
- hour, min = offset.split(':', 2)
- offset = (Integer(hour) * 60 + (Integer(min || 0)))*60
- if h.has_key?(abbr)
- h[abbr] = false
- else
- h[abbr] = offset
- end
-end
-
-h.delete_if{|_,v| !v}
-
-lines = File.readlines('zonetab.list')
-lines.select{|l| l.include?(',')}.
- map{|l| l.split(',', 2)[0]}.
- each{|a| h.delete(a)}
-
-lines.insert(-2, h.sort.map{|k,v| "#{k},#{v}\n"})
-lines.flatten!
-File.write('zonetab.list', lines.join)
diff --git a/ext/date/zonetab.h b/ext/date/zonetab.h
deleted file mode 100644
index 379f78e1b8..0000000000
--- a/ext/date/zonetab.h
+++ /dev/null
@@ -1,1562 +0,0 @@
-/* ANSI-C code produced by gperf version 3.1 */
-/* Command-line: gperf --ignore-case -C -c -P -p -j1 -i 1 -g -o -t -N zonetab zonetab.list */
-/* Computed positions: -k'1-4,9' */
-
-#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;
-
-#define TOTAL_KEYWORDS 316
-#define MIN_WORD_LENGTH 1
-#define MAX_WORD_LENGTH 17
-#define MIN_HASH_VALUE 2
-#define MAX_HASH_VALUE 619
-/* maximum key range = 618, 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 (register const char *s1, register const char *s2, register size_t 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
-
-#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[] =
- {
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 17, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 3, 2, 620, 620, 620,
- 620, 620, 70, 8, 3, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 39, 176, 207, 70, 168,
- 1, 5, 18, 74, 218, 2, 117, 130, 48, 88,
- 125, 225, 92, 1, 1, 12, 54, 30, 36, 13,
- 48, 168, 263, 59, 114, 166, 109, 39, 176, 207,
- 70, 168, 1, 5, 18, 74, 218, 2, 117, 130,
- 48, 88, 125, 225, 92, 1, 1, 12, 54, 30,
- 36, 13, 48, 168, 263, 59, 114, 166, 109, 27,
- 104, 1, 9, 4, 309, 190, 188, 177, 255, 108,
- 2, 341, 3, 620, 620, 620, 620, 620, 620, 12,
- 54, 30, 36, 13, 48, 168, 263, 59, 114, 166,
- 109, 27, 104, 1, 9, 4, 309, 190, 188, 177,
- 255, 108, 2, 341, 3, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620, 620, 620,
- 620, 620, 620, 620, 620, 620, 620, 620
- };
- register unsigned int hval = (unsigned int)len;
-
- switch (hval)
- {
- default:
- hval += asso_values[(unsigned char)str[8]];
- /*FALLTHROUGH*/
- case 8:
- case 7:
- case 6:
- case 5:
- case 4:
- 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]+6];
- /*FALLTHROUGH*/
- case 1:
- hval += asso_values[(unsigned char)str[0]+52];
- break;
- }
- return (unsigned int)hval;
-}
-
-struct stringpool_t
- {
- char stringpool_str2[sizeof("o")];
- char stringpool_str3[sizeof("x")];
- char stringpool_str4[sizeof("z")];
- char stringpool_str5[sizeof("q")];
- char stringpool_str8[sizeof("omst")];
- char stringpool_str9[sizeof("omsst")];
- char stringpool_str10[sizeof("p")];
- char stringpool_str13[sizeof("a")];
- char stringpool_str14[sizeof("e")];
- char stringpool_str15[sizeof("pet")];
- char stringpool_str16[sizeof("pmst")];
- char stringpool_str17[sizeof("pett")];
- char stringpool_str18[sizeof("petst")];
- char stringpool_str19[sizeof("eet")];
- char stringpool_str20[sizeof("aest")];
- char stringpool_str21[sizeof("eest")];
- char stringpool_str22[sizeof("eat")];
- char stringpool_str24[sizeof("east")];
- char stringpool_str25[sizeof("easst")];
- char stringpool_str26[sizeof("pst")];
- char stringpool_str27[sizeof("eastern")];
- char stringpool_str28[sizeof("m")];
- char stringpool_str29[sizeof("ast")];
- char stringpool_str30[sizeof("est")];
- char stringpool_str31[sizeof("c")];
- char stringpool_str32[sizeof("mmt")];
- char stringpool_str33[sizeof("met")];
- char stringpool_str35[sizeof("mest")];
- char stringpool_str36[sizeof("cet")];
- char stringpool_str37[sizeof("d")];
- char stringpool_str38[sizeof("cest")];
- char stringpool_str39[sizeof("cat")];
- char stringpool_str41[sizeof("cast")];
- char stringpool_str42[sizeof("magt")];
- char stringpool_str43[sizeof("magst")];
- char stringpool_str44[sizeof("mst")];
- char stringpool_str45[sizeof("msk")];
- char stringpool_str46[sizeof("cot")];
- char stringpool_str47[sizeof("cst")];
- char stringpool_str48[sizeof("aqtt")];
- char stringpool_str49[sizeof("f")];
- char stringpool_str52[sizeof("art")];
- char stringpool_str53[sizeof("fnt")];
- char stringpool_str54[sizeof("fet")];
- char stringpool_str55[sizeof("b")];
- char stringpool_str57[sizeof("anat")];
- char stringpool_str58[sizeof("anast")];
- char stringpool_str59[sizeof("bnt")];
- char stringpool_str60[sizeof("i")];
- char stringpool_str61[sizeof("pht")];
- char stringpool_str62[sizeof("at")];
- char stringpool_str63[sizeof("zp6")];
- char stringpool_str64[sizeof("mewt")];
- char stringpool_str65[sizeof("fst")];
- char stringpool_str66[sizeof("ahst")];
- char stringpool_str67[sizeof("mawt")];
- char stringpool_str68[sizeof("zp5")];
- char stringpool_str70[sizeof("bot")];
- char stringpool_str71[sizeof("bst")];
- char stringpool_str72[sizeof("pwt")];
- char stringpool_str74[sizeof("pont")];
- char stringpool_str75[sizeof("iot")];
- char stringpool_str76[sizeof("ist")];
- char stringpool_str77[sizeof("awst")];
- char stringpool_str79[sizeof("mht")];
- char stringpool_str80[sizeof("mez")];
- char stringpool_str81[sizeof("orat")];
- char stringpool_str82[sizeof("mesz")];
- char stringpool_str84[sizeof("chst")];
- char stringpool_str85[sizeof("pmdt")];
- char stringpool_str88[sizeof("central")];
- char stringpool_str89[sizeof("aedt")];
- char stringpool_str90[sizeof("act")];
- char stringpool_str91[sizeof("ect")];
- char stringpool_str92[sizeof("acst")];
- char stringpool_str93[sizeof("eadt")];
- char stringpool_str94[sizeof("brt")];
- char stringpool_str95[sizeof("chut")];
- char stringpool_str96[sizeof("brst")];
- char stringpool_str97[sizeof("cen. australia")];
- char stringpool_str100[sizeof("davt")];
- char stringpool_str101[sizeof("irst")];
- char stringpool_str102[sizeof("irkt")];
- char stringpool_str103[sizeof("irkst")];
- char stringpool_str104[sizeof("bt")];
- char stringpool_str105[sizeof("n")];
- char stringpool_str106[sizeof("btt")];
- char stringpool_str107[sizeof("mountain")];
- char stringpool_str108[sizeof("cct")];
- char stringpool_str109[sizeof("w")];
- char stringpool_str110[sizeof("l")];
- char stringpool_str111[sizeof("fwt")];
- char stringpool_str113[sizeof("msd")];
- char stringpool_str114[sizeof("wet")];
- char stringpool_str116[sizeof("west")];
- char stringpool_str117[sizeof("wat")];
- char stringpool_str119[sizeof("wast")];
- char stringpool_str120[sizeof("wakt")];
- char stringpool_str121[sizeof("nst")];
- char stringpool_str122[sizeof("acwst")];
- char stringpool_str123[sizeof("chast")];
- char stringpool_str124[sizeof("cist")];
- char stringpool_str125[sizeof("azt")];
- char stringpool_str126[sizeof("clt")];
- char stringpool_str127[sizeof("azst")];
- char stringpool_str128[sizeof("clst")];
- char stringpool_str129[sizeof("mart")];
- char stringpool_str130[sizeof("zp4")];
- char stringpool_str131[sizeof("jst")];
- char stringpool_str132[sizeof("central asia")];
- char stringpool_str133[sizeof("aft")];
- char stringpool_str134[sizeof("e. south america")];
- char stringpool_str135[sizeof("central america")];
- char stringpool_str137[sizeof("ict")];
- char stringpool_str143[sizeof("pgt")];
- char stringpool_str144[sizeof("nrt")];
- char stringpool_str145[sizeof("mexico")];
- char stringpool_str146[sizeof("awdt")];
- char stringpool_str147[sizeof("egt")];
- char stringpool_str148[sizeof("cxt")];
- char stringpool_str149[sizeof("egst")];
- char stringpool_str150[sizeof("phot")];
- char stringpool_str151[sizeof("alaskan")];
- char stringpool_str154[sizeof("nt")];
- char stringpool_str158[sizeof("wt")];
- char stringpool_str160[sizeof("west asia")];
- char stringpool_str161[sizeof("acdt")];
- char stringpool_str162[sizeof("npt")];
- char stringpool_str163[sizeof("lhst")];
- char stringpool_str164[sizeof("afghanistan")];
- char stringpool_str167[sizeof("k")];
- char stringpool_str169[sizeof("g")];
- char stringpool_str170[sizeof("irdt")];
- char stringpool_str171[sizeof("chot")];
- char stringpool_str172[sizeof("chost")];
- char stringpool_str173[sizeof("gmt")];
- char stringpool_str174[sizeof("get")];
- char stringpool_str175[sizeof("novt")];
- char stringpool_str176[sizeof("novst")];
- char stringpool_str177[sizeof("fjt")];
- char stringpool_str178[sizeof("u")];
- char stringpool_str179[sizeof("fjst")];
- char stringpool_str181[sizeof("pyst")];
- char stringpool_str182[sizeof("nct")];
- char stringpool_str183[sizeof("kst")];
- char stringpool_str184[sizeof("kost")];
- char stringpool_str185[sizeof("gst")];
- char stringpool_str186[sizeof("iran")];
- char stringpool_str187[sizeof("e. africa")];
- char stringpool_str188[sizeof("wadt")];
- char stringpool_str189[sizeof("t")];
- char stringpool_str190[sizeof("e. australia")];
- char stringpool_str191[sizeof("s")];
- char stringpool_str192[sizeof("chadt")];
- char stringpool_str193[sizeof("tmt")];
- char stringpool_str194[sizeof("cidst")];
- char stringpool_str195[sizeof("aoe")];
- char stringpool_str197[sizeof("myt")];
- char stringpool_str198[sizeof("west pacific")];
- char stringpool_str199[sizeof("mut")];
- char stringpool_str200[sizeof("wit")];
- char stringpool_str201[sizeof("sast")];
- char stringpool_str202[sizeof("sakt")];
- char stringpool_str203[sizeof("new zealand")];
- char stringpool_str204[sizeof("tot")];
- char stringpool_str205[sizeof("china")];
- char stringpool_str206[sizeof("tost")];
- char stringpool_str207[sizeof("sst")];
- char stringpool_str209[sizeof("india")];
- char stringpool_str211[sizeof("warst")];
- char stringpool_str212[sizeof("sbt")];
- char stringpool_str214[sizeof("azot")];
- char stringpool_str215[sizeof("azost")];
- char stringpool_str216[sizeof("taht")];
- char stringpool_str217[sizeof("nzt")];
- char stringpool_str218[sizeof("dateline")];
- char stringpool_str219[sizeof("nzst")];
- char stringpool_str220[sizeof("tokyo")];
- char stringpool_str221[sizeof("central pacific")];
- char stringpool_str223[sizeof("qyzt")];
- char stringpool_str224[sizeof("atlantic")];
- char stringpool_str225[sizeof("nft")];
- char stringpool_str227[sizeof("ut")];
- char stringpool_str228[sizeof("trt")];
- char stringpool_str229[sizeof("wft")];
- char stringpool_str230[sizeof("srt")];
- char stringpool_str231[sizeof("pdt")];
- char stringpool_str232[sizeof("lhdt")];
- char stringpool_str234[sizeof("adt")];
- char stringpool_str235[sizeof("edt")];
- char stringpool_str238[sizeof("pkt")];
- char stringpool_str239[sizeof("almt")];
- char stringpool_str240[sizeof("wita")];
- char stringpool_str242[sizeof("wgt")];
- char stringpool_str243[sizeof("akst")];
- char stringpool_str244[sizeof("wgst")];
- char stringpool_str246[sizeof("krat")];
- char stringpool_str247[sizeof("krast")];
- char stringpool_str248[sizeof("mid-atlantic")];
- char stringpool_str249[sizeof("mdt")];
- char stringpool_str250[sizeof("lint")];
- char stringpool_str251[sizeof("malay peninsula")];
- char stringpool_str252[sizeof("cdt")];
- char stringpool_str253[sizeof("swt")];
- char stringpool_str255[sizeof("se asia")];
- char stringpool_str256[sizeof("v")];
- char stringpool_str258[sizeof("tonga")];
- char stringpool_str259[sizeof("ckt")];
- char stringpool_str261[sizeof("vet")];
- char stringpool_str262[sizeof("caucasus")];
- char stringpool_str263[sizeof("central europe")];
- char stringpool_str264[sizeof("h")];
- char stringpool_str265[sizeof("central european")];
- char stringpool_str266[sizeof("newfoundland")];
- char stringpool_str267[sizeof("arab")];
- char stringpool_str268[sizeof("sct")];
- char stringpool_str269[sizeof("arabic")];
- char stringpool_str270[sizeof("arabian")];
- char stringpool_str271[sizeof("ddut")];
- char stringpool_str273[sizeof("vost")];
- char stringpool_str274[sizeof("hast")];
- char stringpool_str275[sizeof("nepal")];
- char stringpool_str276[sizeof("nut")];
- char stringpool_str277[sizeof("fkt")];
- char stringpool_str279[sizeof("fkst")];
- char stringpool_str280[sizeof("hst")];
- char stringpool_str281[sizeof("idt")];
- char stringpool_str284[sizeof("tlt")];
- char stringpool_str285[sizeof("w. australia")];
- char stringpool_str286[sizeof("egypt")];
- char stringpool_str287[sizeof("myanmar")];
- char stringpool_str288[sizeof("nzdt")];
- char stringpool_str289[sizeof("gft")];
- char stringpool_str290[sizeof("uzt")];
- char stringpool_str293[sizeof("north asia")];
- char stringpool_str294[sizeof("mvt")];
- char stringpool_str295[sizeof("galt")];
- char stringpool_str296[sizeof("nfdt")];
- char stringpool_str297[sizeof("cvt")];
- char stringpool_str298[sizeof("north asia east")];
- char stringpool_str300[sizeof("kgt")];
- char stringpool_str301[sizeof("aus central")];
- char stringpool_str302[sizeof("pacific")];
- char stringpool_str304[sizeof("canada central")];
- char stringpool_str306[sizeof("pacific sa")];
- char stringpool_str307[sizeof("azores")];
- char stringpool_str308[sizeof("gamt")];
- char stringpool_str309[sizeof("tft")];
- char stringpool_str310[sizeof("r")];
- char stringpool_str311[sizeof("fle")];
- char stringpool_str312[sizeof("akdt")];
- char stringpool_str313[sizeof("ulat")];
- char stringpool_str314[sizeof("ulast")];
- char stringpool_str315[sizeof("ret")];
- char stringpool_str317[sizeof("tjt")];
- char stringpool_str319[sizeof("south africa")];
- char stringpool_str324[sizeof("sgt")];
- char stringpool_str326[sizeof("ndt")];
- char stringpool_str327[sizeof("rott")];
- char stringpool_str330[sizeof("samt")];
- char stringpool_str332[sizeof("tasmania")];
- char stringpool_str334[sizeof("hovt")];
- char stringpool_str335[sizeof("hovst")];
- char stringpool_str338[sizeof("gyt")];
- char stringpool_str342[sizeof("y")];
- char stringpool_str343[sizeof("hadt")];
- char stringpool_str344[sizeof("sa western")];
- char stringpool_str345[sizeof("hawaiian")];
- char stringpool_str347[sizeof("uyt")];
- char stringpool_str349[sizeof("uyst")];
- char stringpool_str350[sizeof("yekt")];
- char stringpool_str351[sizeof("yekst")];
- char stringpool_str352[sizeof("kuyt")];
- char stringpool_str353[sizeof("yakt")];
- char stringpool_str354[sizeof("yakst")];
- char stringpool_str358[sizeof("yst")];
- char stringpool_str359[sizeof("jerusalem")];
- char stringpool_str365[sizeof("sri lanka")];
- char stringpool_str367[sizeof("yakutsk")];
- char stringpool_str375[sizeof("wib")];
- char stringpool_str377[sizeof("aus eastern")];
- char stringpool_str378[sizeof("gilt")];
- char stringpool_str387[sizeof("us mountain")];
- char stringpool_str391[sizeof("vlat")];
- char stringpool_str392[sizeof("vlast")];
- char stringpool_str395[sizeof("gtb")];
- char stringpool_str398[sizeof("taipei")];
- char stringpool_str399[sizeof("sret")];
- char stringpool_str408[sizeof("cape verde")];
- char stringpool_str417[sizeof("tkt")];
- char stringpool_str418[sizeof("samoa")];
- char stringpool_str421[sizeof("sa pacific")];
- char stringpool_str427[sizeof("vut")];
- char stringpool_str428[sizeof("idlw")];
- char stringpool_str432[sizeof("fiji")];
- char stringpool_str435[sizeof("utc")];
- char stringpool_str443[sizeof("korea")];
- char stringpool_str445[sizeof("e. europe")];
- char stringpool_str449[sizeof("syot")];
- char stringpool_str452[sizeof("n. central asia")];
- char stringpool_str455[sizeof("tvt")];
- char stringpool_str458[sizeof("w. central africa")];
- char stringpool_str466[sizeof("ekaterinburg")];
- char stringpool_str468[sizeof("vladivostok")];
- char stringpool_str476[sizeof("yapt")];
- char stringpool_str477[sizeof("us eastern")];
- char stringpool_str482[sizeof("sa eastern")];
- char stringpool_str485[sizeof("hdt")];
- char stringpool_str486[sizeof("russian")];
- char stringpool_str492[sizeof("hkt")];
- char stringpool_str497[sizeof("romance")];
- char stringpool_str540[sizeof("w. europe")];
- char stringpool_str563[sizeof("ydt")];
- char stringpool_str566[sizeof("idle")];
- char stringpool_str567[sizeof("greenwich")];
- char stringpool_str619[sizeof("greenland")];
- };
-static const struct stringpool_t stringpool_contents =
- {
- "o",
- "x",
- "z",
- "q",
- "omst",
- "omsst",
- "p",
- "a",
- "e",
- "pet",
- "pmst",
- "pett",
- "petst",
- "eet",
- "aest",
- "eest",
- "eat",
- "east",
- "easst",
- "pst",
- "eastern",
- "m",
- "ast",
- "est",
- "c",
- "mmt",
- "met",
- "mest",
- "cet",
- "d",
- "cest",
- "cat",
- "cast",
- "magt",
- "magst",
- "mst",
- "msk",
- "cot",
- "cst",
- "aqtt",
- "f",
- "art",
- "fnt",
- "fet",
- "b",
- "anat",
- "anast",
- "bnt",
- "i",
- "pht",
- "at",
- "zp6",
- "mewt",
- "fst",
- "ahst",
- "mawt",
- "zp5",
- "bot",
- "bst",
- "pwt",
- "pont",
- "iot",
- "ist",
- "awst",
- "mht",
- "mez",
- "orat",
- "mesz",
- "chst",
- "pmdt",
- "central",
- "aedt",
- "act",
- "ect",
- "acst",
- "eadt",
- "brt",
- "chut",
- "brst",
- "cen. australia",
- "davt",
- "irst",
- "irkt",
- "irkst",
- "bt",
- "n",
- "btt",
- "mountain",
- "cct",
- "w",
- "l",
- "fwt",
- "msd",
- "wet",
- "west",
- "wat",
- "wast",
- "wakt",
- "nst",
- "acwst",
- "chast",
- "cist",
- "azt",
- "clt",
- "azst",
- "clst",
- "mart",
- "zp4",
- "jst",
- "central asia",
- "aft",
- "e. south america",
- "central america",
- "ict",
- "pgt",
- "nrt",
- "mexico",
- "awdt",
- "egt",
- "cxt",
- "egst",
- "phot",
- "alaskan",
- "nt",
- "wt",
- "west asia",
- "acdt",
- "npt",
- "lhst",
- "afghanistan",
- "k",
- "g",
- "irdt",
- "chot",
- "chost",
- "gmt",
- "get",
- "novt",
- "novst",
- "fjt",
- "u",
- "fjst",
- "pyst",
- "nct",
- "kst",
- "kost",
- "gst",
- "iran",
- "e. africa",
- "wadt",
- "t",
- "e. australia",
- "s",
- "chadt",
- "tmt",
- "cidst",
- "aoe",
- "myt",
- "west pacific",
- "mut",
- "wit",
- "sast",
- "sakt",
- "new zealand",
- "tot",
- "china",
- "tost",
- "sst",
- "india",
- "warst",
- "sbt",
- "azot",
- "azost",
- "taht",
- "nzt",
- "dateline",
- "nzst",
- "tokyo",
- "central pacific",
- "qyzt",
- "atlantic",
- "nft",
- "ut",
- "trt",
- "wft",
- "srt",
- "pdt",
- "lhdt",
- "adt",
- "edt",
- "pkt",
- "almt",
- "wita",
- "wgt",
- "akst",
- "wgst",
- "krat",
- "krast",
- "mid-atlantic",
- "mdt",
- "lint",
- "malay peninsula",
- "cdt",
- "swt",
- "se asia",
- "v",
- "tonga",
- "ckt",
- "vet",
- "caucasus",
- "central europe",
- "h",
- "central european",
- "newfoundland",
- "arab",
- "sct",
- "arabic",
- "arabian",
- "ddut",
- "vost",
- "hast",
- "nepal",
- "nut",
- "fkt",
- "fkst",
- "hst",
- "idt",
- "tlt",
- "w. australia",
- "egypt",
- "myanmar",
- "nzdt",
- "gft",
- "uzt",
- "north asia",
- "mvt",
- "galt",
- "nfdt",
- "cvt",
- "north asia east",
- "kgt",
- "aus central",
- "pacific",
- "canada central",
- "pacific sa",
- "azores",
- "gamt",
- "tft",
- "r",
- "fle",
- "akdt",
- "ulat",
- "ulast",
- "ret",
- "tjt",
- "south africa",
- "sgt",
- "ndt",
- "rott",
- "samt",
- "tasmania",
- "hovt",
- "hovst",
- "gyt",
- "y",
- "hadt",
- "sa western",
- "hawaiian",
- "uyt",
- "uyst",
- "yekt",
- "yekst",
- "kuyt",
- "yakt",
- "yakst",
- "yst",
- "jerusalem",
- "sri lanka",
- "yakutsk",
- "wib",
- "aus eastern",
- "gilt",
- "us mountain",
- "vlat",
- "vlast",
- "gtb",
- "taipei",
- "sret",
- "cape verde",
- "tkt",
- "samoa",
- "sa pacific",
- "vut",
- "idlw",
- "fiji",
- "utc",
- "korea",
- "e. europe",
- "syot",
- "n. central asia",
- "tvt",
- "w. central africa",
- "ekaterinburg",
- "vladivostok",
- "yapt",
- "us eastern",
- "sa eastern",
- "hdt",
- "russian",
- "hkt",
- "romance",
- "w. europe",
- "ydt",
- "idle",
- "greenwich",
- "greenland"
- };
-#define stringpool ((const char *) &stringpool_contents)
-const struct zone *
-zonetab (register const char *str, register size_t len)
-{
- static const struct zone wordlist[] =
- {
- {-1}, {-1},
-#line 34 "zonetab.list"
- {gperf_offsetof(stringpool, 2), -2*3600},
-#line 43 "zonetab.list"
- {gperf_offsetof(stringpool, 3), -11*3600},
-#line 45 "zonetab.list"
- {gperf_offsetof(stringpool, 4), 0*3600},
-#line 36 "zonetab.list"
- {gperf_offsetof(stringpool, 5), -4*3600},
- {-1}, {-1},
-#line 269 "zonetab.list"
- {gperf_offsetof(stringpool, 8),21600},
-#line 268 "zonetab.list"
- {gperf_offsetof(stringpool, 9),25200},
-#line 35 "zonetab.list"
- {gperf_offsetof(stringpool, 10), -3*3600},
- {-1}, {-1},
-#line 21 "zonetab.list"
- {gperf_offsetof(stringpool, 13), 1*3600},
-#line 25 "zonetab.list"
- {gperf_offsetof(stringpool, 14), 5*3600},
-#line 271 "zonetab.list"
- {gperf_offsetof(stringpool, 15),-18000},
-#line 279 "zonetab.list"
- {gperf_offsetof(stringpool, 16),-10800},
-#line 273 "zonetab.list"
- {gperf_offsetof(stringpool, 17),43200},
-#line 272 "zonetab.list"
- {gperf_offsetof(stringpool, 18),43200},
-#line 80 "zonetab.list"
- {gperf_offsetof(stringpool, 19), 2*3600},
-#line 186 "zonetab.list"
- {gperf_offsetof(stringpool, 20),36000},
-#line 88 "zonetab.list"
- {gperf_offsetof(stringpool, 21), 3*3600},
-#line 87 "zonetab.list"
- {gperf_offsetof(stringpool, 22), 3*3600},
- {-1},
-#line 101 "zonetab.list"
- {gperf_offsetof(stringpool, 24),10*3600},
-#line 217 "zonetab.list"
- {gperf_offsetof(stringpool, 25),-18000},
-#line 19 "zonetab.list"
- {gperf_offsetof(stringpool, 26), -8*3600},
-#line 133 "zonetab.list"
- {gperf_offsetof(stringpool, 27), -18000},
-#line 32 "zonetab.list"
- {gperf_offsetof(stringpool, 28), 12*3600},
-#line 56 "zonetab.list"
- {gperf_offsetof(stringpool, 29), -4*3600},
-#line 13 "zonetab.list"
- {gperf_offsetof(stringpool, 30), -5*3600},
-#line 23 "zonetab.list"
- {gperf_offsetof(stringpool, 31), 3*3600},
-#line 256 "zonetab.list"
- {gperf_offsetof(stringpool, 32),23400},
-#line 73 "zonetab.list"
- {gperf_offsetof(stringpool, 33), 1*3600},
- {-1},
-#line 82 "zonetab.list"
- {gperf_offsetof(stringpool, 35), 2*3600},
-#line 71 "zonetab.list"
- {gperf_offsetof(stringpool, 36), 1*3600},
-#line 24 "zonetab.list"
- {gperf_offsetof(stringpool, 37), 4*3600},
-#line 79 "zonetab.list"
- {gperf_offsetof(stringpool, 38), 2*3600},
-#line 65 "zonetab.list"
- {gperf_offsetof(stringpool, 39),-10*3600},
- {-1},
-#line 202 "zonetab.list"
- {gperf_offsetof(stringpool, 41),28800},
-#line 252 "zonetab.list"
- {gperf_offsetof(stringpool, 42),39600},
-#line 251 "zonetab.list"
- {gperf_offsetof(stringpool, 43),43200},
-#line 17 "zonetab.list"
- {gperf_offsetof(stringpool, 44), -7*3600},
-#line 89 "zonetab.list"
- {gperf_offsetof(stringpool, 45), 3*3600},
-#line 212 "zonetab.list"
- {gperf_offsetof(stringpool, 46),-18000},
-#line 15 "zonetab.list"
- {gperf_offsetof(stringpool, 47), -6*3600},
-#line 192 "zonetab.list"
- {gperf_offsetof(stringpool, 48),18000},
-#line 26 "zonetab.list"
- {gperf_offsetof(stringpool, 49), 6*3600},
- {-1}, {-1},
-#line 51 "zonetab.list"
- {gperf_offsetof(stringpool, 52), -3*3600},
-#line 226 "zonetab.list"
- {gperf_offsetof(stringpool, 53),-7200},
-#line 221 "zonetab.list"
- {gperf_offsetof(stringpool, 54),10800},
-#line 22 "zonetab.list"
- {gperf_offsetof(stringpool, 55), 2*3600},
- {-1},
-#line 190 "zonetab.list"
- {gperf_offsetof(stringpool, 57),43200},
-#line 189 "zonetab.list"
- {gperf_offsetof(stringpool, 58),43200},
-#line 199 "zonetab.list"
- {gperf_offsetof(stringpool, 59),28800},
-#line 29 "zonetab.list"
- {gperf_offsetof(stringpool, 60), 9*3600},
-#line 276 "zonetab.list"
- {gperf_offsetof(stringpool, 61),28800},
-#line 48 "zonetab.list"
- {gperf_offsetof(stringpool, 62), -2*3600},
-#line 94 "zonetab.list"
- {gperf_offsetof(stringpool, 63), 6*3600},
-#line 74 "zonetab.list"
- {gperf_offsetof(stringpool, 64), 1*3600},
-#line 81 "zonetab.list"
- {gperf_offsetof(stringpool, 65), 2*3600},
-#line 64 "zonetab.list"
- {gperf_offsetof(stringpool, 66),-10*3600},
-#line 254 "zonetab.list"
- {gperf_offsetof(stringpool, 67),18000},
-#line 92 "zonetab.list"
- {gperf_offsetof(stringpool, 68), 5*3600},
- {-1},
-#line 200 "zonetab.list"
- {gperf_offsetof(stringpool, 70),-14400},
-#line 70 "zonetab.list"
- {gperf_offsetof(stringpool, 71), 1*3600},
-#line 281 "zonetab.list"
- {gperf_offsetof(stringpool, 72),32400},
- {-1},
-#line 280 "zonetab.list"
- {gperf_offsetof(stringpool, 74),39600},
-#line 238 "zonetab.list"
- {gperf_offsetof(stringpool, 75),21600},
-#line 93 "zonetab.list"
- {gperf_offsetof(stringpool, 76), (5*3600+1800)},
-#line 194 "zonetab.list"
- {gperf_offsetof(stringpool, 77),28800},
- {-1},
-#line 255 "zonetab.list"
- {gperf_offsetof(stringpool, 79),43200},
-#line 75 "zonetab.list"
- {gperf_offsetof(stringpool, 80), 1*3600},
-#line 270 "zonetab.list"
- {gperf_offsetof(stringpool, 81),18000},
-#line 83 "zonetab.list"
- {gperf_offsetof(stringpool, 82), 2*3600},
- {-1},
-#line 207 "zonetab.list"
- {gperf_offsetof(stringpool, 84),36000},
-#line 278 "zonetab.list"
- {gperf_offsetof(stringpool, 85),-7200},
- {-1}, {-1},
-#line 126 "zonetab.list"
- {gperf_offsetof(stringpool, 88), -21600},
-#line 185 "zonetab.list"
- {gperf_offsetof(stringpool, 89),39600},
-#line 183 "zonetab.list"
- {gperf_offsetof(stringpool, 90),-18000},
-#line 218 "zonetab.list"
- {gperf_offsetof(stringpool, 91),-18000},
-#line 182 "zonetab.list"
- {gperf_offsetof(stringpool, 92),34200},
-#line 103 "zonetab.list"
- {gperf_offsetof(stringpool, 93),11*3600},
-#line 53 "zonetab.list"
- {gperf_offsetof(stringpool, 94), -3*3600},
-#line 208 "zonetab.list"
- {gperf_offsetof(stringpool, 95),36000},
-#line 49 "zonetab.list"
- {gperf_offsetof(stringpool, 96),-2*3600},
-#line 120 "zonetab.list"
- {gperf_offsetof(stringpool, 97), 34200},
- {-1}, {-1},
-#line 215 "zonetab.list"
- {gperf_offsetof(stringpool, 100),25200},
-#line 242 "zonetab.list"
- {gperf_offsetof(stringpool, 101),12600},
-#line 241 "zonetab.list"
- {gperf_offsetof(stringpool, 102),28800},
-#line 240 "zonetab.list"
- {gperf_offsetof(stringpool, 103),32400},
-#line 86 "zonetab.list"
- {gperf_offsetof(stringpool, 104), 3*3600},
-#line 33 "zonetab.list"
- {gperf_offsetof(stringpool, 105), -1*3600},
-#line 201 "zonetab.list"
- {gperf_offsetof(stringpool, 106),21600},
-#line 148 "zonetab.list"
- {gperf_offsetof(stringpool, 107), -25200},
-#line 96 "zonetab.list"
- {gperf_offsetof(stringpool, 108), 8*3600},
-#line 42 "zonetab.list"
- {gperf_offsetof(stringpool, 109), -10*3600},
-#line 31 "zonetab.list"
- {gperf_offsetof(stringpool, 110), 11*3600},
-#line 72 "zonetab.list"
- {gperf_offsetof(stringpool, 111), 1*3600},
- {-1},
-#line 90 "zonetab.list"
- {gperf_offsetof(stringpool, 113), 4*3600},
-#line 47 "zonetab.list"
- {gperf_offsetof(stringpool, 114), 0*3600},
- {-1},
-#line 78 "zonetab.list"
- {gperf_offsetof(stringpool, 116), 1*3600},
-#line 77 "zonetab.list"
- {gperf_offsetof(stringpool, 117), 1*3600},
- {-1},
-#line 95 "zonetab.list"
- {gperf_offsetof(stringpool, 119), 7*3600},
-#line 313 "zonetab.list"
- {gperf_offsetof(stringpool, 120),43200},
-#line 55 "zonetab.list"
- {gperf_offsetof(stringpool, 121), -(3*3600+1800)},
-#line 184 "zonetab.list"
- {gperf_offsetof(stringpool, 122),31500},
-#line 204 "zonetab.list"
- {gperf_offsetof(stringpool, 123),45900},
-#line 210 "zonetab.list"
- {gperf_offsetof(stringpool, 124),-18000},
-#line 198 "zonetab.list"
- {gperf_offsetof(stringpool, 125),14400},
-#line 57 "zonetab.list"
- {gperf_offsetof(stringpool, 126), -4*3600},
-#line 197 "zonetab.list"
- {gperf_offsetof(stringpool, 127),18000},
-#line 54 "zonetab.list"
- {gperf_offsetof(stringpool, 128),-3*3600},
-#line 253 "zonetab.list"
- {gperf_offsetof(stringpool, 129),-30600},
-#line 91 "zonetab.list"
- {gperf_offsetof(stringpool, 130), 4*3600},
-#line 99 "zonetab.list"
- {gperf_offsetof(stringpool, 131), 9*3600},
-#line 122 "zonetab.list"
- {gperf_offsetof(stringpool, 132), 21600},
-#line 187 "zonetab.list"
- {gperf_offsetof(stringpool, 133),16200},
-#line 132 "zonetab.list"
- {gperf_offsetof(stringpool, 134), -10800},
-#line 121 "zonetab.list"
- {gperf_offsetof(stringpool, 135), -21600},
- {-1},
-#line 236 "zonetab.list"
- {gperf_offsetof(stringpool, 137),25200},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 274 "zonetab.list"
- {gperf_offsetof(stringpool, 143),36000},
-#line 266 "zonetab.list"
- {gperf_offsetof(stringpool, 144),43200},
-#line 146 "zonetab.list"
- {gperf_offsetof(stringpool, 145), -21600},
-#line 193 "zonetab.list"
- {gperf_offsetof(stringpool, 146),32400},
-#line 220 "zonetab.list"
- {gperf_offsetof(stringpool, 147),-3600},
-#line 214 "zonetab.list"
- {gperf_offsetof(stringpool, 148),25200},
-#line 219 "zonetab.list"
- {gperf_offsetof(stringpool, 149),0},
-#line 275 "zonetab.list"
- {gperf_offsetof(stringpool, 150),46800},
-#line 109 "zonetab.list"
- {gperf_offsetof(stringpool, 151), -32400},
- {-1}, {-1},
-#line 68 "zonetab.list"
- {gperf_offsetof(stringpool, 154), -11*3600},
- {-1}, {-1}, {-1},
-#line 321 "zonetab.list"
- {gperf_offsetof(stringpool, 158),0},
- {-1},
-#line 178 "zonetab.list"
- {gperf_offsetof(stringpool, 160), 18000},
-#line 181 "zonetab.list"
- {gperf_offsetof(stringpool, 161),37800},
-#line 265 "zonetab.list"
- {gperf_offsetof(stringpool, 162),20700},
-#line 249 "zonetab.list"
- {gperf_offsetof(stringpool, 163),37800},
-#line 108 "zonetab.list"
- {gperf_offsetof(stringpool, 164), 16200},
- {-1}, {-1},
-#line 30 "zonetab.list"
- {gperf_offsetof(stringpool, 167), 10*3600},
- {-1},
-#line 27 "zonetab.list"
- {gperf_offsetof(stringpool, 169), 7*3600},
-#line 239 "zonetab.list"
- {gperf_offsetof(stringpool, 170),16200},
-#line 206 "zonetab.list"
- {gperf_offsetof(stringpool, 171),28800},
-#line 205 "zonetab.list"
- {gperf_offsetof(stringpool, 172),32400},
-#line 12 "zonetab.list"
- {gperf_offsetof(stringpool, 173), 0*3600},
-#line 229 "zonetab.list"
- {gperf_offsetof(stringpool, 174),14400},
-#line 264 "zonetab.list"
- {gperf_offsetof(stringpool, 175),25200},
-#line 263 "zonetab.list"
- {gperf_offsetof(stringpool, 176),25200},
-#line 223 "zonetab.list"
- {gperf_offsetof(stringpool, 177),43200},
-#line 40 "zonetab.list"
- {gperf_offsetof(stringpool, 178), -8*3600},
-#line 222 "zonetab.list"
- {gperf_offsetof(stringpool, 179),46800},
- {-1},
-#line 282 "zonetab.list"
- {gperf_offsetof(stringpool, 181),-10800},
-#line 260 "zonetab.list"
- {gperf_offsetof(stringpool, 182),39600},
-#line 100 "zonetab.list"
- {gperf_offsetof(stringpool, 183), 9*3600},
-#line 244 "zonetab.list"
- {gperf_offsetof(stringpool, 184),39600},
-#line 102 "zonetab.list"
- {gperf_offsetof(stringpool, 185), 10*3600},
-#line 143 "zonetab.list"
- {gperf_offsetof(stringpool, 186), 12600},
-#line 129 "zonetab.list"
- {gperf_offsetof(stringpool, 187), 10800},
-#line 98 "zonetab.list"
- {gperf_offsetof(stringpool, 188), 8*3600},
-#line 39 "zonetab.list"
- {gperf_offsetof(stringpool, 189), -7*3600},
-#line 130 "zonetab.list"
- {gperf_offsetof(stringpool, 190), 36000},
-#line 38 "zonetab.list"
- {gperf_offsetof(stringpool, 191), -6*3600},
-#line 203 "zonetab.list"
- {gperf_offsetof(stringpool, 192),49500},
-#line 298 "zonetab.list"
- {gperf_offsetof(stringpool, 193),18000},
-#line 209 "zonetab.list"
- {gperf_offsetof(stringpool, 194),-14400},
-#line 191 "zonetab.list"
- {gperf_offsetof(stringpool, 195),-43200},
- {-1},
-#line 259 "zonetab.list"
- {gperf_offsetof(stringpool, 197),28800},
-#line 179 "zonetab.list"
- {gperf_offsetof(stringpool, 198), 36000},
-#line 257 "zonetab.list"
- {gperf_offsetof(stringpool, 199),14400},
-#line 319 "zonetab.list"
- {gperf_offsetof(stringpool, 200),32400},
-#line 84 "zonetab.list"
- {gperf_offsetof(stringpool, 201), 2*3600},
-#line 286 "zonetab.list"
- {gperf_offsetof(stringpool, 202),39600},
-#line 152 "zonetab.list"
- {gperf_offsetof(stringpool, 203), 43200},
-#line 300 "zonetab.list"
- {gperf_offsetof(stringpool, 204),46800},
-#line 127 "zonetab.list"
- {gperf_offsetof(stringpool, 205), 28800},
-#line 299 "zonetab.list"
- {gperf_offsetof(stringpool, 206),50400},
-#line 85 "zonetab.list"
- {gperf_offsetof(stringpool, 207), 2*3600},
- {-1},
-#line 142 "zonetab.list"
- {gperf_offsetof(stringpool, 209), 19800},
- {-1},
-#line 314 "zonetab.list"
- {gperf_offsetof(stringpool, 211),-10800},
-#line 288 "zonetab.list"
- {gperf_offsetof(stringpool, 212),39600},
- {-1},
-#line 196 "zonetab.list"
- {gperf_offsetof(stringpool, 214),-3600},
-#line 195 "zonetab.list"
- {gperf_offsetof(stringpool, 215),0},
-#line 293 "zonetab.list"
- {gperf_offsetof(stringpool, 216),-36000},
-#line 106 "zonetab.list"
- {gperf_offsetof(stringpool, 217), 12*3600},
-#line 128 "zonetab.list"
- {gperf_offsetof(stringpool, 218), -43200},
-#line 105 "zonetab.list"
- {gperf_offsetof(stringpool, 219),12*3600},
-#line 170 "zonetab.list"
- {gperf_offsetof(stringpool, 220), 32400},
-#line 125 "zonetab.list"
- {gperf_offsetof(stringpool, 221), 39600},
- {-1},
-#line 283 "zonetab.list"
- {gperf_offsetof(stringpool, 223),21600},
-#line 113 "zonetab.list"
- {gperf_offsetof(stringpool, 224), -14400},
-#line 262 "zonetab.list"
- {gperf_offsetof(stringpool, 225),39600},
- {-1},
-#line 11 "zonetab.list"
- {gperf_offsetof(stringpool, 227), 0*3600},
-#line 301 "zonetab.list"
- {gperf_offsetof(stringpool, 228),10800},
-#line 315 "zonetab.list"
- {gperf_offsetof(stringpool, 229),43200},
-#line 291 "zonetab.list"
- {gperf_offsetof(stringpool, 230),-10800},
-#line 20 "zonetab.list"
- {gperf_offsetof(stringpool, 231), -7*3600},
-#line 248 "zonetab.list"
- {gperf_offsetof(stringpool, 232),39600},
- {-1},
-#line 52 "zonetab.list"
- {gperf_offsetof(stringpool, 234), -3*3600},
-#line 14 "zonetab.list"
- {gperf_offsetof(stringpool, 235), -4*3600},
- {-1}, {-1},
-#line 277 "zonetab.list"
- {gperf_offsetof(stringpool, 238),18000},
-#line 188 "zonetab.list"
- {gperf_offsetof(stringpool, 239),21600},
-#line 320 "zonetab.list"
- {gperf_offsetof(stringpool, 240),28800},
- {-1},
-#line 317 "zonetab.list"
- {gperf_offsetof(stringpool, 242),-10800},
-#line 60 "zonetab.list"
- {gperf_offsetof(stringpool, 243),-9*3600},
-#line 316 "zonetab.list"
- {gperf_offsetof(stringpool, 244),-7200},
- {-1},
-#line 246 "zonetab.list"
- {gperf_offsetof(stringpool, 246),25200},
-#line 245 "zonetab.list"
- {gperf_offsetof(stringpool, 247),28800},
-#line 147 "zonetab.list"
- {gperf_offsetof(stringpool, 248), -7200},
-#line 18 "zonetab.list"
- {gperf_offsetof(stringpool, 249), -6*3600},
-#line 250 "zonetab.list"
- {gperf_offsetof(stringpool, 250),50400},
-#line 165 "zonetab.list"
- {gperf_offsetof(stringpool, 251), 28800},
-#line 16 "zonetab.list"
- {gperf_offsetof(stringpool, 252), -5*3600},
-#line 76 "zonetab.list"
- {gperf_offsetof(stringpool, 253), 1*3600},
- {-1},
-#line 164 "zonetab.list"
- {gperf_offsetof(stringpool, 255), 25200},
-#line 41 "zonetab.list"
- {gperf_offsetof(stringpool, 256), -9*3600},
- {-1},
-#line 171 "zonetab.list"
- {gperf_offsetof(stringpool, 258), 46800},
-#line 211 "zonetab.list"
- {gperf_offsetof(stringpool, 259),-36000},
- {-1},
-#line 308 "zonetab.list"
- {gperf_offsetof(stringpool, 261),-14400},
-#line 119 "zonetab.list"
- {gperf_offsetof(stringpool, 262), 14400},
-#line 123 "zonetab.list"
- {gperf_offsetof(stringpool, 263), 3600},
-#line 28 "zonetab.list"
- {gperf_offsetof(stringpool, 264), 8*3600},
-#line 124 "zonetab.list"
- {gperf_offsetof(stringpool, 265), 3600},
-#line 153 "zonetab.list"
- {gperf_offsetof(stringpool, 266), -12600},
-#line 110 "zonetab.list"
- {gperf_offsetof(stringpool, 267), 10800},
-#line 289 "zonetab.list"
- {gperf_offsetof(stringpool, 268),14400},
-#line 112 "zonetab.list"
- {gperf_offsetof(stringpool, 269), 10800},
-#line 111 "zonetab.list"
- {gperf_offsetof(stringpool, 270), 14400},
-#line 216 "zonetab.list"
- {gperf_offsetof(stringpool, 271),36000},
- {-1},
-#line 311 "zonetab.list"
- {gperf_offsetof(stringpool, 273),21600},
-#line 66 "zonetab.list"
- {gperf_offsetof(stringpool, 274),-10*3600},
-#line 151 "zonetab.list"
- {gperf_offsetof(stringpool, 275), 20700},
-#line 267 "zonetab.list"
- {gperf_offsetof(stringpool, 276),-39600},
-#line 225 "zonetab.list"
- {gperf_offsetof(stringpool, 277),-14400},
- {-1},
-#line 224 "zonetab.list"
- {gperf_offsetof(stringpool, 279),-10800},
-#line 67 "zonetab.list"
- {gperf_offsetof(stringpool, 280),-10*3600},
-#line 237 "zonetab.list"
- {gperf_offsetof(stringpool, 281),10800},
- {-1}, {-1},
-#line 297 "zonetab.list"
- {gperf_offsetof(stringpool, 284),32400},
-#line 175 "zonetab.list"
- {gperf_offsetof(stringpool, 285), 28800},
-#line 134 "zonetab.list"
- {gperf_offsetof(stringpool, 286), 7200},
-#line 149 "zonetab.list"
- {gperf_offsetof(stringpool, 287), 23400},
-#line 107 "zonetab.list"
- {gperf_offsetof(stringpool, 288),13*3600},
-#line 230 "zonetab.list"
- {gperf_offsetof(stringpool, 289),-10800},
-#line 307 "zonetab.list"
- {gperf_offsetof(stringpool, 290),18000},
- {-1}, {-1},
-#line 155 "zonetab.list"
- {gperf_offsetof(stringpool, 293), 25200},
-#line 258 "zonetab.list"
- {gperf_offsetof(stringpool, 294),18000},
-#line 227 "zonetab.list"
- {gperf_offsetof(stringpool, 295),-21600},
-#line 261 "zonetab.list"
- {gperf_offsetof(stringpool, 296),43200},
-#line 213 "zonetab.list"
- {gperf_offsetof(stringpool, 297),-3600},
-#line 154 "zonetab.list"
- {gperf_offsetof(stringpool, 298), 28800},
- {-1},
-#line 243 "zonetab.list"
- {gperf_offsetof(stringpool, 300),21600},
-#line 114 "zonetab.list"
- {gperf_offsetof(stringpool, 301), 34200},
-#line 157 "zonetab.list"
- {gperf_offsetof(stringpool, 302), -28800},
- {-1},
-#line 117 "zonetab.list"
- {gperf_offsetof(stringpool, 304), -21600},
- {-1},
-#line 156 "zonetab.list"
- {gperf_offsetof(stringpool, 306), -14400},
-#line 116 "zonetab.list"
- {gperf_offsetof(stringpool, 307), -3600},
-#line 228 "zonetab.list"
- {gperf_offsetof(stringpool, 308),-32400},
-#line 294 "zonetab.list"
- {gperf_offsetof(stringpool, 309),18000},
-#line 37 "zonetab.list"
- {gperf_offsetof(stringpool, 310), -5*3600},
-#line 137 "zonetab.list"
- {gperf_offsetof(stringpool, 311), 7200},
-#line 58 "zonetab.list"
- {gperf_offsetof(stringpool, 312),-8*3600},
-#line 304 "zonetab.list"
- {gperf_offsetof(stringpool, 313),28800},
-#line 303 "zonetab.list"
- {gperf_offsetof(stringpool, 314),32400},
-#line 284 "zonetab.list"
- {gperf_offsetof(stringpool, 315),14400},
- {-1},
-#line 295 "zonetab.list"
- {gperf_offsetof(stringpool, 317),18000},
- {-1},
-#line 166 "zonetab.list"
- {gperf_offsetof(stringpool, 319), 7200},
- {-1}, {-1}, {-1}, {-1},
-#line 97 "zonetab.list"
- {gperf_offsetof(stringpool, 324), 8*3600},
- {-1},
-#line 50 "zonetab.list"
- {gperf_offsetof(stringpool, 326), -(2*3600+1800)},
-#line 285 "zonetab.list"
- {gperf_offsetof(stringpool, 327),-10800},
- {-1}, {-1},
-#line 287 "zonetab.list"
- {gperf_offsetof(stringpool, 330),14400},
- {-1},
-#line 169 "zonetab.list"
- {gperf_offsetof(stringpool, 332), 36000},
- {-1},
-#line 235 "zonetab.list"
- {gperf_offsetof(stringpool, 334),25200},
-#line 234 "zonetab.list"
- {gperf_offsetof(stringpool, 335),28800},
- {-1}, {-1},
-#line 232 "zonetab.list"
- {gperf_offsetof(stringpool, 338),-14400},
- {-1}, {-1}, {-1},
-#line 44 "zonetab.list"
- {gperf_offsetof(stringpool, 342), -12*3600},
-#line 61 "zonetab.list"
- {gperf_offsetof(stringpool, 343),-9*3600},
-#line 162 "zonetab.list"
- {gperf_offsetof(stringpool, 344), -14400},
-#line 141 "zonetab.list"
- {gperf_offsetof(stringpool, 345), -36000},
- {-1},
-#line 306 "zonetab.list"
- {gperf_offsetof(stringpool, 347),-10800},
- {-1},
-#line 305 "zonetab.list"
- {gperf_offsetof(stringpool, 349),-7200},
-#line 326 "zonetab.list"
- {gperf_offsetof(stringpool, 350),18000},
-#line 325 "zonetab.list"
- {gperf_offsetof(stringpool, 351),21600},
-#line 247 "zonetab.list"
- {gperf_offsetof(stringpool, 352),14400},
-#line 323 "zonetab.list"
- {gperf_offsetof(stringpool, 353),32400},
-#line 322 "zonetab.list"
- {gperf_offsetof(stringpool, 354),36000},
- {-1}, {-1}, {-1},
-#line 63 "zonetab.list"
- {gperf_offsetof(stringpool, 358), -9*3600},
-#line 144 "zonetab.list"
- {gperf_offsetof(stringpool, 359), 7200},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 167 "zonetab.list"
- {gperf_offsetof(stringpool, 365), 21600},
- {-1},
-#line 180 "zonetab.list"
- {gperf_offsetof(stringpool, 367), 32400},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 318 "zonetab.list"
- {gperf_offsetof(stringpool, 375),25200},
- {-1},
-#line 115 "zonetab.list"
- {gperf_offsetof(stringpool, 377), 36000},
-#line 231 "zonetab.list"
- {gperf_offsetof(stringpool, 378),43200},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 173 "zonetab.list"
- {gperf_offsetof(stringpool, 387), -25200},
- {-1}, {-1}, {-1},
-#line 310 "zonetab.list"
- {gperf_offsetof(stringpool, 391),36000},
-#line 309 "zonetab.list"
- {gperf_offsetof(stringpool, 392),39600},
- {-1}, {-1},
-#line 140 "zonetab.list"
- {gperf_offsetof(stringpool, 395), 7200},
- {-1}, {-1},
-#line 168 "zonetab.list"
- {gperf_offsetof(stringpool, 398), 28800},
-#line 290 "zonetab.list"
- {gperf_offsetof(stringpool, 399),39600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 118 "zonetab.list"
- {gperf_offsetof(stringpool, 408), -3600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 296 "zonetab.list"
- {gperf_offsetof(stringpool, 417),46800},
-#line 163 "zonetab.list"
- {gperf_offsetof(stringpool, 418), -39600},
- {-1}, {-1},
-#line 161 "zonetab.list"
- {gperf_offsetof(stringpool, 421), -18000},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 312 "zonetab.list"
- {gperf_offsetof(stringpool, 427),39600},
-#line 69 "zonetab.list"
- {gperf_offsetof(stringpool, 428),-12*3600},
- {-1}, {-1}, {-1},
-#line 136 "zonetab.list"
- {gperf_offsetof(stringpool, 432), 43200},
- {-1}, {-1},
-#line 46 "zonetab.list"
- {gperf_offsetof(stringpool, 435), 0*3600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 145 "zonetab.list"
- {gperf_offsetof(stringpool, 443), 32400},
- {-1},
-#line 131 "zonetab.list"
- {gperf_offsetof(stringpool, 445), 7200},
- {-1}, {-1}, {-1},
-#line 292 "zonetab.list"
- {gperf_offsetof(stringpool, 449),10800},
- {-1}, {-1},
-#line 150 "zonetab.list"
- {gperf_offsetof(stringpool, 452), 21600},
- {-1}, {-1},
-#line 302 "zonetab.list"
- {gperf_offsetof(stringpool, 455),43200},
- {-1}, {-1},
-#line 176 "zonetab.list"
- {gperf_offsetof(stringpool, 458), 3600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 135 "zonetab.list"
- {gperf_offsetof(stringpool, 466), 18000},
- {-1},
-#line 174 "zonetab.list"
- {gperf_offsetof(stringpool, 468), 36000},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 324 "zonetab.list"
- {gperf_offsetof(stringpool, 476),36000},
-#line 172 "zonetab.list"
- {gperf_offsetof(stringpool, 477), -18000},
- {-1}, {-1}, {-1}, {-1},
-#line 160 "zonetab.list"
- {gperf_offsetof(stringpool, 482), -10800},
- {-1}, {-1},
-#line 62 "zonetab.list"
- {gperf_offsetof(stringpool, 485), -9*3600},
-#line 159 "zonetab.list"
- {gperf_offsetof(stringpool, 486), 10800},
- {-1}, {-1}, {-1}, {-1}, {-1},
-#line 233 "zonetab.list"
- {gperf_offsetof(stringpool, 492),28800},
- {-1}, {-1}, {-1}, {-1},
-#line 158 "zonetab.list"
- {gperf_offsetof(stringpool, 497), 3600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-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 177 "zonetab.list"
- {gperf_offsetof(stringpool, 540), 3600},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
- {-1}, {-1}, {-1}, {-1},
-#line 59 "zonetab.list"
- {gperf_offsetof(stringpool, 563), -8*3600},
- {-1}, {-1},
-#line 104 "zonetab.list"
- {gperf_offsetof(stringpool, 566),12*3600},
-#line 139 "zonetab.list"
- {gperf_offsetof(stringpool, 567), 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},
-#line 138 "zonetab.list"
- {gperf_offsetof(stringpool, 619), -10800}
- };
-
- 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 ((((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strncmp (str, s, len) && s[len] == '\0')
- return &wordlist[key];
- }
- }
- }
- return 0;
-}
-#line 327 "zonetab.list"
-
diff --git a/ext/date/zonetab.list b/ext/date/zonetab.list
deleted file mode 100644
index 0618546eb0..0000000000
--- a/ext/date/zonetab.list
+++ /dev/null
@@ -1,327 +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
-acdt,37800
-acst,34200
-act,-18000
-acwst,31500
-aedt,39600
-aest,36000
-aft,16200
-almt,21600
-anast,43200
-anat,43200
-aoe,-43200
-aqtt,18000
-awdt,32400
-awst,28800
-azost,0
-azot,-3600
-azst,18000
-azt,14400
-bnt,28800
-bot,-14400
-btt,21600
-cast,28800
-chadt,49500
-chast,45900
-chost,32400
-chot,28800
-chst,36000
-chut,36000
-cidst,-14400
-cist,-18000
-ckt,-36000
-cot,-18000
-cvt,-3600
-cxt,25200
-davt,25200
-ddut,36000
-easst,-18000
-ect,-18000
-egst,0
-egt,-3600
-fet,10800
-fjst,46800
-fjt,43200
-fkst,-10800
-fkt,-14400
-fnt,-7200
-galt,-21600
-gamt,-32400
-get,14400
-gft,-10800
-gilt,43200
-gyt,-14400
-hkt,28800
-hovst,28800
-hovt,25200
-ict,25200
-idt,10800
-iot,21600
-irdt,16200
-irkst,32400
-irkt,28800
-irst,12600
-kgt,21600
-kost,39600
-krast,28800
-krat,25200
-kuyt,14400
-lhdt,39600
-lhst,37800
-lint,50400
-magst,43200
-magt,39600
-mart,-30600
-mawt,18000
-mht,43200
-mmt,23400
-mut,14400
-mvt,18000
-myt,28800
-nct,39600
-nfdt,43200
-nft,39600
-novst,25200
-novt,25200
-npt,20700
-nrt,43200
-nut,-39600
-omsst,25200
-omst,21600
-orat,18000
-pet,-18000
-petst,43200
-pett,43200
-pgt,36000
-phot,46800
-pht,28800
-pkt,18000
-pmdt,-7200
-pmst,-10800
-pont,39600
-pwt,32400
-pyst,-10800
-qyzt,21600
-ret,14400
-rott,-10800
-sakt,39600
-samt,14400
-sbt,39600
-sct,14400
-sret,39600
-srt,-10800
-syot,10800
-taht,-36000
-tft,18000
-tjt,18000
-tkt,46800
-tlt,32400
-tmt,18000
-tost,50400
-tot,46800
-trt,10800
-tvt,43200
-ulast,32400
-ulat,28800
-uyst,-7200
-uyt,-10800
-uzt,18000
-vet,-14400
-vlast,39600
-vlat,36000
-vost,21600
-vut,39600
-wakt,43200
-warst,-10800
-wft,43200
-wgst,-7200
-wgt,-10800
-wib,25200
-wit,32400
-wita,28800
-wt,0
-yakst,36000
-yakt,32400
-yapt,36000
-yekst,21600
-yekt,18000
-%%
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index bc1d527735..c90fe71fce 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))
@@ -39,8 +39,6 @@ struct dbmdata {
DBM *di_dbm;
};
-NORETURN(static void closed_dbm(void));
-
static void
closed_dbm(void)
{
@@ -49,6 +47,7 @@ closed_dbm(void)
#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)
@@ -61,18 +60,21 @@ static void
free_dbm(void *ptr)
{
struct dbmdata *dbmp = ptr;
- if (dbmp->di_dbm)
- dbm_close(dbmp->di_dbm);
- xfree(dbmp);
+ if (dbmp) {
+ if (dbmp->di_dbm) dbm_close(dbmp->di_dbm);
+ xfree(dbmp);
+ }
}
static size_t
memsize_dbm(const void *ptr)
{
+ size_t size = 0;
const struct dbmdata *dbmp = ptr;
- size_t size = sizeof(*dbmp);
- if (dbmp->di_dbm)
- size += DBM_SIZEOF_DBM;
+ if (dbmp) {
+ size += sizeof(*dbmp);
+ if (dbmp->di_dbm) size += DBM_SIZEOF_DBM;
+ }
return size;
}
@@ -113,6 +115,8 @@ fdbm_closed(VALUE obj)
struct dbmdata *dbmp;
TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
+ if (dbmp == 0)
+ return Qtrue;
if (dbmp->di_dbm == 0)
return Qtrue;
@@ -122,9 +126,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 TypedData_Wrap_Struct(klass, &dbm_type, 0);
}
/*
@@ -143,12 +145,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 */
}
@@ -190,24 +192,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
@@ -216,8 +218,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
}
@@ -227,8 +229,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;
@@ -279,11 +281,12 @@ fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
not_found:
if (NIL_P(ifnone) && rb_block_given_p()) {
keystr = rb_str_dup(keystr);
+ OBJ_TAINT(keystr);
return rb_yield(keystr);
}
return ifnone;
}
- return rb_str_new(value.dptr, value.dsize);
+ return rb_tainted_str_new(value.dptr, value.dsize);
}
/*
@@ -337,13 +340,15 @@ 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)) {
val = dbm_fetch(dbm, key);
if ((long)val.dsize == RSTRING_LEN(valstr) &&
memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0) {
- return rb_str_new(key.dptr, key.dsize);
+ return rb_tainted_str_new(key.dptr, key.dsize);
}
}
return Qnil;
@@ -376,8 +381,8 @@ fdbm_select(VALUE obj)
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
VALUE assoc, v;
val = dbm_fetch(dbm, key);
- assoc = rb_assoc_new(rb_str_new(key.dptr, key.dsize),
- rb_str_new(val.dptr, val.dsize));
+ assoc = rb_assoc_new(rb_tainted_str_new(key.dptr, key.dsize),
+ rb_tainted_str_new(val.dptr, val.dsize));
v = rb_yield(assoc);
if (RTEST(v)) {
rb_ary_push(new, assoc);
@@ -445,7 +450,7 @@ fdbm_delete(VALUE obj, VALUE keystr)
}
/* need to save value before dbm_delete() */
- valstr = rb_str_new(value.dptr, value.dsize);
+ valstr = rb_tainted_str_new(value.dptr, value.dsize);
if (dbm_delete(dbm, key)) {
dbmp->di_size = -1;
@@ -480,8 +485,8 @@ fdbm_shift(VALUE obj)
key = dbm_firstkey(dbm);
if (!key.dptr) return Qnil;
val = dbm_fetch(dbm, key);
- keystr = rb_str_new(key.dptr, key.dsize);
- valstr = rb_str_new(val.dptr, val.dsize);
+ keystr = rb_tainted_str_new(key.dptr, key.dsize);
+ valstr = rb_tainted_str_new(val.dptr, val.dsize);
dbm_delete(dbm, key);
return rb_assoc_new(keystr, valstr);
@@ -503,8 +508,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);
@@ -513,9 +518,9 @@ fdbm_delete_if(VALUE obj)
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- keystr = rb_str_new(key.dptr, key.dsize);
+ keystr = rb_tainted_str_new(key.dptr, key.dsize);
OBJ_FREEZE(keystr);
- valstr = rb_str_new(val.dptr, val.dsize);
+ valstr = rb_tainted_str_new(val.dptr, val.dsize);
ret = rb_protect(rb_yield, rb_assoc_new(rb_str_dup(keystr), valstr), &status);
if (status != 0) break;
if (RTEST(ret)) rb_ary_push(ary, keystr);
@@ -523,7 +528,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)) {
@@ -582,8 +587,8 @@ fdbm_invert(VALUE obj)
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- keystr = rb_str_new(key.dptr, key.dsize);
- valstr = rb_str_new(val.dptr, val.dsize);
+ keystr = rb_tainted_str_new(key.dptr, key.dsize);
+ valstr = rb_tainted_str_new(val.dptr, val.dsize);
rb_hash_aset(hash, valstr, keystr);
}
return hash;
@@ -594,13 +599,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;
}
@@ -743,7 +746,7 @@ fdbm_each_value(VALUE obj)
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- rb_yield(rb_str_new(val.dptr, val.dsize));
+ rb_yield(rb_tainted_str_new(val.dptr, val.dsize));
GetDBM2(obj, dbmp, dbm);
}
return obj;
@@ -766,7 +769,7 @@ fdbm_each_key(VALUE obj)
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
- rb_yield(rb_str_new(key.dptr, key.dsize));
+ rb_yield(rb_tainted_str_new(key.dptr, key.dsize));
GetDBM2(obj, dbmp, dbm);
}
return obj;
@@ -793,8 +796,8 @@ fdbm_each_pair(VALUE obj)
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- keystr = rb_str_new(key.dptr, key.dsize);
- valstr = rb_str_new(val.dptr, val.dsize);
+ keystr = rb_tainted_str_new(key.dptr, key.dsize);
+ valstr = rb_tainted_str_new(val.dptr, val.dsize);
rb_yield(rb_assoc_new(keystr, valstr));
GetDBM2(obj, dbmp, dbm);
}
@@ -820,7 +823,7 @@ fdbm_keys(VALUE obj)
ary = rb_ary_new();
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
- rb_ary_push(ary, rb_str_new(key.dptr, key.dsize));
+ rb_ary_push(ary, rb_tainted_str_new(key.dptr, key.dsize));
}
return ary;
@@ -844,7 +847,7 @@ fdbm_values(VALUE obj)
ary = rb_ary_new();
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- rb_ary_push(ary, rb_str_new(val.dptr, val.dsize));
+ rb_ary_push(ary, rb_tainted_str_new(val.dptr, val.dsize));
}
return ary;
@@ -930,8 +933,8 @@ fdbm_to_a(VALUE obj)
ary = rb_ary_new();
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- rb_ary_push(ary, rb_assoc_new(rb_str_new(key.dptr, key.dsize),
- rb_str_new(val.dptr, val.dsize)));
+ rb_ary_push(ary, rb_assoc_new(rb_tainted_str_new(key.dptr, key.dsize),
+ rb_tainted_str_new(val.dptr, val.dsize)));
}
return ary;
@@ -956,8 +959,8 @@ fdbm_to_hash(VALUE obj)
hash = rb_hash_new();
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- rb_hash_aset(hash, rb_str_new(key.dptr, key.dsize),
- rb_str_new(val.dptr, val.dsize));
+ rb_hash_aset(hash, rb_tainted_str_new(key.dptr, key.dsize),
+ rb_tainted_str_new(val.dptr, val.dsize));
}
return hash;
@@ -993,7 +996,7 @@ fdbm_reject(VALUE obj)
* It is based on dbm library in Unix Version 7 but has different API to
* support multiple databases in a process.
* - {Berkeley DB}[http://en.wikipedia.org/wiki/Berkeley_DB] versions
- * 1 thru 6, also known as BDB and Sleepycat DB, now owned by Oracle
+ * 1 thru 5, also known as BDB and Sleepycat DB, now owned by Oracle
* Corporation.
* - Berkeley DB 1.x, still found in 4.4BSD derivatives (FreeBSD, OpenBSD, etc).
* - {gdbm}[http://www.gnu.org/software/gdbm/], the GNU implementation of dbm.
@@ -1031,7 +1034,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 9de425b521..0000000000
--- a/ext/dbm/dbm.gemspec
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-Gem::Specification.new do |s|
- s.name = "dbm"
- s.version = '1.1.0'
- 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 192527a8eb..0000000000
--- a/ext/dbm/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-dbm.o: $(RUBY_EXTCONF_H)
-dbm.o: $(arch_hdrdir)/ruby/config.h
-dbm.o: $(hdrdir)/ruby.h
-dbm.o: $(hdrdir)/ruby/assert.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: dbm.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index c9a5518bf6..2c8caa398e 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
#
@@ -7,7 +6,6 @@
# db Berkeley DB (libdb)
# db2 Berkeley DB (libdb2)
# db1 Berkeley DB (libdb1)
-# db6 Berkeley DB (libdb6)
# db5 Berkeley DB (libdb5)
# db4 Berkeley DB (libdb4)
# db3 Berkeley DB (libdb3)
@@ -24,7 +22,7 @@ dir_config("dbm")
if dblib = with_config("dbm-type", nil)
dblib = dblib.split(/[ ,]+/)
else
- dblib = %w(libc db db2 db1 db6 db5 db4 db3 gdbm_compat gdbm qdbm)
+ dblib = %w(libc db db2 db1 db5 db4 db3 gdbm_compat gdbm qdbm)
end
headers = {
@@ -35,7 +33,6 @@ headers = {
"db3" => ["db3/db.h", "db3.h", "db.h"],
"db4" => ["db4/db.h", "db4.h", "db.h"],
"db5" => ["db5/db.h", "db5.h", "db.h"],
- "db6" => ["db6/db.h", "db6.h", "db.h"],
"gdbm_compat" => ["gdbm-ndbm.h", "gdbm/ndbm.h", "ndbm.h"], # GDBM since 1.8.1
"gdbm" => ["gdbm-ndbm.h", "gdbm/ndbm.h", "ndbm.h"], # GDBM until 1.8.0
"qdbm" => ["qdbm/relic.h", "relic.h"],
@@ -133,7 +130,7 @@ def headers.db_check2(db, hdr)
hsearch = nil
case db
- when /^db[2-6]?$/
+ when /^db[2-5]?$/
hsearch = "-DDB_DBM_HSEARCH"
when "gdbm_compat"
have_library("gdbm") or return false
diff --git a/ext/digest/bubblebabble/bubblebabble.c b/ext/digest/bubblebabble/bubblebabble.c
index 6557e43c9d..4b8263de5a 100644
--- a/ext/digest/bubblebabble/bubblebabble.c
+++ b/ext/digest/bubblebabble/bubblebabble.c
@@ -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
@@ -124,7 +124,6 @@ rb_digest_instance_bubblebabble(VALUE self)
void
Init_bubblebabble(void)
{
-#undef rb_intern
VALUE rb_mDigest, rb_mDigest_Instance, rb_cDigest_Class;
rb_require("digest");
diff --git a/ext/digest/bubblebabble/depend b/ext/digest/bubblebabble/depend
index e7e2a8889d..59c6d0ce74 100644
--- a/ext/digest/bubblebabble/depend
+++ b/ext/digest/bubblebabble/depend
@@ -1,15 +1,13 @@
# AUTOGENERATED DEPENDENCIES START
bubblebabble.o: $(RUBY_EXTCONF_H)
bubblebabble.o: $(arch_hdrdir)/ruby/config.h
-bubblebabble.o: $(hdrdir)/ruby.h
-bubblebabble.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../digest.h
+bubblebabble.o: $(top_srcdir)/ext/digest/digest.h
+bubblebabble.o: $(top_srcdir)/include/ruby.h
bubblebabble.o: bubblebabble.c
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/bubblebabble/extconf.rb b/ext/digest/bubblebabble/extconf.rb
index 21feed57fb..1214add293 100644
--- a/ext/digest/bubblebabble/extconf.rb
+++ b/ext/digest/bubblebabble/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
$defs << "-DHAVE_CONFIG_H"
diff --git a/ext/digest/depend b/ext/digest/depend
index 87c39c8b8d..dbc2bba3cc 100644
--- a/ext/digest/depend
+++ b/ext/digest/depend
@@ -1,15 +1,13 @@
# AUTOGENERATED DEPENDENCIES START
digest.o: $(RUBY_EXTCONF_H)
digest.o: $(arch_hdrdir)/ruby/config.h
-digest.o: $(hdrdir)/ruby.h
-digest.o: $(hdrdir)/ruby/assert.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
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index a59f880ac7..ed96c2f274 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,22 +518,10 @@ get_digest_base_metadata(VALUE klass)
if (NIL_P(p))
rb_raise(rb_eRuntimeError, "Digest::Base cannot be directly inherited in Ruby");
- if (!RB_TYPE_P(obj, T_DATA) || RTYPEDDATA_P(obj)) {
- wrong:
- if (p == klass)
- rb_raise(rb_eTypeError, "%"PRIsVALUE"::metadata is not initialized properly",
- klass);
- else
- rb_raise(rb_eTypeError, "%"PRIsVALUE"(%"PRIsVALUE")::metadata is not initialized properly",
- klass, p);
- }
-
#undef RUBY_UNTYPED_DATA_WARNING
#define RUBY_UNTYPED_DATA_WARNING 0
Data_Get_Struct(obj, rb_digest_metadata_t, algo);
- if (!algo) goto wrong;
-
switch (algo->api_version) {
case 3:
break;
@@ -585,12 +537,6 @@ get_digest_base_metadata(VALUE klass)
return algo;
}
-static rb_digest_metadata_t *
-get_digest_obj_metadata(VALUE obj)
-{
- return get_digest_base_metadata(rb_obj_class(obj));
-}
-
static const rb_data_type_t digest_type = {
"digest",
{0, RUBY_TYPED_DEFAULT_FREE, 0,},
@@ -619,10 +565,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 = TypedData_Wrap_Struct(klass, &digest_type, pctx);
+
return obj;
}
@@ -637,8 +584,8 @@ rb_digest_base_copy(VALUE copy, VALUE obj)
rb_check_frozen(copy);
- algo = get_digest_obj_metadata(copy);
- if (algo != get_digest_obj_metadata(obj))
+ 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);
@@ -648,18 +595,14 @@ rb_digest_base_copy(VALUE copy, VALUE obj)
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)
{
rb_digest_metadata_t *algo;
void *pctx;
- algo = get_digest_obj_metadata(self);
+ algo = get_digest_base_metadata(rb_obj_class(self));
TypedData_Get_Struct(self, void, &digest_type, pctx);
@@ -668,26 +611,19 @@ rb_digest_base_reset(VALUE self)
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)
{
rb_digest_metadata_t *algo;
void *pctx;
- algo = get_digest_obj_metadata(self);
+ algo = get_digest_base_metadata(rb_obj_class(self));
TypedData_Get_Struct(self, void, &digest_type, pctx);
StringValue(str);
algo->update_func(pctx, (unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str));
- RB_GC_GUARD(str);
return self;
}
@@ -700,7 +636,7 @@ rb_digest_base_finish(VALUE self)
void *pctx;
VALUE str;
- algo = get_digest_obj_metadata(self);
+ algo = get_digest_base_metadata(rb_obj_class(self));
TypedData_Get_Struct(self, void, &digest_type, pctx);
@@ -713,32 +649,24 @@ 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)
{
rb_digest_metadata_t *algo;
- algo = get_digest_obj_metadata(self);
+ algo = get_digest_base_metadata(rb_obj_class(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)
{
rb_digest_metadata_t *algo;
- algo = get_digest_obj_metadata(self);
+ algo = get_digest_base_metadata(rb_obj_class(self));
return INT2NUM(algo->block_len);
}
@@ -746,20 +674,13 @@ rb_digest_base_block_length(VALUE self)
void
Init_digest(void)
{
-#undef rb_intern
id_reset = rb_intern("reset");
id_update = rb_intern("update");
id_finish = rb_intern("finish");
id_digest = rb_intern("digest");
id_hexdigest = rb_intern("hexdigest");
id_digest_length = rb_intern("digest_length");
- id_metadata = rb_id_metadata();
- InitVM(digest);
-}
-void
-InitVM_digest(void)
-{
/*
* module Digest
*/
@@ -806,6 +727,8 @@ InitVM_digest(void)
rb_define_singleton_method(rb_cDigest_Class, "digest", rb_digest_class_s_digest, -1);
rb_define_singleton_method(rb_cDigest_Class, "hexdigest", rb_digest_class_s_hexdigest, -1);
+ id_metadata = rb_intern("metadata");
+
/* class Digest::Base < Digest::Class */
rb_cDigest_Base = rb_define_class_under(rb_mDigest, "Base", rb_cDigest_Class);
diff --git a/ext/digest/digest.h b/ext/digest/digest.h
index 4b6954089f..85848d5682 100644
--- a/ext/digest/digest.h
+++ b/ext/digest/digest.h
@@ -30,35 +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); \
-}
-
-static inline VALUE
-rb_digest_namespace(void)
-{
- rb_require("digest");
- return rb_path2class("Digest");
-}
-
-static inline ID
-rb_id_metadata(void)
-{
- return rb_intern_const("metadata");
-}
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..ef43c46ac3 100644
--- a/ext/digest/lib/digest.rb
+++ b/ext/digest/lib/digest.rb
@@ -1,9 +1,8 @@
-# frozen_string_literal: false
require 'digest.so'
module Digest
# A mutex for Digest().
- REQUIRE_MUTEX = Thread::Mutex.new
+ REQUIRE_MUTEX = Mutex.new
def self.const_missing(name) # :nodoc:
case name
diff --git a/ext/digest/md5/depend b/ext/digest/md5/depend
index abfd8de6a5..288c30aa15 100644
--- a/ext/digest/md5/depend
+++ b/ext/digest/md5/depend
@@ -1,19 +1,18 @@
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.h
-md5init.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../digest.h
+md5init.o: $(top_srcdir)/ext/digest/digest.h
+md5init.o: $(top_srcdir)/include/ruby.h
md5init.o: md5init.c
md5init.o: md5ossl.h
+md5ossl.o: md5ossl.c
+md5ossl.o: md5ossl.h
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb
index dead9a228b..a4e30d5356 100644
--- a/ext/digest/md5/extconf.rb
+++ b/ext/digest/md5/extconf.rb
@@ -1,16 +1,23 @@
# -*- 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"
$objs = [ "md5init.#{$OBJEXT}" ]
-digest_conf("md5")
+if !with_config("bundled-md5") &&
+ (dir_config("openssl")
+ pkg_config("openssl")
+ require File.expand_path('../../../openssl/deprecation', __FILE__)
+ 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/md5cc.h b/ext/digest/md5/md5cc.h
deleted file mode 100644
index e34d7d5c11..0000000000
--- a/ext/digest/md5/md5cc.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#define COMMON_DIGEST_FOR_OPENSSL 1
-#include <CommonCrypto/CommonDigest.h>
-
-#ifdef __clang__
-# pragma clang diagnostic ignored "-Wdeprecated-declarations"
-/* Suppress deprecation warnings of MD5 from Xcode 11.1 */
-/* Although we know MD5 is deprecated too, provide just for backward
- * compatibility, as well as Apple does. */
-#endif
-
-#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 dafd38a29c..cda31c6af1 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -3,10 +3,8 @@
#include <ruby/ruby.h>
#include "../digest.h"
-#if defined(MD5_USE_OPENSSL)
+#if defined(HAVE_OPENSSL_MD5_H)
#include "md5ossl.h"
-#elif defined(MD5_USE_COMMONDIGEST)
-#include "md5cc.h"
#else
#include "md5.h"
#endif
@@ -22,45 +20,27 @@ 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)
{
VALUE mDigest, cDigest_Base, cDigest_MD5;
+ rb_require("digest");
+
#if 0
mDigest = rb_define_module("Digest"); /* let rdoc know */
#endif
- mDigest = rb_digest_namespace();
+ mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
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(0, 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 07c406a7d2..49cf2afc6f 100644
--- a/ext/digest/rmd160/depend
+++ b/ext/digest/rmd160/depend
@@ -1,19 +1,28 @@
-rmd160.o: rmd160.c rmd160.h $(srcdir)/../defs.h
-rmd160init.o: $(LOCAL_HDRS)
+rmd160.o: rmd160.c rmd160.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
# AUTOGENERATED DEPENDENCIES START
rmd160init.o: $(RUBY_EXTCONF_H)
rmd160init.o: $(arch_hdrdir)/ruby/config.h
-rmd160init.o: $(hdrdir)/ruby.h
-rmd160init.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../digest.h
+rmd160init.o: $(top_srcdir)/ext/digest/digest.h
+rmd160init.o: $(top_srcdir)/include/ruby.h
rmd160init.o: rmd160init.c
rmd160init.o: rmd160ossl.h
+rmd160ossl.o: $(RUBY_EXTCONF_H)
+rmd160ossl.o: $(arch_hdrdir)/ruby/config.h
+rmd160ossl.o: $(hdrdir)/ruby/defines.h
+rmd160ossl.o: $(hdrdir)/ruby/intern.h
+rmd160ossl.o: $(hdrdir)/ruby/missing.h
+rmd160ossl.o: $(hdrdir)/ruby/ruby.h
+rmd160ossl.o: $(hdrdir)/ruby/st.h
+rmd160ossl.o: $(hdrdir)/ruby/subst.h
+rmd160ossl.o: $(top_srcdir)/ext/digest/defs.h
+rmd160ossl.o: $(top_srcdir)/include/ruby.h
+rmd160ossl.o: rmd160ossl.c
+rmd160ossl.o: rmd160ossl.h
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb
index a02ba56169..5081cea897 100644
--- a/ext/digest/rmd160/extconf.rb
+++ b/ext/digest/rmd160/extconf.rb
@@ -1,16 +1,23 @@
# -*- 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"
$objs = [ "rmd160init.#{$OBJEXT}" ]
-digest_conf("rmd160", "ripemd", "RIPEMD160")
+if !with_config("bundled-rmd160") &&
+ (dir_config("openssl")
+ pkg_config("openssl")
+ require File.expand_path('../../../openssl/deprecation', __FILE__)
+ have_library("crypto")) &&
+ OpenSSL.check_func("RIPEMD160_Transform", "openssl/ripemd.h")
+ $objs << "rmd160ossl.#{$OBJEXT}"
+else
+ $objs << "rmd160.#{$OBJEXT}"
+end
have_header("sys/cdefs.h")
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index a2c0a023c0..3ab3a4826a 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -3,7 +3,7 @@
#include <ruby/ruby.h>
#include "../digest.h"
-#if defined(RMD160_USE_OPENSSL)
+#if defined(HAVE_OPENSSL_RIPEMD_H)
#include "rmd160ossl.h"
#else
#include "rmd160.h"
@@ -20,45 +20,27 @@ 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)
{
VALUE mDigest, cDigest_Base, cDigest_RMD160;
+ rb_require("digest");
+
#if 0
mDigest = rb_define_module("Digest"); /* let rdoc know */
#endif
- mDigest = rb_digest_namespace();
+ mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
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(0, 0, 0, (void *)&rmd160));
}
diff --git a/ext/digest/rmd160/rmd160ossl.c b/ext/digest/rmd160/rmd160ossl.c
new file mode 100644
index 0000000000..bbfff8bbe2
--- /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 bc9e216eed..2ce73c4238 100644
--- a/ext/digest/sha1/depend
+++ b/ext/digest/sha1/depend
@@ -1,19 +1,28 @@
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.h
-sha1init.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../digest.h
+sha1init.o: $(top_srcdir)/ext/digest/digest.h
+sha1init.o: $(top_srcdir)/include/ruby.h
sha1init.o: sha1init.c
sha1init.o: sha1ossl.h
+sha1ossl.o: $(RUBY_EXTCONF_H)
+sha1ossl.o: $(arch_hdrdir)/ruby/config.h
+sha1ossl.o: $(hdrdir)/ruby/defines.h
+sha1ossl.o: $(hdrdir)/ruby/intern.h
+sha1ossl.o: $(hdrdir)/ruby/missing.h
+sha1ossl.o: $(hdrdir)/ruby/ruby.h
+sha1ossl.o: $(hdrdir)/ruby/st.h
+sha1ossl.o: $(hdrdir)/ruby/subst.h
+sha1ossl.o: $(top_srcdir)/ext/digest/defs.h
+sha1ossl.o: $(top_srcdir)/include/ruby.h
+sha1ossl.o: sha1ossl.c
+sha1ossl.o: sha1ossl.h
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb
index 0ff4158bef..26689a1c78 100644
--- a/ext/digest/sha1/extconf.rb
+++ b/ext/digest/sha1/extconf.rb
@@ -1,16 +1,23 @@
# -*- 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"
$objs = [ "sha1init.#{$OBJEXT}" ]
-digest_conf("sha1", "sha", nil, %w[SHA])
+if !with_config("bundled-sha1") &&
+ (dir_config("openssl")
+ pkg_config("openssl")
+ require File.expand_path('../../../openssl/deprecation', __FILE__)
+ 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/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 3adf424b1d..69b93723b3 100644
--- a/ext/digest/sha1/sha1init.c
+++ b/ext/digest/sha1/sha1init.c
@@ -3,10 +3,8 @@
#include <ruby/ruby.h>
#include "../digest.h"
-#if defined(SHA1_USE_OPENSSL)
+#if defined(HAVE_OPENSSL_SHA_H)
#include "sha1ossl.h"
-#elif defined(SHA1_USE_COMMONDIGEST)
-#include "sha1cc.h"
#else
#include "sha1.h"
#endif
@@ -22,47 +20,27 @@ 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)
{
VALUE mDigest, cDigest_Base, cDigest_SHA1;
+ rb_require("digest");
+
#if 0
mDigest = rb_define_module("Digest"); /* let rdoc know */
#endif
- mDigest = rb_digest_namespace();
+ mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
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(0, 0, 0, (void *)&sha1));
}
diff --git a/ext/digest/sha1/sha1ossl.c b/ext/digest/sha1/sha1ossl.c
new file mode 100644
index 0000000000..0fcb2d6b1e
--- /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 8946d44f31..3a47a76532 100644
--- a/ext/digest/sha2/depend
+++ b/ext/digest/sha2/depend
@@ -1,19 +1,28 @@
-sha2.o: sha2.c sha2.h $(srcdir)/../defs.h
-sha2init.o: $(LOCAL_HDRS)
+sha2.o: sha2.c sha2.h $(srcdir)/../defs.h $(HDRS) $(ruby_headers)
# AUTOGENERATED DEPENDENCIES START
sha2init.o: $(RUBY_EXTCONF_H)
sha2init.o: $(arch_hdrdir)/ruby/config.h
-sha2init.o: $(hdrdir)/ruby.h
-sha2init.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../digest.h
+sha2init.o: $(top_srcdir)/ext/digest/digest.h
+sha2init.o: $(top_srcdir)/include/ruby.h
sha2init.o: sha2init.c
sha2init.o: sha2ossl.h
+sha2ossl.o: $(RUBY_EXTCONF_H)
+sha2ossl.o: $(arch_hdrdir)/ruby/config.h
+sha2ossl.o: $(hdrdir)/ruby/defines.h
+sha2ossl.o: $(hdrdir)/ruby/intern.h
+sha2ossl.o: $(hdrdir)/ruby/missing.h
+sha2ossl.o: $(hdrdir)/ruby/ruby.h
+sha2ossl.o: $(hdrdir)/ruby/st.h
+sha2ossl.o: $(hdrdir)/ruby/subst.h
+sha2ossl.o: $(top_srcdir)/ext/digest/defs.h
+sha2ossl.o: $(top_srcdir)/include/ruby.h
+sha2ossl.o: sha2ossl.c
+sha2ossl.o: sha2ossl.h
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb
index 5c7f76c7f3..12fbbc4144 100644
--- a/ext/digest/sha2/extconf.rb
+++ b/ext/digest/sha2/extconf.rb
@@ -1,17 +1,25 @@
# -*- 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"
$objs = [ "sha2init.#{$OBJEXT}" ]
-unless digest_conf("sha2", "sha", %w[SHA256 SHA512])
+if !with_config("bundled-sha2") &&
+ (dir_config("openssl")
+ pkg_config("openssl")
+ require File.expand_path('../../../openssl/deprecation', __FILE__)
+ 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")
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..0cd3b0f24e 100644
--- a/ext/digest/sha2/sha2.c
+++ b/ext/digest/sha2/sha2.c
@@ -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 7d211784a3..38467df12c 100644
--- a/ext/digest/sha2/sha2init.c
+++ b/ext/digest/sha2/sha2init.c
@@ -5,8 +5,6 @@
#include "../digest.h"
#if defined(SHA2_USE_OPENSSL)
#include "sha2ossl.h"
-#elif defined(SHA2_USE_COMMONDIGEST)
-#include "sha2cc.h"
#else
#include "sha2.h"
#endif
@@ -35,14 +33,18 @@ void
Init_sha2(void)
{
VALUE mDigest, cDigest_Base;
- ID id_metadata = rb_id_metadata();
+ ID id_metadata;
#define DECLARE_ALGO_CLASS(bitlen) \
VALUE cDigest_SHA##bitlen;
FOREACH_BITLEN(DECLARE_ALGO_CLASS)
- mDigest = rb_digest_namespace();
+ rb_require("digest");
+
+ id_metadata = rb_intern("metadata");
+
+ mDigest = rb_path2class("Digest");
cDigest_Base = rb_path2class("Digest::Base");
#define DEFINE_ALGO_CLASS(bitlen) \
diff --git a/ext/digest/sha2/sha2ossl.c b/ext/digest/sha2/sha2ossl.c
new file mode 100644
index 0000000000..e68828899c
--- /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/etc/depend b/ext/etc/depend
index 99e812c7e4..a73a18465a 100644
--- a/ext/etc/depend
+++ b/ext/etc/depend
@@ -1,23 +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.h
-etc.o: $(hdrdir)/ruby/assert.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: constdefs.h
-etc.o: etc.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 2f3fbb737b..4173d33bdc 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -52,8 +52,6 @@ char *getenv();
#endif
char *getlogin();
-#define RUBY_ETC_VERSION "1.1.0"
-
#include "constdefs.h"
/* call-seq:
@@ -100,7 +98,7 @@ static VALUE
safe_setup_str(const char *str)
{
if (str == 0) str = "";
- return rb_str_new2(str);
+ return rb_tainted_str_new2(str);
}
static VALUE
@@ -217,9 +215,9 @@ etc_getpwnam(VALUE obj, VALUE nam)
{
#ifdef HAVE_GETPWENT
struct passwd *pwd;
- const char *p = StringValueCStr(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
@@ -230,7 +228,7 @@ etc_getpwnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETPWENT
static int passwd_blocking = 0;
static VALUE
-passwd_ensure(VALUE _)
+passwd_ensure(void)
{
endpwent();
passwd_blocking = (int)Qfalse;
@@ -238,12 +236,12 @@ passwd_ensure(VALUE _)
}
static VALUE
-passwd_iterate(VALUE _)
+passwd_iterate(void)
{
struct passwd *pw;
setpwent();
- while ((pw = getpwent()) != 0) {
+ while (pw = getpwent()) {
rb_yield(setup_passwd(pw));
}
return Qnil;
@@ -289,7 +287,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
@@ -371,7 +369,7 @@ etc_getpwent(VALUE obj)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- if ((pw = getpwent()) != 0) {
+ if (pw = getpwent()) {
return setup_passwd(pw);
}
#endif
@@ -460,9 +458,9 @@ etc_getgrnam(VALUE obj, VALUE nam)
{
#ifdef HAVE_GETGRENT
struct group *grp;
- const char *p = StringValueCStr(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
@@ -473,7 +471,7 @@ etc_getgrnam(VALUE obj, VALUE nam)
#ifdef HAVE_GETGRENT
static int group_blocking = 0;
static VALUE
-group_ensure(VALUE _)
+group_ensure(void)
{
endgrent();
group_blocking = (int)Qfalse;
@@ -482,12 +480,12 @@ group_ensure(VALUE _)
static VALUE
-group_iterate(VALUE _)
+group_iterate(void)
{
struct group *pw;
setgrent();
- while ((pw = getgrent()) != 0) {
+ while (pw = getgrent()) {
rb_yield(setup_group(pw));
}
return Qnil;
@@ -529,7 +527,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 +606,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 +625,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)
@@ -645,7 +642,7 @@ etc_sysconfdir(VALUE obj)
* Returns system temporary directory; typically "/tmp".
*/
static VALUE
-etc_systmpdir(VALUE _)
+etc_systmpdir(void)
{
VALUE tmpdir;
#ifdef _WIN32
@@ -667,20 +664,11 @@ etc_systmpdir(VALUE _)
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
#endif
-#ifndef RB_PASS_KEYWORDS
- /* untaint on Ruby < 2.7 */
FL_UNSET(tmpdir, FL_TAINT);
-#endif
return tmpdir;
}
@@ -757,6 +745,9 @@ etc_uname(VALUE obj)
# ifndef PROCESSOR_ARCHITECTURE_AMD64
# define PROCESSOR_ARCHITECTURE_AMD64 9
# endif
+# ifndef PROCESSOR_ARCHITECTURE_IA64
+# define PROCESSOR_ARCHITECTURE_IA64 6
+# endif
# ifndef PROCESSOR_ARCHITECTURE_INTEL
# define PROCESSOR_ARCHITECTURE_INTEL 0
# endif
@@ -768,6 +759,9 @@ etc_uname(VALUE obj)
case PROCESSOR_ARCHITECTURE_ARM:
mach = "ARM";
break;
+ case PROCESSOR_ARCHITECTURE_IA64:
+ mach = "IA64";
+ break;
case PROCESSOR_ARCHITECTURE_INTEL:
mach = "x86";
break;
@@ -1012,7 +1006,7 @@ etc_nprocessors(VALUE obj)
ncpus = etc_nprocessors_affin();
if (ncpus != -1) {
- return INT2NUM(ncpus);
+ return INT2NUM(ncpus);
}
/* fallback to _SC_NPROCESSORS_ONLN */
#endif
@@ -1065,7 +1059,6 @@ Init_etc(void)
VALUE mEtc;
mEtc = rb_define_module("Etc");
- rb_define_const(mEtc, "VERSION", rb_str_new_cstr(RUBY_ETC_VERSION));
init_constants(mEtc);
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
diff --git a/ext/etc/etc.gemspec b/ext/etc/etc.gemspec
deleted file mode 100644
index f28016925f..0000000000
--- a/ext/etc/etc.gemspec
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-version = ["", "ext/etc/"].find do |dir|
- begin
- break File.open(File.expand_path("../#{dir}/etc.c", __FILE__)) do |f|
- f.gets "\n#define RUBY_ETC_VERSION "
- f.gets[/"(.+)"/, 1]
- end
- rescue
- next
- end
-end
-
-Gem::Specification.new do |spec|
- spec.name = "etc"
- spec.version = version
- 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 = spec.summary
- spec.homepage = "https://github.com/ruby/etc"
- spec.license = "BSD-2-Clause"
-
- spec.files = %w[
- LICENSE.txt
- README.md
- ext/etc/constdefs.h
- ext/etc/etc.c
- ext/etc/extconf.rb
- ext/etc/mkconstants.rb
- stub/etc.rb
- test/etc/test_etc.rb
- ]
- spec.bindir = "exe"
- 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 435fbe7f3d..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")
@@ -41,12 +38,6 @@ have_struct_member('struct passwd', 'pw_expire', 'pwd.h')
have_struct_member('struct passwd', 'pw_passwd', 'pwd.h')
have_struct_member('struct group', 'gr_passwd', 'grp.h')
-# for https://github.com/ruby/etc
-srcdir = File.expand_path("..", __FILE__)
-if !File.exist?("#{srcdir}/depend")
- %x[#{RbConfig.ruby} #{srcdir}/mkconstants.rb -o #{srcdir}/constdefs.h]
-end
-
$distcleanfiles << "constdefs.h"
create_makefile("etc")
diff --git a/ext/etc/mkconstants.rb b/ext/etc/mkconstants.rb
index a752d64519..c9fddfd132 100644
--- a/ext/etc/mkconstants.rb
+++ b/ext/etc/mkconstants.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'optparse'
require 'erb'
@@ -66,15 +65,7 @@ def each_name(pat)
}
end
-erb_new = lambda do |src, safe, trim|
- if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
- ERB.new(src, trim_mode: trim)
- else
- ERB.new(src, safe, trim)
- end
-end
-
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
% each_const {|name, default_value|
#if !defined(<%=name%>)
# if defined(HAVE_CONST_<%=name.upcase%>)
@@ -88,7 +79,7 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
% }
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
% each_const {|name, default_value|
#if defined(<%=name%>)
% if comment = COMMENTS[name]
@@ -99,13 +90,13 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
% }
EOS
-header_result = erb_new.call(<<'EOS', nil, '%').result(binding)
+header_result = ERB.new(<<'EOS', nil, '%').result(binding)
/* autogenerated file */
<%= gen_const_decls %>
EOS
-result = erb_new.call(<<'EOS', nil, '%').result(binding)
+result = ERB.new(<<'EOS', nil, '%').result(binding)
/* autogenerated file */
#ifdef HAVE_LONG_LONG
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 80a0a1208d..32cc9f10cf 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 ||= []
@@ -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,119 +492,59 @@ 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
- if ext_prefix == 'gems'
- @gemname = exts
- elsif exts
- $static_ext.delete_if {|t, *| !File.fnmatch(t, exts)}
- end
-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(?:\.\/)+/, '')
- incl, excl = Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d|
+ exts |= Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d|
d = File.dirname(d)
d.slice!(0, ext_prefix.length + 1)
d
- }.partition {|ext|
+ }.find_all {|ext|
with_config(ext, &cond)
- }
- incl.sort!
- excl.sort!.collect! {|d| d+"/"}
- nil while incl.reject! {|d| excl << d+"/" if excl.any? {|x| d.start_with?(x)}}
- exts |= incl
+ }.sort
if $LIBRUBYARG_SHARED.empty? and CONFIG["EXTSTATIC"] == "static"
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
@@ -584,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)
@@ -604,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 = [
@@ -616,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)
@@ -640,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=)"
@@ -669,14 +690,10 @@ 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)"'
@@ -688,17 +705,12 @@ begin
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/lib/colorize.rb skip]
- mf.macro "NOTE_NAME", %w[$(RUBY) $(top_srcdir)/tool/lib/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}"
@@ -715,7 +727,7 @@ begin
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 "ext/extinit.#{$OBJEXT}:\n\t$(Q)$(MAKE) $(MFLAGS) V=$(V) $@" if $static
mf.puts
if $gnumake == "yes"
submake = "$(MAKE) -C $(@D)"
@@ -726,49 +738,35 @@ begin
end
targets.each do |tgt|
exts.each do |d|
- d = d[0..-2]
- t = "#{d}#{tgt}"
- if /^(dist|real)?clean$/ =~ tgt
- deps = exts.select {|e|e.start_with?(d)}.map {|e|"#{e[0..-2]}#{tgt}"} - [t]
- pd = ' ' + deps.join(' ') unless deps.empty?
- else
- pext = File.dirname(d)
- pd = " #{pext}/#{tgt}" if exts.include?("#{pext}/.")
- end
- mf.puts "#{t}:#{pd}\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
+ 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 60d6be6b89..0000000000
--- a/ext/fcntl/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-fcntl.o: $(RUBY_EXTCONF_H)
-fcntl.o: $(arch_hdrdir)/ruby/config.h
-fcntl.o: $(hdrdir)/ruby.h
-fcntl.o: $(hdrdir)/ruby/assert.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: 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..62780b78c0 100644
--- a/ext/fcntl/fcntl.c
+++ b/ext/fcntl/fcntl.c
@@ -68,7 +68,7 @@ Init_fcntl(void)
#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 0e3194fbdc..0000000000
--- a/ext/fcntl/fcntl.gemspec
+++ /dev/null
@@ -1,25 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "fcntl"
- spec.version = "1.0.0"
- 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 675263b95c..0000000000
--- a/ext/fiber/depend
+++ /dev/null
@@ -1,3 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-fiber.o: fiber.c
-# AUTOGENERATED DEPENDENCIES END
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..d857bfe870 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;
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 5ed745fa0f..47ba44e9a6 100644
--- a/ext/fiddle/depend
+++ b/ext/fiddle/depend
@@ -6,6 +6,11 @@ CONFIGURE_LIBFFI = \
CC="$(CC)" CFLAGS="$(LIBFFI_CFLAGS)" \
LD="$(LD)" LDFLAGS="$(LIBFFI_LDFLAGS)"
+$(OBJS): $(HDRS) $(ruby_headers) \
+ $(hdrdir)/ruby/io.h \
+ $(hdrdir)/ruby/encoding.h \
+ $(hdrdir)/ruby/oniguruma.h
+
$(STATIC_LIB) $(RUBYARCHDIR)/$(DLLIB) $(DLLIB): $(LIBFFI_A)
$(OBJS): $(FFI_H)
@@ -25,133 +30,26 @@ $(LIBFFI_DIR)/Makefile:
$(Q) $(MAKEDIRS) $(LIBFFI_DIR)
$(Q) $(CONFIGURE_LIBFFI)
+build-libffi: $(LIBFFI_A)
build-libffi $(LIBFFI_A):
- $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG)
+ $(Q) $(SUBMAKE_LIBFFI)
-clean-none:
clean-libffi:
- $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG) clean
+ $(Q) $(SUBMAKE_LIBFFI) clean
-distclean-none:
distclean-libffi:
- $(Q) $(SUBMAKE_PRE) $(MAKE) $(SUBMAKE_ARG) distclean
+ $(Q) $(SUBMAKE_LIBFFI) distclean
$(Q) $(RM) $(LIBFFI_DIR)/local.exp
- $(Q) $(RUBY) -rfileutils -e "FileUtils.rmdir(Dir.glob(ARGV[0]+'/**/{,.*/}'), :parents=>true)" $(LIBFFI_DIR)
+ $(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
+.PHONY clean-libffi distclean-libffi realclean-libffi: .FORCE
+.PHONY clean-none distclean-none realclean-none: .FORCE
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.h
-closure.o: $(hdrdir)/ruby/assert.h
-closure.o: $(hdrdir)/ruby/backward.h
-closure.o: $(hdrdir)/ruby/defines.h
-closure.o: $(hdrdir)/ruby/intern.h
-closure.o: $(hdrdir)/ruby/missing.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: 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.h
-conversions.o: $(hdrdir)/ruby/assert.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: 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.h
-fiddle.o: $(hdrdir)/ruby/assert.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: 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.h
-function.o: $(hdrdir)/ruby/assert.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: 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.h
-handle.o: $(hdrdir)/ruby/assert.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: 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.h
-pointer.o: $(hdrdir)/ruby/assert.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: closure.h
-pointer.o: conversions.h
-pointer.o: fiddle.h
-pointer.o: function.h
-pointer.o: pointer.c
-# AUTOGENERATED DEPENDENCIES END
+.PHONY configure: configure-libffi
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index fce0cb4079..5688086f44 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -1,10 +1,8 @@
-# frozen_string_literal: true
require 'mkmf'
# :stopdoc:
-bundle = enable_config('bundled-libffi')
-if ! bundle
+if ! enable_config('bundled-libffi', false)
dir_config 'libffi'
pkg_config("libffi") and
@@ -18,18 +16,7 @@ if ! bundle
end and (have_library('ffi') || have_library('libffi'))
end or
begin
- # for https://github.com/ruby/fiddle
- if bundle && File.exist?("../../bin/extlibs.rb")
- require "fileutils"
- require_relative "../../bin/extlibs"
- extlibs = ExtLibs.new
- cache_dir = File.expand_path("../../tmp/.download_cache", $srcdir)
- ext_dir = File.expand_path("../../ext", $srcdir)
- Dir.glob("#{$srcdir}/libffi-*/").each{|dir| FileUtils.rm_rf(dir)}
- extlibs.run(["--cache=#{cache_dir}", ext_dir])
- end
- ver = bundle != false &&
- Dir.glob("#{$srcdir}/libffi-*/")
+ ver = Dir.glob("#{$srcdir}/libffi-*/")
.map {|n| File.basename(n)}
.max_by {|n| n.scan(/\d+/).map(&:to_i)}
unless ver
@@ -51,17 +38,14 @@ begin
libffi.lib = "#{libffi.builddir}/.libs"
libffi.a = "#{libffi.lib}/libffi_convenience.#{$LIBEXT}"
nowarn = CONFIG.merge("warnflags"=>"")
- libffi.cflags = RbConfig.expand("$(CFLAGS)".dup, nowarn)
+ libffi.cflags = RbConfig.expand("$(CFLAGS)", nowarn)
ver = ver[/libffi-(.*)/, 1]
FileUtils.mkdir_p(libffi.dir)
libffi.opt = CONFIG['configure_args'][/'(-C)'/, 1]
- libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}".dup)
+ libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}")
libffi.arch = RbConfig::CONFIG['host']
if $mswin
- unless find_executable(as = /x64/ =~ libffi.arch ? "ml64" : "ml")
- raise "missing #{as} command."
- end
$defs << "-DFFI_BUILDING"
libffi_config = "#{relative_from($srcdir, '..')}/win32/libffi-config.rb"
config = CONFIG.merge("top_srcdir" => $top_srcdir)
@@ -87,21 +71,15 @@ begin
args << libffi.opt if libffi.opt
args.concat %W[
CC=#{cc} CFLAGS=#{libffi.cflags}
- CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)".dup, nowarn)}
+ CXX=#{cxx} CXXFLAGS=#{RbConfig.expand("$(CXXFLAGS)", nowarn)}
LD=#{ld} LDFLAGS=#{libffi.ldflags}
]
FileUtils.rm_f("#{libffi.include}/ffitarget.h")
Logging::open do
Logging.message("%p in %p\n", args, opts)
- unless system(*args, **opts)
- begin
- IO.copy_stream(libffi.dir + "/config.log", Logging.instance_variable_get(:@logfile))
- rescue SystemCallError => e
- Logfile.message("%s\n", e.message)
- end
+ system(*args, **opts) or
raise "failed to configure libffi. Please install libffi."
- end
end
if $mswin && File.file?("#{libffi.include}/ffitarget.h")
FileUtils.rm_f("#{libffi.include}/ffitarget.h")
@@ -151,17 +129,15 @@ types.each do |type, signed|
end
if libffi
- $LOCAL_LIBS.prepend("./#{libffi.a} ").strip! # to exts.mk
- $INCFLAGS.gsub!(/-I#{libffi.dir}/, '-I$(LIBFFI_DIR)')
+ $LOCAL_LIBS.prepend("./#{libffi.a} ").strip!
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"
+ submake = "$(MAKE) -C $(LIBFFI_DIR)\n"
else
- submake_pre = "cd $(LIBFFI_DIR) && #{config_string("exec")}".strip
+ submake = "cd $(LIBFFI_DIR) && \\\n\t\t" << "#{config_string("exec")} $(MAKE)".strip
end
if $nmake
cmd = "$(RUBY) -C $(LIBFFI_DIR) #{libffi_config} --srcdir=$(LIBFFI_SRCDIR)"
@@ -174,14 +150,13 @@ create_makefile 'fiddle' do |conf|
PWD =
LIBFFI_CONFIGURE = #{cmd}
LIBFFI_ARCH = #{libffi.arch}
- LIBFFI_SRCDIR = #{libffi.srcdir.sub(libffi.dir, '$(LIBFFI_DIR)')}
+ LIBFFI_SRCDIR = #{libffi.srcdir}
LIBFFI_DIR = #{libffi.dir}
- LIBFFI_A = #{libffi.a.sub(libffi.dir, '$(LIBFFI_DIR)')}
+ LIBFFI_A = #{libffi.a}
LIBFFI_CFLAGS = #{libffi.cflags}
LIBFFI_LDFLAGS = #{libffi.ldflags}
FFI_H = $(LIBFFI_DIR)/include/ffi.h
- SUBMAKE_PRE = #{submake_pre}
- SUBMAKE_ARG = #{submake_arg}
+ SUBMAKE_LIBFFI = #{submake}
LIBFFI_CLEAN = libffi
MK
end
diff --git a/ext/fiddle/extlibs b/ext/fiddle/extlibs
index 290b814590..7d5fda5247 100644
--- a/ext/fiddle/extlibs
+++ b/ext/fiddle/extlibs
@@ -1,5 +1,2 @@
-http://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz \
- md5:83b89587607e3eb65c70d361f13bab43 \
- sha512:980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 \
- #
+ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz md5:83b89587607e3eb65c70d361f13bab43
win32/libffi-3.2.1-mswin.patch -p0
diff --git a/ext/fiddle/fiddle.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/function.c b/ext/fiddle/function.c
index 994402e26b..e0da8b69cb 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,36 +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);
- rb_iv_set(self, "@closure", ptr);
-
- 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_AREF(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);
@@ -131,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);
@@ -147,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;
@@ -178,23 +144,31 @@ 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++) {
+ VALUE src = argv[i];
+ if (OBJ_TAINTED(src)) {
+ rb_raise(rb_eSecurityError, "tainted parameter not allowed");
+ }
+ }
+ }
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)) {
@@ -203,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 = (void(*)(void))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)
@@ -218,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
@@ -283,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/handle.c b/ext/fiddle/handle.c
index 700924afb5..c5c356c175 100644
--- a/ext/fiddle/handle.c
+++ b/ext/fiddle/handle.c
@@ -1,6 +1,8 @@
#include <ruby.h>
#include <fiddle.h>
+#define SafeStringValueCStr(v) (rb_check_safe_obj(rb_string_value(&v)), StringValueCStr(v))
+
VALUE rb_cHandle;
struct dl_handle {
@@ -46,7 +48,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 = {
@@ -143,17 +145,19 @@ rb_fiddle_handle_initialize(int argc, VALUE argv[], VALUE self)
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 1:
- clib = NIL_P(lib) ? NULL : StringValueCStr(lib);
+ clib = NIL_P(lib) ? NULL : SafeStringValueCStr(lib);
cflag = RTLD_LAZY | RTLD_GLOBAL;
break;
case 2:
- clib = NIL_P(lib) ? NULL : StringValueCStr(lib);
+ clib = NIL_P(lib) ? NULL : SafeStringValueCStr(lib);
cflag = NUM2INT(flag);
break;
default:
rb_bug("rb_fiddle_handle_new");
}
+ rb_secure(2);
+
#if defined(_WIN32)
if( !clib ){
HANDLE rb_libruby_handle(void);
@@ -317,8 +321,9 @@ fiddle_handle_sym(void *handle, VALUE symbol)
# define CHECK_DLERROR
#endif
void (*func)();
- const char *name = StringValueCStr(symbol);
+ const char *name = SafeStringValueCStr(symbol);
+ rb_secure(2);
#ifdef HAVE_DLERROR
dlerror();
#endif
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 178ebb8c76..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
@@ -115,6 +111,8 @@ module Fiddle
return SIZEOF_INT
when TYPE_LONG
return SIZEOF_LONG
+ when TYPE_LONG_LONG
+ return SIZEOF_LONG_LONG
when TYPE_FLOAT
return SIZEOF_FLOAT
when TYPE_DOUBLE
@@ -122,12 +120,7 @@ module Fiddle
when TYPE_VOIDP
return SIZEOF_VOIDP
else
- if defined?(TYPE_LONG_LONG) and
- ty == TYPE_LONG_LONG
- return SIZEOF_LONG_LONG
- else
- raise(DLError, "unknown type: #{ty}")
- end
+ raise(DLError, "unknown type: #{ty}")
end
when Class
if( ty.instance_methods().include?(:to_ptr) )
@@ -157,8 +150,7 @@ module Fiddle
# :stopdoc:
CALL_TYPE_TO_ABI = Hash.new { |h, k|
raise RuntimeError, "unsupported call type: #{k}"
- }.merge({ :stdcall => Function.const_defined?(:STDCALL) ? Function::STDCALL :
- Function::DEFAULT,
+ }.merge({ :stdcall => (Function::STDCALL rescue Function::DEFAULT),
:cdecl => Function::DEFAULT,
nil => Function::DEFAULT
}).freeze
@@ -167,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(/@.+/,'')
@@ -191,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
@@ -220,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
@@ -228,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
@@ -264,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 22eccedb76..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
@@ -18,7 +17,7 @@ module Fiddle
}
PACK_MAP = {
- TYPE_VOIDP => "l!",
+ TYPE_VOIDP => ((SIZEOF_VOIDP == SIZEOF_LONG_LONG) ? "q" : "l!"),
TYPE_CHAR => "c",
TYPE_SHORT => "s!",
TYPE_INT => "i!",
@@ -48,7 +47,6 @@ module Fiddle
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
- PACK_MAP[TYPE_VOIDP] = "q" if SIZEOF_LONG_LONG == SIZEOF_VOIDP
end
def align(addr, align)
@@ -81,13 +79,10 @@ module Fiddle
case SIZEOF_VOIDP
when SIZEOF_LONG
ary.pack(@template)
+ when SIZEOF_LONG_LONG
+ ary.pack(@template)
else
- if defined?(TYPE_LONG_LONG) and
- SIZEOF_VOIDP == SIZEOF_LONG_LONG
- ary.pack(@template)
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
+ raise(RuntimeError, "sizeof(void*)?")
end
end
@@ -95,20 +90,17 @@ module Fiddle
case SIZEOF_VOIDP
when SIZEOF_LONG
ary.join().unpack(@template)
+ when SIZEOF_LONG_LONG
+ ary.join().unpack(@template)
else
- if defined?(TYPE_LONG_LONG) and
- SIZEOF_VOIDP == SIZEOF_LONG_LONG
- ary.join().unpack(@template)
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
+ raise(RuntimeError, "sizeof(void*)?")
end
end
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 01fec1c206..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
@@ -13,13 +12,10 @@ module Fiddle
[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
- if defined?(TYPE_LONG_LONG) and
- ty.abs == TYPE_LONG_LONG
- [val].pack("q").unpack("Q")[0]
- else
- val
- end
+ val
end
end
@@ -33,13 +29,10 @@ module Fiddle
[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
- if defined?(TYPE_LONG_LONG) and
- ty.abs == TYPE_LONG_LONG
- [val].pack("Q").unpack("q")[0]
- else
- val
- end
+ val
end
end
@@ -81,13 +74,10 @@ module Fiddle
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
- if defined?(SIZEOF_LONG_LONG) and
- SIZEOF_VOIDP == SIZEOF_LONG_LONG
- return [arg].pack("p").unpack("q")[0]
- else
- raise(RuntimeError, "sizeof(void*)?")
- end
+ raise(RuntimeError, "sizeof(void*)?")
end
end
when Float, Integer
diff --git a/ext/fiddle/pointer.c b/ext/fiddle/pointer.c
index 117cc9b826..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 = {
@@ -90,6 +90,7 @@ rb_fiddle_ptr_new2(VALUE klass, void *ptr, long size, freefunc_t func)
data->ptr = ptr;
data->free = func;
data->size = size;
+ OBJ_TAINT(val);
return val;
}
@@ -375,11 +376,11 @@ rb_fiddle_ptr_to_s(int argc, VALUE argv[], VALUE self)
TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
switch (rb_scan_args(argc, argv, "01", &arg1)) {
case 0:
- val = rb_str_new2((char*)(data->ptr));
+ val = rb_tainted_str_new2((char*)(data->ptr));
break;
case 1:
len = NUM2INT(arg1);
- val = rb_str_new((char*)(data->ptr), len);
+ val = rb_tainted_str_new((char*)(data->ptr), len);
break;
default:
rb_bug("rb_fiddle_ptr_to_s");
@@ -413,11 +414,11 @@ rb_fiddle_ptr_to_str(int argc, VALUE argv[], VALUE self)
TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
switch (rb_scan_args(argc, argv, "01", &arg1)) {
case 0:
- val = rb_str_new((char*)(data->ptr),data->size);
+ val = rb_tainted_str_new((char*)(data->ptr),data->size);
break;
case 1:
len = NUM2INT(arg1);
- val = rb_str_new((char*)(data->ptr), len);
+ val = rb_tainted_str_new((char*)(data->ptr), len);
break;
default:
rb_bug("rb_fiddle_ptr_to_str");
@@ -439,7 +440,7 @@ rb_fiddle_ptr_inspect(VALUE self)
TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
return rb_sprintf("#<%"PRIsVALUE":%p ptr=%p size=%ld free=%p>",
- RB_OBJ_CLASSNAME(self), (void *)data, data->ptr, data->size, (void *)data->free);
+ RB_OBJ_CLASSNAME(self), data, data->ptr, data->size, data->free);
}
/*
@@ -550,7 +551,7 @@ rb_fiddle_ptr_aref(int argc, VALUE argv[], VALUE self)
case 2:
offset = NUM2ULONG(arg0);
len = NUM2ULONG(arg1);
- retval = rb_str_new((char *)data->ptr + offset, len);
+ retval = rb_tainted_str_new((char *)data->ptr + offset, len);
break;
default:
rb_bug("rb_fiddle_ptr_aref()");
@@ -668,6 +669,7 @@ rb_fiddle_ptr_s_to_ptr(VALUE self, VALUE val)
if (num == val) wrap = 0;
ptr = rb_fiddle_ptr_new(NUM2PTR(num), 0, NULL);
}
+ OBJ_INFECT(ptr, val);
if (wrap) RPTR_DATA(ptr)->wrap[0] = wrap;
return ptr;
}
@@ -675,7 +677,6 @@ rb_fiddle_ptr_s_to_ptr(VALUE self, VALUE val)
void
Init_fiddle_pointer(void)
{
-#undef rb_intern
id_to_ptr = rb_intern("to_ptr");
/* Document-class: Fiddle::Pointer
diff --git a/ext/fiddle/win32/libffi-3.2.1-mswin.patch b/ext/fiddle/win32/libffi-3.2.1-mswin.patch
index f9100e703d..782cf41e36 100644
--- a/ext/fiddle/win32/libffi-3.2.1-mswin.patch
+++ b/ext/fiddle/win32/libffi-3.2.1-mswin.patch
@@ -1,6 +1,6 @@
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
++++ libffi-3.2.1/src/x86/ffi.c 2014-12-22 16:00:42.000000000 +0900
@@ -99,11 +99,13 @@
i != 0;
i--, p_arg += dir, p_argv += dir)
@@ -16,37 +16,7 @@ diff -ru libffi-3.2.1/src/x86/ffi.c libffi-3.2.1/src/x86/ffi.c
#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 @@
+@@ -599,11 +601,13 @@
i != 0;
i--, p_arg += dir, p_argv += dir)
{
@@ -61,7 +31,7 @@ diff -ru libffi-3.2.1/src/x86/ffi.c libffi-3.2.1/src/x86/ffi.c
#ifdef X86_WIN64
if (z > FFI_SIZEOF_ARG
-@@ -642,7 +647,7 @@
+@@ -642,7 +646,7 @@
#endif
}
@@ -70,20 +40,6 @@ diff -ru libffi-3.2.1/src/x86/ffi.c libffi-3.2.1/src/x86/ffi.c
}
#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
@@ -174,18 +130,3 @@ diff -ru libffi-3.2.1/src/x86/win64.S libffi-3.2.1/src/x86/win64.S
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
index 6abc9b2c02..ecd3b086c0 100755
--- a/ext/fiddle/win32/libffi-config.rb
+++ b/ext/fiddle/win32/libffi-config.rb
@@ -1,5 +1,4 @@
#!/usr/bin/ruby
-# frozen_string_literal: true
require 'fileutils'
basedir = File.dirname(__FILE__)
diff --git a/ext/gdbm/depend b/ext/gdbm/depend
deleted file mode 100644
index 33635bc099..0000000000
--- a/ext/gdbm/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-gdbm.o: $(RUBY_EXTCONF_H)
-gdbm.o: $(arch_hdrdir)/ruby/config.h
-gdbm.o: $(hdrdir)/ruby.h
-gdbm.o: $(hdrdir)/ruby/assert.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: gdbm.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/gdbm/extconf.rb b/ext/gdbm/extconf.rb
index d1908ffa5c..389bfb633f 100644
--- a/ext/gdbm/extconf.rb
+++ b/ext/gdbm/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
dir_config("gdbm")
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 4a6377b685..eb802a7563 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -83,10 +83,6 @@ static VALUE rb_cGDBM, rb_eGDBMError, rb_eGDBMFatalError;
#define MY_BLOCK_SIZE (2048)
#define MY_FATAL_FUNC rb_gdbm_fatal
-
-NORETURN(static void rb_gdbm_fatal(const char *msg));
-NORETURN(static void closed_dbm(void));
-
static void
rb_gdbm_fatal(const char *msg)
{
@@ -106,6 +102,7 @@ closed_dbm(void)
#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)
@@ -118,18 +115,21 @@ static void
free_dbm(void *ptr)
{
struct dbmdata *dbmp = ptr;
- if (dbmp->di_dbm)
- gdbm_close(dbmp->di_dbm);
- xfree(dbmp);
+ if (dbmp) {
+ if (dbmp->di_dbm) gdbm_close(dbmp->di_dbm);
+ xfree(dbmp);
+ }
}
static size_t
memsize_dbm(const void *ptr)
{
+ size_t size = 0;
const struct dbmdata *dbmp = ptr;
- size_t size = sizeof(*dbmp);
- if (dbmp->di_dbm)
- size += DBM_SIZEOF_DBM;
+ if (dbmp) {
+ size += sizeof(*dbmp);
+ if (dbmp->di_dbm) size += DBM_SIZEOF_DBM;
+ }
return size;
}
@@ -170,6 +170,8 @@ fgdbm_closed(VALUE obj)
struct dbmdata *dbmp;
TypedData_Get_Struct(obj, struct dbmdata, &dbm_type, dbmp);
+ if (dbmp == 0)
+ return Qtrue;
if (dbmp->di_dbm == 0)
return Qtrue;
@@ -179,9 +181,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 TypedData_Wrap_Struct(klass, &dbm_type, 0);
}
/*
@@ -215,7 +215,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 */
}
@@ -229,7 +228,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. */
@@ -269,8 +268,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;
@@ -324,6 +324,7 @@ rb_gdbm_fetch(GDBM_FILE dbm, datum key)
str = rb_str_new(val.dptr, val.dsize);
free(val.dptr);
+ OBJ_TAINT(str);
return str;
}
@@ -333,7 +334,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);
@@ -364,6 +365,7 @@ rb_gdbm_firstkey(GDBM_FILE dbm)
str = rb_str_new(key.dptr, key.dsize);
free(key.dptr);
+ OBJ_TAINT(str);
return str;
}
@@ -384,6 +386,7 @@ rb_gdbm_nextkey(GDBM_FILE dbm, VALUE keystr)
str = rb_str_new(key2.dptr, key2.dsize);
free(key2.dptr);
+ OBJ_TAINT(str);
return str;
}
@@ -447,7 +450,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)) {
@@ -535,7 +538,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);
@@ -611,8 +614,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);
@@ -631,7 +633,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);
@@ -722,8 +724,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);
@@ -744,13 +746,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;
}
@@ -988,7 +988,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);
@@ -1015,7 +1015,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 da074b0180..0000000000
--- a/ext/gdbm/gdbm.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-Gem::Specification.new do |spec|
- spec.name = "gdbm"
- spec.version = "2.1.0"
- 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"
-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 ac5b6a611c..e846450007 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -4,7 +4,6 @@
*/
#include "ruby.h"
#include "ruby/io.h"
-#include "ruby/thread.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -23,7 +22,7 @@ typedef struct termios conmode;
static int
setattr(int fd, conmode *t)
{
- while (tcsetattr(fd, TCSANOW, t)) {
+ while (tcsetattr(fd, TCSAFLUSH, t)) {
if (errno != EINTR) return 0;
}
return 1;
@@ -49,10 +48,13 @@ typedef struct sgttyb conmode;
# endif
#elif defined _WIN32
#include <winioctl.h>
-#include <conio.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
@@ -75,60 +77,25 @@ getattr(int fd, conmode *t)
#define SET_LAST_ERROR (0)
#endif
-static ID id_getc, id_console, id_close, id_min, id_time, id_intr;
-#if ENABLE_IO_GETPASS
-static ID id_gets;
-#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
+static ID id_getc, id_console, id_close;
typedef struct {
int vmin;
int vtime;
- int intr;
} rawmode_arg_t;
static rawmode_arg_t *
-rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *opts)
+rawmode_opt(int argc, VALUE *argv, rawmode_arg_t *opts)
{
- int argc = *argcp;
rawmode_arg_t *optp = NULL;
- VALUE vopts = Qnil;
- if (argc > min_argc) {
- vopts = rb_check_hash_type(argv[argc-1]);
- if (!NIL_P(vopts)) {
- argv[argc-1] = vopts;
- vopts = rb_extract_keywords(&argv[argc-1]);
- if (!argv[argc-1]) *argcp = --argc;
- if (!vopts) vopts = Qnil;
- }
- }
- rb_check_arity(argc, min_argc, max_argc);
+ VALUE vopts;
+ rb_scan_args(argc, argv, "0:", &vopts);
if (!NIL_P(vopts)) {
- VALUE vmin = rb_hash_aref(vopts, ID2SYM(id_min));
- VALUE vtime = rb_hash_aref(vopts, ID2SYM(id_time));
- VALUE intr = rb_hash_aref(vopts, ID2SYM(id_intr));
+ 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;
- opts->intr = 0;
if (!NIL_P(vmin)) {
opts->vmin = NUM2INT(vmin);
optp = opts;
@@ -139,21 +106,6 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
opts->vtime = NUM2INT(vtime);
optp = opts;
}
- switch (intr) {
- case Qtrue:
- opts->intr = 1;
- optp = opts;
- break;
- case Qfalse:
- opts->intr = 0;
- optp = opts;
- break;
- case Qnil:
- break;
- default:
- rb_raise(rb_eArgError, "true or false expected as intr: %"PRIsVALUE,
- intr);
- }
}
return optp;
}
@@ -165,35 +117,24 @@ set_rawmode(conmode *t, void *arg)
cfmakeraw(t);
t->c_lflag &= ~(ECHOE|ECHOK);
#elif defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
- t->c_iflag &= ~(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL);
+ t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
t->c_oflag &= ~OPOST;
- t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN|XCASE);
+ t->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN);
t->c_cflag &= ~(CSIZE|PARENB);
t->c_cflag |= CS8;
- t->c_cc[VMIN] = 1;
- t->c_cc[VTIME] = 0;
#elif defined HAVE_SGTTY_H
t->sg_flags &= ~ECHO;
t->sg_flags |= RAW;
#elif defined _WIN32
*t = 0;
#endif
+#if defined HAVE_TERMIOS_H || defined HAVE_TERMIO_H
if (arg) {
const rawmode_arg_t *r = arg;
-#ifdef VMIN
if (r->vmin >= 0) t->c_cc[VMIN] = r->vmin;
-#endif
-#ifdef VTIME
if (r->vtime >= 0) t->c_cc[VTIME] = r->vtime;
-#endif
-#ifdef ISIG
- if (r->intr) {
- t->c_iflag |= BRKINT|IXON;
- t->c_lflag |= ISIG;
- }
-#endif
- (void)r;
}
+#endif
}
static void
@@ -273,7 +214,7 @@ get_write_fd(const rb_io_t *fptr)
#define FD_PER_IO 2
static VALUE
-ttymode(VALUE io, VALUE (*func)(VALUE), VALUE farg, void (*setter)(conmode *, void *), void *arg)
+ttymode(VALUE io, VALUE (*func)(VALUE), void (*setter)(conmode *, void *), void *arg)
{
rb_io_t *fptr;
int status = -1;
@@ -304,7 +245,7 @@ ttymode(VALUE io, VALUE (*func)(VALUE), VALUE farg, void (*setter)(conmode *, vo
}
}
if (status == 0) {
- result = rb_protect(func, farg, &status);
+ result = rb_protect(func, io, &status);
}
GetOpenFile(io, fptr);
if (fd[0] != -1 && fd[0] == GetReadFD(fptr)) {
@@ -321,38 +262,14 @@ ttymode(VALUE io, VALUE (*func)(VALUE), VALUE farg, void (*setter)(conmode *, vo
}
if (status) {
if (status == -1) {
- rb_syserr_fail(error, 0);
+ errno = error;
+ rb_sys_fail(0);
}
rb_jump_tag(status);
}
return result;
}
-#if !defined _WIN32
-struct ttymode_callback_args {
- VALUE (*func)(VALUE, VALUE);
- VALUE io;
- VALUE farg;
-};
-
-static VALUE
-ttymode_callback(VALUE args)
-{
- struct ttymode_callback_args *argp = (struct ttymode_callback_args *)args;
- return argp->func(argp->io, argp->farg);
-}
-
-static VALUE
-ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter)(conmode *, void *), void *arg)
-{
- struct ttymode_callback_args cargs;
- cargs.func = func;
- cargs.io = io;
- cargs.farg = farg;
- return ttymode(io, ttymode_callback, (VALUE)&cargs, setter, arg);
-}
-#endif
-
/*
* call-seq:
* io.raw(min: nil, time: nil) {|io| }
@@ -363,21 +280,13 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
*
* 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
console_raw(int argc, VALUE *argv, VALUE io)
{
- rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);
- return ttymode(io, rb_yield, io, set_rawmode, optp);
+ rawmode_arg_t opts, *optp = rawmode_opt(argc, argv, &opts);
+ return ttymode(io, rb_yield, set_rawmode, optp);
}
/*
@@ -388,8 +297,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 +305,7 @@ console_set_raw(int argc, VALUE *argv, VALUE io)
conmode t;
rb_io_t *fptr;
int fd;
- rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);
+ rawmode_arg_t opts, *optp = rawmode_opt(argc, argv, &opts);
GetOpenFile(io, fptr);
fd = GetReadFD(fptr);
@@ -423,7 +330,7 @@ console_set_raw(int argc, VALUE *argv, VALUE io)
static VALUE
console_cooked(VALUE io)
{
- return ttymode(io, rb_yield, io, set_cookedmode, NULL);
+ return ttymode(io, rb_yield, set_cookedmode, NULL);
}
/*
@@ -451,34 +358,11 @@ console_set_cooked(VALUE io)
return io;
}
-#ifndef _WIN32
static VALUE
getc_call(VALUE io)
{
- return rb_funcallv(io, id_getc, 0, 0);
+ return rb_funcall2(io, id_getc, 0, 0);
}
-#else
-static void *
-nogvl_getch(void *p)
-{
- int len = 0;
- wint_t *buf = p, c = _getwch();
-
- switch (c) {
- case WEOF:
- break;
- case 0x00:
- case 0xe0:
- buf[len++] = c;
- c = _getwch();
- /* fall through */
- default:
- buf[len++] = c;
- break;
- }
- return (void *)(VALUE)len;
-}
-#endif
/*
* call-seq:
@@ -486,63 +370,13 @@ nogvl_getch(void *p)
*
* 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
console_getch(int argc, VALUE *argv, VALUE io)
{
- rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);
-#ifndef _WIN32
- return ttymode(io, getc_call, io, set_rawmode, optp);
-#else
- rb_io_t *fptr;
- VALUE str;
- wint_t c;
- int w, len;
- char buf[8];
- wint_t wbuf[2];
- struct timeval *to = NULL, tv;
-
- GetOpenFile(io, fptr);
- if (optp) {
- if (optp->vtime) {
- to = &tv;
- tv.tv_sec = optp->vtime / 10;
- tv.tv_usec = (optp->vtime % 10) * 100000;
- }
- if (optp->vmin != 1) {
- rb_warning("min option ignored");
- }
- if (optp->intr) {
- w = rb_wait_for_single_fd(fptr->fd, RB_WAITFD_IN, to);
- if (w < 0) rb_eof_error();
- if (!(w & RB_WAITFD_IN)) return Qnil;
- }
- else {
- rb_warning("vtime option ignored if intr flag is unset");
- }
- }
- len = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getch, wbuf, RUBY_UBF_IO, 0);
- switch (len) {
- case 0:
- return Qnil;
- case 2:
- buf[0] = (char)wbuf[0];
- c = wbuf[1];
- len = 1;
- do {
- buf[len++] = (unsigned char)c;
- } while ((c >>= CHAR_BIT) && len < (int)sizeof(buf));
- return rb_str_new(buf, len);
- default:
- c = wbuf[0];
- len = rb_uv_to_utf8(buf, c);
- str = rb_utf8_str_new(buf, len);
- return rb_str_conv_enc(str, NULL, rb_default_external_encoding());
- }
-#endif
+ rawmode_arg_t opts, *optp = rawmode_opt(argc, argv, &opts);
+ return ttymode(io, getc_call, set_rawmode, optp);
}
/*
@@ -560,7 +394,7 @@ console_getch(int argc, VALUE *argv, VALUE io)
static VALUE
console_noecho(VALUE io)
{
- return ttymode(io, rb_yield, io, set_noecho, NULL);
+ return ttymode(io, rb_yield, set_noecho, NULL);
}
/*
@@ -612,115 +446,6 @@ console_echo_p(VALUE io)
return echo_p(&t) ? Qtrue : Qfalse;
}
-static const rb_data_type_t conmode_type = {
- "console-mode",
- {0, RUBY_TYPED_DEFAULT_FREE,},
- 0, 0,
- RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED,
-};
-static VALUE cConmode;
-
-static VALUE
-conmode_alloc(VALUE klass)
-{
- return rb_data_typed_object_zalloc(klass, sizeof(conmode), &conmode_type);
-}
-
-static VALUE
-conmode_new(VALUE klass, const conmode *t)
-{
- VALUE obj = conmode_alloc(klass);
- *(conmode *)DATA_PTR(obj) = *t;
- return obj;
-}
-
-static VALUE
-conmode_init_copy(VALUE obj, VALUE obj2)
-{
- conmode *t = rb_check_typeddata(obj, &conmode_type);
- conmode *t2 = rb_check_typeddata(obj2, &conmode_type);
- *t = *t2;
- return obj;
-}
-
-static VALUE
-conmode_set_echo(VALUE obj, VALUE f)
-{
- conmode *t = rb_check_typeddata(obj, &conmode_type);
- if (RTEST(f))
- set_echo(t, NULL);
- else
- set_noecho(t, NULL);
- return obj;
-}
-
-static VALUE
-conmode_set_raw(int argc, VALUE *argv, VALUE obj)
-{
- conmode *t = rb_check_typeddata(obj, &conmode_type);
- rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);
-
- set_rawmode(t, optp);
- return obj;
-}
-
-static VALUE
-conmode_raw_new(int argc, VALUE *argv, VALUE obj)
-{
- conmode *r = rb_check_typeddata(obj, &conmode_type);
- conmode t = *r;
- rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);
-
- set_rawmode(&t, optp);
- return conmode_new(rb_obj_class(obj), &t);
-}
-
-/*
- * call-seq:
- * io.console_mode -> mode
- *
- * Returns a data represents the current console mode.
- *
- * You must require 'io/console' to use this method.
- */
-static VALUE
-console_conmode_get(VALUE io)
-{
- conmode t;
- rb_io_t *fptr;
- int fd;
-
- GetOpenFile(io, fptr);
- fd = GetReadFD(fptr);
- if (!getattr(fd, &t)) rb_sys_fail(0);
-
- return conmode_new(cConmode, &t);
-}
-
-/*
- * call-seq:
- * io.console_mode = mode
- *
- * Sets the console mode to +mode+.
- *
- * You must require 'io/console' to use this method.
- */
-static VALUE
-console_conmode_set(VALUE io, VALUE mode)
-{
- conmode *t, r;
- rb_io_t *fptr;
- int fd;
-
- TypedData_Get_Struct(mode, conmode, &conmode_type, t);
- r = *t;
- GetOpenFile(io, fptr);
- fd = GetReadFD(fptr);
- if (!setattr(fd, &r)) rb_sys_fail(0);
-
- return mode;
-}
-
#if defined TIOCGWINSZ
typedef struct winsize rb_console_size_t;
#define getwinsize(fd, buf) (ioctl((fd), TIOCGWINSZ, (buf)) == 0)
@@ -779,25 +504,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);
@@ -807,62 +525,30 @@ 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;
}
#endif
-#ifdef _WIN32
-static VALUE
-console_check_winsize_changed(VALUE io)
-{
- rb_io_t *fptr;
- HANDLE h;
- DWORD num;
-
- GetOpenFile(io, fptr);
- h = (HANDLE)rb_w32_get_osfhandle(GetReadFD(fptr));
- while (GetNumberOfConsoleInputEvents(h, &num) && num > 0) {
- INPUT_RECORD rec;
- if (ReadConsoleInput(h, &rec, 1, &num)) {
- if (rec.EventType == WINDOW_BUFFER_SIZE_EVENT) {
- rb_yield(Qnil);
- }
- }
- }
- return io;
-}
-#else
-#define console_check_winsize_changed rb_f_notimplement
-#endif
-
/*
* call-seq:
* io.iflush
@@ -940,456 +626,6 @@ 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;
-}
-
-static int
-mode_in_range(VALUE val, int high, const char *modename)
-{
- int mode;
- if (NIL_P(val)) return 0;
- if (!RB_INTEGER_TYPE_P(val)) {
- wrong_value:
- rb_raise(rb_eArgError, "wrong %s mode: %"PRIsVALUE, modename, val);
- }
- if ((mode = NUM2INT(val)) < 0 || mode > high) {
- goto wrong_value;
- }
- return mode;
-}
-
-#if defined _WIN32
-static VALUE
-console_goto(VALUE io, VALUE y, VALUE x)
-{
- 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.Y), UINT2NUM(ws.dwCursorPosition.X));
-}
-
-static VALUE
-console_move(VALUE io, int y, int x)
-{
- rb_io_t *fptr;
- HANDLE h;
- rb_console_size_t ws;
- COORD *pos = &ws.dwCursorPosition;
-
- GetOpenFile(io, fptr);
- h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));
- if (!GetConsoleScreenBufferInfo(h, &ws)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- pos->X += x;
- pos->Y += y;
- if (!SetConsoleCursorPosition(h, *pos)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- return io;
-}
-
-static VALUE
-console_goto_column(VALUE io, VALUE val)
-{
- rb_io_t *fptr;
- HANDLE h;
- rb_console_size_t ws;
- COORD *pos = &ws.dwCursorPosition;
-
- GetOpenFile(io, fptr);
- h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));
- if (!GetConsoleScreenBufferInfo(h, &ws)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- pos->X = NUM2INT(val);
- if (!SetConsoleCursorPosition(h, *pos)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- return io;
-}
-
-static void
-constat_clear(HANDLE handle, WORD attr, DWORD len, COORD pos)
-{
- DWORD written;
-
- FillConsoleOutputAttribute(handle, attr, len, pos, &written);
- FillConsoleOutputCharacterW(handle, L' ', len, pos, &written);
-}
-
-static VALUE
-console_erase_line(VALUE io, VALUE val)
-{
- rb_io_t *fptr;
- HANDLE h;
- rb_console_size_t ws;
- COORD *pos = &ws.dwCursorPosition;
- DWORD w;
- int mode = mode_in_range(val, 2, "line erase");
-
- GetOpenFile(io, fptr);
- h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));
- if (!GetConsoleScreenBufferInfo(h, &ws)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- w = winsize_col(&ws);
- switch (mode) {
- case 0: /* after cursor */
- w -= pos->X;
- break;
- case 1: /* before *and* cursor */
- w = pos->X + 1;
- pos->X = 0;
- break;
- case 2: /* entire line */
- pos->X = 0;
- break;
- }
- constat_clear(h, ws.wAttributes, w, *pos);
- return io;
-}
-
-static VALUE
-console_erase_screen(VALUE io, VALUE val)
-{
- rb_io_t *fptr;
- HANDLE h;
- rb_console_size_t ws;
- COORD *pos = &ws.dwCursorPosition;
- DWORD w;
- int mode = mode_in_range(val, 3, "screen erase");
-
- GetOpenFile(io, fptr);
- h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));
- if (!GetConsoleScreenBufferInfo(h, &ws)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- w = winsize_col(&ws);
- switch (mode) {
- case 0: /* erase after cursor */
- w = (w * (ws.srWindow.Bottom - pos->Y + 1) - pos->X);
- break;
- case 1: /* erase before *and* cursor */
- w = (w * (pos->Y - ws.srWindow.Top) + pos->X + 1);
- pos->X = 0;
- pos->Y = ws.srWindow.Top;
- break;
- case 2: /* erase entire screen */
- w = (w * winsize_row(&ws));
- pos->X = 0;
- pos->Y = ws.srWindow.Top;
- break;
- case 3: /* erase entire screen */
- w = (w * ws.dwSize.Y);
- pos->X = 0;
- pos->Y = 0;
- break;
- }
- constat_clear(h, ws.wAttributes, w, *pos);
- return io;
-}
-
-static VALUE
-console_scroll(VALUE io, int line)
-{
- rb_io_t *fptr;
- HANDLE h;
- rb_console_size_t ws;
-
- GetOpenFile(io, fptr);
- h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));
- if (!GetConsoleScreenBufferInfo(h, &ws)) {
- rb_syserr_fail(LAST_ERROR, 0);
- }
- if (line) {
- SMALL_RECT scroll;
- COORD destination;
- CHAR_INFO fill;
- scroll.Left = 0;
- scroll.Top = line > 0 ? line : 0;
- scroll.Right = winsize_col(&ws) - 1;
- scroll.Bottom = winsize_row(&ws) - 1 + (line < 0 ? line : 0);
- destination.X = 0;
- destination.Y = line < 0 ? -line : 0;
- fill.Char.UnicodeChar = L' ';
- fill.Attributes = ws.wAttributes;
-
- ScrollConsoleScreenBuffer(h, &scroll, NULL, destination, &fill);
- }
- return io;
-}
-
-#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
-struct query_args {
- const char *qstr;
- int opt;
-};
-
-static int
-direct_query(VALUE io, const struct query_args *query)
-{
- if (RB_TYPE_P(io, T_FILE)) {
- rb_io_t *fptr;
- VALUE wio;
- GetOpenFile(io, fptr);
- wio = fptr->tied_io_for_writing;
- if (wio) {
- VALUE s = rb_str_new_cstr(query->qstr);
- rb_io_write(wio, s);
- rb_io_flush(wio);
- return 1;
- }
- if (write(fptr->fd, query->qstr, strlen(query->qstr)) != -1) {
- return 1;
- }
- if (fptr->fd == 0 &&
- write(1, query->qstr, strlen(query->qstr)) != -1) {
- return 1;
- }
- }
- return 0;
-}
-
-static VALUE
-read_vt_response(VALUE io, VALUE query)
-{
- struct query_args *qargs = (struct query_args *)query;
- VALUE result, b;
- int opt = 0;
- int num = 0;
- if (qargs) {
- opt = qargs->opt;
- if (!direct_query(io, qargs)) return Qnil;
- }
- if (rb_io_getbyte(io) != INT2FIX(0x1b)) return Qnil;
- if (rb_io_getbyte(io) != INT2FIX('[')) return Qnil;
- result = rb_ary_new();
- while (!NIL_P(b = rb_io_getbyte(io))) {
- int c = NUM2UINT(b);
- if (c == ';') {
- rb_ary_push(result, INT2NUM(num));
- num = 0;
- }
- else if (ISDIGIT(c)) {
- num = num * 10 + c - '0';
- }
- else if (opt && c == opt) {
- opt = 0;
- }
- else {
- char last = (char)c;
- rb_ary_push(result, INT2NUM(num));
- b = rb_str_new(&last, 1);
- break;
- }
- }
- return rb_ary_push(result, b);
-}
-
-static VALUE
-console_vt_response(int argc, VALUE *argv, VALUE io, const struct query_args *qargs)
-{
- rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 1, &opts);
- VALUE query = (VALUE)qargs;
- VALUE ret = ttymode_with_io(io, read_vt_response, query, set_rawmode, optp);
- return ret;
-}
-
-static VALUE
-console_cursor_pos(VALUE io)
-{
- static const struct query_args query = {"\033[6n", 0};
- VALUE resp = console_vt_response(0, 0, io, &query);
- VALUE row, column, term;
- unsigned int r, c;
- if (!RB_TYPE_P(resp, T_ARRAY) || RARRAY_LEN(resp) != 3) return Qnil;
- term = RARRAY_AREF(resp, 2);
- if (!RB_TYPE_P(term, T_STRING) || RSTRING_LEN(term) != 1) return Qnil;
- if (RSTRING_PTR(term)[0] != 'R') return Qnil;
- row = RARRAY_AREF(resp, 0);
- column = RARRAY_AREF(resp, 1);
- rb_ary_resize(resp, 2);
- r = NUM2UINT(row) - 1;
- c = NUM2UINT(column) - 1;
- RARRAY_ASET(resp, 0, INT2NUM(r));
- RARRAY_ASET(resp, 1, INT2NUM(c));
- return resp;
-}
-
-static VALUE
-console_goto(VALUE io, VALUE y, VALUE x)
-{
- rb_io_write(io, rb_sprintf("\x1b[%d;%dH", NUM2UINT(y)+1, NUM2UINT(x)+1));
- return io;
-}
-
-static VALUE
-console_move(VALUE io, int y, int x)
-{
- if (x || y) {
- VALUE s = rb_str_new_cstr("");
- if (y) rb_str_catf(s, "\x1b[%d%c", y < 0 ? -y : y, y < 0 ? 'A' : 'B');
- if (x) rb_str_catf(s, "\x1b[%d%c", x < 0 ? -x : x, x < 0 ? 'D' : 'C');
- rb_io_write(io, s);
- rb_io_flush(io);
- }
- return io;
-}
-
-static VALUE
-console_goto_column(VALUE io, VALUE val)
-{
- rb_io_write(io, rb_sprintf("\x1b[%dG", NUM2UINT(val)+1));
- return io;
-}
-
-static VALUE
-console_erase_line(VALUE io, VALUE val)
-{
- int mode = mode_in_range(val, 2, "line erase");
- rb_io_write(io, rb_sprintf("\x1b[%dK", mode));
- return io;
-}
-
-static VALUE
-console_erase_screen(VALUE io, VALUE val)
-{
- int mode = mode_in_range(val, 3, "screen erase");
- rb_io_write(io, rb_sprintf("\x1b[%dJ", mode));
- return io;
-}
-
-static VALUE
-console_scroll(VALUE io, int line)
-{
- if (line) {
- VALUE s = rb_sprintf("\x1b[%d%c", line < 0 ? -line : line,
- line < 0 ? 'T' : 'S');
- rb_io_write(io, s);
- }
- return io;
-}
-# define console_key_pressed_p rb_f_notimplement
-#endif
-
-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));
-}
-
-static VALUE
-console_cursor_up(VALUE io, VALUE val)
-{
- return console_move(io, -NUM2INT(val), 0);
-}
-
-static VALUE
-console_cursor_down(VALUE io, VALUE val)
-{
- return console_move(io, +NUM2INT(val), 0);
-}
-
-static VALUE
-console_cursor_left(VALUE io, VALUE val)
-{
- return console_move(io, 0, -NUM2INT(val));
-}
-
-static VALUE
-console_cursor_right(VALUE io, VALUE val)
-{
- return console_move(io, 0, +NUM2INT(val));
-}
-
-static VALUE
-console_scroll_forward(VALUE io, VALUE val)
-{
- return console_scroll(io, +NUM2INT(val));
-}
-
-static VALUE
-console_scroll_backward(VALUE io, VALUE val)
-{
- return console_scroll(io, -NUM2INT(val));
-}
-
-static VALUE
-console_clear_screen(VALUE io)
-{
- console_erase_screen(io, INT2FIX(2));
- console_goto(io, INT2FIX(0), INT2FIX(0));
- return io;
-}
-
/*
* call-seq:
* IO.console -> #<File:/dev/tty>
@@ -1410,9 +646,11 @@ console_dev(int argc, VALUE *argv, VALUE klass)
rb_io_t *fptr;
VALUE sym = 0;
- rb_check_arity(argc, 0, UNLIMITED_ARGUMENTS);
+ rb_check_arity(argc, 0, 1);
if (argc) {
Check_Type(sym = argv[0], T_SYMBOL);
+ --argc;
+ ++argv;
}
if (klass == rb_cIO) klass = rb_cFile;
if (rb_const_defined(klass, id_console)) {
@@ -1424,7 +662,7 @@ console_dev(int argc, VALUE *argv, VALUE klass)
}
}
if (sym) {
- if (sym == ID2SYM(id_close) && argc == 1) {
+ if (sym == ID2SYM(id_close) && !argc) {
if (con) {
rb_io_close(con);
rb_const_remove(klass, id_console);
@@ -1482,7 +720,8 @@ console_dev(int argc, VALUE *argv, VALUE klass)
rb_const_set(klass, id_console, con);
}
if (sym) {
- return rb_f_send(argc, argv, con);
+ /* TODO: avoid inadvertent pindown */
+ return rb_funcall(con, SYM2ID(sym), argc, argv);
}
return con;
}
@@ -1496,101 +735,18 @@ 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, io, 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_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");
- id_intr = rb_intern("intr");
-#ifndef HAVE_RB_F_SEND
- id___send__ = rb_intern("__send__");
-#endif
InitVM(console);
}
@@ -1604,50 +760,15 @@ InitVM_console(void)
rb_define_method(rb_cIO, "getch", console_getch, -1);
rb_define_method(rb_cIO, "echo=", console_set_echo, 1);
rb_define_method(rb_cIO, "echo?", console_echo_p, 0);
- rb_define_method(rb_cIO, "console_mode", console_conmode_get, 0);
- rb_define_method(rb_cIO, "console_mode=", console_conmode_set, 1);
rb_define_method(rb_cIO, "noecho", console_noecho, 0);
rb_define_method(rb_cIO, "winsize", console_winsize, 0);
rb_define_method(rb_cIO, "winsize=", console_set_winsize, 1);
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, "cursor_up", console_cursor_up, 1);
- rb_define_method(rb_cIO, "cursor_down", console_cursor_down, 1);
- rb_define_method(rb_cIO, "cursor_left", console_cursor_left, 1);
- rb_define_method(rb_cIO, "cursor_right", console_cursor_right, 1);
- rb_define_method(rb_cIO, "goto_column", console_goto_column, 1);
- rb_define_method(rb_cIO, "erase_line", console_erase_line, 1);
- rb_define_method(rb_cIO, "erase_screen", console_erase_screen, 1);
- rb_define_method(rb_cIO, "scroll_forward", console_scroll_forward, 1);
- rb_define_method(rb_cIO, "scroll_backward", console_scroll_backward, 1);
- rb_define_method(rb_cIO, "clear_screen", console_clear_screen, 0);
- rb_define_method(rb_cIO, "pressed?", console_key_pressed_p, 1);
- rb_define_method(rb_cIO, "check_winsize_changed", console_check_winsize_changed, 0);
-#if ENABLE_IO_GETPASS
- rb_define_method(rb_cIO, "getpass", console_getpass, -1);
-#endif
rb_define_singleton_method(rb_cIO, "console", console_dev, -1);
{
VALUE mReadable = rb_define_module_under(rb_cIO, "generic_readable");
rb_define_method(mReadable, "getch", io_getch, -1);
-#if ENABLE_IO_GETPASS
- rb_define_method(mReadable, "getpass", io_getpass, -1);
-#endif
- }
- {
- /* :stopdoc: */
- cConmode = rb_define_class_under(rb_cIO, "ConsoleMode", rb_cObject);
- rb_define_alloc_func(cConmode, conmode_alloc);
- rb_undef_method(cConmode, "initialize");
- rb_define_method(cConmode, "initialize_copy", conmode_init_copy, 1);
- rb_define_method(cConmode, "echo=", conmode_set_echo, 1);
- rb_define_method(cConmode, "raw!", conmode_set_raw, -1);
- rb_define_method(cConmode, "raw", conmode_raw_new, -1);
- /* :startdoc: */
}
}
diff --git a/ext/io/console/depend b/ext/io/console/depend
index 9c8f9cd22e..e786dc71d2 100644
--- a/ext/io/console/depend
+++ b/ext/io/console/depend
@@ -1,39 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-console.o: $(RUBY_EXTCONF_H)
-console.o: $(arch_hdrdir)/ruby/config.h
-console.o: $(hdrdir)/ruby.h
-console.o: $(hdrdir)/ruby/assert.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: $(hdrdir)/ruby/thread.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 a6049da667..eb431b008d 100644
--- a/ext/io/console/extconf.rb
+++ b/ext/io/console/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
ok = true
@@ -6,8 +5,6 @@ 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}"
when hdr = %w"termios.h termio.h".find {|h| have_header(h)}
have_func("cfmakeraw", hdr)
when have_header(hdr = "sgtty.h")
@@ -16,15 +13,9 @@ else
ok = false
end
if ok
- have_header("sys/ioctl.h") if hdr
+ have_header("sys/ioctl.h")
# rb_check_hash_type: 1.9.3
# rb_io_get_write_io: 1.9.1
# rb_cloexec_open: 2.0.0
- # rb_funcallv: 2.1.0
- # RARRAY_CONST_PTR: 2.1.0
- # rb_sym2str: 2.2.0
- $defs << "-D""ENABLE_IO_GETPASS=1"
- create_makefile("io/console") {|conf|
- conf << "\n""VK_HEADER = #{vk_header}\n"
- }
+ create_makefile("io/console")
end
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
index fac9bff9b7..52ecdd9603 100644
--- a/ext/io/console/io-console.gemspec
+++ b/ext/io/console/io-console.gemspec
@@ -1,5 +1,5 @@
# -*- ruby -*-
-_VERSION = "0.5.3"
+_VERSION = "0.4.3"
date = %w$Date:: $[1]
Gem::Specification.new do |s|
@@ -9,19 +9,13 @@ Gem::Specification.new do |s|
s.summary = "Console interface"
s.email = "nobu@ruby-lang.org"
s.description = "add console capabilities to IO instances."
- s.required_ruby_version = ">= 2.2.0"
- s.homepage = "https://github.com/ruby/io-console"
- s.metadata["source_code_url"] = s.homepage
+ s.required_ruby_version = ">= 2.0.0"
+ s.homepage = "http://www.ruby-lang.org"
s.authors = ["Nobu Nakada"]
s.require_path = %[lib]
- s.files = %w[
- LICENSE.txt
- README.md
- ext/io/console/console.c
- ext/io/console/extconf.rb
- ext/io/console/win32_vk.inc
- lib/io/console/size.rb
- ]
- s.extensions = %w[ext/io/console/extconf.rb]
- s.license = "BSD-2-Clause"
+ 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/
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 bea4a15e23..e786dc71d2 100644
--- a/ext/io/nonblock/depend
+++ b/ext/io/nonblock/depend
@@ -1,18 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-nonblock.o: $(RUBY_EXTCONF_H)
-nonblock.o: $(arch_hdrdir)/ruby/config.h
-nonblock.o: $(hdrdir)/ruby.h
-nonblock.o: $(hdrdir)/ruby/assert.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: 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..2c5c298126 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;
}
/*
@@ -122,8 +121,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 bbf1266aba..e786dc71d2 100644
--- a/ext/io/wait/depend
+++ b/ext/io/wait/depend
@@ -1,18 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-wait.o: $(RUBY_EXTCONF_H)
-wait.o: $(arch_hdrdir)/ruby/config.h
-wait.o: $(hdrdir)/ruby.h
-wait.o: $(hdrdir)/ruby/assert.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: 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 d846bba49e..fd32be79b1 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
@@ -95,49 +71,67 @@ io_nread(VALUE io)
/*
* call-seq:
- * io.ready? -> true or false
+ * io.ready? -> true, false or nil
*
* Returns true if input available without blocking, or false.
+ * Returns nil if no information available.
*/
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;
}
@@ -146,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;
}
@@ -247,7 +181,7 @@ Init_wait(void)
{
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/depend b/ext/json/depend
deleted file mode 100644
index 0301ce074c..0000000000
--- a/ext/json/depend
+++ /dev/null
@@ -1,2 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-# AUTOGENERATED DEPENDENCIES END
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..5a0a27cda5 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
diff --git a/ext/json/generator/depend b/ext/json/generator/depend
index 3f04c0d625..b7373cde1f 100644
--- a/ext/json/generator/depend
+++ b/ext/json/generator/depend
@@ -4,21 +4,18 @@ 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.h
-generator.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../fbuffer/fbuffer.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 881435e3dc..f56ac09cd2 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,
+ 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
@@ -237,7 +230,6 @@ static void convert_UTF8_to_JSON(FBuffer *buffer, VALUE string)
int escape_len;
unsigned char c;
char buf[6] = { '\\', 'u' };
- int ascii_only = rb_enc_str_asciionly_p(string);
for (start = 0, end = 0; end < len;) {
p = ptr + end;
@@ -282,17 +274,14 @@ static void convert_UTF8_to_JSON(FBuffer *buffer, VALUE string)
break;
default:
{
- unsigned short clen = 1;
- if (!ascii_only) {
- clen += trailingBytesForUTF8[c];
- if (end + clen > len) {
- rb_raise(rb_path2class("JSON::GeneratorError"),
- "partial character in source, but hit end");
- }
- if (!isLegalUTF8((UTF8 *) p, clen)) {
- rb_raise(rb_path2class("JSON::GeneratorError"),
- "source sequence is illegal/malformed utf-8");
- }
+ unsigned short clen = trailingBytesForUTF8[c] + 1;
+ if (end + clen > len) {
+ rb_raise(rb_path2class("JSON::GeneratorError"),
+ "partial character in source, but hit end");
+ }
+ if (!isLegalUTF8((UTF8 *) p, clen)) {
+ rb_raise(rb_path2class("JSON::GeneratorError"),
+ "source sequence is illegal/malformed utf-8");
}
end += clen;
}
@@ -312,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;
}
@@ -353,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(*)
*
@@ -384,7 +361,6 @@ static VALUE mBignum_to_json(int argc, VALUE *argv, VALUE self)
{
GENERATE_JSON(bignum);
}
-#endif
/*
* call-seq: to_json(*)
@@ -539,22 +515,23 @@ static size_t State_memsize(const void *ptr)
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(void)
+{
+ JSON_Generator_State *state = ZALLOC(JSON_Generator_State);
+ 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 TypedData_Wrap_Struct(klass, &JSON_Generator_State_type, state);
}
/*
@@ -646,6 +623,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;
}
@@ -679,6 +658,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));
@@ -688,7 +668,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)
{
@@ -696,14 +676,14 @@ static VALUE cState_aref(VALUE self, VALUE name)
if (RTEST(rb_funcall(self, i_respond_to_p, 1, name))) {
return rb_funcall(self, i_send, 1, name);
} else {
- return rb_attr_get(self, rb_intern_str(rb_str_concat(rb_str_new2("@"), name)));
+ return rb_ivar_get(self, rb_intern_str(rb_str_concat(rb_str_new2("@"), 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)
{
@@ -719,83 +699,43 @@ static VALUE cState_aset(VALUE self, VALUE name, VALUE value)
return Qnil;
}
-struct hash_foreach_arg {
- FBuffer *buffer;
- JSON_Generator_State *state;
- VALUE Vstate;
- int iter;
-};
-
-static int
-json_object_i(VALUE key, VALUE val, VALUE _arg)
+static void generate_json_object(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
{
- struct hash_foreach_arg *arg = (struct hash_foreach_arg *)_arg;
- FBuffer *buffer = arg->buffer;
- JSON_Generator_State *state = arg->state;
- VALUE Vstate = arg->Vstate;
-
char *object_nl = state->object_nl;
long object_nl_len = state->object_nl_len;
char *indent = state->indent;
long indent_len = state->indent_len;
+ long max_nesting = state->max_nesting;
char *delim = FBUFFER_PTR(state->object_delim);
long delim_len = FBUFFER_LEN(state->object_delim);
char *delim2 = FBUFFER_PTR(state->object_delim2);
long delim2_len = FBUFFER_LEN(state->object_delim2);
- long depth = state->depth;
- int j;
- VALUE klass, key_to_s;
-
- if (arg->iter > 0) fbuffer_append(buffer, delim, delim_len);
- if (object_nl) {
- fbuffer_append(buffer, object_nl, object_nl_len);
- }
- if (indent) {
- for (j = 0; j < depth; j++) {
- fbuffer_append(buffer, indent, indent_len);
- }
- }
-
- klass = CLASS_OF(key);
- if (klass == rb_cString) {
- key_to_s = key;
- } else if (klass == rb_cSymbol) {
- key_to_s = rb_id2str(SYM2ID(key));
- } else {
- key_to_s = rb_funcall(key, i_to_s, 0);
- }
- Check_Type(key_to_s, T_STRING);
- generate_json(buffer, Vstate, state, key_to_s);
- fbuffer_append(buffer, delim2, delim2_len);
- generate_json(buffer, Vstate, state, val);
-
- arg->iter++;
- return ST_CONTINUE;
-}
-
-static void generate_json_object(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
-{
- char *object_nl = state->object_nl;
- long object_nl_len = state->object_nl_len;
- char *indent = state->indent;
- long indent_len = state->indent_len;
- long max_nesting = state->max_nesting;
long depth = ++state->depth;
- int j;
- struct hash_foreach_arg arg;
-
+ int i, j;
+ VALUE key, key_to_s, keys;
if (max_nesting != 0 && depth > max_nesting) {
fbuffer_free(buffer);
rb_raise(eNestingError, "nesting of %ld is too deep", --state->depth);
}
fbuffer_append_char(buffer, '{');
-
- arg.buffer = buffer;
- arg.state = state;
- arg.Vstate = Vstate;
- arg.iter = 0;
- rb_hash_foreach(obj, json_object_i, (VALUE)&arg);
-
+ keys = rb_funcall(obj, i_keys, 0);
+ for(i = 0; i < RARRAY_LEN(keys); i++) {
+ if (i > 0) fbuffer_append(buffer, delim, delim_len);
+ if (object_nl) {
+ fbuffer_append(buffer, object_nl, object_nl_len);
+ }
+ if (indent) {
+ for (j = 0; j < depth; j++) {
+ fbuffer_append(buffer, indent, indent_len);
+ }
+ }
+ key = rb_ary_entry(keys, i);
+ key_to_s = rb_funcall(key, i_to_s, 0);
+ Check_Type(key_to_s, T_STRING);
+ generate_json(buffer, Vstate, state, key_to_s);
+ fbuffer_append(buffer, delim2, delim2_len);
+ generate_json(buffer, Vstate, state, rb_hash_aref(obj, key));
+ }
depth = --state->depth;
if (object_nl) {
fbuffer_append(buffer, object_nl, object_nl_len);
@@ -846,22 +786,11 @@ static void generate_json_array(FBuffer *buffer, VALUE Vstate, JSON_Generator_St
fbuffer_append_char(buffer, ']');
}
-#ifdef HAVE_RUBY_ENCODING_H
-static int enc_utf8_compatible_p(rb_encoding *enc)
-{
- if (enc == rb_usascii_encoding()) return 1;
- if (enc == rb_utf8_encoding()) return 1;
- return 0;
-}
-#endif
-
static void generate_json_string(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj)
{
fbuffer_append_char(buffer, '"');
#ifdef HAVE_RUBY_ENCODING_H
- if (!enc_utf8_compatible_p(rb_enc_get(obj))) {
- obj = rb_str_encode(obj, CEncoding_UTF_8, 0, Qnil);
- }
+ obj = rb_funcall(obj, i_encode, 1, CEncoding_UTF_8);
#endif
if (state->ascii_only) {
convert_UTF8_to_JSON_ASCII(buffer, obj);
@@ -897,15 +826,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);
@@ -939,9 +859,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);
@@ -952,7 +872,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);
}
}
@@ -973,7 +893,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);
@@ -996,6 +915,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
@@ -1006,7 +940,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;
}
@@ -1025,8 +961,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.
- * * *ascii_only*: true if only ASCII characters should be generated. This
- * ontions 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.
*/
@@ -1044,7 +980,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)
@@ -1082,15 +1018,17 @@ static VALUE cState_from_state_s(VALUE self, VALUE opts)
} else if (rb_obj_is_kind_of(opts, rb_cHash)) {
return rb_funcall(self, i_new, 1, opts);
} else {
- VALUE prototype = rb_const_get(mJSON, i_SAFE_STATE_PROTOTYPE);
- return rb_funcall(prototype, i_dup, 0);
+ if (NIL_P(CJSON_SAFE_STATE_PROTOTYPE)) {
+ CJSON_SAFE_STATE_PROTOTYPE = rb_const_get(mJSON, i_SAFE_STATE_PROTOTYPE);
+ }
+ return rb_funcall(CJSON_SAFE_STATE_PROTOTYPE, i_dup, 0);
}
}
/*
* 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)
{
@@ -1101,7 +1039,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)
{
@@ -1117,7 +1055,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;
@@ -1126,7 +1064,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)
@@ -1138,7 +1076,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)
@@ -1155,7 +1093,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;
@@ -1164,7 +1102,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)
{
@@ -1175,7 +1113,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)
{
@@ -1191,7 +1129,7 @@ static VALUE cState_space_before_set(VALUE self, VALUE space_before)
}
} else {
if (state->space_before) ruby_xfree(state->space_before);
- state->space_before = fstrndup(RSTRING_PTR(space_before), len);
+ state->space_before = strdup(RSTRING_PTR(space_before));
state->space_before_len = len;
}
return Qnil;
@@ -1228,7 +1166,7 @@ static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
}
} else {
if (state->object_nl) ruby_xfree(state->object_nl);
- state->object_nl = fstrndup(RSTRING_PTR(object_nl), len);
+ state->object_nl = strdup(RSTRING_PTR(object_nl));
state->object_nl_len = len;
}
return Qnil;
@@ -1263,7 +1201,7 @@ static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
}
} else {
if (state->array_nl) ruby_xfree(state->array_nl);
- state->array_nl = fstrndup(RSTRING_PTR(array_nl), len);
+ state->array_nl = strdup(RSTRING_PTR(array_nl));
state->array_nl_len = len;
}
return Qnil;
@@ -1322,7 +1260,7 @@ static VALUE cState_allow_nan_p(VALUE self)
/*
* call-seq: ascii_only?
*
- * Returns true, if only ASCII characters should be generated. Otherwise
+ * Returns true, if NaN, Infinity, and -Infinity should be generated, otherwise
* returns false.
*/
static VALUE cState_ascii_only_p(VALUE self)
@@ -1332,6 +1270,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.
@@ -1359,7 +1320,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)
{
@@ -1390,7 +1351,6 @@ static VALUE cState_buffer_initial_length_set(VALUE self, VALUE buffer_initial_l
*/
void Init_generator(void)
{
-#undef rb_intern
rb_require("json/common");
mJSON = rb_define_module("JSON");
@@ -1399,8 +1359,6 @@ void Init_generator(void)
eGeneratorError = rb_path2class("JSON::GeneratorError");
eNestingError = rb_path2class("JSON::NestingError");
- rb_gc_register_mark_object(eGeneratorError);
- rb_gc_register_mark_object(eNestingError);
cState = rb_define_class_under(mGenerator, "State", rb_cObject);
rb_define_alloc_func(cState, cState_s_allocate);
@@ -1422,6 +1380,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);
@@ -1441,15 +1402,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");
@@ -1466,6 +1422,7 @@ void Init_generator(void)
mNilClass = rb_define_module_under(mGeneratorMethods, "NilClass");
rb_define_method(mNilClass, "to_json", mNilClass_to_json, -1);
+ CRegexp_MULTILINE = rb_const_get(rb_cRegexp, rb_intern("MULTILINE"));
i_to_s = rb_intern("to_s");
i_to_json = rb_intern("to_json");
i_new = rb_intern("new");
@@ -1477,6 +1434,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");
@@ -1496,4 +1454,5 @@ void Init_generator(void)
i_encode = rb_intern("encode");
#endif
i_SAFE_STATE_PROTOTYPE = rb_intern("SAFE_STATE_PROTOTYPE");
+ CJSON_SAFE_STATE_PROTOTYPE = Qnil;
}
diff --git a/ext/json/generator/generator.h b/ext/json/generator/generator.h
index c367a6209a..ddd1aa8a30 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,6 +73,7 @@ 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;
@@ -97,12 +99,8 @@ typedef struct JSON_Generator_StateStruct {
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);
@@ -114,6 +112,7 @@ 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 JSON_Generator_State *State_allocate(void);
static VALUE cState_s_allocate(VALUE klass);
static VALUE cState_configure(VALUE self, VALUE opts);
static VALUE cState_to_h(VALUE self);
@@ -124,9 +123,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 +147,6 @@ 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 d8be2e52c6..0000000000
--- a/ext/json/json.gemspec
+++ /dev/null
@@ -1,133 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = "json"
- s.version = "2.3.0"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.require_paths = ["lib"]
- s.authors = ["Florian Frank"]
- s.date = "2019-12-11"
- s.description = "This is a JSON implementation as a Ruby extension in C."
- s.email = "flori@ping.de"
- s.extensions = ["ext/json/ext/generator/extconf.rb", "ext/json/ext/parser/extconf.rb", "ext/json/extconf.rb"]
- s.extra_rdoc_files = ["README.md"]
- s.files = [
- ".gitignore",
- ".travis.yml",
- "CHANGES.md",
- "Gemfile",
- "README-json-jruby.md",
- "README.md",
- "Rakefile",
- "VERSION",
- "diagrams/.keep",
- "ext/json/ext/fbuffer/fbuffer.h",
- "ext/json/ext/generator/depend",
- "ext/json/ext/generator/extconf.rb",
- "ext/json/ext/generator/generator.c",
- "ext/json/ext/generator/generator.h",
- "ext/json/ext/parser/depend",
- "ext/json/ext/parser/extconf.rb",
- "ext/json/ext/parser/parser.c",
- "ext/json/ext/parser/parser.h",
- "ext/json/ext/parser/parser.rl",
- "ext/json/extconf.rb",
- "install.rb",
- "java/src/json/ext/ByteListTranscoder.java",
- "java/src/json/ext/Generator.java",
- "java/src/json/ext/GeneratorMethods.java",
- "java/src/json/ext/GeneratorService.java",
- "java/src/json/ext/GeneratorState.java",
- "java/src/json/ext/OptionsReader.java",
- "java/src/json/ext/Parser.java",
- "java/src/json/ext/Parser.rl",
- "java/src/json/ext/ParserService.java",
- "java/src/json/ext/RuntimeInfo.java",
- "java/src/json/ext/StringDecoder.java",
- "java/src/json/ext/StringEncoder.java",
- "java/src/json/ext/Utils.java",
- "json-java.gemspec",
- "json.gemspec",
- "json_pure.gemspec",
- "lib/json.rb",
- "lib/json/add/bigdecimal.rb",
- "lib/json/add/complex.rb",
- "lib/json/add/core.rb",
- "lib/json/add/date.rb",
- "lib/json/add/date_time.rb",
- "lib/json/add/exception.rb",
- "lib/json/add/ostruct.rb",
- "lib/json/add/range.rb",
- "lib/json/add/rational.rb",
- "lib/json/add/regexp.rb",
- "lib/json/add/set.rb",
- "lib/json/add/struct.rb",
- "lib/json/add/symbol.rb",
- "lib/json/add/time.rb",
- "lib/json/common.rb",
- "lib/json/ext.rb",
- "lib/json/ext/.keep",
- "lib/json/generic_object.rb",
- "lib/json/pure.rb",
- "lib/json/pure/generator.rb",
- "lib/json/pure/parser.rb",
- "lib/json/version.rb",
- "references/rfc7159.txt",
- "tests/fixtures/fail10.json",
- "tests/fixtures/fail11.json",
- "tests/fixtures/fail12.json",
- "tests/fixtures/fail13.json",
- "tests/fixtures/fail14.json",
- "tests/fixtures/fail18.json",
- "tests/fixtures/fail19.json",
- "tests/fixtures/fail2.json",
- "tests/fixtures/fail20.json",
- "tests/fixtures/fail21.json",
- "tests/fixtures/fail22.json",
- "tests/fixtures/fail23.json",
- "tests/fixtures/fail24.json",
- "tests/fixtures/fail25.json",
- "tests/fixtures/fail27.json",
- "tests/fixtures/fail28.json",
- "tests/fixtures/fail3.json",
- "tests/fixtures/fail4.json",
- "tests/fixtures/fail5.json",
- "tests/fixtures/fail6.json",
- "tests/fixtures/fail7.json",
- "tests/fixtures/fail8.json",
- "tests/fixtures/fail9.json",
- "tests/fixtures/obsolete_fail1.json",
- "tests/fixtures/pass1.json",
- "tests/fixtures/pass15.json",
- "tests/fixtures/pass16.json",
- "tests/fixtures/pass17.json",
- "tests/fixtures/pass2.json",
- "tests/fixtures/pass26.json",
- "tests/fixtures/pass3.json",
- "tests/json_addition_test.rb",
- "tests/json_common_interface_test.rb",
- "tests/json_encoding_test.rb",
- "tests/json_ext_parser_test.rb",
- "tests/json_fixtures_test.rb",
- "tests/json_generator_test.rb",
- "tests/json_generic_object_test.rb",
- "tests/json_parser_test.rb",
- "tests/json_string_matching_test.rb",
- "tests/test_helper.rb",
- "tests/test_helper.rb",
- "tools/diff.sh",
- "tools/fuzz.rb",
- "tools/server.rb",
- ]
- s.homepage = "http://flori.github.com/json"
- s.licenses = ["Ruby"]
- s.rdoc_options = ["--title", "JSON implemention for Ruby", "--main", "README.md"]
- s.required_ruby_version = Gem::Requirement.new(">= 1.9")
- s.rubygems_version = "3.0.3"
- s.summary = "JSON Implementation for Ruby"
- s.test_files = ["tests/test_helper.rb"]
-
- s.add_development_dependency("rake", [">= 0"])
- s.add_development_dependency("test-unit", ["~> 2.0"])
-end
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 c8b4f567cb..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
@@ -23,7 +22,7 @@ class BigDecimal
end
# return the JSON value
- def to_json(*args)
- as_json.to_json(*args)
+ def to_json(*)
+ as_json.to_json
end
end
diff --git a/ext/json/lib/json/add/complex.rb b/ext/json/lib/json/add/complex.rb
index 4d977e7589..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,8 +16,7 @@ class Complex
}
end
- # Stores class name (Complex) along with real value <tt>r</tt> and imaginary value <tt>i</tt> as JSON string
- def to_json(*args)
- as_json.to_json(*args)
+ def to_json(*)
+ as_json.to_json
end
end
diff --git a/ext/json/lib/json/add/core.rb b/ext/json/lib/json/add/core.rb
index 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..458d9eba96 100644
--- a/ext/json/lib/json/add/date.rb
+++ b/ext/json/lib/json/add/date.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/date_time.rb b/ext/json/lib/json/add/date_time.rb
index 38b0e86ab8..a1009cf5dc 100644
--- a/ext/json/lib/json/add/date_time.rb
+++ b/ext/json/lib/json/add/date_time.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/exception.rb b/ext/json/lib/json/add/exception.rb
index a107e5b3c4..f4b150d236 100644
--- a/ext/json/lib/json/add/exception.rb
+++ b/ext/json/lib/json/add/exception.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/ostruct.rb b/ext/json/lib/json/add/ostruct.rb
index 686cf0025d..a62f92f59b 100644
--- a/ext/json/lib/json/add/ostruct.rb
+++ b/ext/json/lib/json/add/ostruct.rb
@@ -1,4 +1,3 @@
-#frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
@@ -7,7 +6,7 @@ require 'ostruct'
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
@@ -23,7 +22,7 @@ class OpenStruct
}
end
- # Stores class name (OpenStruct) with this struct's values <tt>t</tt> as a
+ # Stores class name (OpenStruct) with this struct's values <tt>v</tt> as a
# JSON string.
def to_json(*args)
as_json.to_json(*args)
diff --git a/ext/json/lib/json/add/range.rb b/ext/json/lib/json/add/range.rb
index 93529fb1c4..0df382c60a 100644
--- a/ext/json/lib/json/add/range.rb
+++ b/ext/json/lib/json/add/range.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/rational.rb b/ext/json/lib/json/add/rational.rb
index 6be4034581..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,8 +16,7 @@ class Rational
}
end
- # Stores class name (Rational) along with numerator value <tt>n</tt> and denominator value <tt>d</tt> as JSON string
- def to_json(*args)
- as_json.to_json(*args)
+ def to_json(*)
+ as_json.to_json
end
end
diff --git a/ext/json/lib/json/add/regexp.rb b/ext/json/lib/json/add/regexp.rb
index 39d69fede7..9adf06c8f6 100644
--- a/ext/json/lib/json/add/regexp.rb
+++ b/ext/json/lib/json/add/regexp.rb
@@ -1,4 +1,3 @@
-#frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
@@ -24,7 +23,7 @@ class Regexp
# Stores class name (Regexp) with options <tt>o</tt> and source <tt>s</tt>
# (Regexp or String) as JSON string
- def to_json(*args)
- as_json.to_json(*args)
+ def to_json(*)
+ as_json.to_json
end
end
diff --git a/ext/json/lib/json/add/set.rb b/ext/json/lib/json/add/set.rb
deleted file mode 100644
index 71e2a0ac8b..0000000000
--- a/ext/json/lib/json/add/set.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
- require 'json'
-end
-defined?(::Set) or require 'set'
-
-class Set
- # Import a JSON Marshalled object.
- #
- # method used for JSON marshalling support.
- def self.json_create(object)
- new object['a']
- end
-
- # Marshal the object to JSON.
- #
- # method used for JSON marshalling support.
- def as_json(*)
- {
- JSON.create_id => self.class.name,
- 'a' => to_a,
- }
- end
-
- # return the JSON value
- def to_json(*args)
- as_json.to_json(*args)
- end
-end
-
diff --git a/ext/json/lib/json/add/struct.rb b/ext/json/lib/json/add/struct.rb
index e8395ed42f..e1e24800d0 100644
--- a/ext/json/lib/json/add/struct.rb
+++ b/ext/json/lib/json/add/struct.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/symbol.rb b/ext/json/lib/json/add/symbol.rb
index 74b13a423f..6df77cab09 100644
--- a/ext/json/lib/json/add/symbol.rb
+++ b/ext/json/lib/json/add/symbol.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/time.rb b/ext/json/lib/json/add/time.rb
index b73acc4086..25cec9fe91 100644
--- a/ext/json/lib/json/add/time.rb
+++ b/ext/json/lib/json/add/time.rb
@@ -1,4 +1,3 @@
-#frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
require 'json'
end
@@ -10,7 +9,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 3be9fd8dc5..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,21 +138,21 @@ 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 = {})
- Parser.new(source, **(opts||{})).parse
+ Parser.new(source, opts).parse
end
# Parse the JSON document _source_ into a Ruby data structure and return it.
@@ -162,21 +161,21 @@ 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)
- Parser.new(source, **(opts||{})).parse
+ }.update(opts)
+ Parser.new(source, opts).parse
end
# Generate a JSON document from the Ruby data structure _obj_ and return
@@ -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 9d781df875..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.3.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 d0c9c2d2a6..bc5db06404 100644
--- a/ext/json/parser/depend
+++ b/ext/json/parser/depend
@@ -4,19 +4,16 @@ 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.h
-parser.o: $(hdrdir)/ruby/assert.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: $(srcdir)/../fbuffer/fbuffer.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
diff --git a/ext/json/parser/extconf.rb b/ext/json/parser/extconf.rb
index f7360d46b2..2addc53e7f 100644
--- a/ext/json/parser/extconf.rb
+++ b/ext/json/parser/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
have_func("rb_enc_raise", "ruby.h")
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index 0f98cf9827..8e168e1bd4 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -1,10 +1,10 @@
-/* This file is automatically generated from parser.rl by using ragel */
+
#line 1 "parser.rl"
#include "../fbuffer/fbuffer.h"
#include "parser.h"
#if defined HAVE_RUBY_ENCODING_H
-# define EXC_ENCODING rb_utf8_encoding(),
+# define EXC_ENCODING UTF_8,
# ifndef HAVE_RB_ENC_RAISE
static void
enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
@@ -27,7 +27,7 @@ enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
/* unicode */
-static const signed char digit_values[256] = {
+static const char digit_values[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -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, 2, 3, 4, 5, 6, 7, 8, 9, -1,
@@ -46,20 +46,20 @@ static const signed char digit_values[256] = {
static UTF32 unescape_unicode(const unsigned char *p)
{
- signed char b;
+ char b;
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,22 +89,26 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
return len;
}
+#ifdef HAVE_RUBY_ENCODING_H
+static rb_encoding *UTF_8, *UTF_16BE, *UTF_16LE, *UTF_32BE, *UTF_32LE;
+#else
+static ID i_iconv;
+#endif
+
static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
static VALUE CNaN, CInfinity, CMinusInfinity;
-static VALUE cBigDecimal = Qundef;
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_BigDecimal;
+ 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 126 "parser.rl"
+#line 130 "parser.rl"
-#line 108 "parser.c"
+#line 112 "parser.c"
enum {JSON_object_start = 1};
enum {JSON_object_first_final = 27};
enum {JSON_object_error = 0};
@@ -112,30 +116,30 @@ enum {JSON_object_error = 0};
enum {JSON_object_en_main = 1};
-#line 167 "parser.rl"
+#line 171 "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 132 "parser.c"
+#line 136 "parser.c"
{
cs = JSON_object_start;
}
-#line 182 "parser.rl"
+#line 186 "parser.rl"
-#line 139 "parser.c"
+#line 143 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -163,7 +167,7 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 149 "parser.rl"
+#line 153 "parser.rl"
{
char *np;
json->parsing_name = 1;
@@ -176,7 +180,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 180 "parser.c"
+#line 184 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -243,10 +247,10 @@ case 8:
goto st8;
goto st0;
tr11:
-#line 134 "parser.rl"
+#line 138 "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 {
@@ -263,7 +267,7 @@ st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 267 "parser.c"
+#line 271 "parser.c"
switch( (*p) ) {
case 13: goto st9;
case 32: goto st9;
@@ -352,14 +356,14 @@ case 18:
goto st9;
goto st18;
tr4:
-#line 157 "parser.rl"
+#line 161 "parser.rl"
{ p--; {p++; cs = 27; goto _out;} }
goto st27;
st27:
if ( ++p == pe )
goto _test_eof27;
case 27:
-#line 363 "parser.c"
+#line 367 "parser.c"
goto st0;
st19:
if ( ++p == pe )
@@ -457,7 +461,7 @@ case 26:
_out: {}
}
-#line 183 "parser.rl"
+#line 187 "parser.rl"
if (cs >= JSON_object_first_final) {
if (json->create_additions) {
@@ -482,78 +486,69 @@ case 26:
-#line 486 "parser.c"
+#line 490 "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 283 "parser.rl"
+#line 291 "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 502 "parser.c"
+#line 506 "parser.c"
{
cs = JSON_value_start;
}
-#line 290 "parser.rl"
+#line 298 "parser.rl"
-#line 509 "parser.c"
+#line 513 "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 235 "parser.rl"
+tr0:
+#line 239 "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 240 "parser.rl"
+ goto st21;
+tr2:
+#line 244 "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);
}
@@ -562,27 +557,31 @@ tr3:
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 258 "parser.rl"
+ goto st21;
+tr5:
+#line 262 "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 264 "parser.rl"
+ goto st21;
+tr9:
+#line 270 "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 228 "parser.rl"
+ goto st21;
+tr16:
+#line 232 "parser.rl"
{
if (json->allow_nan) {
*result = CInfinity;
@@ -590,9 +589,9 @@ tr25:
rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 8);
}
}
- goto st29;
-tr27:
-#line 221 "parser.rl"
+ goto st21;
+tr18:
+#line 225 "parser.rl"
{
if (json->allow_nan) {
*result = CNaN;
@@ -600,240 +599,168 @@ tr27:
rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p - 2);
}
}
- goto st29;
-tr31:
-#line 215 "parser.rl"
+ goto st21;
+tr22:
+#line 219 "parser.rl"
{
*result = Qfalse;
}
- goto st29;
-tr34:
-#line 212 "parser.rl"
+ goto st21;
+tr25:
+#line 216 "parser.rl"
{
*result = Qnil;
}
- goto st29;
-tr37:
-#line 218 "parser.rl"
+ goto st21;
+tr28:
+#line 222 "parser.rl"
{
*result = Qtrue;
}
- goto st29;
-st29:
+ goto st21;
+st21:
if ( ++p == pe )
- goto _test_eof29;
-case 29:
-#line 270 "parser.rl"
- { p--; {p++; cs = 29; goto _out;} }
-#line 629 "parser.c"
- switch( (*p) ) {
- case 13: goto st29;
- case 32: goto st29;
- case 47: goto st2;
- }
- if ( 9 <= (*p) && (*p) <= 10 )
- goto st29;
+ goto _test_eof21;
+case 21:
+#line 278 "parser.rl"
+ { p--; {p++; cs = 21; goto _out;} }
+#line 628 "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;
@@ -853,20 +780,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 291 "parser.rl"
+#line 299 "parser.rl"
if (cs >= JSON_value_first_final) {
return p;
@@ -876,7 +795,7 @@ case 28:
}
-#line 880 "parser.c"
+#line 799 "parser.c"
enum {JSON_integer_start = 1};
enum {JSON_integer_first_final = 3};
enum {JSON_integer_error = 0};
@@ -884,7 +803,7 @@ enum {JSON_integer_error = 0};
enum {JSON_integer_en_main = 1};
-#line 307 "parser.rl"
+#line 315 "parser.rl"
static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *result)
@@ -892,15 +811,15 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
int cs = EVIL;
-#line 896 "parser.c"
+#line 815 "parser.c"
{
cs = JSON_integer_start;
}
-#line 314 "parser.rl"
+#line 322 "parser.rl"
json->memo = p;
-#line 904 "parser.c"
+#line 823 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -934,14 +853,14 @@ case 3:
goto st0;
goto tr4;
tr4:
-#line 304 "parser.rl"
+#line 312 "parser.rl"
{ p--; {p++; cs = 4; goto _out;} }
goto st4;
st4:
if ( ++p == pe )
goto _test_eof4;
case 4:
-#line 945 "parser.c"
+#line 864 "parser.c"
goto st0;
st5:
if ( ++p == pe )
@@ -960,7 +879,7 @@ case 5:
_out: {}
}
-#line 316 "parser.rl"
+#line 324 "parser.rl"
if (cs >= JSON_integer_first_final) {
long len = p - json->memo;
@@ -975,7 +894,7 @@ case 5:
}
-#line 979 "parser.c"
+#line 898 "parser.c"
enum {JSON_float_start = 1};
enum {JSON_float_first_final = 8};
enum {JSON_float_error = 0};
@@ -983,36 +902,23 @@ enum {JSON_float_error = 0};
enum {JSON_float_en_main = 1};
-#line 341 "parser.rl"
+#line 349 "parser.rl"
-static int is_bigdecimal_class(VALUE obj)
-{
- if (cBigDecimal == Qundef) {
- if (rb_const_defined(rb_cObject, i_BigDecimal)) {
- cBigDecimal = rb_const_get_at(rb_cObject, i_BigDecimal);
- }
- else {
- return 0;
- }
- }
- return obj == cBigDecimal;
-}
-
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
-#line 1008 "parser.c"
+#line 914 "parser.c"
{
cs = JSON_float_start;
}
-#line 361 "parser.rl"
+#line 356 "parser.rl"
json->memo = p;
-#line 1016 "parser.c"
+#line 922 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1070,14 +976,14 @@ case 8:
goto st0;
goto tr9;
tr9:
-#line 335 "parser.rl"
+#line 343 "parser.rl"
{ p--; {p++; cs = 9; goto _out;} }
goto st9;
st9:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 1081 "parser.c"
+#line 987 "parser.c"
goto st0;
st5:
if ( ++p == pe )
@@ -1138,24 +1044,14 @@ case 7:
_out: {}
}
-#line 363 "parser.rl"
+#line 358 "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));
- if (is_bigdecimal_class(json->decimal_class)) {
- *result = rb_funcall(Qnil, i_BigDecimal, 1, text);
- } else {
- *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;
@@ -1164,7 +1060,7 @@ case 7:
-#line 1168 "parser.c"
+#line 1064 "parser.c"
enum {JSON_array_start = 1};
enum {JSON_array_first_final = 17};
enum {JSON_array_error = 0};
@@ -1172,28 +1068,28 @@ enum {JSON_array_error = 0};
enum {JSON_array_en_main = 1};
-#line 416 "parser.rl"
+#line 401 "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 1190 "parser.c"
+#line 1086 "parser.c"
{
cs = JSON_array_start;
}
-#line 429 "parser.rl"
+#line 414 "parser.rl"
-#line 1197 "parser.c"
+#line 1093 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1232,10 +1128,10 @@ case 2:
goto st2;
goto st0;
tr2:
-#line 393 "parser.rl"
+#line 378 "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 {
@@ -1252,7 +1148,7 @@ st3:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 1256 "parser.c"
+#line 1152 "parser.c"
switch( (*p) ) {
case 13: goto st3;
case 32: goto st3;
@@ -1352,14 +1248,14 @@ case 12:
goto st3;
goto st12;
tr4:
-#line 408 "parser.rl"
+#line 393 "parser.rl"
{ p--; {p++; cs = 17; goto _out;} }
goto st17;
st17:
if ( ++p == pe )
goto _test_eof17;
case 17:
-#line 1363 "parser.c"
+#line 1259 "parser.c"
goto st0;
st13:
if ( ++p == pe )
@@ -1415,7 +1311,7 @@ case 16:
_out: {}
}
-#line 430 "parser.rl"
+#line 415 "parser.rl"
if(cs >= JSON_array_first_final) {
return p + 1;
@@ -1460,21 +1356,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)
@@ -1504,7 +1392,7 @@ static VALUE json_string_unescape(VALUE result, char *string, char *stringEnd)
}
-#line 1508 "parser.c"
+#line 1396 "parser.c"
enum {JSON_string_start = 1};
enum {JSON_string_first_final = 8};
enum {JSON_string_error = 0};
@@ -1512,7 +1400,7 @@ enum {JSON_string_error = 0};
enum {JSON_string_en_main = 1};
-#line 537 "parser.rl"
+#line 514 "parser.rl"
static int
@@ -1534,15 +1422,15 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu
*result = rb_str_buf_new(0);
-#line 1538 "parser.c"
+#line 1426 "parser.c"
{
cs = JSON_string_start;
}
-#line 558 "parser.rl"
+#line 535 "parser.rl"
json->memo = p;
-#line 1546 "parser.c"
+#line 1434 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1567,7 +1455,7 @@ case 2:
goto st0;
goto st2;
tr2:
-#line 523 "parser.rl"
+#line 500 "parser.rl"
{
*result = json_string_unescape(*result, json->memo + 1, p);
if (NIL_P(*result)) {
@@ -1578,14 +1466,14 @@ tr2:
{p = (( p + 1))-1;}
}
}
-#line 534 "parser.rl"
+#line 511 "parser.rl"
{ p--; {p++; cs = 8; goto _out;} }
goto st8;
st8:
if ( ++p == pe )
goto _test_eof8;
case 8:
-#line 1589 "parser.c"
+#line 1477 "parser.c"
goto st0;
st3:
if ( ++p == pe )
@@ -1661,7 +1549,7 @@ case 7:
_out: {}
}
-#line 560 "parser.rl"
+#line 537 "parser.rl"
if (json->create_additions && RTEST(match_string = json->match_string)) {
VALUE klass;
@@ -1676,8 +1564,6 @@ case 7:
if (json->symbolize_names && json->parsing_name) {
*result = rb_str_intern(*result);
- } else if (RB_TYPE_P(*result, T_STRING)) {
- rb_str_resize(*result, RSTRING_LEN(*result));
}
if (cs >= JSON_string_first_final) {
return p + 1;
@@ -1700,16 +1586,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);
+ {
+ rb_encoding *enc = rb_enc_get(source);
+ if (enc == rb_ascii8bit_encoding()) {
+ if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
+ source = rb_str_conv_enc(source, UTF_32BE, rb_utf8_encoding());
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
+ source = rb_str_conv_enc(source, UTF_16BE, rb_utf8_encoding());
+ } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
+ source = rb_str_conv_enc(source, UTF_32LE, rb_utf8_encoding());
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
+ source = rb_str_conv_enc(source, UTF_16LE, rb_utf8_encoding());
+ } else {
+ source = rb_str_dup(source);
+ FORCE_UTF8(source);
+ }
+ } else {
+ source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
+ }
+ }
+#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;
}
@@ -1732,12 +1643,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
*/
@@ -1749,18 +1659,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);
@@ -1785,17 +1689,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);
@@ -1814,12 +1720,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);
@@ -1827,20 +1727,20 @@ 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;
- json->create_additions = 0;
+ json->create_additions = 1;
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));
StringValue(source);
+ if (!json->quirks_mode) {
+ source = convert_encoding(source);
+ }
+ json->current_nesting = 0;
json->len = RSTRING_LEN(source);
json->source = RSTRING_PTR(source);;
json->Vsource = source;
@@ -1848,7 +1748,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self)
}
-#line 1852 "parser.c"
+#line 1752 "parser.c"
enum {JSON_start = 1};
enum {JSON_first_final = 10};
enum {JSON_error = 0};
@@ -1856,33 +1756,201 @@ enum {JSON_error = 0};
enum {JSON_en_main = 1};
-#line 760 "parser.rl"
+#line 759 "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 1877 "parser.c"
+#line 1771 "parser.c"
{
cs = JSON_start;
}
-#line 776 "parser.rl"
- p = json->source;
- pe = p + json->len;
+#line 769 "parser.rl"
+ p = json->source;
+ pe = p + json->len;
-#line 1886 "parser.c"
+#line 1780 "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 748 "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 741 "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 1857 "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 772 "parser.rl"
+
+ if (cs >= JSON_first_final && p == pe) {
+ return result;
+ } else {
+ rb_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
+
+
+#line 1926 "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 797 "parser.rl"
+
+
+static VALUE cParser_parse_quirks_mode(VALUE self)
+{
+ char *p, *pe;
+ int cs = EVIL;
+ VALUE result = Qnil;
+ GET_PARSER;
+
+
+#line 1945 "parser.c"
+ {
+ cs = JSON_quirks_mode_start;
+ }
+
+#line 807 "parser.rl"
+ p = json->source;
+ pe = p + json->len;
+
+#line 1954 "parser.c"
{
if ( p == pe )
goto _test_eof;
@@ -1916,9 +1984,9 @@ st0:
cs = 0;
goto _out;
tr2:
-#line 752 "parser.rl"
+#line 789 "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;
@@ -1926,7 +1994,7 @@ st10:
if ( ++p == pe )
goto _test_eof10;
case 10:
-#line 1930 "parser.c"
+#line 1998 "parser.c"
switch( (*p) ) {
case 13: goto st10;
case 32: goto st10;
@@ -2015,16 +2083,42 @@ case 9:
_out: {}
}
-#line 779 "parser.rl"
+#line 810 "parser.rl"
- if (cs >= JSON_first_final && p == pe) {
- return result;
+ if (cs >= JSON_quirks_mode_first_final && p == pe) {
+ return result;
+ } else {
+ rb_enc_raise(EXC_ENCODING 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 JSON_Parser *JSON_allocate(void)
+{
+ JSON_Parser *json = ALLOC(JSON_Parser);
+ MEMZERO(json, JSON_Parser, 1);
+ json->fbuffer = fbuffer_alloc(0);
+ return json;
+}
+
static void JSON_mark(void *ptr)
{
JSON_Parser *json = ptr;
@@ -2032,7 +2126,6 @@ static void JSON_mark(void *ptr)
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);
}
@@ -2049,23 +2142,17 @@ static size_t JSON_memsize(const void *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 TypedData_Wrap_Struct(klass, &JSON_Parser_type, json);
}
/*
@@ -2080,30 +2167,35 @@ static VALUE cParser_source(VALUE self)
return rb_str_dup(json->Vsource);
}
+/*
+ * call-seq: quirks_mode?()
+ *
+ * Returns a true, if this parser is in quirks_mode, false otherwise.
+ */
+static VALUE cParser_quirks_mode_p(VALUE self)
+{
+ GET_PARSER;
+ return json->quirks_mode ? Qtrue : Qfalse;
+}
+
+
void Init_parser(void)
{
-#undef rb_intern
rb_require("json/common");
mJSON = rb_define_module("JSON");
mExt = rb_define_module_under(mJSON, "Ext");
cParser = rb_define_class_under(mExt, "Parser", rb_cObject);
eParserError = rb_path2class("JSON::ParserError");
eNestingError = rb_path2class("JSON::NestingError");
- rb_gc_register_mark_object(eParserError);
- rb_gc_register_mark_object(eNestingError);
rb_define_alloc_func(cParser, cJSON_parser_s_allocate);
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"));
- rb_gc_register_mark_object(CNaN);
-
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
- rb_gc_register_mark_object(CInfinity);
-
CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
- rb_gc_register_mark_object(CMinusInfinity);
i_json_creatable_p = rb_intern("json_creatable?");
i_json_create = rb_intern("json_create");
@@ -2113,9 +2205,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?");
@@ -2123,8 +2215,15 @@ void Init_parser(void)
i_aset = rb_intern("[]=");
i_aref = rb_intern("[]");
i_leftshift = rb_intern("<<");
- i_new = rb_intern("new");
- i_BigDecimal = rb_intern("BigDecimal");
+#ifdef HAVE_RUBY_ENCODING_H
+ UTF_8 = rb_utf8_encoding();
+ UTF_16BE = rb_enc_find("utf-16be");
+ UTF_16LE = rb_enc_find("utf-16le");
+ UTF_32BE = rb_enc_find("utf-32be");
+ UTF_32LE = rb_enc_find("utf-32le");
+#else
+ i_iconv = rb_intern("iconv");
+#endif
}
/*
diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h
index e6cf779024..45afbc2732 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;
@@ -57,35 +58,21 @@ typedef struct JSON_ParserStruct {
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 JSON_Parser *JSON_allocate(void);
static void JSON_mark(void *json);
static void JSON_free(void *json);
static VALUE cJSON_parser_s_allocate(VALUE klass);
static VALUE cParser_source(VALUE self);
-#ifndef ZALLOC
-#define ZALLOC(type) ((type *)ruby_zalloc(sizeof(type)))
-static inline void *ruby_zalloc(size_t n)
-{
- void *p = ruby_xmalloc(n);
- memset(p, 0, n);
- return p;
-}
-#endif
-#ifdef TypedData_Make_Struct
static const rb_data_type_t JSON_Parser_type;
-#define NEW_TYPEDDATA_WRAPPER 1
-#else
-#define TypedData_Make_Struct(klass, type, ignore, json) Data_Make_Struct(klass, type, NULL, JSON_free, json)
-#define TypedData_Get_Struct(self, JSON_Parser, ignore, json) Data_Get_Struct(self, JSON_Parser, json)
-#endif
#endif
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl
index 6b38bb283a..54da92bd15 100644
--- a/ext/json/parser/parser.rl
+++ b/ext/json/parser/parser.rl
@@ -2,7 +2,7 @@
#include "parser.h"
#if defined HAVE_RUBY_ENCODING_H
-# define EXC_ENCODING rb_utf8_encoding(),
+# define EXC_ENCODING UTF_8,
# ifndef HAVE_RB_ENC_RAISE
static void
enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
@@ -25,7 +25,7 @@ enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
/* unicode */
-static const signed char digit_values[256] = {
+static const char digit_values[256] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -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, 2, 3, 4, 5, 6, 7, 8, 9, -1,
@@ -44,20 +44,20 @@ static const signed char digit_values[256] = {
static UTF32 unescape_unicode(const unsigned char *p)
{
- signed char b;
+ char b;
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,15 +87,19 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch)
return len;
}
+#ifdef HAVE_RUBY_ENCODING_H
+static rb_encoding *UTF_8, *UTF_16BE, *UTF_16LE, *UTF_32BE, *UTF_32LE;
+#else
+static ID i_iconv;
+#endif
+
static VALUE mJSON, mExt, cParser, eParserError, eNestingError;
static VALUE CNaN, CInfinity, CMinusInfinity;
-static VALUE cBigDecimal = Qundef;
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_BigDecimal;
+ 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;
@@ -133,7 +137,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 {
@@ -166,14 +170,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);
@@ -239,7 +243,7 @@ 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;
@@ -257,19 +261,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 |
@@ -279,10 +287,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;
@@ -340,19 +348,6 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res
) (^[0-9Ee.\-]? @exit );
}%%
-static int is_bigdecimal_class(VALUE obj)
-{
- if (cBigDecimal == Qundef) {
- if (rb_const_defined(rb_cObject, i_BigDecimal)) {
- cBigDecimal = rb_const_get_at(rb_cObject, i_BigDecimal);
- }
- else {
- return 0;
- }
- }
- return obj == cBigDecimal;
-}
-
static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result)
{
int cs = EVIL;
@@ -366,17 +361,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));
- if (is_bigdecimal_class(json->decimal_class)) {
- *result = rb_funcall(Qnil, i_BigDecimal, 1, text);
- } else {
- *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;
@@ -392,7 +377,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 {
@@ -415,13 +400,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);
@@ -471,21 +456,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)
@@ -571,8 +548,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 if (RB_TYPE_P(*result, T_STRING)) {
- rb_str_resize(*result, RSTRING_LEN(*result));
}
if (cs >= JSON_string_first_final) {
return p + 1;
@@ -595,16 +570,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);
+ {
+ rb_encoding *enc = rb_enc_get(source);
+ if (enc == rb_ascii8bit_encoding()) {
+ if (len >= 4 && ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0) {
+ source = rb_str_conv_enc(source, UTF_32BE, rb_utf8_encoding());
+ } else if (len >= 4 && ptr[0] == 0 && ptr[2] == 0) {
+ source = rb_str_conv_enc(source, UTF_16BE, rb_utf8_encoding());
+ } else if (len >= 4 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0) {
+ source = rb_str_conv_enc(source, UTF_32LE, rb_utf8_encoding());
+ } else if (len >= 4 && ptr[1] == 0 && ptr[3] == 0) {
+ source = rb_str_conv_enc(source, UTF_16LE, rb_utf8_encoding());
+ } else {
+ source = rb_str_dup(source);
+ FORCE_UTF8(source);
+ }
+ } else {
+ source = rb_str_conv_enc(source, NULL, rb_utf8_encoding());
+ }
+ }
+#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;
}
@@ -627,12 +627,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
*/
@@ -644,18 +643,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);
@@ -680,17 +673,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);
@@ -709,12 +704,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);
@@ -722,20 +711,20 @@ 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;
- json->create_additions = 0;
+ json->create_additions = 1;
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));
StringValue(source);
+ if (!json->quirks_mode) {
+ source = convert_encoding(source);
+ }
+ json->current_nesting = 0;
json->len = RSTRING_LEN(source);
json->source = RSTRING_PTR(source);;
json->Vsource = source;
@@ -749,8 +738,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_enc_raise(EXC_ENCODING 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;
}
@@ -759,6 +796,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_enc_raise(EXC_ENCODING eParserError, "%u: unexpected token at '%s'", __LINE__, p);
+ return Qnil;
+ }
+}
+
/*
* call-seq: parse()
*
@@ -767,24 +824,24 @@ 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 JSON_Parser *JSON_allocate(void)
+{
+ JSON_Parser *json = ALLOC(JSON_Parser);
+ MEMZERO(json, JSON_Parser, 1);
+ json->fbuffer = fbuffer_alloc(0);
+ return json;
+}
+
static void JSON_mark(void *ptr)
{
JSON_Parser *json = ptr;
@@ -792,7 +849,6 @@ static void JSON_mark(void *ptr)
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);
}
@@ -809,23 +865,17 @@ static size_t JSON_memsize(const void *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 TypedData_Wrap_Struct(klass, &JSON_Parser_type, json);
}
/*
@@ -840,30 +890,35 @@ 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()
{
-#undef rb_intern
rb_require("json/common");
mJSON = rb_define_module("JSON");
mExt = rb_define_module_under(mJSON, "Ext");
cParser = rb_define_class_under(mExt, "Parser", rb_cObject);
eParserError = rb_path2class("JSON::ParserError");
eNestingError = rb_path2class("JSON::NestingError");
- rb_gc_register_mark_object(eParserError);
- rb_gc_register_mark_object(eNestingError);
rb_define_alloc_func(cParser, cJSON_parser_s_allocate);
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"));
- rb_gc_register_mark_object(CNaN);
-
CInfinity = rb_const_get(mJSON, rb_intern("Infinity"));
- rb_gc_register_mark_object(CInfinity);
-
CMinusInfinity = rb_const_get(mJSON, rb_intern("MinusInfinity"));
- rb_gc_register_mark_object(CMinusInfinity);
i_json_creatable_p = rb_intern("json_creatable?");
i_json_create = rb_intern("json_create");
@@ -873,9 +928,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?");
@@ -883,8 +938,15 @@ void Init_parser(void)
i_aset = rb_intern("[]=");
i_aref = rb_intern("[]");
i_leftshift = rb_intern("<<");
- i_new = rb_intern("new");
- i_BigDecimal = rb_intern("BigDecimal");
+#ifdef HAVE_RUBY_ENCODING_H
+ UTF_8 = rb_utf8_encoding();
+ UTF_16BE = rb_enc_find("utf-16be");
+ UTF_16LE = rb_enc_find("utf-16le");
+ UTF_32BE = rb_enc_find("utf-32be");
+ UTF_32LE = rb_enc_find("utf-32le");
+#else
+ i_iconv = rb_intern("iconv");
+#endif
}
/*
diff --git a/ext/json/parser/prereq.mk b/ext/json/parser/prereq.mk
index 37bacc3380..be7bcb4319 100644
--- a/ext/json/parser/prereq.mk
+++ b/ext/json/parser/prereq.mk
@@ -5,7 +5,6 @@ RAGEL = ragel
.rl.c:
$(RAGEL) -G2 $<
$(BASERUBY) -pli -e '$$_.sub!(/[ \t]+$$/, "")' \
- -e '$$_.sub!(/^static const int (JSON_.*=.*);$$/, "enum {\\1};")' \
- -e '$$_ = "/* This file is automatically generated from parser.rl by using ragel */" + $$_ if $$. == 1' $@
+ -e '$$_.sub!(/^static const int (JSON_.*=.*);$$/, "enum {\\1};")' $@
parser.c:
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/monitor/depend b/ext/monitor/depend
deleted file mode 100644
index 89efe1766b..0000000000
--- a/ext/monitor/depend
+++ /dev/null
@@ -1,13 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-monitor.o: $(RUBY_EXTCONF_H)
-monitor.o: $(arch_hdrdir)/ruby/config.h
-monitor.o: $(hdrdir)/ruby/assert.h
-monitor.o: $(hdrdir)/ruby/backward.h
-monitor.o: $(hdrdir)/ruby/defines.h
-monitor.o: $(hdrdir)/ruby/intern.h
-monitor.o: $(hdrdir)/ruby/missing.h
-monitor.o: $(hdrdir)/ruby/ruby.h
-monitor.o: $(hdrdir)/ruby/st.h
-monitor.o: $(hdrdir)/ruby/subst.h
-monitor.o: monitor.c
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/monitor/extconf.rb b/ext/monitor/extconf.rb
deleted file mode 100644
index 78c53fa0c5..0000000000
--- a/ext/monitor/extconf.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-require 'mkmf'
-create_makefile('monitor')
diff --git a/ext/monitor/lib/monitor.rb b/ext/monitor/lib/monitor.rb
deleted file mode 100644
index 1883cb72f6..0000000000
--- a/ext/monitor/lib/monitor.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-# frozen_string_literal: false
-# = monitor.rb
-#
-# Copyright (C) 2001 Shugo Maeda <shugo@ruby-lang.org>
-#
-# This library is distributed under the terms of the Ruby license.
-# You can freely distribute/modify this library.
-#
-
-#
-# 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
-# monitor is that its methods are executed with mutual exclusion. That is, at
-# each point in time, at most one thread may be executing any of its methods.
-# This mutual exclusion greatly simplifies reasoning about the implementation
-# of monitors compared to reasoning about parallel code that updates a data
-# structure.
-#
-# You can read more about the general principles on the Wikipedia page for
-# Monitors[http://en.wikipedia.org/wiki/Monitor_%28synchronization%29]
-#
-# == Examples
-#
-# === Simple object.extend
-#
-# require 'monitor.rb'
-#
-# buf = []
-# buf.extend(MonitorMixin)
-# empty_cond = buf.new_cond
-#
-# # consumer
-# Thread.start do
-# loop do
-# buf.synchronize do
-# empty_cond.wait_while { buf.empty? }
-# print buf.shift
-# end
-# end
-# end
-#
-# # producer
-# while line = ARGF.gets
-# buf.synchronize do
-# buf.push(line)
-# empty_cond.signal
-# end
-# end
-#
-# The consumer thread waits for the producer thread to push a line to buf
-# while <tt>buf.empty?</tt>. The producer thread (main thread) reads a
-# line from ARGF and pushes it into buf then calls <tt>empty_cond.signal</tt>
-# to notify the consumer thread of new data.
-#
-# === Simple Class include
-#
-# require 'monitor'
-#
-# class SynchronizedArray < Array
-#
-# include MonitorMixin
-#
-# def initialize(*args)
-# super(*args)
-# end
-#
-# alias :old_shift :shift
-# alias :old_unshift :unshift
-#
-# def shift(n=1)
-# self.synchronize do
-# self.old_shift(n)
-# end
-# end
-#
-# def unshift(item)
-# self.synchronize do
-# self.old_unshift(item)
-# end
-# end
-#
-# # other methods ...
-# end
-#
-# +SynchronizedArray+ implements an Array with synchronized access to items.
-# This Class is implemented as subclass of Array which includes the
-# MonitorMixin module.
-#
-
-require 'monitor.so'
-
-module MonitorMixin
- #
- # FIXME: This isn't documented in Nutshell.
- #
- # Since MonitorMixin.new_cond returns a ConditionVariable, and the example
- # above calls while_wait and signal, this class should be documented.
- #
- class ConditionVariable
- #
- # Releases the lock held in the associated monitor 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.
- #
- def wait(timeout = nil)
- @monitor.mon_check_owner
- @monitor.wait_for_cond(@cond, timeout)
- end
-
- #
- # Calls wait repeatedly while the given block yields a truthy value.
- #
- def wait_while
- while yield
- wait
- end
- end
-
- #
- # Calls wait repeatedly until the given block yields a truthy value.
- #
- def wait_until
- until yield
- wait
- end
- end
-
- #
- # Wakes up the first thread in line waiting for this lock.
- #
- def signal
- @monitor.mon_check_owner
- @cond.signal
- end
-
- #
- # Wakes up all threads waiting for this lock.
- #
- def broadcast
- @monitor.mon_check_owner
- @cond.broadcast
- end
-
- private
-
- def initialize(monitor)
- @monitor = monitor
- @cond = Thread::ConditionVariable.new
- end
- end
-
- def self.extend_object(obj)
- super(obj)
- obj.__send__(:mon_initialize)
- end
-
- #
- # Attempts to enter exclusive section. Returns +false+ if lock fails.
- #
- def mon_try_enter
- @mon_data.try_enter
- end
- # For backward compatibility
- alias try_mon_enter mon_try_enter
-
- #
- # Enters exclusive section.
- #
- def mon_enter
- @mon_data.enter
- end
-
- #
- # Leaves exclusive section.
- #
- def mon_exit
- mon_check_owner
- @mon_data.exit
- end
-
- #
- # Returns true if this monitor is locked by any thread
- #
- def mon_locked?
- @mon_data.mon_locked?
- end
-
- #
- # Returns true if this monitor is locked by current thread.
- #
- def mon_owned?
- @mon_data.mon_owned?
- end
-
- #
- # Enters exclusive section and executes the block. Leaves the exclusive
- # section automatically when the block exits. See example under
- # +MonitorMixin+.
- #
- def mon_synchronize(&b)
- @mon_data.synchronize(&b)
- end
- alias synchronize mon_synchronize
-
- #
- # Creates a new MonitorMixin::ConditionVariable associated with the
- # Monitor object.
- #
- def new_cond
- unless defined?(@mon_data)
- mon_initialize
- @mon_initialized_by_new_cond = true
- end
- return ConditionVariable.new(@mon_data)
- end
-
- private
-
- # Use <tt>extend MonitorMixin</tt> or <tt>include MonitorMixin</tt> instead
- # of this constructor. Have look at the examples above to understand how to
- # use this module.
- def initialize(*args)
- super
- mon_initialize
- end
-
- # Initializes the MonitorMixin after being included in a class or when an
- # object has been extended with the MonitorMixin
- def mon_initialize
- if defined?(@mon_data)
- if defined?(@mon_initialized_by_new_cond)
- return # already initalized.
- elsif @mon_data_owner_object_id == self.object_id
- raise ThreadError, "already initialized"
- end
- end
- @mon_data = ::Monitor.new
- @mon_data_owner_object_id = self.object_id
- end
-
- def mon_check_owner
- @mon_data.mon_check_owner
- end
-end
-
-# Use the Monitor class when you want to have a lock object for blocks with
-# mutual exclusion.
-#
-# require 'monitor'
-#
-# lock = Monitor.new
-# lock.synchronize do
-# # exclusive access
-# end
-#
-class Monitor
- def new_cond
- ::MonitorMixin::ConditionVariable.new(self)
- end
-
- # for compatibility
- alias try_mon_enter try_enter
- alias mon_try_enter try_enter
- alias mon_enter enter
- alias mon_exit exit
- alias mon_synchronize synchronize
-end
-
-# Documentation comments:
-# - All documentation comes from Nutshell.
-# - MonitorMixin.new_cond appears in the example, but is not documented in
-# Nutshell.
-# - All the internals (internal modules Accessible and Initializable, class
-# ConditionVariable) appear in RDoc. It might be good to hide them, by
-# making them private, or marking them :nodoc:, etc.
-# - RDoc doesn't recognise aliases, so we have mon_synchronize documented, but
-# not synchronize.
-# - mon_owner is in Nutshell, but appears as an accessor in a separate module
-# here, so is hard/impossible to RDoc. Some other useful accessors
-# (mon_count and some queue stuff) are also in this module, and don't appear
-# directly in the RDoc output.
-# - in short, it may be worth changing the code layout in this file to make the
-# documentation easier
diff --git a/ext/monitor/monitor.c b/ext/monitor/monitor.c
deleted file mode 100644
index 256fc4d7db..0000000000
--- a/ext/monitor/monitor.c
+++ /dev/null
@@ -1,221 +0,0 @@
-#include "ruby/ruby.h"
-
-/* Thread::Monitor */
-
-struct rb_monitor {
- long count;
- const VALUE owner;
- const VALUE mutex;
-};
-
-static void
-monitor_mark(void *ptr)
-{
- struct rb_monitor *mc = ptr;
- rb_gc_mark(mc->owner);
- rb_gc_mark(mc->mutex);
-}
-
-static size_t
-monitor_memsize(const void *ptr)
-{
- return sizeof(struct rb_monitor);
-}
-
-static const rb_data_type_t monitor_data_type = {
- "monitor",
- {monitor_mark, RUBY_TYPED_DEFAULT_FREE, monitor_memsize,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY|RUBY_TYPED_WB_PROTECTED
-};
-
-static VALUE
-monitor_alloc(VALUE klass)
-{
- struct rb_monitor *mc;
- VALUE obj;
-
- obj = TypedData_Make_Struct(klass, struct rb_monitor, &monitor_data_type, mc);
- RB_OBJ_WRITE(obj, &mc->mutex, rb_mutex_new());
- RB_OBJ_WRITE(obj, &mc->owner, Qnil);
- mc->count = 0;
-
- return obj;
-}
-
-static struct rb_monitor *
-monitor_ptr(VALUE monitor)
-{
- struct rb_monitor *mc;
- TypedData_Get_Struct(monitor, struct rb_monitor, &monitor_data_type, mc);
- return mc;
-}
-
-static int
-mc_owner_p(struct rb_monitor *mc)
-{
- return mc->owner == rb_thread_current();
-}
-
-static VALUE
-monitor_try_enter(VALUE monitor)
-{
- struct rb_monitor *mc = monitor_ptr(monitor);
-
- if (!mc_owner_p(mc)) {
- if (!rb_mutex_trylock(mc->mutex)) {
- return Qfalse;
- }
- RB_OBJ_WRITE(monitor, &mc->owner, rb_thread_current());
- mc->count = 0;
- }
- mc->count += 1;
- return Qtrue;
-}
-
-static VALUE
-monitor_enter(VALUE monitor)
-{
- struct rb_monitor *mc = monitor_ptr(monitor);
- if (!mc_owner_p(mc)) {
- rb_mutex_lock(mc->mutex);
- RB_OBJ_WRITE(monitor, &mc->owner, rb_thread_current());
- mc->count = 0;
- }
- mc->count++;
- return Qnil;
-}
-
-static VALUE
-monitor_check_owner(VALUE monitor)
-{
- struct rb_monitor *mc = monitor_ptr(monitor);
- if (!mc_owner_p(mc)) {
- rb_raise(rb_eThreadError, "current thread not owner");
- }
- return Qnil;
-}
-
-static VALUE
-monitor_exit(VALUE monitor)
-{
- monitor_check_owner(monitor);
-
- struct rb_monitor *mc = monitor_ptr(monitor);
-
- if (mc->count <= 0) rb_bug("monitor_exit: count:%d\n", (int)mc->count);
- mc->count--;
-
- if (mc->count == 0) {
- RB_OBJ_WRITE(monitor, &mc->owner, Qnil);
- rb_mutex_unlock(mc->mutex);
- }
- return Qnil;
-}
-
-static VALUE
-monitor_locked_p(VALUE monitor)
-{
- struct rb_monitor *mc = monitor_ptr(monitor);
- return rb_mutex_locked_p(mc->mutex);
-}
-
-static VALUE
-monitor_owned_p(VALUE monitor)
-{
- struct rb_monitor *mc = monitor_ptr(monitor);
- return (rb_mutex_locked_p(mc->mutex) && mc_owner_p(mc)) ? Qtrue : Qfalse;
-}
-
-static VALUE
-monitor_exit_for_cond(VALUE monitor)
-{
- struct rb_monitor *mc = monitor_ptr(monitor);
- long cnt = mc->count;
- RB_OBJ_WRITE(monitor, &mc->owner, Qnil);
- mc->count = 0;
- return LONG2NUM(cnt);
-}
-
-struct wait_for_cond_data {
- VALUE monitor;
- VALUE cond;
- VALUE timeout;
- VALUE count;
-};
-
-static VALUE
-monitor_wait_for_cond_body(VALUE v)
-{
- struct wait_for_cond_data *data = (struct wait_for_cond_data *)v;
- struct rb_monitor *mc = monitor_ptr(data->monitor);
- // cond.wait(monitor.mutex, timeout)
- rb_funcall(data->cond, rb_intern("wait"), 2, mc->mutex, data->timeout);
- return Qtrue;
-}
-
-static VALUE
-monitor_enter_for_cond(VALUE v)
-{
- // assert(rb_mutex_owned_p(mc->mutex) == Qtrue)
- // but rb_mutex_owned_p is not exported...
-
- struct wait_for_cond_data *data = (struct wait_for_cond_data *)v;
- struct rb_monitor *mc = monitor_ptr(data->monitor);
- RB_OBJ_WRITE(data->monitor, &mc->owner, rb_thread_current());
- mc->count = NUM2LONG(data->count);
- return Qnil;
-}
-
-static VALUE
-monitor_wait_for_cond(VALUE monitor, VALUE cond, VALUE timeout)
-{
- VALUE count = monitor_exit_for_cond(monitor);
- struct wait_for_cond_data data = {
- monitor,
- cond,
- timeout,
- count,
- };
-
- return rb_ensure(monitor_wait_for_cond_body, (VALUE)&data,
- monitor_enter_for_cond, (VALUE)&data);
-}
-
-static VALUE
-monitor_sync_body(VALUE monitor)
-{
- return rb_yield_values(0);
-}
-
-static VALUE
-monitor_sync_ensure(VALUE monitor)
-{
- return monitor_exit(monitor);
-}
-
-static VALUE
-monitor_synchronize(VALUE monitor)
-{
- monitor_enter(monitor);
- return rb_ensure(monitor_sync_body, monitor, monitor_sync_ensure, monitor);
-}
-
-void
-Init_monitor(void)
-{
- VALUE rb_cMonitor = rb_define_class("Monitor", rb_cObject);
- rb_define_alloc_func(rb_cMonitor, monitor_alloc);
-
- rb_define_method(rb_cMonitor, "try_enter", monitor_try_enter, 0);
- rb_define_method(rb_cMonitor, "enter", monitor_enter, 0);
- rb_define_method(rb_cMonitor, "exit", monitor_exit, 0);
- rb_define_method(rb_cMonitor, "synchronize", monitor_synchronize, 0);
-
- /* internal methods for MonitorMixin */
- rb_define_method(rb_cMonitor, "mon_locked?", monitor_locked_p, 0);
- rb_define_method(rb_cMonitor, "mon_check_owner", monitor_check_owner, 0);
- rb_define_method(rb_cMonitor, "mon_owned?", monitor_owned_p, 0);
-
- /* internal methods for MonitorMixin::ConditionalVariable */
- rb_define_method(rb_cMonitor, "wait_for_cond", monitor_wait_for_cond, 2);
-}
diff --git a/ext/nkf/depend b/ext/nkf/depend
index 82580ff7fe..16421508b1 100644
--- a/ext/nkf/depend
+++ b/ext/nkf/depend
@@ -5,13 +5,10 @@ nkf.o: nkf.c
# AUTOGENERATED DEPENDENCIES START
nkf.o: $(RUBY_EXTCONF_H)
nkf.o: $(arch_hdrdir)/ruby/config.h
-nkf.o: $(hdrdir)/ruby/assert.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
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 cc438a50d6..b13f304f6a 100644
--- a/ext/nkf/nkf-utf8/nkf.c
+++ b/ext/nkf/nkf-utf8/nkf.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1987, Fujitsu LTD. (Itaru ICHIKAWA).
- * Copyright (c) 1996-2018, The nkf Project.
+ * Copyright (c) 1996-2013, The nkf Project.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -20,11 +20,11 @@
*
* 3. This notice may not be removed or altered from any source distribution.
*/
-#define NKF_VERSION "2.1.5"
-#define NKF_RELEASE_DATE "2018-12-15"
+#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-2018, The nkf Project."
+ "Copyright (C) 1996-2013, The nkf Project."
#include "config.h"
#include "nkf.h"
@@ -1111,26 +1111,18 @@ encode_fallback_java(nkf_char c)
(*oconv)(0, '\\');
c &= VALUE_MASK;
if(!nkf_char_unicode_bmp_p(c)){
- int high = (c >> 10) + NKF_INT32_C(0xD7C0); /* high surrogate */
- int low = (c & 0x3FF) + NKF_INT32_C(0xDC00); /* low surrogate */
- (*oconv)(0, 'u');
- (*oconv)(0, bin2hex(high>>12));
- (*oconv)(0, bin2hex(high>> 8));
- (*oconv)(0, bin2hex(high>> 4));
- (*oconv)(0, bin2hex(high ));
- (*oconv)(0, '\\');
- (*oconv)(0, 'u');
- (*oconv)(0, bin2hex(low>>12));
- (*oconv)(0, bin2hex(low>> 8));
- (*oconv)(0, bin2hex(low>> 4));
- (*oconv)(0, bin2hex(low ));
+ (*oconv)(0, 'U');
+ (*oconv)(0, '0');
+ (*oconv)(0, '0');
+ (*oconv)(0, bin2hex(c>>20));
+ (*oconv)(0, bin2hex(c>>16));
}else{
(*oconv)(0, 'u');
- (*oconv)(0, bin2hex(c>>12));
- (*oconv)(0, bin2hex(c>> 8));
- (*oconv)(0, bin2hex(c>> 4));
- (*oconv)(0, bin2hex(c ));
}
+ (*oconv)(0, bin2hex(c>>12));
+ (*oconv)(0, bin2hex(c>> 8));
+ (*oconv)(0, bin2hex(c>> 4));
+ (*oconv)(0, bin2hex(c ));
return;
}
@@ -1955,17 +1947,12 @@ unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_c
ret = unicode_to_jis_common2(c1, c0, ppp[c2 - 0xE0], sizeof_utf8_to_euc_C2, p2, p1);
}else return -1;
#ifdef SHIFTJIS_CP932
- if (!ret&& is_eucg3(*p2)) {
- if (cp932inv_f) {
- if (encode_fallback) ret = 1;
- }
- else {
- nkf_char s2, s1;
- if (e2s_conv(*p2, *p1, &s2, &s1) == 0) {
- s2e_conv(s2, s1, p2, p1);
- }else{
- ret = 1;
- }
+ if (!ret && !cp932inv_f && is_eucg3(*p2)) {
+ nkf_char s2, s1;
+ if (e2s_conv(*p2, *p1, &s2, &s1) == 0) {
+ s2e_conv(s2, s1, p2, p1);
+ }else{
+ ret = 1;
}
}
#endif
@@ -3588,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){
@@ -5504,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)
@@ -5723,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 a31e4e7805..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
*
*/
@@ -5445,7 +5445,7 @@ static const unsigned short utf8_to_euc_E4BB_x0213[] = {
0xB047, 0x2E28, 0xB049, 0x4265, 0x4E61, 0x304A, 0, 0,
0xB04A, 0, 0, 0xA13B, 0, 0x5041, 0x323E, 0xB04B,
0x3644, 0xA13D, 0x4367, 0xB04D, 0, 0xA13E, 0x376F, 0x5043,
- 0, 0, 0, 0x4724, 0, 0x2E29, 0xB050, 0x2E2A,
+ 0, 0, 0, 0x4724, 0xF42F, 0x2E29, 0xB050, 0x2E2A,
};
static const unsigned short utf8_to_euc_E4BC[] = {
0xB052, 0x346B, 0xB053, 0xB054, 0, 0, 0, 0,
@@ -5465,7 +5465,7 @@ static const unsigned short utf8_to_euc_E4BC_x0213[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0xB05D, 0x476C,
0x5046, 0xB05E, 0, 0xB060, 0x483C, 0xB061, 0x4E62, 0xA142,
- 0x3F2D, 0, 0x3B47, 0xB064, 0x3B77, 0x3240, 0xA143, 0,
+ 0x3F2D, 0xB063, 0x3B47, 0xB064, 0x3B77, 0x3240, 0xA143, 0,
};
static const unsigned short utf8_to_euc_E4BD[] = {
0xB066, 0, 0xB067, 0x4451, 0, 0, 0x4322, 0x504A,
@@ -5519,13 +5519,13 @@ static const unsigned short utf8_to_euc_E4BF[] = {
};
static const unsigned short utf8_to_euc_E4BF_x0213[] = {
0xB136, 0xB137, 0x3738, 0x4225, 0x3264, 0xA152, 0xB139, 0,
- 0xB13A, 0x2E39, 0x3D53, 0xA153, 0xB13D, 0, 0x5059, 0xA154,
+ 0xB13A, 0x2E39, 0x3D53, 0xA153, 0xB13D, 0xB13E, 0x5059, 0xA154,
0x505E, 0x505C, 0xA155, 0, 0x5057, 0, 0, 0x422F,
0x505A, 0, 0x505D, 0x505B, 0xB141, 0x4A5D, 0, 0x5058,
0x2E3A, 0x3F2E, 0xB143, 0x4B73, 0x505F, 0x5060, 0xA14F, 0,
0, 0, 0, 0, 0, 0, 0x3D24, 0x506D,
0xB144, 0x2E21, 0xA157, 0x4750, 0, 0x4936, 0x5068, 0,
- 0x4A70, 0, 0x3236, 0, 0xB146, 0xB147, 0x506C, 0,
+ 0x4A70, 0, 0x3236, 0, 0xB146, 0xB147, 0x506C, 0xB148,
};
static const unsigned short utf8_to_euc_E580[] = {
0xB149, 0xB14A, 0, 0, 0xB14B, 0x5066, 0x506F, 0xB14C,
@@ -5601,10 +5601,10 @@ static const unsigned short utf8_to_euc_E583_x0213[] = {
0xB232, 0, 0x5124, 0xB233, 0xA174, 0x364F, 0, 0xA175,
0, 0x5121, 0x5122, 0, 0x2E45, 0x462F, 0xA178, 0x417C,
0x2E47, 0x3623, 0, 0xB239, 0xA17A, 0x4B4D, 0x5125, 0,
- 0, 0xA17B, 0x4E3D, 0, 0xB23C, 0xB23D, 0x5126, 0xB23E,
+ 0xB23B, 0xA17B, 0x4E3D, 0, 0xB23C, 0xB23D, 0x5126, 0xB23E,
0, 0xA17C, 0xB23F, 0x5129, 0xB240, 0x5127, 0x2E48, 0x414E,
0xB242, 0xA17D, 0, 0, 0, 0x5128, 0x512A, 0xB244,
- 0, 0xB245, 0x2E46, 0xA176, 0, 0x512C, 0xB246, 0,
+ 0, 0xB245, 0x2E46, 0xA176, 0xF430, 0x512C, 0xB246, 0,
0, 0x512B, 0xB247, 0x4A48, 0, 0, 0xB248, 0,
};
static const unsigned short utf8_to_euc_E584[] = {
@@ -5642,7 +5642,7 @@ static const unsigned short utf8_to_euc_E585_x0213[] = {
0x4068, 0x3877, 0x2E4F, 0x396E, 0x513C, 0x4C48, 0x4546, 0xB267,
0x3B79, 0, 0x513B, 0xB268, 0x513D, 0x2E51, 0, 0x2E52,
0xB26B, 0, 0x455E, 0, 0x3375, 0, 0, 0xB26C,
- 0xA326, 0, 0x513E, 0, 0, 0x467E, 0xB26E, 0,
+ 0xA326, 0, 0x513E, 0, 0xB26D, 0x467E, 0xB26E, 0,
0x4134, 0x5140, 0x5141, 0x482C, 0x3878, 0x4F3B, 0x5142, 0,
0, 0x3626, 0, 0xA328, 0, 0x4A3C, 0x4236, 0x3671,
0x4535, 0, 0, 0xF474, 0x3773, 0, 0xB26F, 0,
@@ -5665,7 +5665,7 @@ static const unsigned short utf8_to_euc_E586_x0213[] = {
0x3427, 0xB276, 0x514F, 0xA32D, 0x514D, 0x4C3D, 0x514E, 0,
0x495A, 0x5150, 0x5151, 0x5152, 0x455F, 0xA32E, 0, 0,
0x5156, 0x5154, 0x5155, 0x5153, 0x3A63, 0x5157, 0x4C6A, 0x4E64,
- 0xB279, 0, 0xB27A, 0, 0xA330, 0x5158, 0, 0xB27D,
+ 0xB279, 0, 0xB27A, 0, 0xA330, 0x5158, 0xB27C, 0xB27D,
};
static const unsigned short utf8_to_euc_E587[] = {
0, 0, 0xB27E, 0, 0x4028, 0x5159, 0x3D5A, 0,
@@ -5683,7 +5683,7 @@ static const unsigned short utf8_to_euc_E587_x0213[] = {
0, 0xB323, 0xB324, 0xB325, 0, 0xB326, 0x5245, 0,
0xB327, 0, 0, 0x515B, 0x7425, 0x3645, 0x2E57, 0,
0x515C, 0x4B5E, 0x2E58, 0, 0, 0xB32A, 0x3D68, 0x427C,
- 0, 0x515E, 0x4664, 0, 0, 0x515F, 0x2E59, 0,
+ 0, 0x515E, 0x4664, 0, 0xF431, 0x515F, 0x2E59, 0,
0x5160, 0x332E, 0xB32C, 0xA333, 0xA334, 0x5161, 0x3627, 0xB32F,
0x464C, 0x317A, 0x3D50, 0, 0, 0x4821, 0x5162, 0,
};
@@ -5741,7 +5741,7 @@ static const unsigned short utf8_to_euc_E58A_x0213[] = {
0xB34D, 0, 0xA33E, 0x3344, 0xA33D, 0xB34F, 0, 0x3760,
0x517C, 0x4E2D, 0xB350, 0, 0xB351, 0x5178, 0, 0,
0, 0x517D, 0x517A, 0x2E61, 0x5179, 0xB353, 0xB354, 0xB355,
- 0xA340, 0, 0xB357, 0x4E4F, 0, 0, 0, 0x3879,
+ 0xA340, 0, 0xB357, 0x4E4F, 0xB358, 0, 0, 0x3879,
0x3243, 0, 0, 0x4E74, 0xA342, 0xB35A, 0xA343, 0xB35C,
0, 0x3D75, 0x4558, 0x3965, 0x5222, 0x5223, 0, 0xA344,
0xB35E, 0x4E65, 0, 0, 0x4F2B, 0x5225, 0xB35F, 0xB360,
@@ -5758,7 +5758,7 @@ static const unsigned short utf8_to_euc_E58B[] = {
0x5230, 0x5231, 0x3C5B, 0, 0, 0, 0x387B, 0x4C5E,
};
static const unsigned short utf8_to_euc_E58B_x0213[] = {
- 0, 0x5226, 0, 0x4B56, 0xB366, 0x443C, 0xB367, 0x4D26,
+ 0xB365, 0x5226, 0, 0x4B56, 0xB366, 0x443C, 0xB367, 0x4D26,
0x2E62, 0x4A59, 0xA347, 0, 0x2E64, 0x5227, 0, 0xB36A,
0x2E65, 0xA349, 0x7055, 0, 0xB36C, 0x4630, 0x2E66, 0x5228,
0x342A, 0x4C33, 0, 0x2E67, 0xB36F, 0x3E21, 0x5229, 0x4A67,
@@ -5804,7 +5804,7 @@ static const unsigned short utf8_to_euc_E58D_x0213[] = {
0x4331, 0xB439, 0x476E, 0xB43A, 0x4B4E, 0, 0x5246, 0,
0x406A, 0x2E6F, 0, 0x2E70, 0, 0xB43D, 0x3735, 0xA354,
0, 0x5247, 0, 0, 0xA355, 0xB43F, 0x5248, 0x312C,
- 0x3075, 0x346D, 0, 0x4228, 0x3551, 0x4D71, 0, 0x524B,
+ 0x3075, 0x346D, 0xB440, 0x4228, 0x3551, 0x4D71, 0, 0x524B,
0x3237, 0xB441, 0xA356, 0x524A, 0, 0x2E71, 0xB442, 0x362A,
};
static const unsigned short utf8_to_euc_E58E[] = {
@@ -5841,7 +5841,7 @@ static const unsigned short utf8_to_euc_E58F_x0213[] = {
0xA35B, 0, 0x3B32, 0x5254, 0, 0xB458, 0, 0,
0x4B74, 0x3A35, 0x355A, 0x4D27, 0x4150, 0x483F, 0x3C7D, 0xB459,
0, 0, 0xB45A, 0xB45B, 0x3D47, 0xA35F, 0x3C68, 0x3C75,
- 0, 0x3D76, 0xA360, 0x4840, 0, 0, 0xB45F, 0x5257,
+ 0, 0x3D76, 0xA360, 0x4840, 0, 0xB45E, 0xB45F, 0x5257,
0xB460, 0x3143, 0x4151, 0x387D, 0x3845, 0x3667, 0xB461, 0xB462,
0x525B, 0x4321, 0x427E, 0x362B, 0x3E24, 0x525C, 0x525A, 0x3244,
0x4266, 0x3C38, 0x3B4B, 0x3126, 0xA362, 0xA363, 0x3370, 0x3966,
@@ -6121,8 +6121,8 @@ static const unsigned short utf8_to_euc_E59D_x0213[] = {
0x542E, 0, 0x3A64, 0, 0, 0xA45F, 0xA460, 0x3651,
0, 0, 0x4B37, 0, 0xA461, 0xA462, 0x542C, 0x542F,
0x3A41, 0x3923, 0xB740, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x5433, 0xB741, 0, 0x3A25, 0, 0x4333, 0xB743,
+ 0, 0xF436, 0, 0, 0, 0, 0, 0,
+ 0, 0x5433, 0xB741, 0, 0x3A25, 0xB742, 0x4333, 0xB743,
0xA464, 0x5430, 0x445A, 0xB745, 0, 0xB746, 0xB747, 0xA465,
0x2F47, 0xB74A, 0, 0xA466, 0xA467, 0xA468, 0, 0x2F48,
0, 0xB74F, 0xB750, 0xA469, 0x2F49, 0, 0xB753, 0x5434,
@@ -6224,7 +6224,7 @@ static const unsigned short utf8_to_euc_E5A2_x0213[] = {
0, 0, 0, 0, 0x4446, 0xA52F, 0x2F5D, 0x5452,
0xB848, 0xB849, 0xB84A, 0, 0, 0, 0xB84B, 0,
0x4B4F, 0x2F5F, 0xA530, 0x5453, 0, 0, 0x5458, 0,
- 0, 0xA531, 0, 0x4A2F, 0, 0, 0, 0,
+ 0, 0xA531, 0xB84E, 0x4A2F, 0, 0, 0, 0,
0x5457, 0x5451, 0x5454, 0x5456, 0xB850, 0, 0x3A26, 0,
};
static const unsigned short utf8_to_euc_E5A3[] = {
@@ -6280,9 +6280,9 @@ static const unsigned short utf8_to_euc_E5A5[] = {
static const unsigned short utf8_to_euc_E5A5_x0213[] = {
0, 0, 0, 0xB872, 0x3162, 0, 0xA542, 0x3471,
0x4660, 0x4A74, 0, 0, 0, 0, 0x5477, 0x4155,
- 0x5476, 0x3740, 0xB874, 0, 0x4B5B, 0x5475, 0, 0x4565,
+ 0x5476, 0x3740, 0xB874, 0xB875, 0x4B5B, 0x5475, 0, 0x4565,
0x5479, 0xB876, 0x5478, 0xA545, 0, 0x2F69, 0xB879, 0xA546,
- 0x547B, 0xB87B, 0x547A, 0, 0, 0x317C, 0, 0x547C,
+ 0x547B, 0xB87B, 0x547A, 0xB87C, 0, 0x317C, 0, 0x547C,
0x3E29, 0x547E, 0x4325, 0xB87D, 0x547D, 0x2F6A, 0x4A33, 0xB921,
0, 0, 0xB922, 0x3D77, 0x455B, 0xA548, 0xA549, 0,
0x5521, 0xB925, 0, 0xB926, 0xA54A, 0x3925, 0, 0,
@@ -6305,7 +6305,7 @@ static const unsigned short utf8_to_euc_E5A6_x0213[] = {
0, 0, 0, 0x5526, 0x2F6D, 0x4245, 0, 0xB930,
0x4B38, 0, 0, 0, 0x454A, 0xB931, 0xA54C, 0xB933,
0xB934, 0, 0x5527, 0xB935, 0, 0, 0, 0xB936,
- 0, 0x4B65, 0, 0x3A4A, 0xA54D, 0, 0x3E2A, 0,
+ 0, 0x4B65, 0xB937, 0x3A4A, 0xA54D, 0, 0x3E2A, 0,
};
static const unsigned short utf8_to_euc_E5A7[] = {
0, 0xB939, 0, 0xB93A, 0xB93B, 0, 0x5528, 0,
@@ -6564,7 +6564,7 @@ static const unsigned short utf8_to_euc_E5B3_x0213[] = {
0, 0x5635, 0, 0, 0, 0xBB3C, 0, 0,
0x463D, 0x362E, 0, 0, 0, 0, 0, 0,
0x3265, 0x5636, 0x563B, 0, 0, 0x5639, 0xBB3E, 0x4A77,
- 0x4A76, 0xBB3F, 0xBB40, 0, 0x4F6D, 0, 0x4567, 0,
+ 0x4A76, 0xBB3F, 0xBB40, 0, 0x4F6D, 0xF43B, 0x4567, 0,
0, 0, 0x5638, 0x3D54, 0, 0x5637, 0, 0,
};
static const unsigned short utf8_to_euc_E5B4[] = {
@@ -6640,7 +6640,7 @@ static const unsigned short utf8_to_euc_E5B7[] = {
static const unsigned short utf8_to_euc_E5B7_x0213[] = {
0, 0, 0, 0xBB76, 0, 0, 0, 0xBB77,
0, 0x565A, 0, 0x4F7D, 0x3460, 0x565B, 0xBB7A, 0,
- 0, 0xA868, 0x565D, 0x565C, 0, 0, 0x565E, 0xA869,
+ 0xBB79, 0xA868, 0x565D, 0x565C, 0, 0, 0x565E, 0xA869,
0xA86A, 0xBB7C, 0, 0x565F, 0, 0x406E, 0x3D23, 0,
0xA86B, 0x3D64, 0x7428, 0x4163, 0xA86D, 0x3929, 0x3A38, 0x392A,
0x3570, 0xA86E, 0, 0x5660, 0, 0, 0x3A39, 0,
@@ -6742,7 +6742,7 @@ static const unsigned short utf8_to_euc_E5BC_x0213[] = {
0xAC2D, 0x5732, 0x4A40, 0x5735, 0x5021, 0x5031, 0xAC2E, 0x3C30,
0x4675, 0x5736, 0, 0x355D, 0x4424, 0x307A, 0x5737, 0x4A26,
0x3930, 0xBC61, 0, 0x4350, 0xAC2F, 0x7434, 0xAC31, 0x446F,
- 0, 0, 0xBC65, 0x7435, 0xBC67, 0x4C6F, 0x3839, 0x384C,
+ 0, 0xBC64, 0xBC65, 0x7435, 0xBC67, 0x4C6F, 0x3839, 0x384C,
0xBC68, 0x5738, 0, 0xBC69, 0xBC6A, 0x5739, 0xBC6B, 0x573F,
0xBC6C, 0x3C65, 0, 0, 0x7436, 0x4425, 0x7437, 0x362F,
0x573A, 0, 0, 0xBC6F, 0x492B, 0x7438, 0x4346, 0xBC71,
@@ -6841,7 +6841,7 @@ static const unsigned short utf8_to_euc_E681_x0213[] = {
0xBD5E, 0x576C, 0x5776, 0x5774, 0, 0, 0x5771, 0x744F,
0xBD60, 0xBD61, 0x5770, 0x4E78, 0xAC4B, 0x5772, 0, 0,
0x3632, 0xBD63, 0x3931, 0, 0xBD64, 0x3D7A, 0xBD65, 0xBD66,
- 0, 0x5779, 0x576B, 0, 0, 0, 0, 0x576F,
+ 0, 0x5779, 0x576B, 0, 0, 0xBD67, 0, 0x576F,
0x575F, 0xBD68, 0x327A, 0x5773, 0x5775, 0x4351, 0, 0xBD69,
0x3A28, 0x3238, 0x576D, 0x5778, 0x5777, 0x3633, 0, 0x4229,
0x3366, 0xBD6A, 0, 0, 0, 0x3743, 0, 0x576E,
@@ -6858,7 +6858,7 @@ static const unsigned short utf8_to_euc_E682[] = {
0x5829, 0, 0, 0xBE21, 0x4569, 0x582E, 0xBE22, 0,
};
static const unsigned short utf8_to_euc_E682_x0213[] = {
- 0, 0x577A, 0xBD6D, 0x577D, 0x5821, 0, 0xBD6E, 0,
+ 0, 0x577A, 0xBD6D, 0x577D, 0x5821, 0xF43F, 0xBD6E, 0,
0xBD6F, 0x3C3D, 0xAC4D, 0x5827, 0x4470, 0x577B, 0xBD71, 0,
0, 0xBD72, 0x5825, 0xBD73, 0x3279, 0xAC4E, 0x5823, 0x5824,
0xBD75, 0, 0x577E, 0x5822, 0, 0x7451, 0x7452, 0x3867,
@@ -6881,7 +6881,7 @@ static const unsigned short utf8_to_euc_E683_x0213[] = {
0, 0, 0xBE23, 0, 0xBE24, 0x3E70, 0x582F, 0x4657,
0xAC54, 0xBE26, 0xBE27, 0x7453, 0, 0, 0xBE29, 0xBE2A,
0, 0x4F47, 0, 0x582B, 0x7454, 0x7455, 0, 0,
- 0x5831, 0xAC55, 0x397B, 0xAC56, 0x404B, 0x7456, 0, 0x3054,
+ 0x5831, 0xAC55, 0x397B, 0xAC56, 0x404B, 0x7456, 0xBE30, 0x3054,
0x582A, 0x5828, 0xBE31, 0x415A, 0, 0xBE32, 0, 0x577C,
0x3B34, 0, 0, 0, 0, 0, 0xAC57, 0,
0x4246, 0x583D, 0xAC58, 0x415B, 0x5838, 0xAC59, 0x5835, 0x5836,
@@ -6900,9 +6900,9 @@ static const unsigned short utf8_to_euc_E684[] = {
static const unsigned short utf8_to_euc_E684_x0213[] = {
0x5837, 0x3D25, 0xBE38, 0x583A, 0, 0, 0x5834, 0xBE39,
0x4C7C, 0x4C7B, 0xBE3A, 0, 0xBE3B, 0x583E, 0x583F, 0x3055,
- 0xAC5A, 0, 0xAC5B, 0xAC5C, 0xBE40, 0x5833, 0xBE41, 0xBE42,
+ 0xAC5A, 0xBE3D, 0xAC5B, 0xAC5C, 0xBE40, 0x5833, 0xBE41, 0xBE42,
0, 0xAC5D, 0x3672, 0x3026, 0x7458, 0, 0xAC5E, 0x3436,
- 0, 0x583B, 0xBE46, 0, 0, 0, 0, 0x5843,
+ 0xF440, 0x583B, 0xBE46, 0, 0, 0, 0, 0x5843,
0x5842, 0, 0xBE47, 0x7459, 0x5847, 0, 0, 0,
0x745A, 0xBE4A, 0, 0, 0x5848, 0xBE4B, 0xBE4C, 0x745B,
0, 0xBE4E, 0xAC5F, 0, 0x5846, 0x5849, 0x5841, 0x5845,
@@ -6980,7 +6980,7 @@ static const unsigned short utf8_to_euc_E688[] = {
static const unsigned short utf8_to_euc_E688_x0213[] = {
0x5878, 0xBF24, 0, 0xBF25, 0xBF26, 0, 0, 0xBF27,
0x5879, 0x587A, 0x4A6A, 0, 0x587C, 0x587B, 0x3D3F, 0,
- 0x402E, 0x3266, 0x327C, 0, 0x587D, 0xAC73, 0x303F, 0,
+ 0x402E, 0x3266, 0x327C, 0xBF28, 0x587D, 0xAC73, 0x303F, 0,
0, 0, 0x404C, 0x587E, 0xBF2A, 0x6C43, 0x5921, 0x3761,
0xBF2B, 0x5922, 0x7462, 0xAC74, 0, 0, 0x406F, 0xBF2E,
0, 0xAC75, 0x5923, 0xBF30, 0, 0, 0x5924, 0x353A,
@@ -7239,7 +7239,7 @@ static const unsigned short utf8_to_euc_E695[] = {
};
static const unsigned short utf8_to_euc_E695_x0213[] = {
0, 0, 0, 0xC14A, 0xAD62, 0x384E, 0, 0xC14B,
- 0x5A43, 0xC14C, 0, 0, 0, 0x5A46, 0, 0x4952,
+ 0x5A43, 0xC14C, 0, 0, 0, 0x5A46, 0xF441, 0x4952,
0xC14D, 0x355F, 0xC14E, 0, 0xAD63, 0x5A45, 0x5A44, 0x4754,
0x5A47, 0x3635, 0, 0, 0, 0x5A49, 0x5A48, 0xC150,
0xC151, 0, 0x343A, 0x3B36, 0, 0, 0x4658, 0x7529,
@@ -7303,9 +7303,9 @@ static const unsigned short utf8_to_euc_E698_x0213[] = {
0, 0xC17A, 0xC17B, 0x3057, 0x404E, 0x752E, 0xC17D, 0,
0, 0, 0, 0, 0x5A66, 0xC17E, 0x752F, 0x4031,
0x3147, 0xAD77, 0x7531, 0xC224, 0x7532, 0x3D55, 0xC226, 0x4B66,
- 0x3A72, 0xC227, 0xAD78, 0x7533, 0xC22A, 0x3E3C, 0, 0x4027,
+ 0x3A72, 0xC227, 0xAD78, 0x7533, 0xC22A, 0x3E3C, 0xC22B, 0x4027,
0x7534, 0x7535, 0, 0x7536, 0x5A65, 0x5A63, 0x5A64, 0xC230,
- 0, 0xC22F, 0x7530, 0, 0x436B, 0, 0, 0x5B26,
+ 0, 0xC22F, 0x7530, 0xF442, 0x436B, 0, 0, 0x5B26,
};
static const unsigned short utf8_to_euc_E699[] = {
0xC231, 0x5A6A, 0x3B7E, 0x3938, 0x5A68, 0xC232, 0xC233, 0,
@@ -7379,7 +7379,7 @@ static const unsigned short utf8_to_euc_E69C[] = {
};
static const unsigned short utf8_to_euc_E69C_x0213[] = {
0x3A47, 0xAE37, 0, 0x5072, 0, 0xAE38, 0, 0xC26F,
- 0x376E, 0x4D2D, 0, 0x4A7E, 0, 0x497E, 0, 0x5B2C,
+ 0x376E, 0x4D2D, 0, 0x4A7E, 0, 0x497E, 0xC270, 0x5B2C,
0, 0, 0xAE39, 0x754D, 0x3A73, 0x443F, 0x5B2D, 0x4F2F,
0, 0xAE3B, 0, 0x4B3E, 0xC273, 0x442B, 0x5B2E, 0x347C,
0xC274, 0, 0xC275, 0, 0, 0, 0x5B2F, 0x5B30,
@@ -7682,7 +7682,7 @@ static const unsigned short utf8_to_euc_E6AB_x0213[] = {
0xC54D, 0xC54C, 0, 0, 0xC54E, 0, 0, 0,
0xAF66, 0x5D2A, 0, 0x4F26, 0xAF65, 0xC551, 0xC552, 0,
0, 0, 0x5D2D, 0x367B, 0xAF67, 0xAF68, 0x5D29, 0x5D2B,
- 0, 0, 0, 0, 0x7638, 0, 0, 0x7639,
+ 0, 0, 0xF44A, 0, 0x7638, 0, 0, 0x7639,
0x4827, 0, 0x5D2E, 0, 0xAF6B, 0, 0, 0,
0xC558, 0xAF6C, 0xAF6D, 0xAF6E, 0, 0, 0, 0,
0, 0, 0x5D32, 0x5D2F, 0xC55B, 0xAF6F, 0, 0,
@@ -7803,7 +7803,7 @@ static const unsigned short utf8_to_euc_E6B1_x0213[] = {
0x3C2E, 0, 0xC65C, 0, 0xC65D, 0x5D68, 0, 0x3440,
0, 0x7651, 0x3178, 0xEE37, 0x7652, 0x4672, 0x5D67, 0x393E,
0x4353, 0, 0x5D69, 0, 0, 0, 0, 0xEE4F,
- 0x5D71, 0, 0x5D6A, 0xC661, 0, 0xEE38, 0, 0,
+ 0x5D71, 0, 0x5D6A, 0xC661, 0, 0xEE38, 0, 0xC663,
0x4241, 0, 0x3562, 0x5D72, 0x7654, 0, 0x7655, 0,
0xC666, 0xC667, 0x3768, 0xC668, 0, 0x3525, 0x5D70, 0,
};
@@ -7883,7 +7883,7 @@ static const unsigned short utf8_to_euc_E6B5_x0213[] = {
0, 0, 0, 0, 0, 0, 0, 0xC73D,
0x7667, 0x5E36, 0x5E34, 0xEE52, 0x494D, 0, 0xEE53, 0xC73F,
0xEE54, 0xC740, 0, 0x5E31, 0x5E33, 0x7668, 0x313A, 0xC742,
- 0, 0x3940, 0x4F32, 0, 0x333D, 0, 0x4962, 0,
+ 0, 0x3940, 0x4F32, 0, 0x333D, 0, 0x4962, 0xC743,
0xEE55, 0, 0, 0, 0x4D61, 0, 0, 0x3324,
0x3F3B, 0x5E35, 0, 0, 0xC745, 0, 0, 0,
};
@@ -7900,7 +7900,7 @@ static const unsigned short utf8_to_euc_E6B6[] = {
static const unsigned short utf8_to_euc_E6B6_x0213[] = {
0xEE56, 0xEE57, 0x766A, 0, 0, 0x5E3A, 0, 0x766B,
0x3E43, 0x766C, 0xEE58, 0, 0x4D30, 0xEE59, 0x5E37, 0,
- 0, 0xEE5A, 0xC749, 0x5E32, 0x766D, 0x5E38, 0, 0xC74C,
+ 0, 0xEE5A, 0xC749, 0x5E32, 0x766D, 0x5E38, 0xC74B, 0xC74C,
0xEE5B, 0x4E5E, 0, 0x4573, 0x4642, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0x766E, 0xEE61, 0x766F, 0, 0xEE62, 0x3336,
@@ -7924,8 +7924,8 @@ static const unsigned short utf8_to_euc_E6B7_x0213[] = {
0x4571, 0x5E4A, 0x7673, 0x7674, 0, 0x7675, 0x5E44, 0xEE6A,
0xC75E, 0x4338, 0xC75F, 0, 0x5E4B, 0xC760, 0x5E40, 0,
0x5E46, 0xEE6B, 0x5E4D, 0x307C, 0x5E43, 0, 0x5E4E, 0xC762,
- 0xC763, 0x3F3C, 0, 0x3D5F, 0xC764, 0x4A25, 0xEE6C, 0x3A2E,
- 0, 0x5E3B, 0x5E49, 0x453A, 0x7676, 0, 0, 0,
+ 0xC763, 0x3F3C, 0xF44C, 0x3D5F, 0xC764, 0x4A25, 0xEE6C, 0x3A2E,
+ 0xF44B, 0x5E3B, 0x5E49, 0x453A, 0x7676, 0, 0, 0,
};
static const unsigned short utf8_to_euc_E6B8[] = {
0xC767, 0, 0, 0, 0xC768, 0x4036, 0, 0x3369,
@@ -7945,7 +7945,7 @@ static const unsigned short utf8_to_euc_E6B8_x0213[] = {
0x3574, 0x454F, 0xEE6F, 0x5E56, 0x5E5F, 0x302F, 0x3132, 0xEE70,
0, 0x3239, 0, 0x5E58, 0x422C, 0x5E4F, 0x5E51, 0x3941,
0, 0, 0xEE72, 0, 0x7678, 0, 0xEE6D, 0,
- 0x5E62, 0, 0x5E5D, 0xC76F, 0xEE73, 0, 0x5E55, 0,
+ 0x5E62, 0xC76E, 0x5E5D, 0xC76F, 0xEE73, 0, 0x5E55, 0,
};
static const unsigned short utf8_to_euc_E6B9[] = {
0, 0, 0, 0x5E5C, 0xC771, 0xC772, 0, 0,
@@ -8342,7 +8342,7 @@ static const unsigned short utf8_to_euc_E78C_x0213[] = {
0, 0, 0x6049, 0xCB26, 0, 0xCB27, 0, 0,
0, 0, 0xF046, 0xCB29, 0, 0, 0x604B, 0x6048,
0xF047, 0xF048, 0, 0x4C54, 0x604A, 0x604C, 0xCB2C, 0x4E44,
- 0, 0, 0xCB2D, 0, 0, 0x6050, 0, 0x776D,
+ 0, 0, 0xCB2D, 0, 0xCB2E, 0x6050, 0, 0x776D,
0x776E, 0x604F, 0x4376, 0x472D, 0xF04B, 0, 0x3825, 0x604E,
0, 0xF04C, 0xCB33, 0xF04D, 0x604D, 0xCB34, 0x4D31, 0x4D32,
0, 0xF04A, 0xCB35, 0xCB36, 0, 0xF04E, 0x6051, 0x316E,
@@ -8385,7 +8385,7 @@ static const unsigned short utf8_to_euc_E78E_x0213[] = {
0x7775, 0, 0x7776, 0, 0, 0xF05F, 0x7777, 0,
0xF060, 0x3461, 0xCB5F, 0x7778, 0, 0xCB61, 0, 0,
0, 0, 0x4E68, 0x605E, 0, 0xF061, 0, 0xF062,
- 0, 0xF063, 0, 0x6060, 0xF064, 0, 0, 0xF065,
+ 0, 0xF063, 0, 0x6060, 0xF064, 0xCB66, 0, 0xF065,
};
static const unsigned short utf8_to_euc_E78F[] = {
0x6061, 0, 0x3251, 0, 0, 0xCB68, 0xCB69, 0,
@@ -8400,11 +8400,11 @@ static const unsigned short utf8_to_euc_E78F[] = {
static const unsigned short utf8_to_euc_E78F_x0213[] = {
0x6061, 0, 0x3251, 0, 0, 0xF066, 0xCB69, 0,
0x605D, 0x7779, 0x3B39, 0xF067, 0xCB6C, 0x4441, 0x605F, 0x777A,
- 0, 0, 0, 0xCB6F, 0, 0, 0x777B, 0,
+ 0, 0, 0xCB6E, 0xCB6F, 0, 0, 0x777B, 0,
0, 0x777C, 0, 0, 0, 0xCB72, 0x6064, 0,
0x3C6E, 0xF068, 0, 0x777D, 0, 0x6062, 0xCB75, 0xF069,
0, 0x777E, 0x373E, 0, 0, 0x4849, 0x6063, 0,
- 0, 0x607E, 0, 0, 0xCB78, 0, 0, 0xCB7A,
+ 0, 0x607E, 0, 0, 0xCB78, 0xCB79, 0, 0xCB7A,
0x6069, 0xF06A, 0xF06C, 0xCB7D, 0, 0xCB7E, 0x383D, 0xCC21,
};
static const unsigned short utf8_to_euc_E790[] = {
@@ -8423,7 +8423,7 @@ static const unsigned short utf8_to_euc_E790_x0213[] = {
0, 0xCC27, 0, 0xF06B, 0, 0, 0, 0,
0, 0, 0x7823, 0x7824, 0, 0, 0, 0,
0, 0, 0x4276, 0, 0xF06E, 0x6068, 0x7826, 0,
- 0x7827, 0, 0x7828, 0x7829, 0x782A, 0xCC31, 0x782B, 0x782C,
+ 0x7827, 0xCC2D, 0x7828, 0x7829, 0x782A, 0xCC31, 0x782B, 0x782C,
0x782D, 0xF06F, 0x606A, 0x4E56, 0x3657, 0x487C, 0x474A, 0,
0, 0xF070, 0x606B, 0, 0, 0, 0, 0x606D,
};
@@ -8618,7 +8618,7 @@ static const unsigned short utf8_to_euc_E79A[] = {
0x6230, 0x6231, 0x6232, 0, 0, 0xCE48, 0, 0x3B2E,
};
static const unsigned short utf8_to_euc_E79A_x0213[] = {
- 0x6225, 0x7860, 0, 0x6226, 0x452A, 0xCE36, 0x3327, 0x3944,
+ 0x6225, 0x7860, 0xF451, 0x6226, 0x452A, 0xCE36, 0x3327, 0x3944,
0x6227, 0, 0, 0x6228, 0xCE37, 0xCE38, 0x6229, 0,
0x3B29, 0, 0, 0x622B, 0, 0xF16E, 0x622A, 0,
0, 0x622C, 0x622D, 0x7861, 0xF16F, 0x7862, 0x7863, 0xCE3D,
@@ -8765,7 +8765,7 @@ static const unsigned short utf8_to_euc_E7A1_x0213[] = {
0xCF66, 0xCF67, 0, 0xCF68, 0xF246, 0, 0, 0,
0x7925, 0, 0xF247, 0x4E32, 0x3945, 0, 0x7926, 0x3827,
0, 0, 0x4823, 0, 0x626D, 0, 0, 0,
- 0, 0, 0, 0, 0x626F, 0, 0xCF6E, 0,
+ 0, 0, 0xCF6D, 0, 0x626F, 0, 0xCF6E, 0,
};
static const unsigned short utf8_to_euc_E7A2[] = {
0, 0x386B, 0, 0, 0, 0, 0x626E, 0x4476,
@@ -9322,7 +9322,7 @@ static const unsigned short utf8_to_euc_E7BE_x0213[] = {
0x6633, 0, 0x4D53, 0xD526, 0x6635, 0xD527, 0x487E, 0xD528,
0xF473, 0x7A3B, 0, 0, 0x6636, 0, 0xF476, 0x7A3C,
0, 0, 0x6639, 0, 0xF477, 0x6638, 0x6637, 0,
- 0, 0, 0xD52F, 0x663A, 0x3732, 0, 0xD530, 0,
+ 0, 0xD52E, 0xD52F, 0x663A, 0x3732, 0, 0xD530, 0,
0x4122, 0x3541, 0xD531, 0, 0, 0xF478, 0x663E, 0x663B,
0, 0, 0x663C, 0, 0xD533, 0, 0x663F, 0,
0x6640, 0x663D, 0, 0, 0xD534, 0x3129, 0, 0x7A3D,
@@ -9664,7 +9664,7 @@ static const unsigned short utf8_to_euc_E88F_x0213[] = {
0x6845, 0, 0, 0, 0x3A5A, 0xF63E, 0, 0x4551,
0x684A, 0x7B22, 0, 0, 0, 0xF63F, 0, 0,
0xD83F, 0x4A6E, 0x7B23, 0x6841, 0, 0, 0, 0x325A,
- 0x3856, 0x4929, 0x684B, 0, 0x683F, 0, 0, 0x6848,
+ 0x3856, 0x4929, 0x684B, 0, 0x683F, 0, 0xD841, 0x6848,
0xD842, 0xF640, 0, 0x6852, 0xD844, 0x6843, 0, 0,
};
static const unsigned short utf8_to_euc_E890[] = {
@@ -9783,7 +9783,7 @@ static const unsigned short utf8_to_euc_E895_x0213[] = {
0xD943, 0xF670, 0xD945, 0xF671, 0, 0x6924, 0xD947, 0x4979,
0x687D, 0x7B38, 0x6856, 0, 0xD949, 0xD94A, 0xF672, 0xD94C,
0xD94D, 0xF673, 0xF674, 0x687C, 0x7B39, 0, 0, 0,
- 0x4F4F, 0x4622, 0x4973, 0, 0, 0x692B, 0, 0xF66C,
+ 0x4F4F, 0x4622, 0x4973, 0xD951, 0, 0x692B, 0, 0xF66C,
0, 0, 0, 0, 0, 0, 0, 0x6931,
0, 0xD953, 0x7B3C, 0xF676, 0, 0xF677, 0x6932, 0xF678,
};
@@ -9998,7 +9998,7 @@ static const unsigned short utf8_to_euc_E8A0[] = {
0, 0x6A45, 0xDC21, 0x6A47, 0xDC22, 0, 0, 0,
};
static const unsigned short utf8_to_euc_E8A0_x0213[] = {
- 0, 0xF77A, 0, 0xF77B, 0, 0x6A24, 0x7B63, 0,
+ 0, 0xF77A, 0, 0xF77B, 0, 0x6A24, 0x7B63, 0xF464,
0, 0xDB6B, 0x7B64, 0xF77C, 0, 0x6A38, 0x6A3C, 0x6A37,
0x7B65, 0x6A3E, 0xDB70, 0xF77D, 0x7B66, 0x6A40, 0x6A3F, 0,
0xDB73, 0xDB6F, 0xDB74, 0xDB75, 0xDB76, 0, 0xDB77, 0x7B67,
@@ -10260,7 +10260,7 @@ static const unsigned short utf8_to_euc_E8AD[] = {
static const unsigned short utf8_to_euc_E8AD_x0213[] = {
0, 0x6B76, 0xDE44, 0xF86A, 0xDE46, 0xDE47, 0x7C31, 0,
0xDE49, 0x6B7A, 0, 0, 0x6B77, 0xDE4E, 0x6B79, 0x6B78,
- 0, 0xF86C, 0xDE4A, 0, 0x7C32, 0, 0x6B7B, 0,
+ 0, 0xF86C, 0xDE4A, 0xDE4B, 0x7C32, 0, 0x6B7B, 0,
0x3C31, 0x7C33, 0x6B7D, 0x6B7C, 0x4968, 0, 0xF86D, 0x6C21,
0, 0, 0, 0xDE50, 0, 0, 0x3759, 0,
0, 0x7C34, 0, 0x6B7E, 0x6C22, 0xDE51, 0, 0x6C23,
@@ -10404,7 +10404,7 @@ static const unsigned short utf8_to_euc_E8B5_x0213[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x4056, 0xDF46, 0x3C4F, 0x6C5F,
0, 0xDF47, 0, 0x3352, 0xF935, 0x6C60, 0xDF49, 0,
- 0x4176, 0x6C61, 0, 0x6C62, 0x496B, 0, 0, 0x352F,
+ 0x4176, 0x6C61, 0, 0x6C62, 0x496B, 0, 0xF468, 0x352F,
0, 0, 0, 0, 0, 0, 0, 0xDF4A,
};
static const unsigned short utf8_to_euc_E8B6[] = {
@@ -10519,7 +10519,7 @@ static const unsigned short utf8_to_euc_E8BB[] = {
};
static const unsigned short utf8_to_euc_E8BB_x0213[] = {
0x7C4A, 0xE055, 0, 0xE056, 0xE057, 0x6D40, 0x6D3D, 0xE058,
- 0x6D41, 0, 0x3C56, 0x6D42, 0x3530, 0x3733, 0, 0,
+ 0x6D41, 0, 0x3C56, 0x6D42, 0x3530, 0x3733, 0, 0xE059,
0, 0xF95A, 0x382E, 0, 0xF95B, 0, 0, 0,
0, 0, 0, 0x6D43, 0xE05C, 0, 0, 0x4670,
0, 0, 0x453E, 0x6D44, 0, 0, 0, 0,
@@ -10642,7 +10642,7 @@ static const unsigned short utf8_to_euc_E981_x0213[] = {
0, 0x6E26, 0x4D37, 0x313F, 0xE15D, 0x4A57, 0x3261, 0x6E21,
0x6E22, 0x6E23, 0x6E24, 0x463B, 0x4323, 0x3063, 0x6E28, 0,
0x6E29, 0x7423, 0, 0xE15E, 0x423D, 0xF97D, 0x6E2A, 0,
- 0x3173, 0x414C, 0xE160, 0x382F, 0, 0x4D5A, 0xE161, 0,
+ 0x3173, 0x414C, 0xE160, 0x382F, 0, 0x4D5A, 0xE161, 0xE162,
0x6E2B, 0x452C, 0, 0, 0xE163, 0x4178, 0x3C57, 0x6E2C,
0xE164, 0, 0x6E2F, 0, 0xE165, 0x3D65, 0x6E2D, 0x412B,
0x412A, 0xE166, 0x3064, 0, 0x4E4B, 0x6E31, 0, 0x4872,
@@ -10761,7 +10761,7 @@ static const unsigned short utf8_to_euc_E987_x0213[] = {
0x6E56, 0x6E57, 0xE321, 0xFA4C, 0xFA4D, 0xE323, 0x4850, 0x3A53,
0x3C61, 0x6E58, 0, 0x6E59, 0x4E24, 0x3D45, 0x4C6E, 0x4E4C,
0x6E5A, 0x3662, 0, 0xE324, 0xE325, 0, 0x6E5B, 0x7C7C,
- 0x4523, 0xE327, 0xFA4E, 0x6E5E, 0x3378, 0x3F4B, 0, 0x6E5C,
+ 0x4523, 0xE327, 0xFA4E, 0x6E5E, 0x3378, 0x3F4B, 0xE329, 0x6E5C,
0, 0x6E5D, 0, 0x4460, 0x7C7E, 0x7D21, 0x4B55, 0x367C,
0, 0xE32C, 0xE32D, 0, 0xFA51, 0x7D22, 0xFA52, 0xE331,
0xE332, 0x7D23, 0, 0, 0, 0x6E60, 0x6E61, 0xE334,
@@ -10778,7 +10778,7 @@ static const unsigned short utf8_to_euc_E988[] = {
0xE353, 0xE354, 0xE355, 0, 0xE356, 0, 0xE357, 0x6E6F,
};
static const unsigned short utf8_to_euc_E988_x0213[] = {
- 0xE338, 0xFA53, 0, 0, 0xE33A, 0xE33B, 0, 0x7D24,
+ 0xE338, 0xFA53, 0, 0, 0xE33A, 0xE33B, 0xE33C, 0x7D24,
0, 0xE33E, 0xFA54, 0, 0xE340, 0x465F, 0x3343, 0,
0x7D25, 0x6E67, 0xE342, 0xE343, 0x6E64, 0x6E66, 0xFA55, 0xFA56,
0xE345, 0, 0, 0, 0xE346, 0xE347, 0x6E62, 0,
@@ -10804,7 +10804,7 @@ static const unsigned short utf8_to_euc_E989_x0213[] = {
0xE362, 0xFA5F, 0x6E76, 0x3174, 0xE364, 0xE365, 0x6E68, 0,
0xFA60, 0xFA61, 0x482D, 0, 0x6E6C, 0xFA62, 0x3E60, 0xFA63,
0xFA64, 0xE36B, 0, 0, 0, 0, 0xE36C, 0xE36D,
- 0xE36E, 0x395B, 0, 0, 0, 0xE36F, 0xE370, 0,
+ 0xE36E, 0x395B, 0, 0, 0, 0xE36F, 0xE370, 0xE371,
0x7D2D, 0xE373, 0, 0xE374, 0xFA67, 0xFA68, 0x4B48, 0xFA69,
};
static const unsigned short utf8_to_euc_E98A[] = {
@@ -10840,7 +10840,7 @@ static const unsigned short utf8_to_euc_E98B[] = {
static const unsigned short utf8_to_euc_E98B_x0213[] = {
0xFA75, 0xE433, 0x7D2F, 0xE435, 0, 0xE436, 0xFA76, 0xE438,
0xE439, 0, 0, 0x7D30, 0x7D31, 0xE43C, 0xFA77, 0x6E77,
- 0xFA78, 0, 0x4B2F, 0x7D32, 0, 0, 0, 0xFA79,
+ 0xFA78, 0, 0x4B2F, 0x7D32, 0, 0xE440, 0, 0xFA79,
0xE442, 0xFA7A, 0, 0, 0xE444, 0xE445, 0, 0xE446,
0x7D33, 0xE448, 0, 0xE449, 0x3D7B, 0xFA7B, 0, 0xFA7C,
0xE44C, 0x6E7A, 0x4A5F, 0, 0xE44D, 0x3154, 0xE44E, 0,
@@ -10902,7 +10902,7 @@ static const unsigned short utf8_to_euc_E98E_x0213[] = {
0xFB38, 0, 0xE528, 0xFB39, 0x3379, 0xE52A, 0, 0xFB3A,
0, 0, 0xE52C, 0, 0x6F30, 0xE52D, 0x3A3F, 0x4179,
0xE52E, 0, 0x444A, 0x7D40, 0, 0, 0xFB3B, 0,
- 0, 0xFB35, 0, 0x7D41, 0, 0, 0xE534, 0x333B,
+ 0, 0xFB35, 0, 0x7D41, 0xE533, 0, 0xE534, 0x333B,
0xE535, 0xE53B, 0, 0xE536, 0x6F2E, 0x6F2F, 0x4443, 0,
0x6F2D, 0, 0, 0, 0xE537, 0xE538, 0xE539, 0,
0, 0x6F31, 0x7D42, 0, 0, 0, 0, 0,
@@ -10925,7 +10925,7 @@ static const unsigned short utf8_to_euc_E98F_x0213[] = {
0, 0x3640, 0xFB43, 0, 0x6F3B, 0x6F35, 0xE54C, 0xFB44,
0x6F34, 0, 0, 0, 0, 0, 0, 0,
0, 0xFB3F, 0, 0, 0, 0xFB3C, 0, 0xE54F,
- 0, 0xE54E, 0xE551, 0xFB49, 0, 0x7D47, 0, 0,
+ 0xE550, 0xE54E, 0xE551, 0xFB49, 0, 0x7D47, 0, 0,
};
static const unsigned short utf8_to_euc_E990[] = {
0, 0xE554, 0xE555, 0x6F3F, 0xE556, 0, 0, 0x6F40,
@@ -10944,7 +10944,7 @@ static const unsigned short utf8_to_euc_E990_x0213[] = {
0x3E62, 0x462A, 0x6F3C, 0, 0, 0, 0, 0xE55F,
0, 0x6F45, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0x6F43, 0, 0, 0xE560, 0xE561,
- 0, 0, 0xFB4A, 0x7D48, 0xFB4B, 0x6F44, 0x6F42, 0,
+ 0, 0xE562, 0xFB4A, 0x7D48, 0xFB4B, 0x6F44, 0x6F42, 0,
0x4278, 0, 0x6F46, 0xFB4C, 0, 0xE568, 0, 0xE567,
};
static const unsigned short utf8_to_euc_E991[] = {
@@ -10959,7 +10959,7 @@ static const unsigned short utf8_to_euc_E991[] = {
};
static const unsigned short utf8_to_euc_E991_x0213[] = {
0, 0x6F47, 0, 0xE569, 0x6F49, 0xFB4D, 0, 0,
- 0, 0, 0x7D49, 0, 0xE56D, 0, 0, 0,
+ 0xE56B, 0, 0x7D49, 0, 0xE56D, 0, 0, 0,
0, 0x3455, 0x6F48, 0x4C7A, 0, 0xE56E, 0, 0,
0, 0xE56F, 0x6F54, 0x6F4A, 0xE570, 0, 0x6F4D, 0xE571,
0x6F4B, 0xE572, 0x6F4C, 0x7D4A, 0, 0, 0, 0,
@@ -11010,7 +11010,7 @@ static const unsigned short utf8_to_euc_E996[] = {
static const unsigned short utf8_to_euc_E996_x0213[] = {
0x4C67, 0, 0x6F59, 0x412E, 0xE622, 0, 0xFB54, 0x6F5A,
0xE623, 0x4A44, 0x6F5B, 0x332B, 0xFB55, 0xFB56, 0x7D4E, 0x313C,
- 0, 0x3457, 0, 0x3456, 0x6F5C, 0, 0x6F5D, 0,
+ 0, 0x3457, 0xF471, 0x3456, 0x6F5C, 0, 0x6F5D, 0,
0x6F5E, 0x6F5F, 0, 0, 0, 0xE627, 0xE628, 0x7D4F,
0x6F60, 0xE62A, 0x3458, 0x3355, 0x395E, 0x4836, 0x7D50, 0x6F62,
0x6F61, 0x7D51, 0, 0xFB58, 0x7D52, 0x6F63, 0, 0,
@@ -11148,9 +11148,9 @@ static const unsigned short utf8_to_euc_E99D[] = {
0xE73E, 0x7058, 0x705C, 0xE73F, 0x705A, 0xE740, 0, 0xE741,
};
static const unsigned short utf8_to_euc_E99D_x0213[] = {
- 0, 0xFB7A, 0x704E, 0, 0x704B, 0, 0x704C, 0xFB7B,
+ 0, 0xFB7A, 0x704E, 0xE72E, 0x704B, 0, 0x704C, 0xFB7B,
0x704D, 0x704F, 0xE72F, 0, 0, 0x7D68, 0x7D69, 0x7D6A,
- 0, 0, 0x4044, 0, 0, 0xFB7C, 0x4C77, 0xFB7D,
+ 0, 0xF476, 0x4044, 0, 0, 0xFB7C, 0x4C77, 0xFB7D,
0xE734, 0x4045, 0x7D6B, 0xFB7E, 0x7050, 0, 0x4873, 0,
0x7051, 0x7353, 0x4C4C, 0xE737, 0x7052, 0, 0x7053, 0xE738,
0x7054, 0x3357, 0xFC21, 0x7056, 0, 0x3F59, 0x7D6C, 0,
@@ -11292,7 +11292,7 @@ static const unsigned short utf8_to_euc_E9A4_x0213[] = {
0xFC54, 0x712E, 0x4D5C, 0, 0x3142, 0, 0, 0,
0x3B41, 0xE853, 0x712F, 0x326E, 0x7130, 0xE854, 0xFC57, 0xFC58,
0x7131, 0, 0xFC5A, 0xFC5B, 0xFC5C, 0x7133, 0x7134, 0xE85A,
- 0x7136, 0x7132, 0xE85B, 0, 0x7135, 0, 0xE85C, 0,
+ 0x7136, 0x7132, 0xE85B, 0, 0x7135, 0, 0xE85C, 0xE85D,
0x345B, 0, 0, 0xE85E, 0x7137, 0, 0x7138, 0,
0, 0xFC5E, 0xFC5F, 0xFC60, 0xE862, 0xE863, 0, 0,
0, 0xE864, 0xFC61, 0xFC62, 0xFC63, 0x7139, 0x713A, 0,
@@ -11431,7 +11431,7 @@ static const unsigned short utf8_to_euc_E9AB_x0213[] = {
0x716F, 0x7E36, 0, 0x7E37, 0x3F71, 0, 0xFD2D, 0,
0xE965, 0, 0, 0, 0, 0, 0x7E38, 0x7170,
0xFD2E, 0x7171, 0xFD2F, 0x7172, 0x7173, 0xFD30, 0x7E39, 0xE96B,
- 0x3962, 0, 0, 0xE96C, 0xFD32, 0, 0x7174, 0x7175,
+ 0x3962, 0xF47B, 0, 0xE96C, 0xFD32, 0, 0x7174, 0x7175,
0xFD33, 0, 0x7176, 0x7177, 0xE96F, 0xFD34, 0x7178, 0xE971,
0, 0xFD35, 0x4831, 0x717A, 0xE973, 0x4926, 0x717B, 0x7179,
0, 0x717D, 0xE974, 0xE975, 0x717C, 0xE976, 0, 0x717E,
@@ -11495,7 +11495,7 @@ static const unsigned short utf8_to_euc_E9AE_x0213[] = {
0x723E, 0, 0, 0, 0, 0, 0xFD48, 0x7E49,
0x723F, 0xEA63, 0x4B6E, 0x3B2D, 0xFD49, 0x3A7A, 0x412F, 0,
0xEA65, 0xFD4A, 0xFD4D, 0, 0x7240, 0, 0, 0xEA68,
- 0xFD4E, 0x7243, 0, 0, 0xEA6B, 0, 0xFD4F, 0xEA6D,
+ 0xFD4E, 0x7243, 0, 0xEA6A, 0xEA6B, 0, 0xFD4F, 0xEA6D,
};
static const unsigned short utf8_to_euc_E9AF[] = {
0x7241, 0xEA6E, 0, 0, 0, 0, 0x7244, 0xEA6F,
@@ -11859,11 +11859,11 @@ static const unsigned short utf8_to_euc_EFA8[] = {
};
static const unsigned short utf8_to_euc_EFA8_x0213[] = {
0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0x2F4B,
- 0x2F57, 0x4F72, 0, 0xAE79, 0x757A, 0x775A, 0x776F, 0,
- 0, 0x793C, 0x793D, 0x7941, 0, 0, 0, 0x7B3A,
- 0xF738, 0xF745, 0x7C2E, 0, 0xF96E, 0, 0x7C6A, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0xF434, 0x2F4B,
+ 0x2F57, 0x4F72, 0xF444, 0xAE79, 0x757A, 0x775A, 0x776F, 0xF453,
+ 0xF455, 0x793C, 0x793D, 0x7941, 0xF45A, 0xF45B, 0xF45E, 0x7B3A,
+ 0xF738, 0xF745, 0x7C2E, 0xF469, 0xF96E, 0xF46B, 0x7C6A, 0xF46F,
+ 0xF470, 0xF473, 0xF477, 0xF478, 0xF479, 0xF47D, 0, 0,
0x2E38, 0x2E49, 0x2E50, 0x2E63, 0x2E68, 0x2E6E, 0x2F2C, 0x2F2F,
0x2F36, 0x2F5A, 0x2F5E, 0x4F61, 0x4F62, 0x7450, 0x745C, 0x745E,
};
@@ -11957,16 +11957,6 @@ static const unsigned short utf8_to_euc_EFBF[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
-static const unsigned short utf8_to_euc_EFBF_x0213[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0x2131, 0, 0x216F, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
static const unsigned short *const utf8_to_euc_E1_x0213[] = {
0, 0, 0, 0,
0, 0, 0, 0,
@@ -12415,7 +12405,7 @@ static const unsigned short *const utf8_to_euc_EF_x0213[] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, utf8_to_euc_EFB9_x0213, 0, 0,
- utf8_to_euc_EFBC_x0213, utf8_to_euc_EFBD_x0213, utf8_to_euc_EFBE, utf8_to_euc_EFBF_x0213,
+ utf8_to_euc_EFBC_x0213, utf8_to_euc_EFBD_x0213, utf8_to_euc_EFBE, utf8_to_euc_EFBF,
};
const unsigned short *const utf8_to_euc_2bytes[] = {
0, 0, 0, 0,
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 37717e4799..9613a925ce 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);
@@ -168,6 +170,7 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
/* use _result_ end */
rb_str_set_len(tmp, output_ctr);
+ OBJ_INFECT(tmp, src);
if (mimeout_f)
rb_enc_associate(tmp, rb_usascii_encoding());
@@ -192,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;
diff --git a/ext/objspace/depend b/ext/objspace/depend
index 18be4fe8a8..32af521ba5 100644
--- a/ext/objspace/depend
+++ b/ext/objspace/depend
@@ -1,30 +1,27 @@
# AUTOGENERATED DEPENDENCIES START
object_tracing.o: $(RUBY_EXTCONF_H)
object_tracing.o: $(arch_hdrdir)/ruby/config.h
-object_tracing.o: $(hdrdir)/ruby.h
-object_tracing.o: $(hdrdir)/ruby/assert.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/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.h
-objspace.o: $(hdrdir)/ruby/assert.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
@@ -32,23 +29,18 @@ 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.h
-objspace_dump.o: $(hdrdir)/ruby/assert.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
@@ -59,13 +51,14 @@ 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
diff --git a/ext/objspace/extconf.rb b/ext/objspace/extconf.rb
index d0c2dbd02b..2b4154303f 100644
--- a/ext/objspace/extconf.rb
+++ b/ext/objspace/extconf.rb
@@ -1,4 +1,3 @@
-# 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 a057ac2a96..3a7f54427d 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -39,8 +39,7 @@ make_unique_str(st_table *tbl, const char *str, long len)
if (st_lookup(tbl, (st_data_t)str, &n)) {
st_insert(tbl, (st_data_t)str, n+1);
- st_get_key(tbl, (st_data_t)str, &n);
- result = (char *)n;
+ st_get_key(tbl, (st_data_t)str, (st_data_t *)&result);
}
else {
result = (char *)ruby_xmalloc(len+1);
@@ -60,9 +59,8 @@ delete_unique_str(st_table *tbl, const char *str)
st_lookup(tbl, (st_data_t)str, &n);
if (n == 1) {
- n = (st_data_t)str;
- st_delete(tbl, &n, 0);
- ruby_xfree((char *)n);
+ st_delete(tbl, (st_data_t *)&str, 0);
+ ruby_xfree((char *)str);
}
else {
st_insert(tbl, (st_data_t)str, n-1);
@@ -84,10 +82,8 @@ newobj_i(VALUE tpval, void *data)
const char *path_cstr = RTEST(path) ? make_unique_str(arg->str_table, RSTRING_PTR(path), RSTRING_LEN(path)) : 0;
VALUE class_path = (RTEST(klass) && !OBJ_FROZEN(klass)) ? rb_class_path_cached(klass) : Qnil;
const char *class_path_cstr = RTEST(class_path) ? make_unique_str(arg->str_table, RSTRING_PTR(class_path), RSTRING_LEN(class_path)) : 0;
- st_data_t v;
- if (st_lookup(arg->object_table, (st_data_t)obj, &v)) {
- info = (struct allocation_info *)v;
+ if (st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) {
if (arg->keep_remains) {
if (info->living) {
/* do nothing. there is possibility to keep living if FREEOBJ events while suppressing tracing */
@@ -117,19 +113,15 @@ freeobj_i(VALUE tpval, void *data)
{
struct traceobj_arg *arg = (struct traceobj_arg *)data;
rb_trace_arg_t *tparg = rb_tracearg_from_tracepoint(tpval);
- st_data_t obj = (st_data_t)rb_tracearg_object(tparg);
- st_data_t v;
+ VALUE obj = rb_tracearg_object(tparg);
struct allocation_info *info;
- if (arg->keep_remains) {
- if (st_lookup(arg->object_table, obj, &v)) {
- info = (struct allocation_info *)v;
+ if (st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) {
+ if (arg->keep_remains) {
info->living = 0;
}
- }
- else {
- if (st_delete(arg->object_table, &obj, &v)) {
- info = (struct allocation_info *)v;
+ else {
+ st_delete(arg->object_table, (st_data_t *)&obj, (st_data_t *)&info);
delete_unique_str(arg->str_table, info->path);
delete_unique_str(arg->str_table, info->class_path);
ruby_xfree(info);
@@ -138,14 +130,14 @@ freeobj_i(VALUE tpval, void *data)
}
static int
-free_keys_i(st_data_t key, st_data_t value, st_data_t data)
+free_keys_i(st_data_t key, st_data_t value, void *data)
{
ruby_xfree((void *)key);
return ST_CONTINUE;
}
static int
-free_values_i(st_data_t key, st_data_t value, st_data_t data)
+free_values_i(st_data_t key, st_data_t value, void *data)
{
ruby_xfree((void *)value);
return ST_CONTINUE;
@@ -186,9 +178,7 @@ trace_object_allocations_start(VALUE self)
else {
if (arg->newobj_trace == 0) {
arg->newobj_trace = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_NEWOBJ, newobj_i, arg);
- rb_gc_register_mark_object(arg->newobj_trace);
arg->freeobj_trace = rb_tracepoint_new(0, RUBY_INTERNAL_EVENT_FREEOBJ, freeobj_i, arg);
- rb_gc_register_mark_object(arg->freeobj_trace);
}
rb_tracepoint_enable(arg->newobj_trace);
rb_tracepoint_enable(arg->freeobj_trace);
@@ -218,6 +208,8 @@ trace_object_allocations_stop(VALUE self)
if (arg->running == 0) {
rb_tracepoint_disable(arg->newobj_trace);
rb_tracepoint_disable(arg->freeobj_trace);
+ arg->newobj_trace = 0;
+ arg->freeobj_trace = 0;
}
return Qnil;
@@ -329,9 +321,9 @@ static struct allocation_info *
lookup_allocation_info(VALUE obj)
{
if (tmp_trace_arg) {
- st_data_t info;
- if (st_lookup(tmp_trace_arg->object_table, obj, &info)) {
- return (struct allocation_info *)info;
+ struct allocation_info *info;
+ if (st_lookup(tmp_trace_arg->object_table, obj, (st_data_t *)&info)) {
+ return info;
}
}
return NULL;
@@ -364,7 +356,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+.
*
@@ -447,7 +439,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 311e687206..038461a394 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -12,13 +12,12 @@
**********************************************************************/
-#include <ruby/io.h>
#include "internal.h"
#include <ruby/st.h>
+#include <ruby/io.h>
#include <ruby/re.h>
#include "node.h"
#include "gc.h"
-#include "symbol.h"
/*
* call-seq:
@@ -33,7 +32,7 @@
* This method is only expected to work with C Ruby.
*
* From Ruby 2.2, memsize_of(obj) returns a memory size includes
- * sizeof(RVALUE).
+ * sizeof(RVALUE).
*/
static VALUE
@@ -57,11 +56,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 +124,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,10 +166,8 @@ 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_MOVED);
CASE_TYPE(T_ZOMBIE);
#undef CASE_TYPE
default: rb_bug("type2sym: unknown type (%d)", i);
@@ -204,7 +183,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, ...}
@@ -225,7 +204,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;
@@ -233,6 +217,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);
@@ -244,77 +235,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)
{
@@ -358,8 +278,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;
@@ -367,25 +292,28 @@ 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_CASE3);
COUNT_NODE(NODE_WHEN);
- COUNT_NODE(NODE_IN);
+ COUNT_NODE(NODE_OPT_N);
COUNT_NODE(NODE_WHILE);
COUNT_NODE(NODE_UNTIL);
COUNT_NODE(NODE_ITER);
COUNT_NODE(NODE_FOR);
- COUNT_NODE(NODE_FOR_MASGN);
COUNT_NODE(NODE_BREAK);
COUNT_NODE(NODE_NEXT);
COUNT_NODE(NODE_REDO);
@@ -402,22 +330,22 @@ 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_LIST);
- COUNT_NODE(NODE_ZLIST);
+ COUNT_NODE(NODE_ARRAY);
+ COUNT_NODE(NODE_ZARRAY);
COUNT_NODE(NODE_VALUES);
COUNT_NODE(NODE_HASH);
COUNT_NODE(NODE_RETURN);
@@ -440,7 +368,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_DXSTR);
COUNT_NODE(NODE_EVSTR);
COUNT_NODE(NODE_DREGX);
- COUNT_NODE(NODE_ONCE);
+ COUNT_NODE(NODE_DREGX_ONCE);
COUNT_NODE(NODE_ARGS);
COUNT_NODE(NODE_ARGS_AUX);
COUNT_NODE(NODE_OPT_ARG);
@@ -449,6 +377,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);
@@ -460,6 +390,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);
@@ -471,16 +402,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);
- COUNT_NODE(NODE_ARYPTN);
- COUNT_NODE(NODE_HSHPTN);
#undef COUNT_NODE
- case NODE_LAST: break;
+ default: node = INT2FIX(i);
}
- UNREACHABLE;
- set:
rb_hash_aset(hash, node, SIZET2NUM(nodes[i]));
}
}
@@ -554,88 +486,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_env");
- 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_tmpbuf");
- imemo_type_ids[9] = rb_intern("imemo_ast");
- imemo_type_ids[10] = 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;
}
@@ -664,7 +529,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. */
@@ -809,7 +674,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");
}
@@ -830,7 +696,7 @@ static int
collect_values_of_values(VALUE category, VALUE category_objects, VALUE categories)
{
VALUE ary = rb_ary_new();
- rb_hash_foreach(category_objects, collect_values, ary);
+ st_foreach(rb_hash_tbl(category_objects), collect_values, ary);
rb_hash_aset(categories, category, ary);
return ST_CONTINUE;
}
@@ -845,82 +711,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);
@@ -942,7 +742,6 @@ void Init_objspace_dump(VALUE rb_mObjSpace);
void
Init_objspace(void)
{
-#undef rb_intern
VALUE rb_mObjSpace;
#if 0
rb_mObjSpace = rb_define_module("ObjectSpace"); /* let rdoc know */
@@ -953,17 +752,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 5fa9d98e38..b6973df10e 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -12,30 +12,27 @@
**********************************************************************/
-#include "ruby/io.h"
#include "internal.h"
#include "ruby/debug.h"
+#include "ruby/io.h"
#include "gc.h"
#include "node.h"
#include "vm_core.h"
#include "objspace.h"
static VALUE sym_output, sym_stdout, sym_string, sym_file;
-static VALUE sym_full;
struct dump_config {
VALUE type;
FILE *stream;
VALUE string;
+ int roots;
const char *root_category;
VALUE cur_obj;
VALUE cur_obj_klass;
size_t cur_obj_references;
- unsigned int roots: 1;
- unsigned int full_heap: 1;
};
-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 +51,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 +89,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 +116,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 +125,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;
@@ -172,49 +133,14 @@ reachable_object_i(VALUE ref, void *data)
return;
if (dc->cur_obj_references == 0)
- dump_append(dc, ", \"references\":[\"%#"PRIxVALUE"\"", ref);
+ dump_append(dc, ", \"references\":[\"%p\"", (void *)ref);
else
- dump_append(dc, ", \"%#"PRIxVALUE"\"", ref);
+ dump_append(dc, ", \"%p\"", (void *)ref);
dc->cur_obj_references++;
}
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(tmpbuf);
- 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;
@@ -224,7 +150,7 @@ dump_object(VALUE obj, struct dump_config *dc)
size_t n, i;
if (SPECIAL_CONST_P(obj)) {
- dump_append_special_const(dc, obj);
+ dump_append(dc, "{}");
return;
}
@@ -235,24 +161,16 @@ dump_object(VALUE obj, struct dump_config *dc)
if (dc->cur_obj == dc->string)
return;
- dump_append(dc, "{\"address\":\"%#"PRIxVALUE"\", \"type\":\"%s\"", obj, obj_type(obj));
+ dump_append(dc, "{\"address\":\"%p\", \"type\":\"%s\"", (void *)obj, obj_type(obj));
if (dc->cur_obj_klass)
- dump_append(dc, ", \"class\":\"%#"PRIxVALUE"\"", dc->cur_obj_klass);
+ dump_append(dc, ", \"class\":\"%p\"", (void *)dc->cur_obj_klass);
if (rb_obj_frozen_p(obj))
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,17 +182,25 @@ 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));
- if (FL_TEST(obj, RHASH_PROC_DEFAULT))
- dump_append(dc, ", \"default\":\"%#"PRIxVALUE"\"", RHASH_IFNONE(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;
case T_ARRAY:
@@ -301,7 +227,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 +272,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;
}
@@ -363,12 +288,12 @@ root_obj_i(const char *category, VALUE obj, void *data)
if (dc->root_category != NULL && category != dc->root_category)
dump_append(dc, "]}\n");
if (dc->root_category == NULL || category != dc->root_category)
- dump_append(dc, "{\"type\":\"ROOT\", \"root\":\"%s\", \"references\":[\"%#"PRIxVALUE"\"", category, obj);
+ dump_append(dc, "{\"type\":\"ROOT\", \"root\":\"%s\", \"references\":[\"%p\"", category, (void *)obj);
else
- dump_append(dc, ", \"%#"PRIxVALUE"\"", obj);
+ dump_append(dc, ", \"%p\"", (void *)obj);
dc->root_category = category;
- dc->roots = 1;
+ dc->roots++;
}
static VALUE
@@ -376,15 +301,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 +336,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);
@@ -498,7 +417,6 @@ objspace_dump_all(int argc, VALUE *argv, VALUE os)
void
Init_objspace_dump(VALUE rb_mObjSpace)
{
-#undef rb_intern
#if 0
rb_mObjSpace = rb_define_module("ObjectSpace"); /* let rdoc know */
#endif
@@ -510,7 +428,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 68cf357294..21ba20abde 100644
--- a/ext/openssl/depend
+++ b/ext/openssl/depend
@@ -1,25 +1,21 @@
# 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.h
-ossl.o: $(hdrdir)/ruby/assert.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
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
@@ -31,10 +27,10 @@ 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_pkcs5.h
ossl.o: ossl_pkcs7.h
ossl.o: ossl_pkey.h
ossl.o: ossl_rand.h
@@ -44,20 +40,17 @@ 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.h
-ossl_asn1.o: $(hdrdir)/ruby/assert.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
@@ -69,10 +62,10 @@ 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_pkcs5.h
ossl_asn1.o: ossl_pkcs7.h
ossl_asn1.o: ossl_pkey.h
ossl_asn1.o: ossl_rand.h
@@ -82,20 +75,17 @@ 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.h
-ossl_bio.o: $(hdrdir)/ruby/assert.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
@@ -107,10 +97,10 @@ 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_pkcs5.h
ossl_bio.o: ossl_pkcs7.h
ossl_bio.o: ossl_pkey.h
ossl_bio.o: ossl_rand.h
@@ -120,20 +110,17 @@ 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.h
-ossl_bn.o: $(hdrdir)/ruby/assert.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
@@ -145,10 +132,10 @@ 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_pkcs5.h
ossl_bn.o: ossl_pkcs7.h
ossl_bn.o: ossl_pkey.h
ossl_bn.o: ossl_rand.h
@@ -158,20 +145,17 @@ 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.h
-ossl_cipher.o: $(hdrdir)/ruby/assert.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
@@ -183,10 +167,10 @@ 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_pkcs5.h
ossl_cipher.o: ossl_pkcs7.h
ossl_cipher.o: ossl_pkey.h
ossl_cipher.o: ossl_rand.h
@@ -196,20 +180,17 @@ 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.h
-ossl_config.o: $(hdrdir)/ruby/assert.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
@@ -221,10 +202,10 @@ 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_pkcs5.h
ossl_config.o: ossl_pkcs7.h
ossl_config.o: ossl_pkey.h
ossl_config.o: ossl_rand.h
@@ -234,20 +215,17 @@ 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.h
-ossl_digest.o: $(hdrdir)/ruby/assert.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
@@ -259,10 +237,10 @@ 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_pkcs5.h
ossl_digest.o: ossl_pkcs7.h
ossl_digest.o: ossl_pkey.h
ossl_digest.o: ossl_rand.h
@@ -272,20 +250,17 @@ 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.h
-ossl_engine.o: $(hdrdir)/ruby/assert.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
@@ -297,10 +272,10 @@ 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_pkcs5.h
ossl_engine.o: ossl_pkcs7.h
ossl_engine.o: ossl_pkey.h
ossl_engine.o: ossl_rand.h
@@ -310,20 +285,17 @@ 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.h
-ossl_hmac.o: $(hdrdir)/ruby/assert.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
@@ -335,10 +307,10 @@ 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_pkcs5.h
ossl_hmac.o: ossl_pkcs7.h
ossl_hmac.o: ossl_pkey.h
ossl_hmac.o: ossl_rand.h
@@ -346,60 +318,19 @@ 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.h
-ossl_kdf.o: $(hdrdir)/ruby/assert.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: 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.h
-ossl_ns_spki.o: $(hdrdir)/ruby/assert.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
@@ -410,11 +341,11 @@ 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_pkcs5.h
ossl_ns_spki.o: ossl_pkcs7.h
ossl_ns_spki.o: ossl_pkey.h
ossl_ns_spki.o: ossl_rand.h
@@ -424,20 +355,17 @@ 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.h
-ossl_ocsp.o: $(hdrdir)/ruby/assert.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
@@ -448,11 +376,11 @@ 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_pkcs5.h
ossl_ocsp.o: ossl_pkcs7.h
ossl_ocsp.o: ossl_pkey.h
ossl_ocsp.o: ossl_rand.h
@@ -462,20 +390,17 @@ 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.h
-ossl_pkcs12.o: $(hdrdir)/ruby/assert.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
@@ -486,11 +411,11 @@ 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_pkcs5.h
ossl_pkcs12.o: ossl_pkcs7.h
ossl_pkcs12.o: ossl_pkey.h
ossl_pkcs12.o: ossl_rand.h
@@ -498,22 +423,54 @@ ossl_pkcs12.o: ossl_ssl.h
ossl_pkcs12.o: ossl_version.h
ossl_pkcs12.o: ossl_x509.h
ossl_pkcs12.o: ruby_missing.h
+ossl_pkcs5.o: $(RUBY_EXTCONF_H)
+ossl_pkcs5.o: $(arch_hdrdir)/ruby/config.h
+ossl_pkcs5.o: $(hdrdir)/ruby/defines.h
+ossl_pkcs5.o: $(hdrdir)/ruby/encoding.h
+ossl_pkcs5.o: $(hdrdir)/ruby/intern.h
+ossl_pkcs5.o: $(hdrdir)/ruby/io.h
+ossl_pkcs5.o: $(hdrdir)/ruby/missing.h
+ossl_pkcs5.o: $(hdrdir)/ruby/oniguruma.h
+ossl_pkcs5.o: $(hdrdir)/ruby/ruby.h
+ossl_pkcs5.o: $(hdrdir)/ruby/st.h
+ossl_pkcs5.o: $(hdrdir)/ruby/subst.h
+ossl_pkcs5.o: $(hdrdir)/ruby/thread.h
+ossl_pkcs5.o: $(top_srcdir)/include/ruby.h
+ossl_pkcs5.o: openssl_missing.h
+ossl_pkcs5.o: ossl.h
+ossl_pkcs5.o: ossl_asn1.h
+ossl_pkcs5.o: ossl_bio.h
+ossl_pkcs5.o: ossl_bn.h
+ossl_pkcs5.o: ossl_cipher.h
+ossl_pkcs5.o: ossl_config.h
+ossl_pkcs5.o: ossl_digest.h
+ossl_pkcs5.o: ossl_engine.h
+ossl_pkcs5.o: ossl_hmac.h
+ossl_pkcs5.o: ossl_ns_spki.h
+ossl_pkcs5.o: ossl_ocsp.h
+ossl_pkcs5.o: ossl_pkcs12.h
+ossl_pkcs5.o: ossl_pkcs5.c
+ossl_pkcs5.o: ossl_pkcs5.h
+ossl_pkcs5.o: ossl_pkcs7.h
+ossl_pkcs5.o: ossl_pkey.h
+ossl_pkcs5.o: ossl_rand.h
+ossl_pkcs5.o: ossl_ssl.h
+ossl_pkcs5.o: ossl_version.h
+ossl_pkcs5.o: ossl_x509.h
+ossl_pkcs5.o: ruby_missing.h
ossl_pkcs7.o: $(RUBY_EXTCONF_H)
ossl_pkcs7.o: $(arch_hdrdir)/ruby/config.h
-ossl_pkcs7.o: $(hdrdir)/ruby.h
-ossl_pkcs7.o: $(hdrdir)/ruby/assert.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
@@ -524,10 +481,10 @@ 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_pkcs5.h
ossl_pkcs7.o: ossl_pkcs7.c
ossl_pkcs7.o: ossl_pkcs7.h
ossl_pkcs7.o: ossl_pkey.h
@@ -538,20 +495,17 @@ 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.h
-ossl_pkey.o: $(hdrdir)/ruby/assert.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
@@ -562,10 +516,10 @@ 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_pkcs5.h
ossl_pkey.o: ossl_pkcs7.h
ossl_pkey.o: ossl_pkey.c
ossl_pkey.o: ossl_pkey.h
@@ -576,20 +530,17 @@ 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.h
-ossl_pkey_dh.o: $(hdrdir)/ruby/assert.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
@@ -600,10 +551,10 @@ 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_pkcs5.h
ossl_pkey_dh.o: ossl_pkcs7.h
ossl_pkey_dh.o: ossl_pkey.h
ossl_pkey_dh.o: ossl_pkey_dh.c
@@ -614,20 +565,17 @@ 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.h
-ossl_pkey_dsa.o: $(hdrdir)/ruby/assert.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
@@ -638,10 +586,10 @@ 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_pkcs5.h
ossl_pkey_dsa.o: ossl_pkcs7.h
ossl_pkey_dsa.o: ossl_pkey.h
ossl_pkey_dsa.o: ossl_pkey_dsa.c
@@ -652,20 +600,17 @@ 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.h
-ossl_pkey_ec.o: $(hdrdir)/ruby/assert.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
@@ -676,10 +621,10 @@ 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_pkcs5.h
ossl_pkey_ec.o: ossl_pkcs7.h
ossl_pkey_ec.o: ossl_pkey.h
ossl_pkey_ec.o: ossl_pkey_ec.c
@@ -690,20 +635,17 @@ 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.h
-ossl_pkey_rsa.o: $(hdrdir)/ruby/assert.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
@@ -714,10 +656,10 @@ 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_pkcs5.h
ossl_pkey_rsa.o: ossl_pkcs7.h
ossl_pkey_rsa.o: ossl_pkey.h
ossl_pkey_rsa.o: ossl_pkey_rsa.c
@@ -728,20 +670,17 @@ 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.h
-ossl_rand.o: $(hdrdir)/ruby/assert.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
@@ -752,10 +691,10 @@ 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_pkcs5.h
ossl_rand.o: ossl_pkcs7.h
ossl_rand.o: ossl_pkey.h
ossl_rand.o: ossl_rand.c
@@ -766,20 +705,17 @@ 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.h
-ossl_ssl.o: $(hdrdir)/ruby/assert.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
@@ -790,10 +726,10 @@ 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_pkcs5.h
ossl_ssl.o: ossl_pkcs7.h
ossl_ssl.o: ossl_pkey.h
ossl_ssl.o: ossl_rand.h
@@ -804,20 +740,17 @@ 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.h
-ossl_ssl_session.o: $(hdrdir)/ruby/assert.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
@@ -828,10 +761,10 @@ 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_pkcs5.h
ossl_ssl_session.o: ossl_pkcs7.h
ossl_ssl_session.o: ossl_pkey.h
ossl_ssl_session.o: ossl_rand.h
@@ -842,20 +775,17 @@ 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.h
-ossl_x509.o: $(hdrdir)/ruby/assert.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
@@ -866,10 +796,10 @@ 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_pkcs5.h
ossl_x509.o: ossl_pkcs7.h
ossl_x509.o: ossl_pkey.h
ossl_x509.o: ossl_rand.h
@@ -880,20 +810,17 @@ 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.h
-ossl_x509attr.o: $(hdrdir)/ruby/assert.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
@@ -904,10 +831,10 @@ 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_pkcs5.h
ossl_x509attr.o: ossl_pkcs7.h
ossl_x509attr.o: ossl_pkey.h
ossl_x509attr.o: ossl_rand.h
@@ -918,20 +845,17 @@ 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.h
-ossl_x509cert.o: $(hdrdir)/ruby/assert.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
@@ -942,10 +866,10 @@ 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_pkcs5.h
ossl_x509cert.o: ossl_pkcs7.h
ossl_x509cert.o: ossl_pkey.h
ossl_x509cert.o: ossl_rand.h
@@ -956,20 +880,17 @@ 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.h
-ossl_x509crl.o: $(hdrdir)/ruby/assert.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
@@ -980,10 +901,10 @@ 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_pkcs5.h
ossl_x509crl.o: ossl_pkcs7.h
ossl_x509crl.o: ossl_pkey.h
ossl_x509crl.o: ossl_rand.h
@@ -994,20 +915,17 @@ 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.h
-ossl_x509ext.o: $(hdrdir)/ruby/assert.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
@@ -1018,10 +936,10 @@ 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_pkcs5.h
ossl_x509ext.o: ossl_pkcs7.h
ossl_x509ext.o: ossl_pkey.h
ossl_x509ext.o: ossl_rand.h
@@ -1032,20 +950,17 @@ 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.h
-ossl_x509name.o: $(hdrdir)/ruby/assert.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
@@ -1056,10 +971,10 @@ 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_pkcs5.h
ossl_x509name.o: ossl_pkcs7.h
ossl_x509name.o: ossl_pkey.h
ossl_x509name.o: ossl_rand.h
@@ -1070,20 +985,17 @@ 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.h
-ossl_x509req.o: $(hdrdir)/ruby/assert.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
@@ -1094,10 +1006,10 @@ 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_pkcs5.h
ossl_x509req.o: ossl_pkcs7.h
ossl_x509req.o: ossl_pkey.h
ossl_x509req.o: ossl_rand.h
@@ -1108,20 +1020,17 @@ 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.h
-ossl_x509revoked.o: $(hdrdir)/ruby/assert.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
@@ -1132,10 +1041,10 @@ 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_pkcs5.h
ossl_x509revoked.o: ossl_pkcs7.h
ossl_x509revoked.o: ossl_pkey.h
ossl_x509revoked.o: ossl_rand.h
@@ -1146,20 +1055,17 @@ 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.h
-ossl_x509store.o: $(hdrdir)/ruby/assert.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
@@ -1170,10 +1076,10 @@ 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_pkcs5.h
ossl_x509store.o: ossl_pkcs7.h
ossl_x509store.o: ossl_pkey.h
ossl_x509store.o: ossl_rand.h
diff --git a/ext/openssl/deprecation.rb b/ext/openssl/deprecation.rb
index afe989ead1..39ebfa0d37 100644
--- a/ext/openssl/deprecation.rb
+++ b/ext/openssl/deprecation.rb
@@ -1,9 +1,11 @@
-# frozen_string_literal: false
module OpenSSL
def self.deprecated_warning_flag
unless flag = (@deprecated_warning_flag ||= nil)
if try_compile("", flag = "-Werror=deprecated-declarations")
- $warnflags = "#{@warnflags = $warnflags}" #{flag}"
+ if with_config("broken-apple-openssl")
+ flag = "-Wno-deprecated-declarations"
+ end
+ $warnflags << " #{flag}"
else
flag = ""
end
@@ -12,16 +14,8 @@ module OpenSSL
flag
end
- def self.restore_warning_flag
- $warnflags = @warnflags
- 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 264130bb51..3dd8d29009 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,156 +23,142 @@ dir_config("kerberos")
Logging::message "=== OpenSSL for Ruby configurator ===\n"
-# Check with -Werror=deprecated-declarations 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
+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
Logging::message "=== Checking for OpenSSL features... ===\n"
-# compile options
+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("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")
-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
+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("SSLv3_method")
+have_func("SSLv3_server_method")
+have_func("SSLv3_client_method")
+have_func("TLSv1_1_method")
+have_func("TLSv1_1_server_method")
+have_func("TLSv1_1_client_method")
+have_func("TLSv1_2_method")
+have_func("TLSv1_2_server_method")
+have_func("TLSv1_2_client_method")
+have_func("SSL_CTX_set_next_proto_select_cb")
+unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
+ have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TLSEXT_HOST_NAME")
+end
+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
-OpenSSL.restore_warning_flag
-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..95babb4cbd 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,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
@@ -27,9 +32,8 @@ module OpenSSL
end # OpenSSL
##
-#--
# Add double dispatch to Integer
-#++
+#
class Integer
# Casts an Integer as an OpenSSL::BN
#
@@ -38,3 +42,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 5d1586e594..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)
@@ -316,33 +317,36 @@ module OpenSSL::Buffering
@wbuffer << s
@wbuffer.force_encoding(Encoding::BINARY)
@sync ||= false
- if @sync or @wbuffer.size > BLOCK_SIZE
- until @wbuffer.empty?
+ if @sync or @wbuffer.size > BLOCK_SIZE or idx = @wbuffer.rindex($/)
+ remain = idx ? idx + $/.size : @wbuffer.length
+ nwritten = 0
+ while remain > 0
+ str = @wbuffer[nwritten,remain]
begin
- nwrote = syswrite(@wbuffer)
+ nwrote = syswrite(str)
rescue Errno::EAGAIN
retry
end
- @wbuffer[0, nwrote] = ""
+ remain -= nwrote
+ nwritten += nwrote
end
+ @wbuffer[0,nwritten] = ""
end
end
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.
#
@@ -373,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
@@ -384,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.
@@ -404,14 +404,16 @@ module OpenSSL::Buffering
end
args.each{|arg|
s << arg.to_s
- s.sub!(/(?<!\n)\z/, "\n")
+ if $/ && /\n\z/ !~ s
+ s << "\n"
+ end
}
do_write(s)
nil
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 355eb2ebbb..f9e561ae0d 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -1,143 +1,89 @@
-# 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 "ipaddr"
+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 &= ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS if defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS)
+ opts |= OpenSSL::SSL::OP_NO_COMPRESSION if defined?(OpenSSL::SSL::OP_NO_COMPRESSION)
+ opts |= OpenSSL::SSL::OP_NO_SSLv2 if defined?(OpenSSL::SSL::OP_NO_SSLv2)
+ opts |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
opts
}.call
}
- 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
@@ -146,88 +92,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
@@ -260,6 +124,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|
@@ -273,11 +146,11 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
return true if verify_hostname(hostname, san.value)
when 7 # iPAddress in GeneralName (RFC5280)
should_verify_common_name = false
- if san.value.size == 4 || san.value.size == 16
- begin
- return true if san.value == IPAddr.new(hostname).hton
- rescue IPAddr::InvalidAddressError
- end
+ # follows GENERAL_NAME_print() in x509v3/v3_alt.c
+ if san.value.size == 4
+ return true if san.value.unpack('C*').join('.') == hostname
+ elsif san.value.size == 16
+ return true if san.value.unpack('n*').map { |e| sprintf("%X", e) }.join(':') == hostname
end
end
}
@@ -347,37 +220,10 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
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.
+ ##
+ # Perform hostname verification after an SSL connection is established
#
# This method MUST be called after calling #connect to ensure that the
# hostname of a remote peer has been verified.
@@ -385,8 +231,7 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
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."
+ msg += " Anonymous cipher suite #{cipher[0]} was negotiated. Anonymous suites must be disabled to use peer verification."
end
raise SSLError, msg
end
@@ -397,11 +242,6 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
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
@@ -415,26 +255,6 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
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
##
@@ -445,8 +265,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..38b65c71cf 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 << " = "
@@ -144,13 +145,7 @@ 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
@@ -165,13 +160,6 @@ module OpenSSL
end
end
- class Attribute
- def ==(other)
- return false unless Attribute === other
- to_der == other.to_der
- end
- end
-
class StoreContext
def cleanup
warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
@@ -190,26 +178,5 @@ module OpenSSL
}
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 295379fb6c..0000000000
--- a/ext/openssl/openssl.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = "openssl"
- s.version = "2.1.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.metadata = { "msys2_mingw_dependencies" => "openssl" } if s.respond_to? :metadata=
- s.require_paths = ["lib"]
- s.authors = ["Martin Bosslet", "SHIBATA Hiroshi", "Zachary Scott", "Kazuki Yamaguchi"]
- s.date = "2018-10-17"
- s.description = "It wraps the OpenSSL library."
- s.email = ["ruby-core@ruby-lang.org"]
- s.extensions = ["ext/openssl/extconf.rb"]
- s.extra_rdoc_files = ["README.md", "CONTRIBUTING.md", "History.md"]
- s.files = ["BSDL", "CONTRIBUTING.md", "History.md", "LICENSE.txt", "README.md", "ext/openssl/deprecation.rb", "ext/openssl/extconf.rb", "ext/openssl/openssl_missing.c", "ext/openssl/openssl_missing.h", "ext/openssl/ossl.c", "ext/openssl/ossl.h", "ext/openssl/ossl_asn1.c", "ext/openssl/ossl_asn1.h", "ext/openssl/ossl_bio.c", "ext/openssl/ossl_bio.h", "ext/openssl/ossl_bn.c", "ext/openssl/ossl_bn.h", "ext/openssl/ossl_cipher.c", "ext/openssl/ossl_cipher.h", "ext/openssl/ossl_config.c", "ext/openssl/ossl_config.h", "ext/openssl/ossl_digest.c", "ext/openssl/ossl_digest.h", "ext/openssl/ossl_engine.c", "ext/openssl/ossl_engine.h", "ext/openssl/ossl_hmac.c", "ext/openssl/ossl_hmac.h", "ext/openssl/ossl_kdf.c", "ext/openssl/ossl_kdf.h", "ext/openssl/ossl_ns_spki.c", "ext/openssl/ossl_ns_spki.h", "ext/openssl/ossl_ocsp.c", "ext/openssl/ossl_ocsp.h", "ext/openssl/ossl_pkcs12.c", "ext/openssl/ossl_pkcs12.h", "ext/openssl/ossl_pkcs7.c", "ext/openssl/ossl_pkcs7.h", "ext/openssl/ossl_pkey.c", "ext/openssl/ossl_pkey.h", "ext/openssl/ossl_pkey_dh.c", "ext/openssl/ossl_pkey_dsa.c", "ext/openssl/ossl_pkey_ec.c", "ext/openssl/ossl_pkey_rsa.c", "ext/openssl/ossl_rand.c", "ext/openssl/ossl_rand.h", "ext/openssl/ossl_ssl.c", "ext/openssl/ossl_ssl.h", "ext/openssl/ossl_ssl_session.c", "ext/openssl/ossl_version.h", "ext/openssl/ossl_x509.c", "ext/openssl/ossl_x509.h", "ext/openssl/ossl_x509attr.c", "ext/openssl/ossl_x509cert.c", "ext/openssl/ossl_x509crl.c", "ext/openssl/ossl_x509ext.c", "ext/openssl/ossl_x509name.c", "ext/openssl/ossl_x509req.c", "ext/openssl/ossl_x509revoked.c", "ext/openssl/ossl_x509store.c", "ext/openssl/ruby_missing.h", "lib/openssl.rb", "lib/openssl/bn.rb", "lib/openssl/buffering.rb", "lib/openssl/cipher.rb", "lib/openssl/config.rb", "lib/openssl/digest.rb", "lib/openssl/pkcs5.rb", "lib/openssl/pkey.rb", "lib/openssl/ssl.rb", "lib/openssl/x509.rb"]
- s.homepage = "https://github.com/ruby/openssl"
- s.licenses = ["Ruby"]
- s.rdoc_options = ["--main", "README.md"]
- s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
- s.rubygems_version = "3.0.0.beta1"
- s.summary = "OpenSSL provides SSL, TLS and general purpose cryptography."
-
- s.add_runtime_dependency("ipaddr", [">= 0"])
- s.add_development_dependency("rake", [">= 0"])
- s.add_development_dependency("rake-compiler", [">= 0"])
- s.add_development_dependency("test-unit", ["~> 3.0"])
- s.add_development_dependency("rdoc", [">= 0"])
-end
diff --git a/ext/openssl/openssl_missing.c b/ext/openssl/openssl_missing.c
index b36ef0288e..ec0c30ac99 100644
--- a/ext/openssl/openssl_missing.c
+++ b/ext/openssl/openssl_missing.c
@@ -1,106 +1,342 @@
/*
+ * $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_EVP_MD_CTX_CREATE)
+EVP_MD_CTX *
+EVP_MD_CTX_create(void)
{
- 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;
+ 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_EVP_MD_CTX_CLEANUP)
+int
+EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
+{
+ /* FIXME!!! */
+ memset(ctx, 0, sizeof(EVP_MD_CTX));
+
+ return 1;
+}
#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_DESTROY)
+void
+EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
{
- HMAC_CTX *ctx = OPENSSL_malloc(sizeof(HMAC_CTX));
- if (!ctx)
- return NULL;
- HMAC_CTX_init(ctx);
- return ctx;
+ EVP_MD_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
}
#endif
-#if !defined(HAVE_HMAC_CTX_FREE)
+#if !defined(HAVE_EVP_MD_CTX_INIT)
void
-ossl_HMAC_CTX_free(HMAC_CTX *ctx)
+EVP_MD_CTX_init(EVP_MD_CTX *ctx)
{
- if (ctx) {
- HMAC_CTX_cleanup(ctx);
- OPENSSL_free(ctx);
- }
+ memset(ctx, 0, sizeof(EVP_MD_CTX));
}
#endif
-#if !defined(HAVE_X509_CRL_GET0_SIGNATURE)
+#if !defined(HAVE_HMAC_CTX_INIT)
void
-ossl_X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
- const X509_ALGOR **palg)
+HMAC_CTX_init(HMAC_CTX *ctx)
{
- if (psig != NULL)
- *psig = crl->signature;
- if (palg != NULL)
- *palg = crl->sig_alg;
+ 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_X509_REQ_GET0_SIGNATURE)
+#if !defined(HAVE_HMAC_CTX_CLEANUP)
void
-ossl_X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
- const X509_ALGOR **palg)
+HMAC_CTX_cleanup(HMAC_CTX *ctx)
{
- if (psig != NULL)
- *psig = req->signature;
- if (palg != NULL)
- *palg = req->sig_alg;
+ 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)
+{
+ 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 09998214e1..1c10953166 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -1,222 +1,203 @@
/*
+ * $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)
+# define X509_STORE_get_ex_data(x, idx) \
+ CRYPTO_get_ex_data(&(x)->ex_data, (idx))
+#endif
+
+#if !defined(HAVE_X509_STORE_SET_EX_DATA)
+# define X509_STORE_set_ex_data(x, idx, data) \
+ CRYPTO_set_ex_data(&(x)->ex_data, (idx), (data))
+# define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
+ CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, (l), (p), \
+ (newf), (dupf), (freef))
#endif
-#if !defined(HAVE_X509_CRL_UP_REF)
-# define X509_CRL_up_ref(x) \
- CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509_CRL);
+#if !defined(HAVE_X509_CRL_SET_VERSION)
+int X509_CRL_set_version(X509_CRL *x, long version);
#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_ISSUER_NAME)
+int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
#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_SORT)
+int X509_CRL_sort(X509_CRL *c);
#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_ADD0_REVOKED)
+int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
#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_BN_MOD_SQR)
+int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+#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_ADD)
+int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 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_SUB)
+int BN_mod_sub(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_RAND_RANGE)
+int BN_rand_range(BIGNUM *r, BIGNUM *range);
#endif
-#if !defined(OPENSSL_NO_EC)
-IMPL_PKEY_GETTER(EC_KEY, ec)
+#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
+int BN_pseudo_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_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 e4196f0754..b82549e6e5 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,78 @@ 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_store_ctx_ex_verify_cb_idx;
+int ossl_store_ex_verify_cb_idx;
+
+VALUE
+ossl_call_verify_cb_proc(struct ossl_verify_cb_args *args)
+{
+ 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_store_ctx_ex_verify_cb_idx);
+ if (!proc)
+ proc = (VALUE)X509_STORE_get_ex_data(ctx->ctx, ossl_store_ex_verify_cb_idx);
+ if (!proc)
+ return ok;
+ if (!NIL_P(proc)) {
+ ret = Qfalse;
+ 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 +268,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 +296,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 +319,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 +342,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 +359,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(VALUE _)
+ossl_get_errors(void)
{
VALUE ary;
long e;
@@ -386,36 +410,29 @@ 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
*
* Turns FIPS mode on or off. Turning on FIPS mode will obviously only have an
@@ -423,14 +440,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 +465,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 +512,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 +601,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 +614,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 +778,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 +847,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 +1001,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 +1023,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!"
@@ -1099,7 +1037,6 @@ static void Init_ossl_locks(void)
void
Init_openssl(void)
{
-#undef rb_intern
/*
* Init timezone info
*/
@@ -1110,14 +1047,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 +1087,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 +1096,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 +1113,14 @@ Init_openssl(void)
rb_global_variable(&eOSSLError);
/*
+ * Verify callback Proc index for ext-data
+ */
+ if ((ossl_store_ctx_ex_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, (void *)"ossl_store_ctx_ex_verify_cb_idx", 0, 0, 0)) < 0)
+ ossl_raise(eOSSLError, "X509_STORE_CTX_get_ex_new_index");
+ if ((ossl_store_ex_verify_cb_idx = X509_STORE_get_ex_new_index(0, (void *)"ossl_store_ex_verify_cb_idx", 0, 0, 0)) < 0)
+ ossl_raise(eOSSLError, "X509_STORE_get_ex_new_index");
+
+ /*
* Init debug core
*/
dOSSL = Qfalse;
@@ -1187,9 +1135,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 +1148,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 +1156,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 6af7ddd7d0..1b42597067 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>
+#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 <errno.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>
@@ -27,18 +63,22 @@
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
-#include <openssl/crypto.h>
-#if !defined(OPENSSL_NO_ENGINE)
+#include <openssl/conf_api.h>
+#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
@@ -60,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);\
@@ -90,42 +142,45 @@ 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_store_ctx_ex_verify_cb_idx;
+extern int ossl_store_ex_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);
@@ -143,9 +198,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
/*
@@ -164,14 +230,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 0085d4beab..6d564a312f 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')
@@ -970,9 +1046,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')
@@ -1000,9 +1076,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
@@ -1037,19 +1113,19 @@ ossl_asn1_decode_all(VALUE self, VALUE obj)
/*
* 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 +1138,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 +1173,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 +1261,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 +1357,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 +1385,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 +1400,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 +1421,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) \
@@ -1360,27 +1477,25 @@ OSSL_ASN1_IMPL_FACTORY_METHOD(EndOfContent)
void
Init_ossl_asn1(void)
{
-#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 +1521,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 +1555,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 +1668,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 +1679,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 +1692,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 +1715,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 +1742,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 +1839,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 +1873,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,10 +1971,8 @@ 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_gc_register_mark_object(class_tag_map);
rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC));
rb_hash_aset(class_tag_map, cASN1Boolean, INT2NUM(V_ASN1_BOOLEAN));
rb_hash_aset(class_tag_map, cASN1Integer, INT2NUM(V_ASN1_INTEGER));
@@ -1848,6 +1996,5 @@ do{\
rb_hash_aset(class_tag_map, cASN1GeneralString, INT2NUM(V_ASN1_GENERALSTRING));
rb_hash_aset(class_tag_map, cASN1UniversalString, INT2NUM(V_ASN1_UNIVERSALSTRING));
rb_hash_aset(class_tag_map, cASN1BMPString, INT2NUM(V_ASN1_BMPSTRING));
-
- id_each = rb_intern_const("each");
+ rb_global_variable(&class_tag_map);
}
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 6f0064e966..c1eaea224b 100644
--- a/ext/openssl/ossl_bn.c
+++ b/ext/openssl/ossl_bn.c
@@ -1,22 +1,21 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_bn_type, (bn)); \
} while (0)
#define GetBN(obj, bn) do { \
@@ -26,29 +25,34 @@
} \
} while (0)
+#define SafeGetBN(obj, bn) do { \
+ OSSL_Check_Kind((obj), cBN); \
+ GetBN((obj), (bn)); \
+} while (0)
+
static void
ossl_bn_free(void *ptr)
{
BN_clear_free(ptr);
}
+static size_t
+ossl_bn_size(const void *ptr)
+{
+ return sizeof(BIGNUM);
+}
+
static const rb_data_type_t ossl_bn_type = {
"OpenSSL/BN",
- {
- 0, ossl_bn_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+ {0, ossl_bn_free, ossl_bn_size,},
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY,
};
/*
* Classes
*/
VALUE cBN;
-
-/* Document-class: OpenSSL::BNError
- *
- * Generic Error for all of OpenSSL::BN (big num)
- */
VALUE eBNError;
/*
@@ -60,89 +64,41 @@ 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)
+try_convert_to_bnptr(VALUE obj)
{
- 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;
+ BIGNUM *bn = NULL;
- if (INT_MAX < len) {
- rb_raise(eBNError, "bignum too long");
+ 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);
}
- 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);
+ WrapBN(cBN, obj, bn); /* Handle potencial mem leaks */
+ break;
}
-
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;
-
- tmp = try_convert_to_bn(*ptr);
- if (NIL_P(tmp))
+ BIGNUM *bn = try_convert_to_bnptr(obj);
+ if (!bn)
ossl_raise(rb_eTypeError, "Cannot convert into OpenSSL::BN");
- GetBN(tmp, bn);
- *ptr = tmp;
return bn;
}
@@ -161,25 +117,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)
@@ -187,19 +141,50 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
BIGNUM *bn;
VALUE str, bs;
int base = 10;
- char *ptr;
if (rb_scan_args(argc, argv, "11", &str, &bs) == 2) {
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;
@@ -211,27 +196,26 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
return self;
}
+ StringValue(str);
GetBN(self, bn);
switch (base) {
case 0:
- ptr = StringValuePtr(str);
- if (!BN_mpi2bn((unsigned char *)ptr, RSTRING_LENINT(str), bn)) {
+ if (!BN_mpi2bn((unsigned char *)RSTRING_PTR(str), RSTRING_LENINT(str), bn)) {
ossl_raise(eBNError, NULL);
}
break;
case 2:
- ptr = StringValuePtr(str);
- if (!BN_bin2bn((unsigned char *)ptr, 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;
@@ -247,12 +231,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)
@@ -342,6 +326,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) \
{ \
@@ -352,51 +341,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); \
} \
@@ -404,25 +364,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); \
} \
@@ -430,32 +388,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); \
} \
@@ -463,69 +413,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);
}
@@ -538,13 +447,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) \
{ \
@@ -552,7 +466,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); \
} \
@@ -560,39 +473,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) \
{ \
@@ -603,33 +497,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)
@@ -646,6 +520,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) \
{ \
@@ -654,7 +533,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); \
} \
@@ -662,25 +540,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) \
{ \
@@ -692,22 +563,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) \
{ \
@@ -723,7 +587,6 @@ BIGNUM_SELF_SHIFT(rshift)
top = NUM2INT(fill); \
} \
b = NUM2INT(bits); \
- obj = NewBN(klass); \
if (!(result = BN_new())) { \
ossl_raise(eBNError, NULL); \
} \
@@ -731,28 +594,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); \
} \
@@ -760,39 +618,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)
@@ -812,40 +652,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
@@ -866,70 +698,27 @@ 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
+ * 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
@@ -938,12 +727,10 @@ ossl_bn_eq(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);
+ /* BNPtr may raise, so we can't use here */
+ bn2 = try_convert_to_bnptr(other);
- if (!BN_cmp(bn1, bn2)) {
+ if (bn2 && !BN_cmp(bn1, bn2)) {
return Qtrue;
}
return Qfalse;
@@ -954,7 +741,7 @@ ossl_bn_eq(VALUE self, VALUE other)
* 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
+ * <code>OpenSSL::BN</code> with the same value as <i>big</i>. Contrast this
* with OpenSSL::BN#==, which performs type conversions.
*/
static VALUE
@@ -982,20 +769,20 @@ static VALUE
ossl_bn_hash(VALUE self)
{
BIGNUM *bn;
- VALUE tmp, hash;
+ VALUE hash;
unsigned char *buf;
int len;
GetBN(self, bn);
len = BN_num_bytes(bn);
- buf = ALLOCV(tmp, len);
+ buf = xmalloc(len);
if (BN_bn2bin(bn, buf) != len) {
- ALLOCV_END(tmp);
- ossl_raise(eBNError, "BN_bn2bin");
+ xfree(buf);
+ ossl_raise(eBNError, NULL);
}
- hash = ST2FIX(rb_memhash(buf, len));
- ALLOCV_END(tmp);
+ hash = INT2FIX(rb_memhash(buf, len));
+ xfree(buf);
return hash;
}
@@ -1005,12 +792,8 @@ ossl_bn_hash(VALUE self)
* 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)
@@ -1023,7 +806,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:
@@ -1041,12 +824,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)
@@ -1065,7 +845,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:
@@ -1085,8 +865,7 @@ void
Init_ossl_bn(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
if (!(ossl_bn_ctx = BN_CTX_new())) {
@@ -1100,7 +879,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?) */
@@ -1109,9 +888,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);
@@ -1145,7 +921,6 @@ Init_ossl_bn(void)
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
@@ -1160,7 +935,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);
@@ -1202,4 +976,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..08fdacfb4a 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -1,74 +1,63 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_cipher_type, (ctx))
+#define MakeCipher(obj, klass, ctx) \
+ (obj) = TypedData_Make_Struct((klass), EVP_CIPHER_CTX, &ossl_cipher_type, (ctx))
+#define AllocCipher(obj, ctx) \
+ (DATA_PTR(obj) = (ctx) = ZALLOC(EVP_CIPHER_CTX))
#define GetCipherInit(obj, ctx) do { \
TypedData_Get_Struct((obj), EVP_CIPHER_CTX, &ossl_cipher_type, (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 size_t ossl_cipher_memsize(const void *ptr);
static const rb_data_type_t ossl_cipher_type = {
"OpenSSL/Cipher",
- {
- 0, ossl_cipher_free,
- },
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+ {0, ossl_cipher_free, ossl_cipher_memsize,},
+ 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 +68,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);
@@ -91,20 +81,35 @@ ossl_cipher_new(const EVP_CIPHER *cipher)
static void
ossl_cipher_free(void *ptr)
{
- EVP_CIPHER_CTX_free(ptr);
+ EVP_CIPHER_CTX *ctx = ptr;
+ if (ctx) {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ ruby_xfree(ctx);
+ }
+}
+
+static size_t
+ossl_cipher_memsize(const void *ptr)
+{
+ const EVP_CIPHER_CTX *ctx = ptr;
+ return ctx ? sizeof(*ctx) : 0;
}
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 +119,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 +156,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 +191,9 @@ ossl_s_ciphers(VALUE self)
return ary;
}
+#else
+#define ossl_s_ciphers rb_f_notimplement
+#endif
/*
* call-seq:
@@ -237,9 +257,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 +268,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 +286,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 +298,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 +334,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,8 +343,6 @@ 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;
}
@@ -338,23 +351,25 @@ ossl_cipher_update_long(EVP_CIPHER_CTX *ctx, unsigned char *out, long *out_len_p
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;
-
+#define UPDATE_LENGTH_LIMIT INT_MAX
+
+#if SIZEOF_LONG > UPDATE_LENGTH_LIMIT
+ if (in_len > UPDATE_LENGTH_LIMIT) {
+ const int in_part_len = (UPDATE_LENGTH_LIMIT / 2 + 1) & ~1;
+ do {
+ if (!EVP_CipherUpdate(ctx, out ? (out + out_len) : 0,
+ &out_part_len, in, in_part_len))
+ return 0;
+ out_len += out_part_len;
+ in += in_part_len;
+ } while ((in_len -= in_part_len) > UPDATE_LENGTH_LIMIT);
+ }
+#endif
+ if (!EVP_CipherUpdate(ctx, out ? (out + out_len) : 0,
+ &out_part_len, in, (int)in_len))
+ return 0;
+ if (out_len_ptr) *out_len_ptr = out_len += out_part_len;
return 1;
}
@@ -363,12 +378,13 @@ ossl_cipher_update_long(EVP_CIPHER_CTX *ctx, unsigned char *out, long *out_len_p
* 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)
@@ -380,9 +396,6 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self)
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)
@@ -416,7 +429,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 +485,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 +509,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 +530,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
@@ -571,8 +562,6 @@ ossl_cipher_set_auth_data(VALUE self, VALUE data)
in_len = RSTRING_LEN(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))
ossl_raise(eCipherError, "couldn't set additional authenticated data");
@@ -580,63 +569,88 @@ ossl_cipher_set_auth_data(VALUE self, VALUE 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 +659,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 +724,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 +746,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 +765,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 +788,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 +887,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 +901,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 +964,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 +1006,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..74a52f71a2 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);
@@ -72,12 +72,6 @@ void
Init_ossl_config(void)
{
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..6ce5316fd9 100644
--- a/ext/openssl/ossl_digest.c
+++ b/ext/openssl/ossl_digest.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,6 +16,10 @@
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
@@ -42,7 +47,7 @@ static const rb_data_type_t ossl_digest_type = {
* Public
*/
const EVP_MD *
-ossl_evp_get_digestbyname(VALUE obj)
+GetDigestPtr(VALUE obj)
{
const EVP_MD *md;
ASN1_OBJECT *oid = NULL;
@@ -57,11 +62,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 +81,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 +95,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 = TypedData_Wrap_Struct(klass, &ossl_digest_type, ctx);
+
+ return obj;
}
VALUE ossl_digest_update(VALUE, VALUE);
@@ -102,18 +112,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 +134,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 +154,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 +206,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 +221,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 +242,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
@@ -316,8 +313,7 @@ Init_ossl_digest(void)
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 +440,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..04b5879bbc 100644
--- a/ext/openssl/ossl_engine.c
+++ b/ext/openssl/ossl_engine.c
@@ -1,23 +1,22 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_engine_type, (engine)); \
} while(0)
#define GetEngine(obj, engine) do { \
TypedData_Get_Struct((obj), ENGINE, &ossl_engine_type, (engine)); \
@@ -25,6 +24,10 @@
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,25 +49,13 @@ 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)
@@ -80,13 +71,14 @@ static const rb_data_type_t ossl_engine_type = {
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 +95,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 +182,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 +211,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 +257,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 +275,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 +292,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 +314,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 +327,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 +353,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 +366,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 +389,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 +404,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 +423,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 +465,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 +483,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 +504,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 +530,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)
@@ -528,19 +549,15 @@ ossl_engine_inspect(VALUE self)
void
Init_ossl_engine(void)
{
-#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,8 +581,12 @@ 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);
}
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..74fc962b2a 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) = TypedData_Make_Struct((klass), HMAC_CTX, &ossl_hmac_type, (ctx))
#define GetHMAC(obj, ctx) do { \
TypedData_Get_Struct((obj), HMAC_CTX, &ossl_hmac_type, (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
@@ -36,7 +41,8 @@ VALUE eHMACError;
static void
ossl_hmac_free(void *ctx)
{
- HMAC_CTX_free(ctx);
+ HMAC_CTX_cleanup(ctx);
+ ruby_xfree(ctx);
}
static const rb_data_type_t ossl_hmac_type = {
@@ -50,14 +56,11 @@ static const rb_data_type_t ossl_hmac_type = {
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 +108,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 +123,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 +133,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 +160,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;
+ HMAC_CTX final;
- final = HMAC_CTX_new();
- if (!final)
- ossl_raise(eHMACError, "HMAC_CTX_new");
-
- 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 +181,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 +209,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 +257,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 +266,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 +287,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,38 +297,38 @@ 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;
}
/*
@@ -333,38 +338,10 @@ void
Init_ossl_hmac(void)
{
#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 +351,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);
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..d2a52e6f05 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_netscape_spki_type, (spki)); \
} while (0)
#define GetSPKI(obj, spki) do { \
TypedData_Get_Struct((obj), NETSCAPE_SPKI, &ossl_netscape_spki_type, (spki)); \
@@ -59,11 +58,10 @@ 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 +71,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 +84,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 +157,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 +168,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 +201,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 +211,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 +246,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 +271,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 +287,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 +301,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 +310,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 +351,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)
@@ -379,8 +378,7 @@ void
Init_ossl_ns_spki(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
mNetscape = rb_define_module_under(mOSSL, "Netscape");
@@ -403,3 +401,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..dc31d79cf7 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -1,78 +1,75 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_ocsp_request_type, (req)); \
} while (0)
#define GetOCSPReq(obj, req) do { \
TypedData_Get_Struct((obj), OCSP_REQUEST, &ossl_ocsp_request_type, (req)); \
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
} while (0)
+#define SafeGetOCSPReq(obj, req) do { \
+ 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) = TypedData_Wrap_Struct((klass), &ossl_ocsp_response_type, (res)); \
} while (0)
#define GetOCSPRes(obj, res) do { \
TypedData_Get_Struct((obj), OCSP_RESPONSE, &ossl_ocsp_response_type, (res)); \
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)
+#define SafeGetOCSPRes(obj, res) do { \
+ 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) = TypedData_Wrap_Struct((klass), &ossl_ocsp_basicresp_type, (res)); \
} while (0)
#define GetOCSPBasicRes(obj, res) do { \
TypedData_Get_Struct((obj), OCSP_BASICRESP, &ossl_ocsp_basicresp_type, (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) = TypedData_Wrap_Struct((klass), &ossl_ocsp_certid_type, (cid)); \
} while (0)
#define GetOCSPCertId(obj, cid) do { \
TypedData_Get_Struct((obj), OCSP_CERTID, &ossl_ocsp_certid_type, (cid)); \
if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0)
+#define SafeGetOCSPCertId(obj, cid) do { \
+ 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
@@ -118,20 +115,6 @@ static const rb_data_type_t ossl_ocsp_basicresp_type = {
};
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);
@@ -151,8 +134,8 @@ static const rb_data_type_t ossl_ocsp_certid_type = {
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 +148,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 +190,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 +223,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 +233,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 +246,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 +256,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 +294,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 +305,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
- *
- * Verifies this request using the given _certificates_ and _store_.
- * _certificates_ is an array of OpenSSL::X509::Certificate, _store_ is an
- * OpenSSL::X509::Store.
+ * request.verify(certificates, store) -> true or false
+ * request.verify(certificates, store, flags) -> true or false
*
- * 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 +360,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 +396,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 +415,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 +428,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 +519,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 +562,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 +586,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 +598,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 +608,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 +634,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:
+ * 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.
*
- * - OpenSSL::OCSP::V_CERTSTATUS_GOOD
- * - OpenSSL::OCSP::V_CERTSTATUS_REVOKED
- * - OpenSSL::OCSP::V_CERTSTATUS_UNKNOWN
+ * 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.
*
- * _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.
- *
- * _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.
- *
- * _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 +658,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);
+ OSSL_Check_Kind(RARRAY_PTR(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;
- }
-
- 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 +695,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 +723,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 +751,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 +773,76 @@ ossl_ocspbres_get_status(VALUE self)
return ret;
}
-static VALUE ossl_ocspsres_new(OCSP_SINGLERESP *);
-
-/*
- * call-seq:
- * basic_response.responses -> Array of SingleResponse
- *
- * 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
+ * basic_response.sign(signer_cert, signer_key) -> self
+ * basic_response.sign(signer_cert, signer_key, certificates) -> self
+ * basic_response.sign(signer_cert, signer_key, certificates, flags) -> self
*
- * Signs this 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();
+ if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
- return result > 0 ? Qtrue : Qfalse;
+ return result;
}
/*
- * 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;
-
- return asn1time_to_time(time);
-}
-
-/*
- * 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 +851,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 +901,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 +911,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 +921,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 +932,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 +940,24 @@ ossl_ocspcid_cmp_issuer(VALUE self, VALUE other)
/*
* call-seq:
- * certificate_id.serial -> Integer
- *
- * Returns the serial number of the certificate for which status is being
- * requested.
- */
-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
+ * certificate_id.get_serial -> Integer
*
- * Returns the issuerKeyHash of this certificate ID, the hash of the issuer's
- * public key.
+ * Returns the serial number of the issuing certificate.
*/
-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)
{
-#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 +1027,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 +1043,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 +1084,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 +1101,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 +1115,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 +1130,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,7 +1235,8 @@ 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)
{
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..53e0e619ca 100644
--- a/ext/openssl/ossl_pkcs12.c
+++ b/ext/openssl/ossl_pkcs12.c
@@ -1,15 +1,13 @@
/*
- * 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) = TypedData_Wrap_Struct((klass), &ossl_pkcs12_type, (p12)); \
} while (0)
#define GetPKCS12(obj, p12) do { \
@@ -17,6 +15,11 @@
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))
@@ -53,51 +56,31 @@ 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 +97,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 +118,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 +138,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 +154,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:
@@ -232,12 +208,6 @@ ossl_pkcs12_to_der(VALUE self)
void
Init_ossl_pkcs12(void)
{
-#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 +218,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..6c7738a2b2
--- /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(void)
+{
+ /*
+ * 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 28010c81fb..f4a5088ea3 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_pkcs7_type, (pkcs7)); \
} while (0)
#define GetPKCS7(obj, pkcs7) do { \
TypedData_Get_Struct((obj), PKCS7, &ossl_pkcs7_type, (pkcs7)); \
@@ -23,14 +22,16 @@
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) = TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, (p7si)); \
} while (0)
#define GetPKCS7si(obj, p7si) do { \
TypedData_Get_Struct((obj), PKCS7_SIGNER_INFO, &ossl_pkcs7_signer_info_type, (p7si)); \
@@ -38,14 +39,16 @@
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) = TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, (p7ri)); \
} while (0)
#define GetPKCS7ri(obj, p7ri) do { \
TypedData_Get_Struct((obj), PKCS7_RECIP_INFO, &ossl_pkcs7_recip_info_type, (p7ri)); \
@@ -53,6 +56,10 @@
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]))
@@ -115,32 +122,15 @@ static const rb_data_type_t ossl_pkcs7_recip_info_type = {
* 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 +140,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 +154,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 +166,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 +185,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 +214,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 +253,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 +267,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 +306,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 +320,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 +333,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 +358,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 +387,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 +418,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 +509,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 +744,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 +756,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 +765,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;
}
@@ -803,9 +787,9 @@ ossl_pkcs7_decrypt(int argc, VALUE *argv, VALUE self)
BIO *out;
VALUE str;
- rb_scan_args(argc, argv, "12", &pkey, &cert, &flags);
+ rb_scan_args(argc, argv, "21", &pkey, &cert, &flags);
key = GetPrivPKeyPtr(pkey); /* NO NEED TO DUP */
- x509 = NIL_P(cert) ? NULL : GetX509CertPtr(cert); /* NO NEED TO DUP */
+ x509 = GetX509CertPtr(cert); /* NO NEED TO DUP */
flg = NIL_P(flags) ? 0 : NUM2INT(flags);
GetPKCS7(self, p7);
if(!(out = BIO_new(BIO_s_mem())))
@@ -827,12 +811,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 +828,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 +886,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 +904,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 +965,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;
}
@@ -1042,12 +1024,6 @@ ossl_pkcs7ri_get_enc_key(VALUE self)
void
Init_ossl_pkcs7(void)
{
-#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 +1033,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..ba9a019461 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,8 +65,9 @@ void
ossl_generate_cb_stop(void *ptr)
{
struct ossl_generate_cb_arg *arg = (struct ossl_generate_cb_arg *)ptr;
- arg->interrupted = 1;
+ arg->stop = 1;
}
+#endif
static void
ossl_evp_pkey_free(void *ptr)
@@ -92,16 +86,13 @@ const rb_data_type_t ossl_evp_pkey_type = {
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 +105,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 +199,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 +212,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 +241,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 +254,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 +269,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 +286,24 @@ 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);
+ 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);
+ result = EVP_SignFinal(&ctx, (unsigned char *)RSTRING_PTR(str), &buf_len, pkey);
+ EVP_MD_CTX_cleanup(&ctx);
if (!result)
- ossl_raise(ePKeyError, "EVP_SignFinal");
+ ossl_raise(ePKeyError, NULL);
+ assert((long)buf_len <= RSTRING_LEN(str));
rb_str_set_len(str, buf_len);
return str;
@@ -349,12 +313,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,39 +334,25 @@ 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 */
}
/*
@@ -411,10 +361,8 @@ ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
void
Init_ossl_pkey(void)
{
-#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 +374,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 +453,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 0db59305f7..6c0b7fd602 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,19 +14,18 @@
extern VALUE mPKey;
extern VALUE cPKey;
extern VALUE ePKeyError;
+extern ID id_private_q;
extern const rb_data_type_t ossl_evp_pkey_type;
#define OSSL_PKEY_SET_PRIVATE(obj) rb_iv_set((obj), "private", Qtrue)
#define OSSL_PKEY_SET_PUBLIC(obj) rb_iv_set((obj), "private", Qfalse)
#define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue)
-#define 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) = TypedData_Wrap_Struct((klass), &ossl_evp_pkey_type, (pkey)); \
OSSL_PKEY_SET_PUBLIC(obj); \
} while (0)
#define GetPKey(obj, pkey) do {\
@@ -34,20 +34,29 @@ extern const rb_data_type_t ossl_evp_pkey_type;
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 +82,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 +100,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 bf4e3f9322..6a006b91cb 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,20 +491,21 @@ 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)
+ GetPKeyDH(self, pkey);
+ dh = pkey->pkey.dh;
+ if (!dh->p)
ossl_raise(eDHError, "incomplete DH");
pub_key = GetBNPtr(pub);
len = DH_size(dh);
@@ -552,22 +518,73 @@ 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
@@ -576,9 +593,8 @@ void
Init_ossl_dh(void)
{
#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 +611,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 +634,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,14 +647,17 @@ 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 */
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 56cc9dd4f1..20be2a7290 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,20 @@ 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)
+ GetPKeyDSA(self, pkey);
+ if (!pkey->pkey.dsa->q)
ossl_raise(eDSAError, "incomplete DSA");
- if (!DSA_PRIVATE(self, dsa))
+ if (!DSA_PRIVATE(self, pkey->pkey.dsa))
ossl_raise(eDSAError, "Private DSA key needed!");
StringValue(data);
- str = rb_str_new(0, DSA_size(dsa));
+ 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 +518,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 +535,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,22 +554,11 @@ 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
@@ -609,9 +567,8 @@ void
Init_ossl_dsa(void)
{
#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 +584,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,8 +612,6 @@ 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);
}
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c
index 8bb611248b..d63f757394 100644
--- a/ext/openssl/ossl_pkey_ec.c
+++ b/ext/openssl/ossl_pkey_ec.c
@@ -4,7 +4,18 @@
#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
@@ -14,31 +25,70 @@ 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); \
+ TypedData_Get_Struct((obj), ossl_ec_group, &ossl_ec_group_type, (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; \
+ TypedData_Get_Struct((obj), ossl_ec_group, &ossl_ec_group_type, ec_group); \
+ if (ec_group == NULL) \
+ ossl_raise(eEC_GROUP, "missing ossl_ec_group structure"); \
+ (g) = ec_group->group; \
+} 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; \
+ TypedData_Get_Struct((obj), ossl_ec_point, &ossl_ec_point_type, ec_point); \
+ if (ec_point == NULL) \
+ ossl_raise(eEC_POINT, "missing ossl_ec_point structure"); \
+ (p) = ec_point->point; \
+} 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 +108,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 +116,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 +123,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 +135,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 +147,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
+/* 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 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)
- *
- * 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;
- GetEC(self, ec);
- group = EC_KEY_get0_group(ec);
- if (!group)
- return Qnil;
+ Require_EC_KEY(self, ec);
- return ec_group_new(group);
+ group_v = rb_iv_get(self, "@group");
+ if (!NIL_P(group_v))
+ return group_v;
+
+ 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.
*
- * 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.
+ * 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.
+ *
+ * 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 +327,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 +346,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 +363,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);
+ TypedData_Get_Struct(obj, ossl_ec_point, &ossl_ec_point_type, 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 +393,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 +418,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 +437,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 +471,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 +485,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 +538,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 +575,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 +590,16 @@ static VALUE ossl_ec_key_to_text(VALUE self)
/*
* call-seq:
- * key.generate_key! => self
- *
- * Generates a new random private and public key.
+ * key.generate_key => self
*
- * See also the OpenSSL documentation for EC_KEY_generate_key()
- *
- * === 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 +618,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 +639,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 +669,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 +694,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,13 +709,12 @@ 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)
+static void ossl_ec_group_free(void *ptr)
{
- EC_GROUP_clear_free(ptr);
+ ossl_ec_group *ec_group = ptr;
+ if (!ec_group->dont_free && ec_group->group)
+ EC_GROUP_clear_free(ec_group->group);
+ ruby_xfree(ec_group);
}
static const rb_data_type_t ossl_ec_group_type = {
@@ -681,55 +725,40 @@ static const rb_data_type_t ossl_ec_group_type = {
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
};
-static VALUE
-ossl_ec_group_alloc(VALUE klass)
-{
- return TypedData_Wrap_Struct(klass, &ossl_ec_group_type, NULL);
-}
-
-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 = TypedData_Make_Struct(klass, ossl_ec_group, &ossl_ec_group_type, 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)
+ TypedData_Get_Struct(self, ossl_ec_group, &ossl_ec_group_type, ec_group);
+ if (ec_group->group != NULL)
ossl_raise(rb_eRuntimeError, "EC_GROUP is already initialized");
switch (rb_scan_args(argc, argv, "13", &arg1, &arg2, &arg3, &arg4)) {
@@ -759,11 +788,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 +806,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 +851,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 +875,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 +903,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 +914,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 +925,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 +936,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 +947,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 +958,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 +978,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 +1011,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 +1055,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 +1069,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 +1117,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 +1137,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 +1158,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 +1185,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 +1195,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 +1216,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 +1230,130 @@ static VALUE ossl_ec_group_to_text(VALUE self)
}
-/*
- * OpenSSL::PKey::EC::Point
- */
-static void
-ossl_ec_point_free(void *ptr)
+static void ossl_ec_point_free(void *ptr)
{
- EC_POINT_clear_free(ptr);
+ ossl_ec_point *ec_point = ptr;
+ if (!ec_point->dont_free && ec_point->point)
+ EC_POINT_clear_free(ec_point->point);
+ ruby_xfree(ec_point);
}
static const rb_data_type_t ossl_ec_point_type = {
- "OpenSSL/EC_POINT",
+ "OpenSSL/ec_point",
{
0, ossl_ec_point_free,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
};
-static VALUE
-ossl_ec_point_alloc(VALUE klass)
+static VALUE ossl_ec_point_alloc(VALUE klass)
{
- return TypedData_Wrap_Struct(klass, &ossl_ec_point_type, NULL);
-}
-
-static VALUE
-ec_point_new(const EC_POINT *point, const EC_GROUP *group)
-{
- 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 = TypedData_Make_Struct(klass, ossl_ec_point, &ossl_ec_point_type, 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");
+ TypedData_Get_Struct(self, ossl_ec_point, &ossl_ec_point_type, ec_point);
+ if (ec_point->point)
+ ossl_raise(eEC_POINT, "EC_POINT already initialized");
- 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);
+
+ 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);
- RTYPEDDATA_DATA(self) = point;
- rb_ivar_set(self, id_i_group, group_v);
+ point = EC_POINT_new(group);
+ } else {
+ ossl_raise(eEC_POINT, "wrong argument type: must be OpenSSL::PKey::EC::Point or OpenSSL::Pkey::EC::Group");
+ }
- return self;
-}
+ 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);
-static VALUE
-ossl_ec_point_initialize_copy(VALUE self, VALUE other)
-{
- EC_POINT *point, *point_new;
- EC_GROUP *group;
- VALUE group_v;
+ 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 +1362,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 +1385,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 +1408,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 +1428,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 +1448,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 +1468,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)
{
-#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 +1602,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 +1617,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 +1626,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 +1642,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 +1677,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,10 +1688,12 @@ 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 */
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index 4800fb2710..1a2bb32fdc 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,55 @@ 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)
+ GetPKeyRSA(self, pkey);
+ if (!pkey->pkey.rsa->n)
ossl_raise(eRSAError, "incomplete RSA");
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
- 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 +410,26 @@ 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)
+ GetPKeyRSA(self, pkey);
+ if (!pkey->pkey.rsa->n)
ossl_raise(eRSAError, "incomplete RSA");
rb_scan_args(argc, argv, "11", &buffer, &padding);
pad = (argc == 1) ? RSA_PKCS1_PADDING : NUM2INT(padding);
StringValue(buffer);
- 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 +441,28 @@ 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)
+ GetPKeyRSA(self, pkey);
+ if (!pkey->pkey.rsa->n)
ossl_raise(eRSAError, "incomplete RSA");
- if (!RSA_PRIVATE(self, rsa))
- ossl_raise(eRSAError, "private key needed.");
+ 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 +474,28 @@ 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)
+ GetPKeyRSA(self, pkey);
+ if (!pkey->pkey.rsa->n)
ossl_raise(eRSAError, "incomplete RSA");
- if (!RSA_PRIVATE(self, rsa))
- ossl_raise(eRSAError, "private key needed.");
+ 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 +504,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 +516,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 +548,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 +580,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 +595,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 +608,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)
{
#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 +650,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 +661,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 +674,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 +683,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);
@@ -956,3 +704,4 @@ Init_ossl_rsa(void)
{
}
#endif /* NO_RSA */
+
diff --git a/ext/openssl/ossl_rand.c b/ext/openssl/ossl_rand.c
index 4a4f9dd5bf..27466fe233 100644
--- a/ext/openssl/ossl_rand.c
+++ b/ext/openssl/ossl_rand.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"
@@ -16,7 +17,7 @@ VALUE eRandomError;
* call-seq:
* seed(str) -> str
*
- * ::seed is equivalent to ::add where _entropy_ is length of _str_.
+ * ::seed is equivalent to ::add where +entropy+ is length of +str+.
*/
static VALUE
ossl_rand_seed(VALUE self, VALUE str)
@@ -31,23 +32,23 @@ ossl_rand_seed(VALUE self, VALUE str)
* call-seq:
* add(str, entropy) -> self
*
- * Mixes the bytes from _str_ into the Pseudo Random Number Generator(PRNG)
+ * 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
+ * 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.
+ * The +entropy+ argument is (the lower bound of) an estimate of how much
+ * randomness is contained in +str+, measured in bytes.
*
- * === Example
+ * 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)
+ * OpenSSL::Random.add(ary.join("").to_s, 0.0)
+ * OpenSSL::Random.seed(ary.join("").to_s)
*/
static VALUE
ossl_rand_add(VALUE self, VALUE str, VALUE entropy)
@@ -62,12 +63,14 @@ 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.
+ * Reads bytes from +filename+ and adds them to the PRNG.
*/
static VALUE
ossl_rand_load_file(VALUE self, VALUE filename)
{
- if(!RAND_load_file(StringValueCStr(filename), -1)) {
+ SafeStringValue(filename);
+
+ if(!RAND_load_file(RSTRING_PTR(filename), -1)) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -77,14 +80,15 @@ 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_
+ * 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)
{
- if (RAND_write_file(StringValueCStr(filename)) == -1) {
+ SafeStringValue(filename);
+ if (RAND_write_file(RSTRING_PTR(filename)) == -1) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -94,46 +98,41 @@ ossl_rand_write_file(VALUE self, VALUE filename)
* call-seq:
* random_bytes(length) -> string
*
- * Generates a String with _length_ number of cryptographically strong
+ * Generates +string+ with +length+ number of cryptographically strong
* pseudo-random bytes.
*
- * === Example
+ * 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.
+ * Generates +string+ with +length+ number of pseudo-random bytes.
*
* Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if
* they are of sufficient length, but are not necessarily unpredictable.
*
- * === Example
+ * Example:
*
* OpenSSL::Random.pseudo_bytes(12)
- * #=> "..."
+ * => "..."
*/
static VALUE
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
@@ -142,13 +141,12 @@ 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
/*
@@ -160,7 +158,9 @@ ossl_rand_pseudo_bytes(VALUE self, VALUE len)
static VALUE
ossl_rand_egd(VALUE self, VALUE filename)
{
- if (RAND_egd(StringValueCStr(filename)) == -1) {
+ SafeStringValue(filename);
+
+ if(!RAND_egd(RSTRING_PTR(filename))) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -170,9 +170,9 @@ 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_.
+ * 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
+ * Fetches +length+ number of bytes and uses ::add to seed the OpenSSL built-in
* PRNG.
*/
static VALUE
@@ -180,7 +180,9 @@ ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)
{
int n = NUM2INT(len);
- if (RAND_egd_bytes(StringValueCStr(filename), n) == -1) {
+ SafeStringValue(filename);
+
+ if (!RAND_egd_bytes(RSTRING_PTR(filename), n)) {
ossl_raise(eRandomError, NULL);
}
return Qtrue;
@@ -191,7 +193,7 @@ ossl_rand_egd_bytes(VALUE self, VALUE filename, VALUE len)
* 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)
@@ -206,8 +208,7 @@ void
Init_ossl_rand(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
mRandom = rb_define_module_under(mOSSL, "Random");
@@ -219,12 +220,11 @@ Init_ossl_rand(void)
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);
}
+
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 de0556f543..5b00cb7b76 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
@@ -24,43 +29,139 @@
} 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
+#if defined(HAVE_SSLV3_METHOD) && defined(HAVE_SSLV3_SERVER_METHOD) && \
+ defined(HAVE_SSLV3_CLIENT_METHOD)
+ OSSL_SSL_METHOD_ENTRY(SSLv3),
+ OSSL_SSL_METHOD_ENTRY(SSLv3_server),
+ OSSL_SSL_METHOD_ENTRY(SSLv3_client),
+#endif
+ OSSL_SSL_METHOD_ENTRY(SSLv23),
+ OSSL_SSL_METHOD_ENTRY(SSLv23_server),
+ OSSL_SSL_METHOD_ENTRY(SSLv23_client),
+#undef OSSL_SSL_METHOD_ENTRY
+};
+
+int ossl_ssl_ex_vcb_idx;
+int ossl_ssl_ex_store_p;
+int ossl_ssl_ex_ptr_idx;
+int ossl_ssl_ex_client_cert_cb_idx;
+int ossl_ssl_ex_tmp_dh_callback_idx;
static void
ossl_sslctx_free(void *ptr)
{
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);
}
@@ -76,327 +177,212 @@ 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 TypedData_Wrap_Struct(klass, &ossl_sslctx_type, 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);
+ }
+ GetSSLCTX(self, 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);
+ GetSSL(obj, 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));
+ GetSSL(args[0], 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_store_ctx_ex_verify_cb_idx, (void *)cb);
+ return ossl_verify_cb(preverify_ok, ctx);
}
static VALUE
ossl_call_session_get_cb(VALUE ary)
{
- VALUE ssl_obj, 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 (!defined(LIBRESSL_VERSION_NUMBER) ? OPENSSL_VERSION_NUMBER >= 0x10100000 : LIBRESSL_VERSION_NUMBER >= 0x2080000f)
-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;
@@ -404,7 +390,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;
@@ -413,15 +399,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 */
@@ -429,20 +417,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));
}
@@ -465,37 +456,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.
@@ -522,6 +509,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)
{
@@ -530,11 +518,12 @@ 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;
@@ -543,10 +532,8 @@ ossl_call_servername_cb(VALUE ary)
GetSSL(ssl_obj, ssl);
GetSSLCTX(ret_obj, 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;
@@ -556,18 +543,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;
@@ -575,24 +565,29 @@ 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;
- 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);
+ if ((ptr = SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx)) == NULL)
+ ossl_raise(eSSLError, "SSL object could not be retrieved");
+ ssl_obj = (VALUE)ptr;
+
+ sslctx_obj = rb_iv_get(ssl_obj, "@context");
+ if (NIL_P(sslctx_obj)) return;
+ cb = rb_iv_get(sslctx_obj, "@renegotiation_cb");
if (NIL_P(cb)) return;
- 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)
+#if defined(HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB) || defined(HAVE_SSL_CTX_SET_ALPN_SELECT_CB)
static VALUE
-ssl_npn_encode_protocol_i(RB_BLOCK_CALL_FUNC_ARGLIST(cur, encoded))
+ssl_npn_encode_protocol_i(VALUE cur, VALUE encoded)
{
int len = RSTRING_LENINT(cur);
char len_byte;
@@ -605,28 +600,23 @@ ssl_npn_encode_protocol_i(RB_BLOCK_CALL_FUNC_ARGLIST(cur, 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;
+ StringValueCStr(encoded);
+ rb_iv_set(sslctx, "@_protocols", encoded);
}
-struct npn_select_cb_common_args {
- VALUE cb;
- const unsigned char *in;
- unsigned inlen;
-};
-
-static VALUE
-npn_select_cb_common_i(VALUE tmp)
+static int
+ssl_npn_select_cb_common(VALUE cb, const unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen)
{
- struct npn_select_cb_common_args *args = (void *)tmp;
- const unsigned char *in = args->in, *in_end = in + args->inlen;
- unsigned char l;
+ VALUE selected;
long len;
- VALUE selected, protocols = rb_ary_new();
+ VALUE protocols = rb_ary_new();
+ unsigned char l;
+ const unsigned char *in_end = in + inlen;
/* assume OpenSSL verifies this format */
/* The format is len_1|proto_1|...|len_n|proto_n */
@@ -636,50 +626,24 @@ npn_select_cb_common_i(VALUE tmp)
in += l;
}
- selected = rb_funcallv(args->cb, id_call, 1, &protocols);
+ selected = rb_funcall(cb, rb_intern("call"), 1, protocols);
StringValue(selected);
len = RSTRING_LEN(selected);
if (len < 1 || len >= 256) {
ossl_raise(eSSLError, "Selected protocol name must have length 1..255");
}
-
- 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);
+ *outlen = (unsigned char)len;
return SSL_TLSEXT_ERR_OK;
}
-#endif
-#ifndef OPENSSL_NO_NEXTPROTONEG
+#ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
static int
-ssl_npn_advertise_cb(SSL *ssl, const unsigned char **out, unsigned int *outlen,
- void *arg)
+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);
@@ -688,82 +652,32 @@ 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;
sslctx_obj = (VALUE) arg;
- cb = rb_attr_get(sslctx_obj, id_i_npn_select_cb);
+ cb = rb_iv_get(sslctx_obj, "@npn_select_cb");
- return ssl_npn_select_cb_common(ssl, cb, (const unsigned char **)out,
- outlen, in, inlen);
+ return ssl_npn_select_cb_common(cb, (const unsigned char **)out, outlen, in, inlen);
}
#endif
+#endif /* HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB || HAVE_SSL_CTX_SET_ALPN_SELECT_CB */
-#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;
-
- sslctx_obj = (VALUE) arg;
- cb = rb_attr_get(sslctx_obj, id_i_alpn_select_cb);
-
- return ssl_npn_select_cb_common(ssl, cb, out, outlen, in, inlen);
-}
-#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
@@ -777,66 +691,48 @@ 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);
#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);
}
-#endif /* OPENSSL_NO_EC */
+ else{
+ SSL_CTX_set_tmp_dh_callback(ctx, ossl_default_tmp_dh_callback);
+ }
+#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 */
@@ -851,11 +747,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");
@@ -871,61 +767,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_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
+ 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),
@@ -934,30 +819,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;
@@ -966,8 +853,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;
}
@@ -976,19 +863,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);
+ if(!ctx){
+ rb_warning("SSL_CTX is not initialized.");
+ return Qnil;
+ }
+ ciphers = ctx->cipher_list;
+
if (!ciphers)
return rb_ary_new();
@@ -1007,9 +899,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)
@@ -1036,293 +930,22 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v)
}
GetSSLCTX(self, ctx);
- if (!SSL_CTX_set_cipher_list(ctx, StringValueCStr(str))) {
+ 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)
@@ -1331,7 +954,7 @@ ossl_sslctx_session_add(VALUE self, VALUE arg)
SSL_SESSION *sess;
GetSSLCTX(self, ctx);
- GetSSLSession(arg, sess);
+ SafeGetSSLSession(arg, sess);
return SSL_CTX_add_session(ctx, sess) == 1 ? Qtrue : Qfalse;
}
@@ -1340,7 +963,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)
@@ -1349,7 +972,7 @@ ossl_sslctx_session_remove(VALUE self, VALUE arg)
SSL_SESSION *sess;
GetSSLCTX(self, ctx);
- GetSSLSession(arg, sess);
+ SafeGetSSLSession(arg, sess);
return SSL_CTX_remove_session(ctx, sess) == 1 ? Qtrue : Qfalse;
}
@@ -1476,9 +1099,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)
@@ -1508,11 +1131,25 @@ 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
@@ -1540,10 +1177,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.
@@ -1554,36 +1191,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");
-
- 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);
+ VALUE io, ctx;
- 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;
}
@@ -1591,20 +1213,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;
+ if(!ssl){
+#ifdef HAVE_SSL_SET_TLSEXT_HOST_NAME
+ VALUE hostname = rb_iv_get(self, "@hostname");
+#endif
+
+ v_ctx = ossl_ssl_get_ctx(self);
+ GetSSLCTX(v_ctx, ctx);
- 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");
+ 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;
}
@@ -1615,90 +1263,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 { \
+ GetSSL((v), (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));
}
@@ -1718,13 +1344,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.
*
@@ -1739,20 +1364,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);
}
/*
@@ -1766,13 +1383,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.
*
@@ -1787,20 +1403,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
@@ -1808,9 +1416,10 @@ 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);
@@ -1818,81 +1427,66 @@ ossl_ssl_read_internal(int argc, VALUE *argv, VALUE self, int nonblock)
rb_scan_args(argc, argv, "11", &len, &str);
}
+ 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);
}
- rb_str_set_len(str, 0);
- if (ilen == 0)
- return str;
+ if(ilen == 0) return str;
GetSSL(self, ssl);
- io = rb_attr_get(self, id_i_io);
- GetOpenFile(io, fptr);
- if (ssl_started(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();
}
- /* fall through */
+ 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) {
- VALUE argv[3];
- argv[0] = len;
- argv[1] = str;
- argv[2] = opts;
- return rb_funcallv_kw(io, meth, 3, argv, RB_PASS_KEYWORDS);
+ 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);
}
- else
- return rb_funcall(io, meth, 2, len, str);
}
end:
rb_str_set_len(str, nread);
+ OBJ_TAINT(str);
+
return str;
}
@@ -1901,7 +1495,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
@@ -1920,7 +1514,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
@@ -1930,19 +1524,17 @@ 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)) {
+ GetOpenFile(ossl_ssl_get_io(self), fptr);
+
+ if (ssl) {
for (;;){
int num = RSTRING_LENINT(str);
@@ -1955,14 +1547,14 @@ ossl_ssl_write_internal(VALUE self, VALUE str, VALUE opts)
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);
@@ -1972,18 +1564,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) {
- VALUE argv[2];
- argv[0] = str;
- argv[1] = opts;
- return rb_funcallv_kw(io, meth, 2, argv, RB_PASS_KEYWORDS);
- }
- 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:
@@ -1994,60 +1577,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;
+
+ /* ossl_ssl_data_get_struct() is not usable here because it may return
+ * from this function; */
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;
- /*
- * 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();
+ 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);
+ }
+
return Qnil;
}
@@ -2063,7 +1650,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?
@@ -2090,7 +1677,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. */
@@ -2118,7 +1705,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;
@@ -2144,35 +1731,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;
- GetSSL(self, ssl);
- cipher = SSL_get_current_cipher(ssl);
- return cipher ? ossl_ssl_cipher_to_ary(cipher) : Qnil;
+ ossl_ssl_data_get_struct(self, ssl);
+
+ cipher = (SSL_CIPHER *)SSL_get_current_cipher(ssl);
+
+ 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)
@@ -2180,7 +1767,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) {
@@ -2194,14 +1781,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));
}
@@ -2210,16 +1797,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;
}
/*
@@ -2234,8 +1827,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");
@@ -2245,33 +1842,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)
@@ -2284,9 +1854,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));
}
/*
@@ -2306,16 +1876,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_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
/*
* 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.
@@ -2327,7 +1897,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)
@@ -2336,82 +1906,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)
{
+ 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
*
@@ -2421,17 +1936,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.
@@ -2452,24 +1956,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);
@@ -2491,7 +1993,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);
@@ -2500,11 +2002,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);
@@ -2517,35 +2014,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);
@@ -2559,19 +2049,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
@@ -2592,7 +2080,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);
@@ -2601,15 +2089,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.
@@ -2632,7 +2124,7 @@ Init_ossl_ssl(void)
* end
*/
rb_attr(cSSLContext, rb_intern("renegotiation_cb"), 1, 1, Qfalse);
-#ifndef OPENSSL_NO_NEXTPROTONEG
+#ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
/*
* An Enumerable of Strings. Each String represents a protocol to be
* advertised as the list of supported protocols for Next Protocol
@@ -2657,81 +2149,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
@@ -2739,7 +2191,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
@@ -2747,18 +2199,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);
@@ -2768,30 +2220,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);
@@ -2804,158 +2268,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_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
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..0c20b10721 100644
--- a/ext/openssl/ossl_ssl.h
+++ b/ext/openssl/ossl_ssl.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_SSL_H_)
@@ -12,9 +13,6 @@
#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 { \
@@ -24,13 +22,21 @@
} \
} while (0)
+#define SafeGetSSLSession(obj, sess) do { \
+ OSSL_Check_Kind((obj), cSSLSession); \
+ GetSSLSession((obj), (sess)); \
+} while (0)
+
extern const rb_data_type_t ossl_ssl_type;
extern const rb_data_type_t ossl_ssl_session_type;
extern VALUE mSSL;
+extern VALUE eSSLError;
extern VALUE cSSLSocket;
+extern VALUE cSSLContext;
extern VALUE cSSLSession;
void Init_ossl_ssl(void);
void Init_ossl_ssl_session(void);
#endif /* _OSSL_SSL_H_ */
+
diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c
index 5514087387..5318f1a525 100644
--- a/ext/openssl/ossl_ssl_session.c
+++ b/ext/openssl/ossl_ssl_session.c
@@ -28,12 +28,12 @@ static VALUE ossl_ssl_session_alloc(VALUE klass)
/*
* 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;
@@ -46,10 +46,10 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
GetSSL(arg1, 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 +73,29 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
return self;
}
-static VALUE
-ossl_ssl_session_initialize_copy(VALUE self, VALUE other)
-{
- 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)
+#if HAVE_SSL_SESSION_CMP == 0
+int 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 +105,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);
- GetSSLSession(self, ctx);
- t = SSL_SESSION_get_time(ctx);
- if (t == 0)
- return Qnil;
+ t = SSL_SESSION_get_time(ctx);
- return rb_funcall(rb_cTime, rb_intern("at"), 1, LONG2NUM(t));
+ 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 +166,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 +182,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 +201,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 +234,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 +249,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 +266,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 +286,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 +312,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..4de45455d4 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)
{
-#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..c9036cad90 100644
--- a/ext/openssl/ossl_x509attr.c
+++ b/ext/openssl/ossl_x509attr.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509attr_type, (attr)); \
} while (0)
#define GetX509Attr(obj, attr) do { \
TypedData_Get_Struct((obj), X509_ATTRIBUTE, &ossl_x509attr_type, (attr)); \
@@ -23,6 +22,10 @@
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
@@ -53,7 +56,6 @@ ossl_x509attr_new(X509_ATTRIBUTE *attr)
X509_ATTRIBUTE *new;
VALUE obj;
- obj = NewX509Attr(cX509Attr);
if (!attr) {
new = X509_ATTRIBUTE_new();
} else {
@@ -62,19 +64,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 +91,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 +127,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 +138,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 +175,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 +191,21 @@ static VALUE
ossl_x509attr_set_value(VALUE self, VALUE value)
{
X509_ATTRIBUTE *attr;
- VALUE asn1_value;
- int i, asn1_tag;
+ ASN1_TYPE *a1type;
- 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");
-
- 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 +218,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 +265,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;
}
@@ -304,18 +276,11 @@ ossl_x509attr_to_der(VALUE self)
void
Init_ossl_x509attr(void)
{
-#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..b76ea793aa 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509_type, (x509)); \
} while (0)
#define GetX509(obj, x509) do { \
TypedData_Get_Struct((obj), X509, &ossl_x509_type, (x509)); \
@@ -23,6 +22,10 @@
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
@@ -53,7 +56,6 @@ ossl_x509_new(X509 *x509)
X509 *new;
VALUE obj;
- obj = NewX509(cX509Cert);
if (!x509) {
new = X509_new();
} else {
@@ -62,7 +64,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 +107,7 @@ GetX509CertPtr(VALUE obj)
{
X509 *x509;
- GetX509(obj, x509);
+ SafeGetX509(obj, x509);
return x509;
}
@@ -82,9 +117,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 +133,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 +158,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 +181,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 +346,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 +368,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 +455,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 +473,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 +492,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 +510,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 +541,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 +568,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 +581,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 +618,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 +660,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 +694,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 +719,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)
{
+
#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 +828,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 +856,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..461c226f4c 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509crl_type, (crl)); \
} while (0)
#define GetX509CRL(obj, crl) do { \
TypedData_Get_Struct((obj), X509_CRL, &ossl_x509crl_type, (crl)); \
@@ -23,6 +22,10 @@
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
@@ -52,7 +55,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 +77,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 +93,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 +112,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 +134,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 +177,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 +222,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 +247,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 +299,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 +329,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 +345,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 +357,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 +375,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 +386,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 +398,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 +409,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 +421,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 +432,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 +473,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 +502,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;
}
@@ -504,19 +518,13 @@ ossl_x509crl_add_extension(VALUE self, VALUE extension)
void
Init_ossl_x509crl(void)
{
-#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 +548,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..faffe06a66 100644
--- a/ext/openssl/ossl_x509ext.c
+++ b/ext/openssl/ossl_x509ext.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509ext_type, (ext)); \
} while (0)
#define GetX509Ext(obj, ext) do { \
TypedData_Get_Struct((obj), X509_EXTENSION, &ossl_x509ext_type, (ext)); \
@@ -23,12 +22,15 @@
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) = TypedData_Wrap_Struct((klass), &ossl_x509extfactory_type, (ctx)); \
} while (0)
#define GetX509ExtFactory(obj, ctx) do { \
TypedData_Get_Struct((obj), X509V3_CTX, &ossl_x509extfactory_type, (ctx)); \
@@ -67,7 +69,6 @@ ossl_x509ext_new(X509_EXTENSION *ext)
X509_EXTENSION *new;
VALUE obj;
- obj = NewX509Ext(cX509Ext);
if (!ext) {
new = X509_EXTENSION_new();
} else {
@@ -76,7 +77,7 @@ ossl_x509ext_new(X509_EXTENSION *ext)
if (!new) {
ossl_raise(eX509ExtError, NULL);
}
- SetX509Ext(obj, new);
+ WrapX509Ext(cX509Ext, obj, new);
return obj;
}
@@ -86,11 +87,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
*/
@@ -171,6 +185,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 +226,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 +240,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 +284,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 +330,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 +351,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 +419,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;
@@ -437,13 +460,6 @@ ossl_x509ext_to_der(VALUE obj)
void
Init_ossl_x509ext(void)
{
-#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 +471,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 1ea8400dbb..546cf3bf2c 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509name_type, (name)); \
} while (0)
#define GetX509Name(obj, name) do { \
TypedData_Get_Struct((obj), X509_NAME, &ossl_x509name_type, (name)); \
@@ -23,6 +22,10 @@
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"))
@@ -58,7 +61,6 @@ ossl_x509name_new(X509_NAME *name)
X509_NAME *new;
VALUE obj;
- obj = NewX509Name(cX509Name);
if (!name) {
new = X509_NAME_new();
} else {
@@ -67,7 +69,7 @@ ossl_x509name_new(X509_NAME *name)
if (!new) {
ossl_raise(eX509NameError, NULL);
}
- SetX509Name(obj, new);
+ WrapX509Name(cX509Name, obj, new);
return obj;
}
@@ -77,7 +79,7 @@ GetX509NamePtr(VALUE obj)
{
X509_NAME *name;
- GetX509Name(obj, name);
+ SafeGetX509Name(obj, name);
return name;
}
@@ -91,11 +93,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 +132,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 +178,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 +191,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 +217,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 +279,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 +291,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 +301,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 +316,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 +336,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;
+
+ if(CLASS_OF(other) != cX509Name) return Qfalse;
+ result = ossl_x509name_cmp0(self, other);
- return ossl_x509name_cmp0(self, other) == 0 ? Qtrue : Qfalse;
+ return (result == 0) ? Qtrue : Qfalse;
}
/*
@@ -440,6 +378,7 @@ ossl_x509name_hash(VALUE self)
return ULONG2NUM(hash);
}
+#ifdef HAVE_X509_NAME_HASH_OLD
/*
* call-seq:
* name.hash_old => integer
@@ -458,6 +397,7 @@ ossl_x509name_hash_old(VALUE self)
return ULONG2NUM(hash);
}
+#endif
/*
* call-seq:
@@ -502,15 +442,8 @@ ossl_x509name_to_der(VALUE self)
void
Init_ossl_x509name(void)
{
-#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 +452,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 +483,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 +498,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..529b68500c 100644
--- a/ext/openssl/ossl_x509req.c
+++ b/ext/openssl/ossl_x509req.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509req_type, (req)); \
} while (0)
#define GetX509Req(obj, req) do { \
TypedData_Get_Struct((obj), X509_REQ, &ossl_x509req_type, (req)); \
@@ -23,6 +22,10 @@
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
@@ -47,16 +50,48 @@ static const rb_data_type_t ossl_x509req_type = {
/*
* 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 +101,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 +120,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 +142,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 +157,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 +168,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 +200,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 +211,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 +247,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 +256,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 +299,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 +339,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 +356,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 +372,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 +415,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 +441,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);
}
@@ -408,19 +454,13 @@ ossl_x509req_add_attribute(VALUE self, VALUE attr)
void
Init_ossl_x509req(void)
{
-#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 +479,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..30c362c3cd 100644
--- a/ext/openssl/ossl_x509revoked.c
+++ b/ext/openssl/ossl_x509revoked.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509rev_type, (rev)); \
} while (0)
#define GetX509Rev(obj, rev) do { \
TypedData_Get_Struct((obj), X509_REVOKED, &ossl_x509rev_type, (rev)); \
@@ -23,6 +22,10 @@
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
@@ -53,7 +56,6 @@ ossl_x509revoked_new(X509_REVOKED *rev)
X509_REVOKED *new;
VALUE obj;
- obj = NewX509Rev(cX509Rev);
if (!rev) {
new = X509_REVOKED_new();
} else {
@@ -62,7 +64,7 @@ ossl_x509revoked_new(X509_REVOKED *rev)
if (!new) {
ossl_raise(eX509RevError, NULL);
}
- SetX509Rev(obj, new);
+ WrapX509Rev(cX509Rev, obj, new);
return obj;
}
@@ -72,7 +74,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 +91,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 +107,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 +131,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 +185,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 +212,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)
{
-#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 +239,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 61543d44f6..7694507509 100644
--- a/ext/openssl/ossl_x509store.c
+++ b/ext/openssl/ossl_x509store.c
@@ -1,21 +1,20 @@
/*
+ * $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) = TypedData_Wrap_Struct((klass), &ossl_x509store_type, (st)); \
} while (0)
#define GetX509Store(obj, st) do { \
TypedData_Get_Struct((obj), X509_STORE, &ossl_x509store_type, (st)); \
@@ -23,14 +22,16 @@
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) = TypedData_Wrap_Struct((klass), &ossl_x509stctx_type, (ctx)); \
} while (0)
#define GetX509StCtx(obj, ctx) do { \
TypedData_Get_Struct((obj), X509_STORE_CTX, &ossl_x509stctx_type, (ctx)); \
@@ -38,65 +39,10 @@
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
@@ -122,45 +68,50 @@ static const rb_data_type_t ossl_x509store_type = {
/*
* 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 +125,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_store_ex_verify_cb_idx, (void *)cb);
rb_iv_set(self, "@verify_callback", cb);
return cb;
@@ -185,7 +136,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 +144,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 +163,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 +220,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,7 +235,8 @@ ossl_x509store_add_file(VALUE self, VALUE file)
char *path = NULL;
if(file != Qnil){
- path = StringValueCStr(file);
+ SafeStringValue(file);
+ path = RSTRING_PTR(file);
}
GetX509Store(self, store);
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
@@ -312,25 +244,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)
{
@@ -339,7 +256,8 @@ ossl_x509store_add_path(VALUE self, VALUE dir)
char *path = NULL;
if(dir != Qnil){
- path = StringValueCStr(dir);
+ SafeStringValue(dir);
+ path = RSTRING_PTR(dir);
}
GetX509Store(self, store);
lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir());
@@ -355,12 +273,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)
@@ -379,8 +296,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)
{
@@ -396,12 +314,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)
{
@@ -421,21 +333,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)
{
@@ -470,6 +367,26 @@ static const rb_data_type_t ossl_x509stctx_type = {
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
};
+
+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;
+
+ return obj;
+}
+
/*
* Private functions
*/
@@ -477,10 +394,10 @@ static void
ossl_x509stctx_free(void *ptr)
{
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);
}
@@ -490,22 +407,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;
}
@@ -515,10 +420,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)
{
@@ -530,13 +431,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"));
@@ -545,34 +453,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_store_ctx_ex_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)
{
@@ -583,7 +477,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){
@@ -599,10 +493,6 @@ ossl_x509stctx_get_chain(VALUE self)
return ary;
}
-/*
- * call-seq:
- * stctx.error -> Integer
- */
static VALUE
ossl_x509stctx_get_err(VALUE self)
{
@@ -610,13 +500,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)
{
@@ -628,12 +514,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)
{
@@ -646,10 +526,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)
{
@@ -657,13 +533,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)
{
@@ -674,30 +546,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)
{
@@ -710,12 +573,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)
{
@@ -728,10 +585,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)
{
@@ -746,9 +599,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,21 +620,13 @@ ossl_x509stctx_set_time(VALUE self, VALUE time)
void
Init_ossl_x509store(void)
{
-#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
@@ -798,11 +641,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:
@@ -813,7 +656,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
@@ -822,30 +664,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);
@@ -858,26 +682,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 1e13dd5f37..79b6c53f50 100644
--- a/ext/pathname/depend
+++ b/ext/pathname/depend
@@ -1,17 +1,3 @@
-# AUTOGENERATED DEPENDENCIES START
-pathname.o: $(RUBY_EXTCONF_H)
-pathname.o: $(arch_hdrdir)/ruby/config.h
-pathname.o: $(hdrdir)/ruby.h
-pathname.o: $(hdrdir)/ruby/assert.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: 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 84e68277aa..037f10065d 100644
--- a/ext/pathname/extconf.rb
+++ b/ext/pathname/extconf.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'mkmf'
-have_func("rb_file_s_birthtime")
+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 dc4a7c0220..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.
@@ -40,7 +42,7 @@ class Pathname
# chop_basename(path) -> [pre-basename, basename] or nil
def chop_basename(path) # :nodoc:
base = File.basename(path)
- if /\A#{SEPARATOR_PAT}?\z/o.match?(base)
+ if /\A#{SEPARATOR_PAT}?\z/o =~ base
return nil
else
return path[0, path.rindex(base)], base
@@ -62,7 +64,7 @@ class Pathname
def prepend_prefix(prefix, relpath) # :nodoc:
if relpath.empty?
File.dirname(prefix)
- elsif /#{SEPARATOR_PAT}/o.match?(prefix)
+ elsif /#{SEPARATOR_PAT}/o =~ prefix
prefix = File.dirname(prefix)
prefix = File.join(prefix, "") if File.basename(prefix + 'a') != 'a'
prefix + relpath
@@ -113,7 +115,7 @@ class Pathname
end
end
pre.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
- if /#{SEPARATOR_PAT}/o.match?(File.basename(pre))
+ if /#{SEPARATOR_PAT}/o =~ File.basename(pre)
names.shift while names[0] == '..'
end
self.class.new(prepend_prefix(pre, File.join(*names)))
@@ -162,7 +164,7 @@ class Pathname
names.unshift base if base != '.'
end
pre.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
- if /#{SEPARATOR_PAT}/o.match?(File.basename(pre))
+ if /#{SEPARATOR_PAT}/o =~ File.basename(pre)
names.shift while names[0] == '..'
end
if names.empty?
@@ -193,7 +195,8 @@ class Pathname
begin
stat1 = self.lstat
stat2 = self.parent.lstat
- stat1.dev != stat2.dev || stat1.ino == stat2.ino
+ stat1.dev == stat2.dev && stat1.ino == stat2.ino ||
+ stat1.dev != stat2.dev
rescue Errno::ENOENT
false
end
@@ -207,7 +210,7 @@ class Pathname
# pathnames which points to roots such as <tt>/usr/..</tt>.
#
def root?
- chop_basename(@path) == nil && /#{SEPARATOR_PAT}/o.match?(@path)
+ !!(chop_basename(@path) == nil && /#{SEPARATOR_PAT}/o =~ @path)
end
# Predicate method for testing whether a path is absolute.
@@ -280,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 }
@@ -313,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)
@@ -379,7 +366,7 @@ class Pathname
basename_list2.shift
end
r1 = chop_basename(prefix1)
- if !r1 && (r1 = /#{SEPARATOR_PAT}/o.match?(File.basename(prefix1)))
+ if !r1 && /#{SEPARATOR_PAT}/o =~ File.basename(prefix1)
while !basename_list2.empty? && basename_list2.first == '..'
index_list2.shift
basename_list2.shift
@@ -503,7 +490,6 @@ class Pathname
# ArgumentError is raised when it cannot find a relative path.
#
def relative_path_from(base_directory)
- base_directory = Pathname.new(base_directory) unless base_directory.is_a? Pathname
dest_directory = self.cleanpath.to_s
base_directory = base_directory.cleanpath.to_s
dest_prefix = dest_directory
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 15f80d487e..982ef0fdb7 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)
@@ -110,6 +42,7 @@ path_initialize(VALUE self, VALUE arg)
str = rb_obj_dup(str);
set_strpath(self, str);
+ OBJ_INFECT(self, str);
return self;
}
@@ -133,12 +66,15 @@ path_freeze(VALUE self)
* call-seq:
* pathname.taint -> obj
*
- * Returns pathname. This method is deprecated and will be removed in Ruby 3.2.
+ * Taints this Pathname.
+ *
+ * See Object.taint.
*/
static VALUE
path_taint(VALUE self)
{
- rb_warning("Pathname#taint is deprecated and will be removed in Ruby 3.2.");
+ rb_call_super(0, 0);
+ rb_obj_taint(get_strpath(self));
return self;
}
@@ -146,12 +82,15 @@ path_taint(VALUE self)
* call-seq:
* pathname.untaint -> obj
*
- * Returns pathname. This method is deprecated and will be removed in Ruby 3.2.
+ * Untaints this Pathname.
+ *
+ * See Object.untaint.
*/
static VALUE
path_untaint(VALUE self)
{
- rb_warning("Pathname#untaint is deprecated and will be removed in Ruby 3.2.");
+ rb_call_super(0, 0);
+ rb_obj_untaint(get_strpath(self));
return self;
}
@@ -216,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)));
}
/*
@@ -264,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));
}
@@ -301,6 +236,7 @@ path_sub_ext(VALUE self, VALUE repl)
}
str2 = rb_str_subseq(str, 0, ext-p);
rb_str_append(str2, repl);
+ OBJ_INFECT(str2, str);
return rb_class_new_instance(1, &str2, rb_obj_class(self));
}
@@ -321,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));
}
@@ -337,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));
}
@@ -360,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_cFile, 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_cFile, id_foreach, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("foreach"), 1+n, args);
}
}
@@ -374,7 +310,7 @@ path_each_line(int argc, VALUE *argv, VALUE self)
*
* Returns all data from the file, or the first +N+ bytes if specified.
*
- * See File.read.
+ * See IO.read.
*
*/
static VALUE
@@ -385,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_kw(rb_cFile, id_read, 1+n, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_funcall2(rb_cIO, rb_intern("read"), 1+n, args);
}
/*
@@ -394,7 +330,7 @@ path_read(int argc, VALUE *argv, VALUE self)
*
* Returns all the bytes from the file, or the first +N+ if specified.
*
- * See File.binread.
+ * See IO.binread.
*
*/
static VALUE
@@ -405,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_cFile, id_binread, 1+n, args);
+ return rb_funcall2(rb_cIO, rb_intern("binread"), 1+n, args);
}
/*
@@ -415,7 +351,7 @@ path_binread(int argc, VALUE *argv, VALUE self)
*
* Writes +contents+ to the file.
*
- * See File.write.
+ * See IO.write.
*
*/
static VALUE
@@ -426,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_kw(rb_cFile, id_write, 1+n, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_funcall2(rb_cIO, rb_intern("write"), 1+n, args);
}
/*
@@ -436,7 +372,7 @@ path_write(int argc, VALUE *argv, VALUE self)
*
* Writes +contents+ to the file, opening it in binary mode.
*
- * See File.binwrite.
+ * See IO.binwrite.
*
*/
static VALUE
@@ -447,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_kw(rb_cFile, id_binwrite, 1+n, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_funcall2(rb_cIO, rb_intern("binwrite"), 1+n, args);
}
/*
@@ -458,7 +394,7 @@ path_binwrite(int argc, VALUE *argv, VALUE self)
*
* Returns all the lines from the file.
*
- * See File.readlines.
+ * See IO.readlines.
*
*/
static VALUE
@@ -469,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_kw(rb_cFile, id_readlines, 1+n, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_funcall2(rb_cIO, rb_intern("readlines"), 1+n, args);
}
/*
@@ -487,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);
}
/*
@@ -501,26 +437,25 @@ 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_RB_FILE_S_BIRTHTIME)
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) || defined(_WIN32)
/*
* call-seq:
* pathname.birthtime -> time
*
* Returns the birth time for the file.
- * If the platform doesn't have birthtime, raises NotImplementedError.
+ * 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
-/* check at compilation time for `respond_to?` */
# define path_birthtime rb_f_notimplement
#endif
@@ -535,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));
}
/*
@@ -549,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));
}
/*
@@ -563,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));
}
/*
@@ -577,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));
}
/*
@@ -591,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));
}
/*
@@ -605,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));
}
/*
@@ -623,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);
}
/*
@@ -639,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));
}
/*
@@ -653,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));
}
/*
@@ -670,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_kw(rb_cFile, id_open, 1+n, args, 0, 0, RB_PASS_CALLED_KEYWORDS);
+ return rb_block_call(rb_cFile, rb_intern("open"), 1+n, args, 0, 0);
}
else {
- return rb_funcallv_kw(rb_cFile, id_open, 1+n, args, RB_PASS_CALLED_KEYWORDS);
+ return rb_funcall2(rb_cFile, rb_intern("open"), 1+n, args);
}
}
@@ -686,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));
}
@@ -698,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);
}
/*
@@ -709,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));
}
/*
@@ -718,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));
}
/*
@@ -732,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));
}
/*
@@ -743,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);
}
/*
@@ -754,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));
}
/*
@@ -768,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));
}
@@ -783,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));
}
@@ -796,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);
}
/*
@@ -810,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));
}
@@ -826,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);
@@ -841,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));
}
/*
@@ -850,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));
}
/*
@@ -859,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));
}
/*
@@ -868,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));
}
/*
@@ -877,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));
}
/*
@@ -886,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));
}
/*
@@ -895,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));
}
/*
@@ -904,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));
}
/*
@@ -913,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));
}
/*
@@ -922,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));
}
/*
@@ -931,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));
}
/*
@@ -940,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));
}
/*
@@ -949,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));
}
/*
@@ -958,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));
}
/*
@@ -967,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));
}
/*
@@ -976,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));
}
/*
@@ -985,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));
}
/*
@@ -994,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));
}
/*
@@ -1003,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));
}
/*
@@ -1012,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));
}
/*
@@ -1021,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));
}
/*
@@ -1030,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));
}
/*
@@ -1039,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));
}
/*
@@ -1048,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));
-}
-
-/*
- * 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);
+ return rb_funcall(rb_mFileTest, rb_intern("zero?"), 1, get_strpath(self));
}
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));
}
@@ -1076,77 +995,29 @@ 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.
*/
static VALUE
path_s_glob(int argc, VALUE *argv, VALUE klass)
{
- VALUE args[3];
- int n;
-
- n = rb_scan_args(argc, argv, "12", &args[0], &args[1], &args[2]);
- if (rb_block_given_p()) {
- return rb_block_call_kw(rb_cDir, id_glob, n, args, s_glob_i, klass, RB_PASS_CALLED_KEYWORDS);
- }
- else {
- VALUE ary;
- long i;
- ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_CALLED_KEYWORDS);
- 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_class_new_instance(1, &elt, klass);
- rb_ary_store(ary, i, elt);
- }
- return ary;
- }
-}
-
-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];
+ VALUE args[2];
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_kw(rb_cDir, id_glob, n, args, glob_i, self, RB_PASS_KEYWORDS);
+ return rb_block_call(rb_cDir, rb_intern("glob"), n, args, glob_i, klass);
}
else {
VALUE ary;
long i;
- ary = rb_funcallv_kw(rb_cDir, id_glob, n, args, RB_PASS_KEYWORDS);
+ 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);
- elt = rb_funcall(self, '+', 1, elt);
+ elt = rb_class_new_instance(1, &elt, klass);
rb_ary_store(ary, i, elt);
}
return ary;
@@ -1165,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);
}
@@ -1202,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);
@@ -1223,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);
}
/*
@@ -1236,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));
}
/*
@@ -1250,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
@@ -1269,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);
}
/*
@@ -1291,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);
}
@@ -1315,8 +1186,6 @@ path_unlink(VALUE self)
static VALUE
path_f_pathname(VALUE self, VALUE str)
{
- if (CLASS_OF(str) == rb_cPathname)
- return str;
return rb_class_new_instance(1, &str, rb_cPathname);
}
@@ -1503,7 +1372,8 @@ path_f_pathname(VALUE self, VALUE str)
void
Init_pathname(void)
{
- 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);
@@ -1578,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);
@@ -1593,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/.gitignore b/ext/psych/.gitignore
new file mode 100644
index 0000000000..836058c169
--- /dev/null
+++ b/ext/psych/.gitignore
@@ -0,0 +1,11 @@
+/api.c
+/config.h
+/dumper.c
+/emitter.c
+/loader.c
+/parser.c
+/reader.c
+/scanner.c
+/writer.c
+/yaml.h
+/yaml_private.h
diff --git a/ext/psych/depend b/ext/psych/depend
index dc358eaed3..79b6c53f50 100644
--- a/ext/psych/depend
+++ b/ext/psych/depend
@@ -1,104 +1,3 @@
-$(OBJS): $(YAML_H)
-
-# AUTOGENERATED DEPENDENCIES START
-psych.o: $(RUBY_EXTCONF_H)
-psych.o: $(arch_hdrdir)/ruby/config.h
-psych.o: $(hdrdir)/ruby.h
-psych.o: $(hdrdir)/ruby/assert.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: 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.h
-psych_emitter.o: $(hdrdir)/ruby/assert.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: 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.h
-psych_parser.o: $(hdrdir)/ruby/assert.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: 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.h
-psych_to_ruby.o: $(hdrdir)/ruby/assert.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: 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.h
-psych_yaml_tree.o: $(hdrdir)/ruby/assert.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: 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 857f8e68c4..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'
@@ -13,10 +12,8 @@ if enable_config("bundled-libyaml", false) || !(find_header('yaml.h') && find_li
$VPATH << "$(srcdir)/yaml"
$INCFLAGS << " -I$(srcdir)/yaml"
- $srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)}.sort
+ $srcs = Dir.glob("#{$srcdir}/{,yaml/}*.c").map {|n| File.basename(n)}
- header = 'yaml/yaml.h'
- header = "{$(VPATH)}#{header}" if $nmake
if have_macro("_WIN32")
$CPPFLAGS << " -DYAML_DECLARE_STATIC -DHAVE_CONFIG_H"
end
@@ -36,8 +33,6 @@ if enable_config("bundled-libyaml", false) || !(find_header('yaml.h') && find_li
have_header 'config.h'
end
-create_makefile 'psych' do |mk|
- mk << "YAML_H = #{header}".strip << "\n"
-end
+create_makefile 'psych'
# :startdoc:
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index c719b036d0..1933437ac8 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -1,17 +1,4 @@
-# frozen_string_literal: true
-require 'psych/versions'
-case RUBY_ENGINE
-when 'jruby'
- require 'psych_jars'
- if JRuby::Util.respond_to?(:load_ext)
- JRuby::Util.load_ext('org.jruby.ext.psych.PsychLibrary')
- else
- require 'java'; require 'jruby'
- org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
- end
-else
- require 'psych.so'
-end
+require 'psych.so'
require 'psych/nodes'
require 'psych/streaming'
require 'psych/visitors'
@@ -22,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'
@@ -32,7 +20,7 @@ require 'psych/class_loader'
# = Overview
#
# Psych is a YAML parser and emitter.
-# Psych leverages libyaml [Home page: https://pyyaml.org/wiki/LibYAML]
+# Psych leverages libyaml [Home page: http://pyyaml.org/wiki/LibYAML]
# or [HG repo: https://bitbucket.org/xi/libyaml] for its YAML parsing
# and emitting capabilities. In addition to wrapping libyaml, Psych also
# knows how to serialize and de-serialize most Ruby objects to and from
@@ -199,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
#
@@ -229,18 +216,17 @@ require 'psych/class_loader'
# # => "a"
module Psych
+ # The version is Psych you're using
+ VERSION = '2.0.8'
+
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
- # Deprecation guard
- NOT_GIVEN = Object.new
- private_constant :NOT_GIVEN
###
# Load +yaml+ in to a Ruby data structure. If multiple documents are
# provided, the object contained in the first document will be returned.
- # +filename+ will be used in the exception message if any exception
- # is raised while parsing. If +yaml+ is empty, it returns
- # the specified +fallback+ return value, which defaults to +false+.
+ # +filename+ will be used in the exception message if any exception is raised
+ # while parsing.
#
# Raises a Psych::SyntaxError when a YAML syntax error is detected.
#
@@ -250,35 +236,14 @@ module Psych
# Psych.load("---\n - a\n - b") # => ['a', 'b']
#
# begin
- # Psych.load("--- `", filename: "file.txt")
+ # Psych.load("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# 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"}
- #
- # Raises a TypeError when `yaml` parameter is NilClass
- #
- # NOTE: This method *should not* be used to parse untrusted documents, such as
- # YAML documents that are supplied via user input. Instead, please use the
- # safe_load method.
- #
- def self.load yaml, legacy_filename = NOT_GIVEN, filename: nil, fallback: false, symbolize_names: false
- if legacy_filename != NOT_GIVEN
- warn_with_uplevel 'Passing filename with the 2nd argument of Psych.load is deprecated. Use keyword argument like Psych.load(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE
- filename = legacy_filename
- end
-
- result = parse(yaml, filename: filename)
- return fallback unless result
- 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
###
@@ -294,72 +259,40 @@ module Psych
# * Hash
#
# Recursive data structures are not allowed by default. Arbitrary classes
- # can be allowed by adding those classes to the +permitted_classes+ keyword argument. They are
+ # can be allowed by adding those classes to the +whitelist+. They are
# additive. For example, to allow Date deserialization:
#
- # Psych.safe_load(yaml, permitted_classes: [Date])
+ # Psych.safe_load(yaml, [Date])
#
# Now the Date class can be loaded in addition to the classes listed above.
#
- # Aliases can be explicitly allowed by changing the +aliases+ keyword argument.
+ # Aliases can be explicitly allowed by changing the +aliases+ parameter.
# For example:
#
# x = []
# x << x
# yaml = Psych.dump x
# Psych.safe_load yaml # => raises an exception
- # Psych.safe_load yaml, aliases: true # => loads the aliases
+ # Psych.safe_load yaml, [], [], true # => loads the aliases
#
# A Psych::DisallowedClass exception will be raised if the yaml contains a
- # class that isn't in the +permitted_classes+ list.
+ # class that isn't in the whitelist.
#
# A Psych::BadAlias exception will be raised if the yaml contains aliases
- # but the +aliases+ keyword argument 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, legacy_permitted_classes = NOT_GIVEN, legacy_permitted_symbols = NOT_GIVEN, legacy_aliases = NOT_GIVEN, legacy_filename = NOT_GIVEN, permitted_classes: [], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false
- if legacy_permitted_classes != NOT_GIVEN
- warn_with_uplevel 'Passing permitted_classes with the 2nd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_classes: ...) instead.', uplevel: 1 if $VERBOSE
- permitted_classes = legacy_permitted_classes
- end
-
- if legacy_permitted_symbols != NOT_GIVEN
- warn_with_uplevel 'Passing permitted_symbols with the 3rd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_symbols: ...) instead.', uplevel: 1 if $VERBOSE
- permitted_symbols = legacy_permitted_symbols
- end
+ # but the +aliases+ parameter is set to false.
+ def self.safe_load yaml, whitelist_classes = [], whitelist_symbols = [], aliases = false, filename = nil
+ result = parse(yaml, filename)
+ return unless result
- if legacy_aliases != NOT_GIVEN
- warn_with_uplevel 'Passing aliases with the 4th argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, aliases: ...) instead.', uplevel: 1 if $VERBOSE
- aliases = legacy_aliases
- end
-
- if legacy_filename != NOT_GIVEN
- warn_with_uplevel 'Passing filename with the 5th argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE
- filename = legacy_filename
- end
-
- result = parse(yaml, filename: filename)
- return fallback unless result
-
- class_loader = ClassLoader::Restricted.new(permitted_classes.map(&:to_s),
- permitted_symbols.map(&:to_s))
+ class_loader = ClassLoader::Restricted.new(whitelist_classes.map(&:to_s),
+ whitelist_symbols.map(&:to_s))
scanner = ScalarScanner.new class_loader
- visitor = if aliases
- Visitors::ToRuby.new scanner, class_loader
- else
- Visitors::NoAliasRuby.new scanner, class_loader
- end
- result = visitor.accept result
- symbolize_names!(result) if symbolize_names
- result
+ if aliases
+ visitor = Visitors::ToRuby.new scanner, class_loader
+ else
+ visitor = Visitors::NoAliasRuby.new scanner, class_loader
+ end
+ visitor.accept result
end
###
@@ -374,40 +307,28 @@ module Psych
# Psych.parse("---\n - a\n - b") # => #<Psych::Nodes::Document:0x00>
#
# begin
- # Psych.parse("--- `", filename: "file.txt")
+ # Psych.parse("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
# ex.message # => "(file.txt): found character that cannot start any token"
# end
#
# See Psych::Nodes for more information about YAML AST.
- def self.parse yaml, legacy_filename = NOT_GIVEN, filename: nil, fallback: NOT_GIVEN
- if legacy_filename != NOT_GIVEN
- warn_with_uplevel 'Passing filename with the 2nd argument of Psych.parse is deprecated. Use keyword argument like Psych.parse(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE
- filename = legacy_filename
- end
-
- parse_stream(yaml, filename: filename) do |node|
+ def self.parse yaml, filename = nil
+ parse_stream(yaml, filename) do |node|
return node
end
-
- if fallback != NOT_GIVEN
- warn_with_uplevel 'Passing the `fallback` keyword argument of Psych.parse is deprecated.', uplevel: 1 if $VERBOSE
- fallback
- else
- false
- end
+ false
end
###
# Parse a file at +filename+. Returns the Psych::Nodes::Document.
#
# Raises a Psych::SyntaxError when a YAML syntax error is detected.
- def self.parse_file filename, fallback: false
- result = File.open filename, 'r:bom|utf-8' do |f|
- parse f, filename: filename
+ def self.parse_file filename
+ File.open filename, 'r:bom|utf-8' do |f|
+ parse f, filename
end
- result || fallback
end
###
@@ -436,21 +357,14 @@ module Psych
# end
#
# begin
- # Psych.parse_stream("--- `", filename: "file.txt")
+ # Psych.parse_stream("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
# ex.message # => "(file.txt): found character that cannot start any token"
# end
#
- # Raises a TypeError when NilClass is passed.
- #
# See Psych::Nodes for more information about YAML AST.
- def self.parse_stream yaml, legacy_filename = NOT_GIVEN, filename: nil, &block
- if legacy_filename != NOT_GIVEN
- warn_with_uplevel 'Passing filename with the 2nd argument of Psych.parse_stream is deprecated. Use keyword argument like Psych.parse_stream(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE
- filename = legacy_filename
- end
-
+ def self.parse_stream yaml, filename = nil, &block
if block_given?
parser = Psych::Parser.new(Handlers::DocumentStream.new(&block))
parser.parse yaml, filename
@@ -472,24 +386,6 @@ module Psych
# to control the output format. If an IO object is passed in, the YAML will
# be dumped to that IO object.
#
- # Currently supported options are:
- #
- # [<tt>:indentation</tt>] Number of space characters used to indent.
- # Acceptable value should be in <tt>0..9</tt> range,
- # otherwise option is ignored.
- #
- # Default: <tt>2</tt>.
- # [<tt>:line_width</tt>] Max character to wrap line at.
- #
- # Default: <tt>0</tt> (meaning "wrap at 81").
- # [<tt>:canonical</tt>] Write "canonical" YAML form (very verbose, yet
- # strictly formal).
- #
- # Default: <tt>false</tt>.
- # [<tt>:header</tt>] Write <tt>%YAML [version]</tt> at the beginning of document.
- #
- # Default: <tt>false</tt>.
- #
# Example:
#
# # Dump an array, get back a YAML string
@@ -499,10 +395,10 @@ module Psych
# Psych.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
#
# # Dump an array with indentation set
- # Psych.dump(['a', ['b']], indentation: 3) # => "---\n- a\n- - b\n"
+ # Psych.dump(['a', ['b']], :indentation => 3) # => "---\n- a\n- - b\n"
#
# # Dump an array to an IO with indentation set
- # Psych.dump(['a', ['b']], StringIO.new, indentation: 3)
+ # Psych.dump(['a', ['b']], StringIO.new, :indentation => 3)
def self.dump o, io = nil, options = {}
if Hash === io
options = io
@@ -551,32 +447,21 @@ module Psych
# end
# list # => ['foo', 'bar']
#
- def self.load_stream yaml, legacy_filename = NOT_GIVEN, filename: nil, fallback: []
- if legacy_filename != NOT_GIVEN
- warn_with_uplevel 'Passing filename with the 2nd argument of Psych.load_stream is deprecated. Use keyword argument like Psych.load_stream(yaml, filename: ...) instead.', uplevel: 1 if $VERBOSE
- filename = legacy_filename
+ def self.load_stream yaml, filename = nil
+ if block_given?
+ parse_stream(yaml, filename) do |node|
+ yield node.to_ruby
+ end
+ else
+ parse_stream(yaml, filename).children.map { |child| child.to_ruby }
end
-
- result = if block_given?
- parse_stream(yaml, filename: filename) do |node|
- yield node.to_ruby
- end
- else
- parse_stream(yaml, filename: filename).children.map(&:to_ruby)
- end
-
- return fallback if result.is_a?(Array) && result.empty?
- result
end
###
# 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 +fallback+ return value, which defaults to +false+.
- def self.load_file filename, fallback: false
- File.open(filename, 'r:bom|utf-8') { |f|
- self.load f, filename: filename, fallback: 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:
@@ -604,34 +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!
-
- # Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
- def self.warn_with_uplevel(message, uplevel: 1)
- at = parse_caller(caller[uplevel]).join(':')
- warn "#{at}: #{message}"
- end
-
- def self.parse_caller(at)
- if /^(.+?):(\d+)(?::in `.*')?/ =~ at
- file = $1
- line = $2.to_i
- [file, line]
- end
- end
- private_class_method :warn_with_uplevel, :parse_caller
-
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 8f23e366fa..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
@@ -105,7 +104,7 @@ module Psych
# - first element
# - *ponies
#
- # &ponies is the anchor, *ponies is the alias. In this case, alias is
+ # &ponies is the achor, *ponies is the alias. In this case, alias is
# called with "ponies".
def alias anchor
end
@@ -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 6da655f0fd..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
###
@@ -14,8 +13,6 @@ module Psych
def initialize anchor
@anchor = anchor
end
-
- def alias?; true; end
end
end
end
diff --git a/ext/psych/lib/psych/nodes/document.rb b/ext/psych/lib/psych/nodes/document.rb
index f57410d636..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
###
@@ -56,8 +55,6 @@ module Psych
def root
children.first
end
-
- def document?; true; end
end
end
end
diff --git a/ext/psych/lib/psych/nodes/mapping.rb b/ext/psych/lib/psych/nodes/mapping.rb
index d49678cb0e..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
###
@@ -52,8 +51,6 @@ module Psych
@implicit = implicit
@style = style
end
-
- def mapping?; true; end
end
end
end
diff --git a/ext/psych/lib/psych/nodes/node.rb b/ext/psych/lib/psych/nodes/node.rb
index f59fb8916b..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 = []
@@ -63,13 +50,6 @@ module Psych
io
end
alias :to_yaml :yaml
-
- def alias?; false; end
- def document?; false; end
- def mapping?; false; end
- def scalar?; false; end
- def sequence?; false; end
- def stream?; false; end
end
end
end
diff --git a/ext/psych/lib/psych/nodes/scalar.rb b/ext/psych/lib/psych/nodes/scalar.rb
index e2616b6a84..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
###
@@ -63,8 +62,6 @@ module Psych
@quoted = quoted
@style = style
end
-
- def scalar?; true; end
end
end
end
diff --git a/ext/psych/lib/psych/nodes/sequence.rb b/ext/psych/lib/psych/nodes/sequence.rb
index 740f1938a4..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
###
@@ -77,8 +76,6 @@ module Psych
@implicit = implicit
@style = style
end
-
- def sequence?; true; end
end
end
end
diff --git a/ext/psych/lib/psych/nodes/stream.rb b/ext/psych/lib/psych/nodes/stream.rb
index b525217821..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
###
@@ -33,8 +32,6 @@ module Psych
super()
@encoding = encoding
end
-
- def stream?; true; end
end
end
end
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 cea2a453dd..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,19 +9,21 @@ 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
# Taken from http://yaml.org/type/int.html
- INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2)
- |[-+]?0[0-7_,]+ (?# base 8)
- |[-+]?(?:0|[1-9][0-9_,]*) (?# base 10)
- |[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x
+ INTEGER = /^(?:[-+]?0b[0-1_]+ (?# base 2)
+ |[-+]?0[0-7_]+ (?# base 8)
+ |[-+]?(?:0|[1-9][0-9_]*) (?# base 10)
+ |[-+]?0x[0-9a-fA-F_]+ (?# base 16))$/x
attr_reader :class_loader
# Create a new scanner
def initialize class_loader
+ @string_cache = {}
@symbol_cache = {}
@class_loader = class_loader
end
@@ -30,70 +31,81 @@ module Psych
# Tokenize +string+ returning the Ruby object
def tokenize string
return nil if string.empty?
+ return string if @string_cache.key?(string)
return @symbol_cache[string] if @symbol_cache.key?(string)
+ case string
# Check for a String type, being careful not to get caught by hash keys, hex values, and
# special floats (e.g., -.inf).
- if string.match?(/^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/) || string.match?(/\n/)
- return string if string.length > 5
+ when /^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/, /\n/
+ if string.length > 5
+ @string_cache[string] = true
+ return string
+ end
- if string.match?(/^[^ytonf~]/i)
+ case string
+ when /^[^ytonf~]/i
+ @string_cache[string] = true
string
- elsif string == '~' || string.match?(/^null$/i)
+ when '~', /^null$/i
nil
- elsif string.match?(/^(yes|true|on)$/i)
+ when /^(yes|true|on)$/i
true
- elsif string.match?(/^(no|false|off)$/i)
+ when /^(no|false|off)$/i
false
else
+ @string_cache[string] = true
string
end
- elsif string.match?(TIME)
+ when TIME
begin
parse_time string
rescue ArgumentError
string
end
- elsif string.match?(/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/)
+ when /^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/
require 'date'
begin
class_loader.date.strptime(string, '%Y-%m-%d')
rescue ArgumentError
string
end
- elsif string.match?(/^\.inf$/i)
+ when /^\.inf$/i
Float::INFINITY
- elsif string.match?(/^-\.inf$/i)
+ when /^-\.inf$/i
-Float::INFINITY
- elsif string.match?(/^\.nan$/i)
+ when /^\.nan$/i
Float::NAN
- elsif string.match?(/^:./)
+ when /^:./
if string =~ /^:(["'])(.*)\1/
@symbol_cache[string] = class_loader.symbolize($2.sub(/^:/, ''))
else
@symbol_cache[string] = class_loader.symbolize(string.sub(/^:/, ''))
end
- elsif string.match?(/^[-+]?[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
- elsif string.match?(/^[-+]?[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)
end
i
- elsif string.match?(FLOAT)
- if string.match?(/\A[-+]?\.\Z/)
+ when FLOAT
+ if string =~ /\A[-+]?\.\Z/
+ @string_cache[string] = true
string
else
- Float(string.gsub(/[,_]|\.([Ee]|$)/, '\1'))
+ Float(string.gsub(/[,_]|\.$/, ''))
end
- elsif string.match?(INTEGER)
- parse_int string
else
+ int = parse_int string.gsub(/[,_]/, '')
+ return int if int
+
+ @string_cache[string] = true
string
end
end
@@ -101,7 +113,8 @@ module Psych
###
# Parse and return an int from +string+
def parse_int string
- Integer(string.gsub(/[,]/, ''))
+ return unless INTEGER === string
+ Integer(string)
end
###
@@ -130,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 731ba9545e..0000000000
--- a/ext/psych/lib/psych/versions.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# frozen_string_literal: true
-module Psych
- # The version of Psych you are using
- VERSION = '3.1.0' unless defined?(::Psych::VERSION)
-
- if RUBY_ENGINE == 'jruby'
- DEFAULT_SNAKEYAML_VERSION = '1.23'.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 b72fb4a1dc..e696ebd4ff 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
@@ -252,8 +251,6 @@ module Psych
e = build_exception((resolve_class($1) || class_loader.exception),
h.delete('message'))
-
- e.set_backtrace h.delete('backtrace') if h.key? 'backtrace'
init_with(e, h, o)
when '!set', 'tag:yaml.org,2002:set'
@@ -264,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)
@@ -333,13 +315,12 @@ module Psych
list
end
- SHOVEL = '<<'
def revive_hash hash, o
o.children.each_slice(2) { |k,v|
- key = deduplicate(accept(k))
+ 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
@@ -368,24 +349,6 @@ module Psych
hash
end
- if RUBY_VERSION < '2.7'
- def deduplicate key
- if key.is_a?(String)
- -(key.untaint)
- else
- key
- end
- end
- else
- def deduplicate key
- if key.is_a?(String)
- -key
- else
- key
- end
- end
- end
-
def merge_key hash, key, val
end
@@ -400,6 +363,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 79ca129b83..989e1f0de5 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,7 +21,6 @@ module Psych
end
def register target, node
- return unless target.respond_to? :object_id
@targets << target
@obj_to_node[target.object_id] = node
end
@@ -53,24 +51,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 +128,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 +154,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 +180,6 @@ module Psych
@emitter.end_mapping
end
- alias :visit_Delegator :visit_Object
-
def visit_Struct o
tag = ['!ruby/struct', o.class.name].compact.join(':')
@@ -181,11 +195,41 @@ module Psych
end
def visit_Exception o
- dump_exception o, private_iv_get(o, 'mesg')
+ tag = ['!ruby/exception', o.class.name].join ':'
+
+ @emitter.start_mapping nil, tag, false, Nodes::Mapping::BLOCK
+
+ {
+ 'message' => private_iv_get(o, 'mesg'),
+ 'backtrace' => private_iv_get(o, 'backtrace'),
+ }.each do |k,v|
+ next unless v
+ @emitter.scalar k, nil, nil, true, false, Nodes::Scalar::ANY
+ accept v
+ end
+
+ dump_ivars o
+
+ @emitter.end_mapping
end
def visit_NameError o
- dump_exception o, o.message.to_s
+ tag = ['!ruby/exception', o.class.name].join ':'
+
+ @emitter.start_mapping nil, tag, false, Nodes::Mapping::BLOCK
+
+ {
+ 'message' => o.message.to_s,
+ 'backtrace' => private_iv_get(o, 'backtrace'),
+ }.each do |k,v|
+ next unless v
+ @emitter.scalar k, nil, nil, true, false, Nodes::Scalar::ANY
+ accept v
+ end
+
+ dump_ivars o
+
+ @emitter.end_mapping
end
def visit_Regexp o
@@ -257,46 +301,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
@@ -323,16 +367,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
@@ -348,18 +393,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
@@ -385,15 +426,20 @@ module Psych
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 }
@@ -411,50 +457,12 @@ module Psych
# Dump the ivars
accept 'ivars'
@emitter.start_mapping(nil, nil, true, Nodes::Sequence::BLOCK)
- ivars.each do |ivar|
- accept ivar
- accept o.instance_variable_get ivar
- end
- @emitter.end_mapping
-
- @emitter.end_mapping
- 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)
-
- # Dump the ivars
- accept 'ivars'
- @emitter.start_mapping nil, nil, true, Nodes::Mapping::BLOCK
o.instance_variables.each do |ivar|
accept ivar
accept o.instance_variable_get ivar
end
@emitter.end_mapping
- # 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
-
- @emitter.end_mapping
- else
- tag = "!ruby/hash:#{o.class}"
- node = @emitter.start_mapping(nil, tag, false, Psych::Nodes::Mapping::BLOCK)
- register(o, node)
- o.each do |k,v|
- accept k
- accept v
- end
@emitter.end_mapping
end
end
@@ -462,30 +470,46 @@ module Psych
def dump_list o
end
- def dump_exception o, msg
- tag = ['!ruby/exception', o.class.name].join ':'
+ # '%: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")
- @emitter.start_mapping nil, tag, false, Nodes::Mapping::BLOCK
+ if time.utc?
+ formatted += " Z"
+ else
+ zone = time.strftime('%z')
+ formatted += " #{zone[0,3]}:#{zone[3,5]}"
+ end
- if msg
- @emitter.scalar 'message', nil, nil, true, false, Nodes::Scalar::ANY
- accept msg
+ formatted
+ end
+ else
+ def format_time time
+ if time.utc?
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
+ else
+ time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
+ end
end
-
- @emitter.scalar 'backtrace', nil, nil, true, false, Nodes::Scalar::ANY
- accept o.backtrace
-
- dump_ivars o
-
- @emitter.end_mapping
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
@@ -503,10 +527,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
@@ -517,7 +541,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
@@ -529,7 +553,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.gemspec b/ext/psych/psych.gemspec
index e0168af7d8..648eb794f4 100644
--- a/ext/psych/psych.gemspec
+++ b/ext/psych/psych.gemspec
@@ -1,70 +1,23 @@
# -*- encoding: utf-8 -*-
-# frozen_string_literal: true
-
-begin
- require_relative 'lib/psych/versions'
-rescue LoadError
- # for Ruby core repository
- require_relative 'versions'
-end
Gem::Specification.new do |s|
s.name = "psych"
- s.version = Psych::VERSION
- s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
- s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
- s.summary = "Psych is a YAML parser and emitter"
- s.description = <<-DESCRIPTION
-Psych is a YAML parser and emitter. Psych leverages libyaml[https://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", "Gemfile", "Mavenfile", "README.md", "Rakefile", "bin/console",
- "bin/setup", "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.version = "2.0.8"
- s.rdoc_options = ["--main", "README.md"]
- s.extra_rdoc_files = ["README.md"]
-
- s.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
- s.rubygems_version = "2.5.1"
- s.required_rubygems_version = Gem::Requirement.new(">= 0")
-
- if RUBY_ENGINE == 'jruby'
- s.platform = 'java'
- s.files.concat [
- "ext/java/org/jruby/ext/psych/PsychEmitter.java",
- "ext/java/org/jruby/ext/psych/PsychLibrary.java",
- "ext/java/org/jruby/ext/psych/PsychParser.java",
- "ext/java/org/jruby/ext/psych/PsychToRuby.java",
- "ext/java/org/jruby/ext/psych/PsychYamlTree.java",
- "lib/psych_jars.rb",
- "lib/psych.jar"
- ]
- s.requirements = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}"
- s.add_dependency 'jar-dependencies', '>= 0.1.7'
- else
- s.extensions = ["ext/psych/extconf.rb"]
- 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-12-05"
+ 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", ".gemtest", "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_marshalable.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.4.4"
+ 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_marshalable.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 022ffa0946..4ba238102b 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);
}
@@ -58,13 +50,14 @@ static const rb_data_type_t psych_emitter_type = {
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 TypedData_Wrap_Struct(klass, &psych_emitter_type, emitter);
}
/* call-seq: Psych::Emitter.new(io, options = Psych::Emitter::OPTIONS)
@@ -91,8 +84,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;
}
@@ -164,18 +156,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 +177,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++;
}
@@ -251,11 +243,14 @@ static VALUE scalar(
) {
yaml_emitter_t * emitter;
yaml_event_t event;
+#ifdef HAVE_RUBY_ENCODING_H
rb_encoding *encoding;
+#endif
TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, 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 +264,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 +299,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 +311,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);
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)
);
@@ -365,10 +363,12 @@ static VALUE start_mapping(
) {
yaml_emitter_t * emitter;
yaml_event_t event;
+#ifdef HAVE_RUBY_ENCODING_H
rb_encoding *encoding;
-
+#endif
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 +380,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)
);
@@ -425,14 +426,16 @@ static VALUE alias(VALUE self, VALUE anchor)
yaml_event_t event;
TypedData_Get_Struct(self, yaml_emitter_t, &psych_emitter_type, 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);
@@ -521,7 +524,6 @@ static VALUE set_line_width(VALUE self, VALUE width)
void Init_psych_emitter(void)
{
-#undef rb_intern
VALUE psych = rb_define_module("Psych");
VALUE handler = rb_define_class_under(psych, "Handler", rb_cObject);
cPsychEmitter = rb_define_class_under(psych, "Emitter", handler);
@@ -546,7 +548,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_parser.c b/ext/psych/psych_parser.c
index fb1a917bb2..faae460dd0 100644
--- a/ext/psych/psych_parser.c
+++ b/ext/psych/psych_parser.c
@@ -1,6 +1,7 @@
#include <psych.h>
VALUE cPsychParser;
+VALUE ePsychSyntaxError;
static ID id_read;
static ID id_path;
@@ -15,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 { \
@@ -70,23 +70,20 @@ static const rb_data_type_t psych_parser_type = {
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 TypedData_Wrap_Struct(klass, &psych_parser_type, parser);
}
static VALUE make_exception(yaml_parser_t * parser, VALUE path)
{
size_t line, column;
- VALUE ePsychSyntaxError;
line = parser->context_mark.line + 1;
column = parser->context_mark.column + 1;
- ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
-
return rb_funcall(ePsychSyntaxError, rb_intern("new"), 6,
path,
INT2NUM(line),
@@ -96,6 +93,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();
@@ -173,6 +171,8 @@ static VALUE transcode_io(VALUE src, int * parser_encoding)
return src;
}
+#endif
+
static VALUE protected_start_stream(VALUE pointer)
{
VALUE *args = (VALUE *)pointer;
@@ -235,12 +235,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)
@@ -256,10 +250,13 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
yaml_parser_t * parser;
yaml_event_t event;
int done = 0;
+ int tainted = 0;
int state = 0;
int parser_encoding = YAML_ANY_ENCODING;
+#ifdef HAVE_RUBY_ENCODING_H
int encoding = rb_utf8_encindex();
rb_encoding * internal_enc = rb_default_internal_encoding();
+#endif
VALUE handler = rb_iv_get(self, "@handler");
if (rb_scan_args(argc, argv, "11", &yaml, &path) == 1) {
@@ -274,14 +271,21 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
yaml_parser_delete(parser);
yaml_parser_initialize(parser);
+ 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),
@@ -290,9 +294,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;
@@ -303,18 +304,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:
{
@@ -348,12 +337,18 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
VALUE prefix = Qnil;
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));
@@ -381,7 +376,10 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
VALUE alias = Qnil;
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;
@@ -399,17 +397,26 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
(const char *)event.data.scalar.value,
(long)event.data.scalar.length
);
+ 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 =
@@ -438,13 +445,19 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
VALUE implicit, style;
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 =
@@ -472,12 +485,18 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
VALUE implicit, style;
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 =
@@ -536,7 +555,6 @@ static VALUE mark(VALUE self)
void Init_psych_parser(void)
{
-#undef rb_intern
#if 0
mPsych = rb_define_module("Psych");
#endif
@@ -557,23 +575,23 @@ void Init_psych_parser(void)
rb_define_const(cPsychParser, "UTF16BE", INT2NUM(YAML_UTF16BE_ENCODING));
rb_require("psych/syntax_error");
+ ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
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_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 95dc6b4de3..e0b9d979cc 100644
--- a/ext/psych/yaml/api.c
+++ b/ext/psych/yaml/api.c
@@ -74,7 +74,7 @@ YAML_DECLARE(int)
yaml_string_extend(yaml_char_t **start,
yaml_char_t **pointer, yaml_char_t **end)
{
- yaml_char_t *new_start = (yaml_char_t *)yaml_realloc((void*)*start, (*end - *start)*2);
+ yaml_char_t *new_start = yaml_realloc(*start, (*end - *start)*2);
if (!new_start) return 0;
@@ -94,9 +94,8 @@ yaml_string_extend(yaml_char_t **start,
YAML_DECLARE(int)
yaml_string_join(
yaml_char_t **a_start, yaml_char_t **a_pointer, yaml_char_t **a_end,
- yaml_char_t **b_start, yaml_char_t **b_pointer, SHIM(yaml_char_t **b_end))
+ yaml_char_t **b_start, yaml_char_t **b_pointer, yaml_char_t **b_end)
{
- UNUSED_PARAM(b_end)
if (*b_start == *b_pointer)
return 1;
@@ -178,17 +177,17 @@ yaml_parser_initialize(yaml_parser_t *parser)
goto error;
if (!BUFFER_INIT(parser, parser->buffer, INPUT_BUFFER_SIZE))
goto error;
- if (!QUEUE_INIT(parser, parser->tokens, INITIAL_QUEUE_SIZE, yaml_token_t*))
+ if (!QUEUE_INIT(parser, parser->tokens, INITIAL_QUEUE_SIZE))
goto error;
- if (!STACK_INIT(parser, parser->indents, int*))
+ if (!STACK_INIT(parser, parser->indents, INITIAL_STACK_SIZE))
goto error;
- if (!STACK_INIT(parser, parser->simple_keys, yaml_simple_key_t*))
+ if (!STACK_INIT(parser, parser->simple_keys, INITIAL_STACK_SIZE))
goto error;
- if (!STACK_INIT(parser, parser->states, yaml_parser_state_t*))
+ if (!STACK_INIT(parser, parser->states, INITIAL_STACK_SIZE))
goto error;
- if (!STACK_INIT(parser, parser->marks, yaml_mark_t*))
+ if (!STACK_INIT(parser, parser->marks, INITIAL_STACK_SIZE))
goto error;
- if (!STACK_INIT(parser, parser->tag_directives, yaml_tag_directive_t*))
+ if (!STACK_INIT(parser, parser->tag_directives, INITIAL_STACK_SIZE))
goto error;
return 1;
@@ -244,7 +243,7 @@ static int
yaml_string_read_handler(void *data, unsigned char *buffer, size_t size,
size_t *size_read)
{
- yaml_parser_t *parser = (yaml_parser_t *)data;
+ yaml_parser_t *parser = data;
if (parser->input.string.current == parser->input.string.end) {
*size_read = 0;
@@ -270,7 +269,7 @@ static int
yaml_file_read_handler(void *data, unsigned char *buffer, size_t size,
size_t *size_read)
{
- yaml_parser_t *parser = (yaml_parser_t *)data;
+ yaml_parser_t *parser = data;
*size_read = fread(buffer, 1, size, parser->input.file);
return !ferror(parser->input.file);
@@ -356,13 +355,13 @@ yaml_emitter_initialize(yaml_emitter_t *emitter)
goto error;
if (!BUFFER_INIT(emitter, emitter->raw_buffer, OUTPUT_RAW_BUFFER_SIZE))
goto error;
- if (!STACK_INIT(emitter, emitter->states, yaml_emitter_state_t*))
+ if (!STACK_INIT(emitter, emitter->states, INITIAL_STACK_SIZE))
goto error;
- if (!QUEUE_INIT(emitter, emitter->events, INITIAL_QUEUE_SIZE, yaml_event_t*))
+ if (!QUEUE_INIT(emitter, emitter->events, INITIAL_QUEUE_SIZE))
goto error;
- if (!STACK_INIT(emitter, emitter->indents, int*))
+ if (!STACK_INIT(emitter, emitter->indents, INITIAL_STACK_SIZE))
goto error;
- if (!STACK_INIT(emitter, emitter->tag_directives, yaml_tag_directive_t*))
+ if (!STACK_INIT(emitter, emitter->tag_directives, INITIAL_STACK_SIZE))
goto error;
return 1;
@@ -396,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);
@@ -414,9 +413,9 @@ yaml_emitter_delete(yaml_emitter_t *emitter)
static int
yaml_string_write_handler(void *data, unsigned char *buffer, size_t size)
{
- yaml_emitter_t *emitter = (yaml_emitter_t *)data;
+ 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,
@@ -440,7 +439,7 @@ yaml_string_write_handler(void *data, unsigned char *buffer, size_t size)
static int
yaml_file_write_handler(void *data, unsigned char *buffer, size_t size)
{
- yaml_emitter_t *emitter = (yaml_emitter_t *)data;
+ yaml_emitter_t *emitter = data;
return (fwrite(buffer, 1, size, emitter->output.file) == size);
}
@@ -718,7 +717,7 @@ yaml_document_start_event_initialize(yaml_event_t *event,
/* Valid tag directives are expected. */
if (version_directive) {
- version_directive_copy = YAML_MALLOC_STATIC(yaml_version_directive_t);
+ version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t));
if (!version_directive_copy) goto error;
version_directive_copy->major = version_directive->major;
version_directive_copy->minor = version_directive->minor;
@@ -726,7 +725,7 @@ yaml_document_start_event_initialize(yaml_event_t *event,
if (tag_directives_start != tag_directives_end) {
yaml_tag_directive_t *tag_directive;
- if (!STACK_INIT(&context, tag_directives_copy, yaml_tag_directive_t*))
+ if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
goto error;
for (tag_directive = tag_directives_start;
tag_directive != tag_directives_end; tag_directive ++) {
@@ -823,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. */
@@ -840,16 +840,19 @@ yaml_scalar_event_initialize(yaml_event_t *event,
}
if (length < 0) {
- length = (int)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;
@@ -1056,10 +1059,10 @@ yaml_document_initialize(yaml_document_t *document,
(tag_directives_start == tag_directives_end));
/* Valid tag directives are expected. */
- if (!STACK_INIT(&context, nodes, yaml_node_t*)) goto error;
+ if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error;
if (version_directive) {
- version_directive_copy = YAML_MALLOC_STATIC(yaml_version_directive_t);
+ version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t));
if (!version_directive_copy) goto error;
version_directive_copy->major = version_directive->major;
version_directive_copy->minor = version_directive->minor;
@@ -1067,7 +1070,7 @@ yaml_document_initialize(yaml_document_t *document,
if (tag_directives_start != tag_directives_end) {
yaml_tag_directive_t *tag_directive;
- if (!STACK_INIT(&context, tag_directives_copy, yaml_tag_directive_t*))
+ if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE))
goto error;
for (tag_directive = tag_directives_start;
tag_directive != tag_directives_end; tag_directive ++) {
@@ -1122,9 +1125,7 @@ yaml_document_delete(yaml_document_t *document)
} context;
yaml_tag_directive_t *tag_directive;
- /* Eliminate a compliler warning. */
- context.error = YAML_NO_ERROR;
- (void)context.error;
+ context.error = YAML_NO_ERROR; /* Eliminate a compliler warning. */
assert(document); /* Non-NULL document object is expected. */
@@ -1205,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. */
@@ -1218,19 +1221,26 @@ yaml_document_add_scalar(yaml_document_t *document,
if (!tag_copy) goto error;
if (length < 0) {
- length = (int)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 (int)(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);
@@ -1258,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. */
@@ -1269,13 +1280,17 @@ yaml_document_add_sequence(yaml_document_t *document,
tag_copy = yaml_strdup(tag);
if (!tag_copy) goto error;
- if (!STACK_INIT(&context, items, yaml_node_item_t*)) goto error;
+ if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error;
SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- return (int)(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);
@@ -1303,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. */
@@ -1314,13 +1330,17 @@ yaml_document_add_mapping(yaml_document_t *document,
tag_copy = yaml_strdup(tag);
if (!tag_copy) goto error;
- if (!STACK_INIT(&context, pairs, yaml_node_pair_t*)) goto error;
+ if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error;
MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- return (int)(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 da905133ff..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.2.1"
-#define PACKAGE_STRING "yaml 0.2.1"
-#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 2
-#define YAML_VERSION_PATCH 1
-#define YAML_VERSION_STRING "0.2.1"
+#define YAML_VERSION_MINOR 1
+#define YAML_VERSION_PATCH 6
+#define YAML_VERSION_STRING "0.1.6"
diff --git a/ext/psych/yaml/dumper.c b/ext/psych/yaml/dumper.c
index 29fb9c0784..203c6a709c 100644
--- a/ext/psych/yaml/dumper.c
+++ b/ext/psych/yaml/dumper.c
@@ -245,9 +245,9 @@ yaml_emitter_anchor_node(yaml_emitter_t *emitter, int index)
#define ANCHOR_TEMPLATE_LENGTH 16
static yaml_char_t *
-yaml_emitter_generate_anchor(SHIM(yaml_emitter_t *emitter), int anchor_id)
+yaml_emitter_generate_anchor(yaml_emitter_t *emitter, int anchor_id)
{
- yaml_char_t *anchor = YAML_MALLOC(ANCHOR_TEMPLATE_LENGTH);
+ yaml_char_t *anchor = yaml_malloc(ANCHOR_TEMPLATE_LENGTH);
if (!anchor) return NULL;
diff --git a/ext/psych/yaml/emitter.c b/ext/psych/yaml/emitter.c
index 92e21cdb73..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), \
@@ -1002,7 +1002,7 @@ yaml_emitter_emit_node(yaml_emitter_t *emitter, yaml_event_t *event,
*/
static int
-yaml_emitter_emit_alias(yaml_emitter_t *emitter, SHIM(yaml_event_t *event))
+yaml_emitter_emit_alias(yaml_emitter_t *emitter, yaml_event_t *event)
{
if (!yaml_emitter_process_anchor(emitter))
return 0;
@@ -1087,7 +1087,7 @@ yaml_emitter_emit_mapping_start(yaml_emitter_t *emitter, yaml_event_t *event)
*/
static int
-yaml_emitter_check_empty_document(SHIM(yaml_emitter_t *emitter))
+yaml_emitter_check_empty_document(yaml_emitter_t *emitter)
{
return 0;
}
@@ -1234,7 +1234,7 @@ yaml_emitter_select_scalar_style(yaml_emitter_t *emitter, yaml_event_t *event)
}
/*
- * Write an anchor.
+ * Write an achor.
*/
static int
@@ -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));
@@ -1946,6 +1946,10 @@ yaml_emitter_write_plain_scalar(yaml_emitter_t *emitter,
emitter->whitespace = 0;
emitter->indention = 0;
+ if (emitter->root_context)
+ {
+ emitter->open_ended = 1;
+ }
return 1;
}
@@ -2322,3 +2326,4 @@ yaml_emitter_write_folded_scalar(yaml_emitter_t *emitter,
return 1;
}
+
diff --git a/ext/psych/yaml/loader.c b/ext/psych/yaml/loader.c
index e5d90be9bc..cb3ea93089 100644
--- a/ext/psych/yaml/loader.c
+++ b/ext/psych/yaml/loader.c
@@ -72,7 +72,7 @@ yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document)
assert(document); /* Non-NULL document object is expected. */
memset(document, 0, sizeof(yaml_document_t));
- if (!STACK_INIT(parser, document->nodes, yaml_node_t*))
+ if (!STACK_INIT(parser, document->nodes, INITIAL_STACK_SIZE))
goto error;
if (!parser->stream_start_produced) {
@@ -90,7 +90,7 @@ yaml_parser_load(yaml_parser_t *parser, yaml_document_t *document)
return 1;
}
- if (!STACK_INIT(parser, parser->aliases, yaml_alias_data_t*))
+ if (!STACK_INIT(parser, parser->aliases, INITIAL_STACK_SIZE))
goto error;
parser->document = document;
@@ -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 = (int)(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;
@@ -339,7 +345,7 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
if (!tag) goto error;
}
- if (!STACK_INIT(parser, items, yaml_node_item_t*)) goto error;
+ if (!STACK_INIT(parser, items, INITIAL_STACK_SIZE)) goto error;
SEQUENCE_NODE_INIT(node, tag, items.start, items.end,
first_event->data.sequence_start.style,
@@ -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 = (int)(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;
@@ -402,7 +413,7 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
if (!tag) goto error;
}
- if (!STACK_INIT(parser, pairs, yaml_node_pair_t*)) goto error;
+ if (!STACK_INIT(parser, pairs, INITIAL_STACK_SIZE)) goto error;
MAPPING_NODE_INIT(node, tag, pairs.start, pairs.end,
first_event->data.mapping_start.style,
@@ -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 = (int)(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/parser.c b/ext/psych/yaml/parser.c
index 621f676bf2..32671b252c 100644
--- a/ext/psych/yaml/parser.c
+++ b/ext/psych/yaml/parser.c
@@ -605,7 +605,7 @@ yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event,
if (strcmp((char *)tag_directive->handle, (char *)tag_handle) == 0) {
size_t prefix_len = strlen((char *)tag_directive->prefix);
size_t suffix_len = strlen((char *)tag_suffix);
- tag = YAML_MALLOC(prefix_len+suffix_len+1);
+ tag = yaml_malloc(prefix_len+suffix_len+1);
if (!tag) {
parser->error = YAML_MEMORY_ERROR;
goto error;
@@ -685,7 +685,7 @@ yaml_parser_parse_node(yaml_parser_t *parser, yaml_event_t *event,
return 1;
}
else if (anchor || tag) {
- yaml_char_t *value = YAML_MALLOC(1);
+ yaml_char_t *value = yaml_malloc(1);
if (!value) {
parser->error = YAML_MEMORY_ERROR;
goto error;
@@ -1208,7 +1208,7 @@ yaml_parser_process_empty_scalar(yaml_parser_t *parser, yaml_event_t *event,
{
yaml_char_t *value;
- value = YAML_MALLOC(1);
+ value = yaml_malloc(1);
if (!value) {
parser->error = YAML_MEMORY_ERROR;
return 0;
@@ -1245,7 +1245,7 @@ yaml_parser_process_directives(yaml_parser_t *parser,
} tag_directives = { NULL, NULL, NULL };
yaml_token_t *token;
- if (!STACK_INIT(parser, tag_directives, yaml_tag_directive_t*))
+ if (!STACK_INIT(parser, tag_directives, INITIAL_STACK_SIZE))
goto error;
token = PEEK_TOKEN(parser);
@@ -1266,7 +1266,7 @@ yaml_parser_process_directives(yaml_parser_t *parser,
"found incompatible YAML document", token->start_mark);
goto error;
}
- version_directive = YAML_MALLOC_STATIC(yaml_version_directive_t);
+ version_directive = yaml_malloc(sizeof(yaml_version_directive_t));
if (!version_directive) {
parser->error = YAML_MEMORY_ERROR;
goto error;
diff --git a/ext/psych/yaml/reader.c b/ext/psych/yaml/reader.c
index f3ac54c251..f1a06deb9d 100644
--- a/ext/psych/yaml/reader.c
+++ b/ext/psych/yaml/reader.c
@@ -460,10 +460,10 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
}
- if (parser->offset >= MAX_FILE_SIZE) {
+ if (parser->offset >= PTRDIFF_MAX)
return yaml_parser_set_reader_error(parser, "input is too long",
- parser->offset, -1);
- }
+ PTRDIFF_MAX, -1);
return 1;
}
+
diff --git a/ext/psych/yaml/scanner.c b/ext/psych/yaml/scanner.c
index 204593d910..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.
*/
@@ -1222,10 +1229,12 @@ 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 = (int)column;
@@ -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;
}
@@ -2399,7 +2408,7 @@ yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token)
{
/* Set the handle to '' */
- handle = YAML_MALLOC(1);
+ handle = yaml_malloc(1);
if (!handle) goto error;
handle[0] = '\0';
@@ -2451,7 +2460,7 @@ yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token)
/* Set the handle to '!'. */
yaml_free(handle);
- handle = YAML_MALLOC(2);
+ handle = yaml_malloc(2);
if (!handle) goto error;
handle[0] = '!';
handle[1] = '\0';
@@ -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? */
@@ -3160,8 +3169,8 @@ yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token,
*(string.pointer++) = '"';
break;
- case '/':
- *(string.pointer++) = '/';
+ case '\'':
+ *(string.pointer++) = '\'';
break;
case '\\':
@@ -3278,11 +3287,6 @@ yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token,
/* Check if we are at the end of the scalar. */
- /* Fix for crash unitialized value crash
- * Credit for the bug and input is to OSS Fuzz
- * Credit for the fix to Alex Gaynor
- */
- if (!CACHE(parser, 1)) goto error;
if (CHECK(parser->buffer, single ? '\'' : '"'))
break;
@@ -3507,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 violate indentation");
+ start_mark, "found a tab character that violate intendation");
goto error;
}
@@ -3545,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;
@@ -3576,3 +3580,4 @@ error:
return 0;
}
+
diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h
index f4f244cbc8..944499c94e 100644
--- a/ext/psych/yaml/yaml_private.h
+++ b/ext/psych/yaml/yaml_private.h
@@ -12,6 +12,16 @@
#include <limits.h>
#include <stddef.h>
+#ifndef _MSC_VER
+#include <stdint.h>
+#else
+#ifdef _WIN64
+#define PTRDIFF_MAX _I64_MAX
+#else
+#define PTRDIFF_MAX INT_MAX
+#endif
+#endif
+
/*
* Memory management.
*/
@@ -71,17 +81,6 @@ yaml_parser_fetch_more_tokens(yaml_parser_t *parser);
#define OUTPUT_RAW_BUFFER_SIZE (OUTPUT_BUFFER_SIZE*2+2)
/*
- * The maximum size of a YAML input file.
- * This used to be PTRDIFF_MAX, but that's not entirely portable
- * because stdint.h isn't available on all platforms.
- * It is not entirely clear why this isn't the maximum value
- * that can fit into the parser->offset field.
- */
-
-#define MAX_FILE_SIZE (~(size_t)0 / 2)
-
-
-/*
* The size of other stacks and queues.
*/
@@ -94,7 +93,7 @@ yaml_parser_fetch_more_tokens(yaml_parser_t *parser);
*/
#define BUFFER_INIT(context,buffer,size) \
- (((buffer).start = (yaml_char_t *)yaml_malloc(size)) ? \
+ (((buffer).start = yaml_malloc(size)) ? \
((buffer).last = (buffer).pointer = (buffer).start, \
(buffer).end = (buffer).start+(size), \
1) : \
@@ -134,7 +133,7 @@ yaml_string_join(
(value).pointer = (string))
#define STRING_INIT(context,string,size) \
- (((string).start = YAML_MALLOC(size)) ? \
+ (((string).start = yaml_malloc(size)) ? \
((string).pointer = (string).start, \
(string).end = (string).start+(size), \
memset((string).start, 0, (size)), \
@@ -424,10 +423,10 @@ yaml_stack_extend(void **start, void **top, void **end);
YAML_DECLARE(int)
yaml_queue_extend(void **start, void **head, void **tail, void **end);
-#define STACK_INIT(context,stack,type) \
- (((stack).start = (type)yaml_malloc(INITIAL_STACK_SIZE*sizeof(*(stack).start))) ? \
+#define STACK_INIT(context,stack,size) \
+ (((stack).start = yaml_malloc((size)*sizeof(*(stack).start))) ? \
((stack).top = (stack).start, \
- (stack).end = (stack).start+INITIAL_STACK_SIZE, \
+ (stack).end = (stack).start+(size), \
1) : \
((context)->error = YAML_MEMORY_ERROR, \
0))
@@ -437,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) ? \
@@ -457,8 +457,8 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
#define POP(context,stack) \
(*(--(stack).top))
-#define QUEUE_INIT(context,queue,size,type) \
- (((queue).start = (type)yaml_malloc((size)*sizeof(*(queue).start))) ? \
+#define QUEUE_INIT(context,queue,size) \
+ (((queue).start = yaml_malloc((size)*sizeof(*(queue).start))) ? \
((queue).head = (queue).tail = (queue).start, \
(queue).end = (queue).start+(size), \
1) : \
@@ -662,27 +662,3 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
(node).data.mapping.pairs.top = (node_pairs_start), \
(node).data.mapping.style = (node_style))
-/* Strict C compiler warning helpers */
-
-#if defined(__clang__) || defined(__GNUC__)
-# define HASATTRIBUTE_UNUSED
-#endif
-#ifdef HASATTRIBUTE_UNUSED
-# define __attribute__unused__ __attribute__((__unused__))
-#else
-# define __attribute__unused__
-#endif
-
-/* Shim arguments are arguments that must be included in your function,
- * but serve no purpose inside. Silence compiler warnings. */
-#define SHIM(a) /*@unused@*/ a __attribute__unused__
-
-/* UNUSED_PARAM() marks a shim argument in the body to silence compiler warnings */
-#ifdef __clang__
-# define UNUSED_PARAM(a) (void)(a);
-#else
-# define UNUSED_PARAM(a) /*@-noeffect*/if (0) (void)(a)/*@=noeffect*/;
-#endif
-
-#define YAML_MALLOC_STATIC(type) (type*)yaml_malloc(sizeof(type))
-#define YAML_MALLOC(size) (yaml_char_t *)yaml_malloc(size)
diff --git a/ext/pty/depend b/ext/pty/depend
index 1e89dc824c..a1982af215 100644
--- a/ext/pty/depend
+++ b/ext/pty/depend
@@ -1,20 +1,17 @@
# AUTOGENERATED DEPENDENCIES START
pty.o: $(RUBY_EXTCONF_H)
pty.o: $(arch_hdrdir)/ruby/config.h
-pty.o: $(hdrdir)/ruby.h
-pty.o: $(hdrdir)/ruby/assert.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
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 7721a744c8..1db9f6e8aa 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -1,15 +1,13 @@
-# frozen_string_literal: true
require 'mkmf'
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
-if /mswin|mingw|bccwin/ !~ RUBY_PLATFORM
+if /mswin|mingw|bccwin|nacl/ !~ RUBY_PLATFORM
have_header("sys/stropts.h")
have_func("setresuid")
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 4c6ae26127..631adb2322 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,8 +33,8 @@
#endif
#include <ctype.h>
-#include "ruby/io.h"
#include "internal.h"
+#include "ruby/io.h"
#include "ruby/util.h"
#include <signal.h>
@@ -143,7 +141,7 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
dup2(slave,0);
dup2(slave,1);
dup2(slave,2);
- if (slave < 0 || slave > 2) (void)!close(slave);
+ close(slave);
#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID)
if (seteuid(getuid())) ERROR_EXIT("seteuid()");
#endif
@@ -159,32 +157,32 @@ 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;
argv = &v;
}
- carg.execarg_obj = rb_execarg_new(argc, argv, 1, 0);
+ 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 +196,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 +209,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,22 +217,6 @@ no_mesg(char *slavedevice, int nomesg)
else
return 0;
}
-#endif
-
-#if defined(I_PUSH) && !defined(__linux__) && !defined(_AIX)
-static inline int
-ioctl_I_PUSH(int fd, const char *const name)
-{
- int ret = 0;
-# if defined(I_FIND)
- ret = ioctl(fd, I_FIND, name);
-# endif
- if (ret == 0) {
- ret = ioctl(fd, I_PUSH, name);
- }
- return ret;
-}
-#endif
static int
get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, int fail)
@@ -246,13 +225,19 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
/* Unix98 PTY */
int masterfd = -1, slavefd = -1;
char *slavedevice;
+ struct sigaction dfl, old;
+
+ dfl.sa_handler = SIG_DFL;
+ 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 */
if ((masterfd = posix_openpt(O_RDWR|O_NOCTTY)) == -1) goto error;
- if (rb_grantpt(masterfd) == -1) goto error;
+ if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error;
+ if (grantpt(masterfd) == -1) goto grantpt_error;
rb_fd_fix_cloexec(masterfd);
#else
{
@@ -266,8 +251,10 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
if ((masterfd = posix_openpt(flags)) == -1) goto error;
}
rb_fd_fix_cloexec(masterfd);
- if (rb_grantpt(masterfd) == -1) goto error;
+ if (sigaction(SIGCHLD, &dfl, &old) == -1) goto error;
+ if (grantpt(masterfd) == -1) goto grantpt_error;
#endif
+ if (sigaction(SIGCHLD, &old, NULL) == -1) goto error;
if (unlockpt(masterfd) == -1) goto error;
if ((slavedevice = ptsname(masterfd)) == NULL) goto error;
if (no_mesg(slavedevice, nomesg) == -1) goto error;
@@ -275,9 +262,9 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
rb_update_max_fd(slavefd);
#if defined(I_PUSH) && !defined(__linux__) && !defined(_AIX)
- if (ioctl_I_PUSH(slavefd, "ptem") == -1) goto error;
- if (ioctl_I_PUSH(slavefd, "ldterm") == -1) goto error;
- if (ioctl_I_PUSH(slavefd, "ttcompat") == -1) goto error;
+ 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;
#endif
*master = masterfd;
@@ -285,6 +272,8 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
strlcpy(SlaveName, slavedevice, DEVICELEN);
return 0;
+ grantpt_error:
+ sigaction(SIGCHLD, &old, NULL);
error:
if (slavefd != -1) close(slavefd);
if (masterfd != -1) close(masterfd);
@@ -336,26 +325,30 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg,
extern char *ptsname(int);
extern int unlockpt(int);
+ extern int grantpt(int);
#if defined(__sun)
/* workaround for Solaris 10: grantpt() doesn't work if FD_CLOEXEC is set. [ruby-dev:44688] */
if((masterfd = open("/dev/ptmx", O_RDWR, 0)) == -1) goto error;
- if(rb_grantpt(masterfd) == -1) goto error;
+ s = signal(SIGCHLD, SIG_DFL);
+ if(grantpt(masterfd) == -1) goto error;
rb_fd_fix_cloexec(masterfd);
#else
if((masterfd = rb_cloexec_open("/dev/ptmx", O_RDWR, 0)) == -1) goto error;
rb_update_max_fd(masterfd);
- if(rb_grantpt(masterfd) == -1) goto error;
+ s = signal(SIGCHLD, SIG_DFL);
+ if(grantpt(masterfd) == -1) goto error;
#endif
+ signal(SIGCHLD, s);
if(unlockpt(masterfd) == -1) goto error;
if((slavedevice = ptsname(masterfd)) == NULL) goto error;
if (no_mesg(slavedevice, nomesg) == -1) goto error;
if((slavefd = rb_cloexec_open(slavedevice, O_RDWR, 0)) == -1) goto error;
rb_update_max_fd(slavefd);
#if defined(I_PUSH) && !defined(__linux__) && !defined(_AIX)
- if(ioctl_I_PUSH(slavefd, "ptem") == -1) goto error;
- if(ioctl_I_PUSH(slavefd, "ldterm") == -1) goto error;
- ioctl_I_PUSH(slavefd, "ttcompat");
+ if(ioctl(slavefd, I_PUSH, "ptem") == -1) goto error;
+ if(ioctl(slavefd, I_PUSH, "ldterm") == -1) goto error;
+ ioctl(slavefd, I_PUSH, "ttcompat");
#endif
*master = masterfd;
*slave = slavefd;
@@ -370,44 +363,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;
@@ -480,14 +503,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)
@@ -520,9 +535,8 @@ pty_open(VALUE klass)
}
static VALUE
-pty_detach_process(VALUE v)
+pty_detach_process(struct pty_info *info)
{
- struct pty_info *info = (void *)v;
#ifdef WNOHANG
int st;
if (rb_waitpid(info->child_pid, &st, WNOHANG) <= 0)
@@ -555,7 +569,7 @@ pty_detach_process(VALUE v)
*
* 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.
@@ -650,23 +664,15 @@ 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();
raise_from_check(cpid, status);
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
static VALUE cPTY;
@@ -681,7 +687,7 @@ static VALUE cPTY;
/*
* Document-class: PTY
*
- * Creates and manages pseudo terminals (PTYs). See also
+ * Creates and managed pseudo terminals (PTYs). See also
* http://en.wikipedia.org/wiki/Pseudo_terminal
*
* PTY allows you to allocate new terminals using ::open or ::spawn a new
@@ -717,7 +723,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
diff --git a/ext/racc/cparse/README b/ext/racc/cparse/README
index 550e8d49fe..7771108b84 100644
--- a/ext/racc/cparse/README
+++ b/ext/racc/cparse/README
@@ -7,5 +7,5 @@ your own parser, you must get Racc full package.
Get it from:
- http://i.loveruby.net/en/projects/racc
- - https://github.com/ruby/racc
+ - https://github.com/tenderlove/racc
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index ca74b80000..b4429ed5f3 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -11,7 +11,7 @@
*/
-#include <ruby.h>
+#include "ruby/ruby.h"
#ifndef FALSE
#define FALSE 0
@@ -24,7 +24,7 @@
Important Constants
----------------------------------------------------------------------- */
-#define RACC_VERSION "1.4.15"
+#define RACC_VERSION "1.4.5"
#define DEFAULT_TOKEN -1
#define ERROR_TOKEN 1
@@ -72,10 +72,6 @@ static ID id_d_e_pop;
# define LONG2NUM(i) INT2NUM(i)
#endif
-#ifndef HAVE_RB_ARY_SUBSEQ
-# define rb_ary_subseq(ary, beg, len) rb_ary_new4(len, RARRAY_PTR(ary) + beg)
-#endif
-
static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));
@@ -212,7 +208,7 @@ static void extract_user_token _((struct cparse_params *v,
VALUE block_args, VALUE *tok, VALUE *val));
static void shift _((struct cparse_params* v, long act, VALUE tok, VALUE val));
static int reduce _((struct cparse_params* v, long act));
-static rb_block_call_func reduce0;
+static VALUE reduce0 _((VALUE block_args, VALUE data, VALUE self));
#ifdef DEBUG
# define D_puts(msg) if (v->sys_debug) puts(msg)
@@ -708,7 +704,7 @@ reduce(struct cparse_params *v, long act)
}
static VALUE
-reduce0(RB_BLOCK_CALL_FUNC_ARGLIST(_, data))
+reduce0(VALUE val, VALUE data, VALUE self)
{
struct cparse_params *v = rb_check_typeddata(data, &cparse_params_type);
VALUE reduce_to, reduce_len, method_id;
diff --git a/ext/racc/cparse/depend b/ext/racc/cparse/depend
deleted file mode 100644
index a156b32343..0000000000
--- a/ext/racc/cparse/depend
+++ /dev/null
@@ -1,14 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-cparse.o: $(RUBY_EXTCONF_H)
-cparse.o: $(arch_hdrdir)/ruby/config.h
-cparse.o: $(hdrdir)/ruby.h
-cparse.o: $(hdrdir)/ruby/assert.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 47b455d992..3710f6f7e7 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,8 +1,5 @@
-# frozen_string_literal: false
-# $Id: a9187b5bc40e6adf05e7b6ee5b370b39a3429ecd $
+# $Id$
require 'mkmf'
-
-have_func('rb_ary_subseq')
-
+have_func('rb_block_call', 'ruby/ruby.h')
create_makefile 'racc/cparse'
diff --git a/ext/rbconfig/sizeof/depend b/ext/rbconfig/sizeof/depend
index 9433dd4156..1bcaa9c6f4 100644
--- a/ext/rbconfig/sizeof/depend
+++ b/ext/rbconfig/sizeof/depend
@@ -1,34 +1,10 @@
-# sources
-
-limits.c: $(top_srcdir)/tool/generic_erb.rb $(top_srcdir)/template/limits.c.tmpl
- $(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
+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/sizes.c.tmpl \
- $(top_srcdir)/configure.ac \
- $(top_srcdir)/ext/rbconfig/sizeof/extconf.rb
+ $(top_srcdir)/template/sizes.c.tmpl $(top_srcdir)/configure.in
# AUTOGENERATED DEPENDENCIES START
-limits.o: $(RUBY_EXTCONF_H)
-limits.o: $(arch_hdrdir)/ruby/config.h
-limits.o: $(hdrdir)/ruby/assert.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/assert.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
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/.gitignore b/ext/readline/.gitignore
deleted file mode 100644
index 3d372989ae..0000000000
--- a/ext/readline/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/readline-[1-9]*.*
diff --git a/ext/readline/depend b/ext/readline/depend
index 2dde7fca58..26777f2816 100644
--- a/ext/readline/depend
+++ b/ext/readline/depend
@@ -1,18 +1,17 @@
# AUTOGENERATED DEPENDENCIES START
readline.o: $(RUBY_EXTCONF_H)
readline.o: $(arch_hdrdir)/ruby/config.h
-readline.o: $(hdrdir)/ruby/assert.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: $(top_srcdir)/internal.h
readline.o: readline.c
# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index fcc62921ae..5cbcc0ef7d 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"])
@@ -59,7 +58,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
@@ -71,7 +70,6 @@ readline.have_func("rl_completion_matches")
readline.have_func("rl_refresh_line")
readline.have_var("rl_deprep_term_function")
readline.have_var("rl_completion_append_character")
-readline.have_var("rl_completion_quote_character")
readline.have_var("rl_basic_word_break_characters")
readline.have_var("rl_completer_word_break_characters")
readline.have_var("rl_basic_quote_characters")
@@ -82,11 +80,10 @@ 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/ !~ RUBY_PLATFORM && readline.have_var("rl_event_hook")
-/mswin|bccwin/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_sigwinch")
-/mswin|bccwin/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_signals")
+/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_event_hook")
+/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_sigwinch")
+/mswin|bccwin|mingw/ !~ RUBY_PLATFORM && readline.have_var("rl_catch_signals")
readline.have_var("rl_pre_input_hook")
readline.have_var("rl_special_prefixes")
readline.have_func("rl_cleanup_after_signal")
diff --git a/ext/readline/readline-ext.gemspec b/ext/readline/readline-ext.gemspec
deleted file mode 100644
index a611a8ea9a..0000000000
--- a/ext/readline/readline-ext.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-Gem::Specification.new do |spec|
- spec.name = "readline-ext"
- spec.version = "0.1.0"
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Provides an interface for GNU Readline and Edit Line (libedit).}
- spec.description = %q{Provides an interface for GNU Readline and Edit Line (libedit).}
- spec.homepage = "https://github.com/ruby/readline-ext"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 646be2b194..140bd7f578 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -33,6 +33,7 @@
#include <editline/readline.h>
#endif
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/thread.h"
@@ -57,11 +58,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
@@ -77,8 +74,6 @@ static ID id_special_prefixes;
#endif
#ifndef HAVE_RL_USERNAME_COMPLETION_FUNCTION
# define rl_username_completion_function username_completion_function
-#else
-char *rl_username_completion_function(const char *, int);
#endif
#ifndef HAVE_RL_COMPLETION_MATCHES
# define rl_completion_matches completion_matches
@@ -94,7 +89,7 @@ static char **readline_attempted_completion_function(const char *text,
int start, int end);
#define OutputStringValue(str) do {\
- StringValueCStr(str);\
+ SafeStringValue(str);\
(str) = rb_str_conv_enc((str), rb_enc_get(str), rb_locale_encoding());\
} while (0)\
@@ -137,13 +132,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
@@ -166,25 +154,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;
@@ -242,7 +229,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;
}
@@ -569,7 +557,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;
@@ -605,7 +594,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;
@@ -631,7 +621,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);
}
@@ -658,7 +649,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
@@ -689,17 +680,6 @@ readline_s_insert_text(VALUE self, VALUE str)
#endif
#if defined(HAVE_RL_DELETE_TEXT)
-int rl_delete_text(int, int);
-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
@@ -717,20 +697,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;
@@ -822,7 +803,7 @@ readline_s_redisplay(VALUE self)
*
* When working with auto-complete there are some strategies that work well.
* To get some ideas you can take a look at the
- * completion.rb[https://git.ruby-lang.org/ruby.git/tree/lib/irb/completion.rb]
+ * completion.rb[http://svn.ruby-lang.org/repos/ruby/trunk/lib/irb/completion.rb]
* file for irb.
*
* The common strategy is to take a list of possible completions and filter it
@@ -837,7 +818,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);
}
@@ -853,51 +835,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
@@ -1019,7 +956,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);
@@ -1029,7 +966,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);
@@ -1073,32 +1010,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:
@@ -1148,7 +1059,6 @@ readline_s_get_screen_size(VALUE self)
#endif
#ifdef HAVE_RL_VI_EDITING_MODE
-int rl_vi_editing_mode(int, int);
/*
* call-seq:
* Readline.vi_editing_mode -> nil
@@ -1187,7 +1097,6 @@ readline_s_vi_editing_mode_p(VALUE self)
#endif
#ifdef HAVE_RL_EMACS_EDITING_MODE
-int rl_emacs_editing_mode(int, int);
/*
* call-seq:
* Readline.emacs_editing_mode -> nil
@@ -1307,35 +1216,6 @@ readline_s_get_completion_append_character(VALUE self)
#define readline_s_get_completion_append_character rb_f_notimplement
#endif
-#ifdef HAVE_RL_COMPLETION_QUOTE_CHARACTER
-/*
- * call-seq:
- * Readline.completion_quote_character -> char
- *
- * When called during a completion (e.g. from within your completion_proc),
- * it will return a string containing the character used to quote the
- * argument being completed, or nil if the argument is unquoted.
- *
- * When called at other times, it will always return nil.
- *
- * Note that Readline.completer_quote_characters must be set,
- * or this method will always return nil.
- */
-static VALUE
-readline_s_get_completion_quote_character(VALUE self)
-{
- char buf[1];
-
- if (rl_completion_quote_character == '\0')
- return Qnil;
-
- buf[0] = (char) rl_completion_quote_character;
- return rb_locale_str_new(buf, 1);
-}
-#else
-#define readline_s_get_completion_quote_character rb_f_notimplement
-#endif
-
#ifdef HAVE_RL_BASIC_WORD_BREAK_CHARACTERS
/*
* call-seq:
@@ -1381,7 +1261,7 @@ readline_s_set_basic_word_break_characters(VALUE self, VALUE str)
* Raises NotImplementedError if the using readline library does not support.
*/
static VALUE
-readline_s_get_basic_word_break_characters(VALUE self)
+readline_s_get_basic_word_break_characters(VALUE self, VALUE str)
{
if (rl_basic_word_break_characters == NULL)
return Qnil;
@@ -1436,7 +1316,7 @@ readline_s_set_completer_word_break_characters(VALUE self, VALUE str)
* Raises NotImplementedError if the using readline library does not support.
*/
static VALUE
-readline_s_get_completer_word_break_characters(VALUE self)
+readline_s_get_completer_word_break_characters(VALUE self, VALUE str)
{
if (rl_completer_word_break_characters == NULL)
return Qnil;
@@ -1551,7 +1431,7 @@ readline_s_set_basic_quote_characters(VALUE self, VALUE str)
* Raises NotImplementedError if the using readline library does not support.
*/
static VALUE
-readline_s_get_basic_quote_characters(VALUE self)
+readline_s_get_basic_quote_characters(VALUE self, VALUE str)
{
if (rl_basic_quote_characters == NULL)
return Qnil;
@@ -1607,7 +1487,7 @@ readline_s_set_completer_quote_characters(VALUE self, VALUE str)
* Raises NotImplementedError if the using readline library does not support.
*/
static VALUE
-readline_s_get_completer_quote_characters(VALUE self)
+readline_s_get_completer_quote_characters(VALUE self, VALUE str)
{
if (rl_completer_quote_characters == NULL)
return Qnil;
@@ -1661,7 +1541,7 @@ readline_s_set_filename_quote_characters(VALUE self, VALUE str)
* Raises NotImplementedError if the using readline library does not support.
*/
static VALUE
-readline_s_get_filename_quote_characters(VALUE self)
+readline_s_get_filename_quote_characters(VALUE self, VALUE str)
{
if (rl_filename_quote_characters == NULL)
return Qnil;
@@ -1672,7 +1552,6 @@ readline_s_get_filename_quote_characters(VALUE self)
#endif
#ifdef HAVE_RL_REFRESH_LINE
-int rl_refresh_line(int, int);
/*
* call-seq:
* Readline.refresh_line -> nil
@@ -1790,7 +1669,7 @@ rb_remove_history(int index)
#else
rb_notimplement();
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
#endif
}
@@ -1918,11 +1797,6 @@ username_completion_proc_call(VALUE self, VALUE str)
return result;
}
-#ifdef HAVE_RL_CLEAR_SIGNALS
-int rl_clear_signals(void);
-#endif
-
-#undef rb_intern
void
Init_readline(void)
{
@@ -1942,7 +1816,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)
@@ -1951,9 +1824,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",
@@ -1966,10 +1836,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",
@@ -1996,8 +1862,6 @@ Init_readline(void)
readline_s_set_completion_append_character, 1);
rb_define_singleton_method(mReadline, "completion_append_character",
readline_s_get_completion_append_character, 0);
- rb_define_singleton_method(mReadline, "completion_quote_character",
- readline_s_get_completion_quote_character, 0);
rb_define_singleton_method(mReadline, "basic_word_break_characters=",
readline_s_set_basic_word_break_characters, 1);
rb_define_singleton_method(mReadline, "basic_word_break_characters",
@@ -2036,8 +1900,8 @@ Init_readline(void)
readline_s_get_special_prefixes, 0);
#if USE_INSERT_IGNORE_ESCAPE
- id_orig_prompt = rb_intern("orig_prompt");
- id_last_prompt = rb_intern("last_prompt");
+ CONST_ID(id_orig_prompt, "orig_prompt");
+ CONST_ID(id_last_prompt, "last_prompt");
#endif
history = rb_obj_alloc(rb_cObject);
@@ -2120,9 +1984,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
@@ -2133,9 +1994,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 69759ec716..64236cd592 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -1,6 +1,7 @@
GEN = $(srcdir)/tools/generate.rb
SRC1 = $(top_srcdir)/parse.y
SRC2 = $(srcdir)/eventids2.c
+BISON = bison
.SUFFIXES: .y
@@ -11,32 +12,27 @@ ripper.o: ripper.c
.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
static: check
-ripper.y: $(srcdir)/tools/preproc.rb $(srcdir)/tools/dsl.rb $(top_srcdir)/parse.y {$(VPATH)}id.h
+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/pure_parser.rb ripper.tmp.y $(BISON)
+ $(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: $(GEN) $(srcdir)/tools/dsl.rb $(SRC1)
+eventids1.c: $(srcdir)/tools/generate.rb $(SRC1)
$(ECHO) generating $@ from $(SRC1)
$(Q) $(RUBY) $(GEN) --mode=eventids1 --ids1src=$(SRC1) --output=$@
-eventids2table.c: $(GEN) $(srcdir)/tools/dsl.rb $(SRC2)
+eventids2table.c: $(srcdir)/tools/generate.rb $(SRC2)
$(ECHO) generating $@ from $(SRC2)
$(Q) $(RUBY) $(GEN) --mode=eventids2table --ids2src=$(SRC2) --output=$@
@@ -45,29 +41,28 @@ eventids2table.c: $(GEN) $(srcdir)/tools/dsl.rb $(SRC2)
preproc: ripper.E
ripper.E: ripper.c
$(ECHO) preprocessing ripper.c
- $(Q) $(CC) -E $(INCFLAGS) $(CPPFLAGS) $< | $(RUBY) $(srcdir)/tools/strip.rb > $@
+ $(Q) $(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@
# AUTOGENERATED DEPENDENCIES START
ripper.o: $(RUBY_EXTCONF_H)
ripper.o: $(arch_hdrdir)/ruby/config.h
-ripper.o: $(hdrdir)/ruby.h
-ripper.o: $(hdrdir)/ruby/assert.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: $(top_srcdir)/vm_opts.h
ripper.o: ../../probes.h
ripper.o: eventids2.c
ripper.o: ripper.y
@@ -76,6 +71,5 @@ 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
diff --git a/ext/ripper/eventids2.c b/ext/ripper/eventids2.c
index cdac2081e6..abbe584454 100644
--- a/ext/ripper/eventids2.c
+++ b/ext/ripper/eventids2.c
@@ -1,13 +1,12 @@
-enum {
- tIGNORED_NL = tLAST_TOKEN + 1,
- tCOMMENT,
- tEMBDOC_BEG,
- tEMBDOC,
- tEMBDOC_END,
- tHEREDOC_BEG,
- tHEREDOC_END,
- k__END__
-};
+#define tIGNORED_NL (tLAST_TOKEN + 1)
+#define tCOMMENT (tLAST_TOKEN + 2)
+#define tEMBDOC_BEG (tLAST_TOKEN + 3)
+#define tEMBDOC (tLAST_TOKEN + 4)
+#define tEMBDOC_END (tLAST_TOKEN + 5)
+#define tSP (tLAST_TOKEN + 6)
+#define tHEREDOC_BEG (tLAST_TOKEN + 7)
+#define tHEREDOC_END (tLAST_TOKEN + 8)
+#define k__END__ (tLAST_TOKEN + 9)
typedef struct {
ID ripper_id_backref;
@@ -128,178 +127,179 @@ ripper_init_eventids2(void)
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;
+} 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)},
+ {tSTRING_BEG, O(tstring_beg)},
+ {tSTRING_CONTENT, O(tstring_content)},
+ {tSTRING_DBEG, O(embexpr_beg)},
+ {tSTRING_DEND, O(embexpr_end)},
+ {tSTRING_DVAR, O(embvar)},
+ {tSTRING_END, O(tstring_end)},
+ {tSYMBEG, O(symbeg)},
+ {tUMINUS, O(op)},
+ {tUMINUS_NUM, O(op)},
+ {tUPLUS, O(op)},
+ {tWORDS_BEG, O(words_beg)},
+ {tXSTRING_BEG, O(backtick)},
+ {tLABEL, O(label)},
+ {tLABEL_END, O(label_end)},
+ {tLAMBDA, O(tlambda)},
+ {tLAMBEG, O(tlambeg)},
+
+ /* ripper specific tokens */
+ {tIGNORED_NL, O(ignored_nl)},
+ {tCOMMENT, O(comment)},
+ {tEMBDOC_BEG, O(embdoc_beg)},
+ {tEMBDOC, O(embdoc)},
+ {tEMBDOC_END, O(embdoc_end)},
+ {tSP, O(sp)},
+ {tHEREDOC_BEG, O(heredoc_beg)},
+ {tHEREDOC_END, O(heredoc_end)},
+ {k__END__, O(__end__)},
+};
static ID
-ripper_token2eventid(enum yytokentype tok)
+ripper_token2eventid(int tok)
{
-#define O(member) (int)offsetof(ripper_scanner_ids_t, ripper_id_##member)+1
- static const unsigned short offsets[] = {
- [' '] = 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),
- [tBDOT2] = O(op),
- [tBDOT3] = O(op),
- [tEQ] = O(op),
- [tEQQ] = O(op),
- [tFID] = O(ident),
- [tFLOAT] = O(float),
- [tGEQ] = O(op),
- [tGVAR] = O(gvar),
- [tIDENTIFIER] = O(ident),
- [tIMAGINARY] = O(imaginary),
- [tINTEGER] = O(int),
- [tIVAR] = O(ivar),
- [tLBRACE] = O(lbrace),
- [tLBRACE_ARG] = O(lbrace),
- ['{'] = O(lbrace),
- ['}'] = O(rbrace),
- [tLBRACK] = O(lbracket),
- ['['] = O(lbracket),
- [']'] = O(rbracket),
- [tLEQ] = O(op),
- [tLPAREN] = O(lparen),
- [tLPAREN_ARG] = O(lparen),
- ['('] = O(lparen),
- [')'] = O(rparen),
- [tLSHFT] = O(op),
- [tMATCH] = O(op),
- [tNEQ] = O(op),
- [tNMATCH] = O(op),
- [tNTH_REF] = O(backref),
- [tOP_ASGN] = O(op),
- [tOROP] = O(op),
- [tPOW] = O(op),
- [tQWORDS_BEG] = O(qwords_beg),
- [tQSYMBOLS_BEG] = O(qsymbols_beg),
- [tSYMBOLS_BEG] = O(symbols_beg),
- [tRATIONAL] = O(rational),
- [tREGEXP_BEG] = O(regexp_beg),
- [tREGEXP_END] = O(regexp_end),
- [tRPAREN] = O(rparen),
- [tRSHFT] = O(op),
- [tSTAR] = O(op),
- [tDSTAR] = O(op),
- [tANDDOT] = O(op),
- [tSTRING_BEG] = O(tstring_beg),
- [tSTRING_CONTENT] = O(tstring_content),
- [tSTRING_DBEG] = O(embexpr_beg),
- [tSTRING_DEND] = O(embexpr_end),
- [tSTRING_DVAR] = O(embvar),
- [tSTRING_END] = O(tstring_end),
- [tSYMBEG] = O(symbeg),
- [tUMINUS] = O(op),
- [tUMINUS_NUM] = O(op),
- [tUPLUS] = O(op),
- [tWORDS_BEG] = O(words_beg),
- [tXSTRING_BEG] = O(backtick),
- [tLABEL] = O(label),
- [tLABEL_END] = O(label_end),
- [tLAMBDA] = O(tlambda),
- [tLAMBEG] = O(tlambeg),
-
- /* ripper specific tokens */
- [tIGNORED_NL] = 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__),
- };
-#undef O
+ int i;
- int i = (int)tok;
- if (i >= 0 && i < numberof(offsets) && (i = offsets[i]) > 0) {
- return *(const ID *)((const char *)&ripper_scanner_ids-1+i);
+ for (i = 0; i < numberof(token_to_eventid); i++) {
+ const struct token_assoc *const a = &token_to_eventid[i];
+ if (a->token == tok)
+ return *(const ID *)((const char *)&ripper_scanner_ids + a->id_offset);
}
- /* 128..256 are used as operator tokens */
- if (tok < 128) {
+ if (tok < 256) {
return ripper_scanner_ids.ripper_id_CHAR;
}
rb_raise(rb_eRuntimeError, "[Ripper FATAL] unknown token %d", tok);
- UNREACHABLE_RETURN(0);
+ UNREACHABLE;
}
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
index 2dde565bd9..db54e5ca2a 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -1,26 +1,21 @@
#!ruby -s
-# frozen_string_literal: true
require 'mkmf'
require 'rbconfig'
def main
- yacc = ENV["YACC"] || "bison"
-
- unless find_executable(yacc)
+ unless find_executable('bison')
unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
raise 'missing bison; abort'
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)'
$INCFLAGS << ' -I$(topdir) -I$(top_srcdir)'
- create_makefile 'ripper' do |conf|
- conf << "BISON = #{yacc}"
- end
+ create_makefile 'ripper'
end
main
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 fa075da5b9..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,23 +29,16 @@ class Ripper
private
- # :stopdoc:
- 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
- # :startdoc:
-
#
# 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.
@@ -68,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 9f613c3475..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,166 +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", FNAME ],
- # [[1, 3], :on_sp, " ", FNAME ],
- # [[1, 4], :on_ident, "m", ENDFN ],
- # [[1, 5], :on_lparen, "(", BEG|LABEL],
- # [[1, 6], :on_ident, "a", ARG ],
- # [[1, 7], :on_rparen, ")", ENDFN ],
- # [[1, 8], :on_sp, " ", BEG ],
- # [[1, 9], :on_kw, "nil", END ],
- # [[1, 12], :on_sp, " ", END ],
- # [[1, 13], :on_kw, "end", 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
- alias inspect to_s
- 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, :message) do
- def initialize(pos, event, tok, state, message = nil)
- super(pos, event, tok, State.new(state), message)
- end
-
- def inspect
- "#<#{self.class}: #{event}@#{pos[0]}:#{pos[1]}:#{state}: #{tok.inspect}#{": " if message}#{message}>"
- end
-
- def pretty_print(q)
- q.group(2, "#<#{self.class}:", ">") {
- q.breakable
- q.text("#{event}@#{pos[0]}:#{pos[1]}")
- q.breakable
- q.text(state)
- q.breakable
- q.text("token: ")
- tok.pretty_print(q)
- if message
- q.breakable
- q.text("message: ")
- q.text(message)
- end
- }
- end
-
- def to_a
- a = super
- a.pop unless a.last
- a
- end
- end
-
- attr_reader :errors
-
def tokenize
- parse().sort_by(&:pos).map(&:tok)
+ lex().map {|pos, event, tok| tok }
end
def lex
- parse().sort_by(&:pos).map(&:to_a)
- end
-
- # parse the code and returns elements including errors.
- def scan
- result = (parse() + errors + @stack.flatten).uniq.sort_by {|e| [*e.pos, (e.message ? -1 : 0)]}
- result.each_with_index do |e, i|
- if e.event == :on_parse_error and e.tok.empty? and (pre = result[i-1]) and
- pre.pos[0] == e.pos[0] and (pre.pos[1] + pre.tok.size) == e.pos[1]
- e.tok = pre.tok
- e.pos[1] = pre.pos[1]
- result[i-1] = e
- result[i] = pre
- end
- end
- result
+ parse().sort_by {|pos, event, tok| pos }
end
def parse
- @errors = []
@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.push 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
-
- def on_error(mesg)
- @errors.push Elem.new([lineno(), column()], __callee__, token(), state(), mesg)
- end
- alias on_parse_error on_error
- alias compile_error on_error
-
- (SCANNER_EVENTS.map {|event|:"on_#{event}"} - private_instance_methods(false)).each do |event|
- alias_method event, :_push_token
+ End
end
end
@@ -244,7 +127,7 @@ class Ripper
if m = /[^\w\s$()\[\]{}?*+\.]/.match(pattern)
raise CompileError, "invalid char in pattern: #{m[0].inspect}"
end
- buf = +''
+ buf = ''
pattern.scan(/(?:\w+|\$\(|[()\[\]\{\}?*+\.]+)/) do |tok|
case tok
when /\w/
@@ -265,14 +148,14 @@ class Ripper
end
def map_tokens(tokens)
- tokens.map {|pos,type,str| map_token(type.to_s.delete_prefix('on_')) }.join
+ tokens.map {|pos,type,str| map_token(type.to_s.sub(/\Aon_/,'')) }.join
end
MAP = {}
seed = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
SCANNER_EVENT_TABLE.each do |ev, |
raise CompileError, "[RIPPER FATAL] too many system token" if seed.empty?
- MAP[ev.to_s.delete_prefix('on_')] = seed.shift
+ MAP[ev.to_s.sub(/\Aon_/,'')] = seed.shift
end
def map_token(tok)
diff --git a/ext/ripper/lib/ripper/sexp.rb b/ext/ripper/lib/ripper/sexp.rb
index e71d52cd45..150c6f0cf8 100644
--- a/ext/ripper/lib/ripper/sexp.rb
+++ b/ext/ripper/lib/ripper/sexp.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# $Id$
#
@@ -25,7 +24,7 @@ class Ripper
# #=> [:program,
# [[:def,
# [:@ident, "m", [1, 4]],
- # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil, nil, nil]],
+ # [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil]],
# [:bodystmt, [[:var_ref, [:@kw, "nil", [1, 9]]]], nil, nil, nil]]]]
#
def Ripper.sexp(src, filename = '-', lineno = 1)
@@ -60,38 +59,45 @@ class Ripper
sexp unless builder.error?
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 +115,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/dsl.rb b/ext/ripper/tools/dsl.rb
deleted file mode 100644
index d2b9715a71..0000000000
--- a/ext/ripper/tools/dsl.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-# Simple DSL implementation for Ripper code generation
-#
-# input: /*% ripper: stmts_add(stmts_new, void_stmt) %*/
-# output:
-# VALUE v1, v2;
-# v1 = dispatch0(stmts_new);
-# v2 = dispatch0(void_stmt);
-# $$ = dispatch2(stmts_add, v1, v2);
-
-class DSL
- def initialize(code, options)
- @events = {}
- @error = options.include?("error")
- @brace = options.include?("brace")
- if options.include?("final")
- @final = "p->result"
- else
- @final = (options.grep(/\A\$(?:\$|\d+)\z/)[0] || "$$")
- end
- @vars = 0
-
- # create $1 == "$1", $2 == "$2", ...
- s = (1..20).map {|n| "$#{n}"}
- re = Array.new(s.size, "([^\0]+)")
- /#{re.join("\0")}/ =~ s.join("\0")
-
- # struct parser_params *p
- p = p = "p"
-
- @code = ""
- @last_value = eval(code)
- end
-
- attr_reader :events
-
- undef lambda
- undef hash
- undef class
-
- def generate
- s = "#@code#@final=#@last_value;"
- s = "{VALUE #{ (1..@vars).map {|v| "v#{ v }" }.join(",") };#{ s }}" if @vars > 0
- s << "ripper_error(p);" if @error
- s = "{#{ s }}" if @brace
- "\t\t\t#{s}"
- end
-
- def new_var
- "v#{ @vars += 1 }"
- end
-
- def opt_event(event, default, addend)
- add_event(event, [default, addend], true)
- end
-
- def add_event(event, args, qundef_check = false)
- event = event.to_s.sub(/!\z/, "")
- @events[event] = args.size
- vars = []
- args.each do |arg|
- vars << v = new_var
- @code << "#{ v }=#{ arg };"
- end
- v = new_var
- d = "dispatch#{ args.size }(#{ [event, *vars].join(",") })"
- d = "#{ vars.last }==Qundef ? #{ vars.first } : #{ d }" if qundef_check
- @code << "#{ v }=#{ d };"
- v
- end
-
- def method_missing(event, *args)
- if event.to_s =~ /!\z/
- add_event(event, args)
- elsif args.empty? and /\Aid[A-Z_]/ =~ event.to_s
- event
- else
- "#{ event }(#{ args.join(", ") })"
- end
- end
-
- def self.const_missing(name)
- name
- end
-end
-
diff --git a/ext/ripper/tools/generate-param-macros.rb b/ext/ripper/tools/generate-param-macros.rb
index f0de55a5f2..b19f6e8d5c 100644..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 883e6ef2df..06b57101d1 100644..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,7 +67,7 @@ def usage(msg)
end
def generate_eventids1(ids)
- buf = "".dup
+ buf = ""
buf << %Q[static struct {\n]
ids.each do |id, arity|
buf << %Q[ ID id_#{id};\n]
@@ -101,7 +100,7 @@ def generate_eventids1(ids)
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]
@@ -135,8 +134,6 @@ def check_arity(h)
abort if invalid
end
-require_relative "dsl"
-
def read_ids1_with_locations(path)
h = {}
File.open(path) {|f|
@@ -146,13 +143,6 @@ def read_ids1_with_locations(path)
line.scan(/\bdispatch(\d)\((\w+)/) do |arity, event|
(h[event] ||= []).push [f.lineno, arity.to_i]
end
- if line =~ %r</\*% *ripper(?:\[(.*?)\])?: *(.*?) *%\*/>
- gen = DSL.new($2, ($1 || "").split(","))
- gen.generate
- gen.events.each do |event, arity|
- (h[event] ||= []).push [f.lineno, arity.to_i]
- end
- end
end
}
h
diff --git a/ext/ripper/tools/preproc.rb b/ext/ripper/tools/preproc.rb
index 7639a901df..06397cea05 100644..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,10 +39,14 @@ def main
end
def prelude(f, out)
- @exprs = {}
- lex_state_def = false
while line = f.gets
case line
+ when %r</\*%%%\*/>
+ out << '/*' << $/
+ when %r</\*%>
+ out << '*/' << $/
+ when %r<%\*/>
+ out << $/
when /\A%%/
out << '%%' << $/
return
@@ -51,37 +54,21 @@ def prelude(f, out)
out << line.sub(/<\w+>/, '<val>')
when /\A%type/
out << line.sub(/<\w+>/, '<val>')
- when /^enum lex_state_(?:bits|e) \{/
- lex_state_def = true
- out << line
- when /^\}/
- lex_state_def = false
- out << line
else
out << line
end
- if lex_state_def
- 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
end
end
-require_relative "dsl"
-
def grammar(f, out)
while line = f.gets
case line
- when %r</\*% *ripper(?:\[(.*?)\])?: *(.*?) *%\*/>
- out << DSL.new($2, ($1 || "").split(",")).generate << $/
when %r</\*%%%\*/>
out << '#if 0' << $/
+ when %r</\*%c%\*/>
+ out << '/*' << $/
+ when %r</\*%c>
+ out << '*/' << $/
when %r</\*%>
out << '#endif' << $/
when %r<%\*/>
@@ -96,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 100644..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/depend b/ext/rubyvm/depend
deleted file mode 100644
index 0301ce074c..0000000000
--- a/ext/rubyvm/depend
+++ /dev/null
@@ -1,2 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-# AUTOGENERATED DEPENDENCIES END
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 e9bde2f299..0000000000
--- a/ext/rubyvm/lib/forwardable/impl.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# :stopdoc:
-module Forwardable
- 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)
- .eval
- end
-end
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index 3a42b0e569..d810befbce 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -176,24 +176,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 +372,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 +399,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 +506,7 @@ getpage(register DBM *db, register long int hash)
while (dbit < db->maxbno && getdbit(db, dbit))
dbit = 2 * dbit + ((hash & ((long) 1 << hbit++)) ? 2 : 1);
- debug(("dbit: %ld...", dbit));
+ debug(("dbit: %d...", dbit));
db->curbit = dbit;
db->hmask = masks[hbit];
@@ -531,7 +531,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 +551,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 +572,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));
diff --git a/ext/sdbm/depend b/ext/sdbm/depend
index d475ecccef..b8f551369b 100644
--- a/ext/sdbm/depend
+++ b/ext/sdbm/depend
@@ -1,27 +1,19 @@
# AUTOGENERATED DEPENDENCIES START
_sdbm.o: $(RUBY_EXTCONF_H)
_sdbm.o: $(arch_hdrdir)/ruby/config.h
-_sdbm.o: $(hdrdir)/ruby/assert.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.h
-init.o: $(hdrdir)/ruby/assert.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
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 42292b99cd..901824c2a7 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -71,8 +71,6 @@ struct dbmdata {
DBM *di_dbm;
};
-NORETURN(static void closed_sdbm(void));
-
static void
closed_sdbm(void)
{
@@ -81,6 +79,7 @@ closed_sdbm(void)
#define GetDBM(obj, dbmp) do {\
TypedData_Get_Struct((obj), struct dbmdata, &sdbm_type, (dbmp));\
+ if ((dbmp) == 0) closed_sdbm();\
if ((dbmp)->di_dbm == 0) closed_sdbm();\
} while (0)
@@ -101,10 +100,12 @@ free_sdbm(void *ptr)
static size_t
memsize_dbm(const void *ptr)
{
+ size_t size = 0;
const struct dbmdata *dbmp = ptr;
- size_t size = sizeof(*dbmp);
- if (dbmp->di_dbm)
- size += sizeof(DBM);
+ if (dbmp) {
+ size += sizeof(*dbmp);
+ if (dbmp->di_dbm) size += sizeof(DBM);
+ }
return size;
}
@@ -147,6 +148,8 @@ fsdbm_closed(VALUE obj)
struct dbmdata *dbmp;
TypedData_Get_Struct(obj, struct dbmdata, &sdbm_type, dbmp);
+ if (dbmp == 0)
+ return Qtrue;
if (dbmp->di_dbm == 0)
return Qtrue;
@@ -156,9 +159,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 TypedData_Wrap_Struct(klass, &sdbm_type, 0);
}
/*
* call-seq:
@@ -178,12 +179,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 */
}
@@ -208,8 +209,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;
@@ -511,8 +512,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);
@@ -529,7 +529,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);
@@ -654,13 +654,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;
}
diff --git a/ext/sdbm/sdbm.gemspec b/ext/sdbm/sdbm.gemspec
deleted file mode 100644
index 6cf000b453..0000000000
--- a/ext/sdbm/sdbm.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-Gem::Specification.new do |s|
- s.name = "sdbm"
- s.version = '1.0.0'
- 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/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 84463af061..b69417e9db 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);
}
@@ -1130,17 +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;
- VALUE tmp;
- int controls_num;
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
VALUE controls_str = 0;
+ VALUE *controls_ptr = NULL;
int family;
#endif
int flags;
@@ -1148,22 +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);
- tmp = rb_str_tmp_frozen_acquire(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;
@@ -1238,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
@@ -1263,63 +1263,98 @@ bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
}
mh.msg_iovlen = 1;
mh.msg_iov = &iov;
- iov.iov_base = RSTRING_PTR(tmp);
- iov.iov_len = RSTRING_LEN(tmp);
+ iov.iov_base = RSTRING_PTR(data);
+ iov.iov_len = RSTRING_LEN(data);
#if defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
if (controls_str) {
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
- rb_str_tmp_frozen_release(data, tmp);
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
@@ -1447,18 +1482,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;
@@ -1466,20 +1501,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;
@@ -1489,7 +1531,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)
@@ -1514,18 +1556,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));
@@ -1548,26 +1598,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
@@ -1579,23 +1623,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 &&
@@ -1615,6 +1655,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);
@@ -1631,9 +1678,10 @@ bsock_recvmsg_internal(VALUE sock,
}
if (NIL_P(dat_str))
- dat_str = rb_str_new(datbuf, ss);
+ dat_str = rb_tainted_str_new(datbuf, ss);
else {
rb_str_resize(dat_str, ss);
+ OBJ_TAINT(dat_str);
rb_obj_reveal(dat_str, rb_cString);
}
@@ -1647,7 +1695,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)) {
@@ -1659,7 +1707,7 @@ bsock_recvmsg_internal(VALUE sock,
}
ctl_end = (char*)cmh + cmh->cmsg_len;
clen = (ctl_end <= msg_end ? ctl_end : msg_end) - (char*)CMSG_DATA(cmh);
- ctl = ancdata_new(family, cmh->cmsg_level, cmh->cmsg_type, rb_str_new((char*)CMSG_DATA(cmh), clen));
+ ctl = ancdata_new(family, cmh->cmsg_level, cmh->cmsg_type, rb_tainted_str_new((char*)CMSG_DATA(cmh), clen));
if (request_scm_rights)
make_io_for_unix_rights(ctl, cmh, msg_end);
else
@@ -1675,21 +1723,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
@@ -1730,7 +1839,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 fb5beed81a..54559779cf 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -158,10 +158,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 +213,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 +245,7 @@ bsock_setsockopt(int argc, VALUE *argv, VALUE sock)
return INT2FIX(0);
}
+#if !defined(__BEOS__)
/*
* Document-method: getsockopt
* call-seq:
@@ -310,22 +312,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't set len for boolean options */
- len = sizeof(int);
- }
-#endif
buf = ALLOCA_N(char,len);
rb_io_check_closed(fptr);
@@ -335,6 +325,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 +535,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 +547,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 +570,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 +592,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 +615,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 +624,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 +638,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);
}
/*
@@ -672,7 +698,7 @@ bsock_recv_nonblock(VALUE sock, VALUE len, VALUE flg, VALUE str, VALUE ex)
* BasicSocket.do_not_reverse_lookup #=> false
*/
static VALUE
-bsock_do_not_rev_lookup(VALUE _)
+bsock_do_not_rev_lookup(void)
{
return rsock_do_not_reverse_lookup?Qtrue:Qfalse;
}
@@ -729,29 +755,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 1bbb53b173..bab27b23bb 100644
--- a/ext/socket/constants.c
+++ b/ext/socket/constants.c
@@ -22,12 +22,13 @@ 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))) {
arg = tmp;
str:
+ rb_check_safe_obj(arg);
ptr = RSTRING_PTR(arg);
if (str_to_int(ptr, RSTRING_LEN(arg), &ret) == -1)
rb_raise(rb_eSocket, "%s: %s", errmsg, ptr);
diff --git a/ext/socket/depend b/ext/socket/depend
index e958b3dc5d..30ecfc5b52 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,32 +1,25 @@
-srcs: constdefs.h constdefs.c
-
-getnameinfo.o: getnameinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h rubysocket.h
+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.h
-ancdata.o: $(hdrdir)/ruby/assert.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
@@ -34,21 +27,18 @@ ancdata.o: rubysocket.h
ancdata.o: sockport.h
basicsocket.o: $(RUBY_EXTCONF_H)
basicsocket.o: $(arch_hdrdir)/ruby/config.h
-basicsocket.o: $(hdrdir)/ruby.h
-basicsocket.o: $(hdrdir)/ruby/assert.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
@@ -56,21 +46,18 @@ basicsocket.o: rubysocket.h
basicsocket.o: sockport.h
constants.o: $(RUBY_EXTCONF_H)
constants.o: $(arch_hdrdir)/ruby/config.h
-constants.o: $(hdrdir)/ruby.h
-constants.o: $(hdrdir)/ruby/assert.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
@@ -79,21 +66,18 @@ constants.o: rubysocket.h
constants.o: sockport.h
ifaddr.o: $(RUBY_EXTCONF_H)
ifaddr.o: $(arch_hdrdir)/ruby/config.h
-ifaddr.o: $(hdrdir)/ruby.h
-ifaddr.o: $(hdrdir)/ruby/assert.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
@@ -101,21 +85,18 @@ ifaddr.o: rubysocket.h
ifaddr.o: sockport.h
init.o: $(RUBY_EXTCONF_H)
init.o: $(arch_hdrdir)/ruby/config.h
-init.o: $(hdrdir)/ruby.h
-init.o: $(hdrdir)/ruby/assert.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
@@ -123,21 +104,18 @@ init.o: rubysocket.h
init.o: sockport.h
ipsocket.o: $(RUBY_EXTCONF_H)
ipsocket.o: $(arch_hdrdir)/ruby/config.h
-ipsocket.o: $(hdrdir)/ruby.h
-ipsocket.o: $(hdrdir)/ruby/assert.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
@@ -145,21 +123,18 @@ ipsocket.o: rubysocket.h
ipsocket.o: sockport.h
option.o: $(RUBY_EXTCONF_H)
option.o: $(arch_hdrdir)/ruby/config.h
-option.o: $(hdrdir)/ruby.h
-option.o: $(hdrdir)/ruby/assert.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
@@ -167,21 +142,18 @@ option.o: rubysocket.h
option.o: sockport.h
raddrinfo.o: $(RUBY_EXTCONF_H)
raddrinfo.o: $(arch_hdrdir)/ruby/config.h
-raddrinfo.o: $(hdrdir)/ruby.h
-raddrinfo.o: $(hdrdir)/ruby/assert.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
@@ -189,21 +161,18 @@ raddrinfo.o: rubysocket.h
raddrinfo.o: sockport.h
socket.o: $(RUBY_EXTCONF_H)
socket.o: $(arch_hdrdir)/ruby/config.h
-socket.o: $(hdrdir)/ruby.h
-socket.o: $(hdrdir)/ruby/assert.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
@@ -211,21 +180,18 @@ socket.o: socket.c
socket.o: sockport.h
sockssocket.o: $(RUBY_EXTCONF_H)
sockssocket.o: $(arch_hdrdir)/ruby/config.h
-sockssocket.o: $(hdrdir)/ruby.h
-sockssocket.o: $(hdrdir)/ruby/assert.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
@@ -233,21 +199,18 @@ sockssocket.o: sockport.h
sockssocket.o: sockssocket.c
tcpserver.o: $(RUBY_EXTCONF_H)
tcpserver.o: $(arch_hdrdir)/ruby/config.h
-tcpserver.o: $(hdrdir)/ruby.h
-tcpserver.o: $(hdrdir)/ruby/assert.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
@@ -255,21 +218,18 @@ tcpserver.o: sockport.h
tcpserver.o: tcpserver.c
tcpsocket.o: $(RUBY_EXTCONF_H)
tcpsocket.o: $(arch_hdrdir)/ruby/config.h
-tcpsocket.o: $(hdrdir)/ruby.h
-tcpsocket.o: $(hdrdir)/ruby/assert.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
@@ -277,21 +237,18 @@ tcpsocket.o: sockport.h
tcpsocket.o: tcpsocket.c
udpsocket.o: $(RUBY_EXTCONF_H)
udpsocket.o: $(arch_hdrdir)/ruby/config.h
-udpsocket.o: $(hdrdir)/ruby.h
-udpsocket.o: $(hdrdir)/ruby/assert.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
@@ -299,21 +256,18 @@ udpsocket.o: sockport.h
udpsocket.o: udpsocket.c
unixserver.o: $(RUBY_EXTCONF_H)
unixserver.o: $(arch_hdrdir)/ruby/config.h
-unixserver.o: $(hdrdir)/ruby.h
-unixserver.o: $(hdrdir)/ruby/assert.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
@@ -321,21 +275,18 @@ unixserver.o: sockport.h
unixserver.o: unixserver.c
unixsocket.o: $(RUBY_EXTCONF_H)
unixsocket.o: $(arch_hdrdir)/ruby/config.h
-unixsocket.o: $(hdrdir)/ruby.h
-unixsocket.o: $(hdrdir)/ruby/assert.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
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 1a67e0013e..6d15bbac6e 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
@@ -433,18 +432,22 @@ end
case RUBY_PLATFORM
when /mswin(32|64)|mingw/
test_func = "WSACleanup"
- have_library("iphlpapi")
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
have_library("socket", "socket(0,0,0)", headers) # SunOS
- have_library("anl", 'getaddrinfo_a', headers)
end
if have_func(test_func, headers)
@@ -478,7 +481,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,10 +508,9 @@ EOF
unless have_func("gethostname((char *)0, 0)", headers)
have_func("uname((struct utsname *)NULL)", headers)
end
- have_func("getaddrinfo_a", headers)
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"
@@ -566,16 +567,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)
- 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 = :wide
end
+ else
+ getaddr_info_ok = :wide
+ end
+ when false
+ 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 = nil
+ end
+ else
+ getaddr_info_ok = nil
end
else
raise "unexpected enable_config() value"
@@ -648,7 +662,7 @@ EOS
if enable_config("socks", ENV["SOCKS_SERVER"])
if have_library("socks5", "SOCKSinit")
$defs << "-DSOCKS5" << "-DSOCKS"
- elsif have_library("socksd", "Rconnect") || have_library("socks", "Rconnect")
+ elsif have_library("socks", "Rconnect")
$defs << "-DSOCKS"
end
end
@@ -658,7 +672,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 ce6dc40478..68f610e807 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>
@@ -149,7 +150,6 @@ static int get_addr __P((const char *, int, struct addrinfo **,
struct addrinfo *, int));
static int str_isnumber __P((const char *));
-#ifndef HAVE_GAI_STRERROR
static const char *const ai_errlist[] = {
"success.",
"address family for hostname not supported.", /* EAI_ADDRFAMILY */
@@ -167,7 +167,6 @@ static const char *const ai_errlist[] = {
"resolved protocol is unknown.", /* EAI_PROTOCOL */
"unknown error.", /* EAI_MAX */
};
-#endif
#define GET_CANONNAME(ai, str) \
if (pai->ai_flags & AI_CANONNAME) {\
@@ -437,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);
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 94a5eb9439..c238c8e501 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
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 0675194d74..4d7cf29ea3 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -10,10 +10,6 @@
#include "rubysocket.h"
-#ifdef _WIN32
-VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
-#endif
-
VALUE rb_cBasicSocket;
VALUE rb_cIPSocket;
VALUE rb_cTCPSocket;
@@ -33,25 +29,14 @@ 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
-#ifdef _WIN32
- rb_encoding *enc = rb_default_internal_encoding();
- VALUE msg = rb_sprintf("%s: ", reason);
- if (!enc) enc = rb_default_internal_encoding();
- rb_str_concat(msg, rb_w32_conv_from_wchar(gai_strerrorW(error), enc));
- rb_exc_raise(rb_exc_new_str(rb_eSocket, msg));
-#else
rb_raise(rb_eSocket, "%s: %s", reason, gai_strerror(error));
-#endif
}
#ifdef _WIN32
@@ -68,19 +53,14 @@ is_socket(int fd)
}
#endif
-#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
-
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");
+ errno = EBADF;
+ rb_sys_fail("not a socket file descriptor");
}
rb_update_max_fd(fd);
@@ -101,10 +81,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
@@ -112,10 +90,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 {
@@ -138,48 +114,21 @@ recvfrom_blocking(void *data)
return (VALUE)ret;
}
-static VALUE
-rsock_strbuf(VALUE str, long buflen)
-{
- long len;
-
- if (NIL_P(str)) return rb_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)) {
@@ -187,20 +136,27 @@ 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);
switch (from) {
case RECV_RECV:
return str;
@@ -227,21 +183,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.
@@ -255,32 +214,29 @@ 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);
switch (from) {
case RECV_RECV:
return str;
@@ -300,115 +256,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;
-
- 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)
{
@@ -432,7 +279,7 @@ rsock_socket0(int domain, int type, int proto)
static int cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */
if (cloexec_state > 0) { /* common path, if SOCK_CLOEXEC is defined */
- ret = socket(domain, type|SOCK_CLOEXEC|RSOCK_NONBLOCK_DEFAULT, proto);
+ ret = socket(domain, type|SOCK_CLOEXEC, proto);
if (ret >= 0) {
if (ret <= 2)
goto fix_cloexec;
@@ -440,7 +287,7 @@ rsock_socket0(int domain, int type, int proto)
}
}
else if (cloexec_state < 0) { /* usually runs once only for detection */
- ret = socket(domain, type|SOCK_CLOEXEC|RSOCK_NONBLOCK_DEFAULT, proto);
+ ret = socket(domain, type|SOCK_CLOEXEC, proto);
if (ret >= 0) {
cloexec_state = rsock_detect_cloexec(ret);
if (cloexec_state == 0 || ret <= 2)
@@ -463,9 +310,6 @@ rsock_socket0(int domain, int type, int proto)
return -1;
fix_cloexec:
rb_maygvl_fd_fix_cloexec(ret);
- if (RSOCK_NONBLOCK_DEFAULT) {
- rsock_make_fd_nonblock(ret);
- }
update_max_fd:
rb_update_max_fd(ret);
@@ -480,9 +324,6 @@ rsock_socket0(int domain, int type, int proto)
if (ret == -1)
return -1;
rb_fd_fix_cloexec(ret);
- if (RSOCK_NONBLOCK_DEFAULT) {
- rsock_make_fd_nonblock(ret);
- }
return ret;
}
@@ -495,7 +336,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);
}
}
@@ -511,30 +353,11 @@ wait_connectable(int fd)
int sockerr, revents;
socklen_t sockerrlen;
+ /* only to clear pending error */
sockerrlen = (socklen_t)sizeof(sockerr);
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr, &sockerrlen) < 0)
return -1;
- /* necessary for non-blocking sockets (at least ECONNREFUSED) */
- switch (sockerr) {
- case 0:
- break;
-#ifdef EALREADY
- case EALREADY:
-#endif
-#ifdef EISCONN
- case EISCONN:
-#endif
-#ifdef ECONNREFUSED
- case ECONNREFUSED:
-#endif
-#ifdef EHOSTUNREACH
- case EHOSTUNREACH:
-#endif
- errno = sockerr;
- return -1;
- }
-
/*
* Stevens book says, successful finish turn on RB_WAITFD_OUT and
* failure finish turn on both RB_WAITFD_IN and RB_WAITFD_OUT.
@@ -635,8 +458,8 @@ rsock_connect(int fd, const struct sockaddr *sockaddr, int len, int socks)
return status;
}
-void
-rsock_make_fd_nonblock(int fd)
+static void
+make_fd_nonblock(int fd)
{
int flags;
#ifdef F_GETFL
@@ -654,17 +477,13 @@ rsock_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;
#ifdef HAVE_ACCEPT4
static int try_accept4 = 1;
#endif
- if (RSOCK_NONBLOCK_DEFAULT) {
- nonblock = 1;
- }
if (address_len) len0 = *address_len;
#ifdef HAVE_ACCEPT4
if (try_accept4) {
@@ -672,21 +491,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) {
- rsock_make_fd_nonblock(ret);
- }
-#endif
if (address_len && len0 < *address_len) *address_len = len0;
return ret;
}
@@ -700,23 +509,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) {
- rsock_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:
@@ -725,13 +531,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);
}
@@ -745,7 +550,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
@@ -755,6 +560,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;
@@ -762,11 +568,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;
@@ -776,7 +580,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);
@@ -784,34 +588,15 @@ 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;
}
@@ -834,11 +619,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 a2cb6e0e12..16a83734bb 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -22,9 +22,8 @@ struct inetsock_arg
};
static VALUE
-inetsock_cleanup(VALUE v)
+inetsock_cleanup(struct inetsock_arg *arg)
{
- struct inetsock_arg *arg = (void *)v;
if (arg->remote.res) {
rb_freeaddrinfo(arg->remote.res);
arg->remote.res = 0;
@@ -40,26 +39,22 @@ inetsock_cleanup(VALUE v)
}
static VALUE
-init_inetsock_internal(VALUE v)
+init_inetsock_internal(struct inetsock_arg *arg)
{
- struct inetsock_arg *arg = (void *)v;
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;
@@ -101,11 +96,6 @@ init_inetsock_internal(VALUE v)
}
else {
if (lres) {
-#if !defined(_WIN32) && !defined(__CYGWIN__)
- status = 1;
- setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
- (char*)&status, (socklen_t)sizeof(status));
-#endif
status = bind(fd, lres->ai_addr, lres->ai_addrlen);
local = status;
syscall = "bind(2)";
@@ -198,43 +188,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
@@ -244,7 +197,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|
@@ -285,7 +238,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|
@@ -347,8 +300,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"
*
@@ -357,7 +308,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 */
@@ -376,7 +327,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 d756a32a5a..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,13 +72,13 @@ class Addrinfo
begin
yield sock
ensure
- sock.close
+ sock.close if !sock.closed?
end
else
sock
end
end
- protected :connect_internal
+ private :connect_internal
# :call-seq:
# addrinfo.connect_from([local_addr_args], [opts]) {|socket| ... }
@@ -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.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
@@ -223,8 +228,8 @@ class Addrinfo
# # #<Addrinfo: [::1]:80 TCP (:80)>
# # #<Addrinfo: [::1]:80 UDP (:80)>
#
- def self.foreach(nodename, service, family=nil, socktype=nil, protocol=nil, flags=nil, timeout: nil, &block)
- Addrinfo.getaddrinfo(nodename, service, family, socktype, protocol, flags, timeout: timeout).each(&block)
+ def self.foreach(nodename, service, family=nil, socktype=nil, protocol=nil, flags=nil, &block)
+ Addrinfo.getaddrinfo(nodename, service, family, socktype, protocol, flags).each(&block)
end
end
@@ -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])
@@ -606,7 +298,6 @@ class Socket < BasicSocket
# _opts_ may have following options:
#
# [:connect_timeout] specify the timeout in seconds.
- # [:resolv_timeout] specify the name resolution timeout in seconds.
#
# If a block is given, the block is called with the socket.
# The value of the block is returned.
@@ -620,26 +311,31 @@ class Socket < BasicSocket
# puts sock.read
# }
#
- def self.tcp(host, port, local_host = nil, local_port = nil, connect_timeout: nil, resolv_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)
end
- Addrinfo.foreach(host, port, nil, :STREAM, timeout: resolv_timeout) {|ai|
+ 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
@@ -647,7 +343,7 @@ class Socket < BasicSocket
ret = sock
break
}
- unless ret
+ if !ret
if last_error
raise last_error
else
@@ -658,7 +354,7 @@ class Socket < BasicSocket
begin
yield ret
ensure
- ret.close
+ ret.close if !ret.closed?
end
else
ret
@@ -682,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
@@ -690,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
@@ -710,7 +406,7 @@ class Socket < BasicSocket
s.listen(Socket::SOMAXCONN)
}
rescue Exception
- sockets.each(&:close)
+ sockets.each {|s| s.close }
raise
end
sockets
@@ -773,7 +469,7 @@ class Socket < BasicSocket
raise last_error
end
rescue Exception
- sockets.each(&:close)
+ sockets.each {|s| s.close }
raise
end
end
@@ -781,7 +477,7 @@ class Socket < BasicSocket
begin
yield sockets
ensure
- sockets.each(&:close)
+ sockets.each {|s| s.close if !s.closed? }
end
else
sockets
@@ -805,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
}
}
@@ -900,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)
@@ -943,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
@@ -971,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)
@@ -1049,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
@@ -1080,7 +781,7 @@ class Socket < BasicSocket
begin
yield sock
ensure
- sock.close
+ sock.close if !sock.closed?
end
else
sock
@@ -1104,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
@@ -1118,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
@@ -1166,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 620a5f60ff..59fcb17682 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'optparse'
require 'erb'
@@ -73,15 +72,7 @@ def each_name(pat)
}
end
-erb_new = lambda do |src, safe, trim|
- if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
- ERB.new(src, trim_mode: trim)
- else
- ERB.new(src, safe, trim)
- end
-end
-
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
% each_const {|guard, name, default_value|
#if !defined(<%=name%>)
# if defined(HAVE_CONST_<%=name.upcase%>)
@@ -95,7 +86,7 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
% }
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_defs_in_guard(name, default_value)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs_in_guard(name, default_value)")
#if defined(<%=name%>)
/* <%= COMMENTS[name] %> */
rb_define_const(rb_cSocket, <%=c_str name%>, INTEGER2NUM(<%=name%>));
@@ -104,7 +95,7 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_defs_in_guard(name
#endif
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
% each_const {|guard, name, default_value|
% if guard
#if <%=guard%>
@@ -154,7 +145,7 @@ def each_names_with_len(pat, prefix_optional=nil)
}
end
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int_decl(funcname, pat, prefix_optional, guard=nil)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int_decl(funcname, pat, prefix_optional, guard=nil)")
%if guard
#ifdef <%=guard%>
int <%=funcname%>(const char *str, long len, int *valp);
@@ -164,7 +155,7 @@ int <%=funcname%>(const char *str, long len, int *valp);
%end
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int_func_in_guard(funcname, pat, prefix_optional, guard=nil)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int_func_in_guard(funcname, pat, prefix_optional, guard=nil)")
int
<%=funcname%>(const char *str, long len, int *valp)
{
@@ -180,13 +171,12 @@ int
% }
default:
- if (!str || !valp) {/* wrong argument */}
return -1;
}
}
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int_func(funcname, pat, prefix_optional, guard=nil)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int_func(funcname, pat, prefix_optional, guard=nil)")
%if guard
#ifdef <%=guard%>
<%=gen_name_to_int_func_in_guard(funcname, pat, prefix_optional, guard)%>
@@ -215,7 +205,7 @@ def reverse_each_name_with_prefix_optional(pat, prefix_pat)
end
end
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_hash(hash_var, pat, prefix_pat)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_hash(hash_var, pat, prefix_pat)")
<%=hash_var%> = st_init_numtable();
% reverse_each_name_with_prefix_optional(pat, prefix_pat) {|n,s|
#ifdef <%=n%>
@@ -224,7 +214,7 @@ erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_hash(hash_va
% }
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_func(func_name, hash_var)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_func(func_name, hash_var)")
ID
<%=func_name%>(int val)
{
@@ -235,7 +225,7 @@ ID
}
EOS
-erb_new.call(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_decl(func_name, hash_var)")
+ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name_decl(func_name, hash_var)")
ID <%=func_name%>(int val);
EOS
@@ -284,7 +274,7 @@ def_intern('rsock_intern_udp_optname', /\AUDP_/, "UDP_")
def_intern('rsock_intern_scm_optname', /\ASCM_/, "SCM_")
def_intern('rsock_intern_local_optname', /\ALOCAL_/, "LOCAL_")
-result = erb_new.call(<<'EOS', nil, '%').result(binding)
+result = ERB.new(<<'EOS', nil, '%').result(binding)
/* autogenerated file */
<%= INTERN_DEFS.map {|vardef, gen_hash, decl, func| vardef }.join("\n") %>
@@ -327,7 +317,7 @@ init_constants(void)
EOS
-header_result = erb_new.call(<<'EOS', nil, '%').result(binding)
+header_result = ERB.new(<<'EOS', nil, '%').result(binding)
/* autogenerated file */
<%= gen_const_decls %>
<%= NAME_TO_INT_DEFS.map {|decl, func| decl }.join("\n") %>
diff --git a/ext/socket/option.c b/ext/socket/option.c
index 5ad44cdcd8..ebec81ad13 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>
*
@@ -309,10 +306,12 @@ sockopt_bool(VALUE self)
StringValue(data);
len = RSTRING_LEN(data);
if (len == 1) {
- return *RSTRING_PTR(data) == 0 ? Qfalse : Qtrue;
+ return *RSTRING_PTR(data) == 0 ? Qfalse : Qtrue;
}
- check_size(len, sizeof(int));
- memcpy((char*)&i, RSTRING_PTR(data), len);
+ if (len != sizeof(int))
+ rb_raise(rb_eTypeError, "size differ. expected as sizeof(int)=%d but %ld",
+ (int)sizeof(int), (long)len);
+ memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
return i == 0 ? Qfalse : Qtrue;
}
@@ -364,7 +363,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 +407,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
@@ -424,7 +425,7 @@ sockopt_ipv4_multicast_loop(VALUE self)
}
#endif
rb_raise(rb_eTypeError, "ipv4_multicast_loop socket option expected");
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
#define inspect_ipv4_multicast_loop(a,b,c,d) \
@@ -457,7 +458,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
@@ -475,7 +476,7 @@ sockopt_ipv4_multicast_ttl(VALUE self)
}
#endif
rb_raise(rb_eTypeError, "ipv4_multicast_ttl socket option expected");
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
#define inspect_ipv4_multicast_ttl(a,b,c,d) \
@@ -1249,7 +1250,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 +1476,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 9ec2fdc329..caa08fea47 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -145,34 +145,6 @@ ruby_getaddrinfo__darwin(const char *nodename, const char *servname,
#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__darwin((node),(serv),(hints),(res))
#endif
-#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
-
#ifndef GETADDRINFO_EMU
struct getaddrinfo_arg
{
@@ -199,27 +171,6 @@ nogvl_getaddrinfo(void *arg)
}
#endif
-#ifdef HAVE_GETADDRINFO_A
-struct gai_suspend_arg
-{
- struct gaicb *req;
- struct timespec *timeout;
-};
-
-static void *
-nogvl_gai_suspend(void *arg)
-{
- int ret;
- struct gai_suspend_arg *ptr = arg;
- struct gaicb const *wait_reqs[1];
-
- wait_reqs[0] = ptr->req;
- ret = gai_suspend(wait_reqs, 1, ptr->timeout);
-
- return (void *)(VALUE)ret;
-}
-#endif
-
static int
numeric_getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
@@ -230,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;
@@ -242,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;
@@ -339,59 +289,6 @@ rb_getaddrinfo(const char *node, const char *service,
return ret;
}
-#ifdef HAVE_GETADDRINFO_A
-int
-rb_getaddrinfo_a(const char *node, const char *service,
- const struct addrinfo *hints,
- struct rb_addrinfo **res, struct timespec *timeout)
-{
- struct addrinfo *ai;
- int ret;
- int allocated_by_malloc = 0;
-
- ret = numeric_getaddrinfo(node, service, hints, &ai);
- if (ret == 0)
- allocated_by_malloc = 1;
- else {
- struct gai_suspend_arg arg;
- struct gaicb *reqs[1];
- struct gaicb req;
-
- req.ar_name = node;
- req.ar_service = service;
- req.ar_request = hints;
-
- reqs[0] = &req;
- ret = getaddrinfo_a(GAI_NOWAIT, reqs, 1, NULL);
- if (ret) return ret;
-
- arg.req = &req;
- arg.timeout = timeout;
-
- ret = (int)(VALUE)rb_thread_call_without_gvl(nogvl_gai_suspend, &arg, RUBY_UBF_IO, 0);
-
- if (ret) {
- /* on Ubuntu 18.04 (or other systems), gai_suspend(3) returns EAI_SYSTEM/ENOENT on timeout */
- if (ret == EAI_SYSTEM && errno == ENOENT) {
- return EAI_AGAIN;
- } else {
- return ret;
- }
- }
-
- ret = gai_error(reqs[0]);
- ai = reqs[0]->ar_result;
- }
-
- if (ret == 0) {
- *res = (struct rb_addrinfo *)xmalloc(sizeof(struct rb_addrinfo));
- (*res)->allocated_by_malloc = allocated_by_malloc;
- (*res)->ai = ai;
- }
- return ret;
-}
-#endif
-
void
rb_freeaddrinfo(struct rb_addrinfo *ai)
{
@@ -491,19 +388,15 @@ str_is_number(const char *p)
char *ep;
if (!p || *p == '\0')
- return 0;
+ return 0;
ep = NULL;
(void)STRTOUL(p, &ep, 10);
if (ep && *ep == '\0')
- return 1;
+ return 1;
else
- return 0;
+ return 0;
}
-#define str_equal(ptr, len, name) \
- ((ptr)[0] == name[0] && \
- rb_strlen_lit(name) == (len) && memcmp(ptr, name, len) == 0)
-
static char*
host_str(VALUE host, char *hbuf, size_t hbuflen, int *flags_ptr)
{
@@ -518,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;
- StringValueCStr(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;
}
@@ -557,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;
- StringValueCStr(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;
}
}
@@ -585,7 +474,7 @@ rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_h
portp = port_str(port, pbuf, sizeof(pbuf), &additional_flags);
if (socktype_hack && hints->ai_socktype == 0 && str_is_number(portp)) {
- hints->ai_socktype = SOCK_DGRAM;
+ hints->ai_socktype = SOCK_DGRAM;
}
hints->ai_flags |= additional_flags;
@@ -600,62 +489,13 @@ rsock_getaddrinfo(VALUE host, VALUE port, struct addrinfo *hints, int socktype_h
return res;
}
-#ifdef HAVE_GETADDRINFO_A
-static struct rb_addrinfo*
-rsock_getaddrinfo_a(VALUE host, VALUE port, struct addrinfo *hints, int socktype_hack, VALUE timeout)
-{
- struct rb_addrinfo* res = NULL;
- char *hostp, *portp;
- int error;
- char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
- int additional_flags = 0;
-
- hostp = host_str(host, hbuf, sizeof(hbuf), &additional_flags);
- portp = port_str(port, pbuf, sizeof(pbuf), &additional_flags);
-
- if (socktype_hack && hints->ai_socktype == 0 && str_is_number(portp)) {
- hints->ai_socktype = SOCK_DGRAM;
- }
- hints->ai_flags |= additional_flags;
-
- if (NIL_P(timeout)) {
- error = rb_getaddrinfo(hostp, portp, hints, &res);
- } else {
- struct timespec _timeout = rb_time_timespec_interval(timeout);
- error = rb_getaddrinfo_a(hostp, portp, hints, &res, &_timeout);
- }
-
- if (error) {
- if (hostp && hostp[strlen(hostp)-1] == '\n') {
- rb_raise(rb_eSocket, "newline at the end of hostname");
- }
- rsock_raise_socket_error("getaddrinfo_a", error);
- }
-
- return res;
-}
-#endif
-
-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);
@@ -703,21 +543,16 @@ rsock_ipaddr(struct sockaddr *sockaddr, socklen_t sockaddrlen, int norevlookup)
}
#ifdef HAVE_SYS_UN_H
-static long
-unixsocket_len(const struct sockaddr_un *su, socklen_t socklen)
-{
- const char *s = su->sun_path, *e = (const char*)su + socklen;
- while (s < e && *(e-1) == '\0')
- e--;
- return e - s;
-}
-
VALUE
rsock_unixpath_str(struct sockaddr_un *sockaddr, socklen_t len)
{
- long n = unixsocket_len(sockaddr, len);
- if (n >= 0)
- return rb_str_new(sockaddr->sun_path, n);
+ char *s, *e;
+ s = sockaddr->sun_path;
+ e = (char *)sockaddr + len;
+ while (s < e && *(e-1) == '\0')
+ e--;
+ if (s <= e)
+ return rb_str_new(s, e-s);
else
return rb_str_new2("");
}
@@ -760,9 +595,8 @@ struct hostent_arg {
};
static VALUE
-make_hostent_internal(VALUE v)
+make_hostent_internal(struct hostent_arg *arg)
{
- struct hostent_arg *arg = (void *)v;
VALUE host = arg->host;
struct addrinfo* addr = arg->addr->ai;
VALUE (*ipaddr)(struct sockaddr*, socklen_t) = arg->ipaddr;
@@ -838,8 +672,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
@@ -847,7 +683,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 = {
@@ -923,7 +759,7 @@ rsock_addrinfo_new(struct sockaddr *addr, socklen_t len,
static struct rb_addrinfo *
call_getaddrinfo(VALUE node, VALUE service,
VALUE family, VALUE socktype, VALUE protocol, VALUE flags,
- int socktype_hack, VALUE timeout)
+ int socktype_hack)
{
struct addrinfo hints;
struct rb_addrinfo *res;
@@ -940,16 +776,7 @@ call_getaddrinfo(VALUE node, VALUE service,
if (!NIL_P(flags)) {
hints.ai_flags = NUM2INT(flags);
}
-
-#ifdef HAVE_GETADDRINFO_A
- if (NIL_P(timeout)) {
- res = rsock_getaddrinfo(node, service, &hints, socktype_hack);
- } else {
- res = rsock_getaddrinfo_a(node, service, &hints, socktype_hack, timeout);
- }
-#else
res = rsock_getaddrinfo(node, service, &hints, socktype_hack);
-#endif
if (res == NULL)
rb_raise(rb_eSocket, "host not found");
@@ -963,13 +790,13 @@ init_addrinfo_getaddrinfo(rb_addrinfo_t *rai, VALUE node, VALUE service,
VALUE family, VALUE socktype, VALUE protocol, VALUE flags,
VALUE inspectnode, VALUE inspectservice)
{
- struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 1, Qnil);
+ struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 1);
VALUE canonname;
VALUE inspectname = rb_str_equal(node, inspectnode) ? Qnil : make_inspectname(inspectnode, inspectservice, res->ai);
canonname = Qnil;
if (res->ai->ai_canonname) {
- canonname = rb_str_new_cstr(res->ai->ai_canonname);
+ canonname = rb_tainted_str_new_cstr(res->ai->ai_canonname);
OBJ_FREEZE(canonname);
}
@@ -1019,6 +846,8 @@ make_inspectname(VALUE node, VALUE service, struct addrinfo *res)
rb_str_catf(inspectname, ":%d", FIX2INT(service));
}
if (!NIL_P(inspectname)) {
+ OBJ_INFECT(inspectname, node);
+ OBJ_INFECT(inspectname, service);
OBJ_FREEZE(inspectname);
}
return inspectname;
@@ -1031,13 +860,13 @@ addrinfo_firstonly_new(VALUE node, VALUE service, VALUE family, VALUE socktype,
VALUE canonname;
VALUE inspectname;
- struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0, Qnil);
+ struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
inspectname = make_inspectname(node, service, res->ai);
canonname = Qnil;
if (res->ai->ai_canonname) {
- canonname = rb_str_new_cstr(res->ai->ai_canonname);
+ canonname = rb_tainted_str_new_cstr(res->ai->ai_canonname);
OBJ_FREEZE(canonname);
}
@@ -1051,13 +880,13 @@ addrinfo_firstonly_new(VALUE node, VALUE service, VALUE family, VALUE socktype,
}
static VALUE
-addrinfo_list_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE protocol, VALUE flags, VALUE timeout)
+addrinfo_list_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE protocol, VALUE flags)
{
VALUE ret;
struct addrinfo *r;
VALUE inspectname;
- struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0, timeout);
+ struct rb_addrinfo *res = call_getaddrinfo(node, service, family, socktype, protocol, flags, 0);
inspectname = make_inspectname(node, service, res->ai);
@@ -1067,7 +896,7 @@ addrinfo_list_new(VALUE node, VALUE service, VALUE family, VALUE socktype, VALUE
VALUE canonname = Qnil;
if (r->ai_canonname) {
- canonname = rb_str_new_cstr(r->ai_canonname);
+ canonname = rb_tainted_str_new_cstr(r->ai_canonname);
OBJ_FREEZE(canonname);
}
@@ -1104,12 +933,6 @@ init_unix_addrinfo(rb_addrinfo_t *rai, VALUE path, int socktype)
init_addrinfo(rai, (struct sockaddr *)&un, len,
PF_UNIX, socktype, 0, Qnil, Qnil);
}
-
-static long
-rai_unixsocket_len(const rb_addrinfo_t *rai)
-{
- return unixsocket_len(&rai->addr.un, rai->sockaddr_len);
-}
#endif
/*
@@ -1239,16 +1062,16 @@ addrinfo_initialize(int argc, VALUE *argv, VALUE self)
}
static int
-get_afamily(const struct sockaddr *addr, socklen_t len)
+get_afamily(struct sockaddr *addr, socklen_t len)
{
- if ((socklen_t)((const char*)&addr->sa_family + sizeof(addr->sa_family) - (char*)addr) <= len)
+ if ((socklen_t)((char*)&addr->sa_family + sizeof(addr->sa_family) - (char*)addr) <= len)
return addr->sa_family;
else
return AF_UNSPEC;
}
static int
-ai_get_afamily(const rb_addrinfo_t *rai)
+ai_get_afamily(rb_addrinfo_t *rai)
{
return get_afamily(&rai->addr.addr, rai->sockaddr_len);
}
@@ -1357,15 +1180,16 @@ rsock_inspect_sockaddr(struct sockaddr *sockaddr_arg, socklen_t socklen, VALUE r
{
struct sockaddr_un *addr = &sockaddr->un;
char *p, *s, *e;
- long len = unixsocket_len(addr, socklen);
s = addr->sun_path;
- if (len < 0)
+ e = (char*)addr + socklen;
+ while (s < e && *(e-1) == '\0')
+ e--;
+ if (e < s)
rb_str_cat2(ret, "too-short-AF_UNIX-sockaddr");
- else if (len == 0)
+ else if (s == e)
rb_str_cat2(ret, "empty-path-AF_UNIX-sockaddr");
else {
int printable_only = 1;
- e = s + len;
p = s;
while (p < e) {
printable_only = printable_only && ISPRINT(*p) && !ISSPACE(*p);
@@ -1691,7 +1515,13 @@ addrinfo_mdump(VALUE self)
#ifdef HAVE_SYS_UN_H
case AF_UNIX:
{
- sockaddr = rb_str_new(rai->addr.un.sun_path, rai_unixsocket_len(rai));
+ struct sockaddr_un *su = &rai->addr.un;
+ char *s, *e;
+ s = su->sun_path;
+ e = (char*)su + rai->sockaddr_len;
+ while (s < e && *(e-1) == '\0')
+ e--;
+ sockaddr = rb_str_new(s, e-s);
break;
}
#endif
@@ -1809,7 +1639,7 @@ addrinfo_mload(VALUE self, VALUE ary)
#endif
res = call_getaddrinfo(rb_ary_entry(pair, 0), rb_ary_entry(pair, 1),
INT2NUM(pfamily), INT2NUM(socktype), INT2NUM(protocol),
- INT2NUM(flags), 1, Qnil);
+ INT2NUM(flags), 1);
len = res->ai->ai_addrlen;
memcpy(&ss, res->ai->ai_addr, res->ai->ai_addrlen);
@@ -1906,6 +1736,7 @@ addrinfo_to_sockaddr(VALUE self)
rb_addrinfo_t *rai = get_addrinfo(self);
VALUE ret;
ret = rb_str_new((char*)&rai->addr, rai->sockaddr_len);
+ OBJ_INFECT(ret, self);
return ret;
}
@@ -2424,27 +2255,28 @@ addrinfo_unix_path(VALUE self)
rb_addrinfo_t *rai = get_addrinfo(self);
int family = ai_get_afamily(rai);
struct sockaddr_un *addr;
- long n;
+ char *s, *e;
if (family != AF_UNIX)
rb_raise(rb_eSocket, "need AF_UNIX address");
addr = &rai->addr.un;
- n = rai_unixsocket_len(rai);
- if (n < 0)
+ s = addr->sun_path;
+ e = (char*)addr + rai->sockaddr_len;
+ if (e < s)
rb_raise(rb_eSocket, "too short AF_UNIX address: %"PRIuSIZE" bytes given for minimum %"PRIuSIZE" bytes.",
- (size_t)rai->sockaddr_len, offsetof(struct sockaddr_un, sun_path));
- if ((long)sizeof(addr->sun_path) < n)
+ (size_t)rai->sockaddr_len, (size_t)(s - (char *)addr));
+ if (addr->sun_path + sizeof(addr->sun_path) < e)
rb_raise(rb_eSocket,
"too long AF_UNIX path (%"PRIuSIZE" bytes given but %"PRIuSIZE" bytes max)",
- (size_t)n, sizeof(addr->sun_path));
- return rb_str_new(addr->sun_path, n);
+ (size_t)(e - addr->sun_path), sizeof(addr->sun_path));
+ while (s < e && *(e-1) == '\0')
+ e--;
+ return rb_str_new(s, e-s);
}
#endif
-static ID id_timeout;
-
/*
* call-seq:
* Addrinfo.getaddrinfo(nodename, service, family, socktype, protocol, flags) => [addrinfo, ...]
@@ -2491,16 +2323,10 @@ static ID id_timeout;
static VALUE
addrinfo_s_getaddrinfo(int argc, VALUE *argv, VALUE self)
{
- VALUE node, service, family, socktype, protocol, flags, opts, timeout;
+ VALUE node, service, family, socktype, protocol, flags;
- rb_scan_args(argc, argv, "24:", &node, &service, &family, &socktype,
- &protocol, &flags, &opts);
- rb_get_kwargs(opts, &id_timeout, 0, 1, &timeout);
- if (timeout == Qundef) {
- timeout = Qnil;
- }
-
- return addrinfo_list_new(node, service, family, socktype, protocol, flags, timeout);
+ rb_scan_args(argc, argv, "24", &node, &service, &family, &socktype, &protocol, &flags);
+ return addrinfo_list_new(node, service, family, socktype, protocol, flags);
}
/*
@@ -2588,6 +2414,7 @@ addrinfo_s_unix(int argc, VALUE *argv, VALUE self)
addr = addrinfo_s_allocate(rb_cAddrinfo);
DATA_PTR(addr) = rai = alloc_addrinfo();
init_unix_addrinfo(rai, path, socktype);
+ OBJ_INFECT(addr, path);
return addr;
}
@@ -2671,7 +2498,7 @@ rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len)
rb_raise(rb_eTypeError, "neither IO nor file descriptor");
}
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
/*
@@ -2684,8 +2511,6 @@ rsock_init_addrinfo(void)
* The Addrinfo class maps <tt>struct addrinfo</tt> to ruby. This
* structure identifies an Internet host and a service.
*/
- id_timeout = rb_intern("timeout");
-
rb_cAddrinfo = rb_define_class("Addrinfo", rb_cData);
rb_define_alloc_func(rb_cAddrinfo, addrinfo_s_allocate);
rb_define_method(rb_cAddrinfo, "initialize", addrinfo_initialize, -1);
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index 0ce77a5f6e..84b971c04e 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -26,14 +26,12 @@
# if defined(_MSC_VER)
# undef HAVE_TYPE_STRUCT_SOCKADDR_DL
# endif
-/*
- * FIXME: failures if we make nonblocking the default
- * [ruby-core:89973] [ruby-core:89976] [ruby-core:89977] [Bug #14968]
- */
-# define RSOCK_NONBLOCK_DEFAULT (0)
#else
-# define RSOCK_NONBLOCK_DEFAULT (0)
-# 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>
@@ -82,9 +80,6 @@
#endif
#ifdef HAVE_IFADDRS_H
-# ifdef __HAIKU__
-# define _BSD_SOURCE
-# endif
# include <ifaddrs.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
@@ -224,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
@@ -232,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;
@@ -285,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;
@@ -295,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);
@@ -344,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,33 +401,17 @@ NORETURN(void rsock_sys_fail_raddrinfo_or_sockaddr(const char *, VALUE addr, VAL
* all cases. For some syscalls (e.g. accept/accept4), blocking on the
* syscall instead of relying on select/poll allows the kernel to use
* "wake-one" behavior and avoid the thundering herd problem.
- * This is likely safe on all other *nix-like systems, so this safe list
+ * This is likely safe on all other *nix-like systems, so this whitelist
* can be expanded by interested parties.
*/
#if defined(__linux__)
static inline int rsock_maybe_fd_writable(int fd) { return 1; }
static inline void rsock_maybe_wait_fd(int fd) { }
-# ifdef MSG_DONTWAIT
-# define MSG_DONTWAIT_RELIABLE 1
-# endif
#else /* some systems (mswin/mingw) need these. ref: r36946 */
# define rsock_maybe_fd_writable(fd) rb_thread_fd_writable((fd))
# define rsock_maybe_wait_fd(fd) rb_thread_wait_fd((fd))
#endif
-/*
- * some OSes may support MSG_DONTWAIT inconsistently depending on socket
- * type, we only expect Linux to support it consistently for all socket types.
- */
-#ifndef MSG_DONTWAIT_RELIABLE
-# define MSG_DONTWAIT_RELIABLE 0
-#endif
-
-VALUE rsock_read_nonblock(VALUE sock, VALUE length, VALUE buf, VALUE ex);
-VALUE rsock_write_nonblock(VALUE sock, VALUE buf, VALUE ex);
-
-void rsock_make_fd_nonblock(int fd);
-
#if !defined HAVE_INET_NTOP && ! defined _WIN32
const char *inet_ntop(int, const void *, char *, size_t);
#elif defined __MINGW32__
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index bfeb30340c..7a5eab55cf 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
@@ -175,17 +174,16 @@ rsock_socketpair0(int domain, int type, int protocol, int sv[2])
{
int ret;
static int cloexec_state = -1; /* <0: unknown, 0: ignored, >0: working */
- static const int default_flags = SOCK_CLOEXEC|RSOCK_NONBLOCK_DEFAULT;
if (cloexec_state > 0) { /* common path, if SOCK_CLOEXEC is defined */
- ret = socketpair(domain, type|default_flags, protocol, sv);
+ ret = socketpair(domain, type|SOCK_CLOEXEC, protocol, sv);
if (ret == 0 && (sv[0] <= 2 || sv[1] <= 2)) {
goto fix_cloexec; /* highly unlikely */
}
goto update_max_fd;
}
else if (cloexec_state < 0) { /* usually runs once only for detection */
- ret = socketpair(domain, type|default_flags, protocol, sv);
+ ret = socketpair(domain, type|SOCK_CLOEXEC, protocol, sv);
if (ret == 0) {
cloexec_state = rsock_detect_cloexec(sv[0]);
if ((cloexec_state == 0) || (sv[0] <= 2 || sv[1] <= 2))
@@ -214,10 +212,6 @@ rsock_socketpair0(int domain, int type, int protocol, int sv[2])
fix_cloexec:
rb_maygvl_fd_fix_cloexec(sv[0]);
rb_maygvl_fd_fix_cloexec(sv[1]);
- if (RSOCK_NONBLOCK_DEFAULT) {
- rsock_make_fd_nonblock(sv[0]);
- rsock_make_fd_nonblock(sv[1]);
- }
update_max_fd:
rb_update_max_fd(sv[0]);
@@ -236,10 +230,6 @@ rsock_socketpair0(int domain, int type, int protocol, int sv[2])
rb_fd_fix_cloexec(sv[0]);
rb_fd_fix_cloexec(sv[1]);
- if (RSOCK_NONBLOCK_DEFAULT) {
- rsock_make_fd_nonblock(sv[0]);
- rsock_make_fd_nonblock(sv[1]);
- }
return ret;
}
#endif /* !SOCK_CLOEXEC */
@@ -250,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);
}
@@ -328,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
@@ -447,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;
@@ -461,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);
@@ -489,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
@@ -591,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
@@ -678,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
@@ -774,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);
}
/*
@@ -809,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));
}
@@ -836,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.
@@ -905,6 +1034,7 @@ sock_gethostname(VALUE obj)
long len = RUBY_MAX_HOST_NAME_LEN;
VALUE name;
+ rb_secure(3);
name = rb_str_new(0, len);
while (gethostname(RSTRING_PTR(name), len) < 0) {
int e = errno;
@@ -934,6 +1064,7 @@ sock_gethostname(VALUE obj)
{
struct utsname un;
+ rb_secure(3);
uname(&un);
return rb_str_new2(un.nodename);
}
@@ -955,7 +1086,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));
@@ -992,18 +1123,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"]
*
@@ -1011,38 +1131,21 @@ 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, VALUE _)
+sock_s_gethostbyaddr(int argc, VALUE *argv)
{
VALUE addr, family;
struct hostent *h;
@@ -1104,7 +1207,7 @@ sock_s_gethostbyaddr(int argc, VALUE *argv, VALUE _)
* Socket.getservbyname("syslog", "udp") #=> 514
*/
static VALUE
-sock_s_getservbyname(int argc, VALUE *argv, VALUE _)
+sock_s_getservbyname(int argc, VALUE *argv)
{
VALUE service, proto;
struct servent *sp;
@@ -1145,7 +1248,7 @@ sock_s_getservbyname(int argc, VALUE *argv, VALUE _)
*
*/
static VALUE
-sock_s_getservbyport(int argc, VALUE *argv, VALUE _)
+sock_s_getservbyport(int argc, VALUE *argv)
{
VALUE port, proto;
struct servent *sp;
@@ -1164,7 +1267,7 @@ sock_s_getservbyport(int argc, VALUE *argv, VALUE _)
if (!sp) {
rb_raise(rb_eSocket, "no such service for port %d/%s", (int)portnum, protoname);
}
- return rb_str_new2(sp->s_name);
+ return rb_tainted_str_new2(sp->s_name);
}
/*
@@ -1173,10 +1276,7 @@ sock_s_getservbyport(int argc, VALUE *argv, VALUE _)
*
* 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.
*
@@ -1203,7 +1303,7 @@ sock_s_getservbyport(int argc, VALUE *argv, VALUE _)
* If Addrinfo object is preferred, use Addrinfo.getaddrinfo.
*/
static VALUE
-sock_s_getaddrinfo(int argc, VALUE *argv, VALUE _)
+sock_s_getaddrinfo(int argc, VALUE *argv)
{
VALUE host, port, family, socktype, protocol, flags, ret, revlookup;
struct addrinfo hints;
@@ -1257,7 +1357,7 @@ sock_s_getaddrinfo(int argc, VALUE *argv, VALUE _)
* If Addrinfo object is preferred, use Addrinfo#getnameinfo.
*/
static VALUE
-sock_s_getnameinfo(int argc, VALUE *argv, VALUE _)
+sock_s_getnameinfo(int argc, VALUE *argv)
{
VALUE sa, af = Qnil, host = Qnil, port = Qnil, flags, tmp;
char *hptr, *pptr;
@@ -1296,16 +1396,16 @@ sock_s_getnameinfo(int argc, VALUE *argv, VALUE _)
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 {
/*
@@ -1326,7 +1426,7 @@ sock_s_getnameinfo(int argc, VALUE *argv, VALUE _)
hptr = NULL;
}
else {
- strncpy(hbuf, StringValueCStr(host), sizeof(hbuf));
+ strncpy(hbuf, StringValuePtr(host), sizeof(hbuf));
hbuf[sizeof(hbuf) - 1] = '\0';
hptr = hbuf;
}
@@ -1340,7 +1440,7 @@ sock_s_getnameinfo(int argc, VALUE *argv, VALUE _)
pptr = pbuf;
}
else {
- strncpy(pbuf, StringValueCStr(port), sizeof(pbuf));
+ strncpy(pbuf, StringValuePtr(port), sizeof(pbuf));
pbuf[sizeof(pbuf) - 1] = '\0';
pptr = pbuf;
}
@@ -1390,7 +1490,7 @@ sock_s_getnameinfo(int argc, VALUE *argv, VALUE _)
errno = saved_errno;
rsock_raise_socket_error("getnameinfo", error);
- UNREACHABLE_RETURN(Qnil);
+ UNREACHABLE;
}
/*
@@ -1410,10 +1510,12 @@ sock_s_getnameinfo(int argc, VALUE *argv, VALUE _)
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);
+ OBJ_INFECT(addr, port);
+ OBJ_INFECT(addr, host);
return addr;
}
@@ -1455,6 +1557,7 @@ sock_s_unpack_sockaddr_in(VALUE self, VALUE addr)
#endif
}
host = rsock_make_ipaddr((struct sockaddr*)sockaddr, RSTRING_SOCKLEN(addr));
+ OBJ_INFECT(host, addr);
return rb_assoc_new(INT2NUM(ntohs(sockaddr->sin_port)), host);
}
@@ -1484,6 +1587,7 @@ sock_s_pack_sockaddr_un(VALUE self, VALUE path)
}
memcpy(sockaddr.sun_path, RSTRING_PTR(path), RSTRING_LEN(path));
addr = rb_str_new((char*)&sockaddr, rsock_unix_sockaddr_len(path));
+ OBJ_INFECT(addr, path);
return addr;
}
@@ -1520,6 +1624,7 @@ sock_s_unpack_sockaddr_un(VALUE self, VALUE addr)
RSTRING_LEN(addr), (int)sizeof(struct sockaddr_un));
}
path = rsock_unixpath_str(sockaddr, RSTRING_SOCKLEN(addr));
+ OBJ_INFECT(path, addr);
return path;
}
#endif
@@ -1676,7 +1781,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;
@@ -1737,7 +1842,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)
@@ -1822,7 +1927,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
@@ -1989,8 +2094,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')
*
@@ -2061,26 +2164,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);
@@ -2101,7 +2193,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 82789eeaab..81f77a67c5 100644
--- a/ext/socket/sockssocket.c
+++ b/ext/socket/sockssocket.c
@@ -13,19 +13,13 @@
#ifdef SOCKS
/*
* call-seq:
- * SOCKSSocket.new(host, port) => socket
+ * SOCKSSocket.new(host, serv) => socket
*
- * Opens a SOCKS connection to +host+ via the SOCKS server.
- *
- * The SOCKS server configuration varies by implementation
- *
- * When using the Dante libsocks/libsocksd implementation it is configured as SOCKS_SERVER env var.
- *
- * See: https://manpages.debian.org/testing/dante-client/socksify.1.en.html for full env variable support.
+ * Opens a SOCKS connection to +host+ via the SOCKS server +serv+.
*
*/
static VALUE
-socks_init(VALUE sock, VALUE host, VALUE port)
+socks_init(VALUE sock, VALUE host, VALUE serv)
{
static int init = 0;
@@ -34,7 +28,7 @@ socks_init(VALUE sock, VALUE host, VALUE port)
init = 1;
}
- return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS);
+ return rsock_init_inetsock(sock, host, serv, Qnil, Qnil, INET_SOCKS);
}
#ifdef SOCKS5
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 6ef8242a1e..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,19 +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(VALUE v)
+udp_connect_internal(struct udp_arg *arg)
{
- struct udp_arg *arg = (void *)v;
- 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;
@@ -86,36 +81,20 @@ udp_connect_internal(VALUE v)
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(VALUE v)
-{
- struct udp_arg *arg = (void *)v;
- 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
@@ -131,47 +110,25 @@ udp_bind_internal(VALUE v)
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(VALUE v)
-{
- struct udp_send_arg *arg = (void *)v;
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);
}
/*
@@ -200,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
@@ -240,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 0c3a01d21e..9a4c2cfc01 100644
--- a/ext/socket/unixsocket.c
+++ b/ext/socket/unixsocket.c
@@ -25,27 +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') {
- return name; /* ignore encoding */
- }
- }
-#endif
- return rb_get_path(path);
-}
-
VALUE
rsock_init_unixsock(VALUE sock, VALUE path, int server)
{
@@ -54,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)) {
@@ -86,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);
}
}
@@ -114,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
*
@@ -156,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_.
*
@@ -164,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)
@@ -226,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)
@@ -324,11 +294,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)
@@ -338,12 +303,6 @@ unix_recv_io(int argc, VALUE *argv, VALUE sock)
struct iomsg_arg arg;
struct iovec vec[2];
char buf[1];
- unsigned int gc_reason = 0;
- enum {
- GC_REASON_EMSGSIZE = 0x1,
- GC_REASON_TRUNCATE = 0x2,
- GC_REASON_ENOMEM = 0x4
- };
int fd;
#if FD_PASSING_BY_MSG_CONTROL
@@ -359,7 +318,6 @@ unix_recv_io(int argc, VALUE *argv, VALUE sock)
if (argc <= 1)
mode = Qnil;
-retry:
GetOpenFile(sock, fptr);
arg.msg.msg_name = NULL;
@@ -387,31 +345,12 @@ retry:
arg.fd = fptr->fd;
while ((int)BLOCKING_REGION_FD(recvmsg_blocking, &arg) == -1) {
- int e = errno;
- if (e == EMSGSIZE && !(gc_reason & GC_REASON_EMSGSIZE)) {
- /* FreeBSD gets here when we're out of FDs */
- gc_reason |= GC_REASON_EMSGSIZE;
- rb_gc_for_fd(EMFILE);
- goto retry;
- }
- else if (e == ENOMEM && !(gc_reason & GC_REASON_ENOMEM)) {
- /* ENOMEM is documented in recvmsg manpages */
- gc_reason |= GC_REASON_ENOMEM;
- rb_gc_for_fd(e);
- goto retry;
- }
if (!rb_io_wait_readable(arg.fd))
- rsock_syserr_fail_path(e, "recvmsg(2)", fptr->pathv);
+ rsock_sys_fail_path("recvmsg(2)", fptr->pathv);
}
#if FD_PASSING_BY_MSG_CONTROL
if (arg.msg.msg_controllen < (socklen_t)sizeof(struct cmsghdr)) {
- /* FreeBSD and Linux both get here when we're out of FDs */
- if (!(gc_reason & GC_REASON_TRUNCATE)) {
- gc_reason |= GC_REASON_TRUNCATE;
- rb_gc_for_fd(EMFILE);
- goto retry;
- }
rb_raise(rb_eSocket,
"file descriptor was not passed (msg_controllen=%d smaller than sizeof(struct cmsghdr)=%d)",
(int)arg.msg.msg_controllen, (int)sizeof(struct cmsghdr));
@@ -471,7 +410,7 @@ retry:
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
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 02d468b306..db356dd6e0 100644
--- a/ext/stringio/depend
+++ b/ext/stringio/depend
@@ -1,18 +1,4 @@
-# AUTOGENERATED DEPENDENCIES START
-stringio.o: $(RUBY_EXTCONF_H)
-stringio.o: $(arch_hdrdir)/ruby/config.h
-stringio.o: $(hdrdir)/ruby.h
-stringio.o: $(hdrdir)/ruby/assert.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: 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 a933159766..8fc84b3735 100644
--- a/ext/stringio/extconf.rb
+++ b/ext/stringio/extconf.rb
@@ -1,4 +1,2 @@
-# frozen_string_literal: false
require 'mkmf'
-have_func("rb_io_extract_modeenc", "ruby/io.h")
create_makefile('stringio')
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index c8057eefb5..ecd7b07203 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -11,8 +11,6 @@
**********************************************************************/
-#define STRINGIO_VERSION "0.1.0"
-
#include "ruby.h"
#include "ruby/io.h"
#include "ruby/encoding.h"
@@ -22,106 +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
-
-#ifndef RB_PASS_CALLED_KEYWORDS
-# define rb_funcallv_kw(recv, mid, arg, argv, kw_splat) rb_funcallv(recv, mid, arg, argv)
-# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
-#endif
-
-#ifndef HAVE_RB_IO_EXTRACT_MODEENC
-#define rb_io_extract_modeenc strio_extract_modeenc
-static void
-strio_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
- int *oflags_p, int *fmode_p, struct rb_io_enc_t *convconfig_p)
-{
- VALUE mode = *vmode_p;
- VALUE intmode;
- int fmode;
- int has_enc = 0, has_vmode = 0;
-
- convconfig_p->enc = convconfig_p->enc2 = 0;
-
- vmode_handle:
- if (NIL_P(mode)) {
- fmode = FMODE_READABLE;
- }
- else if (!NIL_P(intmode = rb_check_to_integer(mode, "to_int"))) {
- int flags = NUM2INT(intmode);
- fmode = rb_io_oflags_fmode(flags);
- }
- else {
- const char *m = StringValueCStr(mode), *n, *e;
- fmode = rb_io_modestr_fmode(m);
- n = strchr(m, ':');
- if (n) {
- long len;
- char encname[ENCODING_MAXNAMELEN+1];
- has_enc = 1;
- if (fmode & FMODE_SETENC_BY_BOM) {
- n = strchr(n, '|');
- }
- e = strchr(++n, ':');
- len = e ? e - n : strlen(n);
- if (len > 0 && len <= ENCODING_MAXNAMELEN) {
- if (e) {
- memcpy(encname, n, len);
- encname[len] = '\0';
- n = encname;
- }
- convconfig_p->enc = rb_enc_find(n);
- }
- if (e && (len = strlen(++e)) > 0 && len <= ENCODING_MAXNAMELEN) {
- convconfig_p->enc2 = rb_enc_find(e);
- }
- }
- }
-
- if (!NIL_P(opthash)) {
- rb_encoding *extenc = 0, *intenc = 0;
- VALUE v;
- if (!has_vmode) {
- ID id_mode;
- CONST_ID(id_mode, "mode");
- v = rb_hash_aref(opthash, ID2SYM(id_mode));
- if (!NIL_P(v)) {
- if (!NIL_P(mode)) {
- rb_raise(rb_eArgError, "mode specified twice");
- }
- has_vmode = 1;
- mode = v;
- goto vmode_handle;
- }
- }
-
- if (rb_io_extract_encoding_option(opthash, &extenc, &intenc, &fmode)) {
- if (has_enc) {
- rb_raise(rb_eArgError, "encoding specified twice");
- }
- }
- }
- *fmode_p = fmode;
-}
-#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)
@@ -139,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
@@ -155,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);
}
@@ -182,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)
@@ -233,6 +139,8 @@ writable(VALUE strio)
if (!WRITABLE(strio)) {
rb_raise(rb_eIOError, "not opened for writing");
}
+ if (!OBJ_TAINTED(ptr->string)) {
+ }
return ptr;
}
@@ -264,111 +172,50 @@ 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 int
-detect_bom(VALUE str, int *bomlen)
+static void
+strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self)
{
- const char *p;
- long len;
+ VALUE string, mode;
+ int trunc = 0;
- RSTRING_GETMEM(str, p, len);
- if (len < 1) return 0;
- switch ((unsigned char)p[0]) {
- case 0xEF:
- if (len < 2) break;
- if ((unsigned char)p[1] == 0xBB && len > 2) {
- if ((unsigned char)p[2] == 0xBF) {
- *bomlen = 3;
- return rb_utf8_encindex();
- }
+ switch (rb_scan_args(argc, argv, "02", &string, &mode)) {
+ case 2:
+ if (FIXNUM_P(mode)) {
+ int flags = FIX2INT(mode);
+ ptr->flags = rb_io_oflags_fmode(flags);
+ trunc = flags & O_TRUNC;
}
- break;
-
- case 0xFE:
- if (len < 2) break;
- if ((unsigned char)p[1] == 0xFF) {
- *bomlen = 2;
- return rb_enc_find_index("UTF-16BE");
+ else {
+ const char *m = StringValueCStr(mode);
+ ptr->flags = rb_io_modestr_fmode(m);
+ trunc = *m == 'w';
}
- break;
-
- case 0xFF:
- if (len < 2) break;
- if ((unsigned char)p[1] == 0xFE) {
- if (len >= 4 && (unsigned char)p[2] == 0 && (unsigned char)p[3] == 0) {
- *bomlen = 4;
- return rb_enc_find_index("UTF-32LE");
- }
- *bomlen = 2;
- return rb_enc_find_index("UTF-16LE");
+ StringValue(string);
+ if ((ptr->flags & FMODE_WRITABLE) && OBJ_FROZEN(string)) {
+ errno = EACCES;
+ rb_sys_fail(0);
}
- break;
-
- case 0:
- if (len < 4) break;
- if ((unsigned char)p[1] == 0 && (unsigned char)p[2] == 0xFE && (unsigned char)p[3] == 0xFF) {
- *bomlen = 4;
- return rb_enc_find_index("UTF-32BE");
+ if (trunc) {
+ rb_str_resize(string, 0);
}
break;
- }
- return 0;
-}
-
-static rb_encoding *
-set_encoding_by_bom(struct StringIO *ptr)
-{
- int bomlen, idx = detect_bom(ptr->string, &bomlen);
- rb_encoding *extenc = NULL;
-
- if (idx) {
- extenc = rb_enc_from_index(idx);
- ptr->pos = bomlen;
- if (ptr->flags & FMODE_WRITABLE) {
- rb_enc_associate_index(ptr->string, idx);
- }
- }
- ptr->enc = extenc;
- return extenc;
-}
-
-static VALUE
-strio_init(int argc, VALUE *argv, struct StringIO *ptr, VALUE self)
-{
- VALUE string, vmode, opt;
- int oflags;
- struct rb_io_enc_t convconfig;
-
- argc = rb_scan_args(argc, argv, "02:", &string, &vmode, &opt);
- rb_io_extract_modeenc(&vmode, 0, opt, &oflags, &ptr->flags, &convconfig);
- if (argc) {
+ case 1:
StringValue(string);
- }
- else {
+ ptr->flags = OBJ_FROZEN(string) ? FMODE_READABLE : FMODE_READWRITE;
+ break;
+ case 0:
string = rb_enc_str_new("", 0, rb_default_external_encoding());
- }
- if (OBJ_FROZEN_RAW(string)) {
- if (ptr->flags & FMODE_WRITABLE) {
- rb_syserr_fail(EACCES, 0);
- }
- }
- else {
- if (NIL_P(vmode)) {
- ptr->flags |= FMODE_WRITABLE;
- }
- }
- if (ptr->flags & FMODE_TRUNC) {
- rb_str_resize(string, 0);
+ ptr->flags = FMODE_READWRITE;
+ break;
}
ptr->string = string;
- ptr->enc = convconfig.enc;
ptr->pos = 0;
ptr->lineno = 0;
- if (ptr->flags & FMODE_SETENC_BY_BOM) set_encoding_by_bom(ptr);
RBASIC(self)->flags |= (ptr->flags & FMODE_READWRITE) * (STRIO_READABLE / FMODE_READABLE);
- return self;
}
static VALUE
@@ -390,24 +237,11 @@ strio_finalize(VALUE self)
static VALUE
strio_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE obj = rb_class_new_instance_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
+ VALUE obj = rb_class_new_instance(argc, argv, klass);
if (!rb_block_given_p()) return obj;
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_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
-}
-
/*
* Returns +false+. Just for compatibility to IO.
*/
@@ -429,7 +263,7 @@ strio_nil(VALUE self)
}
/*
- * Returns an object itself. Just for compatibility to IO.
+ * Returns *strio* itself. Just for compatibility to IO.
*/
static VALUE
strio_self(VALUE self)
@@ -505,13 +339,16 @@ strio_set_string(VALUE self, VALUE string)
* call-seq:
* strio.close -> nil
*
- * Closes a StringIO. The stream is unavailable for any further data
+ * Closes strio. The *strio* is unavailable for any further data
* operations; an +IOError+ is raised if such an attempt is made.
*/
static VALUE
strio_close(VALUE self)
{
StringIO(self);
+ if (CLOSED(self)) {
+ rb_raise(rb_eIOError, "closed stream");
+ }
RBASIC(self)->flags &= ~STRIO_READWRITE;
return Qnil;
}
@@ -521,13 +358,13 @@ strio_close(VALUE self)
* strio.close_read -> nil
*
* Closes the read end of a StringIO. Will raise an +IOError+ if the
- * receiver is not readable.
+ * *strio* is not readable.
*/
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;
@@ -539,13 +376,13 @@ strio_close_read(VALUE self)
* strio.close_write -> nil
*
* Closes the write end of a StringIO. Will raise an +IOError+ if the
- * receiver is not writeable.
+ * *strio* is not writeable.
*/
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;
@@ -556,7 +393,7 @@ strio_close_write(VALUE self)
* call-seq:
* strio.closed? -> true or false
*
- * Returns +true+ if the stream is completely closed, +false+ otherwise.
+ * Returns +true+ if *strio* is completely closed, +false+ otherwise.
*/
static VALUE
strio_closed(VALUE self)
@@ -570,7 +407,7 @@ strio_closed(VALUE self)
* call-seq:
* strio.closed_read? -> true or false
*
- * Returns +true+ if the stream is not readable, +false+ otherwise.
+ * Returns +true+ if *strio* is not readable, +false+ otherwise.
*/
static VALUE
strio_closed_read(VALUE self)
@@ -584,7 +421,7 @@ strio_closed_read(VALUE self)
* call-seq:
* strio.closed_write? -> true or false
*
- * Returns +true+ if the stream is not writable, +false+ otherwise.
+ * Returns +true+ if *strio* is not writable, +false+ otherwise.
*/
static VALUE
strio_closed_write(VALUE self)
@@ -599,8 +436,8 @@ strio_closed_write(VALUE self)
* strio.eof -> true or false
* strio.eof? -> true or false
*
- * Returns true if the stream is at the end of the data (underlying string).
- * The stream must be opened for reading or an +IOError+ will be raised.
+ * Returns true if *strio* is at end of file. The stringio must be
+ * opened for reading or an +IOError+ will be raised.
*/
static VALUE
strio_eof(VALUE self)
@@ -623,6 +460,7 @@ strio_copy(VALUE copy, VALUE orig)
strio_free(DATA_PTR(copy));
}
DATA_PTR(copy) = ptr;
+ OBJ_INFECT(copy, orig);
RBASIC(copy)->flags &= ~STRIO_READWRITE;
RBASIC(copy)->flags |= RBASIC(orig)->flags & STRIO_READWRITE;
++ptr->count;
@@ -633,7 +471,7 @@ strio_copy(VALUE copy, VALUE orig)
* call-seq:
* strio.lineno -> integer
*
- * Returns the current line number. The stream must be
+ * Returns the current line number in *strio*. The stringio must be
* opened for reading. +lineno+ counts the number of times +gets+ is
* called, rather than the number of newlines encountered. The two
* values will differ if +gets+ is called with a separator other than
@@ -659,20 +497,12 @@ strio_set_lineno(VALUE self, VALUE lineno)
return lineno;
}
-/*
- * call-seq:
- * strio.binmode -> stringio
- *
- * Puts stream into binary mode. See IO#binmode.
- *
- */
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);
}
@@ -690,7 +520,7 @@ strio_binmode(VALUE self)
* strio.reopen(other_StrIO) -> strio
* strio.reopen(string, mode) -> strio
*
- * Reinitializes the stream with the given <i>other_StrIO</i> or _string_
+ * Reinitializes *strio* with the given <i>other_StrIO</i> or _string_
* and _mode_ (see StringIO#new).
*/
static VALUE
@@ -700,7 +530,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;
}
/*
@@ -708,7 +539,7 @@ strio_reopen(int argc, VALUE *argv, VALUE self)
* strio.pos -> integer
* strio.tell -> integer
*
- * Returns the current offset (in bytes).
+ * Returns the current offset (in bytes) of *strio*.
*/
static VALUE
strio_get_pos(VALUE self)
@@ -720,7 +551,7 @@ strio_get_pos(VALUE self)
* call-seq:
* strio.pos = integer -> integer
*
- * Seeks to the given position (in bytes).
+ * Seeks to the given position (in bytes) in *strio*.
*/
static VALUE
strio_set_pos(VALUE self, VALUE pos)
@@ -738,7 +569,7 @@ strio_set_pos(VALUE self, VALUE pos)
* call-seq:
* strio.rewind -> 0
*
- * Positions the stream to the beginning of input, resetting
+ * Positions *strio* to the beginning of input, resetting
* +lineno+ to zero.
*/
static VALUE
@@ -762,30 +593,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);
}
@@ -849,19 +679,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));
}
/*
@@ -887,9 +715,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) {
@@ -906,7 +731,7 @@ strio_extend(struct StringIO *ptr, long pos, long len)
* call-seq:
* strio.ungetc(string) -> nil
*
- * Pushes back one character (passed as a parameter)
+ * Pushes back one character (passed as a parameter) onto *strio*
* such that a subsequent buffered read will return it. There is no
* limitation for multiple pushbacks including pushing back behind the
* beginning of the buffer string.
@@ -915,19 +740,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);
@@ -936,10 +761,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;
}
/*
@@ -952,55 +796,36 @@ static VALUE
strio_ungetbyte(VALUE self, VALUE c)
{
struct StringIO *ptr = readable(self);
+ char buf[1], *cp = buf;
+ long pos = ptr->pos, cl = 1;
+ VALUE str = ptr->string;
- check_modifiable(ptr);
if (NIL_P(c)) return Qnil;
- if (RB_INTEGER_TYPE_P(c)) {
- /* rb_int_and() not visible from exts */
- VALUE v = rb_funcall(c, '&', 1, INT2FIX(0xff));
- const char cc = NUM2INT(v) & 0xFF;
- strio_unget_bytes(ptr, &cc, 1);
+ if (FIXNUM_P(c)) {
+ buf[0] = (char)FIX2INT(c);
}
else {
- long cl;
SafeStringValue(c);
+ cp = RSTRING_PTR(c);
cl = RSTRING_LEN(c);
- if (cl > 0) {
- strio_unget_bytes(ptr, RSTRING_PTR(c), cl);
- RB_GC_GUARD(c);
- }
+ if (cl == 0) return Qnil;
}
- 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;
}
@@ -1013,7 +838,7 @@ strio_unget_bytes(struct StringIO *ptr, const char *cp, long cl)
static VALUE
strio_readchar(VALUE self)
{
- VALUE c = rb_funcallv(self, rb_intern("getc"), 0, 0);
+ VALUE c = rb_funcall2(self, rb_intern("getc"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
}
@@ -1027,7 +852,7 @@ strio_readchar(VALUE self)
static VALUE
strio_readbyte(VALUE self)
{
- VALUE c = rb_funcallv(self, rb_intern("getbyte"), 0, 0);
+ VALUE c = rb_funcall2(self, rb_intern("getbyte"), 0, 0);
if (NIL_P(c)) rb_eof_error();
return c;
}
@@ -1053,7 +878,7 @@ strio_each_char(VALUE self)
}
/*
- * This is a deprecated alias for #each_char.
+ * This is a deprecated alias for <code>each_char</code>.
*/
static VALUE
strio_chars(VALUE self)
@@ -1082,7 +907,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;
@@ -1097,7 +922,7 @@ strio_each_codepoint(VALUE self)
}
/*
- * This is a deprecated alias for #each_codepoint.
+ * This is a deprecated alias for <code>each_codepoint</code>.
*/
static VALUE
strio_codepoints(VALUE self)
@@ -1141,19 +966,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;
@@ -1164,6 +984,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 {
@@ -1177,39 +998,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;
@@ -1217,19 +1005,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;
}
@@ -1238,33 +1022,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;
}
}
@@ -1274,11 +1048,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++;
@@ -1287,55 +1061,48 @@ strio_getline(struct getline_arg *arg, struct StringIO *ptr)
/*
* call-seq:
- * strio.gets(sep=$/, chomp: false) -> string or nil
- * strio.gets(limit, chomp: false) -> string or nil
- * strio.gets(sep, limit, chomp: false) -> string or nil
+ * strio.gets(sep=$/) -> string or nil
+ * strio.gets(limit) -> string or nil
+ * strio.gets(sep, limit) -> string or nil
*
* See IO#gets.
*/
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;
}
/*
* call-seq:
- * strio.readline(sep=$/, chomp: false) -> string
- * strio.readline(limit, chomp: false) -> string or nil
- * strio.readline(sep, limit, chomp: false) -> string or nil
+ * strio.readline(sep=$/) -> string
+ * strio.readline(limit) -> string or nil
+ * strio.readline(sep, limit) -> string or nil
*
* See IO#readline.
*/
static VALUE
strio_readline(int argc, VALUE *argv, VALUE self)
{
- VALUE line = rb_funcallv_kw(self, rb_intern("gets"), argc, argv, RB_PASS_CALLED_KEYWORDS);
+ VALUE line = rb_funcall2(self, rb_intern("gets"), argc, argv);
if (NIL_P(line)) rb_eof_error();
return line;
}
/*
* call-seq:
- * strio.each(sep=$/, chomp: false) {|line| block } -> strio
- * strio.each(limit, chomp: false) {|line| block } -> strio
- * strio.each(sep, limit, chomp: false) {|line| block } -> strio
- * strio.each(...) -> anEnumerator
+ * strio.each(sep=$/) {|line| block } -> strio
+ * strio.each(limit) {|line| block } -> strio
+ * strio.each(sep, limit) {|line| block } -> strio
+ * strio.each(...) -> anEnumerator
*
- * strio.each_line(sep=$/, chomp: false) {|line| block } -> strio
- * strio.each_line(limit, chomp: false) {|line| block } -> strio
- * strio.each_line(sep, limit, chomp: false) {|line| block } -> strio
- * strio.each_line(...) -> anEnumerator
+ * strio.each_line(sep=$/) {|line| block } -> strio
+ * strio.each_line(limit) {|line| block } -> strio
+ * strio.each_line(sep,limit) {|line| block } -> strio
+ * strio.each_line(...) -> anEnumerator
*
* See IO#each.
*/
@@ -1343,23 +1110,23 @@ 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;
}
/*
- * This is a deprecated alias for #each_line.
+ * This is a deprecated alias for <code>each_line</code>.
*/
static VALUE
strio_lines(int argc, VALUE *argv, VALUE self)
@@ -1372,9 +1139,9 @@ strio_lines(int argc, VALUE *argv, VALUE self)
/*
* call-seq:
- * strio.readlines(sep=$/, chomp: false) -> array
- * strio.readlines(limit, chomp: false) -> array
- * strio.readlines(sep, limit, chomp: false) -> array
+ * strio.readlines(sep=$/) -> array
+ * strio.readlines(limit) -> array
+ * strio.readlines(sep,limit) -> array
*
* See IO#readlines.
*/
@@ -1382,15 +1149,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;
@@ -1398,26 +1165,15 @@ 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.
+ * Appends the given string to the underlying buffer string of *strio*.
* 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. 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);
@@ -1427,13 +1183,13 @@ strio_write(VALUE self, VALUE str)
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) {
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) {
@@ -1442,6 +1198,7 @@ strio_write(VALUE self, VALUE str)
if (ptr->pos == olen) {
if (enc == ascii8bit || enc2 == ascii8bit) {
rb_enc_str_buf_cat(ptr->string, RSTRING_PTR(str), len, enc);
+ OBJ_INFECT(ptr->string, str);
}
else {
rb_str_buf_append(ptr->string, str);
@@ -1450,10 +1207,12 @@ strio_write(VALUE self, VALUE str)
else {
strio_extend(ptr, ptr->pos, len);
memmove(RSTRING_PTR(ptr->string)+ptr->pos, RSTRING_PTR(str), len);
+ OBJ_INFECT(ptr->string, str);
}
+ OBJ_INFECT(ptr->string, self);
RB_GC_GUARD(str);
ptr->pos += len;
- return len;
+ return LONG2NUM(len);
}
/*
@@ -1527,7 +1286,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];
@@ -1535,7 +1293,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]);
@@ -1553,24 +1310,24 @@ strio_read(int argc, VALUE *argv, VALUE self)
case 0:
len = RSTRING_LEN(ptr->string);
if (len <= ptr->pos) {
- rb_encoding *enc = 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;
@@ -1597,7 +1354,7 @@ strio_read(int argc, VALUE *argv, VALUE self)
static VALUE
strio_sysread(int argc, VALUE *argv, VALUE self)
{
- VALUE val = rb_funcallv_kw(self, rb_intern("read"), argc, argv, RB_PASS_CALLED_KEYWORDS);
+ VALUE val = rb_funcall2(self, rb_intern("read"), argc, argv);
if (NIL_P(val)) {
rb_eof_error();
}
@@ -1615,17 +1372,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();
@@ -1672,7 +1432,7 @@ strio_size(VALUE self)
* call-seq:
* strio.truncate(integer) -> 0
*
- * Truncates the buffer string to at most _integer_ bytes. The stream
+ * Truncates the buffer string to at most _integer_ bytes. The *strio*
* must be opened for writing.
*/
static VALUE
@@ -1696,15 +1456,13 @@ strio_truncate(VALUE self, VALUE len)
* strio.external_encoding => encoding
*
* Returns the Encoding object that represents the encoding of the file.
- * If the stream is write mode and no encoding is specified, returns
- * +nil+.
+ * If strio is write mode and no encoding is specified, returns <code>nil</code>.
*/
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));
}
/*
@@ -1712,13 +1470,13 @@ strio_external_encoding(VALUE self)
* strio.internal_encoding => encoding
*
* Returns the Encoding of the internal string if conversion is
- * specified. Otherwise returns +nil+.
+ * specified. Otherwise returns nil.
*/
static VALUE
strio_internal_encoding(VALUE self)
{
- return Qnil;
+ return Qnil;
}
/*
@@ -1735,7 +1493,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);
@@ -1746,57 +1504,30 @@ 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;
}
-static VALUE
-strio_set_encoding_by_bom(VALUE self)
-{
- struct StringIO *ptr = StringIO(self);
-
- if (ptr->enc) {
- rb_raise(rb_eArgError, "encoding conversion is set");
- }
- if (!set_encoding_by_bom(ptr)) return Qnil;
- return rb_enc_from_encoding(ptr->enc);
-}
-
/*
- * Pseudo I/O on String object, with interface corresponding to IO.
+ * Pseudo I/O on String object.
*
- * Commonly used to simulate <code>$stdio</code> or <code>$stderr</code>
+ * Commonly used to simulate `$stdio` or `$stderr`
*
* === Examples
*
* require 'stringio'
*
- * # Writing stream emulation
* io = StringIO.new
* io.puts "Hello World"
- * io.string #=> "Hello World\n"
- *
- * # Reading stream emulation
- * io = StringIO.new "first\nsecond\nlast\n"
- * io.getc #=> "f"
- * io.gets #=> "irst\n"
- * io.read #=> "second\nlast\n"
+ * io.string #=> "Hello World"
*/
void
Init_stringio(void)
{
-#undef rb_intern
VALUE StringIO = rb_define_class("StringIO", rb_cData);
- rb_define_const(StringIO, "VERSION", rb_str_new_cstr(STRINGIO_VERSION));
-
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);
@@ -1850,7 +1581,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);
/*
@@ -1874,7 +1605,6 @@ Init_stringio(void)
rb_define_method(StringIO, "external_encoding", strio_external_encoding, 0);
rb_define_method(StringIO, "internal_encoding", strio_internal_encoding, 0);
rb_define_method(StringIO, "set_encoding", strio_set_encoding, -1);
- rb_define_method(StringIO, "set_encoding_by_bom", strio_set_encoding_by_bom, 0);
{
VALUE mReadable = rb_define_module_under(rb_cIO, "generic_readable");
diff --git a/ext/stringio/stringio.gemspec b/ext/stringio/stringio.gemspec
deleted file mode 100644
index a16c75753f..0000000000
--- a/ext/stringio/stringio.gemspec
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- encoding: utf-8 -*-
-# frozen_string_literal: true
-
-source_version = ["", "ext/stringio/"].find do |dir|
- begin
- break File.open(File.join(__dir__, "#{dir}stringio.c")) {|f|
- f.gets("\n#define STRINGIO_VERSION ")
- f.gets[/\s*"(.+)"/, 1]
- }
- rescue Errno::ENOENT
- end
-end
-Gem::Specification.new do |s|
- s.name = "stringio"
- s.version = source_version
-
- s.required_rubygems_version = Gem::Requirement.new(">= 2.6")
- s.require_paths = ["lib"]
- s.authors = ["Nobu Nakada"]
- s.description = "Pseudo `IO` class from/to `String`."
- s.email = "nobu@ruby-lang.org"
- s.extensions = ["ext/stringio/extconf.rb"]
- s.files = ["README.md", "ext/stringio/extconf.rb", "ext/stringio/stringio.c"]
- s.homepage = "https://github.com/ruby/stringio"
- s.licenses = ["BSD-2-Clause"]
- s.required_ruby_version = ">= 2.5"
- s.rubygems_version = "2.6.11"
- s.summary = "Pseudo IO on String"
-
- # 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 212d386f83..324c5da2f2 100644
--- a/ext/strscan/depend
+++ b/ext/strscan/depend
@@ -1,18 +1,17 @@
# AUTOGENERATED DEPENDENCIES START
strscan.o: $(RUBY_EXTCONF_H)
strscan.o: $(arch_hdrdir)/ruby/config.h
-strscan.o: $(hdrdir)/ruby/assert.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
diff --git a/ext/strscan/extconf.rb b/ext/strscan/extconf.rb
index f0ecbf85d8..3e5a295e31 100644
--- a/ext/strscan/extconf.rb
+++ b/ext/strscan/extconf.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
require 'mkmf'
-$INCFLAGS << " -I$(top_srcdir)" if $extmk
-have_func("onig_region_memsize", "ruby.h")
+$INCFLAGS << " -I$(top_srcdir)"
create_makefile 'strscan'
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index b6d17992c9..55d13d413b 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -11,18 +11,9 @@
#include "ruby/ruby.h"
#include "ruby/re.h"
#include "ruby/encoding.h"
+#include "regint.h"
-#ifdef RUBY_EXTCONF_H
-# include RUBY_EXTCONF_H
-#endif
-
-#ifdef HAVE_ONIG_REGION_MEMSIZE
-extern size_t onig_region_memsize(const struct re_registers *regs);
-#endif
-
-#include <stdbool.h>
-
-#define STRSCAN_VERSION "1.0.3"
+#define STRSCAN_VERSION "0.7.0"
/* =======================================================================
Data Type Definitions
@@ -50,9 +41,6 @@ struct strscanner
/* regexp used for last scan */
VALUE regex;
-
- /* anchor mode */
- bool fixed_anchor_p;
};
#define MATCHED_P(s) ((s)->flags & FLAG_MATCHED)
@@ -76,7 +64,7 @@ struct strscanner
Function Prototypes
======================================================================= */
-static inline long minl _((const long n, const long x));
+static VALUE infect _((VALUE str, struct strscanner *p));
static VALUE extract_range _((struct strscanner *p, long beg_i, long end_i));
static VALUE extract_beg_len _((struct strscanner *p, long beg_i, long len));
@@ -138,33 +126,36 @@ static VALUE inspect2 _((struct strscanner *p));
======================================================================= */
static VALUE
-str_new(struct strscanner *p, const char *ptr, long len)
+infect(VALUE str, struct strscanner *p)
{
- VALUE str = rb_str_new(ptr, len);
- rb_enc_copy(str, p->str);
+ OBJ_INFECT(str, p->str);
return str;
}
-static inline long
-minl(const long x, const long y)
+static VALUE
+str_new(struct strscanner *p, const char *ptr, long len)
{
- return (x < y) ? x : y;
+ VALUE str = rb_str_new(ptr, len);
+ rb_enc_copy(str, p->str);
+ return str;
}
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));
- return str_new(p, S_PBEG(p) + beg_i, end_i - beg_i);
+ 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);
}
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);
- return str_new(p, S_PBEG(p) + beg_i, len);
+ 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);
}
/* =======================================================================
@@ -190,10 +181,10 @@ static size_t
strscan_memsize(const void *ptr)
{
const struct strscanner *p = ptr;
- size_t size = sizeof(*p) - sizeof(p->regs);
-#ifdef HAVE_ONIG_REGION_MEMSIZE
- size += onig_region_memsize(&p->regs);
-#endif
+ size_t size = 0;
+ if (p) {
+ size = sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
+ }
return size;
}
@@ -207,50 +198,28 @@ 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);
}
/*
- * call-seq:
- * StringScanner.new(string, fixed_anchor: false)
- * StringScanner.new(string, dup = false)
+ * call-seq: StringScanner.new(string, dup = false)
*
* Creates a new StringScanner object to scan over the given +string+.
- *
- * If +fixed_anchor+ is +true+, +\A+ always matches the beginning of
- * the string. Otherwise, +\A+ always matches the current position.
- *
* +dup+ argument is obsolete and not used now.
*/
static VALUE
strscan_initialize(int argc, VALUE *argv, VALUE self)
{
struct strscanner *p;
- VALUE str, options;
+ VALUE str, need_dup;
p = check_strscan(self);
- rb_scan_args(argc, argv, "11", &str, &options);
- options = rb_check_hash_type(options);
- if (!NIL_P(options)) {
- VALUE fixed_anchor;
- ID keyword_ids[1];
- keyword_ids[0] = rb_intern("fixed_anchor");
- rb_get_kwargs(options, keyword_ids, 0, 1, &fixed_anchor);
- if (fixed_anchor == Qundef) {
- p->fixed_anchor_p = false;
- }
- else {
- p->fixed_anchor_p = RTEST(fixed_anchor);
- }
- }
- else {
- p->fixed_anchor_p = false;
- }
+ rb_scan_args(argc, argv, "11", &str, &need_dup);
StringValue(str);
p->str = str;
@@ -324,7 +293,7 @@ strscan_reset(VALUE self)
* terminate
* clear
*
- * Sets the scan pointer to the end of the string and clear matching data.
+ * Set the scan pointer to the end of the string and clear matching data.
*/
static VALUE
strscan_terminate(VALUE self)
@@ -455,7 +424,7 @@ strscan_get_charpos(VALUE self)
/*
* call-seq: pos=(n)
*
- * Sets the byte position of the scan pointer.
+ * Set the byte position of the scan pointer.
*
* s = StringScanner.new('test string')
* s.pos = 7 # -> 7
@@ -476,83 +445,16 @@ strscan_set_pos(VALUE self, VALUE v)
return INT2NUM(i);
}
-static inline UChar *
-match_target(struct strscanner *p)
-{
- if (p->fixed_anchor_p) {
- return (UChar *)S_PBEG(p);
- }
- else
- {
- return (UChar *)CURPTR(p);
- }
-}
-
-static inline void
-set_registers(struct strscanner *p, size_t length)
-{
- const int at = 0;
- OnigRegion *regs = &(p->regs);
- onig_region_clear(regs);
- if (onig_region_set(regs, at, 0, 0)) return;
- if (p->fixed_anchor_p) {
- regs->beg[at] = p->curr;
- regs->end[at] = p->curr + length;
- }
- else
- {
- regs->end[at] = length;
- }
-}
-
-static inline void
-succ(struct strscanner *p)
-{
- if (p->fixed_anchor_p) {
- p->curr = p->regs.end[0];
- }
- else
- {
- p->curr += p->regs.end[0];
- }
-}
-
-static inline long
-last_match_length(struct strscanner *p)
-{
- if (p->fixed_anchor_p) {
- return p->regs.end[0] - p->prev;
- }
- else
- {
- return p->regs.end[0];
- }
-}
-
-static inline long
-adjust_register_position(struct strscanner *p, long position)
-{
- if (p->fixed_anchor_p) {
- return position;
- }
- else {
- return p->prev + position;
- }
-}
-
static VALUE
-strscan_do_scan(VALUE self, VALUE pattern, int succptr, int getstr, int headonly)
+strscan_do_scan(VALUE self, VALUE regex, int succptr, int getstr, int headonly)
{
+ regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
struct strscanner *p;
+ regex_t *re;
+ long ret;
+ int tmpreg;
- if (headonly) {
- if (!RB_TYPE_P(pattern, T_REGEXP)) {
- StringValue(pattern);
- }
- }
- else {
- Check_Type(pattern, T_REGEXP);
- }
+ Check_Type(regex, T_REGEXP);
GET_SCANNER(self, p);
CLEAR_MATCH_STATUS(p);
@@ -560,76 +462,49 @@ strscan_do_scan(VALUE self, VALUE pattern, int succptr, int getstr, int headonly
return Qnil;
}
- if (RB_TYPE_P(pattern, T_REGEXP)) {
- regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
- regex_t *re;
- long ret;
- int tmpreg;
-
- p->regex = pattern;
- re = rb_reg_prepare_re(pattern, p->str);
- tmpreg = re != RREGEXP_PTR(pattern);
- if (!tmpreg) RREGEXP(pattern)->usecnt++;
-
- if (headonly) {
- ret = onig_match(re,
- match_target(p),
- (UChar* )(CURPTR(p) + S_RESTLEN(p)),
- (UChar* )CURPTR(p),
- &(p->regs),
- ONIG_OPTION_NONE);
- }
- else {
- ret = onig_search(re,
- match_target(p),
- (UChar* )(CURPTR(p) + S_RESTLEN(p)),
- (UChar* )CURPTR(p),
- (UChar* )(CURPTR(p) + S_RESTLEN(p)),
- &(p->regs),
- ONIG_OPTION_NONE);
- }
- if (!tmpreg) RREGEXP(pattern)->usecnt--;
- if (tmpreg) {
- if (RREGEXP(pattern)->usecnt) {
- onig_free(re);
- }
- else {
- onig_free(RREGEXP_PTR(pattern));
- RREGEXP_PTR(pattern) = re;
- }
- }
+ p->regex = regex;
+ re = rb_reg_prepare_re(regex, p->str);
+ tmpreg = re != RREGEXP(regex)->ptr;
+ if (!tmpreg) RREGEXP(regex)->usecnt++;
- if (ret == -2) rb_raise(ScanError, "regexp buffer overflow");
- if (ret < 0) {
- /* not matched */
- return Qnil;
- }
+ if (headonly) {
+ ret = onig_match(re, (UChar* )CURPTR(p),
+ (UChar* )(CURPTR(p) + S_RESTLEN(p)),
+ (UChar* )CURPTR(p), &(p->regs), ONIG_OPTION_NONE);
}
else {
- rb_enc_check(p->str, pattern);
- if (S_RESTLEN(p) < RSTRING_LEN(pattern)) {
- return Qnil;
+ ret = onig_search(re,
+ (UChar* )CURPTR(p), (UChar* )(CURPTR(p) + S_RESTLEN(p)),
+ (UChar* )CURPTR(p), (UChar* )(CURPTR(p) + S_RESTLEN(p)),
+ &(p->regs), ONIG_OPTION_NONE);
+ }
+ if (!tmpreg) RREGEXP(regex)->usecnt--;
+ if (tmpreg) {
+ if (RREGEXP(regex)->usecnt) {
+ onig_free(re);
}
- if (memcmp(CURPTR(p), RSTRING_PTR(pattern), RSTRING_LEN(pattern)) != 0) {
- return Qnil;
+ else {
+ onig_free(RREGEXP(regex)->ptr);
+ RREGEXP(regex)->ptr = re;
}
- set_registers(p, RSTRING_LEN(pattern));
+ }
+
+ if (ret == -2) rb_raise(ScanError, "regexp buffer overflow");
+ if (ret < 0) {
+ /* not matched */
+ return Qnil;
}
MATCHED(p);
p->prev = p->curr;
-
if (succptr) {
- succ(p);
+ p->curr += p->regs.end[0];
}
- {
- const long length = last_match_length(p);
- if (getstr) {
- return extract_beg_len(p, p->prev, length);
- }
- else {
- return INT2FIX(length);
- }
+ if (getstr) {
+ return extract_beg_len(p, p->prev, p->regs.end[0]);
+ }
+ else {
+ return INT2FIX(p->regs.end[0]);
}
}
@@ -644,8 +519,7 @@ strscan_do_scan(VALUE self, VALUE pattern, int succptr, int getstr, int headonly
* p s.scan(/\w+/) # -> "test"
* p s.scan(/\w+/) # -> nil
* p s.scan(/\s+/) # -> " "
- * p s.scan("str") # -> "str"
- * p s.scan(/\w+/) # -> "ing"
+ * p s.scan(/\w+/) # -> "string"
* p s.scan(/./) # -> nil
*
*/
@@ -664,7 +538,6 @@ strscan_scan(VALUE self, VALUE re)
* s = StringScanner.new('test string')
* p s.match?(/\w+/) # -> 4
* p s.match?(/\w+/) # -> 4
- * p s.match?("test") # -> 4
* p s.match?(/\s+/) # -> nil
*/
static VALUE
@@ -686,8 +559,7 @@ strscan_match_p(VALUE self, VALUE re)
* p s.skip(/\w+/) # -> 4
* p s.skip(/\w+/) # -> nil
* p s.skip(/\s+/) # -> 1
- * p s.skip("st") # -> 2
- * p s.skip(/\w+/) # -> 4
+ * p s.skip(/\w+/) # -> 6
* p s.skip(/./) # -> nil
*
*/
@@ -831,12 +703,7 @@ static void
adjust_registers_to_matched(struct strscanner *p)
{
onig_region_clear(&(p->regs));
- if (p->fixed_anchor_p) {
- onig_region_set(&(p->regs), 0, (int)p->prev, (int)p->curr);
- }
- else {
- onig_region_set(&(p->regs), 0, 0, (int)(p->curr - p->prev));
- }
+ onig_region_set(&(p->regs), 0, 0, (int)(p->curr - p->prev));
}
/*
@@ -865,14 +732,15 @@ 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);
adjust_registers_to_matched(p);
- return extract_range(p,
- adjust_register_position(p, p->regs.beg[0]),
- adjust_register_position(p, p->regs.end[0]));
+ return extract_range(p, p->prev + p->regs.beg[0],
+ p->prev + p->regs.end[0]);
}
/*
@@ -905,9 +773,8 @@ strscan_get_byte(VALUE self)
p->curr++;
MATCHED(p);
adjust_registers_to_matched(p);
- return extract_range(p,
- adjust_register_position(p, p->regs.beg[0]),
- adjust_register_position(p, p->regs.end[0]));
+ return extract_range(p, p->prev + p->regs.beg[0],
+ p->prev + p->regs.end[0]);
}
/*
@@ -942,9 +809,10 @@ strscan_peek(VALUE self, VALUE vlen)
len = NUM2LONG(vlen);
if (EOS_P(p))
- return str_new(p, "", 0);
+ 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);
}
@@ -960,7 +828,7 @@ strscan_peep(VALUE self, VALUE vlen)
}
/*
- * Sets the scan pointer to the previous position. Only one previous position is
+ * Set the scan pointer to the previous position. Only one previous position is
* remembered, and it changes with each scanning operation.
*
* s = StringScanner.new('test string')
@@ -1085,9 +953,8 @@ strscan_matched(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
- return extract_range(p,
- adjust_register_position(p, p->regs.beg[0]),
- adjust_register_position(p, p->regs.end[0]));
+ return extract_range(p, p->prev + p->regs.beg[0],
+ p->prev + p->regs.end[0]);
}
/*
@@ -1115,7 +982,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;
@@ -1131,7 +998,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 "
@@ -1169,7 +1036,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;
@@ -1183,100 +1049,12 @@ strscan_aref(VALUE self, VALUE idx)
if (i >= p->regs.num_regs) return Qnil;
if (p->regs.beg[i] == -1) return Qnil;
- return extract_range(p,
- adjust_register_position(p, p->regs.beg[i]),
- adjust_register_position(p, p->regs.end[i]));
-}
-
-/*
- * 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,
- adjust_register_position(p, p->regs.beg[i]),
- adjust_register_position(p, p->regs.end[i]));
- rb_ary_push(new_ary, str);
- }
-
- return new_ary;
+ return extract_range(p, p->prev + p->regs.beg[i],
+ p->prev + p->regs.end[i]);
}
/*
- * 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"
@@ -1291,13 +1069,11 @@ strscan_pre_match(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
- return extract_range(p,
- 0,
- adjust_register_position(p, p->regs.beg[0]));
+ return extract_range(p, 0, p->prev + p->regs.beg[0]);
}
/*
- * 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"
@@ -1312,9 +1088,7 @@ strscan_post_match(VALUE self)
GET_SCANNER(self, p);
if (! MATCHED_P(p)) return Qnil;
- return extract_range(p,
- adjust_register_position(p, p->regs.end[0]),
- S_LEN(p));
+ return extract_range(p, p->prev + p->regs.end[0], S_LEN(p));
}
/*
@@ -1328,7 +1102,7 @@ strscan_rest(VALUE self)
GET_SCANNER(self, p);
if (EOS_P(p)) {
- return str_new(p, "", 0);
+ return infect(str_new(p, "", 0), p);
}
return extract_range(p, p->curr, S_LEN(p));
}
@@ -1346,7 +1120,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);
}
@@ -1383,11 +1157,11 @@ strscan_inspect(VALUE self)
p = check_strscan(self);
if (NIL_P(p->str)) {
a = rb_sprintf("#<%"PRIsVALUE" (uninitialized)>", rb_obj_class(self));
- return a;
+ return infect(a, p);
}
if (EOS_P(p)) {
a = rb_sprintf("#<%"PRIsVALUE" fin>", rb_obj_class(self));
- return a;
+ return infect(a, p);
}
if (p->curr == 0) {
b = inspect2(p);
@@ -1395,7 +1169,7 @@ strscan_inspect(VALUE self)
rb_obj_class(self),
p->curr, S_LEN(p),
b);
- return a;
+ return infect(a, p);
}
a = inspect1(p);
b = inspect2(p);
@@ -1403,7 +1177,7 @@ strscan_inspect(VALUE self)
rb_obj_class(self),
p->curr, S_LEN(p),
a, b);
- return a;
+ return infect(a, p);
}
static VALUE
@@ -1432,7 +1206,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, "...");
@@ -1443,23 +1217,6 @@ inspect2(struct strscanner *p)
return rb_str_dump(str);
}
-/*
- * call-seq:
- * scanner.fixed_anchor? -> true or false
- *
- * Whether +scanner+ uses fixed anchor mode or not.
- *
- * If fixed anchor mode is used, +\A+ always matches the beginning of
- * the string. Otherwise, +\A+ always matches the current position.
- */
-static VALUE
-strscan_fixed_anchor_p(VALUE self)
-{
- struct strscanner *p;
- p = check_strscan(self);
- return p->fixed_anchor_p ? Qtrue : Qfalse;
-}
-
/* =======================================================================
Ruby Interface
======================================================================= */
@@ -1570,7 +1327,6 @@ strscan_fixed_anchor_p(VALUE self)
void
Init_strscan(void)
{
-#undef rb_intern
ID id_scanerr = rb_intern("ScanError");
VALUE tmp;
@@ -1637,15 +1393,10 @@ 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);
rb_define_method(StringScanner, "restsize", strscan_restsize, 0);
rb_define_method(StringScanner, "inspect", strscan_inspect, 0);
-
- rb_define_method(StringScanner, "fixed_anchor?", strscan_fixed_anchor_p, 0);
}
diff --git a/ext/strscan/strscan.gemspec b/ext/strscan/strscan.gemspec
deleted file mode 100644
index 4759c6c860..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.3'
- 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}
- s.extensions = %w{ext/strscan/extconf.rb}
- s.required_ruby_version = ">= 2.4.0"
-
- s.authors = ["Minero Aoki", "Sutou Kouhei"]
- s.email = [nil, "kou@cozmixng.org"]
- s.homepage = "https://github.com/ruby/strscan"
- s.license = "BSD-2-Clause"
-
- s.add_development_dependency "rake-compiler"
- s.add_development_dependency "benchmark-driver"
-end
diff --git a/ext/syslog/depend b/ext/syslog/depend
index a3f7db8371..d818fd80aa 100644
--- a/ext/syslog/depend
+++ b/ext/syslog/depend
@@ -1,8 +1,6 @@
# AUTOGENERATED DEPENDENCIES START
syslog.o: $(RUBY_EXTCONF_H)
syslog.o: $(arch_hdrdir)/ruby/config.h
-syslog.o: $(hdrdir)/ruby/assert.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
diff --git a/ext/syslog/extconf.rb b/ext/syslog/extconf.rb
index 1230a4d52e..0fa0bc339b 100644
--- a/ext/syslog/extconf.rb
+++ b/ext/syslog/extconf.rb
@@ -1,11 +1,8 @@
-# frozen_string_literal: false
# $RoughId: extconf.rb,v 1.3 2001/11/24 17:49:26 knu Exp $
# $Id$
require 'mkmf'
-have_library("log") # for Android
-
have_header("syslog.h") &&
have_func("openlog") &&
have_func("setlogmask") &&
diff --git a/ext/syslog/lib/syslog/logger.rb b/ext/syslog/lib/syslog/logger.rb
index 453ca2785c..7040e19d3d 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'
@@ -112,7 +111,7 @@ class Syslog::Logger
end
def #{meth}?
- level <= #{level}
+ @level <= #{level}
end
EOM
end
@@ -202,7 +201,7 @@ class Syslog::Logger
def add severity, message = nil, progname = nil, &block
severity ||= ::Logger::UNKNOWN
- level <= severity and
+ @level <= severity and
@@syslog.log( (LEVEL_MAP[severity] | @facility), '%s', formatter.call(severity, Time.now, progname, (message || block.call)) )
true
end
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index 4c540fc9c7..6aa2cd8484 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,8 +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);
- syslog_ident = strdup(ident_ptr);
+ SafeStringValue(ident);
+ syslog_ident = strdup(RSTRING_PTR(ident));
if (NIL_P(opt)) {
syslog_options = LOG_PID | LOG_CONS;
@@ -296,12 +295,18 @@ static VALUE mSyslog_set_mask(VALUE self, VALUE mask)
* Syslog.log(Syslog::LOG_ALERT, "Out of memory")
* Syslog.alert("Out of memory")
*
+ * Format strings are as for printf/sprintf, except that in addition %m is
+ * replaced with the error message string that would be returned by
+ * strerror(errno).
+ *
*/
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++;
@@ -415,7 +420,6 @@ static VALUE mSyslogMacros_included(VALUE mod, VALUE target)
*/
void Init_syslog(void)
{
-#undef rb_intern
mSyslog = rb_define_module("Syslog");
mSyslogConstants = rb_define_module_under(mSyslog, "Constants");
@@ -502,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..b8656a1d97
--- /dev/null
+++ b/ext/thread/thread.c
@@ -0,0 +1,656 @@
+#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)
+{
+ VALUE que = GET_QUEUE_QUE(self);
+ return RARRAY_LEN(que);
+}
+
+static unsigned long
+queue_num_waiting(VALUE self)
+{
+ VALUE waiters = GET_QUEUE_WAITERS(self);
+ return RARRAY_LEN(waiters);
+}
+
+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);
+ VALUE waiters = GET_SZQUEUE_WAITERS(self);
+ len += RARRAY_LEN(waiters);
+ 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個ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã ã‘を使ã£ã¦ã„ã‚‹å ´åˆã«ã¯ã‚¨ãƒ©ãƒ¼æ™‚ã«ãã®
+ : ã¾ã¾åœæ­¢ã—ã¦ã‚‚通常ã¯å•題ãªã„ãŒï¼Œè¤‡æ•°ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタãŒåŒæ™‚
+ : ã«å‹•作ã—ã¦ã„ã‚‹å ´åˆã«ã¯ï¼Œãれらを管ç†ã™ã‚‹ã‚¤ãƒ™ãƒ³ãƒˆãƒ«ãƒ¼ãƒ—ã¯ï¼‘
+ : 個ã ã‘ã§ã‚ã‚‹ãŸã‚,ã„ãšã‚Œã‹ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã®ã‚¨ãƒ©ãƒ¼ãŒåŽŸå› ã§ï¼Œ
+ : ä»–ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—リタã®å‡¦ç†ç¶™ç¶šãŒä¸å¯èƒ½ã«ãªã‚‹ã“ã¨ãŒã‚る.ãã®
+ : よã†ãªå ´åˆã§ã‚‚エラーを無視ã—ã¦ã‚¤ãƒ™ãƒ³ãƒˆãƒ«ãƒ¼ãƒ—ãŒç¨¼åƒã‚’ç¶šã‘ã‚‹
+ : ã“ã¨ã§ï¼Œä»–ã®ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ—ãƒªã‚¿ãŒæ­£å¸¸ã«å‹•作ã—ç¶šã‘ã‚‹ã“ã¨ãŒã§ãる.
+ : $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..c6a2dd52ff
--- /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.6 8.5 8.4]
+
+TkLib_Config['unsupported_versions'] =
+ %w[8.8 8.7]
+
+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..23c28e2559
--- /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("Warning: fail to call '::safe::disallowTk'") if $DEBUG
+ end
+ else # toplevel path
+ begin
+ @interp._eval("::safe::tkDelete {} #{top} #{slave}")
+ rescue
+ warn("Warning: fail to call '::safe::tkDelete'") if $DEBUG
+ begin
+ @interp._eval("destroy #{top}")
+ rescue
+ warn("Warning: 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..45f86a9253
--- /dev/null
+++ b/ext/tk/lib/tk.rb
@@ -0,0 +1,5775 @@
+#
+# 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?
+ begin
+ #Thread.current[:status].value = TclTkLib.mainloop(false)
+ Thread.current[:status].value = interp.mainloop(false)
+ rescue Exception=>e
+ puts "ignore exception on interp: #{e.inspect}\n" if $DEBUG
+ end
+ end
+
+ ensure
+ # 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
+
+ if !WITH_RUBY_VM || RUN_EVENTLOOP_ON_MAIN_THREAD ### check Ruby 1.9 !!!!!!!
+ at_exit{ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME) }
+ else
+ at_exit{
+ Tk.root.destroy
+ INTERP.remove_tk_procs(TclTkLib::FINALIZE_PROC_NAME)
+ INTERP_THREAD.kill.join
+ }
+ end
+
+ EventFlag = TclTkLib::EventFlag
+
+ 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
+
+ alias subcommand tk_send
+
+ 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 = '2014-10-19'.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..451922c7d3
--- /dev/null
+++ b/ext/tk/lib/tk/autoload.rb
@@ -0,0 +1,762 @@
+#
+# 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 :Fontchooser, 'tk/fontchooser'
+
+ 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..22d70f9c0a
--- /dev/null
+++ b/ext/tk/lib/tk/fontchooser.rb
@@ -0,0 +1,180 @@
+#
+# tk/fontchooser.rb -- "tk fontchooser" support (Tcl/Tk8.6 or later)
+#
+require 'tk'
+require 'tk/font'
+
+module TkFont::Chooser
+ extend TkCore
+end
+
+module Tk
+ Fontchooser = TkFont::Chooser
+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..327ffeeb1a
--- /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'=>'Helvetica 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/tk_mac.rb b/ext/tk/lib/tk/tk_mac.rb
new file mode 100644
index 0000000000..77bb2349cc
--- /dev/null
+++ b/ext/tk/lib/tk/tk_mac.rb
@@ -0,0 +1,158 @@
+#
+# tk/tk_mac.rb : Access Mac-Specific functionality on OS X from Tk
+# (supported by Tk8.6 or later)
+#
+# ATTENTION !!
+# This is NOT TESTED. Because I have no test-environment.
+#
+require 'tk'
+
+module Tk
+ module Mac
+ end
+end
+
+module Tk::Mac
+ extend TkCore
+
+ # event handler callbacks
+ def self.def_ShowPreferences(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::ShowPreferences {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OpenApplication(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OpenApplication {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_ReopenApplication(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::ReopenApplication {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OpenDocument(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OpenDocument {args} { eval #{install_cmd(cmd)} $args }")
+ nil
+ end
+
+ def self.def_PrintDocument(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::PrintDocument {args} { eval #{install_cmd(cmd)} $args }")
+ nil
+ end
+
+ def self.def_Quit(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::Quit {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OnHide(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OnHide {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_OnShow(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::OnShow {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+ def self.def_ShowHelp(cmd=Proc.new)
+ ip_eval("proc ::tk::mac::ShowHelp {} { #{install_cmd(cmd)} }")
+ nil
+ end
+
+
+ # additional dialogs
+ def self.standardAboutPanel
+ tk_call('::tk::mac::standardAboutPanel')
+ nil
+ end
+
+
+ # system configuration
+ def self.useCompatibilityMetrics(mode)
+ tk_call('::tk::mac::useCompatibilityMetrics', mode)
+ nil
+ end
+
+ def self.CGAntialiasLimit(limit)
+ tk_call('::tk::mac::CGAntialiasLimit', limit)
+ nil
+ end
+
+ def self.antialiasedtext(num)
+ tk_call('::tk::mac::antialiasedtext', num)
+ nil
+ end
+
+ def self.useThemedToplevel(mode)
+ tk_call('::tk::mac::useThemedToplevel', mode)
+ nil
+ end
+
+end
+
+class Tk::Mac::IconBitmap < TkImage
+ TkCommandNames = ['::tk::mac::iconBitmap'].freeze
+
+ def self.new(width, height, keys)
+ if keys.kind_of?(Hash)
+ name = nil
+ if keys.key?(:imagename)
+ name = keys[:imagename]
+ elsif keys.key?('imagename')
+ name = keys['imagename']
+ end
+ if name
+ if name.kind_of?(TkImage)
+ obj = name
+ else
+ name = _get_eval_string(name)
+ obj = nil
+ Tk_IMGTBL.mutex.synchronize{
+ obj = Tk_IMGTBL[name]
+ }
+ end
+ if obj
+ if !(keys[:without_creating] || keys['without_creating'])
+ keys = _symbolkey2str(keys)
+ keys.delete('imagename')
+ keys.delete('without_creating')
+ obj.instance_eval{
+ tk_call_without_enc('::tk::mac::iconBitmap',
+ @path, width, height, *hash_kv(keys, true))
+ }
+ end
+ return obj
+ end
+ end
+ end
+ (obj = self.allocate).instance_eval{
+ Tk_IMGTBL.mutex.synchronize{
+ initialize(width, height, keys)
+ Tk_IMGTBL[@path] = self
+ }
+ }
+ obj
+ end
+
+ def initialize(width, height, keys)
+ @path = nil
+ without_creating = false
+ if keys.kind_of?(Hash)
+ keys = _symbolkey2str(keys)
+ @path = keys.delete('imagename')
+ without_creating = keys.delete('without_creating')
+ end
+ unless @path
+ Tk_Image_ID.mutex.synchronize{
+ @path = Tk_Image_ID.join(TkCore::INTERP._ip_id_)
+ Tk_Image_ID[1].succ!
+ }
+ end
+ unless without_creating
+ tk_call_without_enc('::tk::mac::iconBitmap',
+ @path, width, height, *hash_kv(keys, true))
+ end
+ end
+end
diff --git a/ext/tk/lib/tk/toplevel.rb b/ext/tk/lib/tk/toplevel.rb
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..b44b629e46
--- /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 planned list
+(or change its status position), please request them at the ruby-talk,
+ruby-list, or ruby-dev ML. Although we cannot promise to support your
+requests, we'll try to do.
+
+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..37f63509e9
--- /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 initialize(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..a1ebe86692
--- /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::pixelToCoords', 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::pixelToCoords', @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..ebeba0b43a
--- /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
+
+require '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..6519f32cb5
--- /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 initialize(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/validator.rb b/ext/tk/lib/tkextlib/tcllib/validator.rb
new file mode 100644
index 0000000000..3a71960afa
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tcllib/validator.rb
@@ -0,0 +1,65 @@
+#
+# tkextlib/tcllib/validator.rb
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+# * Part of tcllib extension
+# * Provides a unified validation API
+#
+
+require 'tk'
+require 'tkextlib/tcllib.rb'
+
+# TkPackage.require('widget::validator', '0.1')
+TkPackage.require('widget::validator')
+
+module Tk::Tcllib
+ module Validator
+ PACKAGE_NAME = 'widget::validator'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('widget::validator')
+ rescue
+ ''
+ end
+ end
+ end
+end
+
+module Tk::Tcllib::Validator
+ extend TkCore
+
+ def self.attach(widget, color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'attach', widget, color, cmd)
+ nil
+ end
+
+ def self.detach(widget)
+ tk_call_without_enc('::widget::validator', 'detach', widget)
+ nil
+ end
+
+ def self.validate(widget)
+ tk_call_without_enc('::widget::validator', 'validate', widget)
+ nil
+ end
+
+ def attach_validator(color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'attach', @path, color, cmd)
+ self
+ end
+
+ def detach_validator(color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'detach', @path)
+ self
+ end
+
+ def invoke_validator(color, cmd=Proc.new)
+ tk_call_without_enc('::widget::validator', 'validate', @path)
+ self
+ end
+ alias validate_validator invoke_validator
+end
diff --git a/ext/tk/lib/tkextlib/tcllib/widget.rb b/ext/tk/lib/tkextlib/tcllib/widget.rb
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..85d7831671
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tile/treeview.rb
@@ -0,0 +1,1336 @@
+#
+# 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 tag_has
+ @t.tag_has(@id)
+ end
+
+ def add(*items)
+ @t.tag_add(@id, *items)
+ end
+
+ def remove(*items)
+ @t.tag_remove(@id, *items)
+ end
+
+ def bind(seq, *args)
+ if TkComm._callback_entry?(args[0]) || !block_given?
+ cmd = args.shift
+ 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
+
+ def tag_names
+ tk_split_simplelist(tk_send('tag', 'names')).collect{|id|
+ Tk::Tile::Treeview::Tag.id2obj(self, id)
+ }
+ end
+
+ def tag_add(tag, *items)
+ fail ArgumentError, "no target items" if items.empty?
+ tk_send('tag', 'add', tagid(tag), *(items.collect{|item| tagid(item)}))
+ self
+ end
+
+ def tag_remove(tag, *items)
+ tk_send('tag', 'remove', tagid(tag), *(items.collect{|item| tagid(item)}))
+ self
+ end
+
+end
+
+#Tk.__set_toplevel_aliases__(:Ttk, Tk::Tile::Treeview, :TkTreeview)
+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/dted.rb b/ext/tk/lib/tkextlib/tkimg/dted.rb
new file mode 100644
index 0000000000..cae833664c
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/dted.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'DTED'
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tkimg/setup.rb'
+
+# TkPackage.require('img::dted', '1.4')
+TkPackage.require('img::dted')
+
+module Tk
+ module Img
+ module DTED
+ PACKAGE_NAME = 'img::dted'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::dted')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/gif.rb b/ext/tk/lib/tkextlib/tkimg/gif.rb
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/raw.rb b/ext/tk/lib/tkextlib/tkimg/raw.rb
new file mode 100644
index 0000000000..5f1cdcaac0
--- /dev/null
+++ b/ext/tk/lib/tkextlib/tkimg/raw.rb
@@ -0,0 +1,33 @@
+#
+# TkImg - format 'Raw Data'
+# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
+#
+require 'tk'
+
+# call setup script for general 'tkextlib' libraries
+require 'tkextlib/setup.rb'
+
+# call setup script
+require 'tkextlib/tkimg/setup.rb'
+
+# TkPackage.require('img::raw', '1.4')
+TkPackage.require('img::raw')
+
+module Tk
+ module Img
+ module Raw
+ PACKAGE_NAME = 'img::raw'.freeze
+ def self.package_name
+ PACKAGE_NAME
+ end
+
+ def self.package_version
+ begin
+ TkPackage.require('img::raw')
+ rescue
+ ''
+ end
+ end
+ end
+ end
+end
diff --git a/ext/tk/lib/tkextlib/tkimg/setup.rb b/ext/tk/lib/tkextlib/tkimg/setup.rb
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+uIJgU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AAAFEaAgfs/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-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..9322200ef8
--- /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 = 'unchangeable'
+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..b4c42b6199
--- /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 achieve much the same effect by simply moving\
+the mouse over the window you're curious about and pressing the\
+Help or F1 keys. You can do this anytime.
+EOF
+
+$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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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ 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'
+ 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//AP/MzP/Mmf/MAP+Zmf+ZZv+ZAMz//8zM
+ zMyZmcyZZsxmZsxmAMwzAJnMzJmZzJmZmZlmmZlmZplmM5kzM2aZzGZmzGZm
+ mWZmZmYzZmYzMzN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eKz/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 "下ã«ã¯ï¼”ã¤ã®ãƒã‚§ãƒƒã‚¯ãƒœã‚¿ãƒ³ãŒè¡¨ç¤ºã•れã¦ã„ã¾ã™ã€‚クリックã™ã‚‹ã¨ãƒœã‚¿ãƒ³ã®é¸æŠžçŠ¶æ…‹ãŒå¤‰ã‚りã€Tcl変数(TkVariableオブジェクトã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã™ï¼‰ã«ãã®ãƒœã‚¿ãƒ³ã®çŠ¶æ…‹ã‚’ç¤ºã™å€¤ã‚’設定ã—ã¾ã™ã€‚最åˆã®ãƒœã‚¿ãƒ³ã®çŠ¶æ…‹ã¯ä»–ã®ï¼“ã¤ã®ãƒœã‚¿ãƒ³ã®çŠ¶æ…‹ã«ã‚‚ä¾å­˜ã—ã¦å¤‰åŒ–ã—ã¾ã™ã€‚ã‚‚ã—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)
+以下ã«ã¯ï¼”種類ã®ã‚¨ãƒ³ãƒˆãƒªãƒœãƒƒã‚¯ã‚¹ãŒè¡¨ç¤ºã•れã¦ã„ã¾ã™ï¼Žå„エントリボックスã¯ï¼Œ\
+マウスクリックã§é¸æŠžã—文字を打ã¡è¾¼ã‚€ã“ã¨ãŒå¯èƒ½ã§ã™ãŒï¼Œãれãžã‚ŒãŒã©ã®ã‚ˆã†ãª\
+入力をå—ã‘付ã‘ã‚‹ã“ã¨ãŒã§ãã‚‹ã‹ã«ã¯åˆ¶ç´„ãŒè¨­ã‘られã¦ã„ã¾ã™ï¼Ž\
+一ã¤ã‚ã®ã‚¨ãƒ³ãƒˆãƒªãƒœãƒƒã‚¯ã‚¹ã¯æ•´æ•°ã¨è¦‹ãªã•れる文字列ã‹å…¥åŠ›æ–‡å­—ãŒãªã„空ã®çŠ¶æ…‹ã‹\
+ã®å ´åˆã ã‘ã‚’å—ã‘付ã‘,å•題ãŒã‚ã‚‹å ´åˆã¯ã‚¨ãƒ³ãƒˆãƒªãƒœãƒƒã‚¯ã‚¹ãŒç‚¹æ»…ã—ã¾ã™\
+(フォーカスãŒåŽ»ã‚‹æ™‚ã«ãƒã‚§ãƒƒã‚¯ã•れã¾ã™ï¼‰ï¼Ž\
+二ã¤ã‚ã®ã‚¨ãƒ³ãƒˆãƒªãƒœãƒƒã‚¯ã‚¹ã¯ï¼Œå…¥åŠ›ã•ã‚ŒãŸæ–‡å­—列ã®é•·ã•ãŒ\
+ï¼‘ï¼æ–‡å­—未満ã®å ´åˆã ã‘ã‚’å—ã‘付ã‘,制é™ã‚’è¶Šãˆã¦æ›¸ã込もã†ã¨ã—ãŸã¨ãã«ã¯\
+ベルを鳴らã—ã¦çŸ¥ã‚‰ã›ã¾ã™ï¼Ž\
+三ã¤ã‚ã¯ç±³å›½ã®é›»è©±ç•ªå·ã‚’å—ã‘付ã‘るエントリボックスã§ã™ï¼Ž\
+アルファベットã¯ï¼Œé›»è©±æ©Ÿã®ãƒ€ã‚¤ãƒ¤ãƒ«ä¸Šã§å¯¾å¿œã¥ã‘られã¦ã„ã‚‹æ•°å­—ã«å¤‰æ›ã•れã¾ã™ï¼Ž\
+ä¸é©åˆ‡ãªæ–‡å­—ãŒå…¥åŠ›ã•れãŸã‚Šæ•°å­—ä»¥å¤–ã®æ–‡å­—ã®ä½ç½®ã«æ•°å­—を入力ã—よã†ã¨ã—ãŸã‚Š\
+ã—ãŸå ´åˆã«ã¯è­¦å‘Šã®ãƒ™ãƒ«ãŒé³´ã‚Šã¾ã™ï¼Ž\
+å››ã¤ã‚ã®ã‚¨ãƒ³ãƒˆãƒªãƒœãƒƒã‚¯ã‚¹ã¯ï¼Œï¼˜æ–‡å­—ã¾ã§ã®å…¥åŠ›ã‚’å—ã‘付ã‘ã‚‹\
+パスワードフィールドã§ã™ï¼ˆï¼˜æ–‡å­—以上ã¯ç‰¹ã«è­¦å‘Šã‚’出ã™ã“ã¨ãªã無視ã•れã¾ã™ï¼‰ï¼Ž\
+入力ã•ã‚ŒãŸæ–‡å­—ã¯ã‚¢ã‚¹ã‚¿ãƒªã‚¹ã‚¯è¨˜å·ã«ç½®ãæ›ãˆã¦è¡¨ç¤ºã•れã¾ã™ï¼Ž
+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..95c0e3b869
--- /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 achieve much the same effect by simply moving\
+the mouse over the window you're curious about and pressing the\
+Help or F1 keys. You can do this anytime.
+EOF
+
+$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)
+下ã«ã¯ï¼“種類ã®ã‚¹ãƒ”ンボックスãŒè¡¨ç¤ºã•れã¦ã„ã¾ã™ã€‚
+ãれãžã‚Œã€ãƒžã‚¦ã‚¹ã§é¸æŠžã—ã¦æ–‡å­—を入力ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
+編集æ“作ã¨ã—ã¦ã¯ã€Emacs å½¢å¼ã®å¤šãã«åŠ ãˆã¦ã€ä¸€èˆ¬çš„ãª
+Motif å½¢å¼ã®ã‚­ãƒ¼æ“作ãŒã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã™ã€‚ãŸã¨ãˆã°ã€
+Backspace 㨠Control-h ã¨ã¯å…¥åŠ›ã‚«ãƒ¼ã‚½ãƒ«ã®å·¦å´ã®æ–‡å­—ã‚’
+削除ã—ã€Delete 㨠Control-d ã¨ã¯å³å´ã®æ–‡å­—を削除ã—ã¾ã™ã€‚
+入力枠ã®é•·ã•ã‚’è¶Šãˆã‚‹ã‚ˆã†ãªé•·ã„文字列を入力ã—ãŸå ´åˆã«ã¯ã€
+マウスã®ãƒœã‚¿ãƒ³ï¼’を押ã—ã¦ãƒ‰ãƒ©ãƒƒã‚°ã™ã‚‹ã“ã¨ã§ã€å…¥åŠ›æ–‡å­—åˆ—
+をスキャンã™ã‚‹ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚
+ãªãŠã€æœ€åˆã®ã‚¹ãƒ”ンボックスã¯ã€æ•´æ•°å€¤ã¨ã¿ãªã•れるよã†ãª
+文字列ã—ã‹å…¥åŠ›ãŒè¨±ã•れãªã„ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。ã¾ãŸã€
+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', '例ãˆã°ï¼Œã“ã“ã«ã¯ï¼’ã¤ã®')
+$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', "ã«ã—ã¾ã™ã€‚ã¾ãŸã€ï¼’ã¤ã‚ã®ãƒœã‚¿ãƒ³ã‚’クリックã™ã‚‹ã¨\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+CldmB6r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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ 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, 0x20, 0xa8, 0xdf, 0xb5,
+ 0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0,
+ 0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20,
+ 0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00,
+ 0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10,
+ 0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9,
+ 0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef,
+ 0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf,
+ 0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe,
+ 0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91,
+ 0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04,
+ 0x04, 0x00, 0xa4, 0xff,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x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe,
+ 0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40,
+ 0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10,
+ 0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29,
+ 0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00,
+ 0xf8, 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, 0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xbb,
+ 0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5,
+ 0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01,
+ 0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00,
+ 0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b,
+ 0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 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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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, 0xf0, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
+ 0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00,
+ 0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01,
+ 0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07,
+ 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x0e,
+ 0xf0, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x1c,
+ 0x38, 0x00, 0x00, 0x00, 0x0f, 0x38, 0x38, 0x00, 0x00, 0x80, 0x07, 0x38,
+ 0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x1c, 0x04, 0x00, 0xe0, 0x41, 0x70,
+ 0x1c, 0x04, 0x00, 0xf0, 0x40, 0x70, 0x1c, 0x74, 0x00, 0x78, 0x4e, 0x70,
+ 0x0e, 0x04, 0x00, 0x3c, 0x4a, 0xe0, 0x0e, 0x74, 0x03, 0x1e, 0x4a, 0xe0,
+ 0x0e, 0x04, 0x00, 0x0f, 0x4e, 0xe0, 0x0e, 0x04, 0x80, 0x07, 0x40, 0xe0,
+ 0x0e, 0x04, 0xf8, 0x0f, 0x40, 0xe0, 0x0e, 0x04, 0xe0, 0x01, 0x40, 0xe0,
+ 0x0e, 0x04, 0xf8, 0x00, 0x40, 0xe0, 0x0e, 0x04, 0x78, 0x00, 0x40, 0xe0,
+ 0x0e, 0x04, 0xfc, 0xf3, 0x40, 0xe0, 0x1c, 0x04, 0x1e, 0x00, 0x40, 0x70,
+ 0x1c, 0x04, 0x0f, 0x00, 0x40, 0x70, 0x1c, 0x84, 0x07, 0x00, 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.ppm
new file mode 100644
index 0000000000..b8ab85f3a5
--- /dev/null
+++ b/ext/tk/sample/images/teapot.ppm
@@ -0,0 +1,31 @@
+P6
+256 256
+255
+\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À[7 eOLjQLmSMoTMnSMlRMhPL_9 \À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀnSMtVMzYN~[N~[N\N\O€\O€]O€]O€]O€]O€\O€\O}[NyYNtVM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀG-wXN}[N€]O„^O†_O†`O‡`Oˆ`Oˆ`OˆaO‰aO‰aO‰aO‰aO‰aO‰aOˆaOˆ`O†_Oƒ^O\N \À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀaMLyYN…_O‰aP‹bPcPŽcPŽdPŽdPdPdPdPdPdPdPdPeP‘eP’eP’eP‘ePdPcP…_OpUM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀwXN…_OdP“fP•gQ–hQ˜hQ˜iQ™iQ™iQšiQšiQšjQ›jQ›jQœjQœjQœjQœjQœjQ›jQœjQ™iQ“fP‡`O\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJiQL‹bP—hQkQ¡mR¤nR¥oR¥oR¥oR¥oR¥oR¥oR¦oR¦oR¦pR¨pS©qSªqS«rS¬rS«rS©qS¤oRœjQ€]O\KK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀfOLrUMcPŸlR©qS¯tS²uTµwT·xT¸xT¹yTºyT»zT»zU¼zU¼zU¼zU»zUºyT¸xT¶wT¯tS¡mR‰aOhPL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\Àa0 cNLqUM€\O”fQ¦pS²wVºzV¿|VÂ}VÄVÆVÇ€VÉ‚WÌ…[Õeæ w÷³‹êª…Ĉg§qT“fQ{ZNYIK9\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀO1{G#‘JkRMqUMtVN–iS¨v\·€d¹bµzZ±vU°uT®sSªqS¤nRœjQ’eP„^OrUMHh>!T4\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀG-V5wE"~I#†M%U+¥e7²l:°g2®b*­a(­`(©^(¥])¡^-›]1ŠS,qC$`9 R3G-\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À@)J/i>!pA"tD"wF$yH&xH&tE$wE#yG%}M+ƒT4S5mE*Z7!K/B*;'\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À‰aO¦oR½{UÇ€VÏ…X<(F-a: e<!h>!j@#k@$h>"d<!c=$hD-fF2[<)K0@);'5$Ë‚VÇ€V¿|U_LKYIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À…_O·xTÉ‚Wó«€ûµ‹Ö’k¼|X×>µf-¨^(¡Z'šW&–T&œN>)F-J/b; g>#nD(jB&c<!b=%jH2_A/I0!<(8&5$”J¥Y’S%8&;'?)E,<:HA=HE?IJAISFJYIKXIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À£nRÁ}UܘqÊŠe±vU²e,™V&¥V†C €@ |> y< u: r9 o7 l6
+j5
+h4
+g3
+5$D,K/b; h>"wM1tK.e="a<#cA,U8&E-<(9&.!a0 b1 c1    
+
++3#@)46G<:HMCIXHK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀU*´vT¿~X¸{YÃk+›W&‰N$|> u: p8 k5
+f3
+a0 _/ ]. [- I¡\*ª_(‘LkRMmSMmSMnSMnSMD,R3W5mA"|O0|P1j?"c<!a=%Y7"N1F,;'NCJNCJNDJODJODJODJh>!a: X/K%
+g3
+a0 Z- \/ T*Q(ŠHµm8kRMmSMnTMoTMpTMpUM15G15G05G04G04GpUMpTM5^9 d<!yF#O+€N,rC#qB"pB#k?"a: Z7 6ODJPDJPEJQEJQEJREJREJREJRFJSFJSFJSFJSFJe<!X/
+^/ V+Q(L&I$r9  TlRMnSM46G47G47G46G46G46G46G46G36G36G25G25G15G04G/4F.3F
+
+X&pUMuWMwXNxXN<:H<:H<:H<:H<;H<;H<;H<;H=;H=;H=;H=;H>;H>;H?<H@<HA=HC>HG@ILBIREJ[JKcNLjQL§pR±uTºzUÃ~VÈWË‚XÖŽcäsÒŽe¼{V²vT¨pSžkR•gQŒbP†_O‚^O]O€\O€\O€\O€\O€]O]O]O]O]O]O]O]O]O]O]O€\O€\O~\N}[N|ZNxXN•T%H$
+›W&rVMvWNyYNzYN|ZN}[N}[N><H?<H?<H?<H?<H?<H@<H@<H@<HA=HA=HB=HC>HE?IG@IIAIKBIODJSFJWHK—hQŸlR§pR°b(¾i*Én+Ù|7Û|6Ïr,Íq+Êp-Ãl+»g)±b(®sS§pS lRšiQ•gQePcPŠaPˆaO‡`O‡`O†_O†_O…_O…_O…_O…_O…_O…_O…_O„_O„^O„^Oƒ^Oƒ^O‚]O]O€\O~[N{ZN•T%
+
+ 
+@%<-$G?@…pfdNLuWM\NdNL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀTFJvWN‰aP./01„E}[N]O…_Oˆ`O‰aP‹bPŒbPcPcPŽcPdPdPdPeP‘eP’eP’eP“fP“fQ”fQ•gQ•gQ–gQ–hQ—hQ˜hQ™iQšiQ›jQœjQkQkRžlRŸlRžY&¤\'¨^'µ^½bÀcÃeÇi ÄgÀc½b¼a¹`µ^´]¯X¢[' Z'žY&¢mR¡mR¡mR lRŸlRŸlRžkRkQœkQœjQ›jQšjQšiQ™iQ™iQ˜iQ˜hQ—hQ—hQ—hQ–gQ–gQ•gQ•gQ•gQ”fQ”fQ“fQ“fP’eP‘ePdPcP‰aP—O
+ B\À\À\À\À\À\À\À\À\À\À%7!!C*F#P) {dYœze»p€\OgPL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ`LKvWNŠaPm6
+ 
+$5 ¬`(¶e)£nRœjQƒ^OJAI\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀXIK^KKdNLhPLuWM‚]OŒbP”fQeP m6
+†`OŽcP“fQ—hQ˜hQ™iQšiQšjQ›jQ›jQ›jQœjQœjQœjQœkQkQkQkRžkRžkRžkRžlRŸlRŸlRŸlR lR lR lR¡mR¡mR¡mR¡mRºg)³c(²c(±b(­V¿cÂeÅi!Åi!Àd¼bº`¹`·_·_¶^¢Q§]'ª_(­`(¹f)£nR£nR£nR£nR£nR£nR£nR¢nR¢nR¢nR¢nR¢nR¢nR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢mR¢nR¢mR¢mR£nR¢mR¢mR¡mR mRkR—hQˆGa0 ŠbP mRœjQ“fQ‰aP}[NrUMmSM…L$\À\À\À\À\À\À\À\À B B #C, 8&H.Z7 §pR›jQ{ZN\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀQEJ[JK`LKdNLhQLqUM{ZN…_OŽcP–gQ—hQ
+‹bP‘eP–hQšiQ›jQœjQkQkQkRžkRžkRžlRžlRŸlRŸlRŸlRŸlRŸlR lR lR lR mR¡mR¡mR¡mR¡mR¡mR¢mR¢mR¢mR¢nR£nRÀj*ºg)·e)¶d)Âd°XÅgÅhÂe¿c½b½b¾bªU­`(®a(¯a(³c(¾i*¤oR¤oR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤nR¤oR¤oR¥oR¥oR¥oR¥oR¥oR¥oR¦oR¦oR¥oR¥oR¤nR¡mR›jQŽQ%Z- œjQ£nRŸlR—hQŽdP…_OuWMpTMnSMkRLa: \À\À\À\À\À\À\À B B&D2 @*S6#G@IPDJ˜hQmSM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀVGJ]KKbMLeOLiQLlRMvWN\OˆaO‘eP—hQœjQ•gQ
+!C+E'0F.4F7%8%U/lG.SFJZIK]KKZIKB=H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀREJZJK`LKdNLgPLjQLlRMnSMpTMqUMtWMxXN{ZN~[N]O„^O†`O‰aO‹bPdP•gQ™iQœkQ lR¤nR§pSªrS­sS¯tT²uT´vT¶wT·xT¹yT¹yTºyTºyT¹yT¶xT´vT¬rS¢nR—hQ¿|U¿|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ|UÀ}UÀ}UÁ}UÁ}UÁ}UÁ}UÂ}UÂ~UÃ~UÃ~VÃ~VÄVÅ€WÆX®a(ŸlRªrS´vT¸yT¼zU¾|UÁ~VÃXÆ‚[Ɇ_΋dÓ‘jÔ“mÔ“nБlÊŒhĆd½_¶{[°vWªsU¦pS¢nRžkRšiQ˜hQ•gQ“fQ‘ePdPŒbP‰aO†_Oƒ^O€\O|ZNxXNsVMpTMnTMmSMjQL€C B)D&/F-3F47G6%>" Y7 kA$YIK]KK^KKSFJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀVGJ\KKbMLeOLhPLkRLmSMnTMpTMrUMuWNyYN|ZN\N‚]O„_O‡`OŠaPŒbPŽcPeP“fP—hQ›jQžlR¢nR¥oS©qT¬sT¯uU²vU´wV¶xV¸yV¹yUºzU»zU¼{U½{U¾{U¾|U¿|U¿|U¿|U¿|U¾{U½{U¼{U¼zU»zTºyT¹yT¸xTµwT³vT´vT´vT´vT´wT´wTµwT·xT¹yTºzT¼zU½{U¾{U¿|UÀ|UÂ}UÄVÅ€WÇ‚YÉ„\͈_ÑŒdÙ”láuç£|쩂ſt명æ¦ÞŸ{Õ—sËŽl†d¹^³yZ­uW¨qU¤oSŸlRžkRœjQšiQ˜hQ–gQ”fQ‘ePdPcPŠaP‡`O„^O]O}[NyYNuWMpTMoTMmSMkRLgPL&D#.E,3F46G;'<(D"iB(VGJ]KK`LK[JKB>H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJYIK^LKcNLfOLiQLkRMmSMoTMqUMsVMvXNzYN}[N€\O‚^O…_Oˆ`OŠaPŒcPdP‘eP“fQ•gQ—hQ™iQkR mS¤oT¨rU¬tW°wY´zZ¸}\»]¾€^À^Á‚^‚^Â\Á€ZÁYÁXÁ~WÁ~WÂ~VÂ~VÂ~VÃ~VÃ~UÃ~UÄ~UÄ~UÄUÄUÅVÅVÅVÅVÆVÆ€VÆ€VÇ€WÇWÈ‚XɃZË…[͇^ЊaÓdØ’iÜ—nâtè£zî©ó¯‡ø´û¸‘üº“û¹“÷¶ñ±Œé©…à¡~Ö˜vËmÇf»€`´z[®vX©rU¥pT£oS¢nS lRžkRœkRšjQ˜iQ–hQ”fQ’ePdPcP‹bPˆ`O…_O‚]O~[NzYNvWNpTMoTMnSMkRMhQLo7 ,2F36G99HC+@ ]8 nA"\JK`ML_LKSFJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ[JK`LKdNLgPLjQLlRMnSMpTMqUMtVMwXNzZN}[N€]Oƒ^O†_OˆaO‹bPcPdP‘eP“fQ•gQ—hQ™iQ›jRžlR mS£oU§rW¬vZ²{]¹€a¿…fÅŠjËnГqÓ•sÕ–sÕ–rÕ–qÕ”oÓ’mÑjÏgÍŠcˈaɆ^È„\Ç‚[ÆYÅ€XÅ€WÅWÅWÅVÅVÅWÅ€WÆ€WÇXÈ‚YɃ[Ê…\͇_ÏŠaÒeÕ‘hÙ•mÝ™qávä¡zç¤}꧀멃몄騃奀ߠ|Ù›wÓ•rÌmƉh¿„c¸~^²yZ®vX¬tWªsV¨qU¦pT¤oS¢nS mRžlRœkR›jQ™iQ—hQ•gQ“fPePŽcP‹bPˆaO…_O‚^O\N{ZNwXNsVMoTMnSMlRMiQL~I#26G99G?<HA*E$ i@$ZIKaMLbML[JK;:H\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀWHJ]KKbMLeOLhPLjRLlSMnTMpTMrUMuWMxXN{ZN~\N]O„^O†`O‰aO‹bPŽcPdP’eP”fQ–gQ˜hQšiQœkRžlS mT£oU¦rWªuZ¯y]´~aºƒfŠlË’sÔšzÜ¡€ã§†è«‰ë®‹í¯Œí®‹ë¬ˆè¨„ã£~ßžyÚ™tÖ•oÒjÎŒfˈbÈ…_ƃ\ÅZÄ€YÃXÂWÂ~WÂ~WÂ~WÃXÀXÄ€YÅZƃ\Ç…^Ɇ`ˈbÌŠdÍ‹fÎgÎŽiÎŽjÎŽjÍŽjËŒiljgÆd¿ƒaº^¸}]¶|\´{[²yZ°xY®vX¬tWªsV¨qU¦pT¤oS¢nS mRžlRkR›jQ™iQ—hQ•gQ“fP‘ePŽdPŒbP‰aO†_Oƒ^O€\O|ZNxXNtVMpTMnSMmSMjQLgPL99G?<HG-E&b;!YIK`MLdOM`LKNCJ\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀŸlRºyTÄ~UÊ‚XʃYÄXº{W­tUšW'¢[(—hQ lRcP€\OhQL\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀNCJYIK^LKcNLfOLiQLkRLmSMoTMqUMrVMvWNyYN|ZN\N‚]O„_O‡`O‰aPŒbPŽcPdP’fP”gQ–hQ˜iQšjRœkRžlS¡nT¤pU§sW«vZ°z]µb»„gŠlÉ‘sИyØžÞ¤…㩊è­ì±ï³‘ﳑ뭊穅⣀ݞzؘtÒ“nÎiɉdÆ…`Â]Á€[¿~Y¾}X½|W½|V¼{V¼{V¼{V¼{V¼{V¼|W¼|W½}X½}Y½~Z½~Z¼~Z»}[º}[º}[º~\º~\º~]º~]¹~]¸~]·}]¶|\´z[²yZ°wY®vX¬tWªsV¨rU¦pT¤oS¢nS mRŸlRkR›jQšiQ˜hQ–gQ“fQ‘ePdPŒcPŠaP‡`O„^O]O}[NyYNuWNpTMnTMmSMkRLhPL|H$D>IQ2P+XHK_LLfQOcNLXIK\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À©qSºyTÃ~VΈ`遲ޜv¾€]ªqS–LŽG|> g3
+S)?*%.—hQ—hQ‘eP‡`OuWM\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\ÀSFJ[JK`LKdNLgPLjQLlRMnSMoTMqUMsVMwXNzYN}[N€\O‚^O…_O‡`OŠaPŒbPŽdP‘eP“fP•gQ—hQ˜iQšjRœkRŸlS¡nT¤pV§sX«vZ°z^¶b¼…gËmÊ’sјzØŸ€Þ¤…㩊è­ê¯ë°ê¯Žè¬‹å¨‡à¤‚Ûž|Ö™wÑ“qÌŽlljgÃ…bÀ‚_½\»}Zº{X¹zW¸yV·yU·xU·xU·xT·xT·xU·xU·xU·yV·yV·yW¸zW¸{X¹{Y¹|Zº}[º}[º}\º~\¹~]¹~]¸}]·|\µ{\´z[²yZ°wY®vX¬tWªsV¨rU¦pT¤oS¢nS¡mRŸlRkRœjQšiQ˜hQ–gQ”fQ’ePdPcPŠbP‡`O…_O‚]O~[NzZNvWNrUMoTMmSMlRMiQLeOLJAIJ(h>!]KKfQOgQN_LKD>I\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À\À™iQ°tS¸yT¼{UÂYÎŒeï­ˆô´Õ—u¶|\ Z'™LˆD |>
+
+ &3#.$-% .% .& /&!,#,#@70A71XNHXNHWNHWNHZRLYQLYQLXQLWQLWPLUOLSNLQMKOLJMJJ0//.-.,,-&(+"(!'
+ %' %$#" ! !$ 
diff --git a/ext/tk/sample/irbtk.rb b/ext/tk/sample/irbtk.rb
new file mode 100644
index 0000000000..70dd33e4da
--- /dev/null
+++ b/ext/tk/sample/irbtk.rb
@@ -0,0 +1,30 @@
+#!/usr/local/bin/ruby
+#
+# irbtk.rb - irb with Ruby/Tk
+#
+# If you want to use '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..d76dd17b83
--- /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'=>'Helvetica 12 bold')
+menubar.pack('side'=>'top', 'fill'=>'x')
+
+TkText.new(:wrap=>'word').pack.insert('1.0', 'Please read the sample source, and check how to override default configure options of menu entries on a menu_spec. Maybe, on windows, this menubar does not work properly about keyboard shortcuts. Then, please use "menu" option of root/toplevel widget (see sample/menubar2.rb).')
+
+Tk.mainloop
diff --git a/ext/tk/sample/menubar2.rb b/ext/tk/sample/menubar2.rb
new file mode 100644
index 0000000000..076e1947a5
--- /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'=>'Helvetica 12 bold')
+# This (default configure options) is NOT same the following.
+#
+# mbar = Tk.root.add_menubar(menu_spec)
+# mbar.configure('foreground'=>'grey40', 'activeforeground'=>'red',
+# 'font'=>'Helvetica 12 bold')
+
+TkText.new(:wrap=>'word').pack.insert('1.0', 'Please read the sample source, and check how to override default configure options of menu entries on a menu_spec.')
+
+Tk.mainloop
diff --git a/ext/tk/sample/menubar3.rb b/ext/tk/sample/menubar3.rb
new file mode 100644
index 0000000000..246970e61c
--- /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'=>'Helvetica 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', 'Löschen', 'iso8859-1'
+ de 'Error', 'Fehler'
+ de 'Exit', 'Ende'
+ de 'Green', 'Grün', 'iso8859-1'
+ de 'Red', 'Rot'
+ de 'blue', 'blau'
+ de 'green', 'grün', '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", "Wähle Verzeichnis", 'iso8859-1'
+ de "&Clear", "&Rücksetzen", 'iso8859-1'
+ de "&Clear Console", "&Konsole löschen", 'iso8859-1'
+ de "Color", "Farbe"
+ de "Console", "Konsole"
+ de "&Copy", "&Kopieren"
+ de "Cu&t", "Aus&schneiden"
+ de '&Delete', '&Löschen', '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', '&Grün', 'iso8859-1'
+ de "&Help", "&Hilfe"
+ de "Hi", "Hallo"
+ de "&Hide Console", "&Konsole unsichtbar machen"
+ de "&Ignore", "&Ignorieren"
+ de "Invalid file name \"%1\$s\".", "Ungültiger 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&infügen", '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 auswählen", 'iso8859-1'
+ de "Select a file to source", "Auszuführende Datei auswählen", 'iso8859-1'
+ de "&Selection:", "Auswah&l:"
+ de "Skip Messages", "Weitere Nachrichten überspringen", 'iso8859-1'
+ de "&Source...", "&Ausführen...", 'iso8859-1'
+ de "Tcl Scripts", "Tcl-Skripte"
+ de "Tcl for Windows", "Tcl für 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', 'grün', '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:R0lGODlhEAAQAIEAAPwCBPz+/AQCBAAAACH5BAEAAAAALAAAAAAQABAAAAI2hAOCxg2h0nJHyEshi9HpxU1GOCLdZoKpQ15nibUoprKp9lh2oucUxsBRXsJh4Hjs/QTMpr8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+actbookmark16:act act16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy+vERGRFRWVDQ2NKSmpAQCBKyurMTGxISChJyanHR2dIyKjGxubHRydGRmZIyOjFxeXHx6fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVbICACwWieY1CibCCsrBkMb0zchSEcNYskCtqBBzshFkOGQFk0IRqOxqPBODRHCMhCQKteRc9FI/KQWGOIyFYgkDC+gPR4snCcfRGKOIKIgSMQE31+f4OEYCZ+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+actbookmarknew16:act act16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy6vERGRFRWVDQyNKSipAQCBMTGxKyurISChJSSlJyanHR2dIyKjPz+xISGhPz+BGxubMTCBHx+fPz+/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVfICACwWieY1CibCCsrBkMb0zchTEcNYsIiYHiwIOdEAvigdFQGE0Ix4NBbSAgsWjk+jBIAlcUYrJASChnSXZSoUDelKfoKpFALJA61ueGI2IAZmhogGFmCGGAgXsifiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+GUDL4CXqSphPhLwAAIf5oQ3JlYXRlZCBieSBCTVB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ikUgQqNargtFwdB9KSDhxiEjMiUlgHlB3E48IpdKdLCxzEAQJFxUTblwJGH9zGQgVGhUbbhxdG4wBHQQaCwaTb10emB8EBiAhInp8CSKYIw8kDRSfDiUmJ4xCIxMoKSoRJRMrJyy5uhMtLisTLCQkC8bHGBMj1daARgEjLyN03kPZc09FfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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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R0lGODlhEAAQAIIAAAQCBPwCBAQC/AQCjPz+/MTCxKSipAAAACH5BAEAAAEALAAAAAAQABAAAANOCLrMEUDIOUS9AFLLhx8LIRZjKYZmMRCkaChFLHty/AIiS3y6q+QtT49wq8VotRtQJGwRf6Zmrlj7DJLQXsupTJmeEIN4TB5nII20wp8AACH+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:R0lGODlhEAAQAIMAAAQCBPwCBAQ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2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connecting16:connect connect16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBPz+BMTCBISCBAQCBPz+/MTCxMTGxISChFxaXMzGzKSipAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEMhJZbihUiz60FPnfaA0iBpBVGdHEYWxToEoSHBRHHM9AgSEQRcj+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/IDatAoF7xxkS6GgEBr6jAobCyBX42SQBxMOx6A8MhiGASR8YDgrYsNEeJ0zaEGZY7uoH2oB6nOUwtbdLaVOeTUw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wgBITQEGGEREmfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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:R0lGODlhEAAQAIMAAPwC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C4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+folderhtml16:folder folder16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBAQCBERGRBQWFMzKzOzq7CwqLDw6NARqnAQ+XHR2dKyqrOTm5ExKTERCRHRydMTi7NTu9HS+1KSmpBweHDy67DyixHS61ITG3AxypByu7DxinBw+ZERmdIySjITC3ARypExOTDRurIR2RPTSdJyulEyGvBw+bFSyzJTK3LzKvPzivOTixNTChLSybGyCfCRSnBQqRASGtFyuzDw+PCRShPzy5OzerOTShKyaTEx6pCxerGRufBR+rOTezPTShNy6bER+1BxCfBQuRAxelFSixBw2VISq3GySrPTWlHyanIyitFSO3IymtCRujAxWhCRqlCQ6XGyWvNS2bFyGvDxuvCRSpLy+vMS+vGxqbFyO1GSi3EyO1FRaVCQuPLS2tDxyzKyWNFxaNCQyPGxubCxajERSVExKNJyenAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAfZgACCAAECg4eIAAMEBQICBomDBwgJCgsEDA0BDg8BhwYQERKUDxOYDAyeghQVFhehGBmVlwwOqxobHB0eH6EfIAkPIYIiIyQlJhsnKBcpvrYiKissLS4vMDEyFjOvNAA1LDY3ODk6Oyc8PTIyFzQ1Jj42P0A6QTtCQ0REIEUORkdIkihZwsSekBhNnDyBciCKiSNSplDRUcWKkRhXCGDJYgiGli1cpuTocsILjytfFmRpACAGRTBhRogZgzHlAjKGWnIoY+bMgRgBDHRBo/LAIZoxuhwKatRPIAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+folderlocked16:folder folder16 16:photo:16 16:R0lGODlhEAAQAIYA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wgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav1rightarrow16:nav nav16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIdhI+pyxCtwoNHTmpvy3rxnnwQh1mUI52o6rCu6hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+pyxf5VohmSlsxmpjTzAHeN5ak6UHpqKRi2GpwvH3Q3eT64RcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4L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yzAyixEze7BSStBRWdAyWvByixAQSHCQ2TAQCBBRGZJze7CS61BSavAxefMzq9ETW3CSWtAwmPPz+/CzG1ITC3FyuxBSCnAQeLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZfQIBwSCwaj8hhQJAkDggFQxMQIBwQhUSyqlgwsFpjg6BwPCARySSstC4eFAqEURlYhoMLBpPRUDYcHXt7RgUeFB8gIU0BIoiKjAcUIwiLSQUkJRsmGIwJJwmEU6OkfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIH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aHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+apppencil22:app app22 22:photo:22 22:R0lGODlhFgAWAIMAAASC/IQCBPwCBPyChMQCBPzCxAQCBPz+/MzKzISChKyqrDQyNEQCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARYEMhJ6wxiEMtpIAWxddwXiqRlikSQeiAbuC+wirNR322gv7zcLobzDU+9XypoBBKTR1lz+RTWDgip8nUwZK1XLyIx5XoVicX2RUAo1DVKi7GOBxjxfNwQAQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+apptool22:app app22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBISChFxaXNze3NTS1Ly6vKSipNTO1Ly2vNza3Pz+/MzOzOTe5DQyNOzu7MTCxGRmZMTGxPTy9Ozm7Hx6fPTu9MzGzGxmbAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAW1ICCOZGmeaEoGbBsI6joMRGEcbQwESDIrtVtAF1gwDLNaAmfKiVgLBJKgwB1KxQZrBHU0FAXmavFoQLYiB6TxFXMj5AZBwnJI2I3wcNWALyYEcgoKXxRhOHs7XxEVCwsWFgoUDRYUFwwQB25ZCxiNjo6GkwUXN2NsCxEYqhUHoQ0MEglYRQQXErcHrI55FycuB2YSmoyOBTEtB2sXuhU6XAENC2a6z9AKCwq+1tAN3E2J3ySkIQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+connecting22:connect connect22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBPz+BMTCBISCBAQCBPz+/MTCxOTi5AQGBNze3Ly6vISChNza3FxaXKSipAAAACH5BAEAAAAALAAAAAAWABYAAAR4EMhJqwzY6omD+MNGdR8YilNZnug0qGzrqrL1lnV1fyJBVB6VQEMoGH4ADGwQkxQPBwMiKGA2J8VEAnq0tgiKg5aL/C7C2gTjKCM0zowDQ8tuNQznNL7cKzjOUQsNfER+gguIg19+Pm6ChBZFDmWNi5M5FIyYFHQRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+connectno22:connect connect22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBPz+BMTCBERCBAQCBPz+/MTCxOTi5Nze3OTm5Ly6vNza3ISChFxaXKSipAAAACH5BAEAAAAALAAAAAAWABYAAARiEMhJq7046827/+AVCKE0Dh9BAGdaGISAToFGFMcBU+11I4hDYseSZQiKwwKoI/QwBIYiuFDCZseGdIlYEjUNg1SpY6w2N4cUIW6cjwW1lsFwo+MqgtZuw0/ydw5vH34lBhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+connectyes22:connect connect22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBKyirPz+/KymrOTi5KSipMzCzNza3OTe5Ozi7MzGzPTq9OTm5ISChMS+xFxaXNze3GReZIyCjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAWLICCOZGmeaBkAQpoGg7C6JizTQT7CxPwOwFWgYPChYIXkIHC4uQKGAiKRKCyNpxxUUVViVYNFLkq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ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textblock22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUWzvNzo33GfFl5jVlonlTrr1DbvFi9vjeeNUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+0P4wqUSlQvttrkDnyaOHIdeaGRupplAIauVM3xjeeOUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxO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Nvci5jb20AOw==
+textunder22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAIvhI+py+0PowmUnhpeVVnb1DkbCI1I2JhX+Z0sOr2cTHpwK7a4rUr+hAnufsTirwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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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QWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+viewtree22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBFRSVExKTDQyNPz+/Pz69Pzu5PTq5OzaxBQOFOzKpFRWVFxWXOzexPTexCH5BAEAAAAALAAAAAAWABYAAARPEMhJq704g6A779kHCORAgNskFMYhakE8FkjyBcoWv+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+/MTCxKSipFxaXDQyNISChAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARUEMhJZxCjanBH3hY2EFJgVt0YcEW7liLxBoVxzPHL2msqU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HJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+zBRejBxqnLSyrERCRI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HUfpKUIq3QJ036vuakyWvbjCJLYbL2WgyW5WIw3g78AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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/BAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+contents2-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBAQCBDyKhDSChGSinFSWlEySjCx+fHSqrGSipESOjCR6dKTGxISytIy6vFSalBxydAQeHHyurAxubARmZCR+fBx2dDyKjPz+/MzKzLTS1IyOjAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVkICCOZGmKQXCWqTCoa0oUxnDAZIrsSaEMCxwgwGggHI3E47eA4AKRogQxcy0mFFhgEW3MCoOKBZsdUrhFxSUMyT7P3bAlhcnk4BoHvb4RBuABGHwpJn+BGX1CLAGJKzmKjpF+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+contents-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBExCNGSenHRmVCwqJPTq1GxeTHRqXPz+/DwyJPTq3Ny+lOzexPzy5HRuVFSWlNzClPTexIR2ZOzevPz29AxqbPz6/IR+ZDyKjPTy5IyCZPz27ESOjJySfDSGhPTm1PTizJSKdDSChNzWxMS2nIR6ZKyijNzOrOzWtIx+bLSifNTGrMy6lIx+ZCRWRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaeQEAAQCwWBYJiYEAoGAFIw0E5QCScAIVikUgQqNargtFwdB9KSDhxiEjMiUlgHlB3E48IpdKdLCxzEAQJFxUTblwJGH9zGQgVGhUbbhxdG4wBHQQaCwaTb10emB8EBiAhInp8CSKYIw8kDRSfDiUmJ4xCIxMoKSoRJRMrJyy5uhMtLisTLCQkC8bHGBMj1daARgEjLyN03kPZc09FfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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:R0lGODlhEAAQAIUAAPwCBFxaVAQCBKSipDQyNMTCxISChFxaLFxSJExGHE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
+editcut-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBPz+/ISChCH5BAEAAAAALAAAAAAQABAAAAIwhI9pwaHrGFRBNDdPlYB3bWHQ1YXPtYln+iCpmqCDp6El7Ylsp6ssR1uYSKuW0V8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+editdelete-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaXNze3Ly2rJyanPz+/Ozq7GxqbPT29GxubMzOzDQyNIyKjHRydERCROTi3IyKhPz29Ox6bPzCxPzy7PTm3NS6rIQCBMxCNPTq3PTi1PTezMyynPTm1PTaxOzWvMyulOzGrMymhPTq5OzOtNTKxNTOzNTCtNS+rMSehAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaKQAAgQCwahcihYMkcBAiBpLJApRoOBWgyIKhSEQkFgrBAcr1URiPhKAsDD3QB8RhA3FM0IlLHnyUTVBMSFBUWfl0XGBMTGBcZGodmcQWKjpAbHIgIBY2LHRoempOdjooTGx8giIOPFYofISJ+DyMXI6AfFySyfiUmJSUnKBYcICIpfgELzM3OZX5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+edit-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIYAAPwCBFxaVMR+RPzKjNze3AQCBMR6RPzGjPyODPz+/MzOzPyKDPyKBPz29OTWzPyGDPyGBOx6BOza1OR2BKRO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MBoxMjM0KTU2LC2ENzg5wDo6Owo8hT0+Lx8/OztAQR9C1oInQz4FMBAp8sEIhgIEMpwYdASJCwAYkihR5OLGkUUAMmTACK8Hx4+C/AQCACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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:R0lGODlhEAAQAIYAAPwCB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w==
+finish-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAwyTBRObAw2VDR+nAQCBCRKZOzy/KTe7Pz+/KTK3Nzu/Lze7FS+1AyexAyuzBSavAyOtBSmzOTy/BRqjNTm9IzO5ETS3ETa5By61AyixByixBRmjAQGDBxCXGSivCySrCSWtBTC3AQOHAQWHAxWdEze7AQKFBRCXAwqPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZtQIBwSCwahYGjUjBQGgWE5LCgNBwITSFVKOgKDAZEIqodChSLw4HRcIyTW4Dg0HhAIhGIZEIJxA0VFhcYGRAaGBscHXEeHyAhIQ4iiBwjAHEBJCMjJCUmiSdlRyigU0oolURxRSmrTpevsUN+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+flag-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBMTCxPz+/MQCBPzCxPwCBAAAACH5BAEAAAAALAAAAAAQABAAAAM5CLrcruG9QCULokqKR44NJQykQGgXSRaEcYJLsLLu6wSFoRMvCuk1kO9ni8GMt6MForQMl89NxJ8AACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+folder_new-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBPz+hPz+BOSmZPzSnPzChFxaXMTCBPyuZPz+xPzGhEwyHExOTPz+/MSGTFROTPT29OTm5KyurDQyNNza3Ozq5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Z2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+frac-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBAQGBIQChCH5BAEAAAAALAAAAAAQABAAAAInhA9hig0SAmQOxeouPrFTzHzbCAzmiZ4k2S1ryHKsoo3tptXg3fgFACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+frameprint-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFRKNAQCBPz+/MTCxExKLPTq5Pz29Pz6/OzezPTy7PT29NzClPTu7PTu5PTm3LSabJyanOzi1FxaXOzCjOTKrOTSvJyenGRmZLyyTKSipDQyNERCROTi5MzKzIyOjLS2tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaPQIBwKAwIBMTkMDAYEApIpVBgOCAOg4RRGlAsEAqFIcGITqnWRcPxSEDMgkhAonA4DO3yMD6BUCoSCYIWEwVTF4gYAhAMFRUMZRlQEYgXERqKGBAQG5IAHAIDHYiUEUcDpwIcHh4doR0fH02zqAIXIASsrqi0TQBHE7e5HqG0Zr8CwSC9qFJHxbRSU7W1fkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+gear-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBISChMTCxDQyNFxaX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ERa79HTrx2WEiBUH5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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+FExGHCQiDBwaDGxiLHxyNHRuPIR+TIyGZJSSfFxaRFxWJGRiLJyaXNzWpNTOnMzGnLy2hJSKTGReLKyqjPTu1NzarMS+jLSyfKyibJySXIyGVCQeDLSytPT29Ozu7OTi5NTS1KyurJSSjGxqVFxaXLS2tKSebOzuzLSufJSOXExGLGRiTExONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAaTQIBwGCgGhkhkQDBoEpLKQoBACAyOUID1qTVwoQGvMPxNFgVjAxp6QCQUicSCwVgkG44HJCKRRCYUCAxIFRYXhxgZGhYbHINEHR4fGCAhIiMkFSVKJicoKSoFKwMsLZtDLison6GjLA92qCueoAUvpC2xQhWqrLYDErmEMDEXlDIwMxAHukI0NS01EzY2NAmPAH5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+lsub-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBAQCBIQChAAAACH5BAEAAAAALAAAAAAQABAAAAImhI+pFu2+QpxKVppsxkh3fnhh9DyGcC6IwLbqir4HK58tLcfx6xcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+lsup-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIEAAPwCBIQChAQCBAAAACH5BAE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cmJyYPKCIpKrWqKywTmC0SIi4vMDHEDCsyMg8zEyI0NTY3z7U4Hhs5Mx+0IyI6OyPrIzw9Gys+PxIy2EBBxAs8Qjk5Q0RFWFxAZySfgSMsilRAkiRECHQ08hHgJ0TJkCU/mECU2ISEkowUlpAQ4QTfowNPoAzJIeRJCyjm8kVRIkWIzSkXhwxJtYAKgp9VrFi5QoWKFZ5+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:R0lG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BMECxwBBAEPFw8dChkhcBMDDAcdnQqtFKSWcQMimx4dGRkQBxGxsg6bBQEawx8jl3GnJFoFHRNXVVNRJYIFDAsL1tgiDiQXFx0HABwcXeQH5OjkRutEfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+pFrEahGgPtCinS2GMlknU0Xkflm2l6YEiw8aRGssTXLe3lZsznvuRViwholEcLZCfynGT8BcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+redo-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBBxOHBxSHBRGHKzCtNzu3MTSzBQ2FLzSxIzCjCSKFCyeHDzCLAxGHAwuFDSCNBxKLES+NHSmfBQ6FBxWJAQaDAQWFAw+HDSyLJzOnISyjMTexAQOBAwmDAw+FMzizAQODDymNKzWrAQKDAwaDEy6TFTGTFSyXDyKTAQCBAwiFBQyHAwSFAwmHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZ2QIBwSCwaj0hAICBICgcDQsEgaB4PiIRiW0AEiE3sdsFgcK2CBsCheEAcjgYjoigwJRM2pUK0XDAKGRobDRwKHUcegAsfExUdIEcVCgshImojfEUkCiUmJygHACkqHEQpqKkpogAgK5FOQywtprFDKRwptrZ+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+reload-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBCRaJBxWJBxOHBRGBCxeLLTatCSKFCymJBQ6BAwmBNzu3AQCBAQOBCRSJKzWrGy+ZDy+NBxSHFSmTBxWHLTW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5SyyYj0XDQjMvVQwBxRCQTilowFGwrjG5kTo+0x4OdpcLvV0YXIhcGGH0ZFRobOSccfB2PHR4FiyYAGQwdAI8eEAdQKBsZmR+RBpSVVyMHfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+xMTCBISCBAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANCCLrR+zAIMQKMguh6GR2g1QEBCBLiGGjo+DSpS3IqXNqxNAnwzisSk3BowRltM8IAZVMqi84lLNoqUVfLrOhoVPgTACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+start-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBBRSdBRObCQ2TAQCBBxObISevNzu/BRGZPz6/FzC3Pz+/HTS5ByyzJze7Mzq9ITC3AQWLAyWvBSavFyuxAwaLAQSHBRWfBSOrDzW5AyixCS61ETW3CzG1AQeLAweLAxefBSStEze7CSWtCyatBSCnAwmPBRWdByixAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZrQIBwSCwah4HjUTBQEogFw/M4BQgMh2pxijAkFAhBYJwUPq8LRsPxWDwgkSHhelA0JJIJnlKRWy4YGRoSGxwcHRsecgAfICEiGhMjJBglVVMRgBkgJp0El0MRJyhaRFqipUoAFqmqrapHfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+stop-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAASC/Gw6NGQuLHQ6NGQmJFweHFQaFPTm5PTa3PTW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naHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+/ERCBASChISCBARCRAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARaEIQJqpXBBjFI1oGncYU4EUXxSWQZlum6DXDQpeo0tR6KqqgdLXiLBWepHgyYIxF/TKHv9XvtDDfb0So5YHuTgThYCXgH4Q6hqvEGEIm4PLGSyHX4OkZv8UcAACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+top-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBBRObAQSHBRSdISevBRWfAweLNzu/BSOrAQWLPz6/FzC3DzW5BxObHTS5ByyzAyixEze7BSStBRWdAyWvByixCQ2TBRGZJze7CS61BSavAxefMzq9ETW3CSWtAwmPPz+/CzG1ITC3FyuxBSCnAQeLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAZjQIBwSCwSA8ik0kgUDJhGQsFwgA4FBUTCoLBiF4zGtmt0FBYPSEQyoZCvWQakUok0LISnkHBBYjIVGhscS0UGHRUeHyBWAAIhiYuNAggVIgmMVgYjJBolAZMKJgpIjaanRH5BACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+transform-16:actions actions16 16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ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+view_choose-16:actions actions16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBDQyNAQCBPz+/PzerAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAMzCLrcGlAs6UAYgwLdLtEcI4ygQo7VVp2oupGpG4vmaUVTemX523qlFcw0a4RqNlkx5k8AACH+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+P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Tk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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+S4EBDAwQEIsUDBQRFJSJLJcoJpojfiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5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xEySvEyKrER6nERylExqjFSSrKze7EyCrDxulKzG3GSuzGSitEyWvER2nEx6pKzO5DxmhLze7DxqjExihERadLS6xERulEyOrLTC1KzK3ERWbERujFRefGR+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 ap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H5BAEAAAAALAAAAAAQABAAAARXEMgpQ6B4WnGzDgJHWWMYdkAwEF1QFKe2oqDZztr7GpfKjrvAAeFDpQq8ISIRYBotSoTUkiC2ostqYps49BSKIVfaBbcC4MMWcTAbU+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+/PzCxKSipISChAAAAAAAAAAAAAAAAAA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CSChRFFWhg5MkMjkk9JlJRY4uIEixk5fOhAsuOkqyFLXF1oQYOJTiQIAigaqohCD6JD/QQCACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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+iQIGLBItLhOO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XMTCxDQyNAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANECLrcEDDKGYQV4+qbie9eGIJEVxTe+QmjUFgnXLLr615oF8x2v0I8DWpF2GV6slkLKSMdYT4nS0WgSkXYAWUbcXgX/gQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+BMTCBISCBAAAACH5BAEAAAAALAAAAAAQABAAAANHCLrRsTC6F6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cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+xfig-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPz+BMTCBISCBARCBATCBASCBCH5BAEAAAAALAAAAAAQABAAAANQCLocwbAJ8SIMYgwHHO9Opk2V5xGEplZK0alaui0eDLOB8QTykOKGQ6mnKQWFPILDN8sdng7l69c5CjuKAHNnZb2KnUOhcG3MsmMv7aK2+BMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+xfmail-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBPyqXMRaBPz+/AAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAANACLHcAVCJSWcYLwaxSPAXBj2bswyiIlUWSr5muGhbdaZjTd1ZzvKMFaOFcbCIpiOnGGs2FM5gLkLrTalQLMCfAAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+xload-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAImhI+py+3hEoxnUmBpyBjNzWXfJnkGKJ4dBlbjS7Jni9Zsjec66hcAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+xmag-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBKSipMTCxPz+/IQCBPyCBMRaBCH5BAE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HMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+xv-16:apps apps16 16:photo:16 16:R0lGODlhEAAQAIIAAASC/AQCBPyqXPz+xPyCBPwCBAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAM8CLrc/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+t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photo:16 16:R0lGODlhEAAQAIEAAPwCBISChAQCBMTCxCH5BAEAAAAALAAAAAAQABAAAAI6hA+Bu+HCmgiiRuNoHZBRXQlc84TmcHzm2WVryE1YvMaZIdbVd2zw7lj4bDKGbxK8hHgX3K2JUDD8BQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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:R0lGODlhEAAQAIQAA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o8dRYxqLXSmGjIJnVaz29Q3fAP3RwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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/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qd2ZtzXUMIhXZqJYaZ5aK7zwp6h0zc05i+c6Eg8oCnWOR0eHQGEKnEWHdDoF+BMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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/PTy9PTu9Nza3ISitBRupFSixNTS1CxqnDQyNMzGzOTi5MTCxMTGxGxubGxqbLy2vLSutGRiZLy6vLSytKyurDQuNFxaXKSipDw6PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+folder_grey-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBExKTBwWHMzKzOzq7ERCRExGTCwqLHx2fKyqrNTS1PTy9CQiJNza3OTi5GxubJSSlISChLSytFxWXDQuNKSipBweHISGhFxaXIR+hLSutFROVHR2dFRSVGReZKymrLy6vFxeXNTW1Pz+/KSepERGRPz6/PTu9Ozm7DQyNMzGzMTCxMTGxGxqbNTO1Ly2vHRydKyurHRudDw6PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAawQIAQEBAMj0jAgFAwHBDJoUGASCgWDEMxETg2HA8FFaJgFgpdYSMiUYAnlErCsmgKL5iMJqJwPzYcCB0eahAZH4gSESAhYAoGQggiBh4eFB8iehEWI5AABiQFFpMeHCIiiCWeJicMDAUOEZMcHBkSngYMKCkpJA4OBCWTk0IqKw8PvwsLLCwtLBCeRCouLC8vK80wGzEHSQEqHxMhMBMyLtLfKh4WCjM0UUgBCCoAfkEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+folder_grey_open-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBAQCBExOTBQWFNze3Ozq7ERGRCwqLPz+/PTy9Ozu7OTi5HRydIR+fISCfPT29Pz6/PTy7MTCxCwuLJSKfIx6XMzKzDQyNOzizJSOhIyCdOTm5Dw+PJSSlKSipLy+vOzi1OTSvNTCnIRyVNTW1GRiZFxaXAQ6XMyyjNTS1GRmZFxeXHRmTFRWVKSmpKyurMzOzGxqbMTGxLS2tJyenKyqrDw6PAAAAAAAAAA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HJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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+1Dy67DyixITC3BR2pBweHByu7ASGtFSyzHS61AxypExOTBSazBRupJQOFBSCtDxKfKTa9AxelNz61MTaxDw+PPzGpLweHJTO3ESu3DRilFymXCxKRBRypBR+rDwCBNxmVORiRKQWFCyKvJTWhDSOPCRONFSixDQaHNROPNQ2JLRubHTC5DR6rHx6fFSqRCRyLGRmXGxqbIymtCRujAxWhMySjMQ2JMyqrKTW5ERijJSenFSGXGRmZLy+vMTGxMTCvERGRMxCNOzq7NTe5LSurISKhHR2fLy6vLS2tKyurGxubCwqLOSKfOzy9Nza3KSmrIyGjGxmZKyqrIRqZIyKjFxaXJyenDw6PDw6NAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAffgACCAAECg4eIAAMEBQICBomDBwgJCguMAoUMAYcNDg8QlAyXBaWcgg0REhCfExSVpIYAFRYXEhgZE60aCQwbghUcHRQXtri6DxMHgh4fICEiIyTFtxkOJQAeJicoKSojKywtLsUZJS8wMTIpMyA0NTYKIiIaNwc4OTo7PD0+P0BBhAwhUkTFAQNGjiBJomQJExsMmjh5AkVIFANQpEyhsqSKlStXmmDJomVLFC5Gunj5QiALmDAKxGSpMsYiAC5kqjhZUOaKmUdmzoAJgkaQgQYCmogJEmRQAC5pAPgJBAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+folder_important-16:filesystems filesystems16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBExGTKQqLPz+/KQqNAAAAAAAAAA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Pz+/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+xATCxMTCxMTCBKSipPyqXISCBFxaXISChAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARbEIAQJJU4BzEoIdSFbcNQnIVhBJ02GAeFIGxZjUl8KoHRagfeYqgo3kaxQOEwXPAyk4Mgtgg6jxYp1foETgPEKzSgBXOx0W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zaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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/AJXemFZPPNBvGwG672yFMZS7xRwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8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29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+black_sum-16:kspread kspread16 16:photo:16 16:R0lGODlhEAAQAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAQABAAAAIdhI+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:R0lGODlhEAAQAIAAAPw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JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+unknown-16:mimetypes mimetypes16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaXIyKjNTW1Nze3LS2tJyanER2RGS+VPz+/PTu5GxqbPz69BQ6BCxeLFSqRPT29HRydMzOzDQyNERmPKSypCRWHIyKhERCRDyGPKz2nESiLBxGHCyCHGxubPz6/PTy7Ozi1Ly2rKSipOzm3LyqlKSWhCRyFOzizLymhNTKtNzOvOzaxOTStPz27OzWvOTOpLSupLyedMS+rMS6pMSulLyqjLymfLyifAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAamQIAQECgajcOkYEBoDgoBQyAJOCCuiENCsWBIh9aGw9F4HCARiXciRDQoBUnlYRlcIgsMG5CxXAgMGhscBRAEBRd7AB0eBBoIgxUfICEiikSPgyMMIAokJZcBkBybJgomIaBJAZoMpyCmqkMBFCcVCrgKKAwpoSorKqchKCwtvasIFBIhLiYvLzDHsxQNMcMKLDAwMqEz3jQ1NTY3ONyrE+jp6hN+QQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+vcalendar-16:mimetypes mimetypes16 16:photo:16 16:R0lGODlhEAAQAIMAAPwCBFxaXDQyNAQCBMTCxPz+/ISChAQChKSipAQC/Pz+xPzerPyqXMRaBAAAAAAAACH5BAEAAAAALAAAAAAQABAAAARyEEgQahVijMmD/oRAbBw1FCgaFFrpEbB6jt1g3OpFAscxwATUiIAgBRKJXiqIYJEMBQNSWSAYgptrMDo9FJqKrHArTR4WLGisSkbebE12gXFF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IhWdVGDAcENQtIJBQLBgNx0MQaDuQXcghIplQDhBIxXKJYiAZGhscHR4VHyAhIiNWJBklGhIbJoQnFCcTKIxFKSgbKissJi0mJi4vLiYoMEcXKDEyMzQ1Nje2NisoOEg4KDU5K6g6OwwoKAN9SCOeMmgwz884PEq9PT4NYkPLP9jZQikN3d4AKVrjKePp3gZBACH+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:R0lGODlhFgAWAIUAAPwCBCwqLCQiJCQmJMTGxAQ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IHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+border_all-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAI+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+zTk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NUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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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iVgLBJKgwB1KxQZrBHU0FAXmavFoQLYiB6TxFXMj5AZBwnJI2I3wcNWALyYEcgoKXxRhOHs7XxEVCwsWFgoUDRYUFwwQB25ZCxiNjo6GkwUXN2NsCxEYqhUHoQ0MEglYRQQXErcHrI55FycuB2YSmoyOBTEtB2sXuhU6XAENC2a6z9AKCwq+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+/MzKzIyOjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAbFQIBwSCwaj8ikMhBQIpmCQdM5ZBIKhgNiugwkFAsCI7pNMhuOxkNBgBgEiAi3GkBLJpJHYgEpaClyREwVFhcSEhgOGQoMfgMaERtcARQBFRMYExZ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ogK9sHFiwoOPEyQh0JFPXO1YBSYwBEFghjdHkwQOYGgwQwIZRR44GHGDBogabhAsYEEihrUMAIoUMCEDRs3HODIYQHFA6MPcJA7KICFjgw7eIzo4cOfiwc/gKwIUm2SkKdDdlDt4AABDaU/iIRwwbTSUyJFOow4S3Hkx9oNDDZgXPU0h1wcSIgEGUw4ibVET5WoWMKksePHpdxmyKADAEIWly9HJtQkQJMmlAgZCAQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+contexthelp-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBAQCBAQChAAAACH5BAEAAAAALAAAAAAWABYAAAJQhI8Qy5F/ghBsLuOgpHHy+0hZ94HINiqWwoQrtjYpNqJ0A8Hcjbs73yPNZEHVDygTJohJWqiZe0JPM5ajtXxFMkXnklqNgsPiWzmHPatzhgIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+crop-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBAQCBMT+xASyBASCBASaBISChMTCxPz+/AAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARUEMhJq704681r+EFHBcIwEKFImmfKkURhoh1cyO0rxEWZa7bezIUJ7gg04O62A22MyeeyF1XymrUSs5pZmbA61u+FLBOBhrThozq4D2cgYo6IawwRACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA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mVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+fill-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIMAAASC/AQCBMT+xASCBMQCBASaBPyChASyBATCBPwCBARmBAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAASCEMhJq704axB2DkLnVeAwiCNHDMWZcsbaul5ZyCaKBcZwFDcgDRNbHX7AmW4SMx2MSOFQQlitEAhosrVcDQQE7NMXzVGqA6xAgCUckabQpJoIYBFsxBspUKBiHQEHaoNvBQJTgBIBdnh5B4hLihONeJBTc0uMaphMS4uRGQYfny9EEQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+filter-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBAwKDMzKzMTGxNTS1MzOzAQGBLS2tLy+vKyqrLSytLy6vMTCxBQWFKyurCQmJBweHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAV7ICCOZGmeaHoGbKuOAjsQhVG764EgyT7YhaCBVQogFMhFImEABoUBknFxRDAazac2Kg00djystkA0sQ4BgzgYK6+Ch/bBseOmAmMD4gF5ifBCDwoRfiOABgyEhYYFCA6LUo19kH+Nj5QAaQh2kHibmJkFBJydpKCnfnYhACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+find-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIYAAPwCBBQSFJSWlFxaXJyanKy2tLzCxDw+PHyChNTa3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lGODlhFgAWAIIAAPwCBIQChAQCBBwaHAQGBAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAANJCLrc/iDAuYKlU0r8NHfXB24iEyrCIAjAynakQLQuDS+vrTcnI1M9HyaIykFOKwUhZ6zEWC5oU9GrRY+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+PLSutKymrMTCxAQCBHRqLBQODJyanDQuFFxSJ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iBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+paren-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIEAAPwCBIQChAQCBBQSFCH5BAEAAAAALAAAAAAWABYAAAJThI+pGou9oDuS1hlqnkxu/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+/MzGzISGhJyenKSmpGxqbJyWnJSOlKSepLy2vIyOjGRiZPTu9IyGjLSutFxaXExOTHx2fGReZAQCBAQGBBwaHCQiJLSytKyurJSSlFxeXNze3LS2tIyKjFxWXHRudAwGDBQOFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa1QIBwSCwaj8ikcqkMCJjHwIBQgBIDhgMiUbVKFQsGItBdBhpgh4PxIJvRC8cA4oiMy8bvQhJhMAYTFBVOURAWEw0QFxcMERAYCBluVxobDxkVHJocmBwEGgmEQx0dHh0CpKmkH6odVlanBR8FtAIFtiCkSB0LISEiGCIGIxAPDySuRwIOBwrOzwoHJRHJRh0jJgMj2gMnERQUCNVFHQQoCBvo6CkICATjRB0qp7b1K6qv+foyQQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+player_end-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBDQyNFxeXAQCBMTCxGReZBQSFOzm7AwKDKymrJSSlFRSVCwqLLy6vPTy9OTe5Ozq7CQiJLSytOTi5BwaHPz+/HRydMzKzKSepJSOlKSipJyanIyGjIyKjKyurISGhMzGzJyWnHR2dISChIyOjLSutDw+PERCRHx6fJSWlIR+hJyenGRmZHx2fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa6QIBwSCwaj8ikMBBQKgOCgRMZIBSkxYHWoDVWD9EigpBQLLBERsPxCA8NDUhjgTBGJJNGG02RVBQWdUV3FxgZe0IGfoAGdhoXGxwdiAYef4FGFBoeHB8dGSBRihUhIo1FBhkbIyMkJRYmAwYal4JEBh2RChIWJ1IIGxUZFqdECCgkHR6wWAYpFR2YWSobvL5vFgfDaEMDIivMRBEsD9HcQgMWvecDLB0tZ0btsfJa9vLXU/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+/GReZBwaHHRydKSepKSipGRiZJyWnAwODLSutKSmpISChPTu9ISGhFxaXJSWlIyGjJSOlERCRIyKjD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REc5SLnICLiR1koLFVUWfRO9vf4+UwyQQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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 actions22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBIQChCH5BAEAAAAALAAAAAAWABYAAAI7hI+py+1/gpy0hlVRZlP19mmSE0YjeIoXuqpkarYYbJQeDdiJrrs77gvOZDVg7Eb8JXtFSpMJiUoB9AIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+queue-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIIAAPwCBAQCBKSipMTC/Pz+/AAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAANfCLrc/jDKEGQMQlDLKM5aZQXDQIHZ9nhleaLqEhAE1bofKCozXZO3l0bmK9qCQ2LRCDQlAb3lkoTZQaVS6jOKpWmt3O5X2fU6wWXfuBM2mmINCpbKkavho56VI9s7DAkAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+redo-22:actions actions22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBCReDJzGjMzivOTu3Pz+/JTWbHy+VHTCTMTivPT69BxGDESuJDyiHESiHEymJIzKZAQCBFS2LFzKNGzWPDRqHCxqDFSqLHy2XESCHAwaBAQOBBQqBDyWJHyqZDyKFGSiVESeJBQ6BAwSBGTGPFyWPFSSLEyOLESGJBQiDAwiBBQmDCRGFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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DMQBAAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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:R0lGODlhFgA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DQmFKNRwQT2EgoVgsGOCG4wHBIgmRhWRCqVQsF0xGYyYGNgoGh9PpeCQfICEic3UAAWgLIxwRJBsbHSUREyYYJ3RDAQULexGejhueESgpl3WaCxsqJKKsChEUKywtmFoFDC4vCayikzCyMbWHt38NCTKiHhUfMyzBdQIFKsodob0VNDWzwppuKxMRrx6iNjcitNA4bh+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:R0lGODlhFgAWAIYAAAQCBA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FAwp9D27MGugRAh4f29TithIW2c2SBOjgqwxv/AIS9cOEvQPBiBEFetsidOhAQFqEcCDgWLBAwR9AARFCuMPFAMwCEAsQpuMQQkS+EQ1SNkBAwuKwe+kiUDuSzU0JPyUm5HSj4Qi+Bp9A8QEIAgAh/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+/P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Ah/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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+vERGRFRWVDQ2NKSmpAQCBKyurMTGxISChJyanHR2dIyKjGxubHRydGRmZIyOjFxeXHx6fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVbICACwWieY1CibCCsrBkMb0zchSEcNYskCtqBBzshFkOGQFk0IRqOxqPBODRHCMhCQKteRc9FI/KQWGOIyFYgkDC+gPR4snCcfRGKOIKIgSMQE31+f4OEYCZ+IQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+actbookmarknew16:act act16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCwqLLSytLy6vERGRFRWVDQyNKSipAQCBMTGxKyurISChJSSlJyanHR2dIyKjPz+xISGhPz+BGxubMTCBHx+fPz+/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVfICACwWieY1CibCCsrBkMb0zchTEcNYsIiYHiwIOdEAvigdFQGE0Ix4NBbSAgsWjk+jBIAlcUYrJASChnSXZSoUDelKfoKpFALJA61ueGI2IAZmhogGFmCGGAgXsifiEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+actcheck16:act act16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBMT+xATCBASCBARCBAQCBEQCBAAAACH5BAEAAAAALAAAAAAQABAAAAM2CLrc/itAF8RkdVyV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C4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+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+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+devcdmount16:dev dev16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaXISChNTS1MzKzMTGxMy+vNSytAQCBOzq7OTi5Nza3Oy6vPy2tOTStPz6/Ozu7Nze3MTKxOS2tOzOvNTqvLT2tDw+BPTy9MzOzLS2tPy+tLz+tLz2tLSynLzqvLzavLTOtNTW1KSipPz+/LzKvMTCxDQyNASCBARCBDTSJIT+bAAAAAAAA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jBkwDBsNM90Jot9A3DbBD0Dwiur9QnfhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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:R0lGODlhE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93d3cuZGV2ZWxjb3IuY29tADs=
+edittrash16:edit edit16 16:photo:16 16:R0lGODlhEAAQAIIAAPwCBAQCBKSipFxaXPz+/MTCxISChDQyNCH5BAEAAAAALAAAAAAQABAAAANQCKrRsZA5EYZ7K5BdugkdlQVCsRHdoGLMRwqw8UWvIKvGwTICQdmGgY7W+92GEJKPdNwBlMYgMlNkSp3QgOxKXAKFWE0UHHlObI3yyFH2JwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+fileclose16:file file16 16:photo:16 16:R0lGODlhEAAQAIQAAPwCBCQiJBwaHAQCBDQyNDw6PFxaXFRSVERGRCwqLAwODGRiZHx6fPz+/GxqbAwKDCQmJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAAVaICCOZGmeqBgEwjCkRGEcSKK4JrEcBrMgAdeLVDg0GguGsYEbBQyGYyN6FDoPDIf0+LCKBIgetQERDgGDBGIpNY8GioAU0m6KXFw883w3+/l9f4AkfimGIn4hACH+aENyZWF0ZWQgYnkgQk1QVG9HSUYgUHJvIHZlcnNpb24gMi41DQqpIERldmVsQ29yIDE5OTcsMTk5OC4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCmh0dHA6Ly93d3cuZGV2ZWxjb3IuY29tADs=
+filedocument16:file file16 16:photo:16 16:R0lGODlhEAAQAIUAAPwCBFxaXNze3Ly2rJSWjPz+/Ozq7GxqbJyanPT29HRydMzOzDQyNIyKjERCROTi3Pz69PTy7Pzy7PTu5Ozm3LyqlJyWlJSSjJSOhOzi1LyulPz27PTq3PTm1OzezLyqjIyKhJSKfOzaxPz29OzizLyidIyGdIyCdOTOpLymhOzavOTStMTCtMS+rMS6pMSynMS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ISEkowUlpAQ4QTfowNPoAzJIeRJCyjm8kVRIkWIzSkXhwxJtYAKgp9VrFi5QoWKFZ5+AgEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+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+pq5HOAjQyVnqfhHue7oAaKH5kiW0AmnLqaHomkj02g+e6XwAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+nav2uparrow16:nav nav16 16:photo:16 16:R0lGODlhEAA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cm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+aENyZWF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odHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+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:R0lGODlhFgAWAIQAAPwCBCQmJCwqLMTGxAQCBBwaHMTCxLSytERGRFRWVLy+vKyqrKSmpHR2dJSSlJyanISGhGxubIyOjKyurGxqbFxeXGRmZHx+fKSipLy6vGRiZLS2tFRSVHRydJSWlHx6fCH5BAEAAAAALAAAAAAWABYAAAWWICCOZGmewamaQrq+wUC8azHINGocOI38iIRAceDNaISFYklkGHOEhoNBfUAOhuOLEJE8HoPiRKFdESiQBqViuTDIUAsEcyAeGJmyiqC5RCwJ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ZWxjb3IuY29tADs=
+connectno22:connect connect22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBPz+BMTCBERCBAQCBPz+/MTCxOTi5Nze3OTm5Ly6vNza3ISChFxaXKSipAAAACH5BAEAAAAALAAAAAAWABYAAARiEMhJq7046827/+AVCKE0Dh9BAGdaGISAToFGFMcBU+11I4hDYseSZQiKwwKoI/QwBIYiuFDCZseGdIlYEjUNg1SpY6w2N4cUIW6cjwW1lsFwo+MqgtZuw0/ydw5vH34lBhEAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+connectyes22:connect connect22 22:photo:22 22:R0lGODlhFgAWAIQAAPwCBAQCBKyirPz+/KymrOTi5KSipMzCzNza3OTe5Ozi7MzGzPTq9OTm5ISChMS+xFxaXNze3GReZIyCjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAWLICCOZGmeaBkAQpoGg7C6JizTQT7CxPwOwFWgYPChYIXkIHC4uQKGAiKRKCyNpxxUUVViVYNFLkqtLo+DAkMMLXQPXwAy2WCTF4544FGtKuwPDhB6DnxuUmyCcXIQhV1uYoMuEAcOBxEKCHg6TzGFCJUSizuejROKOAM9OY2SnUU7nD89NCcDsLUnIQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+devscreen22:dev dev22 22:photo:22 22:R0lGODlhFgAWAIcAAPwCBAQCBPTy9PTu9Ozq7OTi5Nze3OTe5Nza3NzW3NTS1MzOzMzKzMzGzMTCxMTGxOzm7AwGDBQOFBQ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mRldmVsY29yLmNvbQA7
+playstop22:play play22 22:photo:22 22:R0lGODlhFgAWAIUAAPwCBAQCBAwKDBQSFBwaHCQmJJSSlISChJSOlJSWlGxqbGRiZNTS1PTy9Pz+/Ozm7OTi5FRSVIyKjOTe5MTCxIR+hExOTHR2dLy6vLSytLy2vHRydFxWXIyGjIyOjPz2/FRWVHx6fExKTMzOzJyanKSmpKyqrKSipAQGBLSutHx2fDw6PAwODAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAa1QIBwSCwaj8ikcslsAgKCAWEQjQ4KgSwyYDAcugZEQqFYYJECA6PhaLcfEEUkgJZAGJB8fkKpWOhHAxcOGBQZGBoaGQgbHIBGAhUOGR0SBxISBh4Xf0iCHxQSlRIIXhsgj0UCIaCXmJgHGyKpRJ+hmB5dHQqOaCENIx0epBIkBhdzngoPGCQlJifQJBvJRygRKRcKGxcXGypys1srEREc5SLnICLiR1koLFVUWfRO9vf4+UwyQQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+textblock22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwCBAQCBCH5BAEAAAAALAAAAAAWABYAAAImhI+py30Bo5zBWUWzvNzo33GfFl5jVlonlTrr1DbvFi9vjeeNUQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+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+pyw0Bo5zB2UXz3Sp7yG2fFJajVjonmIor2TJvfL0wjecIXQAAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+textright22:text text22 22:photo:22 22:R0lGODlhFgAWAIAAAPwC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AAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARTEMhJq70466Cl+AMxBVwnFIVRAmQHCIeBrC1L3tQgJ/SaEbeeC1PLBHE2ybFI9A1HzstHEIK6YCmhDTmBybQaHYJn7QC5zKeytIQe1+pKNE6P2yMAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewdetailed22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz+/Pz69PTq5AQCBOzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAAQ+EMhJq7046817+MLQUQFRGMc4lQaSAkcMx3QltMmrDrSu/sCgEPgJhIiFk89DaL1qPRnlhsgBebWhdstVESIAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewicon22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz69PTq5AQCBPz+/OzaxOTKpAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAWABYAAARWEMhJq7046z2DF0PlBeAVEERhiKhqHgWyUgEsX0KczFOO7JeBYciTCImc5ITIXDKHyqhU9AnRqq9UEVDTvmLbGhin2/qAliOUot5OLc81IO5+2+8WewQAIf5oQ3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxDb3IgMTk5NywxOTk4LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5jb20AOw==
+viewmag-22:view view22 22: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0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7
+viewmulticolumn22:view view22 22:photo:22 22:R0lGODlhFgAWAIMAAPwCBFRSVExKTDQyNPz+/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 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0 0 0 0 0 0 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 2 3 4 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 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..c252bd1684
--- /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 auxiliary 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,
+ 0x02,0x00,0x00,0x00,0xf0,0x00,0xbb,0xad,0xd6,0xaa,0x05,0x00,0x00,0x00,0xf0,
+ 0x00,0xca,0xb6,0x6b,0xdb,0x2a,0x00,0x00,0x00,0xf0,0x00,0x77,0xd5,0x5c,0x6d,
+ 0x2d,0x00,0x00,0x00,0xf0,0x00,0x99,0x05,0x00,0xaa,0x56,0x00,0x00,0x00,0xf0,
+ 0x00,0xee,0x06,0x00,0x6c,0xbb,0x00,0x00,0x00,0xf0,0x00,0xaa,0x02,0x00,0xb0,
+ 0x55,0x00,0x00,0x00,0xf0,0x00,0x55,0x05,0x00,0xa8,0xd6,0x00,0x00,0x00,0xf0,
+ 0x00,0xee,0x06,0x00,0xd0,0x6a,0x00,0x00,0x00,0xf0,0x00,0x55,0x03,0x00,0x68,
+ 0xb7,0xfc,0x00,0x7e,0xf0,0x00,0x6d,0x05,0x00,0xa8,0xaa,0xfc,0x80,0x7e,0xf0,
+ 0x00,0xb6,0x05,0x00,0x50,0xbb,0xfe,0x01,0x7e,0xf0,0x00,0x55,0x05,0x00,0x78,
+ 0xad,0xfe,0x81,0x1f,0xf0,0x00,0xb6,0x05,0x00,0xa4,0xb5,0xfe,0x81,0x1f,0xf0,
+ 0x00,0x5b,0x05,0x80,0xba,0x56,0xfe,0x83,0x1f,0xf0,0x00,0xaa,0x6b,0x5b,0xd5,
+ 0x5a,0xff,0x85,0x1f,0xf0,0x00,0xdb,0x5a,0xad,0x57,0x2b,0xff,0xc7,0x0f,0xf0,
+ 0x00,0x6d,0xad,0xd5,0x6a,0x0d,0xff,0xc7,0x0f,0xf0,0x00,0xaa,0xd6,0xb6,0xba,
+ 0x05,0xdf,0xc7,0x0f,0xf0,0x00,0xb7,0xb5,0x5a,0xab,0x8a,0xdf,0xcf,0x0f,0xf0,
+ 0x00,0xd9,0x5a,0xab,0x6d,0x8f,0xcf,0xef,0x07,0xf0,0x00,0x56,0xad,0x75,0xb5,
+ 0xaf,0x8f,0xef,0x07,0xf0,0x00,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
+ OTcsMTk5OC4gQWxsIHJpZ2h0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AapHvgaIDUqUPJlRjSbAoT0fRDKgODRbF0PLUYjZO2F2Bs
+ t9evNix+dsvDlGKK5jraudQb7qbX6a2HEJ+ycyF+LRE8ZTI+fX5oGCEAIf5o
+ Q3JlYXRlZCBieSBCTVBUb0dJRiBQcm8gdmVyc2lvbiAyLjUNCqkgRGV2ZWxD
+ 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///////////////yH5BAEAAAAALAAAAAAgAC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AAQBDlwNBl9sfApQAOw==}
+openfold {R0lGODlhEAANAKIAANnZ2YSEhP///8bGxv//AAAAAP///////yH5BAEAAAAALAAAAAAQAA0A
+AANgCIqhiqDLgaIaCLoagkNDIxi6AIFCQ0M4KKpRgCFDQzg0NIQThaHLSxgVKLochRMVMkhD
+Q4M0VBFYEDKEQ0NDOFFRgCE0NEhDQ4MVBRAoNDSEQ0NRWAAYuqyFBQBYurwJADs=}
+overstrike {R0lGODlhEAAQAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAQABAAAAI3hI+py80Uh+Aj
+RFhQCP8iMILgWwRGEHyLwAiCbxEYQfCB4iPBhwiMIPgXYREEHyEiguBj6nI7FQA7}
+palette {R0lGODlhEAAQAKIAANnZ2QAAAP//AP////8A/4QAhP8AAAD//yH5BAEAAAAALAAAAAAQABAA
+AANtCLrcjqGBoMsRKCMTgaALMSgDAYMSCKoxgAFBITgSAIAQEhUIARCAEgAQOBAwghMQEwga
+MoIjIxAIEgCAEBEyKBAgg4GgGxAIYTGCgaALcRgQIIGgCwEYICODgaALITgyEoGguxiqCLrc
+/lChBAA7}
+passwd {R0lGODlhIAAgAMQAANnZ2QAAAICAgICAAP///7CwsMDAwMjIAPjIAOjo6Pj4AODg4HBwcMj4
+ANjY2JiYANDQ0MjIyPj4yKCgoMiYAMjImDAwAMjIMJiYmJCQkP//////////////////////
+/yH5BAEAAAAALAAAAAAgACAAAAX/ICCOIhiIIgiII1maZSCMQnCeJyAIQiAIAiAMwxCcJwkk
+EAQRCIUwGMSBDEEAAuJIlgKRJEEgGAMRBIGiDENQlqNAJAsYCEwgEEEgBAHSIEMAAuJIAgKR
+LEsgGEMgCEJgBMqhHENQlgJILMsSCMRABEFgGAESHMcRgIA4kgKxOIsTBAOhKAITKEGDHMhD
+kqIAEqAjisJAgIooBkpwNMcTgIA4jgLhOBAkEAOhKIoSKEGDIMcTkKQICgQEQQIxEIqiBEpw
+IMdxPAEIiCMJCEQUMUQ0EIqiHIfSIM3x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RgoujqEVQi63IyBortUWAi63IuBostDWIWgy60YIjKERCMiSFUIutyAISKCpCoiOFSFoMsd
+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..588ae5ccd7
--- /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 management, a new .nmpgrc parser, and new options.
+<P><B>Urgency:</B> low
+<P ALIGN="right"><B>[ <A HREF="/news/2000/01/29/949187896.html">comments (0)</A> ]</B>
+</FONT></TD></TR></TABLE></TD></TR><TR><TD VALIGN="middle">
+&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 Hövekamp: 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')
+R0lGODlhYgIEAIIAAQAAACQ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AAAAQANCgEL
+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////MzP8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zAAzzAAzzDMz
+zP///wAA////M2bMADPMADPMADPMADPMADPMADPMADPMAGbMADPMAMz/ADPMADPMADPMADPM
+AADM7u7uzJmZmTMAmTMAMzPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM////
+AAD///8zM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAmf8AAMwAM8wAmcwAM8wAM8wAM8wAM8wA
+AMzMzP/////d3d0AAMwAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8z///8AAP//
+/zMzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzACZ/wAAzAAzzAD//wAAzAAzzAAzzAAzzAAzzAAz
+zAAAzAAAzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzP///wAA////MzPM
+ADPMADPMADPMADPMADPMADPMADPMAGbMAGbMADPMADPMAMz/AADMADPMADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM////AAD///8AM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAAMwAzP8AAMwAM8wAmf8A//8AAMwAM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8z///8AAP///wAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAAzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzP///wAA////ADPMADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPMADPM
+ADPMADPMADPMADPMADPMADPMADPMADPMADPMzMz/AAD///8AM8wAM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wAM8wA
+M8wAM8wAM8wAM8wAM8wAM8wAM8wAM8yZzP8AAP///wAzzAAzzAAzzAAzzAAzzAAzzAAzzAAz
+zAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzAAzzDMzzJmZ/2aZzGZm
+zGZmzDMzzDMzzDMzzAAzzAAzzJmZzAAA////////////7u7uzMz/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
+sQAqdojAlQMaCDLGHIlk8Ekqi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4cGBIYNjIwEAwSMCgmHhocFBAWNDAuNDI
+uIBweGBYcHhoeDgwQGhgaKCIgNjQuKiAgNjIuKiIgKCAeKCQiEhIWFBIUGBQaNC4sGBQcGBY
+YMi4sGhYWFhIYFhIaFhQWHhoaLCQkDg4SHBgaJB4gJB4eLiYmLiomGhYaEhIYFhYaIh4gHho
+gGhgcIBoaGBIaHhgcNDAsFBAUGhQYLigoLioqJiIgGhQaFA4SFhIWHhweFBIWJiAgIh4eFhI
+UHBYYIhweEg4WLiYkDg4WGBQYEA4SEA4UMCwqIhocHhgaJB4iJCAgFhASEBAUEhAUIBocFhA
+UKCQmHhgeEgwSNjQwEg4SLCgmDgwUGhQWLCgoEAwUFBASLigmEAwQGhIUFg4SIhoeEgwQKiY
+kFA4UDgwSJiIiIBwcKiQmLCooLCYkDgoQP//////////////////////////////////////
+////////////////////////////////////////////////////////////////////////
+/////////////////////////////////yH5BAEAAAAALAAAAABAACgAAAj+AAEIHEiwoMGC
+AQQMGECggIEDByNKnEgxIoIEChYgYNCggYMHEBREkECgosmTBydQqBChgQWXFzB07JihgYYN
+HDp4QMlz4gcJIEKIeDliJokSMzuaOAECRQoCKnpKHbhipgaZSRtgYNHChYaXGhy8gAEjhowZ
+U3vSqJE1KQsbN1rgGGEih44dPHr4+PHDBwIgaU+i6IjhZQMWQVgIuWFjCIsGRTveIFKECBEC
+RowcIYAgMEUkGmZeSKJkyJAJqDMsQVGCLQYNTJo40fHkyQsoUUJI6ez54JQGVEpUgSvEhhUb
+V7CwyKLFhJYtXFCQgNGkOpEkXWBU8PKFAODeBIH+ZADDIoyYEmOmgCFTpsoKMyAwbFkC4gya
+NGrQqGmyZs0SNm24cQQCBDgB3kAIvFFCGRnAEccYcowBxxx0XGEGClTUUYMdTNzRARJ24OHF
+HHnoMQcee+zhHR99HNiFETBg4ccfgFQRCBlhiWChIF+MIcgGHQwCgR0DEFKIIYcgksgccJjA
+QQVAdGHHgTAssIcibiwiCCNz1GGBCHOAQAggZIQAAi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emuEMJVzgE1WcAyAAESb6FOAZhygDNBYgAixM4AFpIEQU0gCJJ8gCPAhgRAhkgYUwgCEN
+b8gDLqKBg0R8QRSJYMQlxGCMGwSBFMz+kMMfmNEBRuDCFAlwhSRoAARa/OJACOBAKe6QgFbo
+oRZWwMMsWECFC4TABSMAwSxmcYE/CEEC0jgAAxoRgQ58AgDKOMY04qAHIszxQANQBicSYIkv
+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.# ",
+" 8.g.x#C.o. ",
+" N#DaA#raY.Xa4aV#4aPas#q.W.W.6a ",
+" i#O.l.4.4.4.4.4.s#wa7.N#wawaXawawawaA#q.C. ",
+" 3a3a4#wawawae.e.e.I.j#m#d#VaN#KaI.e.e.e.e.waDaO..#j#j#N#N#j#fa ",
+" O.A#wae.e.I.e.I.I.Kal#m#m#D.u.KaKaKaKaI.e.I.e.Da3aXaE#C#W.o.C. ",
+" w#e.k.I.I.Kaf#KaKaKaKal#m#m#D.l#j#Kaj#KaKaKaKaKaFai#u. GaDaI. ",
+" .#waKaI.KaKaj#j#j#j#j#VaD.m#FaVaj#j#j#j#j#j#j#KaKae.U. 9#o.Ka ",
+" .#Xae.Kaj#j#N#N#N#N#N#j#N#j#N#N#N#N#N#dbdbN#N#N#I.waU. e#M.taPa ",
+" .#U.Xawae.Kaj#N#7.dbj#a.a.a.a.a.a.a.j#7.sa##naj#I.e.waXaU.Yama.# ",
+" .#U.Xawae.I.Ka.bna3#0#3###sasaa.sac.##Ba7.u#N#Kaf#f#waXaU.4.s#Pa ",
+" j#N#5aW.Y.u#j#R# 8a.#XaXae.e.I.KaN#naz#0#q#gb7.7.N#N#N#u#nau#N#N#Kaf#f#e.waU.LaU. ",
+" 4.Hahb.bI.j#KaY. s#U.XaXawae.KaKaN#na3#0#3#gbna7.N#u#u#N#7.u#N#.bj#KaI.e.waXa.# ",
+" G.2#e.KaI.E# .#U.Xawae.P.Kaj#N#H.z#q#3#gb7.7.7.7.N#N#u#u#N#.bj#KaI.e.TaXaU.0. ",
+" Ca.#e.j#Va 5#aa0.MaU.Xawak.d#I.j#I#N.5a3#5aBa7.dbN#N#dbN#N#u#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v.a#a# ",
+" b.m.b.b.X.K..aK.b.7#D#F#hbv#m.b.m.m.F.F.F.v#v#F.v#L.L.L.L#..ka6#h.s.1.L#1.y#M#y#daM#M#day#y#M#M#M#a#a#a#a# ",
+" p.b.X.X.X.X.X.X.X.9aD#6#..m..aX.y#m.m.F.v#v#v#....1.Ia....kakar#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, 0x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JACSSSS2
+bUm2bUm2bUn/27b//9v/////////////27b/tm3btm3//9v/27b//////////////9skAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+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
+sIDK1BoyjFRUjZSF7f13eYn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R4Gsm4
+uV54beCT1Z5edCVNpc/TSn0HoOsh4gAOAQAAAwAAAAEAQAAAAQEAAwAAAAEAKAAAAQIAAwAA
+AAMAAAQkAQMAAwAAAAGAjQAAAQYAAwAAAAEAAgAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAA
+ARUAAwAAAAEAAwAAARYAAwAAAAEAKAAAARcABAAAAAEAAANuARoABQAAAAEAAAQqARsABQAA
+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/u7VW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A6GYAU41nFrzqLSFSw3GjJf6ZeEpUvwu
+bxDOcFREAkpXRKph7IjRzOjAvEnOC9jzcC7rnlp13YB29ip4wvxT1Jn+qwlthMQ5QWDbwlsE
+RTis4uQX+cZl+zCPQfWWGZgsEkfHhaML3KyQN901lIjwL/6a4GvL5EEK4QErneKSKqPW0qaD
++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
+Zv4Gj6LivWK7UxS0dDCknBGl2jNY6MKoKmBkljwYfQUD2d8ZqjkKgINASEyE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Bu
+IAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDA2MDEgMDAwMDAgbiAKMDAwMDAwMDg0OCAw
+MDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDcgL1Jvb3QgMSAwIFIgL0luZm8gNiAwIFIKPj4K
+c3RhcnR4cmVmCjkzOQolJUVPRgo=
+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 PC´s 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,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x03, 0xfc, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0x0f, 0xfc, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x0f,
+ 0xbf, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0x3f, 0x7f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3f, 0xaf, 0xfa, 0xab, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfa, 0xab, 0x3e,
+ 0x5f, 0xf5, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0xf5, 0x57, 0x3d, 0xaf, 0x0e, 0xac, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xa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, 0x0f, 0xfc, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x0f, 0xf0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 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..89da88aea4
--- /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(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ return(tclStubsPtr != (TclStubs*)NULL);
+}
+
+int
+tk_stubs_init_p(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ return 1;
+}
+
+int
+tk_stubs_init_p(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ /* 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..b4a85dbd1f
--- /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(void);
+extern int ruby_open_tcltk_dll(char *);
+extern int tcl_stubs_init_p(void);
+extern int tk_stubs_init_p(void);
+extern Tcl_Interp *ruby_tcl_create_ip_and_stubs_init(int*);
+extern int ruby_tcl_stubs_init(void);
+extern int ruby_tk_stubs_init(Tcl_Interp*);
+extern int ruby_tk_stubs_safeinit(Tcl_Interp*);
+extern int ruby_tcltk_stubs(void);
+
+/* 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..2d45f7511b
--- /dev/null
+++ b/ext/tk/tcltklib.c
@@ -0,0 +1,11130 @@
+/*
+ * 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
+
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 0
+
+#ifdef HAVE_RB_THREAD_CHECK_TRAP_PENDING
+static int rb_thread_critical; /* dummy */
+int rb_thread_check_trap_pending(void);
+#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(void)
+{
+ 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 void ip_free _((void *p));
+
+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 const rb_data_type_t tcltkip_type = {
+ "tcltkip",
+ {0, ip_free, 0,},
+};
+
+static struct tcltkip *
+get_ip(self)
+ VALUE self;
+{
+ struct tcltkip *ptr;
+
+ TypedData_Get_Struct(self, struct tcltkip, &tcltkip_type, ptr);
+ if (ptr == 0) {
+ /* rb_raise(rb_eTypeError, "uninitialized TclTkIp"); */
+ return((struct tcltkip *)NULL);
+ }
+ 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(void)
+{
+ 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(void)
+{
+ /*
+ * 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(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+ 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(void)
+{
+#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(void)
+{
+ 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(p)
+ void *p;
+{
+ struct tcltkip *ptr = p;
+ 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 TypedData_Wrap_Struct(self, &tcltkip_type, 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;
+}
+
+#ifndef ORIG_NAMESPACE_CMD
+#define ORIG_NAMESPACE_CMD "__orig_namespace_command__"
+#endif
+
+#if TCL_MAJOR_VERSION >= 8
+static int ip_rbNamespaceObjCmd _((ClientData, Tcl_Interp *, int,
+ 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;
+
+ DUMP1("call ip_rbNamespaceObjCmd");
+ DUMP2("objc = %d", objc);
+ DUMP2("objv[0] = '%s'", Tcl_GetString(objv[0]));
+ DUMP2("objv[1] = '%s'", Tcl_GetString(objv[1]));
+ if (!Tcl_GetCommandInfo(interp, ORIG_NAMESPACE_CMD, &(info))) {
+ DUMP1("fail to get "ORIG_NAMESPACE_CMD);
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp,
+ "invalid command name \"namespace\"", (char*)NULL);
+ return TCL_ERROR;
+ }
+
+ rbtk_eventloop_depth++;
+ DUMP2("namespace wrapper enter depth == %d", rbtk_eventloop_depth);
+
+ if (info.isNativeObjectProc) {
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
+ DUMP1("call a native-object-proc");
+ ret = (*(info.objProc))(info.objClientData, interp, objc, objv);
+#else
+ /* Tcl8.6 or later */
+ int i;
+ Tcl_Obj **cp_objv;
+ char org_ns_cmd_name[] = ORIG_NAMESPACE_CMD;
+
+ DUMP1("call a native-object-proc for tcl8.6 or later");
+ cp_objv = RbTk_ALLOC_N(Tcl_Obj *, (objc + 1));
+
+ cp_objv[0] = Tcl_NewStringObj(org_ns_cmd_name, strlen(org_ns_cmd_name));
+ for(i = 1; i < objc; i++) {
+ cp_objv[i] = objv[i];
+ }
+ cp_objv[objc] = (Tcl_Obj *)NULL;
+
+ /* ret = Tcl_EvalObjv(interp, objc, cp_objv, TCL_EVAL_DIRECT); */
+ ret = Tcl_EvalObjv(interp, objc, cp_objv, 0);
+
+ ckfree((char*)cp_objv);
+#endif
+ } else {
+ /* string interface */
+ int i;
+ char **argv;
+
+ DUMP1("call with the string-interface");
+ /* argv = (char **)Tcl_Alloc(sizeof(char *) * (objc + 1)); */
+ argv = RbTk_ALLOC_N(char *, (objc + 1));
+#if 0 /* use Tcl_Preserve/Release */
+ 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--;
+
+ DUMP1("end of ip_rbNamespaceObjCmd");
+ return ret;
+}
+#endif
+
+static void
+ip_wrap_namespace_command(interp)
+ Tcl_Interp *interp;
+{
+#if TCL_MAJOR_VERSION >= 8
+
+#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6
+ Tcl_CmdInfo orig_info;
+
+ if (!Tcl_GetCommandInfo(interp, "namespace", &(orig_info))) {
+ return;
+ }
+
+ if (orig_info.isNativeObjectProc) {
+ Tcl_CreateObjCommand(interp, ORIG_NAMESPACE_CMD,
+ orig_info.objProc, orig_info.objClientData,
+ orig_info.deleteProc);
+ } else {
+ Tcl_CreateCommand(interp, ORIG_NAMESPACE_CMD,
+ orig_info.proc, orig_info.clientData,
+ orig_info.deleteProc);
+ }
+
+#else /* tcl8.6 or later */
+ Tcl_Eval(interp, "rename namespace "ORIG_NAMESPACE_CMD);
+
+#endif
+
+ Tcl_CreateObjCommand(interp, "namespace", ip_rbNamespaceObjCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *)NULL);
+#endif
+}
+
+
+/* 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 */
+ TypedData_Get_Struct(self, struct tcltkip, &tcltkip_type, 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 TypedData_Wrap_Struct(CLASS_OF(interp), &tcltkip_type, 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(0,call_queue_mark,-1,q);
+ ret = rb_funcall(rb_proc_new(callq_safelevel_handler, q_dat),
+ ID_call, 0);
+ rb_gc_force_recycle(q_dat);
+ q_dat = (VALUE)NULL;
+ } else {
+ DUMP2("call function (for caller thread:%"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(0,eval_queue_mark,-1,q);
+ ret = rb_funcall(rb_proc_new(evq_safelevel_handler, q_dat),
+ ID_call, 0);
+ rb_gc_force_recycle(q_dat);
+ 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;
+#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION < 6
+ int i, len;
+ int argc = inf->objc;
+ char **argv = (char **)NULL;
+#endif
+
+ DUMP1("call invoke_tcl_proc");
+
+#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 6)
+ /* Tcl/Tk 8.6 or later */
+
+ /* eval */
+ inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, TCL_EVAL_DIRECT);
+ /* inf->ptr->return_value = Tcl_EvalObjv(inf->ptr->ip, inf->objc, inf->objv, 0); */
+
+#else /* Tcl/Tk 7.x, 8.0 -- 8.5 */
+
+ /* memory allocation for arguments of this command */
+#if TCL_MAJOR_VERSION == 8
+ /* Tcl/Tk 8.0 -- 8.5 */
+ if (!inf->cmdinfo.isNativeObjectProc) {
+ DUMP1("called proc is not a native-obj-proc");
+ /* string interface */
+ /* argv = (char **)ALLOC_N(char *, argc+1);*/ /* XXXXXXXXXX */
+ argv = RbTk_ALLOC_N(char *, (argc+1));
+#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
+
+ DUMP1("reset result of tcl-interp");
+ Tcl_ResetResult(inf->ptr->ip);
+
+ /* Invoke the C procedure */
+#if TCL_MAJOR_VERSION == 8
+ /* Tcl/Tk 8.0 -- 8.5 */
+ if (inf->cmdinfo.isNativeObjectProc) {
+ DUMP1("call tcl_proc as a native-obj-proc");
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.objProc))(inf->cmdinfo.objClientData,
+ inf->ptr->ip, inf->objc, inf->objv);
+ }
+ else
+#endif
+ {
+#if TCL_MAJOR_VERSION == 8
+ /* Tcl/Tk 8.0 -- 8.5 */
+ DUMP1("call tcl_proc as not a native-obj-proc");
+ inf->ptr->return_value
+ = (*(inf->cmdinfo.proc))(inf->cmdinfo.clientData, inf->ptr->ip,
+ argc, (CONST84 char **)argv);
+
+#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
+ }
+
+#endif /* Tcl/Tk 8.6 or later || Tcl 7.x, 8.0 -- 8.5 */
+
+ DUMP1("end of invoke_tcl_proc");
+ 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 */
+ DUMP1("invoke tcl-proc");
+ rb_protect(invoke_tcl_proc, (VALUE)&inf, &status);
+ DUMP2("status of tcl-proc, %d", status);
+ switch(status) {
+ case TAG_RAISE:
+ if (NIL_P(rb_errinfo())) {
+ 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(0,invoke_queue_mark,-1,q);
+ ret = rb_funcall(rb_proc_new(ivq_safelevel_handler, q_dat),
+ ID_call, 0);
+ rb_gc_force_recycle(q_dat);
+ q_dat = (VALUE)NULL;
+ } else {
+ DUMP2("call invoke_real (for caller thread:%"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(void)
+{
+ 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(void)
+{
+ 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..bab68dd145
--- /dev/null
+++ b/ext/tk/tkutil/tkutil.c
@@ -0,0 +1,1878 @@
+/************************************************
+
+ 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
+
+#undef RUBY_UNTYPED_DATA_WARNING
+#define RUBY_UNTYPED_DATA_WARNING 1
+
+#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 size_t
+subst_memsize(ptr)
+ const struct cbsubst_info *ptr;
+{
+ return sizeof(*ptr);
+}
+
+static const rb_data_type_t cbsubst_info_type = {
+ "TkUtil/CallbackSubst/Info",
+ {
+ subst_mark,
+ subst_free,
+ subst_memsize,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
+static VALUE
+allocate_cbsubst_info(struct cbsubst_info **inf_ptr)
+{
+ 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 TypedData_Wrap_Struct(cSUBST_INFO, &cbsubst_info_type, inf);
+}
+
+static void
+cbsubst_init(void)
+{
+ rb_const_set(cCB_SUBST, ID_SUBST_INFO,
+ allocate_cbsubst_info((struct cbsubst_info **)NULL));
+}
+
+static struct cbsubst_info *
+cbsubst_get_ptr(klass)
+ VALUE klass;
+{
+ return rb_check_typeddata(rb_const_get(klass, ID_SUBST_INFO), &cbsubst_info_type);
+}
+
+static VALUE
+cbsubst_initialize(argc, argv, self)
+ int argc;
+ VALUE *argv;
+ VALUE self;
+{
+ struct cbsubst_info *inf;
+ int idx, iv_idx;
+
+ inf = cbsubst_get_ptr(rb_obj_class(self));
+
+ 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");
+ }
+
+ inf = cbsubst_get_ptr(self);
+
+ 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;
+
+ inf = cbsubst_get_ptr(self);
+
+ 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;
+
+ inf = cbsubst_get_ptr(self);
+
+ 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);
+
+ inf = cbsubst_get_ptr(self);
+
+ 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;
+
+ inf = cbsubst_get_ptr(self);
+
+ ptr = buf = ALLOC_N(char, inf->full_subst_length + 1);
+ keys_ptr = keys_buf = ALLOC_N(char, CBSUBST_TBL_MAX + 1);
+
+ 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;
+
+ chr = NUM2CHR(RARRAY_PTR(inf)[0]);
+ 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
+ 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();
+
+ inf = cbsubst_get_ptr(self);
+
+ 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(void)
+{
+ 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/depend b/ext/win32/depend
deleted file mode 100644
index 0301ce074c..0000000000
--- a/ext/win32/depend
+++ /dev/null
@@ -1,2 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-# AUTOGENERATED DEPENDENCIES END
diff --git a/ext/win32/extconf.rb b/ext/win32/extconf.rb
index ceab4ef4f4..c4efee8149 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?('fiddle') and $mswin||$mingw||$cygwin
create_makefile('win32')
end
diff --git a/ext/win32/lib/Win32API.rb b/ext/win32/lib/Win32API.rb
index 97b29fbf74..71f1d30e01 100644
--- a/ext/win32/lib/Win32API.rb
+++ b/ext/win32/lib/Win32API.rb
@@ -1,8 +1,6 @@
# -*- ruby -*-
-# frozen_string_literal: true
-
# for backward compatibility
-warn "Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead", uplevel: 2
+warn "Warning:#{caller[0].sub(/:in `.*'\z/, '')}: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead" if $VERBOSE
require 'fiddle/import'
@@ -11,24 +9,16 @@ class Win32API
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"
-
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)
+ @proto = [import].join.tr("VPpNnLlIi", "0SSI").sub(/^(.)0*$/, '\1')
+ handle = DLL[dllname] ||= Fiddle.dlopen(dllname)
+
+ @func = Fiddle::Function.new(
+ handle[func],
+ @proto.chars.map { |win_type| TYPEMAP[win_type.tr("VPpNnLlIi", "0SSI")] },
+ TYPEMAP[export.tr("VPpNnLlIi", "0SSI")],
+ Fiddle::Importer.const_get(:CALL_TYPE_TO_ABI)[calltype]
+ )
rescue Fiddle::DLError => e
raise LoadError, e.message, e.backtrace
end
diff --git a/ext/win32/lib/win32/importer.rb b/ext/win32/lib/win32/importer.rb
index 2bef016c29..7975cb7f5d 100644
--- a/ext/win32/lib/win32/importer.rb
+++ b/ext/win32/lib/win32/importer.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
require 'fiddle/import'
module Win32
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index 451499b166..7fbeb5c649 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
@@ -378,16 +377,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.
@@ -575,9 +573,9 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
begin
type, data = read(subkey)
rescue Error
- else
- yield subkey, type, data
+ next
end
+ yield subkey, type, data
index += 1
end
index
@@ -635,7 +633,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 +641,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 +657,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 +680,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 +744,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 +753,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 1eb70d5dc6..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
-
-if [nil].pack("p").size <= 4 # 32bit env
- begin
- f = Fiddle
- osid = f::Handle.new["rb_w32_osid"]
- rescue f::DLError # not ix86, cannot be Windows 9x
- else
- if f::Function.new(osid, [], f::TYPE_INT).call < 2 # VER_PLATFORM_WIN32_NT
- require_relative 'resolv9x'
- return
- end
- end
+module Kernel32
+ extend Importer
+ dlload "kernel32"
end
-
-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,5 +119,260 @@ module Win32
[ search.uniq, nameserver.uniq ]
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/depend b/ext/win32/resolv/depend
deleted file mode 100644
index a6d24c3738..0000000000
--- a/ext/win32/resolv/depend
+++ /dev/null
@@ -1,17 +0,0 @@
-# AUTOGENERATED DEPENDENCIES START
-resolv.o: $(RUBY_EXTCONF_H)
-resolv.o: $(arch_hdrdir)/ruby/config.h
-resolv.o: $(hdrdir)/ruby.h
-resolv.o: $(hdrdir)/ruby/assert.h
-resolv.o: $(hdrdir)/ruby/backward.h
-resolv.o: $(hdrdir)/ruby/defines.h
-resolv.o: $(hdrdir)/ruby/encoding.h
-resolv.o: $(hdrdir)/ruby/intern.h
-resolv.o: $(hdrdir)/ruby/missing.h
-resolv.o: $(hdrdir)/ruby/onigmo.h
-resolv.o: $(hdrdir)/ruby/oniguruma.h
-resolv.o: $(hdrdir)/ruby/ruby.h
-resolv.o: $(hdrdir)/ruby/st.h
-resolv.o: $(hdrdir)/ruby/subst.h
-resolv.o: resolv.c
-# AUTOGENERATED DEPENDENCIES END
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 d7034f7845..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).map(&:to_sym)
- 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..7136c938a3 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,7 +26,7 @@ range = worksheet.Range("A1:D2");
range.Select
chart = workbook.Charts.Add;
-workbook.saved = true;
+workbook.saved = TRUE;
print "Now quit Excel... Please enter."
gets
diff --git a/ext/win32ole/sample/excel2.rb b/ext/win32ole/sample/excel2.rb
index 47a5715f84..632882636a 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;
diff --git a/ext/win32ole/sample/excel3.rb b/ext/win32ole/sample/excel3.rb
index 72aee2a929..1ace478007 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
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 f20bfc84f6..0b455c2ec3 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -1,7 +1,6 @@
/*
* (c) 1995 Microsoft Corporation. All rights reserved.
- * Developed by ActiveWare Internet Corp., now known as
- * ActiveState Tool Corp., http://www.ActiveState.com
+ * Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
*
* Other modifications Copyright (c) 1997, 1998 by Gurusamy Sarathy
* <gsar@umich.edu> and Jan Dubois <jan.dubois@ibm.net>
@@ -27,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.4"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -37,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
@@ -51,7 +50,6 @@ 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;
@@ -101,7 +99,7 @@ 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 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);
@@ -171,7 +169,6 @@ 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",
@@ -352,7 +349,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;
@@ -386,7 +383,7 @@ 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;
}
@@ -424,12 +421,12 @@ 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.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 = 0;
SystemTimeToVariantTime(&st, &t);
@@ -438,7 +435,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;
@@ -454,18 +451,18 @@ vtdate2rbtime(double date)
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));
+ INT2FIX(st.wYear),
+ INT2FIX(st.wMonth),
+ INT2FIX(st.wDay),
+ INT2FIX(st.wHour),
+ INT2FIX(st.wMinute),
+ INT2FIX(st.wSecond));
+ st.wYear = FIX2INT(rb_funcall(v, rb_intern("year"), 0));
+ st.wMonth = FIX2INT(rb_funcall(v, rb_intern("month"), 0));
+ st.wDay = FIX2INT(rb_funcall(v, rb_intern("mday"), 0));
+ st.wHour = FIX2INT(rb_funcall(v, rb_intern("hour"), 0));
+ st.wMinute = FIX2INT(rb_funcall(v, rb_intern("min"), 0));
+ st.wSecond = FIX2INT(rb_funcall(v, rb_intern("sec"), 0));
st.wMilliseconds = 0;
SystemTimeToVariantTime(&st, &sec);
/*
@@ -579,13 +576,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)
@@ -693,25 +688,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)
{
@@ -719,17 +695,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;
}
@@ -820,22 +811,16 @@ 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");
}
}
}
@@ -866,21 +851,14 @@ 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);
+ cp = FIX2INT((VALUE)data);
} else {
cp = ole_encoding2cp(enc);
if (code_page_installed(cp) ||
@@ -892,45 +870,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(tbl, (VALUE)enc | FIXNUM_FLAG, INT2FIX(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;
}
@@ -1279,16 +1275,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;
@@ -1495,58 +1482,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__)
@@ -1592,22 +1579,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:
@@ -1810,9 +1793,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);
@@ -1856,7 +1837,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);
}
@@ -1985,6 +1966,10 @@ fole_s_connect(int argc, VALUE *argv, VALUE self)
rb_scan_args(argc, argv, "1*", &svr_name, &others);
StringValue(svr_name);
+ if (rb_safe_level() > 0 && OBJ_TAINTED(svr_name)) {
+ rb_raise(rb_eSecurityError, "insecure connection - `%s'",
+ StringValuePtr(svr_name));
+ }
/* get CLSID from OLE server name */
pBuf = ole_vstr2wc(svr_name);
@@ -2070,12 +2055,12 @@ fole_s_const_load(int argc, VALUE *argv, VALUE self)
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)) {
@@ -2134,7 +2119,7 @@ fole_s_reference_count(VALUE self, VALUE obj)
{
struct oledata * pole = NULL;
pole = oledata_get_struct(obj);
- return RB_INT2NUM(reference_count(pole));
+ return INT2NUM(reference_count(pole));
}
/*
@@ -2157,7 +2142,7 @@ fole_s_free(VALUE self, VALUE obj)
n = OLE_RELEASE(pole->pDispatch);
}
}
- return RB_INT2NUM(n);
+ return INT2NUM(n);
}
static HWND
@@ -2174,10 +2159,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;
}
@@ -2234,7 +2219,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
@@ -2271,7 +2256,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?
@@ -2291,7 +2276,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
@@ -2326,7 +2311,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 {
@@ -2439,16 +2424,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.
@@ -2459,23 +2440,25 @@ 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)) {
+ rb_raise(rb_eSecurityError, "insecure object creation - `%s'",
+ StringValuePtr(svr_name));
+ }
if (!NIL_P(host)) {
StringValue(host);
+ if (rb_safe_level() > 0 && OBJ_TAINTED(host)) {
+ rb_raise(rb_eSecurityError, "insecure object creation - `%s'",
+ StringValuePtr(host));
+ }
return ole_create_dcom(self, svr_name, host, others);
}
@@ -2492,35 +2475,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,
@@ -2554,7 +2511,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" */
@@ -2621,7 +2578,7 @@ 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);
if(!pole->pDispatch) {
@@ -2637,7 +2594,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));
}
}
@@ -2839,11 +2798,7 @@ 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
@@ -2856,7 +2811,8 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind)
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;
@@ -2877,7 +2833,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)
@@ -3012,7 +2968,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,
@@ -3021,7 +2977,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));
}
@@ -3110,11 +3066,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);
}
/*
@@ -3133,11 +3085,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);
}
/*
@@ -3159,11 +3107,7 @@ 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
@@ -3313,7 +3257,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) {
@@ -3329,7 +3273,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);
@@ -3346,32 +3290,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);
}
}
@@ -3388,7 +3330,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,
@@ -3398,7 +3340,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++) {
@@ -3523,7 +3465,7 @@ fole_type(VALUE self)
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);
@@ -3557,7 +3499,7 @@ fole_typelib(VALUE self)
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);
@@ -3604,7 +3546,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));
}
@@ -3633,7 +3575,7 @@ 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);
wcmdname = ole_vstr2wc(method);
@@ -3814,7 +3756,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)
@@ -3845,7 +3787,7 @@ fole_method_help(VALUE self, VALUE cmdname)
pole = oledata_get_struct(self);
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);
@@ -3941,34 +3883,14 @@ static size_t
com_hash_size(const void *ptr)
{
const st_table *tbl = ptr;
- return st_memsize(tbl);
-}
-
-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);
- }
+ return tbl ? st_memsize(tbl) : 0;
}
-
void
Init_win32ole(void)
{
cWIN32OLE_lcid = LOCALE_SYSTEM_DEFAULT;
g_ole_initialized_init();
- check_nano_server();
com_vtbl.QueryInterface = QueryInterface;
com_vtbl.AddRef = AddRef;
@@ -3985,12 +3907,10 @@ 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();
+ enc2cp_hash = TypedData_Wrap_Struct(rb_cData, &win32ole_hash_datatype, 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 = TypedData_Wrap_Struct(rb_cData, &win32ole_hash_datatype, st_init_numtable());
rb_gc_register_mark_object(com_hash);
cWIN32OLE = rb_define_class("WIN32OLE", rb_cObject);
@@ -4072,7 +3992,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());
@@ -4080,50 +4000,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();
diff --git a/ext/win32ole/win32ole.h b/ext/win32ole/win32ole.h
index c019930397..d61f5e23b4 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
diff --git a/ext/win32ole/win32ole_error.c b/ext/win32ole/win32ole_error.c
index 022527617e..62e69b186c 100644
--- a/ext/win32ole/win32ole_error.c
+++ b/ext/win32ole/win32ole_error.c
@@ -80,5 +80,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..5359646ff1 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 ole_raise(HRESULT hr, VALUE ecs, const char *fmt, ...);
void Init_win32ole_error(void);
#endif
diff --git a/ext/win32ole/win32ole_event.c b/ext/win32ole/win32ole_event.c
index 041639af6c..105308a348 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);
@@ -310,6 +294,17 @@ PIEVENTSINKOBJ
EVENTSINK_Constructor(void)
{
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 +337,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 +358,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 +412,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 +465,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);
@@ -922,6 +917,10 @@ ev_advise(int argc, VALUE *argv, VALUE self)
if(!RB_TYPE_P(itf, T_NIL)) {
pitf = StringValuePtr(itf);
+ if (rb_safe_level() > 0 && OBJ_TAINTED(itf)) {
+ rb_raise(rb_eSecurityError, "insecure event creation - `%s'",
+ StringValuePtr(itf));
+ }
hr = find_iid(ole, pitf, &iid, &pTypeInfo);
}
else {
@@ -938,7 +937,7 @@ ev_advise(int argc, VALUE *argv, VALUE self)
&p);
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, eWIN32OLEQueryInterfaceError,
+ ole_raise(hr, rb_eRuntimeError,
"failed to query IConnectionPointContainer");
}
pContainer = p;
@@ -949,7 +948,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;
@@ -957,7 +956,7 @@ 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);
@@ -1042,7 +1041,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);
@@ -1132,7 +1131,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);
@@ -1260,7 +1259,6 @@ fev_get_handler(VALUE self)
void
Init_win32ole_event(void)
{
-#undef rb_intern
ary_ole_event = rb_ary_new();
rb_gc_register_mark_object(ary_ole_event);
id_events = rb_intern("events");
diff --git a/ext/win32ole/win32ole_method.c b/ext/win32ole/win32ole_method.c
index ffa9324657..ba8cf78015 100644
--- a/ext/win32ole/win32ole_method.c
+++ b/ext/win32ole/win32ole_method.c
@@ -83,7 +83,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 +119,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 +148,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 +179,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);
@@ -283,7 +283,7 @@ folemethod_initialize(VALUE self, VALUE oletype, VALUE method)
}
/*
- * call-seq:
+ * call-seq
* WIN32OLE_METHOD#name
*
* Returns the name of the method.
@@ -308,7 +308,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);
@@ -344,7 +344,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;
}
@@ -410,7 +410,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 +420,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;
@@ -712,7 +712,7 @@ ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index)
&helpcontext, NULL);
if (FAILED(hr))
return Qnil;
- return RB_INT2FIX(helpcontext);
+ return INT2FIX(helpcontext);
}
/*
@@ -741,7 +741,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;
}
@@ -772,7 +772,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;
}
@@ -803,7 +803,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;
}
@@ -835,7 +835,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;
}
diff --git a/ext/win32ole/win32ole_param.c b/ext/win32ole/win32ole_param.c
index 52905b3e8e..31cf853b04 100644
--- a/ext/win32ole/win32ole_param.c
+++ b/ext/win32ole/win32ole_param.c
@@ -149,7 +149,7 @@ foleparam_initialize(VALUE self, VALUE olemethod, VALUE n)
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);
}
diff --git a/ext/win32ole/win32ole_record.c b/ext/win32ole/win32ole_record.c
index e8838832a7..28d6238492 100644
--- a/ext/win32ole/win32ole_record.c
+++ b/ext/win32ole/win32ole_record.c
@@ -288,7 +288,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 +452,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 +508,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 +547,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);
}
diff --git a/ext/win32ole/win32ole_type.c b/ext/win32ole/win32ole_type.c
index e6ac402ecf..efcac883df 100644
--- a/ext/win32ole/win32ole_type.c
+++ b/ext/win32ole/win32ole_type.c
@@ -468,7 +468,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 +497,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 +526,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 +645,7 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo)
&helpcontext, NULL);
if(FAILED(hr))
return Qnil;
- return RB_INT2FIX(helpcontext);
+ return INT2FIX(helpcontext);
}
/*
diff --git a/ext/win32ole/win32ole_typelib.c b/ext/win32ole/win32ole_typelib.c
index 35376c644b..5a431d8b12 100644
--- a/ext/win32ole/win32ole_typelib.c
+++ b/ext/win32ole/win32ole_typelib.c
@@ -399,7 +399,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 +541,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 +563,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;
}
diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c
index 3dc9972ee7..dd583828f2 100644
--- a/ext/win32ole/win32ole_variable.c
+++ b/ext/win32ole/win32ole_variable.c
@@ -319,7 +319,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;
}
diff --git a/ext/win32ole/win32ole_variant.c b/ext/win32ole/win32ole_variant.c
index 3ff8f4ffbf..1731ab7a61 100644
--- a/ext/win32ole/win32ole_variant.c
+++ b/ext/win32ole/win32ole_variant.c
@@ -155,12 +155,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;
}
@@ -294,7 +294,7 @@ 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);
@@ -309,7 +309,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,7 +409,9 @@ 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);
@@ -420,7 +422,7 @@ folevariant_initialize(VALUE self, VALUE args)
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");
}
@@ -465,7 +467,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 +491,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
@@ -544,9 +546,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
@@ -602,7 +604,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
@@ -649,7 +651,7 @@ folevariant_vartype(VALUE self)
{
struct olevariantdata *pvar;
TypedData_Get_Struct(self, struct olevariantdata, &olevariant_datatype, pvar);
- return RB_INT2FIX(V_VT(&pvar->var));
+ return INT2FIX(V_VT(&pvar->var));
}
/*
@@ -659,7 +661,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
@@ -692,7 +694,6 @@ ole_variant2variant(VALUE val, VARIANT *var)
void
Init_win32ole_variant(void)
{
-#undef rb_intern
cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);
rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate);
rb_define_singleton_method(cWIN32OLE_VARIANT, "array", folevariant_s_array, 2);
@@ -707,19 +708,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.
@@ -729,5 +730,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_m.c b/ext/win32ole/win32ole_variant_m.c
index 4d76fdc790..eb3b0b11bb 100644
--- a/ext/win32ole/win32ole_variant_m.c
+++ b/ext/win32ole/win32ole_variant_m.c
@@ -17,133 +17,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/zlib/.gitignore b/ext/zlib/.gitignore
deleted file mode 100644
index 069491b4b4..0000000000
--- a/ext/zlib/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/zlib-[1-9]*.*.*
diff --git a/ext/zlib/depend b/ext/zlib/depend
index 5ab5684fb0..9d47df2a8d 100644
--- a/ext/zlib/depend
+++ b/ext/zlib/depend
@@ -1,19 +1,5 @@
-# AUTOGENERATED DEPENDENCIES START
-zlib.o: $(RUBY_EXTCONF_H)
-zlib.o: $(arch_hdrdir)/ruby/config.h
-zlib.o: $(hdrdir)/ruby.h
-zlib.o: $(hdrdir)/ruby/assert.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: 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 5c8aab24af..6a16a039fd 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -25,11 +25,7 @@
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
#endif
-#define RUBY_ZLIB_VERSION "1.1.0"
-
-#ifndef RB_PASS_CALLED_KEYWORDS
-# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
-#endif
+#define RUBY_ZLIB_VERSION "0.6.0"
#ifndef GZIP_SUPPORT
#define GZIP_SUPPORT 1
@@ -56,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 --------*/
@@ -76,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);
@@ -89,7 +86,6 @@ static void zstream_passthrough_input(struct zstream*);
static VALUE zstream_detach_input(struct zstream*);
static void zstream_reset(struct zstream*);
static VALUE zstream_end(struct zstream*);
-static VALUE zstream_ensure_end(VALUE v);
static void zstream_run(struct zstream*, Bytef*, long, int);
static VALUE zstream_sync(struct zstream*, Bytef*, long);
static void zstream_mark(void*);
@@ -145,19 +141,19 @@ static void gzfile_reset(struct gzfile*);
static void gzfile_close(struct gzfile*, int);
static void gzfile_write_raw(struct gzfile*);
static VALUE gzfile_read_raw_partial(VALUE);
-static VALUE gzfile_read_raw_rescue(VALUE,VALUE);
-static VALUE gzfile_read_raw(struct gzfile*, VALUE outbuf);
-static int gzfile_read_raw_ensure(struct gzfile*, long, VALUE outbuf);
+static VALUE gzfile_read_raw_rescue(VALUE);
+static VALUE gzfile_read_raw(struct gzfile*);
+static int gzfile_read_raw_ensure(struct gzfile*, long);
static char *gzfile_read_raw_until_zero(struct gzfile*, long);
static unsigned int gzfile_get16(const unsigned char*);
static unsigned long gzfile_get32(const unsigned char*);
static void gzfile_set32(unsigned long n, unsigned char*);
static void gzfile_make_header(struct gzfile*);
static void gzfile_make_footer(struct gzfile*);
-static void gzfile_read_header(struct gzfile*, VALUE outbuf);
-static void gzfile_check_footer(struct gzfile*, VALUE outbuf);
+static void gzfile_read_header(struct gzfile*);
+static void gzfile_check_footer(struct gzfile*);
static void gzfile_write(struct gzfile*, Bytef*, long);
-static long gzfile_read_more(struct gzfile*, VALUE outbuf);
+static long gzfile_read_more(struct gzfile*);
static void gzfile_calc_crc(struct gzfile*, VALUE);
static VALUE gzfile_read(struct gzfile*, long);
static VALUE gzfile_read_all(struct gzfile*);
@@ -202,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);
@@ -365,7 +361,11 @@ finalizer_warn(const char *msg)
static VALUE
rb_zlib_version(VALUE klass)
{
- return rb_str_new2(zlibVersion());
+ VALUE str;
+
+ str = rb_str_new2(zlibVersion());
+ OBJ_TAINT(str); /* for safe */
+ return str;
}
#if SIZEOF_LONG > SIZEOF_INT
@@ -387,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;
@@ -452,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
@@ -490,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
@@ -529,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 {
@@ -551,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
@@ -601,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;
@@ -625,11 +629,13 @@ 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);
rb_protect(rb_yield, z->buf, &state);
@@ -643,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;
}
}
@@ -657,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);
}
}
@@ -681,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;
}
@@ -709,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 {
@@ -727,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) \
@@ -737,7 +768,7 @@ zstream_append_buffer(struct zstream *z, const Bytef *src, long len)
static VALUE
zstream_detach_buffer(struct zstream *z)
{
- VALUE dst;
+ VALUE dst, self = (VALUE)z->stream.opaque;
if (!ZSTREAM_IS_FINISHED(z) && !ZSTREAM_IS_GZFILE(z) &&
rb_block_given_p()) {
@@ -751,10 +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;
@@ -770,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;
}
@@ -795,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;
@@ -816,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
@@ -842,50 +880,20 @@ zstream_append_input(struct zstream *z, const Bytef *src, long len)
static void
zstream_discard_input(struct zstream *z, long len)
{
- if (NIL_P(z->input)) {
- }
- else if (RBASIC_CLASS(z->input) == 0) {
- /* hidden, we created z->input and have complete control */
- char *ptr;
- long oldlen, newlen;
-
- RSTRING_GETMEM(z->input, ptr, oldlen);
- newlen = oldlen - len;
- if (newlen > 0) {
- memmove(ptr, ptr + len, newlen);
- }
- if (newlen < 0) {
- newlen = 0;
- }
- rb_str_resize(z->input, newlen);
- if (newlen == 0) {
- rb_gc_force_recycle(z->input);
- z->input = Qnil;
- }
- else {
- rb_str_set_len(z->input, newlen);
- }
+ if (NIL_P(z->input) || RSTRING_LEN(z->input) <= len) {
+ z->input = Qnil;
}
- else { /* do not mangle user-provided data */
- if (RSTRING_LEN(z->input) <= len) {
- z->input = Qnil;
- }
- else {
- z->input = rb_str_substr(z->input, len,
- RSTRING_LEN(z->input) - len);
- }
+ else {
+ 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);
}
}
static void
zstream_reset_input(struct zstream *z)
{
- if (!NIL_P(z->input) && RBASIC_CLASS(z->input) == 0) {
- rb_str_resize(z->input, 0);
- }
- else {
- z->input = Qnil;
- }
+ z->input = Qnil;
}
static void
@@ -910,6 +918,7 @@ zstream_detach_input(struct zstream *z)
rb_obj_reveal(dst, rb_cString);
}
z->input = Qnil;
+ rb_obj_reveal(dst, rb_cString);
return dst;
}
@@ -924,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);
@@ -952,12 +962,6 @@ zstream_end(struct zstream *z)
return Qnil;
}
-static VALUE
-zstream_ensure_end(VALUE v)
-{
- return zstream_end((struct zstream *)v);
-}
-
static void *
zstream_run_func(void *ptr)
{
@@ -970,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;
@@ -997,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) {
@@ -1014,7 +1017,6 @@ zstream_run_func(void *ptr)
/*
* There is no safe way to interrupt z->run->func().
- * async-signal-safe
*/
static void
zstream_unblock_func(void *ptr)
@@ -1029,7 +1031,7 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
{
struct zstream_run_args args;
int err;
- VALUE old_input = Qnil;
+ volatile VALUE guard = Qnil;
args.z = z;
args.flush = flush;
@@ -1043,13 +1045,12 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
}
else {
zstream_append_input(z, src, len);
+ z->stream.next_in = (Bytef*)RSTRING_PTR(z->input);
+ z->stream.avail_in = MAX_UINT(RSTRING_LEN(z->input));
/* keep reference to `z->input' so as not to be garbage collected
after zstream_reset_input() and prevent `z->stream.next_in'
from dangling. */
- old_input = zstream_detach_input(z);
- rb_obj_hide(old_input); /* for GVL release and later recycle */
- z->stream.next_in = (Bytef*)RSTRING_PTR(old_input);
- z->stream.avail_in = MAX_UINT(RSTRING_LEN(old_input));
+ guard = z->input;
}
if (z->stream.avail_out == 0) {
@@ -1057,14 +1058,8 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
}
loop:
-#ifndef RB_NOGVL_UBF_ASYNC_SAFE
err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)&args,
zstream_unblock_func, (void *)&args);
-#else
- err = (int)(VALUE)rb_nogvl(zstream_run_func, (void *)&args,
- zstream_unblock_func, (void *)&args,
- RB_NOGVL_UBF_ASYNC_SAFE);
-#endif
if (flush != Z_FINISH && err == Z_BUF_ERROR
&& z->stream.avail_out > 0) {
@@ -1093,10 +1088,7 @@ loop:
if (z->stream.avail_in > 0) {
zstream_append_input(z, z->stream.next_in, z->stream.avail_in);
- }
- if (!NIL_P(old_input)) {
- rb_str_resize(old_input, 0);
- rb_gc_force_recycle(old_input);
+ RB_GC_GUARD(guard) = Qnil; /* prevent tail call to make guard effective */
}
if (args.jump_state)
@@ -1329,6 +1321,7 @@ rb_zstream_flush_next_in(VALUE obj)
TypedData_Get_Struct(obj, struct zstream, &zstream_data_type, z);
dst = zstream_detach_input(z);
+ OBJ_INFECT(dst, obj);
return dst;
}
@@ -1374,6 +1367,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;
}
@@ -1424,7 +1418,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);
}
/*
@@ -1459,7 +1453,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)
@@ -1589,6 +1583,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;
@@ -1647,8 +1642,9 @@ rb_deflate_s_deflate(int argc, VALUE *argv, VALUE klass)
args[0] = (VALUE)&z;
args[1] = src;
- dst = rb_ensure(deflate_run, (VALUE)args, zstream_ensure_end, (VALUE)&z);
+ dst = rb_ensure(deflate_run, (VALUE)args, zstream_end, (VALUE)&z);
+ OBJ_INFECT(dst, src);
return dst;
}
@@ -1698,6 +1694,7 @@ rb_deflate_deflate(int argc, VALUE *argv, VALUE obj)
VALUE src, flush;
rb_scan_args(argc, argv, "11", &src, &flush);
+ OBJ_INFECT(obj, src);
do_deflate(z, src, ARG_FLUSH(flush));
return zstream_detach_buffer(z);
@@ -1715,6 +1712,7 @@ rb_deflate_deflate(int argc, VALUE *argv, VALUE obj)
static VALUE
rb_deflate_addstr(VALUE obj, VALUE src)
{
+ OBJ_INFECT(obj, src);
do_deflate(get_zstream(obj), src, Z_NO_FLUSH);
return obj;
}
@@ -1769,26 +1767,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;
}
@@ -1814,6 +1809,7 @@ rb_deflate_set_dictionary(VALUE obj, VALUE dic)
VALUE src = dic;
int err;
+ OBJ_INFECT(obj, dic);
StringValue(src);
err = deflateSetDictionary(&z->stream,
(Bytef*)RSTRING_PTR(src), RSTRING_LENINT(src));
@@ -1958,8 +1954,9 @@ rb_inflate_s_inflate(VALUE obj, VALUE src)
args[0] = (VALUE)&z;
args[1] = src;
- dst = rb_ensure(inflate_run, (VALUE)args, zstream_ensure_end, (VALUE)&z);
+ dst = rb_ensure(inflate_run, (VALUE)args, zstream_end, (VALUE)&z);
+ OBJ_INFECT(dst, src);
return dst;
}
@@ -1986,8 +1983,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);
@@ -2039,6 +2035,8 @@ rb_inflate_inflate(VALUE obj, VALUE src)
struct zstream *z = get_zstream(obj);
VALUE dst;
+ OBJ_INFECT(obj, src);
+
if (ZSTREAM_IS_FINISHED(z)) {
if (NIL_P(src)) {
dst = zstream_detach_buffer(z);
@@ -2047,6 +2045,7 @@ rb_inflate_inflate(VALUE obj, VALUE src)
StringValue(src);
zstream_append_buffer2(z, src);
dst = rb_str_new(0, 0);
+ OBJ_INFECT(dst, obj);
}
}
else {
@@ -2072,6 +2071,8 @@ rb_inflate_addstr(VALUE obj, VALUE src)
{
struct zstream *z = get_zstream(obj);
+ OBJ_INFECT(obj, src);
+
if (ZSTREAM_IS_FINISHED(z)) {
if (!NIL_P(src)) {
StringValue(src);
@@ -2101,6 +2102,7 @@ rb_inflate_sync(VALUE obj, VALUE src)
{
struct zstream *z = get_zstream(obj);
+ OBJ_INFECT(obj, src);
StringValue(src);
return zstream_sync(z, (Bytef*)RSTRING_PTR(src), RSTRING_LEN(src));
}
@@ -2142,6 +2144,7 @@ rb_inflate_set_dictionary(VALUE obj, VALUE dic)
VALUE src = dic;
int err;
+ OBJ_INFECT(obj, dic);
StringValue(src);
err = inflateSetDictionary(&z->stream,
(Bytef*)RSTRING_PTR(src), RSTRING_LENINT(src));
@@ -2222,6 +2225,7 @@ struct gzfile {
rb_encoding *enc2;
rb_econv_t *ec;
VALUE ecopts;
+ char *cbuf;
VALUE path;
};
#define GZFILE_CBUF_CAPA 10
@@ -2229,23 +2233,12 @@ struct gzfile {
#define GZFILE_FLAG_SYNC ZSTREAM_FLAG_UNUSED
#define GZFILE_FLAG_HEADER_FINISHED (ZSTREAM_FLAG_UNUSED << 1)
#define GZFILE_FLAG_FOOTER_FINISHED (ZSTREAM_FLAG_UNUSED << 2)
-#define GZFILE_FLAG_MTIME_IS_SET (ZSTREAM_FLAG_UNUSED << 3)
#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
-struct read_raw_arg {
- VALUE io;
- union {
- const VALUE argv[2]; /* for rb_funcallv */
- struct {
- VALUE len;
- VALUE buf;
- } in;
- } as;
-};
static void
gzfile_mark(void *p)
@@ -2272,13 +2265,22 @@ gzfile_free(void *p)
}
zstream_finalize(z);
}
+ if (gz->cbuf) {
+ xfree(gz->cbuf);
+ }
xfree(gz);
}
static size_t
gzfile_memsize(const void *p)
{
- return sizeof(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 = {
@@ -2287,9 +2289,16 @@ static const rb_data_type_t gzfile_data_type = {
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
-static void
-gzfile_init(struct gzfile *gz, const struct zstream_funcs *funcs, void (*endfunc)(struct gzfile *))
+static VALUE
+gzfile_new(klass, funcs, endfunc)
+ 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);
zstream_init(&gz->z, funcs);
gz->z.flags |= ZSTREAM_FLAG_GZFILE;
gz->io = Qnil;
@@ -2307,17 +2316,9 @@ gzfile_init(struct gzfile *gz, const struct zstream_funcs *funcs, void (*endfunc
gz->ec = NULL;
gz->ecflags = 0;
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;
}
@@ -2358,8 +2359,9 @@ 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);
if ((gz->z.flags & GZFILE_FLAG_SYNC)
&& rb_respond_to(gz->io, id_flush))
@@ -2370,23 +2372,21 @@ gzfile_write_raw(struct gzfile *gz)
static VALUE
gzfile_read_raw_partial(VALUE arg)
{
- struct read_raw_arg *ra = (struct read_raw_arg *)arg;
+ struct gzfile *gz = (struct gzfile*)arg;
VALUE str;
- int argc = NIL_P(ra->as.argv[1]) ? 1 : 2;
- str = rb_funcallv(ra->io, id_readpartial, argc, ra->as.argv);
+ str = rb_funcall(gz->io, id_readpartial, 1, INT2FIX(GZFILE_READ_SIZE));
Check_Type(str, T_STRING);
return str;
}
static VALUE
-gzfile_read_raw_rescue(VALUE arg, VALUE _)
+gzfile_read_raw_rescue(VALUE arg)
{
- struct read_raw_arg *ra = (struct read_raw_arg *)arg;
+ struct gzfile *gz = (struct gzfile*)arg;
VALUE str = Qnil;
if (rb_obj_is_kind_of(rb_errinfo(), rb_eNoMethodError)) {
- int argc = NIL_P(ra->as.argv[1]) ? 1 : 2;
- str = rb_funcallv(ra->io, id_read, argc, ra->as.argv);
+ str = rb_funcall(gz->io, id_read, 1, INT2FIX(GZFILE_READ_SIZE));
if (!NIL_P(str)) {
Check_Type(str, T_STRING);
}
@@ -2395,30 +2395,20 @@ gzfile_read_raw_rescue(VALUE arg, VALUE _)
}
static VALUE
-gzfile_read_raw(struct gzfile *gz, VALUE outbuf)
+gzfile_read_raw(struct gzfile *gz)
{
- struct read_raw_arg ra;
-
- ra.io = gz->io;
- ra.as.in.len = INT2FIX(GZFILE_READ_SIZE);
- ra.as.in.buf = outbuf;
-
- return rb_rescue2(gzfile_read_raw_partial, (VALUE)&ra,
- gzfile_read_raw_rescue, (VALUE)&ra,
+ return rb_rescue2(gzfile_read_raw_partial, (VALUE)gz,
+ gzfile_read_raw_rescue, (VALUE)gz,
rb_eEOFError, rb_eNoMethodError, (VALUE)0);
}
static int
-gzfile_read_raw_ensure(struct gzfile *gz, long size, VALUE outbuf)
+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, outbuf);
+ str = gzfile_read_raw(gz);
if (NIL_P(str)) return 0;
zstream_append_input2(&gz->z, str);
}
@@ -2435,7 +2425,7 @@ gzfile_read_raw_until_zero(struct gzfile *gz, long offset)
p = memchr(RSTRING_PTR(gz->z.input) + offset, '\0',
RSTRING_LEN(gz->z.input) - offset);
if (p) break;
- str = gzfile_read_raw(gz, Qnil);
+ str = gzfile_read_raw(gz);
if (NIL_P(str)) {
rb_raise(cGzError, "unexpected end of file");
}
@@ -2516,7 +2506,7 @@ gzfile_make_header(struct gzfile *gz)
if (!NIL_P(gz->comment)) {
flags |= GZ_FLAG_COMMENT;
}
- if (!(gz->z.flags & GZFILE_FLAG_MTIME_IS_SET)) {
+ if (gz->mtime == 0) {
gz->mtime = time(0);
}
@@ -2534,7 +2524,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);
@@ -2555,19 +2545,18 @@ 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;
}
static void
-gzfile_read_header(struct gzfile *gz, VALUE outbuf)
+gzfile_read_header(struct gzfile *gz)
{
const unsigned char *head;
long len;
char flags, *p;
- /* 10 is the size of gzip header */
- if (!gzfile_read_raw_ensure(gz, 10, outbuf)) {
+ if (!gzfile_read_raw_ensure(gz, 10)) { /* 10 is the size of gzip header */
gzfile_raise(gz, cGzError, "not in gzip format");
}
@@ -2606,31 +2595,33 @@ gzfile_read_header(struct gzfile *gz, VALUE outbuf)
zstream_discard_input(&gz->z, 10);
if (flags & GZ_FLAG_EXTRA) {
- if (!gzfile_read_raw_ensure(gz, 2, outbuf)) {
+ if (!gzfile_read_raw_ensure(gz, 2)) {
rb_raise(cGzError, "unexpected end of file");
}
len = gzfile_get16((Bytef*)RSTRING_PTR(gz->z.input));
- if (!gzfile_read_raw_ensure(gz, 2 + len, outbuf)) {
+ if (!gzfile_read_raw_ensure(gz, 2 + len)) {
rb_raise(cGzError, "unexpected end of file");
}
zstream_discard_input(&gz->z, 2 + len);
}
if (flags & GZ_FLAG_ORIG_NAME) {
- if (!gzfile_read_raw_ensure(gz, 1, outbuf)) {
+ if (!gzfile_read_raw_ensure(gz, 1)) {
rb_raise(cGzError, "unexpected end of file");
}
p = gzfile_read_raw_until_zero(gz, 0);
len = p - RSTRING_PTR(gz->z.input);
gz->orig_name = rb_str_new(RSTRING_PTR(gz->z.input), len);
+ OBJ_TAINT(gz->orig_name); /* for safe */
zstream_discard_input(&gz->z, len + 1);
}
if (flags & GZ_FLAG_COMMENT) {
- if (!gzfile_read_raw_ensure(gz, 1, outbuf)) {
+ if (!gzfile_read_raw_ensure(gz, 1)) {
rb_raise(cGzError, "unexpected end of file");
}
p = gzfile_read_raw_until_zero(gz, 0);
len = p - RSTRING_PTR(gz->z.input);
gz->comment = rb_str_new(RSTRING_PTR(gz->z.input), len);
+ OBJ_TAINT(gz->comment); /* for safe */
zstream_discard_input(&gz->z, len + 1);
}
@@ -2640,14 +2631,13 @@ gzfile_read_header(struct gzfile *gz, VALUE outbuf)
}
static void
-gzfile_check_footer(struct gzfile *gz, VALUE outbuf)
+gzfile_check_footer(struct gzfile *gz)
{
unsigned long crc, length;
gz->z.flags |= GZFILE_FLAG_FOOTER_FINISHED;
- /* 8 is the size of gzip footer */
- if (!gzfile_read_raw_ensure(gz, 8, outbuf)) {
+ if (!gzfile_read_raw_ensure(gz, 8)) { /* 8 is the size of gzip footer */
gzfile_raise(gz, cNoFooter, "footer is not found");
}
@@ -2681,12 +2671,12 @@ gzfile_write(struct gzfile *gz, Bytef *str, long len)
}
static long
-gzfile_read_more(struct gzfile *gz, VALUE outbuf)
+gzfile_read_more(struct gzfile *gz)
{
- VALUE str;
+ volatile VALUE str;
while (!ZSTREAM_IS_FINISHED(&gz->z)) {
- str = gzfile_read_raw(gz, outbuf);
+ str = gzfile_read_raw(gz);
if (NIL_P(str)) {
if (!ZSTREAM_IS_FINISHED(&gz->z)) {
rb_raise(cGzError, "unexpected end of file");
@@ -2696,11 +2686,10 @@ gzfile_read_more(struct gzfile *gz, VALUE outbuf)
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
@@ -2711,7 +2700,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;
}
}
@@ -2721,11 +2710,13 @@ gzfile_newstr(struct gzfile *gz, VALUE str)
{
if (!gz->enc2) {
rb_enc_associate(str, gz->enc);
+ OBJ_TAINT(str); /* for safe */
return str;
}
if (gz->ec && rb_enc_dummy_p(gz->enc2)) {
str = rb_econv_str_convert(gz->ec, str, ECONV_PARTIAL_INPUT);
rb_enc_associate(str, gz->enc);
+ OBJ_TAINT(str);
return str;
}
return rb_str_conv_enc_opts(str, gz->enc2, gz->enc,
@@ -2739,16 +2730,16 @@ 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) {
- gzfile_read_more(gz, Qnil);
+ while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled < len) {
+ gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
if (!(gz->z.flags & GZFILE_FLAG_FOOTER_FINISHED)) {
- gzfile_check_footer(gz, Qnil);
+ gzfile_check_footer(gz);
}
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
@@ -2772,6 +2763,9 @@ gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
if (len < 0)
rb_raise(rb_eArgError, "negative length %ld given", len);
+ if (!NIL_P(outbuf))
+ OBJ_TAINT(outbuf);
+
if (len == 0) {
if (NIL_P(outbuf))
return rb_str_new(0, 0);
@@ -2780,12 +2774,12 @@ gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
return outbuf;
}
}
- while (!ZSTREAM_IS_FINISHED(&gz->z) && ZSTREAM_BUF_FILLED(&gz->z) == 0) {
- gzfile_read_more(gz, outbuf);
+ while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled == 0) {
+ gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
if (!(gz->z.flags & GZFILE_FLAG_FOOTER_FINISHED)) {
- gzfile_check_footer(gz, outbuf);
+ gzfile_check_footer(gz);
}
if (!NIL_P(outbuf))
rb_str_resize(outbuf, 0);
@@ -2798,10 +2792,9 @@ 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_str_resize(dst, 0);
- rb_gc_force_recycle(dst);
dst = outbuf;
}
+ OBJ_TAINT(dst); /* for safe */
return dst;
}
@@ -2811,11 +2804,11 @@ gzfile_read_all(struct gzfile *gz)
VALUE dst;
while (!ZSTREAM_IS_FINISHED(&gz->z)) {
- gzfile_read_more(gz, Qnil);
+ gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
if (!(gz->z.flags & GZFILE_FLAG_FOOTER_FINISHED)) {
- gzfile_check_footer(gz, Qnil);
+ gzfile_check_footer(gz);
}
return rb_str_new(0, 0);
}
@@ -2823,6 +2816,7 @@ gzfile_read_all(struct gzfile *gz)
dst = zstream_detach_buffer(&gz->z);
if (NIL_P(dst)) return dst;
gzfile_calc_crc(gz, dst);
+ OBJ_TAINT(dst);
return gzfile_newstr(gz, dst);
}
@@ -2833,12 +2827,12 @@ 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) {
- gzfile_read_more(gz, Qnil);
+ while (!ZSTREAM_IS_FINISHED(&gz->z) && gz->z.buf_filled < len) {
+ gzfile_read_more(gz);
}
if (GZFILE_IS_FINISHED(gz)) {
if (!(gz->z.flags & GZFILE_FLAG_FOOTER_FINISHED)) {
- gzfile_check_footer(gz, Qnil);
+ gzfile_check_footer(gz);
}
return Qnil;
}
@@ -2846,18 +2840,22 @@ gzfile_getc(struct gzfile *gz)
if (gz->ec && rb_enc_dummy_p(gz->enc2)) {
const unsigned char *ss, *sp, *se;
unsigned char *ds, *dp, *de;
- VALUE cbuf = rb_enc_str_new(0, GZFILE_CBUF_CAPA, gz->enc);
+ if (!gz->cbuf) {
+ 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);
- ds = dp = (unsigned char *)RSTRING_PTR(cbuf);
+ 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);
rb_econv_check_error(gz->ec);
dst = zstream_shift_buffer(&gz->z, sp - ss);
gzfile_calc_crc(gz, dst);
- rb_str_resize(cbuf, dp - ds);
- return cbuf;
+ dst = rb_str_new(gz->cbuf, dp - ds);
+ rb_enc_associate(dst, gz->enc);
+ OBJ_TAINT(dst);
+ return dst;
}
else {
buf = gz->z.buf;
@@ -2904,7 +2902,7 @@ gzfile_writer_end(struct gzfile *gz)
if (ZSTREAM_IS_CLOSING(&gz->z)) return;
gz->z.flags |= ZSTREAM_FLAG_CLOSING;
- rb_ensure(gzfile_writer_end_run, (VALUE)gz, zstream_ensure_end, (VALUE)&gz->z);
+ rb_ensure(gzfile_writer_end_run, (VALUE)gz, zstream_end, (VALUE)&gz->z);
}
static VALUE
@@ -2914,7 +2912,7 @@ gzfile_reader_end_run(VALUE arg)
if (GZFILE_IS_FINISHED(gz)
&& !(gz->z.flags & GZFILE_FLAG_FOOTER_FINISHED)) {
- gzfile_check_footer(gz, Qnil);
+ gzfile_check_footer(gz);
}
return Qnil;
@@ -2926,7 +2924,7 @@ gzfile_reader_end(struct gzfile *gz)
if (ZSTREAM_IS_CLOSING(&gz->z)) return;
gz->z.flags |= ZSTREAM_FLAG_CLOSING;
- rb_ensure(gzfile_reader_end_run, (VALUE)gz, zstream_ensure_end, (VALUE)&gz->z);
+ rb_ensure(gzfile_reader_end_run, (VALUE)gz, zstream_end, (VALUE)&gz->z);
}
static void
@@ -2951,11 +2949,12 @@ gzfile_reader_get_unused(struct gzfile *gz)
if (!ZSTREAM_IS_READY(&gz->z)) return Qnil;
if (!GZFILE_IS_FINISHED(gz)) return Qnil;
if (!(gz->z.flags & GZFILE_FLAG_FOOTER_FINISHED)) {
- gzfile_check_footer(gz, Qnil);
+ gzfile_check_footer(gz);
}
if (NIL_P(gz->z.input)) return Qnil;
str = rb_str_resurrect(gz->z.input);
+ OBJ_TAINT(str); /* for safe */
return str;
}
@@ -3022,7 +3021,7 @@ static VALUE
new_wrap(VALUE tmp)
{
new_wrap_arg_t *arg = (new_wrap_arg_t *)tmp;
- return rb_class_new_instance_kw(arg->argc, arg->argv, arg->klass, RB_PASS_CALLED_KEYWORDS);
+ return rb_class_new_instance(arg->argc, arg->argv, arg->klass);
}
static VALUE
@@ -3055,7 +3054,7 @@ gzfile_wrap(int argc, VALUE *argv, VALUE klass, int close_io_on_error)
}
}
else {
- obj = rb_class_new_instance_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
+ obj = rb_class_new_instance(argc, argv, klass);
}
if (rb_block_given_p()) {
@@ -3097,7 +3096,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;
@@ -3172,6 +3173,7 @@ rb_gzfile_orig_name(VALUE obj)
if (!NIL_P(str)) {
str = rb_str_dup(str);
}
+ OBJ_TAINT(str); /* for safe */
return str;
}
@@ -3188,6 +3190,7 @@ rb_gzfile_comment(VALUE obj)
if (!NIL_P(str)) {
str = rb_str_dup(str);
}
+ OBJ_TAINT(str); /* for safe */
return str;
}
@@ -3219,20 +3222,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)
@@ -3246,7 +3236,6 @@ rb_gzfile_set_mtime(VALUE obj, VALUE mtime)
val = rb_Integer(mtime);
gz->mtime = NUM2UINT(val);
- gz->z.flags |= GZFILE_FLAG_MTIME_IS_SET;
return mtime;
}
@@ -3308,13 +3297,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;
@@ -3419,14 +3404,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);
}
/*
@@ -3592,23 +3570,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));
}
/*
@@ -3654,7 +3626,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
@@ -3757,7 +3729,7 @@ rb_gzreader_initialize(int argc, VALUE *argv, VALUE obj)
}
gz->io = io;
ZSTREAM_READY(&gz->z);
- gzfile_read_header(gz, Qnil);
+ gzfile_read_header(gz);
rb_gzfile_ecopts(gz, opt);
if (rb_respond_to(io, id_path)) {
@@ -3981,7 +3953,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;
}
@@ -4005,20 +3976,20 @@ 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, Qnil);
+ gzfile_read_more(gz);
}
n = 0;
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, Qnil);
+ gzfile_read_more(gz);
}
n = 0;
p = RSTRING_PTR(gz->z.buf);
@@ -4040,7 +4011,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) {
@@ -4061,7 +4032,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;
@@ -4124,8 +4095,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;
@@ -4135,25 +4105,25 @@ 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, Qnil);
+ gzfile_read_more(gz);
}
p = RSTRING_PTR(gz->z.buf);
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, Qnil);
+ 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;
}
@@ -4162,15 +4132,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);
}
@@ -4180,7 +4149,6 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
if (rspara) {
gzreader_skip_linebreaks(gz);
}
- RB_GC_GUARD(rs);
return gzfile_newstr(gz, dst);
}
@@ -4265,195 +4233,11 @@ 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_end_rescue(VALUE arg)
-{
- struct gzfile *gz = (struct gzfile *)arg;
- gz->end(gz);
- return Qnil;
-}
-
-static VALUE
-zlib_gzip_ensure(VALUE arg)
-{
- return rb_rescue(zlib_gzip_end_rescue, arg, NULL, 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, Qnil);
- 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, Qnil);
- return dst;
-}
-
#endif /* GZIP_SUPPORT */
void
Init_zlib(void)
{
-#undef rb_intern
VALUE mZlib, cZStream, cDeflate, cInflate;
#if GZIP_SUPPORT
VALUE cGzipFile, cGzipWriter, cGzipReader;
@@ -4557,7 +4341,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));
@@ -4688,7 +4472,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);
@@ -4717,10 +4501,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));
@@ -4755,8 +4535,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 */
}
@@ -4877,3 +4655,5 @@ Init_zlib(void)
* Raised when the data length recorded in the gzip file footer is not equivalent
* to the length of the actual uncompressed data.
*/
+
+
diff --git a/ext/zlib/zlib.gemspec b/ext/zlib/zlib.gemspec
deleted file mode 100644
index 4a77ae325e..0000000000
--- a/ext/zlib/zlib.gemspec
+++ /dev/null
@@ -1,35 +0,0 @@
-# coding: utf-8
-# frozen_string_literal: true
-
-source_version = ["", "ext/zlib/"].find do |dir|
- begin
- break File.open(File.join(__dir__, "#{dir}zlib.c")) {|f|
- f.gets("\n#define RUBY_ZLIB_VERSION ")
- f.gets[/\s*"(.+)"/, 1]
- }
- rescue Errno::ENOENT
- end
-end
-
-Gem::Specification.new do |spec|
- spec.name = "zlib"
- spec.version = source_version
- 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 c46377b933..e91180ba13 100644
--- a/file.c
+++ b/file.c
@@ -20,25 +20,14 @@
#include <wchar.h>
#endif
#ifdef __APPLE__
-# if !(defined(__has_feature) && defined(__has_attribute))
-/* Maybe a bug in SDK of Xcode 10.2.1 */
-/* In this condition, <os/availability.h> does not define
- * API_AVAILABLE and similar, but __API_AVAILABLE and similar which
- * are defined in <Availability.h> */
-# define API_AVAILABLE(...)
-# define API_DEPRECATED(...)
-# endif
#include <CoreFoundation/CFString.h>
#endif
-#include "id.h"
-#include "ruby/encoding.h"
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/util.h"
#include "ruby/thread.h"
-#include "internal.h"
#include "dln.h"
-#include "encindex.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -74,13 +63,19 @@ 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__)
+# if defined(NACL_NEWLIB)
+# include "nacl/utime.h"
+# include "nacl/stat.h"
+# include "nacl/unistd.h"
+# else
+# undef HAVE_UTIMENSAT
+# endif
+#endif
+
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
@@ -99,10 +94,9 @@ 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
@@ -111,70 +105,64 @@ int flock(int, int);
#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))
-
-#ifdef HAVE_REALPATH
-/* Don't use native realpath(3) on Windows, as the check for
- absolute paths does not work for drive letters. */
-#undef HAVE_REALPATH
-#endif
#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
-
-/* Solaris 10 realpath(3) doesn't support File.realpath */
-#if defined HAVE_REALPATH && defined __sun && defined __SVR4
-#undef HAVE_REALPATH
-#endif
-
-#ifdef HAVE_REALPATH
-#include <limits.h>
-#include <stdlib.h>
-#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) >= 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
@@ -193,69 +181,83 @@ check_path_encoding(VALUE str)
}
VALUE
-rb_get_path_check_to_string(VALUE obj)
+rb_get_path_check_to_string(VALUE obj, int level)
{
VALUE tmp;
ID to_path;
+ if (insecure_obj_p(obj, level)) {
+ rb_insecure_operation();
+ }
+
if (RB_TYPE_P(obj, T_STRING)) {
return obj;
}
CONST_ID(to_path, "to_path");
- tmp = rb_check_funcall_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;
}
VALUE
-rb_get_path_check_convert(VALUE obj)
+rb_get_path_check_convert(VALUE obj, VALUE tmp, int level)
{
- obj = file_path_convert(obj);
-
- check_path_encoding(obj);
- if (!rb_str_to_cstr(obj)) {
- rb_raise(rb_eArgError, "path name contains null byte");
+ tmp = file_path_convert(tmp);
+ if (obj != tmp && insecure_obj_p(tmp, level)) {
+ rb_insecure_operation();
}
- return rb_str_new4(obj);
+ check_path_encoding(tmp);
+ StringValueCStr(tmp);
+
+ return rb_str_new4(tmp);
+}
+
+static VALUE
+rb_get_path_check(VALUE obj, int level)
+{
+ VALUE tmp = rb_get_path_check_to_string(obj, level);
+ return rb_get_path_check_convert(obj, tmp, level);
}
VALUE
rb_get_path_no_checksafe(VALUE obj)
{
- return rb_get_path(obj);
+ return rb_get_path_check(obj, 0);
}
VALUE
rb_get_path(VALUE obj)
{
- return rb_get_path_check_convert(rb_get_path_check_to_string(obj));
+ return rb_get_path_check(obj, rb_safe_level());
}
VALUE
rb_str_encode_ospath(VALUE path)
{
-#if USE_OSPATH
- int encidx = ENCODING_GET(path);
-#if 0 && defined _WIN32
- if (encidx == ENCINDEX_ASCII) {
- encidx = rb_filesystem_encindex();
+#ifdef _WIN32
+ 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_ASCII && 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,
@@ -263,15 +265,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;
@@ -292,19 +293,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;
@@ -315,7 +313,7 @@ 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;
@@ -352,79 +350,23 @@ ignored_char_p(const char *p, const char *e, rb_encoding *enc)
}
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[FLEX_ARY_LEN];
-};
-
-static void *
-no_gvl_apply2files(void *ptr)
-{
- 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)
+static long
+apply2files(void (*func)(const char *, VALUE, void *), VALUE vargs, 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);
}
/*
@@ -435,13 +377,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 IOError for a <i>file</i> created using
- * File::Constants::TMPFILE because they don't have a pathname.
- *
* File.new("testfile").path #=> "testfile"
* File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx"
*
@@ -454,18 +389,14 @@ 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?)");
- }
-
- return rb_str_dup(fptr->pathv);
+ 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 = {
@@ -478,14 +409,12 @@ 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
@@ -503,7 +432,7 @@ get_stat(VALUE self)
return st;
}
-static struct timespec stat_mtimespec(const struct stat *st);
+static struct timespec stat_mtimespec(struct stat *st);
/*
* call-seq:
@@ -551,7 +480,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.
@@ -567,7 +496,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>.
@@ -580,7 +509,7 @@ static VALUE
rb_stat_dev_major(VALUE self)
{
#if defined(major)
- return UINT2NUM(major(get_stat(self)->st_dev));
+ return INT2NUM(major(get_stat(self)->st_dev));
#else
return Qnil;
#endif
@@ -588,7 +517,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>.
@@ -601,7 +530,7 @@ static VALUE
rb_stat_dev_minor(VALUE self)
{
#if defined(minor)
- return UINT2NUM(minor(get_stat(self)->st_dev));
+ return INT2NUM(minor(get_stat(self)->st_dev));
#else
return Qnil;
#endif
@@ -609,7 +538,7 @@ rb_stat_dev_minor(VALUE self)
/*
* call-seq:
- * stat.ino -> integer
+ * stat.ino -> fixnum
*
* Returns the inode number for <i>stat</i>.
*
@@ -620,13 +549,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);
@@ -635,7 +558,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
@@ -654,7 +577,7 @@ rb_stat_mode(VALUE self)
/*
* call-seq:
- * stat.nlink -> integer
+ * stat.nlink -> fixnum
*
* Returns the number of hard links to <i>stat</i>.
*
@@ -672,7 +595,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>.
*
@@ -688,7 +611,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>.
*
@@ -704,7 +627,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
@@ -726,7 +649,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>.
@@ -739,7 +662,7 @@ static VALUE
rb_stat_rdev_major(VALUE self)
{
#if defined(HAVE_STRUCT_STAT_ST_RDEV) && defined(major)
- return UINT2NUM(major(get_stat(self)->st_rdev));
+ return DEVT2NUM(major(get_stat(self)->st_rdev));
#else
return Qnil;
#endif
@@ -747,7 +670,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>.
@@ -760,7 +683,7 @@ static VALUE
rb_stat_rdev_minor(VALUE self)
{
#if defined(HAVE_STRUCT_STAT_ST_RDEV) && defined(minor)
- return UINT2NUM(minor(get_stat(self)->st_rdev));
+ return DEVT2NUM(minor(get_stat(self)->st_rdev));
#else
return Qnil;
#endif
@@ -768,7 +691,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 +751,7 @@ rb_stat_blocks(VALUE self)
}
static struct timespec
-stat_atimespec(const struct stat *st)
+stat_atimespec(struct stat *st)
{
struct timespec ts;
ts.tv_sec = st->st_atime;
@@ -845,14 +768,14 @@ stat_atimespec(const struct stat *st)
}
static VALUE
-stat_atime(const struct stat *st)
+stat_atime(struct stat *st)
{
struct timespec ts = stat_atimespec(st);
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
}
static struct timespec
-stat_mtimespec(const struct stat *st)
+stat_mtimespec(struct stat *st)
{
struct timespec ts;
ts.tv_sec = st->st_mtime;
@@ -869,14 +792,14 @@ stat_mtimespec(const struct stat *st)
}
static VALUE
-stat_mtime(const struct stat *st)
+stat_mtime(struct stat *st)
{
struct timespec ts = stat_mtimespec(st);
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
}
static struct timespec
-stat_ctimespec(const struct stat *st)
+stat_ctimespec(struct stat *st)
{
struct timespec ts;
ts.tv_sec = st->st_ctime;
@@ -893,7 +816,7 @@ stat_ctimespec(const struct stat *st)
}
static VALUE
-stat_ctime(const struct stat *st)
+stat_ctime(struct stat *st)
{
struct timespec ts = stat_ctimespec(st);
return rb_time_nano_new(ts.tv_sec, ts.tv_nsec);
@@ -901,15 +824,13 @@ stat_ctime(const struct stat *st)
#define HAVE_STAT_BIRTHTIME
#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC)
-typedef struct stat statx_data;
static VALUE
-stat_birthtime(const struct stat *st)
+stat_birthtime(struct stat *st)
{
- const struct timespec *ts = &st->st_birthtimespec;
+ struct timespec *ts = &st->st_birthtimespec;
return rb_time_nano_new(ts->tv_sec, ts->tv_nsec);
}
#elif defined(_WIN32)
-typedef struct stat statx_data;
# define stat_birthtime stat_ctime
#else
# undef HAVE_STAT_BIRTHTIME
@@ -920,7 +841,7 @@ typedef struct stat statx_data;
* stat.atime -> time
*
* Returns the last access time for this file as an object of class
- * Time.
+ * <code>Time</code>.
*
* File.stat("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
*
@@ -974,8 +895,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
@@ -1072,202 +992,96 @@ rb_stat_inspect(VALUE self)
}
}
rb_str_buf_cat2(str, ">");
+ OBJ_INFECT(str, 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)
-{
- no_gvl_stat_data data;
-
- data.file.path = path;
- data.st = st;
-
- return (int)(VALUE)rb_thread_call_without_gvl(no_gvl_stat, &data,
- RUBY_UBF_IO, NULL);
-}
-
-#if !defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) && \
- defined(HAVE_STRUCT_STATX_STX_BTIME)
-
-# ifndef HAVE_STATX
-# ifdef HAVE_SYSCALL_H
-# include <syscall.h>
-# elif defined HAVE_SYS_SYSCALL_H
-# include <sys/syscall.h>
-# endif
-# if defined __linux__
-# include <linux/stat.h>
-static inline int
-statx(int dirfd, const char *pathname, int flags,
- unsigned int mask, struct statx *statxbuf)
-{
- return (int)syscall(__NR_statx, dirfd, pathname, flags, mask, statxbuf);
-}
-# endif
-# endif
-
-typedef struct no_gvl_statx_data {
- struct statx *stx;
- int fd;
- const char *path;
- int flags;
- unsigned int mask;
-} no_gvl_statx_data;
-
-static VALUE
-io_blocking_statx(void *data)
-{
- no_gvl_statx_data *arg = data;
- return (VALUE)statx(arg->fd, arg->path, arg->flags, arg->mask, arg->stx);
-}
-
-static void *
-no_gvl_statx(void *data)
-{
- return (void *)io_blocking_statx(data);
-}
-
static int
-statx_without_gvl(const char *path, struct statx *stx, unsigned int mask)
+rb_stat(VALUE file, struct stat *st)
{
- no_gvl_statx_data data = {stx, AT_FDCWD, path, 0, mask};
-
- /* call statx(2) with pathname */
- return (int)(VALUE)rb_thread_call_without_gvl(no_gvl_statx, &data,
- RUBY_UBF_IO, NULL);
-}
+ VALUE tmp;
-static int
-fstatx_without_gvl(int fd, struct statx *stx, unsigned int mask)
-{
- no_gvl_statx_data data = {stx, fd, "", AT_EMPTY_PATH, mask};
+ rb_secure(2);
+ tmp = rb_check_convert_type(file, T_FILE, "IO", "to_io");
+ if (!NIL_P(tmp)) {
+ rb_io_t *fptr;
- /* call statx(2) with fd */
- return (int)rb_thread_io_blocking_region(io_blocking_statx, &data, fd);
+ GetOpenFile(tmp, fptr);
+ return fstat(fptr->fd, st);
+ }
+ FilePathValue(file);
+ file = rb_str_encode_ospath(file);
+ return STAT(StringValueCStr(file), st);
}
-static int
-rb_statx(VALUE file, struct statx *stx, unsigned int mask)
+#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 = fstatx_without_gvl(fptr->fd, stx, mask);
- file = tmp;
+ rb_io_t *fptr;
+
+ GetOpenFile(tmp, fptr);
+ 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 = statx_without_gvl(RSTRING_PTR(file), stx, mask);
- }
- RB_GC_GUARD(file);
- return result;
-}
-
-# define statx_has_birthtime(st) ((st)->stx_mask & STATX_BTIME)
-
-NORETURN(static void statx_notimplement(const char *field_name));
+ VALUE tmp;
+ WCHAR *ptr;
+ int len;
+ VALUE v;
-/* rb_notimplement() shows "function is unimplemented on this machine".
- It is not applicable to statx which behavior depends on the filesystem. */
-static void
-statx_notimplement(const char *field_name)
-{
- rb_raise(rb_eNotImpError,
- "%s is unimplemented on this filesystem",
- field_name);
+ 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;
+ }
+ if (GetFileType(f) == FILE_TYPE_DISK) {
+ ZeroMemory(st, sizeof(*st));
+ if (GetFileInformationByHandle(f, st)) return ret;
+ }
+ if (ret) CloseHandle(ret);
+ return INVALID_HANDLE_VALUE;
}
static VALUE
-statx_birthtime(const struct statx *stx, VALUE fname)
+close_handle(VALUE h)
{
- if (!statx_has_birthtime(stx)) {
- /* birthtime is not supported on the filesystem */
- statx_notimplement("birthtime");
- }
- return rb_time_nano_new(stx->stx_btime.tv_sec, stx->stx_btime.tv_nsec);
+ CloseHandle((HANDLE)h);
+ return Qfalse;
}
-typedef struct statx statx_data;
-# define HAVE_STAT_BIRTHTIME
-
-#elif defined(HAVE_STAT_BIRTHTIME)
-# define statx_without_gvl(path, st, mask) stat_without_gvl(path, st)
-# define fstatx_without_gvl(fd, st, mask) fstat_without_gvl(fd, st)
-# define statx_birthtime(st, fname) stat_birthtime(st)
-# define statx_has_birthtime(st) 1
-# define rb_statx(file, st, mask) rb_stat(file, st)
-#else
-# define statx_has_birthtime(st) 0
-#endif
+struct w32_io_info_args {
+ VALUE *fname;
+ BY_HANDLE_FILE_INFORMATION *st;
+};
-static int
-rb_stat(VALUE file, struct stat *st)
+static VALUE
+call_w32_io_info(VALUE arg)
{
- VALUE tmp;
- int result;
-
- tmp = rb_check_convert_type_with_id(file, T_FILE, "IO", idTo_io);
- if (!NIL_P(tmp)) {
- rb_io_t *fptr;
-
- GetOpenFile(tmp, fptr);
- result = fstat_without_gvl(fptr->fd, st);
- file = tmp;
- }
- else {
- FilePathValue(file);
- file = rb_str_encode_ospath(file);
- result = stat_without_gvl(RSTRING_PTR(file), st);
- }
- RB_GC_GUARD(file);
- return result;
+ struct w32_io_info_args *p = (void *)arg;
+ return (VALUE)w32_io_info(p->fname, p->st);
}
+#endif
/*
* call-seq:
* File.stat(file_name) -> stat
*
- * Returns a File::Stat object for the named file (see File::Stat).
+ * Returns a <code>File::Stat</code> object for the named file (see
+ * <code>File::Stat</code>).
*
* File.stat("testfile").mtime #=> Tue Apr 08 12:58:04 CDT 2003
*
@@ -1279,8 +1093,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);
@@ -1291,7 +1104,7 @@ rb_file_s_stat(VALUE klass, VALUE fname)
* ios.stat -> stat
*
* Returns status information for <em>ios</em> as an object of type
- * File::Stat.
+ * <code>File::Stat</code>.
*
* f = File.new("testfile")
* s = f.stat
@@ -1314,33 +1127,12 @@ 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
*
- * Same as File::stat, but does not follow the last symbolic link.
- * Instead, reports on the link itself.
+ * Same as <code>File::stat</code>, but does not follow the last symbolic
+ * link. Instead, reports on the link itself.
*
* File.symlink("testfile", "link2test") #=> 0
* File.stat("testfile").size #=> 66
@@ -1355,9 +1147,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);
@@ -1370,8 +1163,8 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
* call-seq:
* file.lstat -> stat
*
- * Same as IO#stat, but does not follow the last symbolic link.
- * Instead, reports on the link itself.
+ * Same as <code>IO#stat</code>, but does not follow the last symbolic
+ * link. Instead, reports on the link itself.
*
* File.symlink("testfile", "link2test") #=> 0
* File.stat("testfile").size #=> 66
@@ -1388,10 +1181,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);
@@ -1455,6 +1249,15 @@ rb_group_member(GETGROUPS_T gid)
#define USE_GETEUID 1
#endif
+#ifdef __native_client__
+// Although the NaCl toolchain contain eaccess() is it not yet
+// overridden by nacl_io.
+// TODO(sbc): Remove this once eaccess() is wired up correctly
+// in NaCl.
+# undef HAVE_EACCESS
+# undef USE_GETEUID
+#endif
+
#ifndef HAVE_EACCESS
int
eaccess(const char *path, int mode)
@@ -1499,62 +1302,14 @@ 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
*
- * FileTest implements file test operations similar to those used in
- * File::Stat. It exists as a standalone module, and its methods are
- * also insinuated into the File class. (Note that this is not done
- * by inclusion: the interpreter cheats).
+ * <code>FileTest</code> implements file test operations similar to
+ * those used in <code>File::Stat</code>. It exists as a standalone
+ * module, and its methods are also insinuated into the <code>File</code>
+ * class. (Note that this is not done by inclusion: the interpreter cheats).
*
*/
@@ -1640,9 +1395,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
@@ -1785,16 +1541,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).
- *
- * Note that some OS-level security features may cause this to return true
- * even though the file is not readable by the effective user/group.
+ * 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;
}
@@ -1803,16 +1559,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).
- *
- * Note that some OS-level security features may cause this to return true
- * even though the file is not readable by the real user/group.
+ * 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;
}
@@ -1826,7 +1582,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
@@ -1859,16 +1615,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).
- *
- * Note that some OS-level security features may cause this to return true
- * even though the file is not writable by the effective user/group.
+ * 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;
}
@@ -1877,22 +1633,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).
- *
- * Note that some OS-level security features may cause this to return true
- * even though the file is not writable by the real user/group.
+ * 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
@@ -1925,20 +1681,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).
- *
- * Windows does not support execute permissions separately from read
- * permissions. On Windows, a file is only considered executable if it ends in
- * .bat, .cmd, .com, or .exe.
- *
- * Note that some OS-level security features may cause this to return true
- * even though the file is not executable by the effective user/group.
+ * 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;
}
@@ -1947,20 +1699,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).
- *
- * Windows does not support execute permissions separately from read
- * permissions. On Windows, a file is only considered executable if it ends in
- * .bat, .cmd, .com, or .exe.
- *
- * Note that some OS-level security features may cause this to return true
- * even though the file is not executable by the real user/group.
+ * 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;
}
@@ -2090,7 +1838,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;
}
@@ -2101,8 +1852,6 @@ check3rdbyte(VALUE fname, int mode)
* File.setuid?(file_name) -> true or false
*
* Returns <code>true</code> if the named file has the setuid bit set.
- *
- * _file_name_ can be an IO object.
*/
static VALUE
@@ -2120,8 +1869,6 @@ rb_file_suid_p(VALUE obj, VALUE fname)
* File.setgid?(file_name) -> true or false
*
* Returns <code>true</code> if the named file has the setgid bit set.
- *
- * _file_name_ can be an IO object.
*/
static VALUE
@@ -2139,8 +1886,6 @@ rb_file_sgid_p(VALUE obj, VALUE fname)
* File.sticky?(file_name) -> true or false
*
* Returns <code>true</code> if the named file has the sticky bit set.
- *
- * _file_name_ can be an IO object.
*/
static VALUE
@@ -2175,18 +1920,56 @@ 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;
+ if (f1) {
+ struct w32_io_info_args arg;
+ arg.fname = &fname2;
+ arg.st = &st2;
+ f2 = (HANDLE)rb_ensure(call_w32_io_info, (VALUE)&arg, close_handle, (VALUE)f1);
+ }
+ else {
+ f2 = w32_io_info(&fname2, &st2);
+ }
+ if (f2 == INVALID_HANDLE_VALUE) return Qfalse;
+ if (f2) CloseHandle(f2);
+
+ 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;
}
/*
@@ -2204,9 +1987,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);
}
@@ -2272,9 +2054,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);
}
@@ -2285,7 +2068,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.
*
@@ -2299,9 +2082,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);
}
@@ -2310,8 +2092,8 @@ rb_file_s_atime(VALUE klass, VALUE fname)
* call-seq:
* file.atime -> time
*
- * Returns the last access time (a Time object) for <i>file</i>, or
- * epoch if <i>file</i> has not been accessed.
+ * Returns the last access time (a <code>Time</code> object)
+ * 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
*
@@ -2348,9 +2130,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);
}
@@ -2400,9 +2181,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);
}
@@ -2433,6 +2213,7 @@ rb_file_ctime(VALUE obj)
return stat_ctime(&st);
}
+#if defined(HAVE_STAT_BIRTHTIME)
/*
* call-seq:
* File.birthtime(file_name) -> time
@@ -2441,24 +2222,22 @@ 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
*
*/
-#if defined(HAVE_STAT_BIRTHTIME)
-RUBY_FUNC_EXPORTED VALUE
+static VALUE
rb_file_s_birthtime(VALUE klass, VALUE fname)
{
- statx_data st;
+ struct stat st;
- if (rb_statx(fname, &st, STATX_BTIME) < 0) {
- int e = errno;
+ if (rb_stat(fname, &st) < 0) {
FilePathValue(fname);
- rb_syserr_fail_path(e, fname);
+ rb_sys_fail_path(fname);
}
- return statx_birthtime(&st, fname);
+ return stat_birthtime(&st);
}
#else
# define rb_file_s_birthtime rb_f_notimplement
@@ -2471,9 +2250,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
*
*/
@@ -2481,13 +2260,13 @@ static VALUE
rb_file_birthtime(VALUE obj)
{
rb_io_t *fptr;
- statx_data st;
+ struct stat st;
GetOpenFile(obj, fptr);
- if (fstatx_without_gvl(fptr->fd, &st, STATX_BTIME) == -1) {
+ if (fstat(fptr->fd, &st) == -1) {
rb_sys_fail_path(fptr->pathv);
}
- return statx_birthtime(&st, fptr->pathv);
+ return stat_birthtime(&st);
}
#else
# define rb_file_birthtime rb_f_notimplement
@@ -2519,10 +2298,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);
}
/*
@@ -2539,14 +2319,19 @@ chmod_internal(const char *path, void *mode)
*/
static VALUE
-rb_file_s_chmod(int argc, VALUE *argv, 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);
}
/*
@@ -2556,7 +2341,7 @@ rb_file_s_chmod(int argc, VALUE *argv, VALUE _)
* Changes permission bits on <i>file</i> to the bit pattern
* represented by <i>mode_int</i>. Actual effects are platform
* dependent; on Unix systems, see <code>chmod(2)</code> for details.
- * Follows symbolic links. Also see File#lchmod.
+ * Follows symbolic links. Also see <code>File#lchmod</code>.
*
* f = File.new("out", "w");
* f.chmod(0644) #=> 0
@@ -2566,24 +2351,19 @@ static VALUE
rb_file_chmod(VALUE obj, VALUE vmode)
{
rb_io_t *fptr;
- mode_t mode;
-#if !defined HAVE_FCHMOD || !HAVE_FCHMOD
+ int mode;
+#ifndef HAVE_FCHMOD
VALUE path;
#endif
- mode = NUM2MODET(vmode);
+ 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)
@@ -2594,31 +2374,36 @@ 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);
}
/*
* call-seq:
* File.lchmod(mode_int, file_name, ...) -> integer
*
- * Equivalent to File::chmod, but does not follow symbolic links (so
- * it will change the permissions associated with the link, not the
- * file referenced by the link). Often not available.
+ * Equivalent to <code>File::chmod</code>, but does not follow symbolic
+ * links (so it will change the permissions associated with the link,
+ * not the file referenced by the link). Often not available.
*
*/
static VALUE
-rb_file_s_lchmod(int argc, VALUE *argv, 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
@@ -2647,16 +2432,17 @@ 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);
}
/*
* call-seq:
- * File.chown(owner_int, group_int, file_name, ...) -> integer
+ * File.chown(owner_int, group_int, file_name,... ) -> integer
*
* Changes the owner and group of the named file(s) to the given
* numeric owner and group id's. Only a process with superuser
@@ -2670,15 +2456,19 @@ chown_internal(const char *path, void *arg)
*/
static VALUE
-rb_file_s_chown(int argc, VALUE *argv, 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);
}
/*
@@ -2690,7 +2480,7 @@ rb_file_s_chown(int argc, VALUE *argv, VALUE _)
* change the owner of a file. The current owner of a file may change
* the file's group to any group to which the owner belongs. A
* <code>nil</code> or -1 owner or group id is ignored. Follows
- * symbolic links. See also File#lchown.
+ * symbolic links. See also <code>File#lchown</code>.
*
* File.new("testfile").chown(502, 1000)
*
@@ -2706,6 +2496,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);
@@ -2723,18 +2514,19 @@ 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);
}
/*
* call-seq:
* File.lchown(owner_int, group_int, file_name,..) -> integer
*
- * Equivalent to File::chown, but does not follow symbolic
+ * Equivalent to <code>File::chown</code>, but does not follow symbolic
* links (so it will change the owner associated with the link, not the
* file referenced by the link). Often not available. Returns number
* of files in the argument list.
@@ -2742,15 +2534,19 @@ lchown_internal(const char *path, void *arg)
*/
static VALUE
-rb_file_s_lchown(int argc, VALUE *argv, 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
@@ -2759,25 +2555,17 @@ rb_file_s_lchown(int argc, VALUE *argv, VALUE _)
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);
}
@@ -2799,15 +2587,18 @@ 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;
@@ -2815,32 +2606,16 @@ utime_internal(const char *path, void *arg)
#if defined(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
@@ -2852,10 +2627,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
@@ -2867,8 +2640,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;
@@ -2878,84 +2651,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
+/*
+ * call-seq:
+ * File.utime(atime, mtime, file_name,...) -> integer
+ *
+ * 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
-utime_internal_i(int argc, VALUE *argv, int follow)
+rb_file_s_utime(int argc, VALUE *argv)
{
+ VALUE rest;
struct utime_args args;
struct timespec tss[2], *tsp = NULL;
+ long n;
- apply2args(2);
- args.atime = *argv++;
- args.mtime = *argv++;
-
- args.follow = follow;
+ rb_secure(2);
+ rb_scan_args(argc, argv, "2*", &args.atime, &args.mtime, &rest);
if (!NIL_P(args.atime) || !NIL_P(args.mtime)) {
tsp = tss;
tsp[0] = rb_time_timespec(args.atime);
- if (args.atime == args.mtime)
- tsp[1] = tsp[0];
- else
- tsp[1] = rb_time_timespec(args.mtime);
+ tsp[1] = rb_time_timespec(args.mtime);
}
args.tsp = tsp;
- return apply2files(utime_internal, argc, argv, &args);
+ n = apply2files(utime_internal, rest, &args);
+ return LONG2FIX(n);
}
-/*
- * 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.
- */
-
-static VALUE
-rb_file_s_utime(int argc, VALUE *argv, VALUE _)
-{
- return utime_internal_i(argc, argv, FALSE);
-}
-
-#if defined(HAVE_UTIMES) && (defined(HAVE_LUTIMES) || (defined(HAVE_UTIMENSAT) && defined(AT_SYMLINK_NOFOLLOW)))
-
-/*
- * 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.
- */
-
-static VALUE
-rb_file_s_lutime(int argc, VALUE *argv, VALUE _)
-{
- return utime_internal_i(argc, argv, TRUE);
-}
-#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
@@ -2964,19 +2699,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
@@ -2986,7 +2717,7 @@ syserr_fail2_in(const char *func, int e, VALUE s1, VALUE s2)
*
* Creates a new name for an existing file using a hard link. Will not
* overwrite <i>new_name</i> if it already exists (raising a subclass
- * of SystemCallError). Not available on all platforms.
+ * of <code>SystemCallError</code>). Not available on all platforms.
*
* File.link("testfile", ".testfile") #=> 0
* IO.readlines(".testfile")[0] #=> "This is line one\n"
@@ -2995,6 +2726,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);
@@ -3015,7 +2747,7 @@ rb_file_s_link(VALUE klass, VALUE from, VALUE to)
* File.symlink(old_name, new_name) -> 0
*
* Creates a symbolic link called <i>new_name</i> for the existing file
- * <i>old_name</i>. Raises a NotImplemented exception on
+ * <i>old_name</i>. Raises a <code>NotImplemented</code> exception on
* platforms that do not support symbolic links.
*
* File.symlink("testfile", "link2test") #=> 0
@@ -3025,6 +2757,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);
@@ -3040,6 +2773,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
@@ -3054,48 +2789,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());
+ return rb_readlink(path);
}
-#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);
-}
-
-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
@@ -3105,23 +2813,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);
}
/*
@@ -3131,40 +2838,25 @@ 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. Errno::ENOENT.
- *
- * See also Dir::rmdir.
+ * 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);
}
/*
* call-seq:
* File.rename(old_name, new_name) -> 0
*
- * Renames the given file to the new name. Raises a SystemCallError
- * if the file cannot be renamed.
+ * Renames the given file to the new name. Raises a
+ * <code>SystemCallError</code> if the file cannot be renamed.
*
* File.rename("afile", "afile.bak") #=> 0
*/
@@ -3172,31 +2864,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);
@@ -3218,22 +2912,22 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
*/
static VALUE
-rb_file_s_umask(int argc, VALUE *argv, VALUE _)
+rb_file_s_umask(int argc, VALUE *argv)
{
- mode_t omask = 0;
+ int omask = 0;
- switch (argc) {
- case 0:
+ rb_secure(2);
+ if (argc == 0) {
omask = umask(0);
umask(omask);
- break;
- case 1:
- omask = umask(NUM2MODET(argv[0]));
- break;
- default:
- rb_error_arity(argc, 0, 1);
}
- return MODET2NUM(omask);
+ else if (argc == 1) {
+ omask = umask(NUM2INT(argv[0]));
+ }
+ else {
+ rb_check_arity(argc, 0, 1);
+ }
+ return INT2FIX(omask);
}
#ifdef __CYGWIN__
@@ -3246,38 +2940,24 @@ rb_file_s_umask(int argc, VALUE *argv, VALUE _)
#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)))
@@ -3315,9 +2995,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);
}
@@ -3448,17 +3128,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);
@@ -3511,18 +3191,16 @@ 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 = '/';
@@ -3536,84 +3214,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)
{
@@ -3621,15 +3245,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);
@@ -3648,15 +3269,18 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
const char *s, *b, *fend;
char *buf, *p, *pend, *root;
size_t buflen, bdiff;
+ int tainted;
rb_encoding *enc, *fsenc = rb_filesystem_encoding();
s = StringValuePtr(fname);
fend = s + RSTRING_LEN(fname);
enc = rb_enc_get(fname);
BUFINIT();
+ tainted = OBJ_TAINTED(fname);
if (s[0] == '~' && abs_mode == 0) { /* execute only if NOT absolute_path() */
long userlen = 0;
+ tainted = 1;
if (isdirsep(s[1]) || s[1] == '\0') {
buf = 0;
b = 0;
@@ -3714,6 +3338,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
}
if (!same) {
char *e = append_fspath(result, fname, getcwdofdrv(*s), &enc, fsenc);
+ tainted = 1;
BUFINIT();
p = e;
}
@@ -3734,7 +3359,8 @@ 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;
}
@@ -3817,7 +3443,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;
}
@@ -3856,23 +3482,19 @@ 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);
@@ -3884,7 +3506,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;
@@ -3901,7 +3523,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;
@@ -3937,15 +3559,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) {
@@ -3963,16 +3585,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;
@@ -3985,6 +3605,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
}
#endif
+ if (tainted) OBJ_TAINT(result);
rb_str_set_len(result, p - buf);
rb_enc_check(fname, result);
ENC_CODERANGE_CLEAR(result);
@@ -4027,13 +3648,6 @@ rb_file_expand_path_fast(VALUE fname, VALUE dname)
return expand_path(fname, dname, 0, 0, EXPAND_PATH_BUFFER());
}
-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);
-}
-
/*
* call-seq:
* File.expand_path(file_name [, dir_string] ) -> abs_file_name
@@ -4062,10 +3676,17 @@ rb_file_s_expand_path(int argc, const VALUE *argv)
* parent, the root of the project and appends +lib/mygem.rb+.
*/
-static VALUE
-s_expand_path(int c, const VALUE * v, VALUE _)
+VALUE
+rb_file_s_expand_path(int argc, const VALUE *argv)
{
- return rb_file_s_expand_path(c, v);
+ 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
@@ -4075,13 +3696,6 @@ rb_file_absolute_path(VALUE fname, VALUE dname)
return expand_path(fname, dname, 1, 1, EXPAND_PATH_BUFFER());
}
-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);
-}
-
/*
* call-seq:
* File.absolute_path(file_name [, dir_string] ) -> abs_file_name
@@ -4095,41 +3709,21 @@ rb_file_s_absolute_path(int argc, const VALUE *argv)
* File.absolute_path("~oracle/bin") #=> "<relative_path>/~oracle/bin"
*/
-static VALUE
-s_absolute_path(int c, const VALUE * v, VALUE _)
+VALUE
+rb_file_s_absolute_path(int argc, const VALUE *argv)
{
- return rb_file_s_absolute_path(c, v);
-}
-
-/*
- * call-seq:
- * File.absolute_path?(file_name) -> true or false
- *
- * Returns <code>true</code> if +file_name+ is an absolute path, and
- * <code>false</code> otherwise.
- *
- * File.absolute_path?("c:/foo") #=> false (on Linux), true (on Windows)
- */
+ VALUE fname, dname;
-static VALUE
-s_absolute_path_p(VALUE klass, VALUE fname)
-{
- VALUE path = rb_get_path(fname);
+ if (argc == 1) {
+ return rb_file_absolute_path(argv[0], Qnil);
+ }
+ rb_scan_args(argc, argv, "11", &fname, &dname);
- if (!rb_is_absolute_path(RSTRING_PTR(path))) return Qfalse;
- return Qtrue;
+ return rb_file_absolute_path(fname, dname);
}
-enum rb_realpath_mode {
- RB_REALPATH_CHECK,
- RB_REALPATH_DIR,
- RB_REALPATH_STRICT,
- RB_REALPATH_MODE_MAX
-};
-
-static int
-realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE fallback,
- VALUE loopcheck, enum rb_realpath_mode mode, int last)
+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);
@@ -4170,11 +3764,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);
@@ -4183,49 +3774,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));
}
@@ -4239,32 +3825,39 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, const char *unresolved, VALUE f
}
}
}
- return 0;
}
-static VALUE
-rb_check_realpath_emulate(VALUE basedir, VALUE path, rb_encoding *origenc, 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;
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);
- 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) {
@@ -4281,7 +3874,7 @@ rb_check_realpath_emulate(VALUE basedir, VALUE path, rb_encoding *origenc, enum
}
}
- 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);
@@ -4289,6 +3882,7 @@ rb_check_realpath_emulate(VALUE basedir, VALUE path, rb_encoding *origenc, enum
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;
@@ -4303,121 +3897,17 @@ rb_check_realpath_emulate(VALUE basedir, VALUE path, rb_encoding *origenc, enum
}
#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 (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);
- if (origenc && 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);
- }
- }
-
- RB_GC_GUARD(unresolved_path);
- RB_GC_GUARD(curdir);
+ OBJ_TAINT(resolved);
return resolved;
}
-
-static VALUE rb_file_join(VALUE ary);
-
-static VALUE
-rb_check_realpath_internal(VALUE basedir, VALUE path, rb_encoding *origenc, enum rb_realpath_mode mode)
-{
-#ifdef HAVE_REALPATH
- VALUE unresolved_path;
- char *resolved_ptr = NULL;
- VALUE resolved;
- struct stat st;
-
- if (mode == RB_REALPATH_DIR) {
- return rb_check_realpath_emulate(basedir, path, origenc, mode);
- }
-
- unresolved_path = rb_str_dup_frozen(path);
- if (*RSTRING_PTR(unresolved_path) != '/' && !NIL_P(basedir)) {
- unresolved_path = rb_file_join(rb_assoc_new(basedir, unresolved_path));
- }
- if (origenc) unresolved_path = TO_OSPATH(unresolved_path);
-
- if ((resolved_ptr = realpath(RSTRING_PTR(unresolved_path), NULL)) == NULL) {
- /* glibc realpath(3) does not allow /path/to/file.rb/../other_file.rb,
- returning ENOTDIR in that case.
- glibc realpath(3) can also return ENOENT for paths that exist,
- such as /dev/fd/5.
- Fallback to the emulated approach in either of those cases. */
- if (errno == ENOTDIR ||
- (errno == ENOENT && rb_file_exist_p(0, unresolved_path))) {
- return rb_check_realpath_emulate(basedir, path, origenc, mode);
-
- }
- if (mode == RB_REALPATH_CHECK) {
- return Qnil;
- }
- rb_sys_fail_path(unresolved_path);
- }
- resolved = ospath_new(resolved_ptr, strlen(resolved_ptr), rb_filesystem_encoding());
- free(resolved_ptr);
-
- /* As `resolved` is a String in the filesystem encoding, no
- * conversion is needed */
- if (stat_without_gvl(RSTRING_PTR(resolved), &st) < 0) {
- if (mode == RB_REALPATH_CHECK) {
- return Qnil;
- }
- rb_sys_fail_path(unresolved_path);
- }
-
- if (origenc && origenc != rb_enc_get(resolved)) {
- if (!rb_enc_str_asciionly_p(resolved)) {
- resolved = rb_str_conv_enc(resolved, NULL, origenc);
- }
- rb_enc_associate(resolved, origenc);
- }
-
- if (rb_enc_str_coderange(resolved) == ENC_CODERANGE_BROKEN) {
- rb_enc_associate(resolved, rb_filesystem_encoding());
- if (rb_enc_str_coderange(resolved) == ENC_CODERANGE_BROKEN) {
- rb_enc_associate(resolved, rb_ascii8bit_encoding());
- }
- }
-
- RB_GC_GUARD(unresolved_path);
- return resolved;
-#else
- return rb_check_realpath_emulate(basedir, path, origenc, mode);
-#endif /* HAVE_REALPATH */
-}
-
-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, rb_enc_get(path), mode);
-}
-
-VALUE
-rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *enc)
-{
- return rb_check_realpath_internal(basedir, path, enc, RB_REALPATH_CHECK);
-}
+#endif
/*
* call-seq:
@@ -4435,9 +3925,8 @@ rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *enc)
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);
}
@@ -4456,9 +3945,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);
}
@@ -4565,13 +4053,13 @@ 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),
- * which can be formed using both File::SEPARATOR and
- * File::ALT_SEPARATOR as the separator when File::ALT_SEPARATOR is
- * not <code>nil</code>. If <i>suffix</i> is given and present at the
- * end of <i>file_name</i>, it is removed. If <i>suffix</i> is ".*",
- * any extension will be removed.
+ * 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
+ * <i>suffix</i> is given and present at the end of <i>file_name</i>,
+ * it is removed. If <i>suffix</i> is ".*", any extension will be
+ * removed.
*
* File.basename("/home/gumby/work/ruby.rb") #=> "ruby.rb"
* File.basename("/home/gumby/work/ruby.rb", ".rb") #=> "ruby"
@@ -4579,20 +4067,17 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
*/
static VALUE
-rb_file_s_basename(int argc, VALUE *argv, VALUE _)
+rb_file_s_basename(int argc, VALUE *argv)
{
VALUE fname, fext, basename;
const char *name, *p;
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);
@@ -4619,6 +4104,7 @@ rb_file_s_basename(int argc, VALUE *argv, VALUE _)
basename = rb_str_new(p, f);
rb_enc_copy(basename, fname);
+ OBJ_INFECT(basename, fname);
return basename;
}
@@ -4627,10 +4113,9 @@ rb_file_s_basename(int argc, VALUE *argv, VALUE _)
* 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 File::SEPARATOR and
- * File::ALT_SEPARATOR as the separator when File::ALT_SEPARATOR 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"
*/
@@ -4680,6 +4165,7 @@ rb_file_dirname(VALUE fname)
rb_str_cat(dirname, ".", 1);
#endif
rb_enc_copy(dirname, fname);
+ OBJ_INFECT(dirname, fname);
return dirname;
}
@@ -4716,7 +4202,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;
}
@@ -4727,7 +4213,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
@@ -4761,13 +4247,9 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
* An empty string will also be returned when the period is the last character
* in +path+.
*
- * On Windows, trailing dots are truncated.
- *
* File.extname("test.rb") #=> ".rb"
* File.extname("a/b/d/test.rb") #=> ".rb"
- * File.extname(".a/b/d/test.rb") #=> ".rb"
- * File.extname("foo.") #=> "" on Windows
- * File.extname("foo.") #=> "." on non-Windows
+ * File.extname("foo.") #=> ""
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""
* File.extname(".profile.sh") #=> ".sh"
@@ -4785,9 +4267,10 @@ rb_file_s_extname(VALUE klass, VALUE fname)
name = StringValueCStr(fname);
len = RSTRING_LEN(fname);
e = ruby_enc_find_extname(name, &len, rb_enc_get(fname));
- if (len < 1)
+ if (len <= 1)
return rb_str_new(0, 0);
extname = rb_str_subseq(fname, e - name, len); /* keep the dot, too! */
+ OBJ_INFECT(extname, fname);
return extname;
}
@@ -4813,8 +4296,8 @@ rb_file_s_path(VALUE klass, VALUE fname)
* File.split(file_name) -> array
*
* Splits the given string into a directory and a file component and
- * returns them in a two-element array. See also File::dirname and
- * File::basename.
+ * returns them in a two-element array. See also
+ * <code>File::dirname</code> and <code>File::basename</code>.
*
* File.split("/home/gumby/.profile") #=> ["/home/gumby", ".profile"]
*/
@@ -4823,18 +4306,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,Qundef));
+ return rb_assoc_new(rb_file_s_dirname(Qnil, path), rb_file_s_basename(1,&path));
}
+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;
@@ -4855,12 +4343,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);
@@ -4870,7 +4362,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:
@@ -4881,13 +4377,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);
@@ -4904,7 +4402,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"
*
@@ -4913,46 +4411,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
@@ -4971,18 +4433,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
}
@@ -4991,29 +4471,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
@@ -5032,18 +4489,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
}
@@ -5091,9 +4558,9 @@ rb_thread_flock(void *data)
*
* Locks or unlocks a file according to <i>locking_constant</i> (a
* logical <em>or</em> of the values in the table below).
- * Returns <code>false</code> if File::LOCK_NB is specified and the
- * operation would otherwise have blocked. Not available on all
- * platforms.
+ * Returns <code>false</code> if <code>File::LOCK_NB</code> is
+ * specified and the operation would otherwise have blocked. Not
+ * available on all platforms.
*
* Locking constants (in class File):
*
@@ -5136,6 +4603,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;
@@ -5144,8 +4612,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
@@ -5166,7 +4633,7 @@ 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);
@@ -5177,6 +4644,7 @@ 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++) {
@@ -5247,7 +4715,7 @@ test_check(int n, int argc, VALUE *argv)
*/
static VALUE
-rb_f_test(int argc, VALUE *argv, VALUE _)
+rb_f_test(int argc, VALUE *argv)
{
int cmd;
@@ -5340,9 +4808,8 @@ rb_f_test(int argc, VALUE *argv, VALUE _)
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) {
@@ -5362,28 +4829,22 @@ rb_f_test(int argc, VALUE *argv, VALUE _)
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;
}
}
@@ -5394,13 +4855,15 @@ rb_f_test(int argc, VALUE *argv, VALUE _)
/*
* Document-class: File::Stat
*
- * Objects of class File::Stat encapsulate common status information
- * for File objects. The information is recorded at the moment the
- * File::Stat object is created; changes made to the file after that
- * point will not be reflected. File::Stat objects are returned by
- * IO#stat, File::stat, File#lstat, and File::lstat. Many of these
+ * Objects of class <code>File::Stat</code> encapsulate common status
+ * information for <code>File</code> objects. The information is
+ * recorded at the moment the <code>File::Stat</code> object is
+ * created; changes made to the file after that point will not be
+ * reflected. <code>File::Stat</code> objects are returned by
+ * <code>IO#stat</code>, <code>File::stat</code>,
+ * <code>File#lstat</code>, and <code>File::lstat</code>. Many of these
* methods return platform-specific values, and not all values are
- * meaningful on all systems. See also Kernel#test.
+ * meaningful on all systems. See also <code>Kernel#test</code>.
*/
static VALUE
@@ -5423,6 +4886,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) {
@@ -5521,9 +4985,10 @@ rb_stat_p(VALUE obj)
*
* Returns <code>true</code> if <i>stat</i> is a symbolic link,
* <code>false</code> if it isn't or if the operating system doesn't
- * support this feature. As File::stat automatically follows symbolic
- * links, #symlink? will always be <code>false</code> for an object
- * returned by File::stat.
+ * support this feature. As <code>File::stat</code> automatically
+ * follows symbolic links, <code>symlink?</code> will always be
+ * <code>false</code> for an object returned by
+ * <code>File::stat</code>.
*
* File.symlink("testfile", "alink") #=> 0
* File.stat("alink").symlink? #=> false
@@ -5720,7 +5185,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
@@ -5735,9 +5200,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;
@@ -5813,7 +5277,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
@@ -5828,9 +5292,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;
@@ -6024,60 +5487,7 @@ 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 _)
-{
- 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
-
-static VALUE rb_mFConst;
+VALUE rb_mFConst;
void
rb_file_const(const char *name, VALUE value)
@@ -6119,7 +5529,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);
@@ -6141,9 +5551,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;
@@ -6191,52 +5601,30 @@ rb_path_check(const char *path)
return 1;
}
-int
-ruby_is_fd_loadable(int fd)
+#ifndef _WIN32
+static void *
+loadopen_func(void *arg)
{
-#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) || S_ISCHR(st.st_mode))
- return -1;
-
- if (S_ISDIR(st.st_mode))
- errno = EISDIR;
- else
- errno = ENXIO;
-
- return 0;
-#endif
+ return (void *)(VALUE)rb_cloexec_open((const char *)arg, O_RDONLY, 0);
}
-#ifndef _WIN32
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;
+
+ fd = (int)(VALUE)rb_thread_call_without_gvl(loadopen_func, (void *)path, RUBY_UBF_IO, 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;
}
@@ -6260,14 +5648,13 @@ copy_path_class(VALUE path, VALUE orig)
}
int
-rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int _level)
+rb_find_file_ext(VALUE *filep, const char *const *ext)
{
- rb_warn("rb_find_file_ext_safe will be removed in Ruby 3.0");
- return rb_find_file_ext(filep, ext);
+ return rb_find_file_ext_safe(filep, ext, rb_safe_level());
}
int
-rb_find_file_ext(VALUE *filep, const char *const *ext)
+rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
{
const char *f = StringValueCStr(*filep);
VALUE fname = *filep, load_path, tmp;
@@ -6278,12 +5665,18 @@ rb_find_file_ext(VALUE *filep, const char *const *ext)
if (f[0] == '~') {
fname = file_expand_path_1(fname);
+ if (safe_level >= 1 && OBJ_TAINTED(fname)) {
+ rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
+ }
f = RSTRING_PTR(fname);
*filep = fname;
expanded = 1;
}
if (expanded || rb_is_absolute_path(f) || is_explicit_relative(f)) {
+ if (safe_level >= 1 && !fpath_check(fname)) {
+ rb_raise(rb_eSecurityError, "loading from unsafe path %s", f);
+ }
if (!expanded) fname = file_expand_path_1(fname);
fnlen = RSTRING_LEN(fname);
for (i=0; ext[i]; i++) {
@@ -6310,13 +5703,14 @@ rb_find_file_ext(VALUE *filep, const char *const *ext)
for (i = 0; i < RARRAY_LEN(load_path); i++) {
VALUE str = RARRAY_AREF(load_path, i);
- RB_GC_GUARD(str) = rb_get_path(str);
+ RB_GC_GUARD(str) = rb_get_path_check(str, safe_level);
if (RSTRING_LEN(str) == 0) continue;
rb_file_expand_path_internal(fname, str, 0, 0, tmp);
if (rb_file_load_ok(RSTRING_PTR(tmp))) {
*filep = copy_path_class(tmp, *filep);
return (int)(j+1);
}
+ FL_UNSET(tmp, FL_TAINT);
}
rb_str_set_len(fname, fnlen);
}
@@ -6326,14 +5720,13 @@ rb_find_file_ext(VALUE *filep, const char *const *ext)
}
VALUE
-rb_find_file_safe(VALUE path, int _level)
+rb_find_file(VALUE path)
{
- rb_warn("rb_find_file_safe will be removed in Ruby 3.0");
- return rb_find_file(path);
+ return rb_find_file_safe(path, rb_safe_level());
}
VALUE
-rb_find_file(VALUE path)
+rb_find_file_safe(VALUE path, int safe_level)
{
VALUE tmp, load_path;
const char *f = StringValueCStr(path);
@@ -6341,12 +5734,18 @@ rb_find_file(VALUE path)
if (f[0] == '~') {
tmp = file_expand_path_1(path);
+ if (safe_level >= 1 && OBJ_TAINTED(tmp)) {
+ rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
+ }
path = copy_path_class(tmp, path);
f = RSTRING_PTR(path);
expanded = 1;
}
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 %s", f);
+ }
if (!rb_file_load_ok(f)) return 0;
if (!expanded)
path = copy_path_class(file_expand_path_1(path), path);
@@ -6361,7 +5760,7 @@ rb_find_file(VALUE path)
rb_enc_associate_index(tmp, rb_usascii_encindex());
for (i = 0; i < RARRAY_LEN(load_path); i++) {
VALUE str = RARRAY_AREF(load_path, i);
- RB_GC_GUARD(str) = rb_get_path(str);
+ RB_GC_GUARD(str) = rb_get_path_check(str, safe_level);
if (RSTRING_LEN(str) > 0) {
rb_file_expand_path_internal(path, str, 0, 0, tmp);
f = RSTRING_PTR(tmp);
@@ -6376,6 +5775,10 @@ rb_find_file(VALUE path)
}
found:
+ if (safe_level >= 1 && !fpath_check(tmp)) {
+ rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
+ }
+
return copy_path_class(tmp, path);
}
@@ -6386,7 +5789,7 @@ define_filetest_function(const char *name, VALUE (*func)(ANYARGS), int argc)
rb_define_singleton_method(rb_cFile, name, func, argc);
}
-const char ruby_null_device[] =
+static const char null_device[] =
#if defined DOSISH
"NUL"
#elif defined AMIGA || defined __amigaos__
@@ -6399,10 +5802,11 @@ const char ruby_null_device[] =
;
/*
- * A File is an abstraction of any file object accessible by the
- * program and is closely associated with class IO. File includes
- * the methods of module FileTest as class methods, allowing you to
- * write (for example) <code>File.exist?("foo")</code>.
+ * A <code>File</code> is an abstraction of any file object accessible
+ * 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>.
*
* In the description of File methods,
* <em>permission bits</em> are a platform-specific
@@ -6434,8 +5838,6 @@ const char ruby_null_device[] =
void
Init_File(void)
{
- VALUE separator;
-
rb_mFileTest = rb_define_module("FileTest");
rb_cFile = rb_define_class("File", rb_cIO);
@@ -6452,7 +5854,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);
@@ -6485,21 +5886,18 @@ 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", s_expand_path, -1);
- rb_define_singleton_method(rb_cFile, "absolute_path", s_absolute_path, -1);
- rb_define_singleton_method(rb_cFile, "absolute_path?", s_absolute_path_p, 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);
rb_define_singleton_method(rb_cFile, "realdirpath", rb_file_s_realdirpath, -1);
rb_define_singleton_method(rb_cFile, "basename", rb_file_s_basename, -1);
@@ -6507,10 +5905,9 @@ 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_lit("/");
+ separator = rb_obj_freeze(rb_usascii_str_new2("/"));
/* separates directory parts in path */
rb_define_const(rb_cFile, "Separator", separator);
- /* separates directory parts in path */
rb_define_const(rb_cFile, "SEPARATOR", separator);
rb_define_singleton_method(rb_cFile, "split", rb_file_s_split, 1);
rb_define_singleton_method(rb_cFile, "join", rb_file_s_join, -2);
@@ -6522,7 +5919,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);
@@ -6585,11 +5982,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));
@@ -6614,10 +6006,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));
@@ -6629,7 +6017,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(ruby_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 131ffb8246..51872f26dd 100644
--- a/gc.c
+++ b/gc.c
@@ -11,36 +11,26 @@
**********************************************************************/
-#define rb_data_object_alloc rb_data_object_alloc
-#define rb_data_typed_object_alloc rb_data_typed_object_alloc
-
-#include "ruby/encoding.h"
-#include "ruby/io.h"
+#include "internal.h"
#include "ruby/st.h"
#include "ruby/re.h"
+#include "ruby/io.h"
#include "ruby/thread.h"
#include "ruby/util.h"
#include "ruby/debug.h"
-#include "internal.h"
#include "eval_intern.h"
#include "vm_core.h"
-#include "builtin.h"
#include "gc.h"
#include "constant.h"
#include "ruby_atomic.h"
#include "probes.h"
-#include "id_table.h"
-#include "symbol.h"
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#include <sys/types.h>
-#include "ruby_assert.h"
-#include "debug_counter.h"
-#include "transient_heap.h"
-#include "mjit.h"
+#include <assert.h>
-#undef rb_data_object_wrap
+#undef rb_data_object_alloc
#ifndef HAVE_MALLOC_USABLE_SIZE
# ifdef _WIN32
@@ -52,9 +42,7 @@
# endif
#endif
#ifdef HAVE_MALLOC_USABLE_SIZE
-# ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
-# include RUBY_ALTERNATIVE_MALLOC_HEADER
-# elif HAVE_MALLOC_H
+# ifdef HAVE_MALLOC_H
# include <malloc.h>
# elif defined(HAVE_MALLOC_NP_H)
# include <malloc_np.h>
@@ -63,6 +51,16 @@
# endif
#endif
+#if /* is ASAN enabled? */ \
+ __has_feature(address_sanitizer) /* Clang */ || \
+ defined(__SANITIZE_ADDRESS__) /* GCC 4.8.x */
+ #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS \
+ __attribute__((no_address_safety_analysis)) \
+ __attribute__((noinline))
+#else
+ #define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
+#endif
+
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -70,6 +68,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>
@@ -81,168 +85,6 @@
#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t
-#if defined(_MSC_VER) && defined(_WIN64)
-#include <intrin.h>
-#pragma intrinsic(_umul128)
-#endif
-
-/* Expecting this struct to be eliminated by function inlinings */
-struct optional {
- bool left;
- size_t right;
-};
-
-static inline struct optional
-size_mul_overflow(size_t x, size_t y)
-{
- bool p;
- size_t z;
-#if 0
-
-#elif defined(HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW)
- p = __builtin_mul_overflow(x, y, &z);
-
-#elif defined(DSIZE_T)
- RB_GNUC_EXTENSION DSIZE_T dx = x;
- RB_GNUC_EXTENSION DSIZE_T dy = y;
- RB_GNUC_EXTENSION DSIZE_T dz = dx * dy;
- p = dz > SIZE_MAX;
- z = (size_t)dz;
-
-#elif defined(_MSC_VER) && defined(_WIN64)
- unsigned __int64 dp;
- unsigned __int64 dz = _umul128(x, y, &dp);
- p = (bool)dp;
- z = (size_t)dz;
-
-#else
- /* https://wiki.sei.cmu.edu/confluence/display/c/INT30-C.+Ensure+that+unsigned+integer+operations+do+not+wrap */
- p = (y != 0) && (x > SIZE_MAX / y);
- z = x * y;
-
-#endif
- return (struct optional) { p, z, };
-}
-
-static inline struct optional
-size_add_overflow(size_t x, size_t y)
-{
- size_t z;
- bool p;
-#if 0
-
-#elif defined(HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW)
- p = __builtin_add_overflow(x, y, &z);
-
-#elif defined(DSIZE_T)
- RB_GNUC_EXTENSION DSIZE_T dx = x;
- RB_GNUC_EXTENSION DSIZE_T dy = y;
- RB_GNUC_EXTENSION DSIZE_T dz = dx + dy;
- p = dz > SIZE_MAX;
- z = (size_t)dz;
-
-#else
- z = x + y;
- p = z < y;
-
-#endif
- return (struct optional) { p, z, };
-}
-
-static inline struct optional
-size_mul_add_overflow(size_t x, size_t y, size_t z) /* x * y + z */
-{
- struct optional t = size_mul_overflow(x, y);
- struct optional u = size_add_overflow(t.right, z);
- return (struct optional) { t.left || u.left, u.right };
-}
-
-static inline struct optional
-size_mul_add_mul_overflow(size_t x, size_t y, size_t z, size_t w) /* x * y + z * w */
-{
- struct optional t = size_mul_overflow(x, y);
- struct optional u = size_mul_overflow(z, w);
- struct optional v = size_add_overflow(t.right, u.right);
- return (struct optional) { t.left || u.left || v.left, v.right };
-}
-
-PRINTF_ARGS(NORETURN(static void gc_raise(VALUE, const char*, ...)), 2, 3);
-
-static inline size_t
-size_mul_or_raise(size_t x, size_t y, VALUE exc)
-{
- struct optional t = size_mul_overflow(x, y);
- if (LIKELY(!t.left)) {
- return t.right;
- }
- else if (rb_during_gc()) {
- rb_memerror(); /* or...? */
- }
- else {
- gc_raise(
- exc,
- "integer overflow: %"PRIuSIZE
- " * %"PRIuSIZE
- " > %"PRIuSIZE,
- x, y, SIZE_MAX);
- }
-}
-
-size_t
-rb_size_mul_or_raise(size_t x, size_t y, VALUE exc)
-{
- return size_mul_or_raise(x, y, exc);
-}
-
-static inline size_t
-size_mul_add_or_raise(size_t x, size_t y, size_t z, VALUE exc)
-{
- struct optional t = size_mul_add_overflow(x, y, z);
- if (LIKELY(!t.left)) {
- return t.right;
- }
- else if (rb_during_gc()) {
- rb_memerror(); /* or...? */
- }
- else {
- gc_raise(
- exc,
- "integer overflow: %"PRIuSIZE
- " * %"PRIuSIZE
- " + %"PRIuSIZE
- " > %"PRIuSIZE,
- x, y, z, SIZE_MAX);
- }
-}
-
-size_t
-rb_size_mul_add_or_raise(size_t x, size_t y, size_t z, VALUE exc)
-{
- return size_mul_add_or_raise(x, y, z, exc);
-}
-
-static inline size_t
-size_mul_add_mul_or_raise(size_t x, size_t y, size_t z, size_t w, VALUE exc)
-{
- struct optional t = size_mul_add_mul_overflow(x, y, z, w);
- if (LIKELY(!t.left)) {
- return t.right;
- }
- else if (rb_during_gc()) {
- rb_memerror(); /* or...? */
- }
- else {
- gc_raise(
- exc,
- "integer overflow: %"PRIdSIZE
- " * %"PRIdSIZE
- " + %"PRIdSIZE
- " * %"PRIdSIZE
- " > %"PRIdSIZE,
- x, y, z, w, SIZE_MAX);
- }
-}
-
#if defined(HAVE_RB_GC_GUARDED_PTR_VAL) && HAVE_RB_GC_GUARDED_PTR_VAL
/* trick the compiler into thinking a external signal handler uses this */
volatile VALUE rb_gc_guarded_val;
@@ -272,13 +114,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
@@ -311,7 +150,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 {
@@ -319,20 +158,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;
@@ -341,21 +173,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:
@@ -374,44 +201,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
-// Note: using RUBY_ASSERT_WHEN() extend a macro in expr (info by nobu).
-#define GC_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(RGENGC_CHECK_MODE > 0, expr, #expr)
-
-/* 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
@@ -467,7 +271,7 @@ int ruby_rgengc_debug;
#define GC_ENABLE_LAZY_SWEEP 1
#endif
#ifndef CALC_EXACT_MALLOC_SIZE
-#define CALC_EXACT_MALLOC_SIZE USE_GC_MALLOC_OBJ_INFO_DETAILS
+#define CALC_EXACT_MALLOC_SIZE 0
#endif
#if defined(HAVE_MALLOC_USABLE_SIZE) || CALC_EXACT_MALLOC_SIZE > 0
#ifndef MALLOC_ALLOCATED_SIZE
@@ -480,14 +284,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 */
@@ -509,13 +305,7 @@ typedef enum {
/* others */
GPR_FLAG_IMMEDIATE_SWEEP = 0x2000,
- GPR_FLAG_HAVE_FINALIZE = 0x4000,
- GPR_FLAG_IMMEDIATE_MARK = 0x8000,
- GPR_FLAG_FULL_MARK = 0x10000,
-
- GPR_DEFAULT_REASON =
- (GPR_FLAG_FULL_MARK | GPR_FLAG_IMMEDIATE_MARK |
- GPR_FLAG_IMMEDIATE_SWEEP | GPR_FLAG_CAPI),
+ GPR_FLAG_HAVE_FINALIZE = 0x4000
} gc_profile_record_flag;
typedef struct gc_profile_record {
@@ -559,7 +349,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
@@ -569,7 +359,6 @@ typedef struct RVALUE {
VALUE flags; /* always 0 for freed obj */
struct RVALUE *next;
} free;
- struct RMoved moved;
struct RBasic basic;
struct RObject object;
struct RClass klass;
@@ -583,21 +372,10 @@ 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_tmpbuf_struct alloc;
- rb_ast_t ast;
- } imemo;
struct {
struct RBasic basic;
VALUE v1;
@@ -611,7 +389,7 @@ typedef struct RVALUE {
#endif
} RVALUE;
-#if defined(_MSC_VER) || defined(__CYGWIN__)
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
#pragma pack(pop)
#endif
@@ -620,7 +398,6 @@ enum {
BITS_SIZE = sizeof(bits_t),
BITS_BITLENGTH = ( BITS_SIZE * CHAR_BIT )
};
-#define popcount_bits rb_popcount_intptr
struct heap_page_header {
struct heap_page *page;
@@ -658,19 +435,19 @@ typedef struct rb_heap_struct {
struct heap_page *free_pages;
struct heap_page *using_page;
- struct list_head pages;
- struct heap_page *sweeping_page; /* iterator for .pages */
+ 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 {
@@ -684,14 +461,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 during_compacting : 1;
unsigned int gc_stressful: 1;
- unsigned int has_hook: 1;
#if USE_RGENGC
unsigned int during_minor_gc : 1;
#endif
@@ -702,7 +477,6 @@ typedef struct rb_objspace {
rb_event_flag_t hook_events;
size_t total_allocated_objects;
- VALUE next_object_id;
rb_heap_t eden_heap;
rb_heap_t tomb_heap; /* heap for zombies and ghosts */
@@ -725,7 +499,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;
@@ -750,7 +527,6 @@ typedef struct rb_objspace {
#if USE_RGENGC
size_t minor_gc_count;
size_t major_gc_count;
- size_t compact_count;
#if RGENGC_PROFILE > 0
size_t total_generated_normal_object_count;
size_t total_generated_shady_object_count;
@@ -790,8 +566,8 @@ 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;
@@ -805,12 +581,6 @@ typedef struct rb_objspace {
size_t error_count;
#endif
} rgengc;
-
- struct {
- size_t considered_count_table[T_MASK];
- size_t moved_count_table[T_MASK];
- } rcompactor;
-
#if GC_ENABLE_INCREMENTAL_MARK
struct {
size_t pooled_slots;
@@ -818,66 +588,59 @@ typedef struct rb_objspace {
} rincgc;
#endif
#endif /* USE_RGENGC */
-
- st_table *id_to_obj_tbl;
- st_table *obj_to_id_tbl;
-
-#if GC_DEBUG_STRESS_TO_CLASS
- VALUE stress_to_class;
-#endif
} rb_objspace_t;
+#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 {
- short total_slots;
- short free_slots;
- short pinned_slots;
- short final_slots;
+ struct heap_page_body *body;
+ struct heap_page *prev;
+ rb_heap_t *heap;
+ int total_slots;
+ int free_slots;
+ int final_slots;
struct {
unsigned int before_sweep : 1;
unsigned int has_remembered_objects : 1;
- unsigned int has_uncollectible_shady_objects : 1;
- unsigned int in_tomb : 1;
+ unsigned int has_long_lived_shady_objects : 1;
} flags;
struct heap_page *free_next;
RVALUE *start;
RVALUE *freelist;
- struct list_node page_node;
+ struct heap_page *next;
#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
-
- /* If set, the object is not movable */
- bits_t pinned_bits[HEAP_PAGE_BITMAP_LIMIT];
};
-#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))
@@ -889,19 +652,20 @@ struct heap_page {
/* getting bitmap */
#define GET_HEAP_MARK_BITS(x) (&GET_HEAP_PAGE(x)->mark_bits[0])
-#define GET_HEAP_PINNED_BITS(x) (&GET_HEAP_PAGE(x)->pinned_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
/* Aliases */
-#define rb_objspace (*rb_objspace_of(GET_VM()))
-#define rb_objspace_of(vm) ((vm)->objspace)
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
+#define rb_objspace (*GET_VM()->objspace)
+#else
+static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT_MIN}};
+#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
@@ -912,8 +676,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)
@@ -925,33 +691,9 @@ 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)
+#define is_marking(objspace) ((objspace)->flags.stat == gc_stat_marking)
+#define is_sweeping(objspace) ((objspace)->flags.stat == gc_stat_sweeping)
#if USE_RGENGC
#define is_full_marking(objspace) ((objspace)->flags.during_minor_gc == FALSE)
#else
@@ -967,7 +709,7 @@ gc_mode_verify(enum gc_mode mode)
#else
#define will_be_incremental_marking(objspace) FALSE
#endif
-#define has_sweeping_pages(heap) ((heap)->sweeping_page != 0)
+#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
@@ -994,31 +736,26 @@ struct RZombie {
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
-#if RUBY_MARK_FREE_DEBUG
int ruby_gc_debug_indent = 0;
-#endif
VALUE rb_mGC;
int ruby_disable_gc = 0;
-void rb_iseq_mark(const rb_iseq_t *iseq);
-void rb_iseq_update_references(rb_iseq_t *iseq);
-void rb_iseq_free(const rb_iseq_t *iseq);
-size_t rb_iseq_memsize(const rb_iseq_t *iseq);
-void rb_vm_update_references(void *ptr);
-
void rb_gcdebug_print_obj_condition(VALUE obj);
+static void rb_objspace_call_finalizer(rb_objspace_t *objspace);
static VALUE define_final0(VALUE obj, VALUE block);
-NORETURN(static void negative_size_allocation_error(const char *));
+static void negative_size_allocation_error(const char *);
+static void *aligned_malloc(size_t, size_t);
+static void aligned_free(void *);
static void init_mark_stack(mark_stack_t *stack);
static int ready_to_gc(rb_objspace_t *objspace);
-static int garbage_collect(rb_objspace_t *, int reason);
+static int garbage_collect(rb_objspace_t *, int full_mark, int immediate_mark, int immediate_sweep, int reason);
-static int gc_start(rb_objspace_t *objspace, int reason);
+static int gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark, const unsigned int immediate_sweep, int reason);
static void gc_rest(rb_objspace_t *objspace);
static inline void gc_enter(rb_objspace_t *objspace, const char *event);
static inline void gc_exit(rb_objspace_t *objspace, const char *event);
@@ -1027,29 +764,30 @@ static void gc_marks(rb_objspace_t *objspace, int full_mark);
static void gc_marks_start(rb_objspace_t *objspace, int full);
static int gc_marks_finish(rb_objspace_t *objspace);
static void gc_marks_rest(rb_objspace_t *objspace);
+#if GC_ENABLE_INCREMENTAL_MARK
static void gc_marks_step(rb_objspace_t *objspace, int slots);
static void gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap);
+#endif
static void gc_sweep(rb_objspace_t *objspace);
static void gc_sweep_start(rb_objspace_t *objspace);
static void gc_sweep_finish(rb_objspace_t *objspace);
static int gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap);
static void gc_sweep_rest(rb_objspace_t *objspace);
+#if GC_ENABLE_LAZY_SWEEP
static void gc_sweep_continue(rb_objspace_t *objspace, rb_heap_t *heap);
+#endif
-static inline void gc_mark(rb_objspace_t *objspace, VALUE ptr);
-static inline void gc_pin(rb_objspace_t *objspace, VALUE ptr);
-static inline void gc_mark_and_pin(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);
-NO_SANITIZE("memory", static void gc_mark_maybe(rb_objspace_t *objspace, VALUE ptr));
+static void gc_mark_maybe(rb_objspace_t *objspace, VALUE ptr);
static void gc_mark_children(rb_objspace_t *objspace, VALUE ptr);
static 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);
-NO_SANITIZE("memory", 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);
static void push_mark_stack(mark_stack_t *, VALUE);
static int pop_mark_stack(mark_stack_t *, VALUE *);
@@ -1057,7 +795,7 @@ static size_t mark_stack_size(mark_stack_t *stack);
static void shrink_stack_chunk_cache(mark_stack_t *stack);
static size_t obj_memsize_of(VALUE obj, int use_all_types);
-static void gc_verify_internal_consistency(rb_objspace_t *objspace);
+static VALUE gc_verify_internal_consistency(VALUE self);
static int gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj);
static int gc_verify_heap_pages(rb_objspace_t *objspace);
@@ -1074,22 +812,14 @@ static inline void gc_prof_sweep_timer_stop(rb_objspace_t *);
static inline void gc_prof_set_malloc_info(rb_objspace_t *);
static inline void gc_prof_set_heap_info(rb_objspace_t *);
-#define TYPED_UPDATE_IF_MOVED(_objspace, _type, _thing) do { \
- if (gc_object_moved_p(_objspace, (VALUE)_thing)) { \
- *((_type *)(&_thing)) = (_type)RMOVED((_thing))->destination; \
- } \
-} while (0)
-
-#define UPDATE_IF_MOVED(_objspace, _thing) TYPED_UPDATE_IF_MOVED(_objspace, VALUE, _thing)
-
#define gc_prof_record(objspace) (objspace)->profile.current_record
#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);
@@ -1141,17 +871,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;
@@ -1199,31 +918,26 @@ 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_PIN_BITMAP(obj) MARKED_IN_BITMAP(GET_HEAP_PINNED_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_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
#define RVALUE_AGE_SHIFT 5 /* FL_PROMOTED0 bit */
static int rgengc_remembered(rb_objspace_t *objspace, VALUE obj);
-static int rgengc_remembered_sweep(rb_objspace_t *objspace, VALUE obj);
static int rgengc_remember(rb_objspace_t *objspace, VALUE obj);
static void rgengc_mark_and_rememberset_clear(rb_objspace_t *objspace, rb_heap_t *heap);
static void rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap);
@@ -1236,137 +950,54 @@ RVALUE_FLAGS_AGE(VALUE flags)
#endif /* USE_RGENGC */
-static int
-check_rvalue_consistency_force(const VALUE obj, int terminate)
+static inline VALUE
+check_rvalue_consistency(const VALUE obj)
{
+#if RGENGC_CHECK_MODE > 0
rb_objspace_t *objspace = &rb_objspace;
- int err = 0;
- if (SPECIAL_CONST_P(obj)) {
- fprintf(stderr, "check_rvalue_consistency: %p is a special const.\n", (void *)obj);
- err++;
- }
- else if (!is_pointer_to_heap(objspace, (void *)obj)) {
- /* check if it is in tomb_pages */
- struct heap_page *page = NULL;
- list_for_each(&heap_tomb->pages, page, page_node) {
- if (&page->start[0] <= (RVALUE *)obj &&
- (RVALUE *)obj < &page->start[page->total_slots]) {
- fprintf(stderr, "check_rvalue_consistency: %p is in a tomb_heap (%p).\n",
- (void *)obj, (void *)page);
- err++;
- goto skip;
- }
- }
- fprintf(stderr, "check_rvalue_consistency: %p is not a Ruby object.\n", (void *)obj);
- err++;
- skip:
- ;
+ 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 (GET_HEAP_PAGE(obj)->flags.in_tomb) {
- fprintf(stderr, "check_rvalue_consistency: %s is in tomb page.\n", obj_info(obj));
- err++;
- }
- if (BUILTIN_TYPE(obj) == T_NONE) {
- fprintf(stderr, "check_rvalue_consistency: %s is T_NONE.\n", obj_info(obj));
- err++;
- }
- if (BUILTIN_TYPE(obj) == T_ZOMBIE) {
- fprintf(stderr, "check_rvalue_consistency: %s is T_ZOMBIE.\n", obj_info(obj));
- err++;
- }
-
- obj_memsize_of((VALUE)obj, FALSE);
-
- /* check generation
- *
- * OLD == age == 3 && old-bitmap && mark-bit (except incremental marking)
- */
- if (age > 0 && wb_unprotected_bit) {
- fprintf(stderr, "check_rvalue_consistency: %s is not WB protected, but age is %d > 0.\n", obj_info(obj), age);
- err++;
- }
-
- if (!is_marking(objspace) && uncollectible_bit && !mark_bit) {
- fprintf(stderr, "check_rvalue_consistency: %s is uncollectible, but is not marked while !gc.\n", obj_info(obj));
- err++;
- }
+ 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 (!is_full_marking(objspace)) {
- if (uncollectible_bit && age != RVALUE_OLD_AGE && !wb_unprotected_bit) {
- fprintf(stderr, "check_rvalue_consistency: %s is uncollectible, but not old (age: %d) and not WB unprotected.\n",
- obj_info(obj), age);
- err++;
- }
- if (remembered_bit && age != RVALUE_OLD_AGE) {
- fprintf(stderr, "check_rvalue_consistency: %s is remembered, but not old (age: %d).\n",
- obj_info(obj), age);
- err++;
- }
- }
+ 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 coloring
- *
- * marking:false marking:true
- * marked:false white *invalid*
- * marked:true black grey
- */
- if (is_incremental_marking(objspace) && marking_bit) {
- if (!is_marking(objspace) && !mark_bit) {
- fprintf(stderr, "check_rvalue_consistency: %s is marking, but not marked.\n", obj_info(obj));
- err++;
- }
- }
- }
+ /* check generation
+ *
+ * OLD == age == 3 && old-bitmap && mark-bit (except incremental marking)
+ */
+ if (age > 0 && wb_unprotected_bit) {
+ rb_bug("check_rvalue_consistency: %s is not WB protected, but age is %d > 0.", obj_info(obj), age);
+ }
+ if (!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_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));
+ }
- if (err > 0 && terminate) {
- rb_bug("check_rvalue_consistency_force: there is %d errors.", err);
+ /*
+ * check coloring
+ *
+ * marking:false marking:true
+ * marked:false white *invalid*
+ * marked:true black grey
+ */
+ 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));
+ }
}
-
- return err;
-}
-
-#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)
-{
- check_rvalue_consistency_force(obj, TRUE);
- return obj;
-}
#endif
-
-static inline int
-gc_object_moved_p(rb_objspace_t * objspace, VALUE obj)
-{
- if (RB_SPECIAL_CONST_P(obj)) {
- return FALSE;
- }
- else {
- void *poisoned = asan_poisoned_object_p(obj);
- asan_unpoison_object(obj, false);
-
- int ret = BUILTIN_TYPE(obj) == T_MOVED;
- /* Re-poison slot if it's not the one we want */
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(obj) == T_NONE);
- asan_poison_object(obj);
- }
- return ret;
- }
+ return obj;
}
static inline int
@@ -1376,13 +1007,6 @@ RVALUE_MARKED(VALUE obj)
return RVALUE_MARK_BITMAP(obj) != 0;
}
-static inline int
-RVALUE_PINNED(VALUE obj)
-{
- check_rvalue_consistency(obj);
- return RVALUE_PIN_BITMAP(obj) != 0;
-}
-
#if USE_RGENGC
static inline int
RVALUE_WB_UNPROTECTED(VALUE obj)
@@ -1406,10 +1030,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
@@ -1436,11 +1060,10 @@ 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++;
- rb_transient_heap_promote(obj);
#if RGENGC_PROFILE >= 2
objspace->profile.total_promoted_count++;
@@ -1448,13 +1071,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)
-{
- RB_DEBUG_COUNTER_INC(obj_promote);
- RVALUE_PAGE_OLD_UNCOLLECTIBLE_SET(objspace, GET_HEAP_PAGE(obj), obj);
-}
-
static inline VALUE
RVALUE_FLAGS_AGE_SET(VALUE flags, int age)
{
@@ -1478,7 +1094,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);
}
@@ -1488,10 +1104,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);
}
@@ -1501,7 +1117,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);
@@ -1512,18 +1128,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);
@@ -1544,8 +1156,7 @@ 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));
RVALUE_AGE_RESET_RAW(obj);
check_rvalue_consistency(obj);
}
@@ -1576,23 +1187,18 @@ RVALUE_WHITE_P(VALUE obj)
--------------------------- ObjectSpace -----------------------------
*/
-static inline void *
-calloc1(size_t n)
-{
- return calloc(1, n);
-}
-
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
rb_objspace_t *
rb_objspace_alloc(void)
{
- rb_objspace_t *objspace = calloc1(sizeof(rb_objspace_t));
+ rb_objspace_t *objspace = calloc(1, sizeof(rb_objspace_t));
malloc_limit = gc_params.malloc_limit_min;
- list_head_init(&objspace->eden_heap.pages);
- list_head_init(&objspace->tomb_heap.pages);
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);
@@ -1625,118 +1231,79 @@ 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;
}
- st_free_table(objspace->id_to_obj_tbl);
- st_free_table(objspace->obj_to_id_tbl);
free_stack_chunks(&objspace->mark_stack);
free(objspace);
}
-
-static void
-heap_pages_expand_sorted_to(rb_objspace_t *objspace, size_t next_length)
-{
- struct heap_page **sorted;
- size_t size = size_mul_or_raise(next_length, sizeof(struct heap_page *), rb_eRuntimeError);
-
- 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
- * because heap_allocatable_pages contains heap_tomb->total_pages (recycle heap_tomb pages).
- * however, 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)
{
RVALUE *p = (RVALUE *)obj;
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
-
p->as.free.flags = 0;
p->as.free.next = page->freelist;
page->freelist = p;
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
- if (RGENGC_CHECK_MODE &&
- /* obj should belong to page */
- !(&page->start[0] <= (RVALUE *)obj &&
- (RVALUE *)obj < &page->start[page->total_slots] &&
- obj % sizeof(RVALUE) == 0)) {
- rb_bug("heap_page_add_freeobj: %p is not rvalue.", (void *)p);
+ if (RGENGC_CHECK_MODE && !is_pointer_to_heap(objspace, p)) {
+ rb_bug("heap_page_add_freeobj: %p is not rvalue.", p);
}
- asan_poison_object(obj);
-
gc_report(3, objspace, "heap_page_add_freeobj: add %p to freelist\n", (void *)obj);
}
static inline void
-heap_add_freepage(rb_heap_t *heap, struct heap_page *page)
+heap_add_freepage(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
{
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
- GC_ASSERT(page->free_slots != 0);
if (page->freelist) {
page->free_next = heap->free_pages;
heap->free_pages = page;
}
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
}
#if GC_ENABLE_INCREMENTAL_MARK
static inline int
heap_add_poolpage(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
{
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
if (page->freelist) {
page->free_next = heap->pooled_pages;
heap->pooled_pages = page;
objspace->rincgc.pooled_slots += page->free_slots;
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
-
return TRUE;
}
else {
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
-
return FALSE;
}
}
@@ -1745,19 +1312,22 @@ heap_add_poolpage(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *pa
static void
heap_unlink_page(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *page)
{
- list_del(&page->page_node);
- heap->total_pages--;
+ if (page->prev) page->prev->next = page->next;
+ if (page->next) page->next->prev = page->prev;
+ if (heap->pages == page) heap->pages = page->next;
+ page->prev = NULL;
+ page->next = NULL;
+ page->heap = NULL;
+ heap->page_length--;
heap->total_slots -= page->total_slots;
}
-static void rb_aligned_free(void *ptr);
-
static void
heap_page_free(rb_objspace_t *objspace, struct heap_page *page)
{
heap_allocated_pages--;
objspace->profile.total_freed_pages++;
- rb_aligned_free(GET_PAGE_BODY(page->start));
+ aligned_free(page->body);
free(page);
}
@@ -1766,22 +1336,29 @@ heap_pages_free_unused_pages(rb_objspace_t *objspace)
{
size_t i, j;
- if (!list_empty(&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;
+ }
+ else if (i == j) {
+ return; /* no need to check rest pages */
}
- j++;
}
+ if (i != j) {
+ heap_pages_sorted[j] = page;
+ }
+ j++;
}
- GC_ASSERT(j == heap_allocated_pages);
+ if (RGENGC_CHECK_MODE) assert(j == heap_allocated_pages);
}
}
@@ -1792,29 +1369,22 @@ 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 *)rb_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();
}
/* assign heap_page entry */
- page = calloc1(sizeof(struct heap_page));
+ page = (struct heap_page *)calloc(1, sizeof(struct heap_page));
if (page == 0) {
- rb_aligned_free(page_body);
+ aligned_free(page_body);
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;
@@ -1824,17 +1394,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);
}
@@ -1842,17 +1411,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;
@@ -1862,57 +1432,48 @@ heap_page_allocate(rb_objspace_t *objspace)
page_body->header.page = page;
for (p = start; p != end; p++) {
- gc_report(3, objspace, "assign_heap_page: %p is added to freelist\n", (void *)p);
+ gc_report(3, objspace, "assign_heap_page: %p is added to freelist\n", p);
heap_page_add_freeobj(objspace, page, (VALUE)p);
}
page->free_slots = limit;
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
return page;
}
static struct heap_page *
heap_page_resurrect(rb_objspace_t *objspace)
{
- struct heap_page *page = 0, *next;
+ struct heap_page *page;
- list_for_each_safe(&heap_tomb->pages, page, next, page_node) {
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
- if (page->freelist != NULL) {
- heap_unlink_page(objspace, heap_tomb, page);
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
- return page;
- }
+ 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, (void *)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);
- list_add(&heap->pages, &page->page_node);
- heap->total_pages++;
+ page->heap = heap;
+ page->next = heap->pages;
+ if (heap->pages) heap->pages->prev = page;
+ heap->pages = page;
+ heap->page_length++;
heap->total_slots += page->total_slots;
}
@@ -1921,7 +1482,7 @@ heap_assign_page(rb_objspace_t *objspace, rb_heap_t *heap)
{
struct heap_page *page = heap_page_create(objspace);
heap_add_page(objspace, heap, page);
- heap_add_freepage(heap, page);
+ heap_add_freepage(objspace, heap, page);
}
static void
@@ -1929,63 +1490,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);
}
@@ -1994,12 +1530,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;
}
@@ -2009,18 +1542,22 @@ 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) &&
- gc_start(objspace, GPR_FLAG_NEWOBJ) == FALSE) {
+ gc_start(objspace, FALSE, FALSE, FALSE, GPR_FLAG_NEWOBJ) == FALSE) {
rb_memerror();
}
}
@@ -2031,42 +1568,27 @@ 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);
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
+ if (RGENGC_CHECK_MODE) assert(page->free_slots != 0);
p = page->freelist;
page->freelist = NULL;
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
page->free_slots = 0;
- asan_unpoison_object((VALUE)p, true);
return p;
}
static inline VALUE
-heap_get_freeobj_head(rb_objspace_t *objspace, rb_heap_t *heap)
-{
- RVALUE *p = heap->freelist;
- if (LIKELY(p != NULL)) {
- heap->freelist = p->as.free.next;
- }
- asan_unpoison_object((VALUE)p, true);
- return (VALUE)p;
-}
-
-static inline VALUE
heap_get_freeobj(rb_objspace_t *objspace, rb_heap_t *heap)
{
RVALUE *p = heap->freelist;
while (1) {
if (LIKELY(p != NULL)) {
- asan_unpoison_object((VALUE)p, true);
heap->freelist = p->as.free.next;
return (VALUE)p;
}
@@ -2081,59 +1603,58 @@ 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)
{
- const VALUE *pc = ec->cfp->pc;
- if (pc && VM_FRAME_RUBYFRAME_P(ec->cfp)) {
- /* increment PC because source line is calculated with PC-1 */
- ec->cfp->pc++;
- }
- EXEC_EVENT_HOOK(ec, event, ec->cfp->self, 0, 0, 0, data);
- ec->cfp->pc = pc;
+ 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)
{
-#if !__has_feature(memory_sanitizer)
- GC_ASSERT(BUILTIN_TYPE(obj) == T_NONE);
- GC_ASSERT((flags & FL_WB_PROTECTED) == 0);
-#endif
+ 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 */
- struct RVALUE buf = {
- .as = {
- .values = {
- .basic = {
- .flags = flags,
- .klass = klass,
- },
- .v1 = v1,
- .v2 = v2,
- .v3 = v3,
- },
- },
- };
- MEMCPY(RANY(obj), &buf, RVALUE, 1);
+ 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);
+ assert(RVALUE_MARKED(obj) == FALSE);
+ assert(RVALUE_MARKING(obj) == FALSE);
+ assert(RVALUE_OLD_P(obj) == FALSE);
+ assert(RVALUE_WB_UNPROTECTED(obj) == FALSE);
if (flags & FL_PROMOTED1) {
if (RVALUE_AGE(obj) != 2) rb_bug("newobj: %s of age (%d) != 2.", obj_info(obj), RVALUE_AGE(obj));
@@ -2145,13 +1666,13 @@ newobj_init(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_prote
#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)]++;
@@ -2166,264 +1687,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, 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;
-
- RB_DEBUG_COUNTER_INC(obj_newobj);
- (void)RB_DEBUG_COUNTER_INC_IF(obj_newobj_wb_unprotected, !wb_protected);
-
-#if GC_DEBUG_STRESS_TO_CLASS
- if (UNLIKELY(stress_to_class)) {
- long i, cnt = RARRAY_LEN(stress_to_class);
- for (i = 0; i < cnt; ++i) {
- if (klass == RARRAY_AREF(stress_to_class, 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 {
- RB_DEBUG_COUNTER_INC(obj_newobj_slowpath);
-
- 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);
-}
-
-#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)
-{
- VALUE flags = T_IMEMO | (type << FL_USHIFT);
- return newobj_of(v0, flags, v1, v2, v3, TRUE);
-}
-
-static VALUE
-rb_imemo_tmpbuf_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
-{
- VALUE flags = T_IMEMO | (imemo_tmpbuf << FL_USHIFT);
- return newobj_of(v0, flags, v1, v2, v3, FALSE);
+ return newobj_of(klass, flags, 0, 0, 0);
}
-static VALUE
-rb_imemo_tmpbuf_auto_free_maybe_mark_buffer(void *buf, size_t cnt)
+NODE*
+rb_node_newnode(enum node_type type, VALUE a0, VALUE a1, VALUE a2)
{
- return rb_imemo_tmpbuf_new((VALUE)buf, 0, (VALUE)cnt, 0);
-}
-
-rb_imemo_tmpbuf_t *
-rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt)
-{
- return (rb_imemo_tmpbuf_t *)rb_imemo_tmpbuf_new((VALUE)buf, (VALUE)old_heap, (VALUE)cnt, 0);
-}
-
-static size_t
-imemo_memsize(VALUE obj)
-{
- size_t size = 0;
- switch (imemo_type(obj)) {
- case imemo_ment:
- size += sizeof(RANY(obj)->as.imemo.ment.def);
- break;
- case imemo_iseq:
- size += rb_iseq_memsize((rb_iseq_t *)obj);
- break;
- case imemo_env:
- size += RANY(obj)->as.imemo.env.env_size * sizeof(VALUE);
- break;
- case imemo_tmpbuf:
- size += RANY(obj)->as.imemo.alloc.cnt * sizeof(VALUE);
- break;
- case imemo_ast:
- size += rb_ast_memsize(&RANY(obj)->as.imemo.ast);
- break;
- case imemo_cref:
- case imemo_svar:
- case imemo_throw_data:
- case imemo_ifunc:
- case imemo_memo:
- case imemo_parser_strterm:
- break;
- default:
- /* unreachable */
- break;
- }
- return size;
-}
-
-#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", (void *)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);
-}
-
-#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;
+ return newobj_of(klass, T_DATA, (VALUE)dmark, (VALUE)dfree, (VALUE)datap);
}
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 *
@@ -2437,7 +1755,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)
{
@@ -2445,13 +1762,8 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
register struct heap_page *page;
register size_t hi, lo, mid;
- RB_DEBUG_COUNTER_INC(gc_isptr_trial);
-
if (p < heap_pages_lomem || p > heap_pages_himem) return FALSE;
- RB_DEBUG_COUNTER_INC(gc_isptr_range);
-
if ((VALUE)p % sizeof(RVALUE) != 0) return FALSE;
- RB_DEBUG_COUNTER_INC(gc_isptr_align);
/* check if p looks like a pointer using bsearch*/
lo = 0;
@@ -2461,14 +1773,7 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
page = heap_pages_sorted[mid];
if (page->start <= p) {
if (p < page->start + page->total_slots) {
- RB_DEBUG_COUNTER_INC(gc_isptr_maybe);
-
- if (page->flags.in_tomb) {
- return FALSE;
- }
- else {
- return TRUE;
- }
+ return TRUE;
}
lo = mid + 1;
}
@@ -2479,26 +1784,52 @@ 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
make_zombie(rb_objspace_t *objspace, VALUE obj, void (*dfree)(void *), void *data)
{
struct RZombie *zombie = RZOMBIE(obj);
- zombie->basic.flags = T_ZOMBIE | (zombie->basic.flags & FL_SEEN_OBJ_ID);
+ zombie->basic.flags = T_ZOMBIE;
zombie->dfree = dfree;
zombie->data = data;
zombie->next = heap_pages_deferred_final;
@@ -2512,28 +1843,9 @@ make_io_zombie(rb_objspace_t *objspace, VALUE obj)
make_zombie(objspace, obj, (void (*)(void*))rb_io_fptr_finalize, fptr);
}
-static void
-obj_free_object_id(rb_objspace_t *objspace, VALUE obj)
-{
- VALUE id;
-
- GC_ASSERT(FL_TEST(obj, FL_SEEN_OBJ_ID));
- FL_UNSET(obj, FL_SEEN_OBJ_ID);
-
- if (st_delete(objspace->obj_to_id_tbl, (st_data_t *)&obj, &id)) {
- GC_ASSERT(id);
- st_delete(objspace->id_to_obj_tbl, (st_data_t *)&id, NULL);
- }
- else {
- rb_bug("Object ID seen, but not in mapping table: %s\n", obj_info(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)) {
@@ -2550,10 +1862,6 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
FL_UNSET(obj, FL_EXIVAR);
}
- if (FL_TEST(obj, FL_SEEN_OBJ_ID) && !FL_TEST(obj, FL_FINALIZE)) {
- obj_free_object_id(objspace, obj);
- }
-
#if USE_RGENGC
if (RVALUE_WB_UNPROTECTED(obj)) CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
@@ -2562,29 +1870,23 @@ 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
switch (BUILTIN_TYPE(obj)) {
case T_OBJECT:
- if ((RANY(obj)->as.basic.flags & ROBJECT_EMBED) ||
- RANY(obj)->as.object.as.heap.ivptr == NULL) {
- RB_DEBUG_COUNTER_INC(obj_obj_embed);
- }
- else if (ROBJ_TRANSIENT_P(obj)) {
- RB_DEBUG_COUNTER_INC(obj_obj_transient);
- }
- else {
- xfree(RANY(obj)->as.object.as.heap.ivptr);
- RB_DEBUG_COUNTER_INC(obj_obj_ptr);
- }
- break;
+ if (!(RANY(obj)->as.basic.flags & ROBJECT_EMBED) &&
+ RANY(obj)->as.object.as.heap.ivptr) {
+ xfree(RANY(obj)->as.object.as.heap.ivptr);
+ }
+ break;
case T_MODULE:
case T_CLASS:
- mjit_remove_class_serial(RCLASS_SERIAL(obj));
- 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));
}
@@ -2608,78 +1910,21 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
if (RANY(obj)->as.klass.ptr)
xfree(RANY(obj)->as.klass.ptr);
RANY(obj)->as.klass.ptr = NULL;
-
- (void)RB_DEBUG_COUNTER_INC_IF(obj_module_ptr, BUILTIN_TYPE(obj) == T_MODULE);
- (void)RB_DEBUG_COUNTER_INC_IF(obj_class_ptr, BUILTIN_TYPE(obj) == T_CLASS);
break;
case T_STRING:
rb_str_free(obj);
break;
case T_ARRAY:
- rb_ary_free(obj);
+ rb_ary_free(obj);
break;
case T_HASH:
-#if USE_DEBUG_COUNTER
- switch RHASH_SIZE(obj) {
- case 0:
- RB_DEBUG_COUNTER_INC(obj_hash_empty);
- break;
- case 1:
- RB_DEBUG_COUNTER_INC(obj_hash_1);
- break;
- case 2:
- RB_DEBUG_COUNTER_INC(obj_hash_2);
- break;
- case 3:
- RB_DEBUG_COUNTER_INC(obj_hash_3);
- break;
- case 4:
- RB_DEBUG_COUNTER_INC(obj_hash_4);
- break;
- case 5:
- case 6:
- case 7:
- case 8:
- RB_DEBUG_COUNTER_INC(obj_hash_5_8);
- break;
- default:
- GC_ASSERT(RHASH_SIZE(obj) > 8);
- RB_DEBUG_COUNTER_INC(obj_hash_g8);
- }
-
- if (RHASH_AR_TABLE_P(obj)) {
- if (RHASH_AR_TABLE(obj) == NULL) {
- RB_DEBUG_COUNTER_INC(obj_hash_null);
- }
- else {
- RB_DEBUG_COUNTER_INC(obj_hash_ar);
- }
- }
- else {
- RB_DEBUG_COUNTER_INC(obj_hash_st);
- }
-#endif
- if (/* RHASH_AR_TABLE_P(obj) */ !FL_TEST_RAW(obj, RHASH_ST_TABLE_FLAG)) {
- struct ar_table_struct *tab = RHASH(obj)->as.ar;
-
- if (tab) {
- if (RHASH_TRANSIENT_P(obj)) {
- RB_DEBUG_COUNTER_INC(obj_hash_transient);
- }
- else {
- ruby_xfree(tab);
- }
- }
- }
- else {
- GC_ASSERT(RHASH_ST_TABLE_P(obj));
- st_free_table(RHASH(obj)->as.st);
- }
+ if (RANY(obj)->as.hash.ntbl) {
+ st_free_table(RANY(obj)->as.hash.ntbl);
+ }
break;
case T_REGEXP:
if (RANY(obj)->as.regexp.ptr) {
onig_free(RANY(obj)->as.regexp.ptr);
- RB_DEBUG_COUNTER_INC(obj_regexp_ptr);
}
break;
case T_DATA:
@@ -2703,68 +1948,37 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
if (dfree) {
if (dfree == RUBY_DEFAULT_FREE) {
xfree(data);
- RB_DEBUG_COUNTER_INC(obj_data_xfree);
}
else if (free_immediately) {
(*dfree)(data);
- RB_DEBUG_COUNTER_INC(obj_data_imm_free);
}
else {
make_zombie(objspace, obj, dfree, data);
- RB_DEBUG_COUNTER_INC(obj_data_zombie);
return 1;
}
}
- else {
- RB_DEBUG_COUNTER_INC(obj_data_empty);
- }
}
break;
case T_MATCH:
if (RANY(obj)->as.match.rmatch) {
struct rmatch *rm = RANY(obj)->as.match.rmatch;
-#if USE_DEBUG_COUNTER
- if (rm->regs.num_regs >= 8) {
- RB_DEBUG_COUNTER_INC(obj_match_ge8);
- }
- else if (rm->regs.num_regs >= 4) {
- RB_DEBUG_COUNTER_INC(obj_match_ge4);
- }
- else if (rm->regs.num_regs >= 1) {
- RB_DEBUG_COUNTER_INC(obj_match_under4);
- }
-#endif
onig_region_free(&rm->regs, 0);
if (rm->char_offset)
xfree(rm->char_offset);
xfree(rm);
-
- RB_DEBUG_COUNTER_INC(obj_match_ptr);
}
break;
case T_FILE:
if (RANY(obj)->as.file.fptr) {
make_io_zombie(objspace, obj);
- RB_DEBUG_COUNTER_INC(obj_file_ptr);
return 1;
}
break;
case T_RATIONAL:
- RB_DEBUG_COUNTER_INC(obj_rational);
- break;
case T_COMPLEX:
- RB_DEBUG_COUNTER_INC(obj_complex);
- break;
- case T_MOVED:
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;
@@ -2773,103 +1987,41 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
rb_class_remove_from_super_subclasses(obj);
xfree(RANY(obj)->as.klass.ptr);
RANY(obj)->as.klass.ptr = NULL;
-
- RB_DEBUG_COUNTER_INC(obj_iclass_ptr);
break;
case T_FLOAT:
- RB_DEBUG_COUNTER_INC(obj_float);
break;
case T_BIGNUM:
if (!(RBASIC(obj)->flags & BIGNUM_EMBED_FLAG) && BIGNUM_DIGITS(obj)) {
xfree(BIGNUM_DIGITS(obj));
- RB_DEBUG_COUNTER_INC(obj_bignum_ptr);
}
- else {
- RB_DEBUG_COUNTER_INC(obj_bignum_embed);
- }
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) ||
- RANY(obj)->as.rstruct.as.heap.ptr == NULL) {
- RB_DEBUG_COUNTER_INC(obj_struct_embed);
- }
- else if (RSTRUCT_TRANSIENT_P(obj)) {
- RB_DEBUG_COUNTER_INC(obj_struct_transient);
- }
- else {
- xfree((void *)RANY(obj)->as.rstruct.as.heap.ptr);
- RB_DEBUG_COUNTER_INC(obj_struct_ptr);
+ if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 &&
+ RANY(obj)->as.rstruct.as.heap.ptr) {
+ xfree((void *)RANY(obj)->as.rstruct.as.heap.ptr);
}
break;
case T_SYMBOL:
{
rb_gc_free_dsymbol(obj);
- RB_DEBUG_COUNTER_INC(obj_symbol);
}
break;
- case T_IMEMO:
- switch (imemo_type(obj)) {
- case imemo_ment:
- rb_free_method_entry(&RANY(obj)->as.imemo.ment);
- RB_DEBUG_COUNTER_INC(obj_imemo_ment);
- break;
- case imemo_iseq:
- rb_iseq_free(&RANY(obj)->as.imemo.iseq);
- RB_DEBUG_COUNTER_INC(obj_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);
- RB_DEBUG_COUNTER_INC(obj_imemo_env);
- break;
- case imemo_tmpbuf:
- xfree(RANY(obj)->as.imemo.alloc.ptr);
- RB_DEBUG_COUNTER_INC(obj_imemo_tmpbuf);
- break;
- case imemo_ast:
- rb_ast_free(&RANY(obj)->as.imemo.ast);
- RB_DEBUG_COUNTER_INC(obj_imemo_ast);
- break;
- case imemo_cref:
- RB_DEBUG_COUNTER_INC(obj_imemo_cref);
- break;
- case imemo_svar:
- RB_DEBUG_COUNTER_INC(obj_imemo_svar);
- break;
- case imemo_throw_data:
- RB_DEBUG_COUNTER_INC(obj_imemo_throw_data);
- break;
- case imemo_ifunc:
- RB_DEBUG_COUNTER_INC(obj_imemo_ifunc);
- break;
- case imemo_memo:
- RB_DEBUG_COUNTER_INC(obj_imemo_memo);
- break;
- case imemo_parser_strterm:
- RB_DEBUG_COUNTER_INC(obj_imemo_parser_strterm);
- break;
- default:
- /* unreachable */
- break;
- }
- return 0;
-
default:
rb_bug("gc_sweep(): unknown data type 0x%x(%p) 0x%"PRIxVALUE,
BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags);
}
if (FL_TEST(obj, FL_FINALIZE)) {
- make_zombie(objspace, obj, 0, 0);
+ make_zombie(objspace, obj, 0, 0);
return 1;
}
else {
@@ -2877,107 +2029,73 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
}
}
-
-#define OBJ_ID_INCREMENT (sizeof(RVALUE) / 2)
-#define OBJ_ID_INITIAL (OBJ_ID_INCREMENT * 2)
-
-static int
-object_id_cmp(st_data_t x, st_data_t y)
-{
- if (RB_TYPE_P(x, T_BIGNUM)) {
- return !rb_big_eql(x, y);
- } else {
- return x != y;
- }
-}
-
-static st_index_t
-object_id_hash(st_data_t n)
-{
- if (RB_TYPE_P(n, T_BIGNUM)) {
- return FIX2LONG(rb_big_hash(n));
- } else {
- return st_numhash(n);
- }
-}
-static const struct st_hash_type object_id_hash_type = {
- object_id_cmp,
- object_id_hash,
-};
-
void
Init_heap(void)
{
rb_objspace_t *objspace = &rb_objspace;
- objspace->next_object_id = INT2FIX(OBJ_ID_INITIAL);
- objspace->id_to_obj_tbl = st_init_table(&object_id_hash_type);
- objspace->obj_to_id_tbl = st_init_numtable();
+ 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
+ {
+ /* altstack of another threads are allocated in another place */
+ rb_thread_t *th = GET_THREAD();
+ void *tmp = th->altstack;
+ th->altstack = malloc(rb_sigaltstack_size());
+ free(tmp); /* free previously allocated area */
+ }
+#endif
+
objspace->profile.invoke_time = getrusage_time();
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 *);
-static void objspace_each_objects(rb_objspace_t *objspace, each_obj_callback *callback, void *data);
-static void objspace_reachable_objects_from_root(rb_objspace_t *, void (func)(const char *, VALUE, void *), void *);
-
struct each_obj_args {
- rb_objspace_t *objspace;
each_obj_callback *callback;
void *data;
};
-static void
-objspace_each_objects_without_setup(rb_objspace_t *objspace, each_obj_callback *callback, void *data)
+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;
- if ((*callback)(pstart, pend, sizeof(RVALUE), data)) {
+ if ((*args->callback)(pstart, pend, sizeof(RVALUE), args->data)) {
break;
}
}
-}
-static VALUE
-objspace_each_objects_protected(VALUE arg)
-{
- struct each_obj_args *args = (struct each_obj_args *)arg;
- objspace_each_objects_without_setup(args->objspace, args->callback, args->data);
return Qnil;
}
static VALUE
-incremental_enable(VALUE _)
+incremental_enable(void)
{
rb_objspace_t *objspace = &rb_objspace;
@@ -3024,30 +2142,32 @@ incremental_enable(VALUE _)
void
rb_objspace_each_objects(each_obj_callback *callback, void *data)
{
- objspace_each_objects(&rb_objspace, callback, data);
-}
-
-static void
-objspace_each_objects(rb_objspace_t *objspace, each_obj_callback *callback, void *data)
-{
+ struct each_obj_args args;
+ rb_objspace_t *objspace = &rb_objspace;
int prev_dont_incremental = objspace->flags.dont_incremental;
gc_rest(objspace);
objspace->flags.dont_incremental = TRUE;
+ args.callback = callback;
+ args.data = data;
+
if (prev_dont_incremental) {
- objspace_each_objects_without_setup(objspace, callback, data);
+ objspace_each_objects((VALUE)&args);
}
else {
- struct each_obj_args args = {objspace, callback, data};
- rb_ensure(objspace_each_objects_protected, (VALUE)&args, incremental_enable, Qnil);
+ rb_ensure(objspace_each_objects, (VALUE)&args, incremental_enable, Qnil);
}
}
void
rb_objspace_each_objects_without_setup(each_obj_callback *callback, void *data)
{
- objspace_each_objects_without_setup(&rb_objspace, callback, data);
+ struct each_obj_args args;
+ args.callback = callback;
+ args.data = data;
+
+ objspace_each_objects((VALUE)&args);
}
struct os_each_struct {
@@ -3059,35 +2179,22 @@ static int
internal_object_p(VALUE obj)
{
RVALUE *p = (RVALUE *)obj;
- void *ptr = __asan_region_is_poisoned(p, SIZEOF_VALUE);
- asan_unpoison_object(obj, false);
- bool used_p = p->as.basic.flags;
- if (used_p) {
+ if (p->as.basic.flags) {
switch (BUILTIN_TYPE(p)) {
- case T_NODE:
- UNEXPECTED_NODE(internal_object_p);
- break;
case T_NONE:
- case T_MOVED:
- 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;
}
}
- if (ptr || ! used_p) {
- asan_poison_object(obj);
- }
return 1;
}
@@ -3129,7 +2236,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
@@ -3138,9 +2245,9 @@ os_obj_of(VALUE of)
* <i>module</i>. Returns the number of objects found. Immediate
* objects (<code>Fixnum</code>s, <code>Symbol</code>s
* <code>true</code>, <code>false</code>, and <code>nil</code>) are
- * never returned. In the example below, #each_object returns both
- * the numbers we defined and several constants defined in the Math
- * module.
+ * never returned. In the example below, <code>each_object</code>
+ * returns both the numbers we defined and several constants defined in
+ * the <code>Math</code> module.
*
* If no block is given, an enumerator is returned instead.
*
@@ -3168,7 +2275,12 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
{
VALUE of;
- of = (!rb_check_arity(argc, 0, 1) ? 0 : argv[0]);
+ if (argc == 0) {
+ of = 0;
+ }
+ else {
+ rb_scan_args(argc, argv, "01", &of);
+ }
RETURN_ENUMERATOR(os, 1, &of);
return os_obj_of(of);
}
@@ -3201,12 +2313,11 @@ rb_undefine_finalizer(VALUE obj)
static void
should_be_callable(VALUE block)
{
- if (!rb_obj_respond_to(block, idCall, TRUE)) {
+ if (!rb_obj_respond_to(block, rb_intern("call"), TRUE)) {
rb_raise(rb_eArgError, "wrong type argument %"PRIsVALUE" (should be callable)",
rb_obj_class(block));
}
}
-
static void
should_be_finalizable(VALUE obj)
{
@@ -3222,9 +2333,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.
*
*/
@@ -3254,7 +2363,7 @@ define_final0(VALUE obj, VALUE block)
RBASIC(obj)->flags |= FL_FINALIZE;
- block = rb_ary_new3(2, INT2FIX(0), block);
+ block = rb_ary_new3(2, INT2FIX(rb_safe_level()), block);
OBJ_FREEZE(block);
if (st_lookup(finalizer_table, obj, &data)) {
@@ -3262,13 +2371,13 @@ define_final0(VALUE obj, VALUE block)
/* 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++) {
- VALUE recv = RARRAY_AREF(table, i);
- if (rb_funcall(recv, idEq, 1, block)) {
- return recv;
+ for (i = 0; i < len; i++, ptr++) {
+ if (rb_funcall(*ptr, idEq, 1, block)) {
+ return *ptr;
}
}
}
@@ -3307,45 +2416,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);
- 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;
- } saved;
- rb_execution_context_t * volatile ec = GET_EC();
-#define RESTORE_FINALIZER() (\
- ec->cfp = saved.cfp, \
- rb_set_errinfo(saved.errinfo))
-
- saved.errinfo = rb_errinfo();
- saved.objid = rb_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
@@ -3367,25 +2469,18 @@ static void
finalize_list(rb_objspace_t *objspace, VALUE zombie)
{
while (zombie) {
- VALUE next_zombie;
- struct heap_page *page;
- asan_unpoison_object(zombie, false);
- next_zombie = RZOMBIE(zombie)->next;
- page = GET_HEAP_PAGE(zombie);
+ VALUE next_zombie = RZOMBIE(zombie)->next;
+ struct heap_page *page = GET_HEAP_PAGE(zombie);
run_final(objspace, zombie);
- GC_ASSERT(BUILTIN_TYPE(zombie) == T_ZOMBIE);
- if (FL_TEST(zombie, FL_SEEN_OBJ_ID)) {
- obj_free_object_id(objspace, zombie);
- }
-
RZOMBIE(zombie)->basic.flags = 0;
- if (LIKELY(heap_pages_final_slots)) heap_pages_final_slots--;
+ heap_pages_final_slots--;
page->final_slots--;
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;
@@ -3397,7 +2492,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);
}
}
@@ -3405,16 +2500,23 @@ 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);
}
+/* TODO: to keep compatibility, maybe unused. */
+void
+rb_gc_finalize_deferred(void)
+{
+ gc_finalize_deferred(0);
+}
+
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.");
}
}
@@ -3438,21 +2540,27 @@ force_chain_object(st_data_t key, st_data_t val, st_data_t arg)
}
void
+rb_gc_call_finalizer_at_exit(void)
+{
+#if RGENGC_CHECK_MODE >= 2
+ gc_verify_internal_consistency(Qnil);
+#endif
+ rb_objspace_call_finalizer(&rb_objspace);
+}
+
+static void
rb_objspace_call_finalizer(rb_objspace_t *objspace)
{
RVALUE *p, *pend;
size_t i;
-#if RGENGC_CHECK_MODE >= 2
- gc_verify_internal_consistency(objspace);
-#endif
gc_rest(objspace);
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
/* run finalizers */
finalize_deferred(objspace);
- GC_ASSERT(heap_pages_deferred_final == 0);
+ assert(heap_pages_deferred_final == 0);
gc_rest(objspace);
/* prohibit incremental GC */
@@ -3482,8 +2590,6 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
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) {
- void *poisoned = asan_poisoned_object_p((VALUE)p);
- asan_unpoison_object((VALUE)p, false);
switch (BUILTIN_TYPE(p)) {
case T_DATA:
if (!DATA_PTR(p) || !RANY(p)->as.data.dfree) break;
@@ -3494,7 +2600,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
if (RTYPEDDATA_P(p)) {
RDATA(p)->dfree = RANY(p)->as.typeddata.type->function.dfree;
}
- if (RANY(p)->as.data.dfree == RUBY_DEFAULT_FREE) {
+ if (RANY(p)->as.data.dfree == (RUBY_DATA_FUNC)-1) {
xfree(DATA_PTR(p));
}
else if (RANY(p)->as.data.dfree) {
@@ -3507,10 +2613,6 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
}
break;
}
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(p) == T_NONE);
- asan_poison_object((VALUE)p);
- }
p++;
}
}
@@ -3526,7 +2628,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)
{
@@ -3608,18 +2709,6 @@ rb_objspace_garbage_object_p(VALUE obj)
return is_garbage_object(objspace, obj);
}
-static VALUE
-id2ref_obj_tbl(rb_objspace_t *objspace, VALUE objid)
-{
- VALUE orig;
- if (st_lookup(objspace->id_to_obj_tbl, objid, &orig)) {
- return orig;
- }
- else {
- return Qundef;
- }
-}
-
/*
* call-seq:
* ObjectSpace._id2ref(object_id) -> an_object
@@ -3634,7 +2723,7 @@ id2ref_obj_tbl(rb_objspace_t *objspace, VALUE objid)
*/
static VALUE
-id2ref(VALUE objid)
+id2ref(VALUE obj, VALUE objid)
{
#if SIZEOF_LONG == SIZEOF_VOIDP
#define NUM2PTR(x) NUM2ULONG(x)
@@ -3643,100 +2732,35 @@ id2ref(VALUE objid)
#endif
rb_objspace_t *objspace = &rb_objspace;
VALUE ptr;
- VALUE orig;
void *p0;
- if (FIXNUM_P(objid) || rb_big_size(objid) <= SIZEOF_VOIDP) {
- ptr = NUM2PTR(objid);
- if (ptr == Qtrue) return Qtrue;
- if (ptr == Qfalse) return Qfalse;
- if (ptr == Qnil) return Qnil;
- if (FIXNUM_P(ptr)) return (VALUE)ptr;
- if (FLONUM_P(ptr)) return (VALUE)ptr;
-
- ptr = obj_id_to_ref(objid);
- if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
- ID symid = ptr / sizeof(RVALUE);
- p0 = (void *)ptr;
- if (rb_id2str(symid) == 0)
- rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
- return ID2SYM(symid);
- }
- }
+ ptr = NUM2PTR(objid);
+ p0 = (void *)ptr;
- if ((orig = id2ref_obj_tbl(objspace, objid)) != Qundef &&
- is_live_object(objspace, orig)) {
- return orig;
- }
+ if (ptr == Qtrue) return Qtrue;
+ if (ptr == Qfalse) return Qfalse;
+ if (ptr == Qnil) return Qnil;
+ if (FIXNUM_P(ptr)) return (VALUE)ptr;
+ if (FLONUM_P(ptr)) return (VALUE)ptr;
+ ptr = obj_id_to_ref(objid);
- if (rb_int_ge(objid, objspace->next_object_id)) {
- rb_raise(rb_eRangeError, "%+"PRIsVALUE" is not id value", rb_int2str(objid, 10));
- } else {
- rb_raise(rb_eRangeError, "%+"PRIsVALUE" is recycled object", rb_int2str(objid, 10));
+ if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
+ ID symid = ptr / sizeof(RVALUE);
+ if (rb_id2str(symid) == 0)
+ rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
+ return ID2SYM(symid);
}
-}
-
-static VALUE
-os_id2ref(VALUE os, VALUE objid)
-{
- return id2ref(objid);
-}
-static VALUE
-rb_find_object_id(VALUE obj, VALUE (*get_heap_object_id)(VALUE))
-{
- if (STATIC_SYM_P(obj)) {
- return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG;
- }
- else if (FLONUM_P(obj)) {
-#if SIZEOF_LONG == SIZEOF_VOIDP
- return LONG2NUM((SIGNED_VALUE)obj);
-#else
- return LL2NUM((SIGNED_VALUE)obj);
-#endif
- }
- else if (SPECIAL_CONST_P(obj)) {
- return LONG2NUM((SIGNED_VALUE)obj);
+ if (!is_id_value(objspace, ptr)) {
+ rb_raise(rb_eRangeError, "%p is not id value", p0);
}
-
- return get_heap_object_id(obj);
-}
-
-static VALUE
-cached_object_id(VALUE obj)
-{
- VALUE id;
- rb_objspace_t *objspace = &rb_objspace;
-
- if (st_lookup(objspace->obj_to_id_tbl, (st_data_t)obj, &id)) {
- GC_ASSERT(FL_TEST(obj, FL_SEEN_OBJ_ID));
- return id;
+ if (!is_live_object(objspace, ptr)) {
+ rb_raise(rb_eRangeError, "%p is recycled object", p0);
}
- else {
- GC_ASSERT(!FL_TEST(obj, FL_SEEN_OBJ_ID));
-
- id = objspace->next_object_id;
- objspace->next_object_id = rb_int_plus(id, INT2FIX(OBJ_ID_INCREMENT));
-
- st_insert(objspace->obj_to_id_tbl, (st_data_t)obj, (st_data_t)id);
- st_insert(objspace->id_to_obj_tbl, (st_data_t)id, (st_data_t)obj);
- FL_SET(obj, FL_SEEN_OBJ_ID);
-
- return id;
+ if (RBASIC(ptr)->klass == 0) {
+ rb_raise(rb_eRangeError, "%p is internal object", p0);
}
-}
-
-static VALUE
-nonspecial_obj_id_(VALUE obj)
-{
- return nonspecial_obj_id(obj);
-}
-
-
-VALUE
-rb_memory_id(VALUE obj)
-{
- return rb_find_object_id(obj, nonspecial_obj_id_);
+ return (VALUE)ptr;
}
/*
@@ -3755,8 +2779,6 @@ rb_memory_id(VALUE obj)
* Note: that some objects of builtin classes are reused for optimization.
* This is the case for immediate values and frozen string literals.
*
- * BasicObject implements +__id__+, Kernel implements +object_id+.
- *
* Immediate values are not passed by reference but are passed by value:
* +nil+, +true+, +false+, Fixnums, Symbols, and some Floats.
*
@@ -3797,8 +2819,20 @@ rb_obj_id(VALUE obj)
* 24 if 32-bit, double is 8-byte aligned
* 40 if 64-bit
*/
-
- return rb_find_object_id(obj, cached_object_id);
+ if (STATIC_SYM_P(obj)) {
+ return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG;
+ }
+ else if (FLONUM_P(obj)) {
+#if SIZEOF_LONG == SIZEOF_VOIDP
+ return LONG2NUM((SIGNED_VALUE)obj);
+#else
+ return LL2NUM((SIGNED_VALUE)obj);
+#endif
+ }
+ else if (SPECIAL_CONST_P(obj)) {
+ return LONG2NUM((SIGNED_VALUE)obj);
+ }
+ return nonspecial_obj_id(obj);
}
#include "regint.h"
@@ -3825,10 +2859,13 @@ 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 += st_memsize(RCLASS_M_TBL(obj));
+ }
if (RCLASS_EXT(obj)) {
- if (RCLASS_M_TBL(obj)) {
- size += rb_id_table_memsize(RCLASS_M_TBL(obj));
- }
if (RCLASS_IV_TBL(obj)) {
size += st_memsize(RCLASS_IV_TBL(obj));
}
@@ -3839,18 +2876,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;
@@ -3858,20 +2888,13 @@ obj_memsize_of(VALUE obj, int use_all_types)
size += rb_ary_memsize(obj);
break;
case T_HASH:
- if (RHASH_AR_TABLE_P(obj)) {
- if (RHASH_AR_TABLE(obj) != NULL) {
- size_t rb_hash_ar_table_size();
- size += rb_hash_ar_table_size();
- }
+ if (RHASH(obj)->ntbl) {
+ size += st_memsize(RHASH(obj)->ntbl);
}
- else {
- VM_ASSERT(RHASH_ST_TABLE(obj) != NULL);
- size += st_memsize(RHASH_ST_TABLE(obj));
- }
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:
@@ -3892,9 +2915,9 @@ obj_memsize_of(VALUE obj, int use_all_types)
break;
case T_RATIONAL:
case T_COMPLEX:
- break;
- case T_IMEMO:
- size += imemo_memsize(obj);
+ break;
+ case T_ICLASS:
+ /* iClass shares table with the module */
break;
case T_FLOAT:
@@ -3908,7 +2931,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:
@@ -3919,7 +2942,6 @@ obj_memsize_of(VALUE obj, int use_all_types)
break;
case T_ZOMBIE:
- case T_MOVED:
break;
default:
@@ -3945,48 +2967,11 @@ set_zero(st_data_t key, st_data_t val, st_data_t arg)
return ST_CONTINUE;
}
-static VALUE
-type_sym(size_t type)
-{
- switch (type) {
-#define COUNT_TYPE(t) case (t): return ID2SYM(rb_intern(#t)); break;
- COUNT_TYPE(T_NONE);
- COUNT_TYPE(T_OBJECT);
- COUNT_TYPE(T_CLASS);
- COUNT_TYPE(T_MODULE);
- COUNT_TYPE(T_FLOAT);
- COUNT_TYPE(T_STRING);
- COUNT_TYPE(T_REGEXP);
- COUNT_TYPE(T_ARRAY);
- COUNT_TYPE(T_HASH);
- COUNT_TYPE(T_STRUCT);
- COUNT_TYPE(T_BIGNUM);
- COUNT_TYPE(T_FILE);
- COUNT_TYPE(T_DATA);
- COUNT_TYPE(T_MATCH);
- COUNT_TYPE(T_COMPLEX);
- COUNT_TYPE(T_RATIONAL);
- COUNT_TYPE(T_NIL);
- COUNT_TYPE(T_TRUE);
- COUNT_TYPE(T_FALSE);
- COUNT_TYPE(T_SYMBOL);
- COUNT_TYPE(T_FIXNUM);
- COUNT_TYPE(T_IMEMO);
- COUNT_TYPE(T_UNDEF);
- COUNT_TYPE(T_NODE);
- COUNT_TYPE(T_ICLASS);
- COUNT_TYPE(T_ZOMBIE);
- COUNT_TYPE(T_MOVED);
-#undef COUNT_TYPE
- default: return INT2NUM(type); break;
- }
-}
-
/*
* 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:
* {
@@ -4000,19 +2985,9 @@ type_sym(size_t type)
* 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.
*
*/
@@ -4025,10 +3000,9 @@ count_objects(int argc, VALUE *argv, VALUE os)
size_t freed = 0;
size_t total = 0;
size_t i;
- VALUE hash = Qnil;
+ VALUE hash;
- if (rb_check_arity(argc, 0, 1) == 1) {
- hash = argv[0];
+ if (rb_scan_args(argc, argv, "01", &hash) == 1) {
if (!RB_TYPE_P(hash, T_HASH))
rb_raise(rb_eTypeError, "non-hash given");
}
@@ -4043,18 +3017,12 @@ count_objects(int argc, VALUE *argv, VALUE os)
p = page->start; pend = p + page->total_slots;
for (;p < pend; p++) {
- void *poisoned = asan_poisoned_object_p((VALUE)p);
- asan_unpoison_object((VALUE)p, false);
if (p->as.basic.flags) {
counts[BUILTIN_TYPE(p)]++;
}
else {
freed++;
}
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE((VALUE)p) == T_NONE);
- asan_poison_object((VALUE)p);
- }
}
total += page->total_slots;
}
@@ -4063,13 +3031,43 @@ count_objects(int argc, VALUE *argv, VALUE os)
hash = rb_hash_new();
}
else if (!RHASH_EMPTY_P(hash)) {
- rb_hash_stlike_foreach(hash, set_zero, hash);
+ st_foreach(RHASH_TBL_RAW(hash), set_zero, hash);
}
rb_hash_aset(hash, ID2SYM(rb_intern("TOTAL")), SIZET2NUM(total));
rb_hash_aset(hash, ID2SYM(rb_intern("FREE")), SIZET2NUM(freed));
for (i = 0; i <= T_MASK; i++) {
- VALUE type = type_sym(i);
+ VALUE type;
+ switch (i) {
+#define COUNT_TYPE(t) case (t): type = ID2SYM(rb_intern(#t)); break;
+ COUNT_TYPE(T_NONE);
+ COUNT_TYPE(T_OBJECT);
+ COUNT_TYPE(T_CLASS);
+ COUNT_TYPE(T_MODULE);
+ COUNT_TYPE(T_FLOAT);
+ COUNT_TYPE(T_STRING);
+ COUNT_TYPE(T_REGEXP);
+ COUNT_TYPE(T_ARRAY);
+ COUNT_TYPE(T_HASH);
+ COUNT_TYPE(T_STRUCT);
+ COUNT_TYPE(T_BIGNUM);
+ COUNT_TYPE(T_FILE);
+ COUNT_TYPE(T_DATA);
+ COUNT_TYPE(T_MATCH);
+ COUNT_TYPE(T_COMPLEX);
+ COUNT_TYPE(T_RATIONAL);
+ COUNT_TYPE(T_NIL);
+ COUNT_TYPE(T_TRUE);
+ COUNT_TYPE(T_FALSE);
+ COUNT_TYPE(T_SYMBOL);
+ COUNT_TYPE(T_FIXNUM);
+ COUNT_TYPE(T_UNDEF);
+ COUNT_TYPE(T_NODE);
+ COUNT_TYPE(T_ICLASS);
+ COUNT_TYPE(T_ZOMBIE);
+#undef COUNT_TYPE
+ default: type = INT2NUM(i); break;
+ }
if (counts[i])
rb_hash_aset(hash, type, SIZET2NUM(counts[i]));
}
@@ -4106,14 +3104,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;
@@ -4133,20 +3133,19 @@ 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;
do {
- asan_unpoison_object((VALUE)p, false);
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_sweep(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)) {
@@ -4157,7 +3156,6 @@ gc_page_sweep(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *sweep_
heap_page_add_freeobj(objspace, sweep_page, (VALUE)p);
gc_report(3, objspace, "page_sweep: %s is added to freelist\n", obj_info((VALUE)p));
freed_slots++;
- asan_poison_object((VALUE)p);
}
break;
}
@@ -4191,7 +3189,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;
@@ -4199,13 +3197,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 */
@@ -4221,51 +3217,35 @@ 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
gc_sweep_start_heap(rb_objspace_t *objspace, rb_heap_t *heap)
{
- heap->sweeping_page = list_top(&heap->pages, struct heap_page, page_node);
+ 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) {
- struct heap_page *page = heap->using_page;
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
-
- RVALUE **p = &page->freelist;
+ RVALUE **p = &heap->using_page->freelist;
while (*p) {
p = &(*p)->as.free.next;
}
*p = heap->freelist;
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
heap->using_page = NULL;
}
heap->freelist = NULL;
@@ -4277,35 +3257,64 @@ __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(objspace);
+ gc_verify_internal_consistency(Qnil);
#endif
}
static int
gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
{
- struct heap_page *sweep_page = heap->sweeping_page;
+ struct heap_page *sweep_page = heap->sweep_pages, *next;
int unlink_limit = 3;
#if GC_ENABLE_INCREMENTAL_MARK
int need_pool = will_be_incremental_marking(objspace) ? TRUE : FALSE;
@@ -4321,20 +3330,18 @@ gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
gc_prof_sweep_timer_start(objspace);
#endif
- do {
- int free_slots = gc_page_sweep(objspace, heap, sweep_page);
- heap->sweeping_page = list_next(&heap->pages, sweep_page, page_node);
+ while (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) {
+ else if (sweep_page->free_slots > 0) {
#if GC_ENABLE_INCREMENTAL_MARK
if (need_pool) {
if (heap_add_poolpage(objspace, heap, sweep_page)) {
@@ -4342,20 +3349,22 @@ gc_sweep_step(rb_objspace_t *objspace, rb_heap_t *heap)
}
}
else {
- heap_add_freepage(heap, sweep_page);
+ heap_add_freepage(objspace, heap, sweep_page);
break;
}
#else
- heap_add_freepage(heap, sweep_page);
+ heap_add_freepage(objspace, heap, sweep_page);
break;
#endif
}
else {
sweep_page->free_next = NULL;
}
- } while ((sweep_page = heap->sweeping_page));
- if (!heap->sweeping_page) {
+ sweep_page = next;
+ }
+
+ if (heap->sweep_pages == NULL) {
gc_sweep_finish(objspace);
}
@@ -4376,11 +3385,11 @@ 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)
{
- GC_ASSERT(dont_gc == FALSE);
- if (!GC_ENABLE_LAZY_SWEEP) return;
+ if (RGENGC_CHECK_MODE) assert(dont_gc == FALSE);
gc_enter(objspace, "sweep_continue");
#if USE_RGENGC
@@ -4391,6 +3400,7 @@ 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)
@@ -4410,12 +3420,13 @@ gc_sweep(rb_objspace_t *objspace)
#endif
}
else {
- struct heap_page *page = NULL;
+ struct heap_page *page;
gc_sweep_start(objspace);
-
- list_for_each(&heap_eden->pages, page, page_node) {
- page->flags.before_sweep = TRUE;
- }
+ page = heap_eden->sweep_pages;
+ while (page) {
+ page->flags.before_sweep = TRUE;
+ page = page->next;
+ }
gc_sweep_step(objspace, heap_eden);
}
@@ -4482,7 +3493,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;
@@ -4505,12 +3516,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)
{
@@ -4523,6 +3535,7 @@ free_stack_chunks(mark_stack_t *stack)
chunk = next;
}
}
+#endif
static void
push_mark_stack(mark_stack_t *stack, VALUE data)
@@ -4595,17 +3608,16 @@ init_mark_stack(mark_stack_t *stack)
/* Marking */
-#define SET_STACK_END SET_MACHINE_STACK_END(&ec->machine.stack_end)
-
-#define STACK_START (ec->machine.stack_start)
-#define STACK_END (ec->machine.stack_end)
-#define STACK_LEVEL_MAX (ec->machine.stack_maxsize/sizeof(VALUE))
-
-#ifdef __EMSCRIPTEN__
-#undef STACK_GROW_DIRECTION
-#define STACK_GROW_DIRECTION 1
+#ifdef __ia64
+#define SET_STACK_END (SET_MACHINE_STACK_END(&th->machine.stack_end), th->machine.register_stack_end = rb_ia64_bsp())
+#else
+#define SET_STACK_END SET_MACHINE_STACK_END(&th->machine.stack_end)
#endif
+#define STACK_START (th->machine.stack_start)
+#define STACK_END (th->machine.stack_end)
+#define STACK_LEVEL_MAX (th->machine.stack_maxsize/sizeof(VALUE))
+
#if STACK_GROW_DIRECTION < 0
# define STACK_LENGTH (size_t)(STACK_START - STACK_END)
#elif STACK_GROW_DIRECTION > 0
@@ -4630,57 +3642,50 @@ 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;
-
- size_t length = STACK_LENGTH;
- size_t maximum_length = STACK_LEVEL_MAX - water_mark;
-
- return length > maximum_length;
+ ret = STACK_LENGTH > STACK_LEVEL_MAX - water_mark;
+#ifdef __ia64
+ if (!ret) {
+ ret = (VALUE*)rb_ia64_bsp() - th->machine.register_stack_start >
+ th->machine.register_stack_maxsize/sizeof(VALUE) - water_mark;
+ }
+#endif
+ return ret;
}
-#else
-#define stack_check(ec, water_mark) FALSE
#endif
-#define STACKFRAME_FOR_CALL_CFUNC 2048
-
-MJIT_FUNC_EXPORTED 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(static void mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n));
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
static void
mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n)
{
VALUE v;
while (n--) {
v = *x;
- gc_mark_maybe(objspace, v);
+ gc_mark_maybe(objspace, v);
x++;
}
}
@@ -4701,97 +3706,55 @@ 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)
-{
- long i;
-
- for (i=0; i<n; i++) {
- gc_mark(objspace, values[i]);
- }
-}
-
void
rb_gc_mark_values(long n, const VALUE *values)
{
- long i;
rb_objspace_t *objspace = &rb_objspace;
-
- for (i=0; i<n; i++) {
- gc_mark_and_pin(objspace, values[i]);
- }
-}
-
-static void
-gc_mark_and_pin_stack_values(rb_objspace_t *objspace, long n, const VALUE *values)
-{
long i;
for (i=0; i<n; i++) {
- /* skip MOVED objects that are on the stack */
- if (is_markable_object(objspace, values[i]) && T_MOVED != BUILTIN_TYPE(values[i])) {
- gc_mark_and_pin(objspace, values[i]);
- }
+ gc_mark(objspace, values[i]);
}
}
-void
-rb_gc_mark_vm_stack_values(long n, const VALUE *values)
-{
- rb_objspace_t *objspace = &rb_objspace;
- gc_mark_and_pin_stack_values(objspace, n, values);
-}
+#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end))
-static int
-mark_value(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);
- return ST_CONTINUE;
-}
+struct mark_tbl_arg {
+ rb_objspace_t *objspace;
+};
static int
-mark_value_pin(st_data_t key, st_data_t value, st_data_t data)
+mark_entry(st_data_t key, st_data_t value, st_data_t data)
{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
- gc_mark_and_pin(objspace, (VALUE)value);
+ struct mark_tbl_arg *arg = (void*)data;
+ gc_mark(arg->objspace, (VALUE)value);
return ST_CONTINUE;
}
static void
-mark_tbl_no_pin(rb_objspace_t *objspace, st_table *tbl)
-{
- if (!tbl || tbl->num_entries == 0) return;
- st_foreach(tbl, mark_value, (st_data_t)objspace);
-}
-
-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_value_pin, (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_and_pin(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);
-}
-
-static void
-mark_finalizer_tbl(rb_objspace_t *objspace, st_table *tbl)
-{
- if (!tbl) return;
- st_foreach(tbl, mark_value, (st_data_t)objspace);
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_key, (st_data_t)&arg);
}
void
@@ -4803,65 +3766,25 @@ 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);
- return ST_CONTINUE;
-}
-
-static int
-pin_key_pin_value(st_data_t key, st_data_t value, st_data_t data)
-{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
-
- gc_mark_and_pin(objspace, (VALUE)key);
- gc_mark_and_pin(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 int
-pin_key_mark_value(st_data_t key, st_data_t value, st_data_t data)
-{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
-
- gc_mark_and_pin(objspace, (VALUE)key);
- gc_mark(objspace, (VALUE)value);
- return ST_CONTINUE;
-}
-
-static void
-mark_hash(rb_objspace_t *objspace, VALUE hash)
-{
- if (rb_hash_compare_by_id_p(hash)) {
- rb_hash_stlike_foreach(hash, pin_key_mark_value, (st_data_t)objspace);
- }
- else {
- rb_hash_stlike_foreach(hash, mark_keyvalue, (st_data_t)objspace);
- }
-
- if (RHASH_AR_TABLE_P(hash)) {
- if (objspace->mark_func_data == NULL && RHASH_TRANSIENT_P(hash)) {
- rb_transient_heap_mark(hash, RHASH_AR_TABLE(hash));
- }
- }
- else {
- VM_ASSERT(!RHASH_TRANSIENT_P(hash));
- }
- gc_mark(objspace, RHASH(hash)->ifnone);
-}
-
static void
-mark_st(rb_objspace_t *objspace, st_table *tbl)
+mark_hash(rb_objspace_t *objspace, st_table *tbl)
{
+ struct mark_tbl_arg arg;
if (!tbl) return;
- st_foreach(tbl, pin_key_pin_value, (st_data_t)objspace);
+ arg.objspace = objspace;
+ st_foreach(tbl, mark_keyvalue, (st_data_t)&arg);
}
void
rb_mark_hash(st_table *tbl)
{
- mark_st(&rb_objspace, tbl);
+ mark_hash(&rb_objspace, tbl);
}
static void
@@ -4869,74 +3792,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.bmethod.proc);
- if (def->body.bmethod.hooks) rb_hook_list_mark(def->body.bmethod.hooks);
- 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
@@ -4949,11 +3877,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;
@@ -4962,7 +3887,6 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_execution_context_t *ec
VALUE *stack_start, *stack_end;
FLUSH_REGISTER_WINDOWS;
- memset(&save_regs_gc_mark, 0, sizeof(save_regs_gc_mark));
/* This assumes that all registers are saved into the jmp_buf (and stack) */
rb_setjmp(save_regs_gc_mark.j);
@@ -4974,30 +3898,30 @@ 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__)
+ rb_gc_mark_locations((VALUE*)((char*)stack_start + 2),
+ (VALUE*)((char*)stack_end - 2));
+#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
+ rb_gc_mark_locations(th->machine.register_stack_start, th->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((VALUE*)((char*)stack_start + 2),
+ (VALUE*)((char*)stack_end - 2));
#endif
}
@@ -5007,36 +3931,15 @@ rb_mark_tbl(st_table *tbl)
mark_tbl(&rb_objspace, tbl);
}
-void
-rb_mark_tbl_no_pin(st_table *tbl)
-{
- mark_tbl_no_pin(&rb_objspace, tbl);
-}
-
static void
gc_mark_maybe(rb_objspace_t *objspace, VALUE obj)
{
(void)VALGRIND_MAKE_MEM_DEFINED(&obj, sizeof(obj));
-
if (is_pointer_to_heap(objspace, (void *)obj)) {
- void *ptr = __asan_region_is_poisoned((void *)obj, SIZEOF_VALUE);
- asan_unpoison_object(obj, false);
-
- /* Garbage can live on the stack, so do not mark or pin */
- switch (BUILTIN_TYPE(obj)) {
- case T_MOVED:
- case T_ZOMBIE:
- case T_NONE:
- break;
- default:
- gc_mark_and_pin(objspace, obj);
- break;
- }
-
- if (ptr) {
- GC_ASSERT(BUILTIN_TYPE(obj) == T_NONE);
- asan_poison_object(obj);
- }
+ int type = BUILTIN_TYPE(obj);
+ if (type != T_ZOMBIE && type != T_NONE) {
+ gc_mark_ptr(objspace, obj);
+ }
}
}
@@ -5059,12 +3962,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++;
@@ -5115,7 +4018,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
}
@@ -5142,17 +4045,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);
@@ -5161,15 +4068,12 @@ 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)
{
if (LIKELY(objspace->mark_func_data == NULL)) {
rgengc_check_relation(objspace, obj);
if (!gc_mark_set(objspace, obj)) return; /* already marked */
- if (RB_TYPE_P(obj, T_NONE)) rb_bug("try to mark T_NONE object"); /* check here will help debugging */
gc_aging(objspace, obj);
gc_grey(objspace, obj);
}
@@ -5178,24 +4082,7 @@ gc_mark_ptr(rb_objspace_t *objspace, VALUE obj)
}
}
-static inline void
-gc_pin(rb_objspace_t *objspace, VALUE obj)
-{
- GC_ASSERT(is_markable_object(objspace, obj));
- if (UNLIKELY(objspace->flags.during_compacting)) {
- MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj);
- }
-}
-
-static inline void
-gc_mark_and_pin(rb_objspace_t *objspace, VALUE obj)
-{
- if (!is_markable_object(objspace, obj)) return;
- gc_pin(objspace, obj);
- gc_mark_ptr(objspace, obj);
-}
-
-static inline void
+static void
gc_mark(rb_objspace_t *objspace, VALUE obj)
{
if (!is_markable_object(objspace, obj)) return;
@@ -5203,15 +4090,9 @@ gc_mark(rb_objspace_t *objspace, VALUE obj)
}
void
-rb_gc_mark_movable(VALUE ptr)
-{
- gc_mark(&rb_objspace, ptr);
-}
-
-void
rb_gc_mark(VALUE ptr)
{
- gc_mark_and_pin(&rb_objspace, ptr);
+ gc_mark(&rb_objspace, ptr);
}
/* CAUTION: THIS FUNCTION ENABLE *ONLY BEFORE* SWEEPING.
@@ -5238,69 +4119,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_tmpbuf:
- {
- const rb_imemo_tmpbuf_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);
@@ -5311,75 +4129,46 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
}
switch (BUILTIN_TYPE(obj)) {
- case T_FLOAT:
- case T_BIGNUM:
- case T_SYMBOL:
- /* Not immediates, but does not have references and singleton
- * class */
- return;
-
case T_NIL:
case T_FIXNUM:
rb_bug("rb_gc_mark() called for broken object");
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:
- if (RCLASS_SUPER(obj)) {
- gc_mark(objspace, RCLASS_SUPER(obj));
- }
+ mark_m_tbl_wrapper(objspace, RCLASS_M_TBL_WRAPPER(obj));
if (!RCLASS_EXT(obj)) break;
- mark_m_tbl(objspace, RCLASS_M_TBL(obj));
- mark_tbl_no_pin(objspace, RCLASS_IV_TBL(obj));
+ mark_tbl(objspace, RCLASS_IV_TBL(obj));
mark_const_tbl(objspace, RCLASS_CONST_TBL(obj));
- break;
-
- case T_ICLASS:
- if (FL_TEST(obj, RICLASS_IS_ORIGIN)) {
- mark_m_tbl(objspace, RCLASS_M_TBL(obj));
- }
- if (RCLASS_SUPER(obj)) {
- gc_mark(objspace, RCLASS_SUPER(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)) {
- VALUE root = any->as.array.as.heap.aux.shared_root;
- gc_mark(objspace, root);
+ if (FL_TEST(obj, ELTS_SHARED)) {
+ gc_mark(objspace, any->as.array.as.heap.aux.shared);
}
else {
long i, len = RARRAY_LEN(obj);
- const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(obj);
+ const VALUE *ptr = RARRAY_CONST_PTR(obj);
for (i=0; i < len; i++) {
- gc_mark(objspace, ptr[i]);
+ gc_mark(objspace, *ptr++);
}
-
- if (objspace->mark_func_data == NULL) {
- if (!FL_TEST_RAW(obj, RARRAY_EMBED_FLAG) &&
- RARRAY_TRANSIENT_P(obj)) {
- rb_transient_heap_mark(obj, ptr);
- }
- }
- }
+ }
break;
case T_HASH:
- mark_hash(objspace, obj);
+ mark_hash(objspace, any->as.hash.ntbl);
+ gc_mark(objspace, any->as.hash.ifnone);
break;
case T_STRING:
@@ -5389,31 +4178,21 @@ 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:
{
- const VALUE * const ptr = ROBJECT_IVPTR(obj);
-
- if (ptr) {
- uint32_t i, len = ROBJECT_NUMIV(obj);
- for (i = 0; i < len; i++) {
- gc_mark(objspace, ptr[i]);
- }
-
- if (objspace->mark_func_data == NULL &&
- ROBJ_TRANSIENT_P(obj)) {
- rb_transient_heap_mark(obj, ptr);
- }
+ long i, len = ROBJECT_NUMIV(obj);
+ VALUE *ptr = ROBJECT_IVPTR(obj);
+ for (i = 0; i < len; i++) {
+ gc_mark(objspace, *ptr++);
}
}
break;
@@ -5433,6 +4212,11 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
gc_mark(objspace, any->as.regexp.src);
break;
+ case T_FLOAT:
+ case T_BIGNUM:
+ case T_SYMBOL:
+ break;
+
case T_MATCH:
gc_mark(objspace, any->as.match.regexp);
if (any->as.match.str) {
@@ -5452,18 +4236,12 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
case T_STRUCT:
{
- long i;
- const long len = RSTRUCT_LEN(obj);
- const VALUE * const ptr = RSTRUCT_CONST_PTR(obj);
-
- for (i=0; i<len; i++) {
- gc_mark(objspace, ptr[i]);
- }
+ long len = RSTRUCT_LEN(obj);
+ const VALUE *ptr = RSTRUCT_CONST_PTR(obj);
- if (objspace->mark_func_data == NULL &&
- RSTRUCT_TRANSIENT_P(obj)) {
- rb_transient_heap_mark(obj, ptr);
- }
+ while (len--) {
+ gc_mark(objspace, *ptr++);
+ }
}
break;
@@ -5471,11 +4249,10 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
#if GC_DEBUG
rb_gcdebug_print_obj_condition((VALUE)obj);
#endif
- if (BUILTIN_TYPE(obj) == T_MOVED) rb_bug("rb_gc_mark(): %p is T_MOVED", (void *)obj);
if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("rb_gc_mark(): %p is T_NONE", (void *)obj);
if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("rb_gc_mark(): %p is T_ZOMBIE", (void *)obj);
rb_bug("rb_gc_mark(): unknown data type 0x%x(%p) %s",
- BUILTIN_TYPE(obj), (void *)any,
+ BUILTIN_TYPE(obj), any,
is_pointer_to_heap(objspace, any) ? "corrupted object" : "non object");
}
}
@@ -5490,7 +4267,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 marked_slots_at_the_beggining = objspace->marked_slots;
size_t popped_count = 0;
#endif
@@ -5510,7 +4287,7 @@ gc_mark_stacked_objects(rb_objspace_t *objspace, int incremental, size_t count)
CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS(obj), obj);
popped_count++;
- if (popped_count + (objspace->marked_slots - marked_slots_at_the_beginning) > count) {
+ if (popped_count + (objspace->marked_slots - marked_slots_at_the_beggining) > count) {
break;
}
}
@@ -5520,7 +4297,9 @@ gc_mark_stacked_objects(rb_objspace_t *objspace, int incremental, size_t count)
#endif
}
- if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(objspace);
+ if (RGENGC_CHECK_MODE >= 3) {
+ gc_verify_internal_consistency(Qnil);
+ }
if (is_mark_stack_empty(mstack)) {
shrink_stack_chunk_cache(mstack);
@@ -5564,14 +4343,18 @@ show_mark_ticks(void)
}
}
-#endif /* PRINT_ROOT_TICKS */
+#endif /* PRITNT_ROOT_TICKS */
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();
@@ -5583,12 +4366,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) { \
@@ -5600,7 +4377,7 @@ gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
prev_category = category; \
start_tick = tick(); \
} while (0)
-#else /* PRINT_ROOT_TICKS */
+#else /* PRITNT_ROOT_TICKS */
#define MARK_CHECKPOINT_PRINT_TICK(category)
#endif
@@ -5611,19 +4388,22 @@ 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(objspace, th->vm->self);
MARK_CHECKPOINT("finalizers");
- mark_finalizer_tbl(objspace, finalizer_table);
+ 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();
/* mark protected global variables */
MARK_CHECKPOINT("global_list");
for (list = global_list; list; list = list->next) {
- gc_mark_maybe(objspace, *list->varptr);
+ rb_gc_mark_maybe(*list->varptr);
}
MARK_CHECKPOINT("end_proc");
@@ -5632,11 +4412,12 @@ gc_mark_roots(rb_objspace_t *objspace, const char **categoryp)
MARK_CHECKPOINT("global_tbl");
rb_gc_mark_global_tbl();
- MARK_CHECKPOINT("object_id");
- rb_gc_mark(objspace->next_object_id);
- mark_tbl_no_pin(objspace, objspace->obj_to_id_tbl); /* Only mark ids */
+ /* mark generic instance variables for special constants */
+ MARK_CHECKPOINT("generic_ivars");
+ rb_mark_generic_ivar_tbl();
- if (stress_to_class) rb_gc_mark(stress_to_class);
+ MARK_CHECKPOINT("live_method_entries");
+ rb_gc_mark_unlinked_live_method_entries(th->vm);
MARK_CHECKPOINT("finish");
#undef MARK_CHECKPOINT
@@ -5700,7 +4481,7 @@ reflist_dump(struct reflist *refs)
}
static int
-reflist_referred_from_machine_context(struct reflist *refs)
+reflist_refered_from_machine_context(struct reflist *refs)
{
int i;
for (i=0; i<refs->pos; i++) {
@@ -5796,7 +4577,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);
@@ -5806,7 +4587,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);
}
@@ -5843,7 +4624,7 @@ gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
fprintf(stderr, "gc_check_after_marks_i: %p is referred from ", (void *)obj);
reflist_dump(refs);
- if (reflist_referred_from_machine_context(refs)) {
+ if (reflist_refered_from_machine_context(refs)) {
fprintf(stderr, " (marked from machine stack).\n");
/* marked from machine context can be false positive */
}
@@ -5856,7 +4637,7 @@ gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
}
static void
-gc_marks_check(rb_objspace_t *objspace, st_foreach_callback_func *checker_func, const char *checker_name)
+gc_marks_check(rb_objspace_t *objspace, int (*checker_func)(ANYARGS), const char *checker_name)
{
size_t saved_malloc_increase = objspace->malloc_params.increase;
#if RGENGC_ESTIMATE_OLDMALLOC
@@ -5908,12 +4689,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++;
}
@@ -5937,14 +4718,7 @@ check_color_i(const VALUE child, void *ptr)
static void
check_children_i(const VALUE child, void *ptr)
{
- struct verify_internal_consistency_struct *data = (struct verify_internal_consistency_struct *)ptr;
- if (check_rvalue_consistency_force(child, FALSE) != 0) {
- fprintf(stderr, "check_children_i: %s has error (referenced from %s)",
- obj_info(child), obj_info(data->parent));
- rb_print_backtrace(); /* C backtrace will help to debug */
-
- data->err_count++;
- }
+ check_rvalue_consistency(child);
}
static int
@@ -5955,25 +4729,18 @@ verify_internal_consistency_i(void *page_start, void *page_end, size_t stride, v
rb_objspace_t *objspace = data->objspace;
for (obj = (VALUE)page_start; obj != (VALUE)page_end; obj += stride) {
- void *poisoned = asan_poisoned_object_p(obj);
- asan_unpoison_object(obj, false);
-
if (is_live_object(objspace, obj)) {
/* count objects */
data->live_object_count++;
- data->parent = obj;
- /* Normally, we don't expect T_MOVED objects to be in the heap.
- * But they can stay alive on the stack, */
- if (!gc_object_moved_p(objspace, obj)) {
- /* moved slots don't have children */
- rb_objspace_reachable_objects_from(obj, check_children_i, (void *)data);
- }
+ rb_objspace_reachable_objects_from(obj, check_children_i, (void *)data);
#if USE_RGENGC
/* check health of children */
+ data->parent = obj;
+
if (RVALUE_OLD_P(obj)) data->old_object_count++;
- if (RVALUE_WB_UNPROTECTED(obj) && RVALUE_UNCOLLECTIBLE(obj)) data->remembered_shady_count++;
+ if (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) */
@@ -5992,14 +4759,10 @@ 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 & ~FL_SEEN_OBJ_ID) == T_ZOMBIE);
+ if (RGENGC_CHECK_MODE) assert(RBASIC(obj)->flags == T_ZOMBIE);
data->zombie_object_count++;
}
}
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(obj) == T_NONE);
- asan_poison_object(obj);
- }
}
return 0;
@@ -6012,100 +4775,54 @@ gc_verify_heap_page(rb_objspace_t *objspace, struct heap_page *page, VALUE obj)
int i;
unsigned int has_remembered_shady = FALSE;
unsigned int has_remembered_old = FALSE;
- int remembered_old_objects = 0;
- int free_objects = 0;
- int zombie_objects = 0;
+ int rememberd_old_objects = 0;
for (i=0; i<page->total_slots; i++) {
- VALUE val = (VALUE)&page->start[i];
- void *poisoned = asan_poisoned_object_p(val);
- asan_unpoison_object(val, false);
-
- 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;
- remembered_old_objects++;
+ rememberd_old_objects++;
}
-
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(val) == T_NONE);
- asan_poison_object(val);
- }
}
if (!is_incremental_marking(objspace) &&
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",
- (void *)page, remembered_old_objects, obj ? obj_info(obj) : "");
+ 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",
- (void *)page, obj ? obj_info(obj) : "");
+ 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", (void *)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", (void *)page, (int)page->final_slots, zombie_objects);
- }
-
- return remembered_old_objects;
+ return rememberd_old_objects;
#else
return 0;
#endif
}
static int
-gc_verify_heap_pages_(rb_objspace_t *objspace, struct list_head *head)
-{
- int remembered_old_objects = 0;
- struct heap_page *page = 0;
-
- list_for_each(head, page, page_node) {
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
- RVALUE *p = page->freelist;
- while (p) {
- RVALUE *prev = p;
- asan_unpoison_object((VALUE)p, false);
- if (BUILTIN_TYPE(p) != T_NONE) {
- fprintf(stderr, "freelist slot expected to be T_NONE but was: %s\n", obj_info((VALUE)p));
- }
- p = p->as.free.next;
- asan_poison_object((VALUE)prev);
- }
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
+gc_verify_heap_pages(rb_objspace_t *objspace)
+{
+ int rememberd_old_objects = 0;
+ struct heap_page *page = heap_eden->pages;
- if (page->flags.has_remembered_objects == FALSE) {
- remembered_old_objects += gc_verify_heap_page(objspace, page, Qfalse);
- }
+ while (page) {
+ if (page->flags.has_remembered_objects == FALSE)
+ rememberd_old_objects += gc_verify_heap_page(objspace, page, Qfalse);
+ page = page->next;
}
- return remembered_old_objects;
-}
-
-static int
-gc_verify_heap_pages(rb_objspace_t *objspace)
-{
- int remembered_old_objects = 0;
- remembered_old_objects += gc_verify_heap_pages_(objspace, &heap_eden->pages);
- remembered_old_objects += gc_verify_heap_pages_(objspace, &heap_tomb->pages);
- return remembered_old_objects;
+ return rememberd_old_objects;
}
/*
@@ -6119,24 +4836,20 @@ gc_verify_heap_pages(rb_objspace_t *objspace)
* if RGenGC is supported.
*/
static VALUE
-gc_verify_internal_consistency_m(VALUE dummy)
-{
- gc_verify_internal_consistency(&rb_objspace);
-
- return Qnil;
-}
-
-static void
-gc_verify_internal_consistency(rb_objspace_t *objspace)
+gc_verify_internal_consistency(VALUE self)
{
+ rb_objspace_t *objspace = &rb_objspace;
struct verify_internal_consistency_struct data = {0};
+ struct each_obj_args eo_args;
data.objspace = objspace;
gc_report(5, objspace, "gc_verify_internal_consistency: start\n");
/* check relations */
- objspace_each_objects_without_setup(objspace, verify_internal_consistency_i, &data);
+ eo_args.callback = verify_internal_consistency_i;
+ eo_args.data = (void *)&data;
+ objspace_each_objects((VALUE)&eo_args);
if (data.err_count != 0) {
#if RGENGC_CHECK_MODE >= 5
@@ -6156,17 +4869,17 @@ gc_verify_internal_consistency(rb_objspace_t *objspace)
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
@@ -6196,18 +4909,7 @@ gc_verify_internal_consistency(rb_objspace_t *objspace)
}
gc_report(5, objspace, "gc_verify_internal_consistency: OK\n");
-}
-void
-rb_gc_verify_internal_consistency(void)
-{
- gc_verify_internal_consistency(&rb_objspace);
-}
-
-static VALUE
-gc_verify_transient_heap_internal_consistency(VALUE dmy)
-{
- rb_transient_heap_verify();
return Qnil;
}
@@ -6218,19 +4920,19 @@ 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);
#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->rincgc.step_slots = (objspace->marked_slots * 2) / ((objspace->rincgc.pooled_slots / HEAP_OBJ_LIMIT) + 1);
if (0) fprintf(stderr, "objspace->marked_slots: %d, objspace->rincgc.pooled_page_num: %d, objspace->rincgc.step_slots: %d, \n",
(int)objspace->marked_slots, (int)objspace->rincgc.pooled_slots, (int)objspace->rincgc.step_slots);
#endif
objspace->flags.during_minor_gc = FALSE;
objspace->profile.major_gc_count++;
- objspace->rgengc.uncollectible_wb_unprotected_objects = 0;
+ objspace->rgengc.remembered_wb_unprotected_objects = 0;
objspace->rgengc.old_objects = 0;
objspace->rgengc.last_major_gc = objspace->profile.count;
objspace->marked_slots = 0;
@@ -6239,7 +4941,8 @@ gc_marks_start(rb_objspace_t *objspace, int full_mark)
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);
}
@@ -6254,16 +4957,16 @@ gc_marks_start(rb_objspace_t *objspace, int full_mark)
static void
gc_marks_wb_unprotected_objects(rb_objspace_t *objspace)
{
- struct heap_page *page = 0;
+ struct heap_page *page = heap_eden->pages;
- list_for_each(&heap_eden->pages, page, page_node) {
+ while (page) {
bits_t *mark_bits = page->mark_bits;
bits_t *wbun_bits = page->wb_unprotected_bits;
RVALUE *p = page->start;
RVALUE *offset = p - NUM_IN_PAGE(p);
size_t j;
- for (j=0; j<HEAP_PAGE_BITMAP_LIMIT; j++) {
+ for (j=0; j<HEAP_BITMAP_LIMIT; j++) {
bits_t bits = mark_bits[j] & wbun_bits[j];
if (bits) {
@@ -6272,8 +4975,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++;
@@ -6281,6 +4986,8 @@ gc_marks_wb_unprotected_objects(rb_objspace_t *objspace)
} while (bits);
}
}
+
+ page = page->next;
}
gc_mark_stacked_objects_all(objspace);
@@ -6293,7 +5000,8 @@ heap_move_pooled_pages_to_free_pages(rb_heap_t *heap)
if (page) {
heap->pooled_pages = page->free_next;
- heap_add_freepage(heap, page);
+ page->free_next = heap->free_pages;
+ heap->free_pages = page;
}
return page;
@@ -6336,14 +5044,14 @@ gc_marks_finish(rb_objspace_t *objspace)
#endif /* GC_ENABLE_INCREMENTAL_MARK */
#if RGENGC_CHECK_MODE >= 2
- gc_verify_internal_consistency(objspace);
+ gc_verify_internal_consistency(Qnil);
#endif
#if USE_RGENGC
if (is_full_marking(objspace)) {
/* See the comment about RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR */
const double r = gc_params.oldobject_limit_factor;
- objspace->rgengc.uncollectible_wb_unprotected_objects_limit = (size_t)(objspace->rgengc.uncollectible_wb_unprotected_objects * r);
+ objspace->rgengc.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
@@ -6352,59 +5060,36 @@ 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;
+ size_t sweep_slots =
+ (heap_allocatable_pages * HEAP_OBJ_LIMIT) + /* allocatable slots in empty pages */
+ (heap->total_slots - objspace->marked_slots); /* will be sweep slots */
- if (sweep_slots > max_free_slots) {
- heap_pages_freeable_pages = (sweep_slots - max_free_slots) / HEAP_PAGE_OBJ_LIMIT;
- }
- else {
- heap_pages_freeable_pages = 0;
- }
-
- /* 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) {
@@ -6417,27 +5102,19 @@ gc_marks_finish(rb_objspace_t *objspace)
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
}
- rb_transient_heap_finish_marking();
-
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_END_MARK, 0);
return TRUE;
}
+#if GC_ENABLE_INCREMENTAL_MARK
static void
gc_marks_step(rb_objspace_t *objspace, int slots)
{
-#if GC_ENABLE_INCREMENTAL_MARK
- 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)) {
@@ -6446,8 +5123,8 @@ gc_marks_step(rb_objspace_t *objspace, int slots)
}
}
if (0) fprintf(stderr, "objspace->marked_slots: %d\n", (int)objspace->marked_slots);
-#endif
}
+#endif
static void
gc_marks_rest(rb_objspace_t *objspace)
@@ -6472,21 +5149,21 @@ 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)
{
- GC_ASSERT(dont_gc == FALSE);
-#if GC_ENABLE_INCREMENTAL_MARK
+ int slots = 0;
+ const char *from;
+
+ if (RGENGC_CHECK_MODE) assert(dont_gc == FALSE);
gc_enter(objspace, "marks_continue");
PUSH_MARK_FUNC_DATA(NULL);
{
- int slots = 0;
- const char *from;
-
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;
}
@@ -6509,8 +5186,8 @@ gc_marks_continue(rb_objspace_t *objspace, rb_heap_t *heap)
POP_MARK_FUNC_DATA();
gc_exit(objspace, "marks_continue");
-#endif
}
+#endif
static void
gc_marks(rb_objspace_t *objspace, int full_mark)
@@ -6593,7 +5270,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;
@@ -6635,18 +5312,12 @@ rgengc_remember(rb_objspace_t *objspace, VALUE obj)
}
static int
-rgengc_remembered_sweep(rb_objspace_t *objspace, VALUE obj)
+rgengc_remembered(rb_objspace_t *objspace, VALUE obj)
{
int result = rgengc_remembersetbits_get(objspace, obj);
check_rvalue_consistency(obj);
- return result;
-}
-
-static int
-rgengc_remembered(rb_objspace_t *objspace, VALUE obj)
-{
gc_report(6, objspace, "rgengc_remembered: %s\n", obj_info(obj));
- return rgengc_remembered_sweep(objspace, obj);
+ return result;
}
#ifndef PROFILE_REMEMBERSET_MARK
@@ -6657,32 +5328,32 @@ static void
rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap)
{
size_t j;
- struct heap_page *page = 0;
+ struct heap_page *page = heap->pages;
#if PROFILE_REMEMBERSET_MARK
int has_old = 0, has_shady = 0, has_both = 0, skip = 0;
#endif
gc_report(1, objspace, "rgengc_rememberset_mark: start\n");
- list_for_each(&heap->pages, page, page_node) {
- if (page->flags.has_remembered_objects | page->flags.has_uncollectible_shady_objects) {
+ while (page) {
+ 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) {
@@ -6692,8 +5363,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);
}
@@ -6708,6 +5382,8 @@ rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap)
skip++;
}
#endif
+
+ page = page->next;
}
#if PROFILE_REMEMBERSET_MARK
@@ -6719,53 +5395,35 @@ rgengc_rememberset_mark(rb_objspace_t *objspace, rb_heap_t *heap)
static void
rgengc_mark_and_rememberset_clear(rb_objspace_t *objspace, rb_heap_t *heap)
{
- struct heap_page *page = 0;
+ struct heap_page *page = heap->pages;
- list_for_each(&heap->pages, page, page_node) {
- memset(&page->mark_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
- memset(&page->uncollectible_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
- memset(&page->marking_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
- memset(&page->pinned_bits[0], 0, HEAP_PAGE_BITMAP_SIZE);
- page->flags.has_uncollectible_shady_objects = FALSE;
+ while (page) {
+ 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;
}
}
/* 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
@@ -6779,60 +5437,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 (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(b)) {
- gc_grey(objspace, 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)
@@ -6863,7 +5510,6 @@ rb_gc_writebarrier_unprotect(VALUE obj)
RVALUE_AGE_RESET(obj);
}
- RB_DEBUG_COUNTER_INC(obj_wb_unprotect);
MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(obj), obj);
}
}
@@ -6871,7 +5517,7 @@ rb_gc_writebarrier_unprotect(VALUE obj)
/*
* remember `obj' if needed.
*/
-MJIT_FUNC_EXPORTED void
+void
rb_gc_writebarrier_remember(VALUE obj)
{
rb_objspace_t *objspace = &rb_objspace;
@@ -6926,8 +5572,8 @@ 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);
}
@@ -6938,16 +5584,9 @@ 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);
+ RVALUE_AGE_RESET_RAW(dest);
}
check_rvalue_consistency(dest);
@@ -6978,7 +5617,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, ID_pinned;
+ static ID ID_wb_protected, ID_old, ID_marking, ID_long_lived;
#endif
if (!ID_marked) {
@@ -6988,8 +5627,7 @@ rb_obj_gc_flags(VALUE obj, ID* flags, size_t max)
I(wb_protected);
I(old);
I(marking);
- I(uncollectible);
- I(pinned);
+ I(long_lived);
#endif
#undef I
}
@@ -6997,11 +5635,10 @@ 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;
- if (MARKED_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj) && n<max) flags[n++] = ID_pinned;
return n;
}
@@ -7022,7 +5659,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
@@ -7062,7 +5699,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) {
@@ -7159,7 +5796,8 @@ gc_reset_malloc_info(rb_objspace_t *objspace)
if (inc > malloc_limit) {
malloc_limit = (size_t)(inc * gc_params.malloc_limit_growth_factor);
- if (malloc_limit > gc_params.malloc_limit_max) {
+ if (gc_params.malloc_limit_max > 0 && /* ignore max-check if 0 */
+ malloc_limit > gc_params.malloc_limit_max) {
malloc_limit = gc_params.malloc_limit_max;
}
}
@@ -7186,7 +5824,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);
@@ -7218,7 +5856,7 @@ gc_reset_malloc_info(rb_objspace_t *objspace)
}
static int
-garbage_collect(rb_objspace_t *objspace, int reason)
+garbage_collect(rb_objspace_t *objspace, int full_mark, int immediate_mark, int immediate_sweep, int reason)
{
#if GC_PROFILE_MORE_DETAIL
objspace->profile.prepare_time = getrusage_time();
@@ -7230,27 +5868,26 @@ garbage_collect(rb_objspace_t *objspace, int reason)
objspace->profile.prepare_time = getrusage_time() - objspace->profile.prepare_time;
#endif
- return gc_start(objspace, reason);
+ return gc_start(objspace, full_mark, immediate_mark, immediate_sweep, reason);
}
static int
-gc_start(rb_objspace_t *objspace, int reason)
+gc_start(rb_objspace_t *objspace, const int full_mark, const int immediate_mark, const unsigned int immediate_sweep, int reason)
{
- unsigned int do_full_mark = !!((unsigned)reason & GPR_FLAG_FULL_MARK);
- unsigned int immediate_mark = (unsigned)reason & GPR_FLAG_IMMEDIATE_MARK;
-
- /* reason may be clobbered, later, so keep set immediate_sweep here */
- objspace->flags.immediate_sweep = !!((unsigned)reason & GPR_FLAG_IMMEDIATE_SWEEP);
+ 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(objspace);
+ gc_verify_internal_consistency(Qnil);
#endif
+ }
gc_enter(objspace, "gc_start");
@@ -7297,41 +5934,19 @@ gc_start(rb_objspace_t *objspace, int reason)
if (objspace->flags.immediate_sweep) reason |= GPR_FLAG_IMMEDIATE_SWEEP;
- gc_report(1, objspace, "gc_start(reason: %d) => %u, %d, %d\n",
- reason,
+ gc_report(1, objspace, "gc_start(%d, %d, %d, reason: %d) => %d, %d, %d\n",
+ full_mark, immediate_mark, immediate_sweep, reason,
do_full_mark, !is_incremental_marking(objspace), objspace->flags.immediate_sweep);
-#if USE_DEBUG_COUNTER
- RB_DEBUG_COUNTER_INC(gc_count);
-
- if (reason & GPR_FLAG_MAJOR_MASK) {
- (void)RB_DEBUG_COUNTER_INC_IF(gc_major_nofree, reason & GPR_FLAG_MAJOR_BY_NOFREE);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_major_oldgen, reason & GPR_FLAG_MAJOR_BY_OLDGEN);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_major_shady, reason & GPR_FLAG_MAJOR_BY_SHADY);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_major_force, reason & GPR_FLAG_MAJOR_BY_FORCE);
-#if RGENGC_ESTIMATE_OLDMALLOC
- (void)RB_DEBUG_COUNTER_INC_IF(gc_major_oldmalloc, reason & GPR_FLAG_MAJOR_BY_OLDMALLOC);
-#endif
- }
- else {
- (void)RB_DEBUG_COUNTER_INC_IF(gc_minor_newobj, reason & GPR_FLAG_NEWOBJ);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_minor_malloc, reason & GPR_FLAG_MALLOC);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_minor_method, reason & GPR_FLAG_METHOD);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_minor_capi, reason & GPR_FLAG_CAPI);
- (void)RB_DEBUG_COUNTER_INC_IF(gc_minor_stress, reason & GPR_FLAG_STRESS);
- }
-#endif
-
objspace->profile.count++;
objspace->profile.latest_gc_info = reason;
objspace->profile.total_allocated_objects_at_gc_start = objspace->total_allocated_objects;
objspace->profile.heap_used_at_gc_start = heap_allocated_pages;
gc_prof_setup_new_record(objspace, reason);
gc_reset_malloc_info(objspace);
- rb_transient_heap_start_marking(do_full_mark);
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);
{
@@ -7352,7 +5967,7 @@ gc_rest(rb_objspace_t *objspace)
if (marking || sweeping) {
gc_enter(objspace, "gc_rest");
- if (RGENGC_CHECK_MODE >= 2) gc_verify_internal_consistency(objspace);
+ if (RGENGC_CHECK_MODE >= 2) gc_verify_internal_consistency(Qnil);
if (is_incremental_marking(objspace)) {
PUSH_MARK_FUNC_DATA(NULL);
@@ -7369,6 +5984,9 @@ gc_rest(rb_objspace_t *objspace)
struct objspace_and_reason {
rb_objspace_t *objspace;
int reason;
+ int full_mark;
+ int immediate_mark;
+ int immediate_sweep;
};
static void
@@ -7452,13 +6070,11 @@ 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 >= 3) gc_verify_internal_consistency(objspace);
-
- mjit_gc_start_hook();
+ if (RGENGC_CHECK_MODE) assert(during_gc == 0);
+ if (RGENGC_CHECK_MODE >= 3) gc_verify_internal_consistency(Qnil);
during_gc = TRUE;
- gc_report(1, objspace, "gc_enter: %s [%s]\n", event, gc_current_status(objspace));
+ gc_report(1, objspace, "gc_entr: %s [%s]\n", event, gc_current_status(objspace));
gc_record(objspace, 0, event);
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_ENTER, 0); /* TODO: which parameter should be passed? */
}
@@ -7466,35 +6082,36 @@ 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);
gc_report(1, objspace, "gc_exit: %s [%s]\n", event, gc_current_status(objspace));
during_gc = FALSE;
-
- mjit_gc_exit_hook();
}
static void *
gc_with_gvl(void *ptr)
{
struct objspace_and_reason *oar = (struct objspace_and_reason *)ptr;
- return (void *)(VALUE)garbage_collect(oar->objspace, oar->reason);
+ return (void *)(VALUE)garbage_collect(oar->objspace, oar->full_mark, oar->immediate_mark, oar->immediate_sweep, oar->reason);
}
static int
-garbage_collect_with_gvl(rb_objspace_t *objspace, int reason)
+garbage_collect_with_gvl(rb_objspace_t *objspace, int full_mark, int immediate_mark, int immediate_sweep, int reason)
{
if (dont_gc) return TRUE;
if (ruby_thread_has_gvl_p()) {
- return garbage_collect(objspace, reason);
+ return garbage_collect(objspace, full_mark, immediate_mark, immediate_sweep, reason);
}
else {
if (ruby_native_thread_p()) {
struct objspace_and_reason oar;
oar.objspace = objspace;
oar.reason = reason;
+ oar.full_mark = full_mark;
+ oar.immediate_mark = immediate_mark;
+ oar.immediate_sweep = immediate_sweep;
return (int)(VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)&oar);
}
else {
@@ -7505,1167 +6122,71 @@ garbage_collect_with_gvl(rb_objspace_t *objspace, int reason)
}
}
-static VALUE
-gc_start_internal(rb_execution_context_t *ec, VALUE self, VALUE full_mark, VALUE immediate_mark, VALUE immediate_sweep)
-{
- rb_objspace_t *objspace = &rb_objspace;
- int reason = GPR_FLAG_FULL_MARK |
- GPR_FLAG_IMMEDIATE_MARK |
- GPR_FLAG_IMMEDIATE_SWEEP |
- GPR_FLAG_METHOD;
-
- if (!RTEST(full_mark)) reason &= ~GPR_FLAG_FULL_MARK;
- if (!RTEST(immediate_mark)) reason &= ~GPR_FLAG_IMMEDIATE_MARK;
- if (!RTEST(immediate_sweep)) reason &= ~GPR_FLAG_IMMEDIATE_SWEEP;
-
- garbage_collect(objspace, reason);
- gc_finalize_deferred(objspace);
-
- return Qnil;
-}
-
-static int
-gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj)
-{
- if (SPECIAL_CONST_P(obj)) {
- return FALSE;
- }
-
- switch (BUILTIN_TYPE(obj)) {
- case T_NONE:
- case T_NIL:
- case T_MOVED:
- case T_ZOMBIE:
- return FALSE;
- break;
- case T_SYMBOL:
- if (DYNAMIC_SYM_P(obj) && (RSYMBOL(obj)->id & ~ID_SCOPE_MASK)) {
- return FALSE;
- }
- /* fall through */
- case T_STRING:
- case T_OBJECT:
- case T_FLOAT:
- case T_IMEMO:
- case T_ARRAY:
- case T_BIGNUM:
- case T_ICLASS:
- case T_MODULE:
- case T_REGEXP:
- case T_DATA:
- case T_MATCH:
- case T_STRUCT:
- case T_HASH:
- case T_FILE:
- case T_COMPLEX:
- case T_RATIONAL:
- case T_NODE:
- case T_CLASS:
- if (FL_TEST(obj, FL_FINALIZE)) {
- if (st_is_member(finalizer_table, obj)) {
- return FALSE;
- }
- }
- return !RVALUE_PINNED(obj);
- break;
-
- default:
- rb_bug("gc_is_moveable_obj: unreachable (%d)", (int)BUILTIN_TYPE(obj));
- break;
- }
-
- return FALSE;
-}
-
-static VALUE
-gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free, VALUE moved_list)
-{
- int marked;
- int wb_unprotected;
- int uncollectible;
- int marking;
- RVALUE *dest = (RVALUE *)free;
- RVALUE *src = (RVALUE *)scan;
-
- gc_report(4, objspace, "Moving object: %p -> %p\n", (void*)scan, (void *)free);
-
- GC_ASSERT(BUILTIN_TYPE(scan) != T_NONE);
- GC_ASSERT(BUILTIN_TYPE(free) == T_NONE);
-
- /* Save off bits for current object. */
- marked = rb_objspace_marked_object_p((VALUE)src);
- wb_unprotected = RVALUE_WB_UNPROTECTED((VALUE)src);
- uncollectible = RVALUE_UNCOLLECTIBLE((VALUE)src);
- marking = RVALUE_MARKING((VALUE)src);
-
- objspace->total_allocated_objects++;
-
- /* Clear bits for eventual T_MOVED */
- CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)src), (VALUE)src);
- CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)src), (VALUE)src);
- CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)src), (VALUE)src);
- CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)src), (VALUE)src);
-
- if (FL_TEST(src, FL_EXIVAR)) {
- rb_mv_generic_ivar((VALUE)src, (VALUE)dest);
- }
-
- VALUE id;
-
- /* If the source object's object_id has been seen, we need to update
- * the object to object id mapping. */
- if (st_lookup(objspace->obj_to_id_tbl, (VALUE)src, &id)) {
- gc_report(4, objspace, "Moving object with seen id: %p -> %p\n", (void *)src, (void *)dest);
- st_delete(objspace->obj_to_id_tbl, (st_data_t *)&src, 0);
- st_insert(objspace->obj_to_id_tbl, (VALUE)dest, id);
- }
-
- /* Move the object */
- memcpy(dest, src, sizeof(RVALUE));
- memset(src, 0, sizeof(RVALUE));
-
- /* Set bits for object in new location */
- if (marking) {
- MARK_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
- }
- else {
- CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
- }
-
- if (marked) {
- MARK_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
- }
- else {
- CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
- }
-
- if (wb_unprotected) {
- MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
- }
- else {
- CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
- }
-
- if (uncollectible) {
- MARK_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
- }
- else {
- CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
- }
-
- /* Assign forwarding address */
- src->as.moved.flags = T_MOVED;
- src->as.moved.destination = (VALUE)dest;
- src->as.moved.next = moved_list;
- GC_ASSERT(BUILTIN_TYPE((VALUE)dest) != T_NONE);
-
- return (VALUE)src;
-}
-
-struct heap_cursor {
- RVALUE *slot;
- size_t index;
- struct heap_page *page;
- rb_objspace_t * objspace;
-};
-
-static void
-advance_cursor(struct heap_cursor *free, struct heap_page **page_list)
-{
- if (free->slot == free->page->start + free->page->total_slots - 1) {
- free->index++;
- free->page = page_list[free->index];
- free->slot = free->page->start;
- }
- else {
- free->slot++;
- }
-}
-
-static void
-retreat_cursor(struct heap_cursor *scan, struct heap_page **page_list)
-{
- if (scan->slot == scan->page->start) {
- scan->index--;
- scan->page = page_list[scan->index];
- scan->slot = scan->page->start + scan->page->total_slots - 1;
- }
- else {
- scan->slot--;
- }
-}
-
-static int
-not_met(struct heap_cursor *free, struct heap_cursor *scan)
-{
- if (free->index < scan->index)
- return 1;
-
- if (free->index > scan->index)
- return 0;
-
- return free->slot < scan->slot;
-}
-
-static void
-init_cursors(rb_objspace_t *objspace, struct heap_cursor *free, struct heap_cursor *scan, struct heap_page **page_list)
-{
- struct heap_page *page;
- size_t total_pages = heap_eden->total_pages;
- page = page_list[0];
-
- free->index = 0;
- free->page = page;
- free->slot = page->start;
- free->objspace = objspace;
-
- page = page_list[total_pages - 1];
- scan->index = total_pages - 1;
- scan->page = page;
- scan->slot = page->start + page->total_slots - 1;
- scan->objspace = objspace;
-}
-
-static int
-count_pinned(struct heap_page *page)
-{
- int pinned = 0;
- int i;
-
- for (i = 0; i < HEAP_PAGE_BITMAP_LIMIT; i++) {
- pinned += popcount_bits(page->pinned_bits[i]);
- }
-
- return pinned;
-}
-
-static int
-compare_pinned(const void *left, const void *right, void *dummy)
-{
- struct heap_page *left_page;
- struct heap_page *right_page;
-
- left_page = *(struct heap_page * const *)left;
- right_page = *(struct heap_page * const *)right;
-
- return right_page->pinned_slots - left_page->pinned_slots;
-}
-
-static int
-compare_free_slots(const void *left, const void *right, void *dummy)
-{
- struct heap_page *left_page;
- struct heap_page *right_page;
-
- left_page = *(struct heap_page * const *)left;
- right_page = *(struct heap_page * const *)right;
-
- return right_page->free_slots - left_page->free_slots;
-}
-
-typedef int page_compare_func_t(const void *, const void *, void *);
-
-static struct heap_page **
-allocate_page_list(rb_objspace_t *objspace, page_compare_func_t *comparator)
-{
- size_t total_pages = heap_eden->total_pages;
- size_t size = size_mul_or_raise(total_pages, sizeof(struct heap_page *), rb_eRuntimeError);
- struct heap_page *page = 0, **page_list = malloc(size);
- int i = 0;
-
- list_for_each(&heap_eden->pages, page, page_node) {
- page_list[i++] = page;
- page->pinned_slots = count_pinned(page);
- GC_ASSERT(page != NULL);
- }
- GC_ASSERT(total_pages > 0);
- GC_ASSERT((size_t)i == total_pages);
-
- ruby_qsort(page_list, total_pages, sizeof(struct heap_page *), comparator, NULL);
-
- return page_list;
-}
-
-static VALUE
-gc_compact_heap(rb_objspace_t *objspace, page_compare_func_t *comparator)
-{
- struct heap_cursor free_cursor;
- struct heap_cursor scan_cursor;
- struct heap_page **page_list;
- VALUE moved_list;
-
- moved_list = Qfalse;
- memset(objspace->rcompactor.considered_count_table, 0, T_MASK * sizeof(size_t));
- memset(objspace->rcompactor.moved_count_table, 0, T_MASK * sizeof(size_t));
-
- page_list = allocate_page_list(objspace, comparator);
-
- init_cursors(objspace, &free_cursor, &scan_cursor, page_list);
-
- /* Two finger algorithm */
- while (not_met(&free_cursor, &scan_cursor)) {
- /* Free cursor movement */
-
- /* Unpoison free_cursor slot */
- void *free_slot_poison = asan_poisoned_object_p((VALUE)free_cursor.slot);
- asan_unpoison_object((VALUE)free_cursor.slot, false);
-
- while (BUILTIN_TYPE(free_cursor.slot) != T_NONE && not_met(&free_cursor, &scan_cursor)) {
- /* Re-poison slot if it's not the one we want */
- if (free_slot_poison) {
- GC_ASSERT(BUILTIN_TYPE(free_cursor.slot) == T_NONE);
- asan_poison_object((VALUE)free_cursor.slot);
- }
-
- advance_cursor(&free_cursor, page_list);
-
- /* Unpoison free_cursor slot */
- free_slot_poison = asan_poisoned_object_p((VALUE)free_cursor.slot);
- asan_unpoison_object((VALUE)free_cursor.slot, false);
- }
-
- /* Unpoison scan_cursor slot */
- void *scan_slot_poison = asan_poisoned_object_p((VALUE)scan_cursor.slot);
- asan_unpoison_object((VALUE)scan_cursor.slot, false);
-
- /* Scan cursor movement */
- objspace->rcompactor.considered_count_table[BUILTIN_TYPE((VALUE)scan_cursor.slot)]++;
-
- while (!gc_is_moveable_obj(objspace, (VALUE)scan_cursor.slot) && not_met(&free_cursor, &scan_cursor)) {
-
- /* Re-poison slot if it's not the one we want */
- if (scan_slot_poison) {
- GC_ASSERT(BUILTIN_TYPE(scan_cursor.slot) == T_NONE);
- asan_poison_object((VALUE)scan_cursor.slot);
- }
-
- retreat_cursor(&scan_cursor, page_list);
-
- /* Unpoison scan_cursor slot */
- scan_slot_poison = asan_poisoned_object_p((VALUE)scan_cursor.slot);
- asan_unpoison_object((VALUE)scan_cursor.slot, false);
-
- objspace->rcompactor.considered_count_table[BUILTIN_TYPE((VALUE)scan_cursor.slot)]++;
- }
-
- if (not_met(&free_cursor, &scan_cursor)) {
- objspace->rcompactor.moved_count_table[BUILTIN_TYPE((VALUE)scan_cursor.slot)]++;
-
- GC_ASSERT(BUILTIN_TYPE(free_cursor.slot) == T_NONE);
- GC_ASSERT(BUILTIN_TYPE(scan_cursor.slot) != T_NONE);
- GC_ASSERT(BUILTIN_TYPE(scan_cursor.slot) != T_MOVED);
-
- moved_list = gc_move(objspace, (VALUE)scan_cursor.slot, (VALUE)free_cursor.slot, moved_list);
-
- GC_ASSERT(BUILTIN_TYPE(free_cursor.slot) != T_MOVED);
- GC_ASSERT(BUILTIN_TYPE(free_cursor.slot) != T_NONE);
- GC_ASSERT(BUILTIN_TYPE(scan_cursor.slot) == T_MOVED);
-
- advance_cursor(&free_cursor, page_list);
- retreat_cursor(&scan_cursor, page_list);
- }
- }
- free(page_list);
-
- return moved_list;
-}
-
-static void
-gc_ref_update_array(rb_objspace_t * objspace, VALUE v)
-{
- long i, len;
-
- if (FL_TEST(v, ELTS_SHARED))
- return;
-
- len = RARRAY_LEN(v);
- if (len > 0) {
- VALUE *ptr = (VALUE *)RARRAY_CONST_PTR_TRANSIENT(v);
- for (i = 0; i < len; i++) {
- UPDATE_IF_MOVED(objspace, ptr[i]);
- }
- }
-}
-
-static void
-gc_ref_update_object(rb_objspace_t * objspace, VALUE v)
-{
- VALUE *ptr = ROBJECT_IVPTR(v);
-
- if (ptr) {
- uint32_t i, len = ROBJECT_NUMIV(v);
- for (i = 0; i < len; i++) {
- UPDATE_IF_MOVED(objspace, ptr[i]);
- }
- }
-}
-
-static int
-hash_replace_ref(st_data_t *key, st_data_t *value, st_data_t argp, int existing)
-{
- rb_objspace_t *objspace = (rb_objspace_t *)argp;
-
- if (gc_object_moved_p(objspace, (VALUE)*key)) {
- *key = rb_gc_location((VALUE)*key);
- }
-
- if (gc_object_moved_p(objspace, (VALUE)*value)) {
- *value = rb_gc_location((VALUE)*value);
- }
-
- return ST_CONTINUE;
-}
-
-static int
-hash_foreach_replace(st_data_t key, st_data_t value, st_data_t argp, int error)
-{
- rb_objspace_t *objspace;
-
- objspace = (rb_objspace_t *)argp;
-
- if (gc_object_moved_p(objspace, (VALUE)key)) {
- return ST_REPLACE;
- }
-
- if (gc_object_moved_p(objspace, (VALUE)value)) {
- return ST_REPLACE;
- }
- return ST_CONTINUE;
-}
-
-static int
-hash_replace_ref_value(st_data_t *key, st_data_t *value, st_data_t argp, int existing)
-{
- rb_objspace_t *objspace = (rb_objspace_t *)argp;
-
- if (gc_object_moved_p(objspace, (VALUE)*value)) {
- *value = rb_gc_location((VALUE)*value);
- }
-
- return ST_CONTINUE;
-}
-
-static int
-hash_foreach_replace_value(st_data_t key, st_data_t value, st_data_t argp, int error)
-{
- rb_objspace_t *objspace;
-
- objspace = (rb_objspace_t *)argp;
-
- if (gc_object_moved_p(objspace, (VALUE)value)) {
- return ST_REPLACE;
- }
- return ST_CONTINUE;
-}
-
-static void
-gc_update_tbl_refs(rb_objspace_t * objspace, st_table *tbl)
+int
+rb_garbage_collect(void)
{
- if (!tbl || tbl->num_entries == 0) return;
-
- if (st_foreach_with_replace(tbl, hash_foreach_replace_value, hash_replace_ref_value, (st_data_t)objspace)) {
- rb_raise(rb_eRuntimeError, "hash modified during iteration");
- }
+ return garbage_collect(&rb_objspace, TRUE, TRUE, TRUE, GPR_FLAG_CAPI);
}
-static void
-gc_update_table_refs(rb_objspace_t * objspace, st_table *tbl)
-{
- if (!tbl || tbl->num_entries == 0) return;
-
- if (st_foreach_with_replace(tbl, hash_foreach_replace, hash_replace_ref, (st_data_t)objspace)) {
- rb_raise(rb_eRuntimeError, "hash modified during iteration");
- }
-}
+#undef Init_stack
-/* Update MOVED references in an st_table */
void
-rb_gc_update_tbl_refs(st_table *ptr)
-{
- rb_objspace_t *objspace = &rb_objspace;
- gc_update_table_refs(objspace, ptr);
-}
-
-static void
-gc_ref_update_hash(rb_objspace_t * objspace, VALUE v)
-{
- rb_hash_stlike_foreach_with_replace(v, hash_foreach_replace, hash_replace_ref, (st_data_t)objspace);
-}
-
-static void
-gc_ref_update_method_entry(rb_objspace_t *objspace, rb_method_entry_t *me)
-{
- rb_method_definition_t *def = me->def;
-
- UPDATE_IF_MOVED(objspace, me->owner);
- UPDATE_IF_MOVED(objspace, me->defined_class);
-
- if (def) {
- switch (def->type) {
- case VM_METHOD_TYPE_ISEQ:
- if (def->body.iseq.iseqptr) {
- TYPED_UPDATE_IF_MOVED(objspace, rb_iseq_t *, def->body.iseq.iseqptr);
- }
- TYPED_UPDATE_IF_MOVED(objspace, rb_cref_t *, def->body.iseq.cref);
- break;
- case VM_METHOD_TYPE_ATTRSET:
- case VM_METHOD_TYPE_IVAR:
- UPDATE_IF_MOVED(objspace, def->body.attr.location);
- break;
- case VM_METHOD_TYPE_BMETHOD:
- UPDATE_IF_MOVED(objspace, def->body.bmethod.proc);
- break;
- case VM_METHOD_TYPE_ALIAS:
- TYPED_UPDATE_IF_MOVED(objspace, struct rb_method_entry_struct *, def->body.alias.original_me);
- return;
- case VM_METHOD_TYPE_REFINED:
- TYPED_UPDATE_IF_MOVED(objspace, struct rb_method_entry_struct *, def->body.refined.orig_me);
- UPDATE_IF_MOVED(objspace, 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;
- }
- }
-}
-
-static void
-gc_update_values(rb_objspace_t *objspace, long n, VALUE *values)
-{
- long i;
-
- for (i=0; i<n; i++) {
- UPDATE_IF_MOVED(objspace, values[i]);
- }
-}
-
-static void
-gc_ref_update_imemo(rb_objspace_t *objspace, VALUE obj)
-{
- switch (imemo_type(obj)) {
- case imemo_env:
- {
- rb_env_t *env = (rb_env_t *)obj;
- TYPED_UPDATE_IF_MOVED(objspace, rb_iseq_t *, env->iseq);
- UPDATE_IF_MOVED(objspace, env->ep[VM_ENV_DATA_INDEX_ENV]);
- gc_update_values(objspace, (long)env->env_size, (VALUE *)env->env);
- }
- break;
- case imemo_cref:
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.cref.klass);
- TYPED_UPDATE_IF_MOVED(objspace, struct rb_cref_struct *, RANY(obj)->as.imemo.cref.next);
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.cref.refinements);
- break;
- case imemo_svar:
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.svar.cref_or_me);
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.svar.lastline);
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.svar.backref);
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.svar.others);
- break;
- case imemo_throw_data:
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.throw_data.throw_obj);
- break;
- case imemo_ifunc:
- break;
- case imemo_memo:
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.memo.v1);
- UPDATE_IF_MOVED(objspace, RANY(obj)->as.imemo.memo.v2);
- break;
- case imemo_ment:
- gc_ref_update_method_entry(objspace, &RANY(obj)->as.imemo.ment);
- break;
- case imemo_iseq:
- rb_iseq_update_references((rb_iseq_t *)obj);
- break;
- case imemo_ast:
- rb_ast_update_references((rb_ast_t *)obj);
- break;
- case imemo_parser_strterm:
- case imemo_tmpbuf:
- break;
- default:
- rb_bug("not reachable %d", imemo_type(obj));
- break;
- }
-}
-
-static enum rb_id_table_iterator_result
-check_id_table_move(ID id, VALUE value, void *data)
-{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
-
- if (gc_object_moved_p(objspace, (VALUE)value)) {
- return ID_TABLE_REPLACE;
- }
-
- return ID_TABLE_CONTINUE;
-}
-
-/* Returns the new location of an object, if it moved. Otherwise returns
- * the existing location. */
-VALUE
-rb_gc_location(VALUE value)
-{
-
- VALUE destination;
-
- if (!SPECIAL_CONST_P((void *)value)) {
- void *poisoned = asan_poisoned_object_p(value);
- asan_unpoison_object(value, false);
-
- if (BUILTIN_TYPE(value) == T_MOVED) {
- destination = (VALUE)RMOVED(value)->destination;
- GC_ASSERT(BUILTIN_TYPE(destination) != T_NONE);
- }
- else {
- destination = value;
- }
-
- /* Re-poison slot if it's not the one we want */
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(value) == T_NONE);
- asan_poison_object(value);
- }
- }
- else {
- destination = value;
- }
-
- return destination;
-}
-
-static enum rb_id_table_iterator_result
-update_id_table(ID *key, VALUE * value, void *data, int existing)
-{
- rb_objspace_t *objspace = (rb_objspace_t *)data;
-
- if (gc_object_moved_p(objspace, (VALUE)*value)) {
- *value = rb_gc_location((VALUE)*value);
- }
-
- return ID_TABLE_CONTINUE;
-}
-
-static void
-update_m_tbl(rb_objspace_t *objspace, struct rb_id_table *tbl)
-{
- if (tbl) {
- rb_id_table_foreach_with_replace(tbl, check_id_table_move, update_id_table, objspace);
- }
-}
-
-static enum rb_id_table_iterator_result
-update_const_table(VALUE value, void *data)
-{
- rb_const_entry_t *ce = (rb_const_entry_t *)value;
- rb_objspace_t * objspace = (rb_objspace_t *)data;
-
- if (gc_object_moved_p(objspace, ce->value)) {
- ce->value = rb_gc_location(ce->value);
- }
-
- if (gc_object_moved_p(objspace, ce->file)) {
- ce->file = rb_gc_location(ce->file);
- }
-
- return ID_TABLE_CONTINUE;
-}
-
-static void
-update_const_tbl(rb_objspace_t *objspace, struct rb_id_table *tbl)
-{
- if (!tbl) return;
- rb_id_table_foreach_values(tbl, update_const_table, objspace);
-}
-
-static void
-update_subclass_entries(rb_objspace_t *objspace, rb_subclass_entry_t *entry)
-{
- while (entry) {
- UPDATE_IF_MOVED(objspace, entry->klass);
- entry = entry->next;
- }
-}
-
-static void
-update_class_ext(rb_objspace_t *objspace, rb_classext_t *ext)
-{
- UPDATE_IF_MOVED(objspace, ext->origin_);
- UPDATE_IF_MOVED(objspace, ext->refined_class);
- update_subclass_entries(objspace, ext->subclasses);
-}
-
-static void
-gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
-{
- RVALUE *any = RANY(obj);
-
- gc_report(4, objspace, "update-refs: %p ->", (void *)obj);
-
- switch (BUILTIN_TYPE(obj)) {
- case T_CLASS:
- case T_MODULE:
- if (RCLASS_SUPER((VALUE)obj)) {
- UPDATE_IF_MOVED(objspace, RCLASS(obj)->super);
- }
- if (!RCLASS_EXT(obj)) break;
- update_m_tbl(objspace, RCLASS_M_TBL(obj));
- gc_update_tbl_refs(objspace, RCLASS_IV_TBL(obj));
- update_class_ext(objspace, RCLASS_EXT(obj));
- update_const_tbl(objspace, RCLASS_CONST_TBL(obj));
- break;
-
- case T_ICLASS:
- if (FL_TEST(obj, RICLASS_IS_ORIGIN)) {
- update_m_tbl(objspace, RCLASS_M_TBL(obj));
- }
- if (RCLASS_SUPER((VALUE)obj)) {
- UPDATE_IF_MOVED(objspace, RCLASS(obj)->super);
- }
- if (!RCLASS_EXT(obj)) break;
- if (RCLASS_IV_TBL(obj)) {
- gc_update_tbl_refs(objspace, RCLASS_IV_TBL(obj));
- }
- update_class_ext(objspace, RCLASS_EXT(obj));
- update_m_tbl(objspace, RCLASS_CALLABLE_M_TBL(obj));
- break;
-
- case T_IMEMO:
- gc_ref_update_imemo(objspace, obj);
- return;
-
- case T_NIL:
- case T_FIXNUM:
- case T_NODE:
- case T_MOVED:
- case T_NONE:
- /* These can't move */
- return;
-
- case T_ARRAY:
- if (FL_TEST(obj, ELTS_SHARED)) {
- UPDATE_IF_MOVED(objspace, any->as.array.as.heap.aux.shared_root);
- }
- else {
- gc_ref_update_array(objspace, obj);
- }
- break;
-
- case T_HASH:
- gc_ref_update_hash(objspace, obj);
- UPDATE_IF_MOVED(objspace, any->as.hash.ifnone);
- break;
-
- case T_STRING:
- if (STR_SHARED_P(obj)) {
- UPDATE_IF_MOVED(objspace, any->as.string.as.heap.aux.shared);
- }
- break;
-
- case T_DATA:
- /* Call the compaction callback, if it exists */
- {
- void *const ptr = DATA_PTR(obj);
- if (ptr) {
- if (RTYPEDDATA_P(obj)) {
- RUBY_DATA_FUNC compact_func = any->as.typeddata.type->function.dcompact;
- if (compact_func) (*compact_func)(ptr);
- }
- }
- }
- break;
-
- case T_OBJECT:
- gc_ref_update_object(objspace, obj);
- break;
-
- case T_FILE:
- if (any->as.file.fptr) {
- UPDATE_IF_MOVED(objspace, any->as.file.fptr->pathv);
- UPDATE_IF_MOVED(objspace, any->as.file.fptr->tied_io_for_writing);
- UPDATE_IF_MOVED(objspace, any->as.file.fptr->writeconv_asciicompat);
- UPDATE_IF_MOVED(objspace, any->as.file.fptr->writeconv_pre_ecopts);
- UPDATE_IF_MOVED(objspace, any->as.file.fptr->encs.ecopts);
- UPDATE_IF_MOVED(objspace, any->as.file.fptr->write_lock);
- }
- break;
- case T_REGEXP:
- UPDATE_IF_MOVED(objspace, any->as.regexp.src);
- break;
-
- case T_SYMBOL:
- if (DYNAMIC_SYM_P((VALUE)any)) {
- UPDATE_IF_MOVED(objspace, RSYMBOL(any)->fstr);
- }
- break;
-
- case T_FLOAT:
- case T_BIGNUM:
- break;
-
- case T_MATCH:
- UPDATE_IF_MOVED(objspace, any->as.match.regexp);
-
- if (any->as.match.str) {
- UPDATE_IF_MOVED(objspace, any->as.match.str);
- }
- break;
-
- case T_RATIONAL:
- UPDATE_IF_MOVED(objspace, any->as.rational.num);
- UPDATE_IF_MOVED(objspace, any->as.rational.den);
- break;
-
- case T_COMPLEX:
- UPDATE_IF_MOVED(objspace, any->as.complex.real);
- UPDATE_IF_MOVED(objspace, any->as.complex.imag);
-
- break;
-
- case T_STRUCT:
- {
- long i, len = RSTRUCT_LEN(obj);
- VALUE *ptr = (VALUE *)RSTRUCT_CONST_PTR(obj);
-
- for (i = 0; i < len; i++) {
- UPDATE_IF_MOVED(objspace, ptr[i]);
- }
- }
- break;
- default:
-#if GC_DEBUG
- rb_gcdebug_print_obj_condition((VALUE)obj);
- rb_obj_info_dump(obj);
- rb_bug("unreachable");
-#endif
- break;
-
- }
-
- UPDATE_IF_MOVED(objspace, RBASIC(obj)->klass);
-
- gc_report(4, objspace, "update-refs: %p <-", (void *)obj);
-}
-
-static int
-gc_ref_update(void *vstart, void *vend, size_t stride, void * data)
-{
- rb_objspace_t * objspace;
- struct heap_page *page;
- short free_slots = 0;
-
- VALUE v = (VALUE)vstart;
- objspace = (rb_objspace_t *)data;
- page = GET_HEAP_PAGE(v);
- asan_unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
- page->freelist = NULL;
- asan_poison_memory_region(&page->freelist, sizeof(RVALUE*));
- page->flags.has_uncollectible_shady_objects = FALSE;
- page->flags.has_remembered_objects = FALSE;
-
- /* For each object on the page */
- for (; v != (VALUE)vend; v += stride) {
- if (!SPECIAL_CONST_P(v)) {
- void *poisoned = asan_poisoned_object_p(v);
- asan_unpoison_object(v, false);
-
- switch (BUILTIN_TYPE(v)) {
- case T_NONE:
- heap_page_add_freeobj(objspace, page, v);
- free_slots++;
- break;
- case T_MOVED:
- break;
- case T_ZOMBIE:
- break;
- default:
- if (RVALUE_WB_UNPROTECTED(v)) {
- page->flags.has_uncollectible_shady_objects = TRUE;
- }
- if (RVALUE_PAGE_MARKING(page, v)) {
- page->flags.has_remembered_objects = TRUE;
- }
- gc_update_object_references(objspace, v);
- }
-
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(v) == T_NONE);
- asan_poison_object(v);
- }
- }
- }
-
- page->free_slots = free_slots;
- return 0;
-}
-
-extern rb_symbols_t ruby_global_symbols;
-#define global_symbols ruby_global_symbols
-
-static void
-gc_update_references(rb_objspace_t * objspace)
-{
- rb_execution_context_t *ec = GET_EC();
- rb_vm_t *vm = rb_ec_vm_ptr(ec);
-
- objspace_each_objects_without_setup(objspace, gc_ref_update, objspace);
- rb_vm_update_references(vm);
- rb_transient_heap_update_references();
- global_symbols.ids = rb_gc_location(global_symbols.ids);
- global_symbols.dsymbol_fstr_hash = rb_gc_location(global_symbols.dsymbol_fstr_hash);
- gc_update_tbl_refs(objspace, objspace->obj_to_id_tbl);
- gc_update_table_refs(objspace, objspace->id_to_obj_tbl);
- gc_update_table_refs(objspace, global_symbols.str_sym);
- gc_update_table_refs(objspace, finalizer_table);
-}
-
-static VALUE type_sym(size_t type);
-
-static VALUE
-gc_compact_stats(rb_objspace_t *objspace)
-{
- size_t i;
- VALUE h = rb_hash_new();
- VALUE considered = rb_hash_new();
- VALUE moved = rb_hash_new();
-
- for (i=0; i<T_MASK; i++) {
- rb_hash_aset(considered, type_sym(i), SIZET2NUM(objspace->rcompactor.considered_count_table[i]));
- }
-
- for (i=0; i<T_MASK; i++) {
- rb_hash_aset(moved, type_sym(i), SIZET2NUM(objspace->rcompactor.moved_count_table[i]));
- }
-
- rb_hash_aset(h, ID2SYM(rb_intern("considered")), considered);
- rb_hash_aset(h, ID2SYM(rb_intern("moved")), moved);
-
- return h;
-}
-
-static void gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages, int use_verifier);
-
-static void
-gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages, int use_verifier)
-{
-
- objspace->flags.during_compacting = TRUE;
- {
- /* pin objects referenced by maybe pointers */
- garbage_collect(objspace, GPR_DEFAULT_REASON);
- /* compact */
- gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, use_verifier);
- }
- objspace->flags.during_compacting = FALSE;
-}
-
-static VALUE
-rb_gc_compact(rb_execution_context_t *ec, VALUE self)
-{
- rb_objspace_t *objspace = &rb_objspace;
- if (dont_gc) return Qnil;
-
- gc_compact(objspace, FALSE, FALSE, FALSE);
- return gc_compact_stats(objspace);
-}
-
-static void
-root_obj_check_moved_i(const char *category, VALUE obj, void *data)
-{
- if (gc_object_moved_p(&rb_objspace, obj)) {
- rb_bug("ROOT %s points to MOVED: %p -> %s\n", category, (void *)obj, obj_info(rb_gc_location(obj)));
- }
-}
-
-static void
-reachable_object_check_moved_i(VALUE ref, void *data)
-{
- VALUE parent = (VALUE)data;
- if (gc_object_moved_p(&rb_objspace, ref)) {
- rb_bug("Object %s points to MOVED: %p -> %s\n", obj_info(parent), (void *)ref, obj_info(rb_gc_location(ref)));
- }
-}
-
-static int
-heap_check_moved_i(void *vstart, void *vend, size_t stride, void *data)
-{
- VALUE v = (VALUE)vstart;
- for (; v != (VALUE)vend; v += stride) {
- if (gc_object_moved_p(&rb_objspace, v)) {
- /* Moved object still on the heap, something may have a reference. */
- }
- else {
- void *poisoned = asan_poisoned_object_p(v);
- asan_unpoison_object(v, false);
-
- switch (BUILTIN_TYPE(v)) {
- case T_NONE:
- case T_ZOMBIE:
- break;
- default:
- rb_objspace_reachable_objects_from(v, reachable_object_check_moved_i, (void *)v);
- }
-
- if (poisoned) {
- GC_ASSERT(BUILTIN_TYPE(v) == T_NONE);
- asan_poison_object(v);
- }
- }
- }
-
- return 0;
-}
-
-static VALUE
-gc_check_references_for_moved(rb_objspace_t *objspace)
-{
- objspace_reachable_objects_from_root(objspace, root_obj_check_moved_i, NULL);
- objspace_each_objects(objspace, heap_check_moved_i, NULL);
- return Qnil;
-}
-
-static void
-gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages, int use_verifier)
+Init_stack(volatile VALUE *addr)
{
- if (0) fprintf(stderr, "gc_compact_after_gc: %d,%d,%d\n", use_toward_empty, use_double_pages, use_verifier);
-
- mjit_gc_start_hook(); // prevent MJIT from running while moving pointers related to ISeq
-
- objspace->profile.compact_count++;
-
- if (use_verifier) {
- gc_verify_internal_consistency(objspace);
- }
-
- if (use_double_pages) {
- /* Double heap size */
- heap_add_pages(objspace, heap_eden, heap_allocated_pages);
- }
-
- VALUE moved_list_head;
- VALUE disabled = rb_gc_disable();
-
- if (use_toward_empty) {
- moved_list_head = gc_compact_heap(objspace, compare_free_slots);
- }
- else {
- moved_list_head = gc_compact_heap(objspace, compare_pinned);
- }
- heap_eden->freelist = NULL;
-
- gc_update_references(objspace);
- if (!RTEST(disabled)) rb_gc_enable();
-
- if (use_verifier) {
- gc_check_references_for_moved(objspace);
- }
-
- rb_clear_method_cache_by_class(rb_cObject);
- rb_clear_constant_cache();
- heap_eden->free_pages = NULL;
- heap_eden->using_page = NULL;
-
- /* For each moved slot */
- while (moved_list_head) {
- VALUE next_moved;
- struct heap_page *page;
-
- page = GET_HEAP_PAGE(moved_list_head);
- next_moved = RMOVED(moved_list_head)->next;
-
- /* clear the memory for that moved slot */
- RMOVED(moved_list_head)->flags = 0;
- RMOVED(moved_list_head)->destination = 0;
- RMOVED(moved_list_head)->next = 0;
- page->free_slots++;
- heap_page_add_freeobj(objspace, page, moved_list_head);
-
- if (page->free_slots == page->total_slots && heap_pages_freeable_pages > 0) {
- heap_pages_freeable_pages--;
- heap_unlink_page(objspace, heap_eden, page);
- heap_add_page(objspace, heap_tomb, page);
- }
- objspace->profile.total_freed_objects++;
- moved_list_head = next_moved;
- }
-
- /* Add any eden pages with free slots back to the free pages list */
- struct heap_page *page = NULL;
- list_for_each(&heap_eden->pages, page, page_node) {
- if (page->free_slots > 0) {
- heap_add_freepage(heap_eden, page);
- } else {
- page->free_next = NULL;
- }
- }
-
- /* Set up "using_page" if we have any pages with free slots */
- if (heap_eden->free_pages) {
- heap_eden->using_page = heap_eden->free_pages;
- heap_eden->free_pages = heap_eden->free_pages->free_next;
- }
-
- if (use_verifier) {
- gc_verify_internal_consistency(objspace);
- }
-
- mjit_gc_exit_hook(); // unlock MJIT here, because `rb_gc()` calls `mjit_gc_start_hook()` again.
+ ruby_init_stack(addr);
}
/*
* call-seq:
- * GC.verify_compaction_references -> nil
+ * GC.start -> nil
+ * GC.garbage_collect -> nil
+ * GC.start(full_mark: true, immediate_sweep: true) -> nil
+ * GC.garbage_collect(full_mark: true, immediate_sweep: true) -> nil
+ *
+ * Initiates garbage collection, unless manually disabled.
*
- * Verify compaction reference consistency.
+ * This method is defined with keyword arguments that default to true:
*
- * This method is implementation specific. During compaction, objects that
- * were moved are replaced with T_MOVED objects. No object should have a
- * reference to a T_MOVED object after compaction.
+ * def GC.start(full_mark: true, immediate_sweep: true); end
*
- * This function doubles the heap to ensure room to move all objects,
- * compacts the heap to make sure everything moves, updates all references,
- * then performs a full GC. If any object contains a reference to a T_MOVED
- * object, that object should be pushed on the mark stack, and will
- * make a SEGV.
+ * Use full_mark: false to perform a minor GC.
+ * Use immediate_sweep: false to defer sweeping (use lazy sweep).
+ *
+ * Note: These keyword arguments are implementation and version dependent. They
+ * are not guaranteed to be future-compatible, and may be ignored if the
+ * underlying implementation does not support them.
*/
+
static VALUE
-gc_verify_compaction_references(int argc, VALUE *argv, VALUE mod)
+gc_start_internal(int argc, VALUE *argv, VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
- int use_toward_empty = FALSE;
- int use_double_pages = FALSE;
-
- if (dont_gc) return Qnil;
-
+ int full_mark = TRUE, immediate_mark = TRUE, immediate_sweep = TRUE;
VALUE opt = Qnil;
- static ID keyword_ids[2];
- VALUE kwvals[2];
-
- kwvals[1] = Qtrue;
+ static ID keyword_ids[3];
rb_scan_args(argc, argv, "0:", &opt);
if (!NIL_P(opt)) {
- if (!keyword_ids[0]) {
- keyword_ids[0] = rb_intern("toward");
- keyword_ids[1] = rb_intern("double_heap");
- }
+ VALUE kwvals[3];
- rb_get_kwargs(opt, keyword_ids, 0, 2, kwvals);
- if (rb_intern("empty") == rb_sym2id(kwvals[0])) {
- use_toward_empty = TRUE;
- }
- if (kwvals[1] != Qundef && RTEST(kwvals[1])) {
- use_double_pages = TRUE;
- }
+ if (!keyword_ids[0]) {
+ keyword_ids[0] = rb_intern("full_mark");
+ keyword_ids[1] = rb_intern("immediate_mark");
+ keyword_ids[2] = rb_intern("immediate_sweep");
+ }
+
+ rb_get_kwargs(opt, keyword_ids, 0, 3, kwvals);
+
+ if (kwvals[0] != Qundef) full_mark = RTEST(kwvals[0]);
+ if (kwvals[1] != Qundef) immediate_mark = RTEST(kwvals[1]);
+ if (kwvals[2] != Qundef) immediate_sweep = RTEST(kwvals[2]);
}
- gc_compact(objspace, use_toward_empty, use_double_pages, TRUE);
- return gc_compact_stats(objspace);
+ garbage_collect(objspace, full_mark, immediate_mark, immediate_sweep, GPR_FLAG_METHOD);
+ if (!finalizing) finalize_deferred(objspace);
+
+ return Qnil;
}
VALUE
@@ -8679,8 +6200,8 @@ void
rb_gc(void)
{
rb_objspace_t *objspace = &rb_objspace;
- int reason = GPR_DEFAULT_REASON;
- garbage_collect(objspace, reason);
+ garbage_collect(objspace, TRUE, TRUE, TRUE, GPR_FLAG_CAPI);
+ if (!finalizing) finalize_deferred(objspace);
}
int
@@ -8697,11 +6218,11 @@ 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);
- rb_hash_aset(result, ID2SYM(rb_intern(type)), SIZET2NUM(types[i]));
+ const char *type = type_name(i, 0);
+ rb_hash_aset(result, ID2SYM(rb_intern(type)), SIZET2NUM(types[i]));
}
rb_hash_aset(hash, ID2SYM(rb_intern(name)), result);
}
@@ -8713,8 +6234,18 @@ rb_gc_count(void)
return rb_objspace.profile.count;
}
+/*
+ * call-seq:
+ * GC.count -> Integer
+ *
+ * The number of times GC occurred.
+ *
+ * It returns the number of times GC occurred since the process started.
+ *
+ */
+
static VALUE
-gc_count(rb_execution_context_t *ec, VALUE self)
+gc_count(VALUE self)
{
return SIZET2NUM(rb_gc_count());
}
@@ -8734,47 +6265,47 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_
VALUE flags = orig_flags ? orig_flags : objspace->profile.latest_gc_info;
if (SYMBOL_P(hash_or_key)) {
- key = hash_or_key;
+ key = hash_or_key;
}
else if (RB_TYPE_P(hash_or_key, T_HASH)) {
- hash = hash_or_key;
+ hash = hash_or_key;
}
else {
- rb_raise(rb_eTypeError, "non-hash or symbol given");
+ rb_raise(rb_eTypeError, "non-hash or symbol given");
}
if (sym_major_by == Qnil) {
#define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
- S(major_by);
- S(gc_by);
- S(immediate_sweep);
- S(have_finalizer);
- S(state);
-
- S(stress);
- S(nofree);
- S(oldgen);
- S(shady);
- S(force);
+ S(major_by);
+ S(gc_by);
+ S(immediate_sweep);
+ S(have_finalizer);
+ S(state);
+
+ S(stress);
+ S(nofree);
+ S(oldgen);
+ S(shady);
+ S(force);
#if RGENGC_ESTIMATE_OLDMALLOC
- S(oldmalloc);
+ S(oldmalloc);
#endif
- S(newobj);
- S(malloc);
- S(method);
- S(capi);
+ S(newobj);
+ S(malloc);
+ S(method);
+ S(capi);
- S(none);
- S(marking);
- S(sweeping);
+ S(none);
+ S(marking);
+ S(sweeping);
#undef S
}
#define SET(name, attr) \
if (key == sym_##name) \
- return (attr); \
+ return (attr); \
else if (hash != Qnil) \
- rb_hash_aset(hash, sym_##name, (attr));
+ rb_hash_aset(hash, sym_##name, (attr));
major_by =
(flags & GPR_FLAG_MAJOR_BY_NOFREE) ? sym_nofree :
@@ -8788,25 +6319,25 @@ gc_info_decode(rb_objspace_t *objspace, const VALUE hash_or_key, const int orig_
SET(major_by, major_by);
SET(gc_by,
- (flags & GPR_FLAG_NEWOBJ) ? sym_newobj :
- (flags & GPR_FLAG_MALLOC) ? sym_malloc :
- (flags & GPR_FLAG_METHOD) ? sym_method :
- (flags & GPR_FLAG_CAPI) ? sym_capi :
- (flags & GPR_FLAG_STRESS) ? sym_stress :
- Qnil
+ (flags & GPR_FLAG_NEWOBJ) ? sym_newobj :
+ (flags & GPR_FLAG_MALLOC) ? sym_malloc :
+ (flags & GPR_FLAG_METHOD) ? sym_method :
+ (flags & GPR_FLAG_CAPI) ? sym_capi :
+ (flags & GPR_FLAG_STRESS) ? sym_stress :
+ Qnil
);
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);
+ SET(state, objspace->flags.stat == gc_stat_none ? sym_none :
+ objspace->flags.stat == gc_stat_marking ? sym_marking : sym_sweeping);
}
#undef SET
if (!NIL_P(key)) {/* matched key should return above */
- rb_raise(rb_eArgError, "unknown key: %"PRIsVALUE, rb_sym2str(key));
+ rb_raise(rb_eArgError, "unknown key: %"PRIsVALUE, rb_sym2str(key));
}
return hash;
@@ -8819,16 +6350,29 @@ rb_gc_latest_gc_info(VALUE key)
return gc_info_decode(objspace, key, 0);
}
+/*
+ * call-seq:
+ * GC.latest_gc_info -> {:gc_by=>:newobj}
+ * GC.latest_gc_info(hash) -> hash
+ * GC.latest_gc_info(:major_by) -> :malloc
+ *
+ * Returns information about the most recent garbage collection.
+ */
+
static VALUE
-gc_latest_gc_info(rb_execution_context_t *ec, VALUE self, VALUE arg)
+gc_latest_gc_info(int argc, VALUE *argv, VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
+ VALUE arg = Qnil;
- if (NIL_P(arg)) {
- arg = rb_hash_new();
+ if (rb_scan_args(argc, argv, "01", &arg) == 1) {
+ if (!SYMBOL_P(arg) && !RB_TYPE_P(arg, T_HASH)) {
+ rb_raise(rb_eTypeError, "non-hash or symbol given");
+ }
}
- else if (!SYMBOL_P(arg) && !RB_TYPE_P(arg, T_HASH)) {
- rb_raise(rb_eTypeError, "non-hash or symbol given");
+
+ if (arg == Qnil) {
+ arg = rb_hash_new();
}
return gc_info_decode(objspace, arg, 0);
@@ -8844,6 +6388,7 @@ enum gc_stat_sym {
gc_stat_sym_heap_free_slots,
gc_stat_sym_heap_final_slots,
gc_stat_sym_heap_marked_slots,
+ gc_stat_sym_heap_swept_slots,
gc_stat_sym_heap_eden_pages,
gc_stat_sym_heap_tomb_pages,
gc_stat_sym_total_allocated_pages,
@@ -8855,7 +6400,6 @@ enum gc_stat_sym {
#if USE_RGENGC
gc_stat_sym_minor_gc_count,
gc_stat_sym_major_gc_count,
- gc_stat_sym_compact_count,
gc_stat_sym_remembered_wb_unprotected_objects,
gc_stat_sym_remembered_wb_unprotected_objects_limit,
gc_stat_sym_old_objects,
@@ -8921,6 +6465,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);
@@ -8932,7 +6477,6 @@ setup_gc_stat_symbols(void)
#if USE_RGENGC
S(minor_gc_count);
S(major_gc_count);
- S(compact_count);
S(remembered_wb_unprotected_objects);
S(remembered_wb_unprotected_objects_limit);
S(old_objects);
@@ -8993,6 +6537,7 @@ setup_gc_stat_symbols(void)
rb_hash_aset(table, OLD_SYM(heap_live_slot), NEW_SYM(heap_live_slots));
rb_hash_aset(table, OLD_SYM(heap_free_slot), NEW_SYM(heap_free_slots));
rb_hash_aset(table, OLD_SYM(heap_final_slot), NEW_SYM(heap_final_slots));
+ rb_hash_aset(table, OLD_SYM(heap_swept_slot), NEW_SYM(heap_swept_slots));
#if USE_RGEGC
rb_hash_aset(table, OLD_SYM(remembered_shady_object), NEW_SYM(remembered_wb_unprotected_objects));
rb_hash_aset(table, OLD_SYM(remembered_shady_object_limit), NEW_SYM(remembered_wb_unprotected_objects_limit));
@@ -9034,7 +6579,7 @@ compat_key(VALUE key)
}
static VALUE
-default_proc_for_compat_func(RB_BLOCK_CALL_FUNC_ARGLIST(hash, _))
+default_proc_for_compat_func(VALUE hash, VALUE dmy, int argc, VALUE *argv)
{
VALUE key, new_key;
@@ -9049,7 +6594,7 @@ default_proc_for_compat_func(RB_BLOCK_CALL_FUNC_ARGLIST(hash, _))
return Qnil;
}
-static size_t
+size_t
gc_stat_internal(VALUE hash_or_sym)
{
rb_objspace_t *objspace = &rb_objspace;
@@ -9094,8 +6639,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);
@@ -9105,9 +6651,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(compact_count, objspace->profile.compact_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
@@ -9149,23 +6694,70 @@ gc_stat_internal(VALUE hash_or_sym)
return 0;
}
+/*
+ * call-seq:
+ * GC.stat -> Hash
+ * GC.stat(hash) -> hash
+ * GC.stat(:key) -> Numeric
+ *
+ * Returns a Hash containing information about the GC.
+ *
+ * The hash includes information about internal statistics about GC such as:
+ *
+ * {
+ * :count=>0,
+ * :heap_allocated_pages=>24,
+ * :heap_sorted_length=>24,
+ * :heap_allocatable_pages=>0,
+ * :heap_available_slots=>9783,
+ * :heap_live_slots=>7713,
+ * :heap_free_slots=>2070,
+ * :heap_final_slots=>0,
+ * :heap_marked_slots=>0,
+ * :heap_swept_slots=>0,
+ * :heap_eden_pages=>24,
+ * :heap_tomb_pages=>0,
+ * :total_allocated_pages=>24,
+ * :total_freed_pages=>0,
+ * :total_allocated_objects=>7796,
+ * :total_freed_objects=>83,
+ * :malloc_increase_bytes=>2389312,
+ * :malloc_increase_bytes_limit=>16777216,
+ * :minor_gc_count=>0,
+ * :major_gc_count=>0,
+ * :remembered_wb_unprotected_objects=>0,
+ * :remembered_wb_unprotected_objects_limit=>0,
+ * :old_objects=>0,
+ * :old_objects_limit=>0,
+ * :oldmalloc_increase_bytes=>2389760,
+ * :oldmalloc_increase_bytes_limit=>16777216
+ * }
+ *
+ * The contents of the hash are implementation specific and may be changed in
+ * the future.
+ *
+ * This method is only expected to work on C Ruby.
+ *
+ */
+
static VALUE
-gc_stat(rb_execution_context_t *ec, VALUE self, VALUE arg) // arg is (nil || hash || symbol)
+gc_stat(int argc, VALUE *argv, VALUE self)
{
- if (NIL_P(arg)) {
- arg = rb_hash_new();
- }
- else if (SYMBOL_P(arg)) {
- size_t value = gc_stat_internal(arg);
- return SIZET2NUM(value);
- }
- else if (RB_TYPE_P(arg, T_HASH)) {
- // ok
- }
- else {
- rb_raise(rb_eTypeError, "non-hash or symbol given");
+ VALUE arg = Qnil;
+
+ if (rb_scan_args(argc, argv, "01", &arg) == 1) {
+ if (SYMBOL_P(arg)) {
+ size_t value = gc_stat_internal(arg);
+ return SIZET2NUM(value);
+ }
+ else if (!RB_TYPE_P(arg, T_HASH)) {
+ rb_raise(rb_eTypeError, "non-hash or symbol given");
+ }
}
+ if (arg == Qnil) {
+ arg = rb_hash_new();
+ }
gc_stat_internal(arg);
return arg;
}
@@ -9183,8 +6775,15 @@ rb_gc_stat(VALUE key)
}
}
+/*
+ * call-seq:
+ * GC.stress -> fixnum, true or false
+ *
+ * Returns current status of GC stress mode.
+ */
+
static VALUE
-gc_stress_get(rb_execution_context_t *ec, VALUE self)
+gc_stress_get(VALUE self)
{
rb_objspace_t *objspace = &rb_objspace;
return ruby_gc_stress_mode;
@@ -9197,14 +6796,45 @@ gc_stress_set(rb_objspace_t *objspace, VALUE flag)
objspace->gc_stress_mode = flag;
}
+/*
+ * call-seq:
+ * GC.stress = flag -> flag
+ *
+ * Updates the GC stress mode.
+ *
+ * When stress mode is enabled, the GC is invoked at every GC opportunity:
+ * all memory and object allocations.
+ *
+ * Enabling stress mode will degrade performance, it is only for debugging.
+ *
+ * flag can be true, false, or a fixnum bit-ORed following flags.
+ * 0x01:: no major GC
+ * 0x02:: no immediate sweep
+ * 0x04:: full mark after malloc/calloc/realloc
+ */
+
static VALUE
-gc_stress_set_m(rb_execution_context_t *ec, VALUE self, VALUE flag)
+gc_stress_set_m(VALUE self, VALUE flag)
{
rb_objspace_t *objspace = &rb_objspace;
+ rb_secure(2);
gc_stress_set(objspace, flag);
return flag;
}
+/*
+ * call-seq:
+ * GC.enable -> true or false
+ *
+ * Enables garbage collection, returning +true+ if garbage
+ * collection was previously disabled.
+ *
+ * GC.disable #=> false
+ * GC.enable #=> true
+ * GC.enable #=> false
+ *
+ */
+
VALUE
rb_gc_enable(void)
{
@@ -9215,34 +6845,28 @@ rb_gc_enable(void)
return old ? Qtrue : Qfalse;
}
-static VALUE
-gc_enable(rb_execution_context_t *ec, VALUE _)
-{
- return rb_gc_enable();
-}
+/*
+ * call-seq:
+ * GC.disable -> true or false
+ *
+ * Disables garbage collection, returning +true+ if garbage
+ * collection was already disabled.
+ *
+ * GC.disable #=> false
+ * GC.disable #=> true
+ *
+ */
VALUE
-rb_gc_disable_no_rest(void)
+rb_gc_disable(void)
{
rb_objspace_t *objspace = &rb_objspace;
int old = dont_gc;
- dont_gc = TRUE;
- return old ? Qtrue : Qfalse;
-}
-
-VALUE
-rb_gc_disable(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
gc_rest(objspace);
- return rb_gc_disable_no_rest();
-}
-static VALUE
-gc_disable(rb_execution_context_t *ec, VALUE _)
-{
- return rb_gc_disable();
+ dont_gc = TRUE;
+ return old ? Qtrue : Qfalse;
}
static int
@@ -9287,14 +6911,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;
@@ -9304,7 +6928,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;
@@ -9316,29 +6940,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;
}
@@ -9349,9 +6958,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);
}
}
@@ -9368,17 +6977,6 @@ gc_set_initial_pages(void)
* - (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)).
* * 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
@@ -9398,8 +6996,10 @@ gc_set_initial_pages(void)
*/
void
-ruby_gc_set_params(void)
+ruby_gc_set_params(int safe_level)
{
+ if (safe_level > 0) return;
+
/* RUBY_GC_HEAP_FREE_SLOTS */
if (get_envparam_size("RUBY_GC_HEAP_FREE_SLOTS", &gc_params.heap_free_slots, 0)) {
/* ok */
@@ -9417,22 +7017,13 @@ ruby_gc_set_params(void)
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);
- if (!gc_params.malloc_limit_max) { /* ignore max-check if 0 */
- gc_params.malloc_limit_max = SIZE_MAX;
- }
- 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)) {
@@ -9440,7 +7031,7 @@ ruby_gc_set_params(void)
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
}
@@ -9476,12 +7067,6 @@ void
rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *passing_data)
{
rb_objspace_t *objspace = &rb_objspace;
- objspace_reachable_objects_from_root(objspace, func, passing_data);
-}
-
-static void
-objspace_reachable_objects_from_root(rb_objspace_t *objspace, void (func)(const char *category, VALUE, void *), void *passing_data)
-{
struct root_objects_data data;
struct mark_func_data_struct mfd;
@@ -9500,53 +7085,30 @@ objspace_reachable_objects_from_root(rb_objspace_t *objspace, void (func)(const
------------------------ Extended allocator ------------------------
*/
-struct gc_raise_tag {
- VALUE exc;
- const char *fmt;
- va_list *ap;
-};
+static void objspace_xfree(rb_objspace_t *objspace, void *ptr, size_t size);
static void *
-gc_vraise(void *ptr)
+negative_size_allocation_error_with_gvl(void *ptr)
{
- struct gc_raise_tag *argv = ptr;
- rb_vraise(argv->exc, argv->fmt, *argv->ap);
- UNREACHABLE_RETURN(NULL);
+ rb_raise(rb_eNoMemError, "%s", (const char *)ptr);
+ return 0; /* should not be reached */
}
static void
-gc_raise(VALUE exc, const char *fmt, ...)
+negative_size_allocation_error(const char *msg)
{
- va_list ap;
- va_start(ap, fmt);
- struct gc_raise_tag argv = {
- exc, fmt, &ap,
- };
-
if (ruby_thread_has_gvl_p()) {
- gc_vraise(&argv);
- UNREACHABLE;
- }
- else if (ruby_native_thread_p()) {
- rb_thread_call_with_gvl(gc_vraise, &argv);
- UNREACHABLE;
+ rb_raise(rb_eNoMemError, "%s", msg);
}
else {
- /* Not in a ruby thread */
- fprintf(stderr, "%s", "[FATAL] ");
- vfprintf(stderr, fmt, ap);
- abort();
+ if (ruby_native_thread_p()) {
+ rb_thread_call_with_gvl(negative_size_allocation_error_with_gvl, (void *)msg);
+ }
+ else {
+ fprintf(stderr, "[FATAL] %s\n", msg);
+ exit(EXIT_FAILURE);
+ }
}
-
- va_end(ap);
-}
-
-static void objspace_xfree(rb_objspace_t *objspace, void *ptr, size_t size);
-
-static void
-negative_size_allocation_error(const char *msg)
-{
- gc_raise(rb_eNoMemError, "%s", msg);
}
static void *
@@ -9577,43 +7139,33 @@ 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;
-
- if (0) {
- // Print out pid, sleep, so you can attach debugger to see what went wrong:
- fprintf(stderr, "rb_memerror pid=%"PRI_PIDT_PREFIX"d\n", getpid());
- sleep(60);
- }
+ 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);
+ if (rb_thread_raised_p(th, RAISED_NOMEMORY)) {
+ rb_thread_raised_clear(th);
+ GET_THREAD()->errinfo = nomem_error;
+ JUMP_TAG(TAG_RAISE);
}
- else {
- rb_ec_raised_set(ec, RAISED_NOMEMORY);
- exc = ruby_vm_special_exception_copy(exc);
- }
- ec->errinfo = exc;
- EC_JUMP_TAG(ec, TAG_RAISE);
+ rb_thread_raised_set(th, RAISED_NOMEMORY);
+ rb_exc_raise(nomem_error);
}
-void *
-rb_aligned_malloc(size_t alignment, size_t size)
+static void *
+aligned_malloc(size_t alignment, size_t size)
{
void *res;
#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)
@@ -9634,18 +7186,20 @@ rb_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;
}
static void
-rb_aligned_free(void *ptr)
+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);
@@ -9665,9 +7219,9 @@ objspace_malloc_size(rb_objspace_t *objspace, void *ptr, size_t hint)
}
enum memop_type {
- MEMOP_TYPE_MALLOC = 0,
- MEMOP_TYPE_FREE,
- MEMOP_TYPE_REALLOC
+ MEMOP_TYPE_MALLOC = 1,
+ MEMOP_TYPE_FREE = 2,
+ MEMOP_TYPE_REALLOC = 3
};
static inline void
@@ -9686,13 +7240,7 @@ static void
objspace_malloc_gc_stress(rb_objspace_t *objspace)
{
if (ruby_gc_stressful && ruby_native_thread_p()) {
- int reason = GPR_FLAG_IMMEDIATE_MARK | GPR_FLAG_IMMEDIATE_SWEEP |
- GPR_FLAG_STRESS | GPR_FLAG_MALLOC;
-
- if (gc_stress_full_mark_after_malloc_p()) {
- reason |= GPR_FLAG_FULL_MARK;
- }
- garbage_collect_with_gvl(objspace, reason);
+ garbage_collect_with_gvl(objspace, gc_stress_full_mark_after_malloc_p(), TRUE, TRUE, GPR_FLAG_STRESS | GPR_FLAG_MALLOC);
}
}
@@ -9719,7 +7267,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, GPR_FLAG_MALLOC);
+ garbage_collect_with_gvl(objspace, FALSE, FALSE, FALSE, GPR_FLAG_MALLOC);
}
}
@@ -9758,7 +7306,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
}
@@ -9768,27 +7316,16 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
#endif
}
-struct malloc_obj_info { /* 4 words */
- size_t size;
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- size_t gen;
- const char *file;
- size_t line;
-#endif
-};
-
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
-const char *ruby_malloc_info_file;
-int ruby_malloc_info_line;
-#endif
-
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
- size += sizeof(struct malloc_obj_info);
+ size += sizeof(size_t);
#endif
return size;
@@ -9797,22 +7334,9 @@ 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
- {
- struct malloc_obj_info *info = mem;
- info->size = size;
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- info->gen = objspace->profile.count;
- info->file = ruby_malloc_info_file;
- info->line = info->file ? ruby_malloc_info_line : 0;
-#else
- info->file = NULL;
-#endif
- mem = info + 1;
- }
+ ((size_t *)mem)[0] = size;
+ mem = (size_t *)mem + 1;
#endif
return mem;
@@ -9821,40 +7345,34 @@ objspace_malloc_fixup(rb_objspace_t *objspace, void *mem, size_t size)
#define TRY_WITH_GC(alloc) do { \
objspace_malloc_gc_stress(objspace); \
if (!(alloc) && \
- (!garbage_collect_with_gvl(objspace, GPR_FLAG_FULL_MARK | \
- GPR_FLAG_IMMEDIATE_MARK | GPR_FLAG_IMMEDIATE_SWEEP | \
- GPR_FLAG_MALLOC) || \
+ (!garbage_collect_with_gvl(objspace, TRUE, TRUE, TRUE, GPR_FLAG_MALLOC) || /* full/immediate mark && immediate sweep */ \
!(alloc))) { \
ruby_memerror(); \
} \
} 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));
- RB_DEBUG_COUNTER_INC(heap_xmalloc);
+ 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)
-{
- return size_mul_or_raise(count, elsize, rb_eArgError);
-}
-
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.
@@ -9862,50 +7380,14 @@ objspace_xrealloc(rb_objspace_t *objspace, void *ptr, size_t new_size, size_t ol
* see http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_400.htm
*/
if (new_size == 0) {
- if ((mem = objspace_xmalloc0(objspace, 0)) != NULL) {
- /*
- * - OpenBSD's malloc(3) man page says that when 0 is passed, it
- * returns a non-NULL pointer to an access-protected memory page.
- * The returned pointer cannot be read / written at all, but
- * still be a valid argument of free().
- *
- * https://man.openbsd.org/malloc.3
- *
- * - Linux's malloc(3) man page says that it _might_ perhaps return
- * a non-NULL pointer when its argument is 0. That return value
- * is safe (and is expected) to be passed to free().
- *
- * http://man7.org/linux/man-pages/man3/malloc.3.html
- *
- * - As I read the implementation jemalloc's malloc() returns fully
- * normal 16 bytes memory region when its argument is 0.
- *
- * - As I read the implementation musl libc's malloc() returns
- * fully normal 32 bytes memory region when its argument is 0.
- *
- * - Other malloc implementations can also return non-NULL.
- */
- objspace_xfree(objspace, ptr, old_size);
- return mem;
- }
- else {
- /*
- * It is dangerous to return NULL here, because that could lead to
- * RCE. Fallback to 1 byte instead of zero.
- *
- * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11932
- */
- new_size = 1;
- }
+ objspace_xfree(objspace, ptr, old_size);
+ return 0;
}
#if CALC_EXACT_MALLOC_SIZE
- {
- struct malloc_obj_info *info = (struct malloc_obj_info *)ptr - 1;
- new_size += sizeof(struct malloc_obj_info);
- ptr = info;
- old_size = info->size;
- }
+ new_size += sizeof(size_t);
+ ptr = (size_t *)ptr - 1;
+ old_size = ((size_t *)ptr)[0];
#endif
old_size = objspace_malloc_size(objspace, ptr, old_size);
@@ -9913,191 +7395,70 @@ objspace_xrealloc(rb_objspace_t *objspace, void *ptr, size_t new_size, size_t ol
new_size = objspace_malloc_size(objspace, mem, new_size);
#if CALC_EXACT_MALLOC_SIZE
- {
- struct malloc_obj_info *info = mem;
- info->size = new_size;
- mem = info + 1;
- }
+ ((size_t *)mem)[0] = new_size;
+ mem = (size_t *)mem + 1;
#endif
objspace_malloc_increase(objspace, mem, new_size, old_size, MEMOP_TYPE_REALLOC);
- RB_DEBUG_COUNTER_INC(heap_xrealloc);
return mem;
}
-#if CALC_EXACT_MALLOC_SIZE && USE_GC_MALLOC_OBJ_INFO_DETAILS
-
-#define MALLOC_INFO_GEN_SIZE 100
-#define MALLOC_INFO_SIZE_SIZE 10
-static size_t malloc_info_gen_cnt[MALLOC_INFO_GEN_SIZE];
-static size_t malloc_info_gen_size[MALLOC_INFO_GEN_SIZE];
-static size_t malloc_info_size[MALLOC_INFO_SIZE_SIZE+1];
-static st_table *malloc_info_file_table;
-
-static int
-mmalloc_info_file_i(st_data_t key, st_data_t val, st_data_t dmy)
-{
- const char *file = (void *)key;
- const size_t *data = (void *)val;
-
- fprintf(stderr, "%s\t%d\t%d\n", file, (int)data[0], (int)data[1]);
-
- return ST_CONTINUE;
-}
-
-__attribute__((destructor))
-void
-rb_malloc_info_show_results(void)
-{
- int i;
-
- fprintf(stderr, "* malloc_info gen statistics\n");
- for (i=0; i<MALLOC_INFO_GEN_SIZE; i++) {
- if (i == MALLOC_INFO_GEN_SIZE-1) {
- fprintf(stderr, "more\t%d\t%d\n", (int)malloc_info_gen_cnt[i], (int)malloc_info_gen_size[i]);
- }
- else {
- fprintf(stderr, "%d\t%d\t%d\n", i, (int)malloc_info_gen_cnt[i], (int)malloc_info_gen_size[i]);
- }
- }
-
- fprintf(stderr, "* malloc_info size statistics\n");
- for (i=0; i<MALLOC_INFO_SIZE_SIZE; i++) {
- int s = 16 << i;
- fprintf(stderr, "%d\t%d\n", (int)s, (int)malloc_info_size[i]);
- }
- fprintf(stderr, "more\t%d\n", (int)malloc_info_size[i]);
-
- if (malloc_info_file_table) {
- fprintf(stderr, "* malloc_info file statistics\n");
- st_foreach(malloc_info_file_table, mmalloc_info_file_i, 0);
- }
-}
-#else
-void
-rb_malloc_info_show_results(void)
-{
-}
-#endif
-
static void
objspace_xfree(rb_objspace_t *objspace, void *ptr, size_t old_size)
{
- if (!ptr) {
- /*
- * ISO/IEC 9899 says "If ptr is a null pointer, no action occurs" since
- * its first version. We would better follow.
- */
- return;
- }
#if CALC_EXACT_MALLOC_SIZE
- struct malloc_obj_info *info = (struct malloc_obj_info *)ptr - 1;
- ptr = info;
- old_size = info->size;
-
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- {
- int gen = (int)(objspace->profile.count - info->gen);
- int gen_index = gen >= MALLOC_INFO_GEN_SIZE ? MALLOC_INFO_GEN_SIZE-1 : gen;
- int i;
-
- malloc_info_gen_cnt[gen_index]++;
- malloc_info_gen_size[gen_index] += info->size;
-
- for (i=0; i<MALLOC_INFO_SIZE_SIZE; i++) {
- size_t s = 16 << i;
- if (info->size <= s) {
- malloc_info_size[i]++;
- goto found;
- }
- }
- malloc_info_size[i]++;
- found:;
-
- {
- st_data_t key = (st_data_t)info->file;
- size_t *data;
-
- if (malloc_info_file_table == NULL) {
- malloc_info_file_table = st_init_numtable_with_size(1024);
- }
- if (st_lookup(malloc_info_file_table, key, (st_data_t *)&data)) {
- /* hit */
- }
- else {
- data = malloc(xmalloc2_size(2, sizeof(size_t)));
- if (data == NULL) rb_bug("objspace_xfree: can not allocate memory");
- data[0] = data[1] = 0;
- st_insert(malloc_info_file_table, key, (st_data_t)data);
- }
- data[0] ++;
- data[1] += info->size;
- };
-#if 0 /* verbose output */
- if (gen >= 2) {
- if (info->file) {
- fprintf(stderr, "free - size:%d, gen:%d, pos: %s:%d\n", (int)info->size, gen, info->file, (int)info->line);
- }
- else {
- fprintf(stderr, "free - size:%d, gen:%d\n", (int)info->size, gen);
- }
- }
-#endif
- }
-#endif
+ ptr = ((size_t *)ptr) - 1;
+ old_size = ((size_t*)ptr)[0];
#endif
old_size = objspace_malloc_size(objspace, ptr, old_size);
free(ptr);
- RB_DEBUG_COUNTER_INC(heap_xfree);
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_body(size_t size)
+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_body(size_t n, size_t size)
+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 = calloc1(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_body(size_t n, size_t size)
+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
@@ -10106,15 +7467,11 @@ ruby_xcalloc_body(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);
}
void *
-ruby_xrealloc_body(void *ptr, size_t new_size)
+ruby_xrealloc(void *ptr, size_t new_size)
{
return ruby_sized_xrealloc(ptr, new_size, 0);
}
@@ -10125,12 +7482,15 @@ ruby_xrealloc_body(void *ptr, size_t new_size)
void *
ruby_sized_xrealloc2(void *ptr, size_t n, size_t size, size_t old_n)
{
- size_t len = xmalloc2_size(n, size);
+ size_t len = size * n;
+ if (n != 0 && size != len / n) {
+ rb_raise(rb_eArgError, "realloc: possible integer overflow");
+ }
return objspace_xrealloc(&rb_objspace, ptr, len, old_n * size);
}
void *
-ruby_xrealloc2_body(void *ptr, size_t n, size_t size)
+ruby_xrealloc2(void *ptr, size_t n, size_t size)
{
return ruby_sized_xrealloc2(ptr, n, size, 0);
}
@@ -10152,34 +7512,6 @@ ruby_xfree(void *x)
ruby_sized_xfree(x, 0);
}
-void *
-rb_xmalloc_mul_add(size_t x, size_t y, size_t z) /* x * y + z */
-{
- size_t w = size_mul_add_or_raise(x, y, z, rb_eArgError);
- return ruby_xmalloc(w);
-}
-
-void *
-rb_xrealloc_mul_add(const void *p, size_t x, size_t y, size_t z) /* x * y + z */
-{
- size_t w = size_mul_add_or_raise(x, y, z, rb_eArgError);
- return ruby_xrealloc((void *)p, w);
-}
-
-void *
-rb_xmalloc_mul_add_mul(size_t x, size_t y, size_t z, size_t w) /* x * y + z * w */
-{
- size_t u = size_mul_add_mul_or_raise(x, y, z, w, rb_eArgError);
- return ruby_xmalloc(u);
-}
-
-void *
-rb_xcalloc_mul_add_mul(size_t x, size_t y, size_t z, size_t w) /* x * y + z * w */
-{
- size_t u = size_mul_add_mul_or_raise(x, y, z, w, rb_eArgError);
- return ruby_xcalloc(u, 1);
-}
-
/* Mimic ruby_xmalloc, but need not rb_objspace.
* should return pointer suitable for ruby_xfree
*/
@@ -10188,27 +7520,13 @@ ruby_mimmalloc(size_t size)
{
void *mem;
#if CALC_EXACT_MALLOC_SIZE
- size += sizeof(struct malloc_obj_info);
+ size += sizeof(size_t);
#endif
mem = malloc(size);
#if CALC_EXACT_MALLOC_SIZE
- if (!mem) {
- return NULL;
- }
- else
/* set 0 for consistency of allocated_size/allocations */
- {
- struct malloc_obj_info *info = mem;
- info->size = 0;
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- info->gen = 0;
- info->file = NULL;
- info->line = 0;
-#else
- info->file = NULL;
-#endif
- mem = info + 1;
- }
+ ((size_t *)mem)[0] = 0;
+ mem = (size_t *)mem + 1;
#endif
return mem;
}
@@ -10216,52 +7534,11 @@ ruby_mimmalloc(size_t size)
void
ruby_mimfree(void *ptr)
{
+ size_t *mem = (size_t *)ptr;
#if CALC_EXACT_MALLOC_SIZE
- struct malloc_obj_info *info = (struct malloc_obj_info *)ptr - 1;
- ptr = info;
+ mem = mem - 1;
#endif
- free(ptr);
-}
-
-void *
-rb_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t size, size_t cnt)
-{
- void *ptr;
- VALUE imemo;
- rb_imemo_tmpbuf_t *tmpbuf;
-
- /* Keep the order; allocate an empty imemo first then xmalloc, to
- * get rid of potential memory leak */
- imemo = rb_imemo_tmpbuf_auto_free_maybe_mark_buffer(NULL, 0);
- *store = imemo;
- ptr = ruby_xmalloc0(size);
- tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
- tmpbuf->ptr = ptr;
- tmpbuf->cnt = cnt;
- 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_tmpbuf_t *s = (rb_imemo_tmpbuf_t*)ATOMIC_VALUE_EXCHANGE(*store, 0);
- if (s) {
- void *ptr = ATOMIC_PTR_EXCHANGE(s->ptr, 0);
- s->cnt = 0;
- ruby_xfree(ptr);
- }
+ free(mem);
}
#if MALLOC_ALLOCATED_SIZE
@@ -10296,18 +7573,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 ------------------------------
*/
@@ -10332,22 +7597,13 @@ wmap_mark_map(st_data_t key, st_data_t val, st_data_t arg)
#endif
static void
-wmap_compact(void *ptr)
-{
- struct weakmap *w = ptr;
- if (w->wmap2obj) rb_gc_update_tbl_refs(w->wmap2obj);
- if (w->obj2wmap) rb_gc_update_tbl_refs(w->obj2wmap);
- w->final = rb_gc_location(w->final);
-}
-
-static void
wmap_mark(void *ptr)
{
struct weakmap *w = ptr;
#if WMAP_DELETE_DEAD_OBJECT_IN_MARK
if (w->obj2wmap) st_foreach(w->obj2wmap, wmap_mark_map, (st_data_t)&rb_objspace);
#endif
- rb_gc_mark_movable(w->final);
+ rb_gc_mark(w->final);
}
static int
@@ -10380,6 +7636,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);
@@ -10393,35 +7650,22 @@ static const rb_data_type_t weakmap_type = {
wmap_mark,
wmap_free,
wmap_memsize,
- wmap_compact,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
-extern const struct st_hash_type rb_hashtype_ident;
-static VALUE wmap_finalize(RB_BLOCK_CALL_FUNC_ARGLIST(objid, self));
-
static VALUE
wmap_allocate(VALUE klass)
{
struct weakmap *w;
VALUE obj = TypedData_Make_Struct(klass, struct weakmap, &weakmap_type, w);
- w->obj2wmap = st_init_table(&rb_hashtype_ident);
- w->wmap2obj = st_init_table(&rb_hashtype_ident);
- w->final = rb_func_lambda_new(wmap_finalize, obj, 1, 1);
+ w->obj2wmap = st_init_numtable();
+ w->wmap2obj = st_init_numtable();
+ w->final = rb_obj_method(obj, ID2SYM(rb_intern("finalize")));
return obj;
}
static int
-wmap_live_p(rb_objspace_t *objspace, VALUE obj)
-{
- if (!FL_ABLE(obj)) return TRUE;
- if (!is_id_value(objspace, obj)) return FALSE;
- if (!is_live_object(objspace, obj)) return FALSE;
- return TRUE;
-}
-
-static int
wmap_final_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
{
VALUE wmap, *ptr, size, i, j;
@@ -10437,16 +7681,15 @@ wmap_final_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing)
return ST_DELETE;
}
if (j < i) {
- SIZED_REALLOC_N(ptr, VALUE, j + 1, i);
+ ptr = ruby_sized_xrealloc2(ptr, j + 1, sizeof(VALUE), i);
ptr[0] = j;
*value = (st_data_t)ptr;
}
return ST_CONTINUE;
}
-/* :nodoc: */
static VALUE
-wmap_finalize(RB_BLOCK_CALL_FUNC_ARGLIST(objid, self))
+wmap_finalize(VALUE self, VALUE objid)
{
st_data_t orig, wmap, data;
VALUE obj, *rids, i, size;
@@ -10454,9 +7697,7 @@ wmap_finalize(RB_BLOCK_CALL_FUNC_ARGLIST(objid, self))
TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
/* Get reference from object id. */
- if ((obj = id2ref_obj_tbl(&rb_objspace, objid)) == Qundef) {
- rb_bug("wmap_finalize: objid is not found.");
- }
+ obj = obj_id_to_ref(objid);
/* obj is original referenced object and/or weak reference. */
orig = (st_data_t)obj;
@@ -10501,6 +7742,8 @@ wmap_inspect_i(st_data_t key, st_data_t val, st_data_t arg)
rb_str_cat2(str, " => ");
v = SPECIAL_CONST_P(v) ? rb_inspect(v) : rb_any_to_s(v);
rb_str_append(str, v);
+ OBJ_INFECT(str, k);
+ OBJ_INFECT(str, v);
return ST_CONTINUE;
}
@@ -10527,7 +7770,7 @@ wmap_each_i(st_data_t key, st_data_t val, st_data_t arg)
{
rb_objspace_t *objspace = (rb_objspace_t *)arg;
VALUE obj = (VALUE)val;
- if (wmap_live_p(objspace, obj)) {
+ if (is_id_value(objspace, obj) && is_live_object(objspace, obj)) {
rb_yield_values(2, (VALUE)key, obj);
}
return ST_CONTINUE;
@@ -10550,7 +7793,7 @@ wmap_each_key_i(st_data_t key, st_data_t val, st_data_t arg)
{
rb_objspace_t *objspace = (rb_objspace_t *)arg;
VALUE obj = (VALUE)val;
- if (wmap_live_p(objspace, obj)) {
+ if (is_id_value(objspace, obj) && is_live_object(objspace, obj)) {
rb_yield((VALUE)key);
}
return ST_CONTINUE;
@@ -10573,7 +7816,7 @@ wmap_each_value_i(st_data_t key, st_data_t val, st_data_t arg)
{
rb_objspace_t *objspace = (rb_objspace_t *)arg;
VALUE obj = (VALUE)val;
- if (wmap_live_p(objspace, obj)) {
+ if (is_id_value(objspace, obj) && is_live_object(objspace, obj)) {
rb_yield(obj);
}
return ST_CONTINUE;
@@ -10598,7 +7841,7 @@ wmap_keys_i(st_data_t key, st_data_t val, st_data_t arg)
rb_objspace_t *objspace = argp->objspace;
VALUE ary = argp->value;
VALUE obj = (VALUE)val;
- if (wmap_live_p(objspace, obj)) {
+ if (is_id_value(objspace, obj) && is_live_object(objspace, obj)) {
rb_ary_push(ary, (VALUE)key);
}
return ST_CONTINUE;
@@ -10625,7 +7868,7 @@ wmap_values_i(st_data_t key, st_data_t val, st_data_t arg)
rb_objspace_t *objspace = argp->objspace;
VALUE ary = argp->value;
VALUE obj = (VALUE)val;
- if (wmap_live_p(objspace, obj)) {
+ if (is_id_value(objspace, obj) && is_live_object(objspace, obj)) {
rb_ary_push(ary, obj);
}
return ST_CONTINUE;
@@ -10652,12 +7895,12 @@ wmap_aset_update(st_data_t *key, st_data_t *val, st_data_t arg, int existing)
if (existing) {
size = (ptr = optr = (VALUE *)*val)[0];
++size;
- SIZED_REALLOC_N(ptr, VALUE, size + 1, size);
+ ptr = ruby_sized_xrealloc2(ptr, size + 1, sizeof(VALUE), size);
}
else {
optr = 0;
size = 1;
- ptr = ruby_xmalloc0(2 * sizeof(VALUE));
+ ptr = ruby_xmalloc2(2, sizeof(VALUE));
}
ptr[0] = size;
ptr[size] = (VALUE)arg;
@@ -10673,13 +7916,10 @@ wmap_aset(VALUE self, VALUE wmap, VALUE orig)
struct weakmap *w;
TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
- if (FL_ABLE(orig)) {
- define_final0(orig, w->final);
- }
- if (FL_ABLE(wmap)) {
- define_final0(wmap, w->final);
- }
-
+ should_be_finalizable(orig);
+ should_be_finalizable(wmap);
+ define_final0(orig, w->final);
+ define_final0(wmap, w->final);
st_update(w->obj2wmap, (st_data_t)orig, wmap_aset_update, wmap);
st_insert(w->wmap2obj, (st_data_t)wmap, (st_data_t)orig);
return nonspecial_obj_id(orig);
@@ -10697,7 +7937,8 @@ wmap_aref(VALUE self, VALUE wmap)
TypedData_Get_Struct(self, struct weakmap, &weakmap_type, w);
if (!st_lookup(w->wmap2obj, (st_data_t)wmap, &data)) return Qnil;
obj = (VALUE)data;
- if (!wmap_live_p(objspace, obj)) return Qnil;
+ if (!is_id_value(objspace, obj)) return Qnil;
+ if (!is_live_object(objspace, obj)) return Qnil;
return obj;
}
@@ -10708,7 +7949,6 @@ wmap_has_key(VALUE self, VALUE key)
return NIL_P(wmap_aref(self, key)) ? Qfalse : Qtrue;
}
-/* Returns the number of referenced objects */
static VALUE
wmap_size(VALUE self)
{
@@ -10797,14 +8037,11 @@ gc_prof_setup_new_record(rb_objspace_t *objspace, int reason)
if (!objspace->profile.records) {
objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE;
- objspace->profile.records = malloc(xmalloc2_size(sizeof(gc_profile_record), objspace->profile.size));
+ 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, xmalloc2_size(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");
@@ -10817,7 +8054,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;
@@ -10867,12 +8104,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();
@@ -10883,7 +8120,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);
@@ -10895,7 +8134,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);
@@ -10908,7 +8149,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;
@@ -10949,7 +8192,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;
@@ -10972,17 +8215,19 @@ gc_prof_set_heap_info(rb_objspace_t *objspace)
*/
static VALUE
-gc_profile_clear(VALUE _)
+gc_profile_clear(void)
{
rb_objspace_t *objspace = &rb_objspace;
- void *p = objspace->profile.records;
- objspace->profile.records = NULL;
- objspace->profile.size = 0;
+ if (GC_PROFILE_RECORD_DEFAULT_SIZE * 2 < objspace->profile.size) {
+ objspace->profile.size = GC_PROFILE_RECORD_DEFAULT_SIZE * 2;
+ objspace->profile.records = realloc(objspace->profile.records, sizeof(gc_profile_record) * objspace->profile.size);
+ if (!objspace->profile.records) {
+ rb_memerror();
+ }
+ }
+ MEMZERO(objspace->profile.records, gc_profile_record, objspace->profile.size);
objspace->profile.next_index = 0;
objspace->profile.current_record = 0;
- if (p) {
- free(p);
- }
return Qnil;
}
@@ -11037,7 +8282,7 @@ gc_profile_clear(VALUE _)
*/
static VALUE
-gc_profile_record_get(VALUE _)
+gc_profile_record_get(void)
{
VALUE prof;
VALUE gc_profile = rb_ary_new();
@@ -11076,8 +8321,8 @@ gc_profile_record_get(VALUE _)
#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);
}
@@ -11108,6 +8353,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
@@ -11135,7 +8382,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));
}
@@ -11159,7 +8406,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
@@ -11224,11 +8471,11 @@ gc_profile_dump_on(VALUE out, VALUE (*append)(VALUE, VALUE))
*/
static VALUE
-gc_profile_result(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;
}
/*
@@ -11245,7 +8492,12 @@ gc_profile_report(int argc, VALUE *argv, VALUE self)
{
VALUE out;
- out = (!rb_check_arity(argc, 0, 1) ? rb_stdout : argv[0]);
+ if (argc == 0) {
+ out = rb_stdout;
+ }
+ else {
+ rb_scan_args(argc, argv, "01", &out);
+ }
gc_profile_dump_on(out, rb_io_write);
return Qnil;
@@ -11298,7 +8550,7 @@ gc_profile_enable_get(VALUE self)
*/
static VALUE
-gc_profile_enable(VALUE _)
+gc_profile_enable(void)
{
rb_objspace_t *objspace = &rb_objspace;
objspace->profile.run = TRUE;
@@ -11315,7 +8567,7 @@ gc_profile_enable(VALUE _)
*/
static VALUE
-gc_profile_disable(VALUE _)
+gc_profile_disable(void)
{
rb_objspace_t *objspace = &rb_objspace;
@@ -11354,9 +8606,8 @@ 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_MOVED);
TYPE_NAME(T_ZOMBIE);
case T_DATA:
if (obj && rb_objspace_data_type_name(obj)) {
@@ -11374,275 +8625,82 @@ obj_type_name(VALUE obj)
return type_name(TYPE(obj), obj);
}
-const char *
-rb_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("rb_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)
-{
- if (buff_size > 0 && iseq->body && iseq->body->location.label && !RB_TYPE_P(iseq->body->location.pathobj, T_MOVED)) {
- VALUE path = rb_iseq_path(iseq);
- VALUE n = iseq->body->location.first_lineno;
- snprintf(buff, buff_size, " %s@%s:%d",
- RSTRING_PTR(iseq->body->location.label),
- RSTRING_PTR(path),
- n ? FIX2INT(n) : 0 );
- }
-}
-
-const char *
-rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
+static const char *
+obj_info(VALUE obj)
{
- int pos = 0;
-
-#define BUFF_ARGS buff + pos, buff_size - pos
-#define APPENDF(f) if ((pos += snprintf f) >= buff_size) goto end
- if (SPECIAL_CONST_P(obj)) {
- APPENDF((BUFF_ARGS, "%s", obj_type_name(obj)));
+ int index = obj_info_buffers_index++;
+ char *buff = &obj_info_buffers[index][0];
+ int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
- if (FIXNUM_P(obj)) {
- APPENDF((BUFF_ARGS, " %ld", FIX2LONG(obj)));
- }
- else if (SYMBOL_P(obj)) {
- APPENDF((BUFF_ARGS, " %s", rb_id2name(SYM2ID(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);
-
- if (is_pointer_to_heap(&rb_objspace, (void *)obj)) {
- APPENDF((BUFF_ARGS, "%p [%d%s%s%s%s%s] %s ",
- (void *)obj, age,
- C(RVALUE_UNCOLLECTIBLE_BITMAP(obj), "L"),
- C(RVALUE_MARK_BITMAP(obj), "M"),
- C(RVALUE_PIN_BITMAP(obj), "P"),
- C(RVALUE_MARKING_BITMAP(obj), "R"),
- C(RVALUE_WB_UNPROTECTED_BITMAP(obj), "U"),
- obj_type_name(obj)));
- }
- else {
- /* fake */
- APPENDF((BUFF_ARGS, "%p [%dXXXX] %s",
- (void *)obj, age,
- obj_type_name(obj)));
- }
-#else
- APPENDF((BUFF_ARGS, "%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) {
- APPENDF((BUFF_ARGS, "(temporary internal)"));
- }
- else {
- if (RTEST(RBASIC(obj)->klass)) {
- VALUE class_path = rb_class_path_cached(RBASIC(obj)->klass);
- if (!NIL_P(class_path)) {
- APPENDF((BUFF_ARGS, "(%s)", RSTRING_PTR(class_path)));
- }
- }
- }
-
-#if GC_DEBUG
- APPENDF((BUFF_ARGS, "@%s:%d", RANY(obj)->file, RANY(obj)->line));
-#endif
-
- switch (type) {
- case T_NODE:
- UNEXPECTED_NODE(rb_raw_obj_info);
- break;
- case T_ARRAY:
- if (FL_TEST(obj, ELTS_SHARED)) {
- APPENDF((BUFF_ARGS, "shared -> %s",
- rb_obj_info(RARRAY(obj)->as.heap.aux.shared_root)));
- }
- else if (FL_TEST(obj, RARRAY_EMBED_FLAG)) {
- APPENDF((BUFF_ARGS, "[%s%s] len: %d (embed)",
- C(ARY_EMBED_P(obj), "E"),
- C(ARY_SHARED_P(obj), "S"),
- (int)RARRAY_LEN(obj)));
- }
- else {
- APPENDF((BUFF_ARGS, "[%s%s%s] len: %d, capa:%d ptr:%p",
- C(ARY_EMBED_P(obj), "E"),
- C(ARY_SHARED_P(obj), "S"),
- C(RARRAY_TRANSIENT_P(obj), "T"),
- (int)RARRAY_LEN(obj),
- ARY_EMBED_P(obj) ? -1 : (int)RARRAY(obj)->as.heap.aux.capa,
- (void *)RARRAY_CONST_PTR_TRANSIENT(obj)));
- }
- break;
- case T_STRING: {
- APPENDF((BUFF_ARGS, "%s", RSTRING_PTR(obj)));
- break;
- }
- case T_MOVED: {
- APPENDF((BUFF_ARGS, "-> %p", (void*)rb_gc_location(obj)));
- break;
- }
- case T_HASH: {
- APPENDF((BUFF_ARGS, "[%c%c] %d",
- RHASH_AR_TABLE_P(obj) ? 'A' : 'S',
- RHASH_TRANSIENT_P(obj) ? 'T' : ' ',
- (int)RHASH_SIZE(obj)));
- break;
- }
- case T_CLASS:
- case T_MODULE:
- {
- VALUE class_path = rb_class_path_cached(obj);
- if (!NIL_P(class_path)) {
- APPENDF((BUFF_ARGS, "%s", RSTRING_PTR(class_path)));
- }
- break;
- }
- case T_ICLASS:
- {
- VALUE class_path = rb_class_path_cached(RBASIC_CLASS(obj));
- if (!NIL_P(class_path)) {
- APPENDF((BUFF_ARGS, "src:%s", RSTRING_PTR(class_path)));
- }
- break;
- }
- case T_OBJECT:
- {
- uint32_t len = ROBJECT_NUMIV(obj);
-
- if (RANY(obj)->as.basic.flags & ROBJECT_EMBED) {
- APPENDF((BUFF_ARGS, "(embed) len:%d", len));
- }
- else {
- VALUE *ptr = ROBJECT_IVPTR(obj);
- APPENDF((BUFF_ARGS, "len:%d ptr:%p", len, (void *)ptr));
- }
- }
- 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_ARGS, iseq);
- }
- else {
- const char * const type_name = rb_objspace_data_type_name(obj);
- if (type_name) {
- APPENDF((BUFF_ARGS, "%s", 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_STRING: {
+ snprintf(buff, OBJ_INFO_BUFFERS_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, 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(tmpbuf);
- IMEMO_NAME(ast);
- IMEMO_NAME(parser_strterm);
-#undef IMEMO_NAME
- default: UNREACHABLE;
- }
- APPENDF((BUFF_ARGS, "/%s", imemo_name));
-
- switch (imemo_type(obj)) {
- case imemo_ment: {
- const rb_method_entry_t *me = &RANY(obj)->as.imemo.ment;
- if (me->def) {
- APPENDF((BUFF_ARGS, "(called_id: %s, type: %s, alias: %d, owner: %s, defined_class: %s)",
- rb_id2name(me->called_id),
- rb_method_type_name(me->def->type),
- me->def->alias_count,
- obj_info(me->owner),
- obj_info(me->defined_class)));
- }
- else {
- APPENDF((BUFF_ARGS, "%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_ARGS, iseq);
- break;
- }
- default:
- break;
- }
}
- default:
- break;
- }
+ break;
+ }
+ default:
+ break;
+ }
+#endif
#undef TF
#undef C
- }
- end:
+
return buff;
-#undef APPENDF
-#undef BUFF_ARGS
}
-#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)
@@ -11651,26 +8709,6 @@ obj_info(VALUE obj)
}
#endif
-MJIT_FUNC_EXPORTED const char *
-rb_obj_info(VALUE obj)
-{
- return obj_info(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));
-}
-
-void
-rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func)
-{
- char buff[0x100];
- fprintf(stderr, "<OBJ_INFO:%s@%s:%d> %s\n", func, file, line, rb_raw_obj_info(buff, 0x100, obj));
-}
-
#if GC_DEBUG
void
@@ -11680,12 +8718,6 @@ rb_gcdebug_print_obj_condition(VALUE obj)
fprintf(stderr, "created at: %s:%d\n", RANY(obj)->file, RANY(obj)->line);
- if (BUILTIN_TYPE(obj) == T_MOVED) {
- fprintf(stderr, "moved?: true\n");
- }
- else {
- fprintf(stderr, "moved?: false\n");
- }
if (is_pointer_to_heap(objspace, (void *)obj)) {
fprintf(stderr, "pointer to heap?: true\n");
}
@@ -11695,7 +8727,6 @@ rb_gcdebug_print_obj_condition(VALUE obj)
}
fprintf(stderr, "marked? : %s\n", MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(obj), obj) ? "true" : "false");
- fprintf(stderr, "pinned? : %s\n", MARKED_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj) ? "true" : "false");
#if USE_RGENGC
fprintf(stderr, "age? : %d\n", RVALUE_AGE(obj));
fprintf(stderr, "old? : %s\n", RVALUE_OLD_P(obj) ? "true" : "false");
@@ -11713,7 +8744,7 @@ rb_gcdebug_print_obj_condition(VALUE obj)
}
static VALUE
-gcdebug_sentinel(RB_BLOCK_CALL_FUNC_ARGLIST(obj, name))
+gcdebug_sentinel(VALUE obj, VALUE name)
{
fprintf(stderr, "WARNING: object %s(%p) is inadvertently collected\n", (char *)name, (void *)obj);
return Qnil;
@@ -11727,52 +8758,6 @@ rb_gcdebug_sentinel(VALUE obj, const char *name)
#endif /* GC_DEBUG */
-#if GC_DEBUG_STRESS_TO_CLASS
-/*
- * call-seq:
- * GC.add_stress_to_class(class[, ...])
- *
- * Raises NoMemoryError when allocating an instance of the given classes.
- *
- */
-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;
-}
-
-/*
- * call-seq:
- * GC.remove_stress_to_class(class[, ...])
- *
- * No longer raises NoMemoryError when allocating an instance of the
- * given classes.
- *
- */
-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
*
@@ -11784,8 +8769,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"
*
@@ -11826,7 +8809,16 @@ rb_gcdebug_remove_stress_to_class(int argc, VALUE *argv, VALUE self)
* See also GC.count, GC.malloc_allocated_size and GC.malloc_allocations
*/
-#include "gc.rbinc"
+/*
+ * The GC module provides an interface to Ruby's mark and
+ * sweep garbage collection mechanism.
+ *
+ * Some of the underlying methods are also available via the ObjectSpace
+ * module.
+ *
+ * You may obtain information about the operation of the GC through
+ * GC::Profiler.
+ */
void
Init_GC(void)
@@ -11837,15 +8829,22 @@ Init_GC(void)
VALUE gc_constants;
rb_mGC = rb_define_module("GC");
- load_gc();
+ rb_define_singleton_method(rb_mGC, "start", gc_start_internal, -1);
+ rb_define_singleton_method(rb_mGC, "enable", rb_gc_enable, 0);
+ rb_define_singleton_method(rb_mGC, "disable", rb_gc_disable, 0);
+ rb_define_singleton_method(rb_mGC, "stress", gc_stress_get, 0);
+ rb_define_singleton_method(rb_mGC, "stress=", gc_stress_set_m, 1);
+ rb_define_singleton_method(rb_mGC, "count", gc_count, 0);
+ rb_define_singleton_method(rb_mGC, "stat", gc_stat, -1);
+ rb_define_singleton_method(rb_mGC, "latest_gc_info", gc_latest_gc_info, -1);
+ rb_define_method(rb_mGC, "garbage_collect", gc_start_internal, -1);
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);
- /* internal constants */
rb_define_const(rb_mGC, "INTERNAL_CONSTANTS", gc_constants);
rb_mProfiler = rb_define_module_under(rb_mGC, "Profiler");
@@ -11859,13 +8858,13 @@ Init_GC(void)
rb_define_singleton_method(rb_mProfiler, "total_time", gc_profile_total_time, 0);
rb_mObjSpace = rb_define_module("ObjectSpace");
-
rb_define_module_function(rb_mObjSpace, "each_object", os_each_obj, -1);
+ rb_define_module_function(rb_mObjSpace, "garbage_collect", gc_start_internal, -1);
rb_define_module_function(rb_mObjSpace, "define_finalizer", define_final, -1);
rb_define_module_function(rb_mObjSpace, "undefine_finalizer", undefine_final, 1);
- rb_define_module_function(rb_mObjSpace, "_id2ref", os_id2ref, 1);
+ rb_define_module_function(rb_mObjSpace, "_id2ref", id2ref, 1);
rb_vm_register_special_exception(ruby_error_nomemory, rb_eNoMemError, "failed to allocate memory");
@@ -11891,28 +8890,22 @@ Init_GC(void)
rb_define_method(rb_cWeakMap, "values", wmap_values, 0);
rb_define_method(rb_cWeakMap, "size", wmap_size, 0);
rb_define_method(rb_cWeakMap, "length", wmap_size, 0);
+ rb_define_private_method(rb_cWeakMap, "finalize", wmap_finalize, 1);
rb_include_module(rb_cWeakMap, rb_mEnumerable);
}
/* internal methods */
- rb_define_singleton_method(rb_mGC, "verify_internal_consistency", gc_verify_internal_consistency_m, 0);
- rb_define_singleton_method(rb_mGC, "verify_compaction_references", gc_verify_compaction_references, -1);
- rb_define_singleton_method(rb_mGC, "verify_transient_heap_internal_consistency", gc_verify_transient_heap_internal_consistency, 0);
+ rb_define_singleton_method(rb_mGC, "verify_internal_consistency", gc_verify_internal_consistency, 0);
#if MALLOC_ALLOCATED_SIZE
rb_define_singleton_method(rb_mGC, "malloc_allocated_size", gc_malloc_allocated_size, 0);
rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0);
#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;
- /* GC build options */
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);
@@ -11929,69 +8922,3 @@ Init_GC(void)
OBJ_FREEZE(opts);
}
}
-
-#ifdef ruby_xmalloc
-#undef ruby_xmalloc
-#endif
-#ifdef ruby_xmalloc2
-#undef ruby_xmalloc2
-#endif
-#ifdef ruby_xcalloc
-#undef ruby_xcalloc
-#endif
-#ifdef ruby_xrealloc
-#undef ruby_xrealloc
-#endif
-#ifdef ruby_xrealloc2
-#undef ruby_xrealloc2
-#endif
-
-void *
-ruby_xmalloc(size_t size)
-{
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- ruby_malloc_info_file = __FILE__;
- ruby_malloc_info_line = __LINE__;
-#endif
- return ruby_xmalloc_body(size);
-}
-
-void *
-ruby_xmalloc2(size_t n, size_t size)
-{
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- ruby_malloc_info_file = __FILE__;
- ruby_malloc_info_line = __LINE__;
-#endif
- return ruby_xmalloc2_body(n, size);
-}
-
-void *
-ruby_xcalloc(size_t n, size_t size)
-{
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- ruby_malloc_info_file = __FILE__;
- ruby_malloc_info_line = __LINE__;
-#endif
- return ruby_xcalloc_body(n, size);
-}
-
-void *
-ruby_xrealloc(void *ptr, size_t new_size)
-{
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- ruby_malloc_info_file = __FILE__;
- ruby_malloc_info_line = __LINE__;
-#endif
- return ruby_xrealloc_body(ptr, new_size);
-}
-
-void *
-ruby_xrealloc2(void *ptr, size_t n, size_t new_size)
-{
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
- ruby_malloc_info_file = __FILE__;
- ruby_malloc_info_line = __LINE__;
-#endif
- return ruby_xrealloc2_body(ptr, n, new_size);
-}
diff --git a/gc.h b/gc.h
index cf794fa514..2ba46c9250 100644
--- a/gc.h
+++ b/gc.h
@@ -2,12 +2,10 @@
#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)))
-#elif defined(__powerpc64__) && defined(__GNUC__)
-#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p)))
#else
NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
#define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
@@ -59,14 +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_NO_PIN_UNLESS_NULL(ptr) do { \
- VALUE markobj = (ptr); \
- if (RTEST(markobj)) {rb_gc_mark_movable(markobj);} \
-} while (0)
-#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
@@ -83,14 +74,6 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr);
# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b))
#endif
-/*
- STACK_GROW_DIR_DETECTION is used with STACK_DIR_UPPER.
-
- On most normal systems, stacks grow from high address to lower address. In
- this case, STACK_DIR_UPPER(a, b) will return (b), but on exotic systems where
- the stack grows UP (from low address to high address), it will return (a).
-*/
-
#if STACK_GROW_DIRECTION
#define STACK_GROW_DIR_DETECTION
#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, (a), (b))
@@ -100,13 +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);
-
-VALUE rb_gc_disable_no_rest(void);
-
-struct rb_thread_struct;
-
RUBY_SYMBOL_EXPORT_BEGIN
/* exports for objspace module */
diff --git a/gc.rb b/gc.rb
deleted file mode 100644
index fcfa48fbe1..0000000000
--- a/gc.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-# for gc.c
-
-# The GC module provides an interface to Ruby's mark and
-# sweep garbage collection mechanism.
-#
-# Some of the underlying methods are also available via the ObjectSpace
-# module.
-#
-# You may obtain information about the operation of the GC through
-# GC::Profiler.
-module GC
-
- # call-seq:
- # GC.start -> nil
- # ObjectSpace.garbage_collect -> nil
- # include 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
- #
- # Initiates garbage collection, even if manually disabled.
- #
- # This method is defined with keyword arguments that default to true:
- #
- # def GC.start(full_mark: true, immediate_sweep: true); end
- #
- # Use full_mark: false to perform a minor GC.
- # Use immediate_sweep: false to defer sweeping (use lazy sweep).
- #
- # Note: These keyword arguments are implementation and version dependent. They
- # are not guaranteed to be future-compatible, and may be ignored if the
- # underlying implementation does not support them.
- def self.start full_mark: true, immediate_mark: true, immediate_sweep: true
- __builtin_gc_start_internal full_mark, immediate_mark, immediate_sweep
- end
-
- def garbage_collect full_mark: true, immediate_mark: true, immediate_sweep: true
- __builtin_gc_start_internal full_mark, immediate_mark, immediate_sweep
- end
-
- # call-seq:
- # GC.enable -> true or false
- #
- # Enables garbage collection, returning +true+ if garbage
- # collection was previously disabled.
- #
- # GC.disable #=> false
- # GC.enable #=> true
- # GC.enable #=> false
- #
- def self.enable
- __builtin_gc_enable
- end
-
- # call-seq:
- # GC.disable -> true or false
- #
- # Disables garbage collection, returning +true+ if garbage
- # collection was already disabled.
- #
- # GC.disable #=> false
- # GC.disable #=> true
- def self.disable
- __builtin_gc_disable
- end
-
- # call-seq:
- # GC.stress -> integer, true or false
- #
- # Returns current status of GC stress mode.
- def self.stress
- __builtin_gc_stress_get
- end
-
- # call-seq:
- # GC.stress = flag -> flag
- #
- # Updates the GC stress mode.
- #
- # When stress mode is enabled, the GC is invoked at every GC opportunity:
- # all memory and object allocations.
- #
- # Enabling stress mode will degrade performance, it is only for debugging.
- #
- # flag can be true, false, or an integer bit-ORed following flags.
- # 0x01:: no major GC
- # 0x02:: no immediate sweep
- # 0x04:: full mark after malloc/calloc/realloc
- def self.stress=(flag)
- __builtin_gc_stress_set_m flag
- end
-
- # call-seq:
- # GC.count -> Integer
- #
- # The number of times GC occurred.
- #
- # It returns the number of times GC occurred since the process started.
- def self.count
- __builtin_gc_count
- end
-
- # call-seq:
- # GC.stat -> Hash
- # GC.stat(hash) -> hash
- # GC.stat(:key) -> Numeric
- #
- # Returns a Hash containing information about the GC.
- #
- # The hash includes information about internal statistics about GC such as:
- #
- # {
- # :count=>0,
- # :heap_allocated_pages=>24,
- # :heap_sorted_length=>24,
- # :heap_allocatable_pages=>0,
- # :heap_available_slots=>9783,
- # :heap_live_slots=>7713,
- # :heap_free_slots=>2070,
- # :heap_final_slots=>0,
- # :heap_marked_slots=>0,
- # :heap_eden_pages=>24,
- # :heap_tomb_pages=>0,
- # :total_allocated_pages=>24,
- # :total_freed_pages=>0,
- # :total_allocated_objects=>7796,
- # :total_freed_objects=>83,
- # :malloc_increase_bytes=>2389312,
- # :malloc_increase_bytes_limit=>16777216,
- # :minor_gc_count=>0,
- # :major_gc_count=>0,
- # :remembered_wb_unprotected_objects=>0,
- # :remembered_wb_unprotected_objects_limit=>0,
- # :old_objects=>0,
- # :old_objects_limit=>0,
- # :oldmalloc_increase_bytes=>2389760,
- # :oldmalloc_increase_bytes_limit=>16777216
- # }
- #
- # The contents of the hash are implementation specific and may be changed in
- # the future.
- #
- # This method is only expected to work on C Ruby.
- def self.stat hash_or_key = nil
- __builtin_gc_stat hash_or_key
- end
-
- # call-seq:
- # GC.latest_gc_info -> {:gc_by=>:newobj}
- # GC.latest_gc_info(hash) -> hash
- # GC.latest_gc_info(:major_by) -> :malloc
- #
- # Returns information about the most recent garbage collection.
- def self.latest_gc_info hash_or_key = nil
- __builtin_gc_latest_gc_info hash_or_key
- end
-
- def self.compact
- __builtin_rb_gc_compact
- end
-end
-
-module ObjectSpace
- def garbage_collect full_mark: true, immediate_mark: true, immediate_sweep: true
- __builtin_gc_start_internal full_mark, immediate_mark, immediate_sweep
- end
-
- module_function :garbage_collect
-end
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 1d0158d00a..3d4516f341 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -1,2 +1 @@
require 'rubygems.rb' if defined?(Gem)
-require 'did_you_mean' if defined?(DidYouMean)
diff --git a/gems/bundled_gems b/gems/bundled_gems
index b2c6e2d5cb..e57fc72f77 100644
--- a/gems/bundled_gems
+++ b/gems/bundled_gems
@@ -1,6 +1,3 @@
-minitest 5.13.0 https://github.com/seattlerb/minitest
-net-telnet 0.2.0 https://github.com/ruby/net-telnet
-power_assert 1.1.5 https://github.com/k-tsj/power_assert
-rake 13.0.1 https://github.com/ruby/rake
-test-unit 3.3.4 https://github.com/test-unit/test-unit
-xmlrpc 0.3.0 https://github.com/ruby/xmlrpc
+power_assert 0.2.2
+test-unit 3.0.8
+minitest 5.4.3
diff --git a/golf_prelude.rb b/golf_prelude.rb
index a13d3f71bc..8034601287 100644
--- a/golf_prelude.rb
+++ b/golf_prelude.rb
@@ -1,7 +1,6 @@
class Object
@@golf_hash = {}
- verbose, $VERBOSE = $VERBOSE, nil
def method_missing m, *a, &b
t = @@golf_hash[ [m, self.class] ] ||= matching_methods(m)[0]
if t && b
@@ -13,7 +12,6 @@ class Object
t ? __send__(t, *a, &b) : super
end
end
- $VERBOSE = verbose
def matching_methods(s = '', m = callable_methods)
r = /^#{s.to_s.gsub(/./){"(.*?)" + Regexp.escape($&)}}/
@@ -52,11 +50,6 @@ class Object
puts "#{a}ello, #{b}orld#{c}"
end
- def f(m = 100)
- 1.upto(m){|n|puts'FizzBuzz
-'[i=n**4%-15,i+13]||n}
- end
-
alias say puts
def do_while
@@ -92,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 82383e9a93..d145f17005 100644
--- a/hash.c
+++ b/hash.c
@@ -11,17 +11,14 @@
**********************************************************************/
-#include "ruby/encoding.h"
+#include "internal.h"
#include "ruby/st.h"
#include "ruby/util.h"
-#include "internal.h"
#include <errno.h>
#include "probes.h"
#include "id.h"
#include "symbol.h"
-#include "debug_counter.h"
-#include "transient_heap.h"
-#include "ruby_assert.h"
+
#ifdef __APPLE__
# ifdef HAVE_CRT_EXTERNS_H
# include <crt_externs.h>
@@ -30,42 +27,19 @@
# endif
#endif
-#ifndef HASH_DEBUG
-#define HASH_DEBUG 0
-#endif
-
-#if HASH_DEBUG
-#include "gc.h"
-#endif
-
#define HAS_EXTRA_STATES(hash, klass) ( \
((klass = has_extra_methods(rb_obj_class(hash))) != 0) || \
- FL_TEST((hash), FL_EXIVAR|RHASH_PROC_DEFAULT) || \
+ FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
!NIL_P(RHASH_IFNONE(hash)))
-#define SET_DEFAULT(hash, ifnone) ( \
- FL_UNSET_RAW(hash, RHASH_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 &= ~RHASH_PROC_DEFAULT;
- hash->basic.flags |= hash2->basic.flags & RHASH_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;
@@ -93,7 +67,12 @@ VALUE rb_cHash;
static VALUE envtbl;
static ID id_hash, id_yield, id_default, id_flatten_bang;
-static ID id_hash_iter_lev;
+
+VALUE
+rb_hash_ifnone(VALUE h)
+{
+ return RHASH_IFNONE(h);
+}
VALUE
rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
@@ -106,6 +85,9 @@ static int
rb_any_cmp(VALUE a, VALUE b)
{
if (a == b) return 0;
+ if (FIXNUM_P(a) && FIXNUM_P(b)) {
+ return a != b;
+ }
if (RB_TYPE_P(a, T_STRING) && RBASIC(a)->klass == rb_cString &&
RB_TYPE_P(b, T_STRING) && RBASIC(b)->klass == rb_cString) {
return rb_str_hash_cmp(a, b);
@@ -146,40 +128,19 @@ rb_hash(VALUE obj)
return hval;
}
-static long rb_objid_hash(st_index_t index);
+long rb_objid_hash(st_index_t index);
static st_index_t
-dbl_to_index(double d)
-{
- union {double d; st_index_t i;} u;
- u.d = d;
- return u.i;
-}
-
-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
- return rb_objid_hash(dbl_to_index(d));
-#endif
-}
-
-static inline long
-any_hash(VALUE a, st_index_t (*other_func)(VALUE))
+rb_any_hash(VALUE a)
{
VALUE hval;
st_index_t hnum;
if (SPECIAL_CONST_P(a)) {
+ if (a == Qundef) return 0;
if (STATIC_SYM_P(a)) {
- hnum = a >> (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT);
- hnum = rb_hash_start(hnum);
- goto out;
- }
+ a >>= (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT);
+ }
else if (FLONUM_P(a)) {
/* prevent pathological behavior: [Bug #10761] */
goto flt;
@@ -190,7 +151,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
hnum = rb_str_hash(a);
}
else if (BUILTIN_TYPE(a) == T_SYMBOL) {
- hnum = RSYMBOL(a)->hashval;
+ return RSYMBOL(a)->hashval;
}
else if (BUILTIN_TYPE(a) == T_BIGNUM) {
hval = rb_big_hash(a);
@@ -198,116 +159,30 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
}
else if (BUILTIN_TYPE(a) == T_FLOAT) {
flt:
- hnum = rb_dbl_long_hash(rb_float_value(a));
+ hval = rb_dbl_hash(rb_float_value(a));
+ hnum = FIX2LONG(hval);
}
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);
+ return (st_index_t)RSHIFT(hnum, 1);
}
-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 uint32_t prime2 = 0x830fcab9;
-
-
-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);
-}
-
-/* Should cast down the result for each purpose */
-#define st_index_hash(index) key64_hash(rb_hash_start(index), prime2)
-
-static long
+long
rb_objid_hash(st_index_t index)
{
- return (long)st_index_hash(index);
-}
-
-static st_index_t
-objid_hash(VALUE obj)
-{
- VALUE object_id = rb_obj_id(obj);
- if (!FIXNUM_P(object_id))
- object_id = rb_big_hash(object_id);
-
-#if SIZEOF_LONG == SIZEOF_VOIDP
- return (st_index_t)st_index_hash((st_index_t)NUM2LONG(object_id));
-#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
- return (st_index_t)st_index_hash((st_index_t)NUM2LL(object_id));
-#endif
+ 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;
}
-/**
- * call-seq:
- * obj.hash -> integer
- *
- * Generates an Integer 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 an Integer 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.
- *--
- * \private
- *++
- */
-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 = {
@@ -320,948 +195,35 @@ static const struct st_hash_type objhash = {
static st_index_t
rb_ident_hash(st_data_t n)
{
-#ifdef USE_FLONUM /* RUBY */
/*
+ * This hash function is lightly-tuned for Ruby. Further tuning
+ * should be possible. Notes:
+ *
+ * - (n >> 3) alone is great for heap objects and OK for fixnum,
+ * however symbols perform poorly.
+ * - (n >> (RUBY_SPECIAL_SHIFT+3)) was added to make symbols hash well,
+ * n.b.: +3 to remove ID scope, +1 worked well initially, too
+ * - (n << 3) was finally added to avoid losing bits for fixnums
+ * - avoid expensive modulo instructions, it is currently only
+ * shifts and bitmask operations.
* - 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]
*/
+#ifdef USE_FLONUM /* RUBY */
if (FLONUM_P(n)) {
- n ^= dbl_to_index(rb_float_value(n));
+ n ^= (st_data_t)rb_float_value(n);
}
#endif
- return (st_index_t)st_index_hash((st_index_t)n);
+ return (st_index_t)((n>>(RUBY_SPECIAL_SHIFT+3)|(n<<3)) ^ (n>>3));
}
-#define identhash rb_hashtype_ident
-const struct st_hash_type rb_hashtype_ident = {
+static const struct st_hash_type identhash = {
rb_ident_cmp,
rb_ident_hash,
};
-typedef st_index_t st_hash_t;
-
-/*
- * RHASH_AR_TABLE_P(h):
- * * as.ar == NULL or
- * as.ar points ar_table.
- * * as.ar is allocated by transient heap or xmalloc.
- *
- * !RHASH_AR_TABLE_P(h):
- * * as.st points st_table.
- */
-
-#define RHASH_AR_TABLE_MAX_BOUND RHASH_AR_TABLE_MAX_SIZE
-
-#define RHASH_AR_TABLE_REF(hash, n) (&RHASH_AR_TABLE(hash)->pairs[n])
-#define RHASH_AR_CLEARED_HINT 0xff
-
-typedef struct ar_table_pair_struct {
- VALUE key;
- VALUE val;
-} ar_table_pair;
-
-typedef struct ar_table_struct {
- /* 64bit CPU: 8B * 2 * 8 = 128B */
- ar_table_pair pairs[RHASH_AR_TABLE_MAX_SIZE];
-} ar_table;
-
-size_t
-rb_hash_ar_table_size(void)
-{
- return sizeof(ar_table);
-}
-
-static inline st_hash_t
-ar_do_hash(st_data_t key)
-{
- return (st_hash_t)rb_any_hash(key);
-}
-
-static inline ar_hint_t
-ar_do_hash_hint(st_hash_t hash_value)
-{
- return (ar_hint_t)hash_value;
-}
-
-static inline ar_hint_t
-ar_hint(VALUE hash, unsigned int index)
-{
- return RHASH(hash)->ar_hint.ary[index];
-}
-
-static inline void
-ar_hint_set_hint(VALUE hash, unsigned int index, ar_hint_t hint)
-{
- RHASH(hash)->ar_hint.ary[index] = hint;
-}
-
-static inline void
-ar_hint_set(VALUE hash, unsigned int index, st_hash_t hash_value)
-{
- ar_hint_set_hint(hash, index, ar_do_hash_hint(hash_value));
-}
-
-static inline void
-ar_clear_entry(VALUE hash, unsigned int index)
-{
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, index);
- pair->key = Qundef;
- ar_hint_set_hint(hash, index, RHASH_AR_CLEARED_HINT);
-}
-
-static inline int
-ar_cleared_entry(VALUE hash, unsigned int index)
-{
- if (ar_hint(hash, index) == RHASH_AR_CLEARED_HINT) {
- /* RHASH_AR_CLEARED_HINT is only a hint, not mean cleared entry,
- * so you need to check key == Qundef
- */
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, index);
- return pair->key == Qundef;
- }
- else {
- return FALSE;
- }
-}
-
-static inline void
-ar_set_entry(VALUE hash, unsigned int index, st_data_t key, st_data_t val, st_hash_t hash_value)
-{
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, index);
- pair->key = key;
- pair->val = val;
- ar_hint_set(hash, index, hash_value);
-}
-
-#define RHASH_AR_TABLE_SIZE(h) (HASH_ASSERT(RHASH_AR_TABLE_P(h)), \
- RHASH_AR_TABLE_SIZE_RAW(h))
-
-#define RHASH_AR_TABLE_BOUND_RAW(h) \
- ((unsigned int)((RBASIC(h)->flags >> RHASH_AR_TABLE_BOUND_SHIFT) & \
- (RHASH_AR_TABLE_BOUND_MASK >> RHASH_AR_TABLE_BOUND_SHIFT)))
-
-#define RHASH_AR_TABLE_BOUND(h) (HASH_ASSERT(RHASH_AR_TABLE_P(h)), \
- RHASH_AR_TABLE_BOUND_RAW(h))
-
-#define RHASH_ST_TABLE_SET(h, s) rb_hash_st_table_set(h, s)
-#define RHASH_TYPE(hash) (RHASH_AR_TABLE_P(hash) ? &objhash : RHASH_ST_TABLE(hash)->type)
-
-#define HASH_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(HASH_DEBUG, expr, #expr)
-
-#if HASH_DEBUG
-#define hash_verify(hash) hash_verify_(hash, __FILE__, __LINE__)
-
-void
-rb_hash_dump(VALUE hash)
-{
- rb_obj_info_dump(hash);
-
- if (RHASH_AR_TABLE_P(hash)) {
- unsigned i, n = 0, bound = RHASH_AR_TABLE_BOUND(hash);
-
- fprintf(stderr, " size:%u bound:%u\n",
- RHASH_AR_TABLE_SIZE(hash), RHASH_AR_TABLE_BOUND(hash));
-
- for (i=0; i<bound; i++) {
- st_data_t k, v;
-
- if (!ar_cleared_entry(hash, i)) {
- char b1[0x100], b2[0x100];
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- k = pair->key;
- v = pair->val;
- fprintf(stderr, " %d key:%s val:%s hint:%02x\n", i,
- rb_raw_obj_info(b1, 0x100, k),
- rb_raw_obj_info(b2, 0x100, v),
- ar_hint(hash, i));
- n++;
- }
- else {
- fprintf(stderr, " %d empty\n", i);
- }
- }
- }
-}
-
-static VALUE
-hash_verify_(VALUE hash, const char *file, int line)
-{
- HASH_ASSERT(RB_TYPE_P(hash, T_HASH));
-
- if (RHASH_AR_TABLE_P(hash)) {
- unsigned i, n = 0, bound = RHASH_AR_TABLE_BOUND(hash);
-
- for (i=0; i<bound; i++) {
- st_data_t k, v;
- if (!ar_cleared_entry(hash, i)) {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- k = pair->key;
- v = pair->val;
- HASH_ASSERT(k != Qundef);
- HASH_ASSERT(v != Qundef);
- n++;
- }
- }
- if (n != RHASH_AR_TABLE_SIZE(hash)) {
- rb_bug("n:%u, RHASH_AR_TABLE_SIZE:%u", n, RHASH_AR_TABLE_SIZE(hash));
- }
- }
- else {
- HASH_ASSERT(RHASH_ST_TABLE(hash) != NULL);
- HASH_ASSERT(RHASH_AR_TABLE_SIZE_RAW(hash) == 0);
- HASH_ASSERT(RHASH_AR_TABLE_BOUND_RAW(hash) == 0);
- }
-
- if (RHASH_TRANSIENT_P(hash)) {
- volatile st_data_t MAYBE_UNUSED(key) = RHASH_AR_TABLE_REF(hash, 0)->key; /* read */
- HASH_ASSERT(RHASH_AR_TABLE(hash) != NULL);
- HASH_ASSERT(rb_transient_heap_managed_ptr_p(RHASH_AR_TABLE(hash)));
- }
- return hash;
-}
-
-#else
-#define hash_verify(h) ((void)0)
-#endif
-
-static inline int
-RHASH_TABLE_NULL_P(VALUE hash)
-{
- if (RHASH(hash)->as.ar == NULL) {
- HASH_ASSERT(RHASH_AR_TABLE_P(hash));
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-static inline int
-RHASH_TABLE_EMPTY_P(VALUE hash)
-{
- return RHASH_SIZE(hash) == 0;
-}
-
-int
-rb_hash_ar_table_p(VALUE hash)
-{
- if (FL_TEST_RAW((hash), RHASH_ST_TABLE_FLAG)) {
- HASH_ASSERT(RHASH(hash)->as.st != NULL);
- return FALSE;
- }
- else {
- return TRUE;
- }
-}
-
-ar_table *
-rb_hash_ar_table(VALUE hash)
-{
- HASH_ASSERT(RHASH_AR_TABLE_P(hash));
- return RHASH(hash)->as.ar;
-}
-
-st_table *
-rb_hash_st_table(VALUE hash)
-{
- HASH_ASSERT(!RHASH_AR_TABLE_P(hash));
- return RHASH(hash)->as.st;
-}
-
-void
-rb_hash_st_table_set(VALUE hash, st_table *st)
-{
- HASH_ASSERT(st != NULL);
- FL_SET_RAW((hash), RHASH_ST_TABLE_FLAG);
- RHASH(hash)->as.st = st;
-}
-
-static void
-hash_ar_table_set(VALUE hash, ar_table *ar)
-{
- HASH_ASSERT(RHASH_AR_TABLE_P(hash));
- HASH_ASSERT((RHASH_TRANSIENT_P(hash) && ar == NULL) ? FALSE : TRUE);
- RHASH(hash)->as.ar = ar;
- hash_verify(hash);
-}
-
-#define RHASH_SET_ST_FLAG(h) FL_SET_RAW(h, RHASH_ST_TABLE_FLAG)
-#define RHASH_UNSET_ST_FLAG(h) FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG)
-
-static inline void
-RHASH_AR_TABLE_BOUND_SET(VALUE h, st_index_t n)
-{
- HASH_ASSERT(RHASH_AR_TABLE_P(h));
- HASH_ASSERT(n <= RHASH_AR_TABLE_MAX_BOUND);
-
- RBASIC(h)->flags &= ~RHASH_AR_TABLE_BOUND_MASK;
- RBASIC(h)->flags |= n << RHASH_AR_TABLE_BOUND_SHIFT;
-}
-
-static inline void
-RHASH_AR_TABLE_SIZE_SET(VALUE h, st_index_t n)
-{
- HASH_ASSERT(RHASH_AR_TABLE_P(h));
- HASH_ASSERT(n <= RHASH_AR_TABLE_MAX_SIZE);
-
- RBASIC(h)->flags &= ~RHASH_AR_TABLE_SIZE_MASK;
- RBASIC(h)->flags |= n << RHASH_AR_TABLE_SIZE_SHIFT;
-}
-
-static inline void
-HASH_AR_TABLE_SIZE_ADD(VALUE h, st_index_t n)
-{
- HASH_ASSERT(RHASH_AR_TABLE_P(h));
-
- RHASH_AR_TABLE_SIZE_SET(h, RHASH_AR_TABLE_SIZE(h) + n);
-
- hash_verify(h);
-}
-
-#define RHASH_AR_TABLE_SIZE_INC(h) HASH_AR_TABLE_SIZE_ADD(h, 1)
-
-static inline void
-RHASH_AR_TABLE_SIZE_DEC(VALUE h)
-{
- HASH_ASSERT(RHASH_AR_TABLE_P(h));
- int new_size = RHASH_AR_TABLE_SIZE(h) - 1;
-
- if (new_size != 0) {
- RHASH_AR_TABLE_SIZE_SET(h, new_size);
- }
- else {
- RHASH_AR_TABLE_SIZE_SET(h, 0);
- RHASH_AR_TABLE_BOUND_SET(h, 0);
- }
- hash_verify(h);
-}
-
-static inline void
-RHASH_AR_TABLE_CLEAR(VALUE h)
-{
- RBASIC(h)->flags &= ~RHASH_AR_TABLE_SIZE_MASK;
- RBASIC(h)->flags &= ~RHASH_AR_TABLE_BOUND_MASK;
-
- hash_ar_table_set(h, NULL);
-}
-
-static ar_table*
-ar_alloc_table(VALUE hash)
-{
- ar_table *tab = (ar_table*)rb_transient_heap_alloc(hash, sizeof(ar_table));
-
- if (tab != NULL) {
- RHASH_SET_TRANSIENT_FLAG(hash);
- }
- else {
- RHASH_UNSET_TRANSIENT_FLAG(hash);
- tab = (ar_table*)ruby_xmalloc(sizeof(ar_table));
- }
-
- RHASH_AR_TABLE_SIZE_SET(hash, 0);
- RHASH_AR_TABLE_BOUND_SET(hash, 0);
- hash_ar_table_set(hash, tab);
-
- return tab;
-}
-
-NOINLINE(static int ar_equal(VALUE x, VALUE y));
-
-static int
-ar_equal(VALUE x, VALUE y)
-{
- return rb_any_cmp(x, y) == 0;
-}
-
-static unsigned
-ar_find_entry_hint(VALUE hash, ar_hint_t hint, st_data_t key)
-{
- unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
- const ar_hint_t *hints = RHASH(hash)->ar_hint.ary;
-
- /* if table is NULL, then bound also should be 0 */
-
- for (i = 0; i < bound; i++) {
- if (hints[i] == hint) {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- if (ar_equal(key, pair->key)) {
- RB_DEBUG_COUNTER_INC(artable_hint_hit);
- return i;
- }
- else {
-#if 0
- static int pid;
- static char fname[256];
- static FILE *fp;
-
- if (pid != getpid()) {
- snprintf(fname, sizeof(fname), "/tmp/ruby-armiss.%d", pid = getpid());
- if ((fp = fopen(fname, "w")) == NULL) rb_bug("fopen");
- }
-
- st_hash_t h1 = ar_do_hash(key);
- st_hash_t h2 = ar_do_hash(pair->key);
-
- fprintf(fp, "miss: hash_eq:%d hints[%d]:%02x hint:%02x\n"
- " key :%016lx %s\n"
- " pair->key:%016lx %s\n",
- h1 == h2, i, hints[i], hint,
- h1, rb_obj_info(key), h2, rb_obj_info(pair->key));
-#endif
- RB_DEBUG_COUNTER_INC(artable_hint_miss);
- }
- }
- }
- RB_DEBUG_COUNTER_INC(artable_hint_notfound);
- return RHASH_AR_TABLE_MAX_BOUND;
-}
-
-static unsigned
-ar_find_entry(VALUE hash, st_hash_t hash_value, st_data_t key)
-{
- ar_hint_t hint = ar_do_hash_hint(hash_value);
- return ar_find_entry_hint(hash, hint, key);
-}
-
-static inline void
-ar_free_and_clear_table(VALUE hash)
-{
- ar_table *tab = RHASH_AR_TABLE(hash);
-
- if (tab) {
- if (RHASH_TRANSIENT_P(hash)) {
- RHASH_UNSET_TRANSIENT_FLAG(hash);
- }
- else {
- ruby_xfree(RHASH_AR_TABLE(hash));
- }
- RHASH_AR_TABLE_CLEAR(hash);
- }
- HASH_ASSERT(RHASH_AR_TABLE_SIZE(hash) == 0);
- HASH_ASSERT(RHASH_AR_TABLE_BOUND(hash) == 0);
- HASH_ASSERT(RHASH_TRANSIENT_P(hash) == 0);
-}
-
-static void
-ar_try_convert_table(VALUE hash)
-{
- st_table *new_tab;
- const unsigned size = RHASH_AR_TABLE_SIZE(hash);
- st_index_t i;
-
- if (!RHASH_AR_TABLE_P(hash) || size < RHASH_AR_TABLE_MAX_SIZE) {
- return;
- }
-
- new_tab = st_init_table_with_size(&objhash, size * 2);
-
- for (i = 0; i < RHASH_AR_TABLE_MAX_BOUND; i++) {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- st_add_direct(new_tab, pair->key, pair->val);
- }
- ar_free_and_clear_table(hash);
- RHASH_ST_TABLE_SET(hash, new_tab);
- return;
-}
-
-static st_table *
-ar_force_convert_table(VALUE hash, const char *file, int line)
-{
- st_table *new_tab;
-
- if (RHASH_ST_TABLE_P(hash)) {
- return RHASH_ST_TABLE(hash);
- }
-
- if (RHASH_AR_TABLE(hash)) {
- unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
-
-#if RHASH_CONVERT_TABLE_DEBUG
- rb_obj_info_dump(hash);
- fprintf(stderr, "force_convert: %s:%d\n", file, line);
- RB_DEBUG_COUNTER_INC(obj_hash_force_convert);
-#endif
-
- new_tab = st_init_table_with_size(&objhash, RHASH_AR_TABLE_SIZE(hash));
-
- for (i = 0; i < bound; i++) {
- if (ar_cleared_entry(hash, i)) continue;
-
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- st_add_direct(new_tab, pair->key, pair->val);
- }
- ar_free_and_clear_table(hash);
- }
- else {
- new_tab = st_init_table(&objhash);
- }
- RHASH_ST_TABLE_SET(hash, new_tab);
-
- return new_tab;
-}
-
-static ar_table *
-hash_ar_table(VALUE hash)
-{
- if (RHASH_TABLE_NULL_P(hash)) {
- ar_alloc_table(hash);
- }
- return RHASH_AR_TABLE(hash);
-}
-
-static int
-ar_compact_table(VALUE hash)
-{
- const unsigned bound = RHASH_AR_TABLE_BOUND(hash);
- const unsigned size = RHASH_AR_TABLE_SIZE(hash);
-
- if (size == bound) {
- return size;
- }
- else {
- unsigned i, j=0;
- ar_table_pair *pairs = RHASH_AR_TABLE(hash)->pairs;
-
- for (i=0; i<bound; i++) {
- if (ar_cleared_entry(hash, i)) {
- if (j <= i) j = i+1;
- for (; j<bound; j++) {
- if (!ar_cleared_entry(hash, j)) {
- pairs[i] = pairs[j];
- ar_hint_set_hint(hash, i, (st_hash_t)ar_hint(hash, j));
- ar_clear_entry(hash, j);
- j++;
- goto found;
- }
- }
- /* non-empty is not found */
- goto done;
- found:;
- }
- }
- done:
- HASH_ASSERT(i<=bound);
-
- RHASH_AR_TABLE_BOUND_SET(hash, size);
- hash_verify(hash);
- return size;
- }
-}
-
-static int
-ar_add_direct_with_hash(VALUE hash, st_data_t key, st_data_t val, st_hash_t hash_value)
-{
- unsigned bin = RHASH_AR_TABLE_BOUND(hash);
-
- if (RHASH_AR_TABLE_SIZE(hash) >= RHASH_AR_TABLE_MAX_SIZE) {
- return 1;
- }
- else {
- if (UNLIKELY(bin >= RHASH_AR_TABLE_MAX_BOUND)) {
- bin = ar_compact_table(hash);
- hash_ar_table(hash);
- }
- HASH_ASSERT(bin < RHASH_AR_TABLE_MAX_BOUND);
-
- ar_set_entry(hash, bin, key, val, hash_value);
- RHASH_AR_TABLE_BOUND_SET(hash, bin+1);
- RHASH_AR_TABLE_SIZE_INC(hash);
- return 0;
- }
-}
-
-static int
-ar_general_foreach(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg)
-{
- if (RHASH_AR_TABLE_SIZE(hash) > 0) {
- unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
-
- for (i = 0; i < bound; i++) {
- if (ar_cleared_entry(hash, i)) continue;
-
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- enum st_retval retval = (*func)(pair->key, pair->val, arg, 0);
- /* pair may be not valid here because of theap */
-
- switch (retval) {
- case ST_CONTINUE:
- break;
- case ST_CHECK:
- case ST_STOP:
- return 0;
- case ST_REPLACE:
- if (replace) {
- VALUE key = pair->key;
- VALUE val = pair->val;
- retval = (*replace)(&key, &val, arg, TRUE);
-
- // TODO: pair should be same as pair before.
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- pair->key = key;
- pair->val = val;
- }
- break;
- case ST_DELETE:
- ar_clear_entry(hash, i);
- RHASH_AR_TABLE_SIZE_DEC(hash);
- break;
- }
- }
- }
- return 0;
-}
-
-static int
-ar_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg)
-{
- return ar_general_foreach(hash, func, replace, arg);
-}
-
-struct functor {
- st_foreach_callback_func *func;
- st_data_t arg;
-};
-
-static int
-apply_functor(st_data_t k, st_data_t v, st_data_t d, int _)
-{
- const struct functor *f = (void *)d;
- return f->func(k, v, f->arg);
-}
-
-static int
-ar_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg)
-{
- const struct functor f = { func, arg };
- return ar_general_foreach(hash, apply_functor, NULL, (st_data_t)&f);
-}
-
-static int
-ar_foreach_check(VALUE hash, st_foreach_check_callback_func *func, st_data_t arg,
- st_data_t never)
-{
- if (RHASH_AR_TABLE_SIZE(hash) > 0) {
- unsigned i, ret = 0, bound = RHASH_AR_TABLE_BOUND(hash);
- enum st_retval retval;
- st_data_t key;
- ar_table_pair *pair;
- ar_hint_t hint;
-
- for (i = 0; i < bound; i++) {
- if (ar_cleared_entry(hash, i)) continue;
-
- pair = RHASH_AR_TABLE_REF(hash, i);
- key = pair->key;
- hint = ar_hint(hash, i);
-
- retval = (*func)(key, pair->val, arg, 0);
- hash_verify(hash);
-
- switch (retval) {
- case ST_CHECK: {
- if (pair->key == never) break;
- ret = ar_find_entry_hint(hash, hint, key);
- if (ret == RHASH_AR_TABLE_MAX_BOUND) {
- retval = (*func)(0, 0, arg, 1);
- return 2;
- }
- }
- case ST_CONTINUE:
- break;
- case ST_STOP:
- case ST_REPLACE:
- return 0;
- case ST_DELETE: {
- if (!ar_cleared_entry(hash, i)) {
- ar_clear_entry(hash, i);
- RHASH_AR_TABLE_SIZE_DEC(hash);
- }
- break;
- }
- }
- }
- }
- return 0;
-}
-
-static int
-ar_update(VALUE hash, st_data_t key,
- st_update_callback_func *func, st_data_t arg)
-{
- int retval, existing;
- unsigned bin = RHASH_AR_TABLE_MAX_BOUND;
- st_data_t value = 0, old_key;
- st_hash_t hash_value = ar_do_hash(key);
-
- if (RHASH_AR_TABLE_SIZE(hash) > 0) {
- bin = ar_find_entry(hash, hash_value, key);
- existing = (bin != RHASH_AR_TABLE_MAX_BOUND) ? TRUE : FALSE;
- }
- else {
- hash_ar_table(hash); /* allocate ltbl if needed */
- existing = FALSE;
- }
-
- if (existing) {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, bin);
- key = pair->key;
- value = pair->val;
- }
- old_key = key;
- retval = (*func)(&key, &value, arg, existing);
- /* pair can be invalid here because of theap */
-
- switch (retval) {
- case ST_CONTINUE:
- if (!existing) {
- if (ar_add_direct_with_hash(hash, key, value, hash_value)) {
- return -1;
- }
- }
- else {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, bin);
- if (old_key != key) {
- pair->key = key;
- }
- pair->val = value;
- }
- break;
- case ST_DELETE:
- if (existing) {
- ar_clear_entry(hash, bin);
- RHASH_AR_TABLE_SIZE_DEC(hash);
- }
- break;
- }
- return existing;
-}
-
-static int
-ar_insert(VALUE hash, st_data_t key, st_data_t value)
-{
- unsigned bin = RHASH_AR_TABLE_BOUND(hash);
- st_hash_t hash_value = ar_do_hash(key);
-
- hash_ar_table(hash); /* prepare ltbl */
-
- bin = ar_find_entry(hash, hash_value, key);
- if (bin == RHASH_AR_TABLE_MAX_BOUND) {
- if (RHASH_AR_TABLE_SIZE(hash) >= RHASH_AR_TABLE_MAX_SIZE) {
- return -1;
- }
- else if (bin >= RHASH_AR_TABLE_MAX_BOUND) {
- bin = ar_compact_table(hash);
- hash_ar_table(hash);
- }
- HASH_ASSERT(bin < RHASH_AR_TABLE_MAX_BOUND);
-
- ar_set_entry(hash, bin, key, value, hash_value);
- RHASH_AR_TABLE_BOUND_SET(hash, bin+1);
- RHASH_AR_TABLE_SIZE_INC(hash);
- return 0;
- }
- else {
- RHASH_AR_TABLE_REF(hash, bin)->val = value;
- return 1;
- }
-}
-
-static int
-ar_lookup(VALUE hash, st_data_t key, st_data_t *value)
-{
- if (RHASH_AR_TABLE_SIZE(hash) == 0) {
- return 0;
- }
- else {
- st_hash_t hash_value = ar_do_hash(key);
- unsigned bin = ar_find_entry(hash, hash_value, key);
-
- if (bin == RHASH_AR_TABLE_MAX_BOUND) {
- return 0;
- }
- else {
- HASH_ASSERT(bin < RHASH_AR_TABLE_MAX_BOUND);
- if (value != NULL) {
- *value = RHASH_AR_TABLE_REF(hash, bin)->val;
- }
- return 1;
- }
- }
-}
-
-static int
-ar_delete(VALUE hash, st_data_t *key, st_data_t *value)
-{
- unsigned bin;
- st_hash_t hash_value = ar_do_hash(*key);
-
-
- bin = ar_find_entry(hash, hash_value, *key);
-
- if (bin == RHASH_AR_TABLE_MAX_BOUND) {
- if (value != 0) *value = 0;
- return 0;
- }
- else {
- if (value != 0) {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, bin);
- *value = pair->val;
- }
- ar_clear_entry(hash, bin);
- RHASH_AR_TABLE_SIZE_DEC(hash);
- return 1;
- }
-}
-
-static int
-ar_shift(VALUE hash, st_data_t *key, st_data_t *value)
-{
- if (RHASH_AR_TABLE_SIZE(hash) > 0) {
- unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
-
- for (i = 0; i < bound; i++) {
- if (!ar_cleared_entry(hash, i)) {
- ar_table_pair *pair = RHASH_AR_TABLE_REF(hash, i);
- if (value != 0) *value = pair->val;
- *key = pair->key;
- ar_clear_entry(hash, i);
- RHASH_AR_TABLE_SIZE_DEC(hash);
- return 1;
- }
- }
- }
- if (value != NULL) *value = 0;
- return 0;
-}
-
-static long
-ar_keys(VALUE hash, st_data_t *keys, st_index_t size)
-{
- unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
- st_data_t *keys_start = keys, *keys_end = keys + size;
-
- for (i = 0; i < bound; i++) {
- if (keys == keys_end) {
- break;
- }
- else {
- if (!ar_cleared_entry(hash, i)) {
- *keys++ = RHASH_AR_TABLE_REF(hash, i)->key;
- }
- }
- }
-
- return keys - keys_start;
-}
-
-static long
-ar_values(VALUE hash, st_data_t *values, st_index_t size)
-{
- unsigned i, bound = RHASH_AR_TABLE_BOUND(hash);
- st_data_t *values_start = values, *values_end = values + size;
-
- for (i = 0; i < bound; i++) {
- if (values == values_end) {
- break;
- }
- else {
- if (!ar_cleared_entry(hash, i)) {
- *values++ = RHASH_AR_TABLE_REF(hash, i)->val;
- }
- }
- }
-
- return values - values_start;
-}
-
-static ar_table*
-ar_copy(VALUE hash1, VALUE hash2)
-{
- ar_table *old_tab = RHASH_AR_TABLE(hash2);
-
- if (old_tab != NULL) {
- ar_table *new_tab = RHASH_AR_TABLE(hash1);
- if (new_tab == NULL) {
- new_tab = (ar_table*) rb_transient_heap_alloc(hash1, sizeof(ar_table));
- if (new_tab != NULL) {
- RHASH_SET_TRANSIENT_FLAG(hash1);
- }
- else {
- RHASH_UNSET_TRANSIENT_FLAG(hash1);
- new_tab = (ar_table*)ruby_xmalloc(sizeof(ar_table));
- }
- }
- *new_tab = *old_tab;
- RHASH(hash1)->ar_hint.word = RHASH(hash2)->ar_hint.word;
- RHASH_AR_TABLE_BOUND_SET(hash1, RHASH_AR_TABLE_BOUND(hash2));
- RHASH_AR_TABLE_SIZE_SET(hash1, RHASH_AR_TABLE_SIZE(hash2));
- hash_ar_table_set(hash1, new_tab);
-
- rb_gc_writebarrier_remember(hash1);
- return new_tab;
- }
- else {
- RHASH_AR_TABLE_BOUND_SET(hash1, RHASH_AR_TABLE_BOUND(hash2));
- RHASH_AR_TABLE_SIZE_SET(hash1, RHASH_AR_TABLE_SIZE(hash2));
-
- if (RHASH_TRANSIENT_P(hash1)) {
- RHASH_UNSET_TRANSIENT_FLAG(hash1);
- }
- else if (RHASH_AR_TABLE(hash1)) {
- ruby_xfree(RHASH_AR_TABLE(hash1));
- }
-
- hash_ar_table_set(hash1, NULL);
-
- rb_gc_writebarrier_remember(hash1);
- return old_tab;
- }
-}
-
-static void
-ar_clear(VALUE hash)
-{
- if (RHASH_AR_TABLE(hash) != NULL) {
- RHASH_AR_TABLE_SIZE_SET(hash, 0);
- RHASH_AR_TABLE_BOUND_SET(hash, 0);
- }
- else {
- HASH_ASSERT(RHASH_AR_TABLE_SIZE(hash) == 0);
- HASH_ASSERT(RHASH_AR_TABLE_BOUND(hash) == 0);
- }
-}
-
-#if USE_TRANSIENT_HEAP
-void
-rb_hash_transient_heap_evacuate(VALUE hash, int promote)
-{
- if (RHASH_TRANSIENT_P(hash)) {
- ar_table *new_tab;
- ar_table *old_tab = RHASH_AR_TABLE(hash);
-
- if (UNLIKELY(old_tab == NULL)) {
- rb_gc_force_recycle(hash);
- return;
- }
- HASH_ASSERT(old_tab != NULL);
- if (promote) {
- promote:
- new_tab = ruby_xmalloc(sizeof(ar_table));
- RHASH_UNSET_TRANSIENT_FLAG(hash);
- }
- else {
- new_tab = rb_transient_heap_alloc(hash, sizeof(ar_table));
- if (new_tab == NULL) goto promote;
- }
- *new_tab = *old_tab;
- hash_ar_table_set(hash, new_tab);
- }
- hash_verify(hash);
-}
-#endif
-
typedef int st_foreach_func(st_data_t, st_data_t, st_data_t);
struct foreach_safe_arg {
@@ -1285,7 +247,7 @@ foreach_safe_i(st_data_t key, st_data_t value, st_data_t args, int error)
}
void
-st_foreach_safe(st_table *table, st_foreach_func *func, st_data_t a)
+st_foreach_safe(st_table *table, int (*func)(ANYARGS), st_data_t a)
{
struct foreach_safe_arg arg;
@@ -1306,27 +268,6 @@ struct hash_foreach_arg {
};
static int
-hash_ar_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
-{
- struct hash_foreach_arg *arg = (struct hash_foreach_arg *)argp;
- int status;
-
- if (error) return ST_STOP;
- status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg);
- /* TODO: rehash check? rb_raise(rb_eRuntimeError, "rehash occurred during iteration"); */
-
- switch (status) {
- case ST_DELETE:
- return ST_DELETE;
- case ST_CONTINUE:
- break;
- case ST_STOP:
- return ST_STOP;
- }
- return ST_CHECK;
-}
-
-static int
hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
{
struct hash_foreach_arg *arg = (struct hash_foreach_arg *)argp;
@@ -1334,13 +275,14 @@ hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
st_table *tbl;
if (error) return ST_STOP;
- tbl = RHASH_ST_TABLE(arg->hash);
+ tbl = RHASH(arg->hash)->ntbl;
status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg);
- if (RHASH_ST_TABLE(arg->hash) != tbl) {
- rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
+ if (RHASH(arg->hash)->ntbl != tbl) {
+ rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
}
switch (status) {
case ST_DELETE:
+ FL_SET(arg->hash, HASH_DELETED);
return ST_DELETE;
case ST_CONTINUE:
break;
@@ -1350,165 +292,65 @@ hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
return ST_CHECK;
}
-static int
-iter_lev_in_ivar(VALUE hash)
-{
- VALUE levval = rb_ivar_get(hash, id_hash_iter_lev);
- HASH_ASSERT(FIXNUM_P(levval));
- return FIX2INT(levval);
-}
-
-void rb_ivar_set_internal(VALUE obj, ID id, VALUE val);
-
-static void
-iter_lev_in_ivar_set(VALUE hash, int lev)
-{
- rb_ivar_set_internal(hash, id_hash_iter_lev, INT2FIX(lev));
-}
-
-static int
-iter_lev_in_flags(VALUE hash)
-{
- unsigned int u = (unsigned int)((RBASIC(hash)->flags >> RHASH_LEV_SHIFT) & RHASH_LEV_MAX);
- return (int)u;
-}
-
-static int
-RHASH_ITER_LEV(VALUE hash)
-{
- int lev = iter_lev_in_flags(hash);
-
- if (lev == RHASH_LEV_MAX) {
- return iter_lev_in_ivar(hash);
- }
- else {
- return lev;
- }
-}
-
-static void
-hash_iter_lev_inc(VALUE hash)
-{
- int lev = iter_lev_in_flags(hash);
- if (lev == RHASH_LEV_MAX) {
- lev = iter_lev_in_ivar(hash);
- iter_lev_in_ivar_set(hash, lev+1);
- }
- else {
- lev += 1;
- RBASIC(hash)->flags = ((RBASIC(hash)->flags & ~RHASH_LEV_MASK) | (lev << RHASH_LEV_SHIFT));
- if (lev == RHASH_LEV_MAX) {
- iter_lev_in_ivar_set(hash, lev);
- }
- }
-}
-
-static void
-hash_iter_lev_dec(VALUE hash)
-{
- int lev = iter_lev_in_flags(hash);
- if (lev == RHASH_LEV_MAX) {
- lev = iter_lev_in_ivar(hash);
- HASH_ASSERT(lev > 0);
- iter_lev_in_ivar_set(hash, lev-1);
- }
- else {
- HASH_ASSERT(lev > 0);
- RBASIC(hash)->flags = ((RBASIC(hash)->flags & ~RHASH_LEV_MASK) | ((lev-1) << RHASH_LEV_SHIFT));
- }
-}
-
static VALUE
hash_foreach_ensure_rollback(VALUE hash)
{
- hash_iter_lev_inc(hash);
+ RHASH_ITER_LEV(hash)++;
return 0;
}
static VALUE
hash_foreach_ensure(VALUE hash)
{
- hash_iter_lev_dec(hash);
- return 0;
-}
-
-int
-rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg)
-{
- if (RHASH_AR_TABLE_P(hash)) {
- return ar_foreach(hash, func, arg);
- }
- else {
- return st_foreach(RHASH_ST_TABLE(hash), func, arg);
- }
-}
-
-int
-rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg)
-{
- if (RHASH_AR_TABLE_P(hash)) {
- return ar_foreach_with_replace(hash, func, replace, arg);
- }
- else {
- return st_foreach_with_replace(RHASH_ST_TABLE(hash), func, replace, arg);
+ 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;
}
static VALUE
hash_foreach_call(VALUE arg)
{
VALUE hash = ((struct hash_foreach_arg *)arg)->hash;
- int ret = 0;
- if (RHASH_AR_TABLE_P(hash)) {
- ret = ar_foreach_check(hash, hash_ar_foreach_iter,
- (st_data_t)arg, (st_data_t)Qundef);
- }
- else if (RHASH_ST_TABLE_P(hash)) {
- ret = st_foreach_check(RHASH_ST_TABLE(hash), hash_foreach_iter,
- (st_data_t)arg, (st_data_t)Qundef);
- }
- if (ret) {
- rb_raise(rb_eRuntimeError, "ret: %d, hash modified during iteration", ret);
+ if (st_foreach_check(RHASH(hash)->ntbl, hash_foreach_iter, (st_data_t)arg, (st_data_t)Qundef)) {
+ rb_raise(rb_eRuntimeError, "hash modified during iteration");
}
return Qnil;
}
void
-rb_hash_foreach(VALUE hash, rb_foreach_func *func, VALUE farg)
+rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg)
{
struct hash_foreach_arg arg;
- if (RHASH_TABLE_EMPTY_P(hash))
+ if (!RHASH(hash)->ntbl)
return;
- hash_iter_lev_inc(hash);
+ RHASH_ITER_LEV(hash)++;
arg.hash = hash;
arg.func = (rb_foreach_func *)func;
arg.arg = farg;
rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash);
- hash_verify(hash);
}
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);
}
@@ -1519,51 +361,28 @@ rb_hash_new(void)
return hash_alloc(rb_cHash);
}
-MJIT_FUNC_EXPORTED 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 == 0) {
- /* do nothing */
- }
- else if (size <= RHASH_AR_TABLE_MAX_SIZE) {
- ar_alloc_table(ret);
- }
- else {
- RHASH_ST_TABLE_SET(ret, 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)) {
- if (RHASH_AR_TABLE_P(hash))
- ar_copy(ret, hash);
- else if (RHASH_ST_TABLE_P(hash))
- RHASH_ST_TABLE_SET(ret, st_copy(RHASH_ST_TABLE(hash)));
+ if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
+ FL_SET(ret, HASH_PROC_DEFAULT);
}
- return ret;
+ 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|RHASH_PROC_DEFAULT));
- if (flags & FL_EXIVAR)
- rb_copy_generic_ivar(ret, hash);
- return ret;
-}
-
-MJIT_FUNC_EXPORTED VALUE
-rb_hash_resurrect(VALUE hash)
-{
- VALUE ret = hash_dup(hash, rb_cHash, 0);
+ VALUE ret = rb_hash_dup_empty(hash);
+ if (!RHASH_EMPTY_P(hash))
+ RHASH(ret)->ntbl = st_copy(RHASH(hash)->ntbl);
return ret;
}
@@ -1573,30 +392,33 @@ rb_hash_modify_check(VALUE hash)
rb_check_frozen(hash);
}
-MJIT_FUNC_EXPORTED struct st_table *
-#if RHASH_CONVERT_TABLE_DEBUG
-rb_hash_tbl_raw(VALUE hash, const char *file, int line)
+static struct st_table *
+hash_tbl(VALUE hash)
{
- return ar_force_convert_table(hash, file, line);
+ if (!RHASH(hash)->ntbl) {
+ RHASH(hash)->ntbl = st_init_table(&objhash);
+ }
+ return RHASH(hash)->ntbl;
}
-#else
-rb_hash_tbl_raw(VALUE hash)
+
+struct st_table *
+rb_hash_tbl(VALUE hash)
{
- return ar_force_convert_table(hash, NULL, 0);
+ OBJ_WB_UNPROTECT(hash);
+ return hash_tbl(hash);
}
-#endif
struct st_table *
-rb_hash_tbl(VALUE hash, const char *file, int line)
+rb_hash_tbl_raw(VALUE hash)
{
- OBJ_WB_UNPROTECT(hash);
- return RHASH_TBL_RAW(hash);
+ return hash_tbl(hash);
}
static void
rb_hash_modify(VALUE hash)
{
rb_hash_modify_check(hash);
+ hash_tbl(hash);
}
NORETURN(static void no_new_key(void));
@@ -1634,26 +456,8 @@ struct update_arg {
VALUE old_value;
};
-typedef int (*tbl_update_func)(st_data_t *, st_data_t *, st_data_t, int);
-
-int
-rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func func, st_data_t arg)
-{
- if (RHASH_AR_TABLE_P(hash)) {
- int result = ar_update(hash, (st_data_t)key, func, arg);
- if (result == -1) {
- ar_try_convert_table(hash);
- }
- else {
- return result;
- }
- }
-
- return st_update(RHASH_ST_TABLE(hash), (st_data_t)key, func, arg);
-}
-
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;
@@ -1665,7 +469,7 @@ tbl_update(VALUE hash, VALUE key, tbl_update_func func, st_data_t optional_arg)
arg.new_value = 0;
arg.old_value = Qundef;
- result = rb_hash_stlike_update(hash, key, func, (st_data_t)&arg);
+ result = st_update(RHASH(hash)->ntbl, (st_data_t)key, func, (st_data_t)&arg);
/* write barrier */
if (arg.new_key) RB_OBJ_WRITTEN(hash, arg.old_key, arg.new_key);
@@ -1684,19 +488,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, RHASH_PROC_DEFAULT);
- RHASH_SET_IFNONE(hash, proc);
}
/*
@@ -1743,7 +542,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);
@@ -1778,17 +579,15 @@ 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]);
+ tmp = rb_hash_s_try_convert(Qnil, argv[0]);
if (!NIL_P(tmp)) {
hash = hash_alloc(klass);
- if (RHASH_AR_TABLE_P(tmp)) {
- ar_copy(hash, tmp);
+ if (RHASH(tmp)->ntbl) {
+ RHASH(hash)->ntbl = st_copy(RHASH(tmp)->ntbl);
}
- else {
- RHASH_ST_TABLE_SET(hash, st_copy(RHASH_ST_TABLE(tmp)));
- }
return hash;
}
@@ -1803,8 +602,17 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
VALUE key, val = Qnil;
if (NIL_P(v)) {
+#if 0 /* refix in the next release */
rb_raise(rb_eArgError, "wrong element type %s at %ld (expected array)",
rb_builtin_class_name(e), i);
+
+#else
+ rb_warn("wrong element type %s at %ld (expected array)",
+ rb_builtin_class_name(e), i);
+ rb_warn("ignoring wrong elements is deprecated, remove them explicitly");
+ rb_warn("this causes ArgumentError in the next release");
+ continue;
+#endif
}
switch (RARRAY_LEN(v)) {
default:
@@ -1825,22 +633,23 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
}
hash = hash_alloc(klass);
- rb_hash_bulk_insert(argc, argv, hash);
- hash_verify(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");
}
/*
@@ -1868,12 +677,9 @@ struct rehash_arg {
static int
rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
{
- if (RHASH_AR_TABLE_P(arg)) {
- ar_insert(arg, (st_data_t)key, (st_data_t)value);
- }
- else {
- st_insert(RHASH_ST_TABLE(arg), (st_data_t)key, (st_data_t)value);
- }
+ st_table *tbl = (st_table *)arg;
+
+ st_insert(tbl, (st_data_t)key, (st_data_t)value);
return ST_CONTINUE;
}
@@ -1883,9 +689,9 @@ 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 Hash#rehash is
- * called while an iterator is traversing the hash, a
- * RuntimeError will be raised in the iterator.
+ * method will reindex <i>hsh</i>. If <code>Hash#rehash</code> is
+ * called while an iterator is traversing the hash, an
+ * <code>RuntimeError</code> will be raised in the iterator.
*
* a = [ "a", "b" ]
* c = [ "c", "d" ]
@@ -1897,7 +703,7 @@ rb_hash_rehash_i(VALUE key, VALUE value, VALUE arg)
* h[a] #=> 100
*/
-VALUE
+static VALUE
rb_hash_rehash(VALUE hash)
{
VALUE tmp;
@@ -1907,34 +713,26 @@ rb_hash_rehash(VALUE hash)
rb_raise(rb_eRuntimeError, "rehash during iteration");
}
rb_hash_modify_check(hash);
- if (RHASH_AR_TABLE_P(hash)) {
- tmp = hash_alloc(0);
- ar_alloc_table(tmp);
- rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp);
- ar_free_and_clear_table(hash);
- ar_copy(hash, tmp);
- ar_free_and_clear_table(tmp);
- }
- else if (RHASH_ST_TABLE_P(hash)) {
- st_table *old_tab = RHASH_ST_TABLE(hash);
- tmp = hash_alloc(0);
- tbl = st_init_table_with_size(old_tab->type, old_tab->num_entries);
- RHASH_ST_TABLE_SET(tmp, tbl);
- rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp);
- st_free_table(old_tab);
- RHASH_ST_TABLE_SET(hash, tbl);
- RHASH_ST_CLEAR(tmp);
- }
- hash_verify(hash);
+ if (!RHASH(hash)->ntbl)
+ return hash;
+ tmp = hash_alloc(0);
+ tbl = st_init_table_with_size(RHASH(hash)->ntbl->type, RHASH(hash)->ntbl->num_entries);
+ RHASH(tmp)->ntbl = tbl;
+
+ rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tbl);
+ st_free_table(RHASH(hash)->ntbl);
+ RHASH(hash)->ntbl = tbl;
+ RHASH(tmp)->ntbl = 0;
+
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);
- if (!FL_TEST(hash, RHASH_PROC_DEFAULT)) return ifnone;
+ if (!FL_TEST(hash, HASH_PROC_DEFAULT)) return ifnone;
if (key == Qundef) return Qnil;
return rb_funcall(ifnone, id_yield, 2, hash, key);
}
@@ -1943,32 +741,13 @@ rb_hash_default_value(VALUE hash, VALUE key)
}
}
-static inline int
-hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval)
-{
- hash_verify(hash);
-
- if (RHASH_AR_TABLE_P(hash)) {
- return ar_lookup(hash, key, pval);
- }
- else {
- return st_lookup(RHASH_ST_TABLE(hash), key, pval);
- }
-}
-
-MJIT_FUNC_EXPORTED int
-rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval)
-{
- return hash_stlike_lookup(hash, key, pval);
-}
-
/*
* call-seq:
* hsh[key] -> value
*
* Element Reference---Retrieves the <i>value</i> object corresponding
* to the <i>key</i> object. If not found, returns the default value (see
- * Hash::new for details).
+ * <code>Hash::new</code> for details).
*
* h = { "a" => 100, "b" => 200 }
* h["a"] #=> 100
@@ -1981,12 +760,10 @@ rb_hash_aref(VALUE hash, VALUE key)
{
st_data_t val;
- if (hash_stlike_lookup(hash, key, &val)) {
- return (VALUE)val;
- }
- else {
- return rb_hash_default_value(hash, key);
+ if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
+ return hash_default_value(hash, key);
}
+ return (VALUE)val;
}
VALUE
@@ -1994,12 +771,10 @@ rb_hash_lookup2(VALUE hash, VALUE key, VALUE def)
{
st_data_t val;
- if (hash_stlike_lookup(hash, key, &val)) {
- return (VALUE)val;
- }
- else {
- return def; /* without Hash#default */
+ if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
+ return def; /* without Hash#default */
}
+ return (VALUE)val;
}
VALUE
@@ -2015,9 +790,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 KeyError 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
@@ -2051,26 +826,19 @@ rb_hash_fetch_m(int argc, VALUE *argv, VALUE hash)
if (block_given && argc == 2) {
rb_warn("block supersedes default value argument");
}
-
- if (hash_stlike_lookup(hash, key, &val)) {
- return (VALUE)val;
- }
- else {
- if (block_given) {
- return rb_yield(key);
- }
- else if (argc == 1) {
- 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);
- }
- else {
- return argv[1];
- }
+ if (!RHASH(hash)->ntbl || !st_lookup(RHASH(hash)->ntbl, key, &val)) {
+ if (block_given) return rb_yield(key);
+ if (argc == 1) {
+ volatile VALUE desc = rb_protect(rb_inspect, key, 0);
+ if (NIL_P(desc)) {
+ desc = rb_any_to_s(key);
+ }
+ desc = rb_str_ellipsize(desc, 65);
+ rb_raise(rb_eKeyError, "key not found: %"PRIsVALUE, desc);
+ }
+ return argv[1];
}
+ return (VALUE)val;
}
VALUE
@@ -2085,7 +853,7 @@ rb_hash_fetch(VALUE hash, VALUE key)
*
* Returns the default value, the value that would be returned by
* <i>hsh</i>[<i>key</i>] if <i>key</i> did not exist in <i>hsh</i>.
- * See also Hash::new and Hash#default=.
+ * See also <code>Hash::new</code> and <code>Hash#default=</code>.
*
* h = Hash.new #=> {}
* h.default #=> nil
@@ -2103,15 +871,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, RHASH_PROC_DEFAULT)) {
+ 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;
}
@@ -2122,7 +889,7 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash)
*
* Sets the default value, the value returned for a key that does not
* exist in the hash. It is not possible to set the default to a
- * Proc that will be executed on each key lookup.
+ * <code>Proc</code> that will be executed on each key lookup.
*
* h = { "a" => 100, "b" => 200 }
* h.default = "Go fish"
@@ -2140,7 +907,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;
}
@@ -2148,7 +916,7 @@ rb_hash_set_default(VALUE hash, VALUE ifnone)
* call-seq:
* hsh.default_proc -> anObject
*
- * If Hash::new was invoked with a block, return that
+ * If <code>Hash::new</code> was invoked with a block, return that
* block, otherwise return <code>nil</code>.
*
* h = Hash.new {|h,k| h[k] = k*k } #=> {}
@@ -2162,7 +930,7 @@ rb_hash_set_default(VALUE hash, VALUE ifnone)
static VALUE
rb_hash_default_proc(VALUE hash)
{
- if (FL_TEST(hash, RHASH_PROC_DEFAULT)) {
+ if (FL_TEST(hash, HASH_PROC_DEFAULT)) {
return RHASH_IFNONE(hash);
}
return Qnil;
@@ -2188,17 +956,20 @@ rb_hash_set_default_proc(VALUE hash, VALUE proc)
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;
}
@@ -2245,21 +1016,10 @@ rb_hash_key(VALUE hash, VALUE value)
static VALUE
rb_hash_index(VALUE hash, VALUE value)
{
- rb_warn_deprecated("Hash#index", "Hash#key");
+ rb_warn("Hash#index is deprecated; use Hash#key");
return rb_hash_key(hash, value);
}
-int
-rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval)
-{
- if (RHASH_AR_TABLE_P(hash)) {
- return ar_delete(hash, pkey, pval);
- }
- else {
- return st_delete(RHASH_ST_TABLE(hash), pkey, pval);
- }
-}
-
/*
* delete a specified entry a given key.
* if there is the corresponding entry, return a value of the entry.
@@ -2270,11 +1030,19 @@ rb_hash_delete_entry(VALUE hash, VALUE key)
{
st_data_t ktmp = (st_data_t)key, val;
- if (rb_hash_stlike_delete(hash, &ktmp, &val)) {
- return (VALUE)val;
+ if (!RHASH(hash)->ntbl) {
+ return Qundef;
+ }
+ else if (RHASH_ITER_LEV(hash) > 0 &&
+ (st_delete_safe(RHASH(hash)->ntbl, &ktmp, &val, (st_data_t)Qundef))) {
+ FL_SET(hash, HASH_DELETED);
+ return (VALUE)val;
+ }
+ else if (st_delete(RHASH(hash)->ntbl, &ktmp, &val)) {
+ return (VALUE)val;
}
else {
- return Qundef;
+ return Qundef;
}
}
@@ -2302,8 +1070,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>.
*
@@ -2369,29 +1137,14 @@ rb_hash_shift(VALUE hash)
struct shift_var var;
rb_hash_modify_check(hash);
- if (RHASH_AR_TABLE_P(hash)) {
+ if (RHASH(hash)->ntbl) {
var.key = Qundef;
if (RHASH_ITER_LEV(hash) == 0) {
- if (ar_shift(hash, &var.key, &var.val)) {
+ if (st_shift(RHASH(hash)->ntbl, &var.key, &var.val)) {
return rb_assoc_new(var.key, var.val);
}
}
else {
- rb_hash_foreach(hash, shift_i_safe, (VALUE)&var);
- if (var.key != Qundef) {
- rb_hash_delete_entry(hash, var.key);
- return rb_assoc_new(var.key, var.val);
- }
- }
- }
- if (RHASH_ST_TABLE_P(hash)) {
- var.key = Qundef;
- if (RHASH_ITER_LEV(hash) == 0) {
- if (st_shift(RHASH_ST_TABLE(hash), &var.key, &var.val)) {
- return rb_assoc_new(var.key, var.val);
- }
- }
- else {
rb_hash_foreach(hash, shift_i_safe, (VALUE)&var);
if (var.key != Qundef) {
rb_hash_delete_entry(hash, var.key);
@@ -2399,7 +1152,7 @@ rb_hash_shift(VALUE hash)
}
}
}
- return rb_hash_default_value(hash, Qnil);
+ return hash_default_value(hash, Qnil);
}
static int
@@ -2437,9 +1190,8 @@ rb_hash_delete_if(VALUE hash)
{
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
rb_hash_modify_check(hash);
- if (!RHASH_TABLE_EMPTY_P(hash)) {
- rb_hash_foreach(hash, delete_if_i, hash);
- }
+ if (RHASH(hash)->ntbl)
+ rb_hash_foreach(hash, delete_if_i, hash);
return hash;
}
@@ -2448,7 +1200,7 @@ rb_hash_delete_if(VALUE hash)
* hsh.reject! {| key, value | block } -> hsh or nil
* hsh.reject! -> an_enumerator
*
- * Equivalent to Hash#delete_if, but returns
+ * Equivalent to <code>Hash#delete_if</code>, but returns
* <code>nil</code> if no changes were made.
*/
@@ -2462,7 +1214,7 @@ rb_hash_reject_bang(VALUE hash)
n = RHASH_SIZE(hash);
if (!n) return Qnil;
rb_hash_foreach(hash, delete_if_i, hash);
- if (n == RHASH_SIZE(hash)) return Qnil;
+ if (n == RHASH(hash)->ntbl->num_entries) return Qnil;
return hash;
}
@@ -2509,43 +1261,11 @@ 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
*
* Return an array containing the values associated with the given keys.
- * Also see Hash.select.
+ * Also see <code>Hash.select</code>.
*
* h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }
* h.values_at("cow", "cat") #=> ["bovine", "feline"]
@@ -2563,34 +1283,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 KeyError when one of keys can't be found.
- * Also see Hash#values_at and Hash#fetch.
- *
- * 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)
{
@@ -2604,8 +1296,6 @@ select_i(VALUE key, VALUE value, VALUE result)
* call-seq:
* hsh.select {|key, value| block} -> a_hash
* hsh.select -> an_enumerator
- * hsh.filter {|key, value| block} -> a_hash
- * hsh.filter -> an_enumerator
*
* Returns a new hash consisting of entries for which the block returns true.
*
@@ -2614,8 +1304,6 @@ select_i(VALUE key, VALUE value, VALUE result)
* h = { "a" => 100, "b" => 200, "c" => 300 }
* h.select {|k,v| k > "a"} #=> {"b" => 200, "c" => 300}
* h.select {|k,v| v < 200} #=> {"a" => 100}
- *
- * Hash#filter is an alias for Hash#select.
*/
VALUE
@@ -2644,13 +1332,9 @@ keep_if_i(VALUE key, VALUE value, VALUE hash)
* call-seq:
* hsh.select! {| key, value | block } -> hsh or nil
* hsh.select! -> an_enumerator
- * hsh.filter! {| key, value | block } -> hsh or nil
- * hsh.filter! -> an_enumerator
*
- * Equivalent to Hash#keep_if, but returns
- * +nil+ if no changes were made.
- *
- * Hash#filter! is an alias for Hash#select!.
+ * Equivalent to <code>Hash#keep_if</code>, but returns
+ * <code>nil</code> if no changes were made.
*/
VALUE
@@ -2660,10 +1344,11 @@ rb_hash_select_bang(VALUE hash)
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
rb_hash_modify_check(hash);
- n = RHASH_SIZE(hash);
- if (!n) return Qnil;
+ if (!RHASH(hash)->ntbl)
+ return Qnil;
+ n = RHASH(hash)->ntbl->num_entries;
rb_hash_foreach(hash, keep_if_i, hash);
- if (n == RHASH_SIZE(hash)) return Qnil;
+ if (n == RHASH(hash)->ntbl->num_entries) return Qnil;
return hash;
}
@@ -2673,11 +1358,10 @@ rb_hash_select_bang(VALUE hash)
* hsh.keep_if -> an_enumerator
*
* Deletes every key-value pair from <i>hsh</i> for which <i>block</i>
- * evaluates to +false+.
+ * evaluates to false.
*
* If no block is given, an enumerator is returned instead.
*
- * See also Hash#select!.
*/
VALUE
@@ -2685,9 +1369,8 @@ rb_hash_keep_if(VALUE hash)
{
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
rb_hash_modify_check(hash);
- if (!RHASH_TABLE_EMPTY_P(hash)) {
- rb_hash_foreach(hash, keep_if_i, hash);
- }
+ if (RHASH(hash)->ntbl)
+ rb_hash_foreach(hash, keep_if_i, hash);
return hash;
}
@@ -2712,15 +1395,13 @@ VALUE
rb_hash_clear(VALUE hash)
{
rb_hash_modify_check(hash);
-
- if (RHASH_ITER_LEV(hash) > 0) {
- rb_hash_foreach(hash, clear_i, 0);
- }
- else if (RHASH_AR_TABLE_P(hash)) {
- ar_clear(hash);
- }
- else {
- st_clear(RHASH_ST_TABLE(hash));
+ if (!RHASH(hash)->ntbl)
+ return hash;
+ if (RHASH(hash)->ntbl->num_entries > 0) {
+ if (RHASH_ITER_LEV(hash) > 0)
+ rb_hash_foreach(hash, clear_i, 0);
+ else
+ st_clear(RHASH(hash)->ntbl);
}
return hash;
@@ -2741,28 +1422,17 @@ hash_aset(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
return ST_CONTINUE;
}
-VALUE
-rb_hash_key_str(VALUE key)
-{
- if (!RB_FL_ANY_RAW(key, FL_EXIVAR) && RBASIC_CLASS(key) == rb_cString) {
- return rb_fstring(key);
- }
- else {
- return rb_str_new_frozen(key);
- }
-}
-
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)) {
- *key = rb_hash_key_str(*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:
@@ -2795,15 +1465,14 @@ VALUE
rb_hash_aset(VALUE hash, VALUE key, VALUE val)
{
int iter_lev = RHASH_ITER_LEV(hash);
+ st_table *tbl = RHASH(hash)->ntbl;
rb_hash_modify(hash);
-
- if (RHASH_TABLE_NULL_P(hash)) {
+ if (!tbl) {
if (iter_lev > 0) no_new_key();
- ar_alloc_table(hash);
+ tbl = hash_tbl(hash);
}
-
- if (RHASH_TYPE(hash) == &identhash || rb_obj_class(key) != rb_cString) {
+ if (tbl->type == &identhash || rb_obj_class(key) != rb_cString) {
RHASH_UPDATE_ITER(hash, iter_lev, key, hash_aset, val);
}
else {
@@ -2812,6 +1481,49 @@ rb_hash_aset(VALUE hash, VALUE key, VALUE val)
return val;
}
+static int
+replace_i(VALUE key, VALUE val, VALUE hash)
+{
+ rb_hash_aset(hash, key, val);
+
+ return ST_CONTINUE;
+}
+
+/* :nodoc: */
+static VALUE
+rb_hash_initialize_copy(VALUE hash, VALUE hash2)
+{
+ st_table *ntbl;
+
+ rb_hash_modify_check(hash);
+ hash2 = to_hash(hash2);
+
+ Check_Type(hash2, T_HASH);
+
+ if (hash == hash2) return hash;
+
+ ntbl = RHASH(hash)->ntbl;
+ if (RHASH(hash2)->ntbl) {
+ if (ntbl) st_free_table(ntbl);
+ RHASH(hash)->ntbl = st_copy(RHASH(hash2)->ntbl);
+ if (RHASH(hash)->ntbl->num_entries)
+ rb_hash_rehash(hash);
+ }
+ else if (ntbl) {
+ st_clear(ntbl);
+ }
+
+ 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;
+}
+
/*
* call-seq:
* hsh.replace(other_hash) -> hsh
@@ -2827,55 +1539,38 @@ rb_hash_aset(VALUE hash, VALUE key, VALUE val)
static VALUE
rb_hash_replace(VALUE hash, VALUE hash2)
{
+ st_table *table2;
+
rb_hash_modify_check(hash);
if (hash == hash2) return hash;
- if (RHASH_ITER_LEV(hash) > 0) {
- rb_raise(rb_eRuntimeError, "can't replace hash during iteration");
- }
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);
- if (RHASH_AR_TABLE_P(hash)) {
- if (RHASH_AR_TABLE_P(hash2)) {
- ar_clear(hash);
- }
- else {
- ar_free_and_clear_table(hash);
- RHASH_ST_TABLE_SET(hash, st_init_table_with_size(RHASH_TYPE(hash2), RHASH_SIZE(hash2)));
- }
- }
- else {
- if (RHASH_AR_TABLE_P(hash2)) {
- st_free_table(RHASH_ST_TABLE(hash));
- RHASH_ST_CLEAR(hash);
- }
- else {
- st_clear(RHASH_ST_TABLE(hash));
- RHASH_TBL_RAW(hash)->type = RHASH_ST_TABLE(hash2)->type;
- }
- }
- rb_hash_foreach(hash2, rb_hash_rehash_i, (VALUE)hash);
+ table2 = RHASH(hash2)->ntbl;
- rb_gc_writebarrier_remember(hash);
+ rb_hash_clear(hash);
+ if (table2) hash_tbl(hash)->type = table2->type;
+ rb_hash_foreach(hash2, replace_i, hash);
return hash;
}
/*
* call-seq:
- * hsh.length -> integer
- * hsh.size -> integer
+ * hsh.length -> fixnum
+ * hsh.size -> fixnum
*
* Returns the number of key-value pairs in the hash.
*
* h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 }
- * h.size #=> 4
+ * h.length #=> 4
* h.delete("a") #=> 200
- * h.size #=> 3
* h.length #=> 3
- *
- * Hash#length is an alias for Hash#size.
*/
VALUE
@@ -2884,11 +1579,6 @@ rb_hash_size(VALUE hash)
return INT2FIX(RHASH_SIZE(hash));
}
-size_t
-rb_hash_size_num(VALUE hash)
-{
- return (long)RHASH_SIZE(hash);
-}
/*
* call-seq:
@@ -2907,7 +1597,7 @@ rb_hash_empty_p(VALUE hash)
}
static int
-each_value_i(VALUE key, VALUE value, VALUE _)
+each_value_i(VALUE key, VALUE value)
{
rb_yield(value);
return ST_CONTINUE;
@@ -2941,7 +1631,7 @@ rb_hash_each_value(VALUE hash)
}
static int
-each_key_i(VALUE key, VALUE value, VALUE _)
+each_key_i(VALUE key, VALUE value)
{
rb_yield(key);
return ST_CONTINUE;
@@ -2974,19 +1664,16 @@ rb_hash_each_key(VALUE hash)
}
static int
-each_pair_i(VALUE key, VALUE value, VALUE _)
+each_pair_i(VALUE key, VALUE value)
{
rb_yield(rb_assoc_new(key, value));
return ST_CONTINUE;
}
static int
-each_pair_i_fast(VALUE key, VALUE value, VALUE _)
+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;
}
@@ -3024,158 +1711,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_TABLE_EMPTY_P(hash)) {
- 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_foreach_func(st_data_t key, st_data_t value, st_data_t argp, int error)
-{
- return ST_REPLACE;
-}
-
-static int
-transform_values_foreach_replace(st_data_t *key, st_data_t *value, st_data_t argp, int existing)
-{
- VALUE new_value = rb_yield((VALUE)*value);
- *value = 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 = hash_dup(hash, rb_cHash, 0);
-
- if (!RHASH_EMPTY_P(hash)) {
- rb_hash_stlike_foreach_with_replace(result, transform_values_foreach_func, transform_values_foreach_replace, 0);
- }
-
- 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_TABLE_EMPTY_P(hash)) {
- rb_hash_stlike_foreach_with_replace(hash, transform_values_foreach_func, transform_values_foreach_replace, 0);
- }
-
- return hash;
-}
-
-static int
to_a_i(VALUE key, VALUE value, VALUE ary)
{
rb_ary_push(ary, rb_assoc_new(key, value));
@@ -3200,6 +1735,7 @@ rb_hash_to_a(VALUE hash)
ary = rb_ary_new_capa(RHASH_SIZE(hash));
rb_hash_foreach(hash, to_a_i, ary);
+ OBJ_INFECT(ary, hash);
return ary;
}
@@ -3217,9 +1753,11 @@ inspect_i(VALUE key, VALUE value, VALUE str)
rb_enc_copy(str, str2);
}
rb_str_buf_append(str, str2);
+ OBJ_INFECT(str, str2);
rb_str_buf_cat_ascii(str, "=>");
str2 = rb_inspect(value);
rb_str_buf_append(str, str2);
+ OBJ_INFECT(str, str2);
return ST_CONTINUE;
}
@@ -3233,6 +1771,7 @@ inspect_hash(VALUE hash, VALUE dummy, int recur)
str = rb_str_buf_new2("{");
rb_hash_foreach(hash, inspect_i, str);
rb_str_buf_cat2(str, "}");
+ OBJ_INFECT(str, hash);
return str;
}
@@ -3269,60 +1808,26 @@ rb_hash_to_hash(VALUE hash)
return hash;
}
-VALUE
-rb_hash_set_pair(VALUE hash, VALUE arg)
-{
- VALUE pair;
-
- pair = rb_check_array_type(arg);
- if (NIL_P(pair)) {
- rb_raise(rb_eTypeError, "wrong element type %s (expected array)",
- rb_builtin_class_name(arg));
- }
- if (RARRAY_LEN(pair) != 2) {
- rb_raise(rb_eArgError, "element has wrong array length (expected 2, was %ld)",
- RARRAY_LEN(pair));
- }
- rb_hash_aset(hash, RARRAY_AREF(pair, 0), RARRAY_AREF(pair, 1));
- return hash;
-}
-
-static int
-to_h_i(VALUE key, VALUE value, VALUE hash)
-{
- rb_hash_set_pair(hash, rb_yield_values(2, key, value));
- return ST_CONTINUE;
-}
-
-static VALUE
-rb_hash_to_h_block(VALUE hash)
-{
- VALUE h = rb_hash_new_with_size(RHASH_SIZE(hash));
- rb_hash_foreach(hash, to_h_i, h);
- return h;
-}
-
/*
* call-seq:
- * hsh.to_h -> hsh or new_hash
- * hsh.to_h {|key, value| block } -> new_hash
+ * hsh.to_h -> hsh or new_hash
*
* Returns +self+. If called on a subclass of Hash, converts
* the receiver to a Hash object.
- *
- * If a block is given, the results of the block on each pair of
- * the receiver will be used as pairs.
*/
static VALUE
rb_hash_to_h(VALUE hash)
{
- if (rb_block_given_p()) {
- return rb_hash_to_h_block(hash);
- }
if (rb_obj_class(hash) != rb_cHash) {
- const VALUE flags = RBASIC(hash)->flags;
- hash = hash_dup(hash, rb_cHash, flags & RHASH_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;
}
@@ -3339,32 +1844,29 @@ keys_i(VALUE key, VALUE value, VALUE ary)
* hsh.keys -> array
*
* Returns a new array populated with the keys from this hash. See also
- * Hash#values.
+ * <code>Hash#values</code>.
*
* h = { "a" => 100, "b" => 200, "c" => 300, "d" => 400 }
* h.keys #=> ["a", "b", "c", "d"]
*
*/
-MJIT_FUNC_EXPORTED VALUE
+VALUE
rb_hash_keys(VALUE hash)
{
+ VALUE keys;
st_index_t size = RHASH_SIZE(hash);
- VALUE keys = rb_ary_new_capa(size);
+ keys = rb_ary_new_capa(size);
if (size == 0) return keys;
if (ST_DATA_COMPATIBLE_P(VALUE)) {
- RARRAY_PTR_USE_TRANSIENT(keys, ptr, {
- if (RHASH_AR_TABLE_P(hash)) {
- size = ar_keys(hash, ptr, size);
- }
- else {
- st_table *table = RHASH_ST_TABLE(hash);
- size = st_keys(table, ptr, size);
- }
- });
- rb_gc_writebarrier_remember(keys);
+ st_table *table = RHASH(hash)->ntbl;
+
+ rb_gc_writebarrier_remember(keys);
+ RARRAY_PTR_USE(keys, ptr, {
+ size = st_keys_check(table, ptr, size, Qundef);
+ });
rb_ary_set_len(keys, size);
}
else {
@@ -3386,7 +1888,7 @@ values_i(VALUE key, VALUE value, VALUE ary)
* hsh.values -> array
*
* Returns a new array populated with the values from <i>hsh</i>. See
- * also Hash#keys.
+ * also <code>Hash#keys</code>.
*
* h = { "a" => 100, "b" => 200, "c" => 300 }
* h.values #=> [100, 200, 300]
@@ -3403,19 +1905,12 @@ rb_hash_values(VALUE hash)
if (size == 0) return values;
if (ST_DATA_COMPATIBLE_P(VALUE)) {
- if (RHASH_AR_TABLE_P(hash)) {
- rb_gc_writebarrier_remember(values);
- RARRAY_PTR_USE_TRANSIENT(values, ptr, {
- size = ar_values(hash, ptr, size);
- });
- }
- else if (RHASH_ST_TABLE_P(hash)) {
- st_table *table = RHASH_ST_TABLE(hash);
- rb_gc_writebarrier_remember(values);
- RARRAY_PTR_USE_TRANSIENT(values, ptr, {
- size = st_values(table, ptr, size);
- });
- }
+ st_table *table = RHASH(hash)->ntbl;
+
+ rb_gc_writebarrier_remember(values);
+ RARRAY_PTR_USE(values, ptr, {
+ size = st_values_check(table, ptr, size, Qundef);
+ });
rb_ary_set_len(values, size);
}
else {
@@ -3438,21 +1933,17 @@ rb_hash_values(VALUE hash)
* h.has_key?("a") #=> true
* h.has_key?("z") #=> false
*
- * Note that #include? and #member? do not test member
- * equality using <code>==</code> as do other Enumerables.
- *
- * See also Enumerable#include?
*/
-MJIT_FUNC_EXPORTED VALUE
+VALUE
rb_hash_has_key(VALUE hash, VALUE key)
{
- if (hash_stlike_lookup(hash, key, NULL)) {
- return Qtrue;
- }
- else {
+ if (!RHASH(hash)->ntbl)
return Qfalse;
+ if (st_lookup(RHASH(hash)->ntbl, key, 0)) {
+ return Qtrue;
}
+ return Qfalse;
}
static int
@@ -3476,8 +1967,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
@@ -3493,7 +1984,7 @@ rb_hash_has_value(VALUE hash, VALUE val)
struct equal_data {
VALUE result;
- VALUE hash;
+ st_table *tbl;
int eql;
};
@@ -3503,17 +1994,15 @@ eql_i(VALUE key, VALUE val1, VALUE arg)
struct equal_data *data = (struct equal_data *)arg;
st_data_t val2;
- if (!hash_stlike_lookup(data->hash, key, &val2)) {
- data->result = Qfalse;
- return ST_STOP;
+ if (!st_lookup(data->tbl, key, &val2)) {
+ data->result = Qfalse;
+ return ST_STOP;
}
- else {
- if (!(data->eql ? rb_eql(val1, (VALUE)val2) : (int)rb_equal(val1, (VALUE)val2))) {
- data->result = Qfalse;
- return ST_STOP;
- }
- return ST_CONTINUE;
+ if (!(data->eql ? rb_eql(val1, (VALUE)val2) : (int)rb_equal(val1, (VALUE)val2))) {
+ data->result = Qfalse;
+ return ST_STOP;
}
+ return ST_CONTINUE;
}
static VALUE
@@ -3553,23 +2042,19 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
}
if (RHASH_SIZE(hash1) != RHASH_SIZE(hash2))
return Qfalse;
- if (!RHASH_TABLE_EMPTY_P(hash1) && !RHASH_TABLE_EMPTY_P(hash2)) {
- if (RHASH_TYPE(hash1) != RHASH_TYPE(hash2)) {
- return Qfalse;
- }
- else {
- data.hash = hash2;
- data.eql = eql;
- return rb_exec_recursive_paired(recursive_eql, hash1, hash2, (VALUE)&data);
- }
- }
-
+ if (!RHASH(hash1)->ntbl || !RHASH(hash2)->ntbl)
+ return Qtrue;
+ if (RHASH(hash1)->ntbl->type != RHASH(hash2)->ntbl->type)
+ return Qfalse;
#if 0
if (!(rb_equal(RHASH_IFNONE(hash1), RHASH_IFNONE(hash2)) &&
- FL_TEST(hash1, RHASH_PROC_DEFAULT) == FL_TEST(hash2, RHASH_PROC_DEFAULT)))
+ FL_TEST(hash1, HASH_PROC_DEFAULT) == FL_TEST(hash2, HASH_PROC_DEFAULT)))
return Qfalse;
#endif
- return Qtrue;
+
+ data.tbl = RHASH(hash2)->ntbl;
+ data.eql = eql;
+ return rb_exec_recursive_paired(recursive_eql, hash1, hash2, (VALUE)&data);
}
/*
@@ -3578,7 +2063,8 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
*
* Equality---Two hashes are equal if they each contain the same number
* of keys and if each key-value pair is equal to (according to
- * Object#==) the corresponding elements in the other hash.
+ * <code>Object#==</code>) the corresponding elements in the other
+ * hash.
*
* h1 = { "a" => 1, "c" => 2 }
* h2 = { 7 => 35, "c" => 2, "a" => 1 }
@@ -3588,12 +2074,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
@@ -3608,7 +2088,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
@@ -3631,7 +2110,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>).
@@ -3649,7 +2128,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
@@ -3665,34 +2144,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;
@@ -3713,7 +2174,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)
@@ -3730,16 +2191,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)
@@ -3750,64 +2212,39 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
/*
* call-seq:
- * hsh.merge!(other_hash1, other_hash2, ...) -> hsh
- * hsh.update(other_hash1, other_hash2, ...) -> hsh
- * hsh.merge!(other_hash1, other_hash2, ...) {|key, oldval, newval| block}
- * -> hsh
- * hsh.update(other_hash1, other_hash2, ...) {|key, oldval, newval| block}
- * -> hsh
- *
- * Adds the contents of the given hashes to the receiver.
- *
- * If no block is given, entries with duplicate keys are overwritten
- * with the values from each +other_hash+ successively,
- * otherwise the value for each duplicate key is determined by
- * calling the block with the key, its value in the receiver and
- * its value in each +other_hash+.
- *
- * h1 = { "a" => 100, "b" => 200 }
- * h1.merge! #=> {"a"=>100, "b"=>200}
- * h1 #=> {"a"=>100, "b"=>200}
+ * hsh.merge!(other_hash) -> hsh
+ * hsh.update(other_hash) -> hsh
+ * hsh.merge!(other_hash){|key, oldval, newval| block} -> hsh
+ * hsh.update(other_hash){|key, oldval, newval| block} -> hsh
*
- * h1 = { "a" => 100, "b" => 200 }
- * h2 = { "b" => 246, "c" => 300 }
- * h1.merge!(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
- * h1 #=> {"a"=>100, "b"=>246, "c"=>300}
+ * Adds the contents of _other_hash_ to _hsh_. If no block is specified,
+ * entries with duplicate keys are overwritten with the values from
+ * _other_hash_, otherwise the value of each duplicate key is determined by
+ * calling the block with the key, its value in _hsh_ and its value in
+ * _other_hash_.
*
* h1 = { "a" => 100, "b" => 200 }
- * h2 = { "b" => 246, "c" => 300 }
- * h3 = { "b" => 357, "d" => 400 }
- * h1.merge!(h2, h3)
- * #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
- * h1 #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
+ * h2 = { "b" => 254, "c" => 300 }
+ * h1.merge!(h2) #=> {"a"=>100, "b"=>254, "c"=>300}
*
* h1 = { "a" => 100, "b" => 200 }
- * h2 = { "b" => 246, "c" => 300 }
- * h3 = { "b" => 357, "d" => 400 }
- * h1.merge!(h2, h3) {|key, v1, v2| v1 }
- * #=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
- * h1 #=> {"a"=>100, "b"=>200, "c"=>300, "d"=>400}
- *
- * Hash#update is an alias for Hash#merge!.
+ * h2 = { "b" => 254, "c" => 300 }
+ * h1.merge!(h2) { |key, v1, v2| v1 }
+ * #=> {"a"=>100, "b"=>200, "c"=>300}
*/
static VALUE
-rb_hash_update(int argc, VALUE *argv, VALUE self)
+rb_hash_update(VALUE hash1, VALUE hash2)
{
- int i;
- bool block_given = rb_block_given_p();
-
- rb_hash_modify(self);
- for (i = 0; i < argc; i++){
- VALUE hash = to_hash(argv[i]);
- if (block_given) {
- rb_hash_foreach(hash, rb_hash_update_block_i, self);
- }
- else {
- rb_hash_foreach(hash, rb_hash_update_i, self);
- }
+ rb_hash_modify(hash1);
+ hash2 = to_hash(hash2);
+ if (rb_block_given_p()) {
+ rb_hash_foreach(hash2, rb_hash_update_block_i, hash1);
+ }
+ else {
+ rb_hash_foreach(hash2, rb_hash_update_i, hash1);
}
- return self;
+ return hash1;
}
struct update_func_arg {
@@ -3825,16 +2262,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)
@@ -3866,39 +2304,28 @@ rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func)
/*
* call-seq:
- * hsh.merge(other_hash1, other_hash2, ...) -> new_hash
- * hsh.merge(other_hash1, other_hash2, ...) {|key, oldval, newval| block}
- * -> new_hash
- *
- * Returns a new hash that combines the contents of the receiver and
- * the contents of the given hashes.
+ * hsh.merge(other_hash) -> new_hash
+ * hsh.merge(other_hash){|key, oldval, newval| block} -> new_hash
*
- * If no block is given, entries with duplicate keys are overwritten
- * with the values from each +other_hash+ successively,
- * otherwise the value for each duplicate key is determined by
- * calling the block with the key, its value in the receiver and
- * its value in each +other_hash+.
- *
- * When called without any argument, returns a copy of the receiver.
+ * Returns a new hash containing the contents of <i>other_hash</i> and
+ * the contents of <i>hsh</i>. If no block is specified, the value for
+ * entries with duplicate keys will be that of <i>other_hash</i>. Otherwise
+ * the value for each duplicate key is determined by calling the block
+ * with the key, its value in <i>hsh</i> and its value in <i>other_hash</i>.
*
* h1 = { "a" => 100, "b" => 200 }
- * h2 = { "b" => 246, "c" => 300 }
- * h3 = { "b" => 357, "d" => 400 }
- * h1.merge #=> {"a"=>100, "b"=>200}
- * h1.merge(h2) #=> {"a"=>100, "b"=>246, "c"=>300}
- * h1.merge(h2, h3) #=> {"a"=>100, "b"=>357, "c"=>300, "d"=>400}
- * h1.merge(h2) {|key, oldval, newval| newval - oldval}
- * #=> {"a"=>100, "b"=>46, "c"=>300}
- * h1.merge(h2, h3) {|key, oldval, newval| newval - oldval}
- * #=> {"a"=>100, "b"=>311, "c"=>300, "d"=>400}
- * h1 #=> {"a"=>100, "b"=>200}
+ * h2 = { "b" => 254, "c" => 300 }
+ * h1.merge(h2) #=> {"a"=>100, "b"=>254, "c"=>300}
+ * h1.merge(h2){|key, oldval, newval| newval - oldval}
+ * #=> {"a"=>100, "b"=>54, "c"=>300}
+ * h1 #=> {"a"=>100, "b"=>200}
*
*/
static VALUE
-rb_hash_merge(int argc, VALUE *argv, VALUE self)
+rb_hash_merge(VALUE hash1, VALUE hash2)
{
- return rb_hash_update(argc, argv, rb_hash_dup(self));
+ return rb_hash_update(rb_obj_dup(hash1), hash2);
}
static int
@@ -3923,8 +2350,7 @@ static VALUE
reset_hash_type(VALUE arg)
{
struct reset_hash_type_arg *p = (struct reset_hash_type_arg *)arg;
- HASH_ASSERT(RHASH_ST_TABLE_P(p->hash));
- RHASH_ST_TABLE(p->hash)->type = p->orighash;
+ RHASH(p->hash)->ntbl->type = p->orighash;
return Qundef;
}
@@ -3946,7 +2372,7 @@ assoc_i(VALUE key, VALUE val, VALUE arg)
*
* Searches through the hash comparing _obj_ with the key using <code>==</code>.
* Returns the key-value pair (two elements array) or +nil+
- * if no match is found. See Array#assoc.
+ * if no match is found. See <code>Array#assoc</code>.
*
* h = {"colors" => ["red", "blue", "green"],
* "letters" => ["a", "b", "c" ]}
@@ -3962,10 +2388,7 @@ rb_hash_assoc(VALUE hash, VALUE key)
VALUE args[2];
if (RHASH_EMPTY_P(hash)) return Qnil;
-
- ar_force_convert_table(hash, __FILE__, __LINE__);
- HASH_ASSERT(RHASH_ST_TABLE_P(hash));
- table = RHASH_ST_TABLE(hash);
+ table = RHASH(hash)->ntbl;
orighash = table->type;
if (orighash != &identhash) {
@@ -3975,7 +2398,7 @@ rb_hash_assoc(VALUE hash, VALUE key)
assochash.compare = assoc_cmp;
assochash.hash = orighash->hash;
- table->type = &assochash;
+ table->type = &assochash;
args[0] = hash;
args[1] = key;
ensure_arg.hash = hash;
@@ -4008,7 +2431,7 @@ rassoc_i(VALUE key, VALUE val, VALUE arg)
*
* Searches through the hash comparing _obj_ with the value using <code>==</code>.
* Returns the first key-value pair (two-element array) that matches. See
- * also Array#rassoc.
+ * also <code>Array#rassoc</code>.
*
* a = {1=> "one", 2 => "two", 3 => "three", "ii" => "two"}
* a.rassoc("two") #=> [2, "two"]
@@ -4059,24 +2482,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 {
@@ -4087,73 +2504,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)
-{
- st_index_t n;
- rb_hash_modify_check(hash);
- n = RHASH_SIZE(hash);
- if (n) {
- rb_hash_foreach(hash, delete_if_nil, hash);
- if (n != RHASH_SIZE(hash))
- return hash;
- }
- return Qnil;
-}
-
-static st_table *rb_init_identtable_with_size(st_index_t size);
+static VALUE rb_hash_compare_by_id_p(VALUE hash);
/*
* call-seq:
@@ -4174,24 +2525,10 @@ static st_table *rb_init_identtable_with_size(st_index_t size);
static VALUE
rb_hash_compare_by_id(VALUE hash)
{
- VALUE tmp;
- st_table *identtable;
-
if (rb_hash_compare_by_id_p(hash)) return hash;
-
- rb_hash_modify_check(hash);
- ar_force_convert_table(hash, __FILE__, __LINE__);
- HASH_ASSERT(RHASH_ST_TABLE_P(hash));
-
- tmp = hash_alloc(0);
- identtable = rb_init_identtable_with_size(RHASH_SIZE(hash));
- RHASH_ST_TABLE_SET(tmp, identtable);
- rb_hash_foreach(hash, rb_hash_rehash_i, (VALUE)tmp);
- st_free_table(RHASH_ST_TABLE(hash));
- RHASH_ST_TABLE_SET(hash, identtable);
- RHASH_ST_CLEAR(tmp);
- rb_gc_force_recycle(tmp);
-
+ rb_hash_modify(hash);
+ RHASH(hash)->ntbl->type = &identhash;
+ rb_hash_rehash(hash);
return hash;
}
@@ -4200,26 +2537,26 @@ rb_hash_compare_by_id(VALUE hash)
* hsh.compare_by_identity? -> true or false
*
* Returns <code>true</code> if <i>hsh</i> will compare its keys by
- * their identity. Also see Hash#compare_by_identity.
+ * their identity. Also see <code>Hash#compare_by_identity</code>.
*
*/
-MJIT_FUNC_EXPORTED VALUE
+static VALUE
rb_hash_compare_by_id_p(VALUE hash)
{
- if (RHASH_ST_TABLE_P(hash) && RHASH_ST_TABLE(hash)->type == &identhash) {
- return Qtrue;
- }
- else {
+ if (!RHASH(hash)->ntbl)
return Qfalse;
+ if (RHASH(hash)->ntbl->type == &identhash) {
+ return Qtrue;
}
+ return Qfalse;
}
VALUE
rb_ident_hash_new(void)
{
VALUE hash = rb_hash_new();
- RHASH_ST_TABLE_SET(hash, st_init_table(&identhash));
+ RHASH(hash)->ntbl = st_init_table(&identhash);
return hash;
}
@@ -4229,7 +2566,7 @@ rb_init_identtable(void)
return st_init_table(&identhash);
}
-static st_table *
+st_table *
rb_init_identtable_with_size(st_index_t size)
{
return st_init_table_with_size(&identhash, size);
@@ -4257,301 +2594,31 @@ 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
- * hsh.any?(pattern) -> true or false
*
* See also Enumerable#any?
*/
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) {
- if (rb_block_given_p()) {
- rb_warn("given block not used");
- }
- 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);
- }
- 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
- */
-
-static 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(RB_BLOCK_CALL_FUNC_ARGLIST(key, hash))
-{
- rb_check_arity(argc, 1, 1);
- return rb_hash_aref(hash, *argv);
-}
-
-/*
- * call-seq:
- * hash.to_proc -> proc
- *
- * Returns a Proc which maps keys to values.
- *
- * h = {a:1, b:2}
- * hp = h.to_proc
- * hp.call(:a) #=> 1
- * hp.call(:b) #=> 2
- * hp.call(:c) #=> nil
- * [:a, :b, :c].map(&h) #=> [1, 2, nil]
- */
-static VALUE
-rb_hash_to_proc(VALUE hash)
-{
- return rb_func_proc_new(hash_proc_call, hash);
-}
-
-static VALUE
-rb_hash_deconstruct_keys(VALUE hash, VALUE keys)
-{
- return 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;
- int ret = 0;
- VALUE args[2];
- args[0] = hash;
- args[1] = val;
-
- if (RHASH_AR_TABLE_P(hash)) {
- hash_ar_table(hash);
-
- ret = ar_update(hash, (st_data_t)key, add_new_i, (st_data_t)args);
- if (ret != -1) {
- return ret;
- }
- ar_try_convert_table(hash);
- }
- tbl = RHASH_TBL_RAW(hash);
- return st_update(tbl, (st_data_t)key, add_new_i, (st_data_t)args);
-
-}
-
-static st_data_t
-key_stringify(VALUE key)
-{
- return (rb_obj_class(key) == rb_cString && !RB_OBJ_FROZEN(key)) ?
- rb_hash_key_str(key) : key;
-}
-
-static void
-ar_bulk_insert(VALUE hash, long argc, const VALUE *argv)
-{
- long i;
- for (i = 0; i < argc; ) {
- st_data_t k = key_stringify(argv[i++]);
- st_data_t v = argv[i++];
- ar_insert(hash, k, v);
- RB_OBJ_WRITTEN(hash, Qundef, k);
- RB_OBJ_WRITTEN(hash, Qundef, v);
+ if (!rb_block_given_p()) {
+ /* yields pairs, never false */
+ return Qtrue;
}
+ if (rb_block_arity() > 1)
+ rb_hash_foreach(hash, any_p_i_fast, (VALUE)&ret);
+ else
+ rb_hash_foreach(hash, any_p_i, (VALUE)&ret);
+ return ret;
}
-void
-rb_hash_bulk_insert(long argc, const VALUE *argv, VALUE hash)
-{
- HASH_ASSERT(argc % 2 == 0);
- if (argc > 0) {
- st_index_t size = argc / 2;
-
- if (RHASH_TABLE_NULL_P(hash)) {
- if (size <= RHASH_AR_TABLE_MAX_SIZE) {
- hash_ar_table(hash);
- }
- else {
- RHASH_TBL_RAW(hash);
- }
- }
-
- if (RHASH_AR_TABLE_P(hash) &&
- (RHASH_AR_TABLE_SIZE(hash) + size <= RHASH_AR_TABLE_MAX_SIZE)) {
- ar_bulk_insert(hash, argc, argv);
- }
- else {
- rb_hash_bulk_insert_into_st_table(argc, argv, hash);
- }
- }
-}
+static int path_tainted = -1;
static char **origenviron;
#ifdef _WIN32
@@ -4561,21 +2628,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;
+ static int binary = -1;
+ static int locale = -1;
+ if (binary < 0) {
+ binary = rb_ascii8bit_encindex();
+ locale = rb_locale_encindex();
}
- else {
- func = rb_w32_ugetenv;
- }
- /* 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
@@ -4595,19 +2658,22 @@ 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
rb_obj_freeze(str);
@@ -4615,15 +2681,16 @@ env_enc_str_new(const char *ptr, long len, rb_encoding *enc)
}
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
@@ -4633,63 +2700,9 @@ env_str_new2(const char *ptr)
return env_str_new(ptr, strlen(ptr));
}
-static const char TZ_ENV[] = "TZ";
-extern bool ruby_tz_uptodate_p;
-
-static rb_encoding *
-env_encoding_for(const char *name, const char *ptr)
-{
- if (ENVMATCH(name, PATH_ENV)) {
- 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)
@@ -4702,32 +2715,19 @@ env_name(volatile VALUE *s)
#define env_name(s) env_name(&(s))
-static VALUE env_aset(VALUE nm, VALUE val);
-
static VALUE
-env_delete(VALUE name)
+env_delete(VALUE obj, VALUE name)
{
const char *nam, *val;
nam = env_name(name);
val = getenv(nam);
-
- /*
- * ENV['TZ'] = nil has a special meaning.
- * TZ is no longer considered up-to-date and ruby call tzset() as needed.
- * It could be useful if sysadmin change /etc/localtime.
- * This hack might works only on Linux glibc.
- */
- if (ENVMATCH(nam, TZ_ENV)) {
- ruby_tz_uptodate_p = FALSE;
- }
-
if (val) {
VALUE value = env_str_new2(val);
ruby_setenv(nam, 0);
if (ENVMATCH(nam, PATH_ENV)) {
- RB_GC_GUARD(name);
+ path_tainted = 0;
}
return value;
}
@@ -4736,47 +2736,31 @@ env_delete(VALUE name)
/*
* call-seq:
- * ENV.delete(name) -> value
- * ENV.delete(name) { |name| block } -> value
- *
- * Deletes the environment variable with +name+ if it exists and returns its value:
- * ENV['foo'] = '0'
- * ENV.delete('foo') # => '0'
- * Returns +nil+ if the named environment variable does not exist:
- * ENV.delete('foo') # => nil
- * If a block given and the environment variable does not exist,
- * yields +name+ to the block and returns +nil+:
- * ENV.delete('foo') { |name| puts name } # => nil
- * foo
- * If a block given and the environment variable exists,
- * deletes the environment variable and returns its value (ignoring the block):
- * ENV['foo'] = '0'
- * ENV.delete('foo') { |name| fail 'ignored' } # => "0"
- * Raises an exception if +name+ is invalid.
- * See {Invalid Names and Values}[#class-ENV-label-Invalid-Names+and+Values].
+ * ENV.delete(name) -> value
+ * ENV.delete(name) { |name| } -> value
+ *
+ * Deletes the environment variable with +name+ and returns the value of the
+ * variable. If a block is given it will be called when the named environment
+ * does not exist.
*/
static VALUE
env_delete_m(VALUE obj, VALUE name)
{
VALUE val;
- val = env_delete(name);
+ val = env_delete(obj, name);
if (NIL_P(val) && rb_block_given_p()) rb_yield(name);
return val;
}
+static int env_path_tainted(const char *);
+
/*
* call-seq:
* ENV[name] -> value
*
- * Returns the value for the environment variable +name+ if it exists:
- * ENV['foo'] = '0'
- * ENV['foo'] # => "0"
- * Returns nil if the named variable does not exist:
- * ENV.clear
- * ENV['foo'] # => nil
- * Raises an exception if +name+ is invalid.
- * See {Invalid Names and Values}[#class-ENV-label-Invalid-Names+and+Values].
+ * Retrieves the +value+ for environment variable +name+ as a String. Returns
+ * +nil+ if the named variable does not exist.
*/
static VALUE
rb_f_getenv(VALUE obj, VALUE name)
@@ -4786,38 +2770,30 @@ 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;
}
/*
+ * :yield: missing_name
* call-seq:
- * ENV.fetch(name) -> value
- * ENV.fetch(name, default) -> value
- * ENV.fetch(name) { |name| block } -> value
- *
- * If +name+ is the name of an environment variable, returns its value:
- * ENV['foo'] = '0'
- * ENV.fetch('foo') # => '0'
- * Otherwise if a block is given (but not a default value),
- * yields +name+ to the block and returns the block's return value:
- * ENV.fetch('foo') { |name| :need_not_return_a_string } # => :need_not_return_a_string
- * Otherwise if a default value is given (but not a block), returns the default value:
- * ENV.delete('foo')
- * ENV.fetch('foo', :default_need_not_be_a_string) # => :default_need_not_be_a_string
- * If the environment variable does not exist and both default and block are given,
- * issues a warning ("warning: block supersedes default value argument"),
- * yields +name+ to the block, and returns the block's return value:
- * ENV.fetch('foo', :default) { |name| :block_return } # => :block_return
- * Raises KeyError if +name+ is valid, but not found,
- * and neither default value nor block is given:
- * ENV.fetch('foo') # Raises KeyError (key not found: "foo")
- * Raises an exception if +name+ is invalid.
- * See {Invalid Names and Values}[#class-ENV-label-Invalid-Names+and+Values].
+ * ENV.fetch(name) -> value
+ * ENV.fetch(name, default) -> value
+ * ENV.fetch(name) { |missing_name| ... } -> value
+ *
+ * Retrieves the environment variable +name+.
+ *
+ * If the given name does not exist and neither +default+ nor a block a
+ * 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.
*/
static VALUE
-env_fetch(int argc, VALUE *argv, VALUE _)
+env_fetch(int argc, VALUE *argv)
{
VALUE key;
long block_given;
@@ -4834,18 +2810,37 @@ env_fetch(int argc, VALUE *argv, VALUE _)
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
+path_tainted_p(const char *path)
+{
+ path_tainted = rb_path_check(path)?0:1;
+}
+
+static int
+env_path_tainted(const char *path)
+{
+ if (path_tainted < 0) {
+ path_tainted_p(path);
+ }
+ return path_tainted;
}
int
rb_env_path_tainted(void)
{
- rb_warning("rb_env_path_tainted is deprecated and will be removed in Ruby 3.2.");
- return 0;
+ if (path_tainted < 0) {
+ path_tainted_p(getenv(PATH_ENV));
+ }
+ return path_tainted;
}
#if defined(_WIN32) || (defined(HAVE_SETENV) && defined(HAVE_UNSETENV))
@@ -4878,39 +2873,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)
{
-#ifdef _MAX_ENV
- return _MAX_ENV;
-#else
- return 32767;
-#endif
-}
-
-static int
-check_envsize(size_t n)
-{
- if (_WIN32_WINNT < 0x0600 && rb_w32_osver() < 6) {
- /* https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx */
- /* Windows Server 2003 and Windows XP: The maximum size of the
- * environment block for the process is 32,767 characters. */
- WCHAR* p = GetEnvironmentStringsW();
- if (!p) return -1; /* never happen */
- n += getenvsize(p);
- FreeEnvironmentStringsW(p);
- if (n >= getenvblocksize()) {
- return -1;
- }
- }
- return 0;
+ return (rb_w32_osver() >= 5) ? 32767 : 5120;
}
#endif
@@ -4939,47 +2911,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) {
- int len2;
- len2 = MultiByteToWideChar(CP_UTF8, 0, value, -1, NULL, 0);
- if (check_envsize((size_t)len + len2)) { /* len and len2 include '\0' */
+ char* p = GetEnvironmentStringsA();
+ size_t n;
+ if (!p) goto fail; /* never happen */
+ n = strlen(name) + 2 + strlen(value) + getenvsize(p);
+ FreeEnvironmentStringsA(p);
+ if (n >= getenvblocksize()) {
goto fail; /* 2 for '=' & '\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) &&
@@ -4990,6 +2942,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));
@@ -5082,61 +3036,20 @@ ruby_unsetenv(const char *name)
/*
* call-seq:
- * ENV[name] = value -> value
+ * ENV[name] = value
* ENV.store(name, value) -> value
*
- * ENV.store is an alias for ENV.[]=.
- *
- * Creates, updates, or deletes the named environment variable, returning the value.
- * Both +name+ and +value+ may be instances of String.
- * See {Valid Names and Values}[#class-ENV-label-Valid+Names+and+Values].
- *
- * - If the named environment variable does not exist:
- * - If +value+ is +nil+, does nothing.
- * ENV.clear
- * ENV['foo'] = nil # => nil
- * ENV.include?('foo') # => false
- * ENV.store('bar', nil) # => nil
- * ENV.include?('bar') # => false
- * - If +value+ is not +nil+, creates the environment variable with +name+ and +value+:
- * # Create 'foo' using ENV.[]=.
- * ENV['foo'] = '0' # => '0'
- * ENV['foo'] # => '0'
- * # Create 'bar' using ENV.store.
- * ENV.store('bar', '1') # => '1'
- * ENV['bar'] # => '1'
- * - If the named environment variable exists:
- * - If +value+ is not +nil+, updates the environment variable with value +value+:
- * # Update 'foo' using ENV.[]=.
- * ENV['foo'] = '2' # => '2'
- * ENV['foo'] # => '2'
- * # Update 'bar' using ENV.store.
- * ENV.store('bar', '3') # => '3'
- * ENV['bar'] # => '3'
- * - If +value+ is +nil+, deletes the environment variable:
- * # Delete 'foo' using ENV.[]=.
- * ENV['foo'] = nil # => nil
- * ENV.include?('foo') # => false
- * # Delete 'bar' using ENV.store.
- * ENV.store('bar', nil) # => nil
- * ENV.include?('bar') # => false
- *
- * Raises an exception if +name+ or +value+ is invalid.
- * See {Invalid Names and Values}[#class-ENV-label-Invalid+Names+and+Values].
+ * Sets the environment variable +name+ to +value+. If the value given is
+ * +nil+ the environment variable is deleted.
+ *
*/
static VALUE
-env_aset_m(VALUE obj, VALUE nm, VALUE val)
-{
- return env_aset(nm, val);
-}
-
-static VALUE
-env_aset(VALUE nm, VALUE val)
+env_aset(VALUE obj, VALUE nm, VALUE val)
{
char *name, *value;
if (NIL_P(val)) {
- env_delete(nm);
+ env_delete(obj, nm);
return Qnil;
}
SafeStringValue(nm);
@@ -5148,14 +3061,24 @@ env_aset(VALUE nm, VALUE val)
ruby_setenv(name, value);
if (ENVMATCH(name, PATH_ENV)) {
- RB_GC_GUARD(nm);
- }
- else if (ENVMATCH(name, TZ_ENV)) {
- ruby_tz_uptodate_p = FALSE;
+ if (OBJ_TAINTED(val)) {
+ /* already tainted, no check */
+ path_tainted = 1;
+ return val;
+ }
+ else {
+ path_tainted_p(value);
+ }
}
return val;
}
+/*
+ * call-seq:
+ * ENV.keys -> Array
+ *
+ * Returns every environment variable name in an Array
+ */
static VALUE
env_keys(void)
{
@@ -5175,27 +3098,6 @@ env_keys(void)
return ary;
}
-/*
- * call-seq:
- * ENV.keys -> Array
- *
- * Returns all variable names in an Array:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.keys # => ['bar', 'foo']
- * The order of the names is OS-dependent.
- * See {About Ordering}[#class-ENV-label-About+Ordering].
- *
- * Returns the empty Array if ENV is empty:
- * ENV.clear
- * ENV.keys # => []
- */
-
-static VALUE
-env_f_keys(VALUE _)
-{
- return env_keys();
-}
-
static VALUE
rb_env_size(VALUE ehash, VALUE args, VALUE eobj)
{
@@ -5214,20 +3116,12 @@ rb_env_size(VALUE ehash, VALUE args, VALUE eobj)
/*
* call-seq:
- * ENV.each_key { |name| block } -> ENV
- * ENV.each_key -> Enumerator
- *
- * Yields each environment variable name:
- * ENV.replace('foo' => '0', 'bar' => '1') # => ENV
- * names = []
- * ENV.each_key { |name| names.push(name) } # => ENV
- * names # => ["bar", "foo"]
- *
- * Returns an Enumerator if no block given:
- * e = ENV.each_key # => #<Enumerator: {"bar"=>"1", "foo"=>"0"}:each_key>
- * names = []
- * e.each { |name| names.push(name) } # => ENV
- * names # => ["bar", "foo"]
+ * ENV.each_key { |name| } -> Hash
+ * ENV.each_key -> Enumerator
+ *
+ * Yields each environment variable name.
+ *
+ * An Enumerator is returned if no block is given.
*/
static VALUE
env_each_key(VALUE ehash)
@@ -5243,6 +3137,12 @@ env_each_key(VALUE ehash)
return ehash;
}
+/*
+ * call-seq:
+ * ENV.values -> Array
+ *
+ * Returns every environment variable value as an Array
+ */
static VALUE
env_values(void)
{
@@ -5264,40 +3164,12 @@ env_values(void)
/*
* call-seq:
- * ENV.values -> Array
+ * ENV.each_value { |value| } -> Hash
+ * ENV.each_value -> Enumerator
*
- * Returns all environment variable values in an Array:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.values # => ['1', '0']
- * The order of the values is OS-dependent.
- * See {About Ordering}[#class-ENV-label-About+Ordering].
+ * Yields each environment variable +value+.
*
- * Returns the empty Array if ENV is empty:
- * ENV.clear
- * ENV.values # => []
- */
-static VALUE
-env_f_values(VALUE _)
-{
- return env_values();
-}
-
-/*
- * call-seq:
- * ENV.each_value { |value| block } -> ENV
- * ENV.each_value -> Enumerator
- *
- * Yields each environment variable value:
- * ENV.replace('foo' => '0', 'bar' => '1') # => ENV
- * values = []
- * ENV.each_value { |value| values.push(value) } # => ENV
- * values # => ["1", "0"]
- *
- * Returns an Enumerator if no block given:
- * e = ENV.each_value # => #<Enumerator: {"bar"=>"1", "foo"=>"0"}:each_value>
- * values = []
- * e.each { |value| values.push(value) } # => ENV
- * values # => ["1", "0"]
+ * An Enumerator is returned if no block was given.
*/
static VALUE
env_each_value(VALUE ehash)
@@ -5315,21 +3187,14 @@ env_each_value(VALUE ehash)
/*
* call-seq:
- * ENV.each { |name, value| block } -> ENV
- * ENV.each -> Enumerator
- * ENV.each_pair { |name, value| block } -> ENV
- * ENV.each_pair -> Enumerator
- *
- * Yields each environment variable name and its value as a 2-element Array:
- * h = {}
- * ENV.each_pair { |name, value| h[name] = value } # => ENV
- * h # => {"bar"=>"1", "foo"=>"0"}
- *
- * Returns an Enumerator if no block given:
- * h = {}
- * e = ENV.each_pair # => #<Enumerator: {"bar"=>"1", "foo"=>"0"}:each_pair>
- * e.each { |name, value| h[name] = value } # => ENV
- * h # => {"bar"=>"1", "foo"=>"0"}
+ * ENV.each { |name, value| } -> Hash
+ * ENV.each -> Enumerator
+ * ENV.each_pair { |name, value| } -> Hash
+ * ENV.each_pair -> Enumerator
+ *
+ * Yields each environment variable +name+ and +value+.
+ *
+ * If no block is given an Enumerator is returned.
*/
static VALUE
env_each_pair(VALUE ehash)
@@ -5367,29 +3232,17 @@ env_each_pair(VALUE ehash)
/*
* call-seq:
- * ENV.reject! { |name, value| block } -> ENV or nil
- * ENV.reject! -> Enumerator
- *
- * Similar to ENV.delete_if, but returns +nil+ if no changes were made.
- *
- * Deletes each environment variable for which the block returns a truthy value,
- * returning ENV (if any deletions) or +nil+ (if not):
- * ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
- * ENV.reject! { |name, value| name.start_with?('b') } # => ENV
- * ENV # => {"foo"=>"0"}
- * ENV.reject! { |name, value| name.start_with?('b') } # => nil
- *
- * Returns an Enumerator if no block given:
- * ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
- * e = ENV.reject! # => #<Enumerator: {"bar"=>"1", "baz"=>"2", "foo"=>"0"}:reject!>
- * e.each { |name, value| name.start_with?('b') } # => ENV
- * ENV # => {"foo"=>"0"}
- * e.each { |name, value| name.start_with?('b') } # => nil
+ * ENV.reject! { |name, value| } -> ENV or nil
+ * ENV.reject! -> Enumerator
+ *
+ * Equivalent to ENV#delete_if but returns +nil+ if no changes were made.
+ *
+ * Returns an Enumerator if no block was given.
*/
static VALUE
env_reject_bang(VALUE ehash)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
int del = 0;
@@ -5400,20 +3253,20 @@ env_reject_bang(VALUE ehash)
VALUE val = rb_f_getenv(Qnil, RARRAY_AREF(keys, i));
if (!NIL_P(val)) {
if (RTEST(rb_yield_values(2, RARRAY_AREF(keys, i), val))) {
- env_delete(RARRAY_AREF(keys, i));
+ FL_UNSET(RARRAY_AREF(keys, i), FL_TAINT);
+ env_delete(Qnil, RARRAY_AREF(keys, i));
del++;
}
}
}
- RB_GC_GUARD(keys);
if (del == 0) return Qnil;
return envtbl;
}
/*
* call-seq:
- * ENV.delete_if { |name, value| block } -> ENV
- * ENV.delete_if -> Enumerator
+ * ENV.delete_if { |name, value| } -> Hash
+ * ENV.delete_if -> Enumerator
*
* Deletes every environment variable for which the block evaluates to +true+.
*
@@ -5435,7 +3288,7 @@ env_delete_if(VALUE ehash)
* the given names. See also ENV.select.
*/
static VALUE
-env_values_at(int argc, VALUE *argv, VALUE _)
+env_values_at(int argc, VALUE *argv)
{
VALUE result;
long i;
@@ -5449,16 +3302,12 @@ env_values_at(int argc, VALUE *argv, VALUE _)
/*
* call-seq:
- * ENV.select { |name, value| block } -> Hash
- * ENV.select -> Enumerator
- * ENV.filter { |name, value| block } -> Hash
- * ENV.filter -> Enumerator
+ * ENV.select { |name, value| } -> Hash
+ * ENV.select -> Enumerator
*
* Returns a copy of the environment for entries where the block returns true.
*
* Returns an Enumerator if no block was given.
- *
- * ENV.filter is an alias for ENV.select.
*/
static VALUE
env_select(VALUE ehash)
@@ -5479,26 +3328,21 @@ env_select(VALUE ehash)
}
}
}
- RB_GC_GUARD(keys);
return result;
}
/*
* call-seq:
- * ENV.select! { |name, value| block } -> ENV or nil
- * ENV.select! -> Enumerator
- * ENV.filter! { |name, value| block } -> ENV or nil
- * ENV.filter! -> Enumerator
+ * ENV.select! { |name, value| } -> ENV or nil
+ * ENV.select! -> Enumerator
*
- * Equivalent to ENV.keep_if but returns +nil+ if no changes were made.
- *
- * ENV.filter! is an alias for ENV.select!.
+ * Equivalent to ENV#keep_if but returns +nil+ if no changes were made.
*/
static VALUE
env_select_bang(VALUE ehash)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
int del = 0;
@@ -5509,20 +3353,20 @@ env_select_bang(VALUE ehash)
VALUE val = rb_f_getenv(Qnil, RARRAY_AREF(keys, i));
if (!NIL_P(val)) {
if (!RTEST(rb_yield_values(2, RARRAY_AREF(keys, i), val))) {
- env_delete(RARRAY_AREF(keys, i));
+ FL_UNSET(RARRAY_AREF(keys, i), FL_TAINT);
+ env_delete(Qnil, RARRAY_AREF(keys, i));
del++;
}
}
}
- RB_GC_GUARD(keys);
if (del == 0) return Qnil;
return envtbl;
}
/*
* call-seq:
- * ENV.keep_if { |name, value| block } -> ENV
- * ENV.keep_if -> Enumerator
+ * ENV.keep_if { |name, value| } -> Hash
+ * ENV.keep_if -> Enumerator
*
* Deletes every environment variable where the block evaluates to +false+.
*
@@ -5537,75 +3381,35 @@ env_keep_if(VALUE ehash)
}
/*
- * call-seq:
- * ENV.slice(*keys) -> a_hash
- *
- * Returns a hash containing only the given keys from ENV and their values.
+ * call-seq:
+ * ENV.clear
*
- * ENV.slice("TERM","HOME") #=> {"TERM"=>"xterm-256color", "HOME"=>"/Users/rhc"}
+ * Removes every environment variable.
*/
-static VALUE
-env_slice(int argc, VALUE *argv, VALUE _)
-{
- int i;
- VALUE key, value, result;
-
- if (argc == 0) {
- return rb_hash_new();
- }
- result = rb_hash_new_with_size(argc);
-
- for (i = 0; i < argc; i++) {
- key = argv[i];
- value = rb_f_getenv(Qnil, key);
- if (value != Qnil)
- rb_hash_aset(result, key, value);
- }
-
- return result;
-}
-
VALUE
rb_env_clear(void)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
keys = env_keys();
for (i=0; i<RARRAY_LEN(keys); i++) {
VALUE val = rb_f_getenv(Qnil, RARRAY_AREF(keys, i));
if (!NIL_P(val)) {
- env_delete(RARRAY_AREF(keys, i));
+ env_delete(Qnil, RARRAY_AREF(keys, i));
}
}
- RB_GC_GUARD(keys);
return envtbl;
}
/*
* call-seq:
- * ENV.clear -> ENV
- *
- * Removes every environment variable; returns ENV:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.size # => 2
- * ENV.clear # => ENV
- * ENV.size # => 0
- */
-static VALUE
-env_clear(VALUE _)
-{
- return rb_env_clear();
-}
-
-/*
- * call-seq:
* ENV.to_s -> "ENV"
*
* Returns "ENV"
*/
static VALUE
-env_to_s(VALUE _)
+env_to_s(void)
{
return rb_usascii_str_new2("ENV");
}
@@ -5617,7 +3421,7 @@ env_to_s(VALUE _)
* Returns the contents of the environment as a String.
*/
static VALUE
-env_inspect(VALUE _)
+env_inspect(void)
{
char **env;
VALUE str, i;
@@ -5641,6 +3445,7 @@ env_inspect(VALUE _)
}
FREE_ENVIRON(environ);
rb_str_buf_cat2(str, "}");
+ OBJ_TAINT(str);
return str;
}
@@ -5655,7 +3460,7 @@ env_inspect(VALUE _)
*
*/
static VALUE
-env_to_a(VALUE _)
+env_to_a(void)
{
char **env;
VALUE ary;
@@ -5682,7 +3487,7 @@ env_to_a(VALUE _)
* compatibility with Hash.
*/
static VALUE
-env_none(VALUE _)
+env_none(void)
{
return Qnil;
}
@@ -5695,7 +3500,7 @@ env_none(VALUE _)
* Returns the number of environment variables.
*/
static VALUE
-env_size(VALUE _)
+env_size(void)
{
int i;
char **env;
@@ -5714,7 +3519,7 @@ env_size(VALUE _)
* Returns true when there are no environment variables
*/
static VALUE
-env_empty_p(VALUE _)
+env_empty_p(void)
{
char **env;
@@ -5729,28 +3534,12 @@ env_empty_p(VALUE _)
/*
* call-seq:
+ * ENV.key?(name) -> true or false
* ENV.include?(name) -> true or false
* ENV.has_key?(name) -> true or false
* ENV.member?(name) -> true or false
- * ENV.key?(name) -> true or false
*
- * ENV.has_key?, ENV.member?, and ENV.key? are aliases for ENV.include?.
- *
- * Returns +true+ if there is an environment variable with the given +name+:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.include?('foo') # => true
- * Returns +false+ if +name+ is a valid String and there is no such environment variable:
- * ENV.include?('baz') # => false
- * Returns +false+ if +name+ is the empty String or is a String containing character <code>'='</code>:
- * ENV.include?('') # => false
- * ENV.include?('=') # => false
- * Raises an exception if +name+ is a String containing the NUL character <code>"\0"</code>:
- * ENV.include?("\0") # Raises ArgumentError (bad environment variable name: contains null byte)
- * Raises an exception if +name+ has an encoding that is not ASCII-compatible:
- * ENV.include?("\xa1\xa1".force_encoding(Encoding::UTF_16LE))
- * # Raises ArgumentError (bad environment variable name: ASCII incompatible encoding: UTF-16LE)
- * Raises an exception if +name+ is not a String:
- * ENV.include?(Object.new) # TypeError (no implicit conversion of Object into String)
+ * Returns +true+ if there is an environment variable with the given +name+.
*/
static VALUE
env_has_key(VALUE env, VALUE key)
@@ -5766,22 +3555,8 @@ env_has_key(VALUE env, VALUE key)
* call-seq:
* ENV.assoc(name) -> Array or nil
*
- * Returns a 2-element Array containing the name and value of the environment variable
- * for +name+ if it exists:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.assoc('foo') # => ['foo' '0']
- * Returns +nil+ if +name+ is a valid String and there is no such environment variable:
- * ENV.assoc('baz') # => false
- * Returns +nil+ if +name+ is the empty String or is a String containing character <code>'='</code>:
- * ENV.assoc('') # => false
- * ENV.assoc('=') # => false
- * Raises an exception if +name+ is a String containing the NUL character <code>"\0"</code>:
- * ENV.assoc("\0") # Raises ArgumentError (bad environment variable name: contains null byte)
- * Raises an exception if +name+ has an encoding that is not ASCII-compatible:
- * ENV.assoc("\xa1\xa1".force_encoding(Encoding::UTF_16LE))
- * # Raises ArgumentError (bad environment variable name: ASCII incompatible encoding: UTF-16LE)
- * Raises an exception if +name+ is not a String:
- * ENV.assoc(Object.new) # TypeError (no implicit conversion of Object into String)
+ * Returns an Array of the name and value of the environment variable with
+ * +name+ or +nil+ if the name cannot be found.
*/
static VALUE
env_assoc(VALUE env, VALUE key)
@@ -5790,7 +3565,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;
}
@@ -5808,6 +3583,7 @@ env_has_value(VALUE dmy, VALUE obj)
obj = rb_check_string_type(obj);
if (NIL_P(obj)) return Qnil;
+ rb_check_safe_obj(obj);
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
@@ -5838,13 +3614,14 @@ env_rassoc(VALUE dmy, VALUE obj)
obj = rb_check_string_type(obj);
if (NIL_P(obj)) return Qnil;
+ rb_check_safe_obj(obj);
env = GET_ENVIRON(environ);
while (*env) {
char *s = strchr(*env, '=');
if (s++) {
long len = strlen(s);
if (RSTRING_LEN(obj) == len && strncmp(s, RSTRING_PTR(obj), len) == 0) {
- VALUE result = rb_assoc_new(rb_str_new(*env, s-*env-1), obj);
+ VALUE result = rb_assoc_new(rb_tainted_str_new(*env, s-*env-1), obj);
FREE_ENVIRON(environ);
return result;
}
@@ -5857,18 +3634,10 @@ env_rassoc(VALUE dmy, VALUE obj)
/*
* call-seq:
- * ENV.key(value) -> name or nil
- *
- * Returns the name of the first environment variable with +value+ if it exists:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.key('0') # =>'foo'
- * The order in which environment variables are examined is OS-dependent.
- * See {About Ordering}[#class-ENV-label-About+Ordering].
- *
- * Returns +nil+ if there is no such value:
- * ENV.key('2') # => nil
- * Raises an exception if +value+ is not a String:
- * ENV.key(Object.new) # raises TypeError (no implicit conversion of Object into String)
+ * ENV.key(value) -> name
+ *
+ * Returns the name of the environment variable with +value+. If the value is
+ * not found +nil+ is returned.
*/
static VALUE
env_key(VALUE dmy, VALUE value)
@@ -5903,10 +3672,18 @@ env_key(VALUE dmy, VALUE value)
static VALUE
env_index(VALUE dmy, VALUE value)
{
- rb_warn_deprecated("ENV.index", "ENV.key");
+ rb_warn("ENV.index is deprecated; use ENV.key");
return env_key(dmy, value);
}
+/*
+ * call-seq:
+ * ENV.to_hash -> hash
+ * ENV.to_h -> hash
+ *
+ * Creates a hash with a copy of the environment variables.
+ *
+ */
static VALUE
env_to_hash(void)
{
@@ -5929,83 +3706,27 @@ env_to_hash(void)
/*
* call-seq:
- * ENV.to_hash -> hash
- *
- * Creates a hash with a copy of the environment variables.
- *
- */
-
-static VALUE
-env_f_to_hash(VALUE _)
-{
- return env_to_hash();
-}
-
-/*
- * call-seq:
- * ENV.to_h -> hash
- * ENV.to_h {|name, value| block } -> hash
- *
- * Creates a hash with a copy of the environment variables.
- *
- */
-static VALUE
-env_to_h(VALUE _)
-{
- VALUE hash = env_to_hash();
- if (rb_block_given_p()) {
- hash = rb_hash_to_h_block(hash);
- }
- return hash;
-}
-
-/*
- * call-seq:
- * ENV.reject { |name, value| block } -> Hash
- * ENV.reject -> Enumerator
+ * ENV.reject { |name, value| } -> Hash
+ * ENV.reject -> Enumerator
*
- * Same as ENV.delete_if, but works on (and returns) a copy of the
+ * Same as ENV#delete_if, but works on (and returns) a copy of the
* environment.
*/
static VALUE
-env_reject(VALUE _)
+env_reject(void)
{
return rb_hash_delete_if(env_to_hash());
}
/*
* call-seq:
- * ENV.freeze -> raises TypeError
+ * ENV.shift -> Array or nil
*
- * Ruby does not allow ENV to be frozen, so calling ENV.freeze
- * raises TypeError.
- */
-static VALUE
-env_freeze(VALUE self)
-{
- rb_raise(rb_eTypeError, "cannot freeze ENV");
- return self; /* Not reached */
-}
-
-/*
- * call-seq:
- * ENV.shift -> [name, value] or nil
- *
- * Removes the first environment variable from ENV and returns
- * a 2-element Array containing its name and value:
- * ENV.replace('foo' => '0', 'bar' => '1')
- * ENV.to_hash # => {'bar' => '1', 'foo' => '0'}
- * ENV.shift # => ['bar', '1']
- * ENV.to_hash # => {'foo' => '0'}
- * Exactly which environment variable is "first" is OS-dependent.
- * See {About Ordering}[#class-ENV-label-About+Ordering].
- *
- * Returns +nil+ if the environment is empty:
- * ENV.clear
- * ENV.shift # => nil
+ * Removes an environment variable name-value pair from ENV and returns it as
+ * an Array. Returns +nil+ if when the environment is empty.
*/
static VALUE
-env_shift(VALUE _)
+env_shift(void)
{
char **env;
VALUE result = Qnil;
@@ -6016,7 +3737,7 @@ env_shift(VALUE _)
if (s) {
VALUE key = env_str_new(*env, s-*env);
VALUE val = env_str_new2(getenv(RSTRING_PTR(key)));
- env_delete(key);
+ env_delete(Qnil, key);
result = rb_assoc_new(key, val);
}
}
@@ -6032,7 +3753,7 @@ env_shift(VALUE _)
* and values as names.
*/
static VALUE
-env_invert(VALUE _)
+env_invert(void)
{
return rb_hash_invert(env_to_hash());
}
@@ -6040,7 +3761,7 @@ env_invert(VALUE _)
static int
env_replace_i(VALUE key, VALUE val, VALUE keys)
{
- env_aset(key, val);
+ env_aset(Qnil, key, val);
if (rb_ary_includes(keys, key)) {
rb_ary_delete(keys, key);
}
@@ -6049,23 +3770,15 @@ env_replace_i(VALUE key, VALUE val, VALUE keys)
/*
* call-seq:
- * ENV.replace(hash) -> ENV
- *
- * Replaces the entire content of the environment variables
- * with the name/value pairs in the given +hash+;
- * returns ENV.
- *
- * Replaces the content of ENV with the given pairs:
- * ENV.replace('foo' => '0', 'bar' => '1') # => ENV
- * ENV.to_hash # => {"bar"=>"1", "foo"=>"0"}
+ * ENV.replace(hash) -> env
*
- * Raises an exception if a name or value is invalid.
- * See {Invalid Names and Values}[#class-ENV-label-Invalid-Names+and+Values].
+ * Replaces the contents of the environment variables with the contents of
+ * +hash+.
*/
static VALUE
env_replace(VALUE env, VALUE hash)
{
- VALUE keys;
+ volatile VALUE keys;
long i;
keys = env_keys();
@@ -6074,36 +3787,25 @@ env_replace(VALUE env, VALUE hash)
rb_hash_foreach(hash, env_replace_i, keys);
for (i=0; i<RARRAY_LEN(keys); i++) {
- env_delete(RARRAY_AREF(keys, i));
+ env_delete(env, RARRAY_AREF(keys, i));
}
- RB_GC_GUARD(keys);
return env;
}
static int
-env_update_i(VALUE key, VALUE val, VALUE _)
-{
- env_aset(key, val);
- return ST_CONTINUE;
-}
-
-static int
-env_update_block_i(VALUE key, VALUE val, VALUE _)
+env_update_i(VALUE key, VALUE val)
{
- VALUE oldval = rb_f_getenv(Qnil, key);
- if (!NIL_P(oldval)) {
- val = rb_yield_values(3, key, oldval, val);
+ if (rb_block_given_p()) {
+ val = rb_yield_values(3, key, rb_f_getenv(Qnil, key), val);
}
- env_aset(key, val);
+ env_aset(Qnil, key, val);
return ST_CONTINUE;
}
/*
* call-seq:
- * ENV.update(hash) -> ENV
- * ENV.update(hash) { |name, old_value, new_value| block } -> ENV
- * ENV.merge!(hash) -> ENV
- * ENV.merge!(hash) { |name, old_value, new_value| block } -> ENV
+ * ENV.update(hash) -> Hash
+ * ENV.update(hash) { |name, old_value, new_value| } -> Hash
*
* Adds the contents of +hash+ to the environment variables. If no block is
* specified entries with duplicate keys are overwritten, otherwise the value
@@ -6115,9 +3817,7 @@ env_update(VALUE env, VALUE hash)
{
if (env == hash) return env;
hash = to_hash(hash);
- rb_foreach_func *func = rb_block_given_p() ?
- env_update_block_i : env_update_i;
- rb_hash_foreach(hash, func, 0);
+ rb_hash_foreach(hash, env_update_i, 0);
return env;
}
@@ -6134,7 +3834,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" }
@@ -6172,7 +3872,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
@@ -6239,11 +3939,11 @@ Init_Hash(void)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
+
id_hash = rb_intern("hash");
id_yield = rb_intern("yield");
id_default = rb_intern("default");
id_flatten_bang = rb_intern("flatten!");
- id_hash_iter_lev = rb_make_internal_id();
rb_cHash = rb_define_class("Hash", rb_cObject);
@@ -6252,170 +3952,75 @@ 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_replace, 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, "filter", rb_hash_select, 0);
- rb_define_method(rb_cHash, "filter!", 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_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,"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, "deconstruct_keys", rb_hash_deconstruct_keys, 1);
+ rb_define_method(rb_cHash, "any?", rb_hash_any_p, 0);
/* Document-class: ENV
*
* ENV is a hash-like accessor for environment variables.
- *
- * === Interaction with the Operating System
- *
- * The ENV object interacts with the operating system's environment variables:
- *
- * - When you get the value for a name in ENV, the value is retrieved from among the current environment variables.
- * - When you create or set a name-value pair in ENV, the name and value are immediately set in the environment variables.
- * - When you delete a name-value pair in ENV, it is immediately deleted from the environment variables.
- *
- * === Names and Values
- *
- * Generally, a name or value is a String.
- *
- * ==== Valid Names and Values
- *
- * Each name or value must be one of the following:
- *
- * - A String.
- * - An object that responds to \#to_str by returning a String, in which case that String will be used as the name or value.
- *
- * ==== Invalid Names and Values
- *
- * A new name:
- *
- * - May not be the empty string:
- * ENV[''] = '0'
- * # Raises Errno::EINVAL (Invalid argument - ruby_setenv())
- *
- * - May not contain character <code>"="</code>:
- * ENV['='] = '0'
- * # Raises Errno::EINVAL (Invalid argument - ruby_setenv(=))
- *
- * A new name or value:
- *
- * - May not be a non-String that does not respond to \#to_str:
- *
- * ENV['foo'] = Object.new
- * # Raises TypeError (no implicit conversion of Object into String)
- * ENV[Object.new] = '0'
- * # Raises TypeError (no implicit conversion of Object into String)
- *
- * - May not contain the NUL character <code>"\0"</code>:
- *
- * ENV['foo'] = "\0"
- * # Raises ArgumentError (bad environment variable value: contains null byte)
- * ENV["\0"] == '0'
- * # Raises ArgumentError (bad environment variable name: contains null byte)
- *
- * - May not have an ASCII-incompatible encoding such as UTF-16LE or ISO-2022-JP:
- *
- * ENV['foo'] = '0'.force_encoding(Encoding::ISO_2022_JP)
- * # Raises ArgumentError (bad environment variable name: ASCII incompatible encoding: ISO-2022-JP)
- * ENV["foo".force_encoding(Encoding::ISO_2022_JP)] = '0'
- * # Raises ArgumentError (bad environment variable name: ASCII incompatible encoding: ISO-2022-JP)
- *
- * === About Ordering
- *
- * ENV enumerates its name/value pairs in the order found
- * in the operating system's environment variables.
- * Therefore the ordering of ENV content is OS-dependent, and may be indeterminate.
- *
- * This will be seen in:
- * - A Hash returned by an ENV method.
- * - An Enumerator returned by an ENV method.
- * - An Array returned by ENV.keys, ENV.values, or ENV.to_a.
- * - The String returned by ENV.inspect.
- * - The Array returned by ENV.shift.
- * - The name returned by ENV.key.
- *
- * === About the Examples
- * Some methods in ENV return ENV itself. Typically, there are many environment variables.
- * It's not useful to display a large ENV in the examples here,
- * so most example snippets begin by resetting the contents of ENV:
- * - ENV.replace replaces ENV with a new collection of entries.
- * - ENV.clear empties ENV.
*/
/*
@@ -6426,53 +4031,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_m, 2);
- rb_define_singleton_method(envtbl, "store", env_aset_m, 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, "slice", env_slice, -1);
- rb_define_singleton_method(envtbl, "clear", 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, "filter", env_select, 0);
- rb_define_singleton_method(envtbl, "filter!", env_select_bang, 0);
- rb_define_singleton_method(envtbl, "shift", env_shift, 0);
- rb_define_singleton_method(envtbl, "freeze", env_freeze, 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, "merge!", 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_f_keys, 0);
- rb_define_singleton_method(envtbl, "values", env_f_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_f_to_hash, 0);
- rb_define_singleton_method(envtbl, "to_h", env_to_h, 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.
@@ -6483,6 +4083,4 @@ Init_Hash(void)
/* for callcc */
ruby_register_rollback_func_for_ensure(hash_foreach_ensure, hash_foreach_ensure_rollback);
-
- HASH_ASSERT(sizeof(ar_hint_t) * RHASH_AR_TABLE_MAX_SIZE == sizeof(VALUE));
}
diff --git a/hrtime.h b/hrtime.h
deleted file mode 100644
index f133bdb1ac..0000000000
--- a/hrtime.h
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef RB_HRTIME_H
-#define RB_HRTIME_H
-#include "ruby/ruby.h"
-#include <time.h>
-#if defined(HAVE_SYS_TIME_H)
-# include <sys/time.h>
-#endif
-
-/*
- * Hi-res monotonic clock. It is currently nsec resolution, which has over
- * 500 years of range (with an unsigned 64-bit integer). Developers
- * targeting small systems may try 32-bit and low-resolution (milliseconds).
- *
- * TBD: Is nsec even necessary? usec resolution seems enough for userspace
- * and it'll be suitable for use with devices lasting over 500,000 years
- * (maybe some devices designed for long-term space travel)
- *
- * Current API:
- *
- * * rb_hrtime_now - current clock value (monotonic if available)
- * * rb_hrtime_mul - multiply with overflow check
- * * rb_hrtime_add - add with overflow check
- * * rb_timeval2hrtime - convert from timeval
- * * rb_timespec2hrtime - convert from timespec
- * * rb_msec2hrtime - convert from millisecond
- * * rb_sec2hrtime - convert from time_t (seconds)
- * * rb_hrtime2timeval - convert to timeval
- * * rb_hrtime2timespec - convert to timespec
- *
- * Note: no conversion to milliseconds is provided here because different
- * functions have different limits (e.g. epoll_wait vs w32_wait_events).
- * So we provide RB_HRTIME_PER_MSEC and similar macros for implementing
- * this for each use case.
- */
-#define RB_HRTIME_PER_USEC ((rb_hrtime_t)1000)
-#define RB_HRTIME_PER_MSEC (RB_HRTIME_PER_USEC * (rb_hrtime_t)1000)
-#define RB_HRTIME_PER_SEC (RB_HRTIME_PER_MSEC * (rb_hrtime_t)1000)
-#define RB_HRTIME_MAX UINT64_MAX
-
-/*
- * Lets try to support time travelers. Lets assume anybody with a time machine
- * also has access to a modern gcc or clang with 128-bit int support
- */
-#ifdef MY_RUBY_BUILD_MAY_TIME_TRAVEL
-typedef int128_t rb_hrtime_t;
-#else
-typedef uint64_t rb_hrtime_t;
-#endif
-
-/* thread.c */
-/* returns the value of the monotonic clock (if available) */
-rb_hrtime_t rb_hrtime_now(void);
-
-/*
- * multiply @a and @b with overflow check and return the
- * (clamped to RB_HRTIME_MAX) result.
- */
-static inline rb_hrtime_t
-rb_hrtime_mul(rb_hrtime_t a, rb_hrtime_t b)
-{
- rb_hrtime_t c;
-
-#ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
- if (__builtin_mul_overflow(a, b, &c))
- return RB_HRTIME_MAX;
-#else
- if (b != 0 && a > RB_HRTIME_MAX / b) /* overflow */
- return RB_HRTIME_MAX;
- c = a * b;
-#endif
- return c;
-}
-
-/*
- * add @a and @b with overflow check and return the
- * (clamped to RB_HRTIME_MAX) result.
- */
-static inline rb_hrtime_t
-rb_hrtime_add(rb_hrtime_t a, rb_hrtime_t b)
-{
- rb_hrtime_t c;
-
-#ifdef HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW
- if (__builtin_add_overflow(a, b, &c))
- return RB_HRTIME_MAX;
-#else
- c = a + b;
- if (c < a) /* overflow */
- return RB_HRTIME_MAX;
-#endif
- return c;
-}
-
-/*
- * convert a timeval struct to rb_hrtime_t, clamping at RB_HRTIME_MAX
- */
-static inline rb_hrtime_t
-rb_timeval2hrtime(const struct timeval *tv)
-{
- rb_hrtime_t s = rb_hrtime_mul((rb_hrtime_t)tv->tv_sec, RB_HRTIME_PER_SEC);
- rb_hrtime_t u = rb_hrtime_mul((rb_hrtime_t)tv->tv_usec, RB_HRTIME_PER_USEC);
-
- return rb_hrtime_add(s, u);
-}
-
-/*
- * convert a timespec struct to rb_hrtime_t, clamping at RB_HRTIME_MAX
- */
-static inline rb_hrtime_t
-rb_timespec2hrtime(const struct timespec *ts)
-{
- rb_hrtime_t s = rb_hrtime_mul((rb_hrtime_t)ts->tv_sec, RB_HRTIME_PER_SEC);
-
- return rb_hrtime_add(s, (rb_hrtime_t)ts->tv_nsec);
-}
-
-/*
- * convert a millisecond value to rb_hrtime_t, clamping at RB_HRTIME_MAX
- */
-static inline rb_hrtime_t
-rb_msec2hrtime(unsigned long msec)
-{
- return rb_hrtime_mul((rb_hrtime_t)msec, RB_HRTIME_PER_MSEC);
-}
-
-/*
- * convert a time_t value to rb_hrtime_t, clamping at RB_HRTIME_MAX
- * Negative values will be clamped at 0.
- */
-static inline rb_hrtime_t
-rb_sec2hrtime(time_t sec)
-{
- if (sec <= 0) return 0;
-
- return rb_hrtime_mul((rb_hrtime_t)sec, RB_HRTIME_PER_SEC);
-}
-
-/*
- * convert a rb_hrtime_t value to a timespec, suitable for calling
- * functions like ppoll(2) or kevent(2)
- */
-static inline struct timespec *
-rb_hrtime2timespec(struct timespec *ts, const rb_hrtime_t *hrt)
-{
- if (hrt) {
- ts->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC);
- ts->tv_nsec = (int32_t)(*hrt % RB_HRTIME_PER_SEC);
- return ts;
- }
- return 0;
-}
-
-/*
- * convert a rb_hrtime_t value to a timeval, suitable for calling
- * functions like select(2)
- */
-static inline struct timeval *
-rb_hrtime2timeval(struct timeval *tv, const rb_hrtime_t *hrt)
-{
- if (hrt) {
- tv->tv_sec = (time_t)(*hrt / RB_HRTIME_PER_SEC);
- tv->tv_usec = (int32_t)((*hrt % RB_HRTIME_PER_SEC)/RB_HRTIME_PER_USEC);
-
- return tv;
- }
- return 0;
-}
-#endif /* RB_HRTIME_H */
diff --git a/ia64.s b/ia64.s
new file mode 100644
index 0000000000..1087105585
--- /dev/null
+++ b/ia64.s
@@ -0,0 +1,42 @@
+// rb_ia64_flushrs and rb_ia64_bsp is written in IA64 assembly language
+// because Intel Compiler for IA64 doesn't support inline assembly.
+//
+// This file is based on following C program compiled by gcc.
+//
+// void rb_ia64_flushrs(void) { __builtin_ia64_flushrs(); }
+// void *rb_ia64_bsp(void) { return __builtin_ia64_bsp(); }
+//
+// Note that rb_ia64_flushrs and rb_ia64_bsp works in its own stack frame.
+// It's because BSP is updated by br.call/brl.call (not alloc instruction).
+// So rb_ia64_flushrs flushes stack frames including caller's one.
+// rb_ia64_bsp returns the address next to caller's register stack frame.
+//
+// See also
+// Intel Itanium Architecture Software Developer's Manual
+// Volume 2: System Architecture.
+//
+ .file "ia64.c"
+ .text
+ .align 16
+ .global rb_ia64_flushrs#
+ .proc rb_ia64_flushrs#
+rb_ia64_flushrs:
+ .prologue
+ .body
+ flushrs
+ ;;
+ nop.i 0
+ br.ret.sptk.many b0
+ .endp rb_ia64_flushrs#
+ .align 16
+ .global rb_ia64_bsp#
+ .proc rb_ia64_bsp#
+rb_ia64_bsp:
+ .prologue
+ .body
+ nop.m 0
+ ;;
+ mov r8 = ar.bsp
+ br.ret.sptk.many b0
+ .endp rb_ia64_bsp#
+ .ident "GCC: (GNU) 3.3.5 (Debian 1:3.3.5-13)"
diff --git a/id_table.c b/id_table.c
deleted file mode 100644
index f566582479..0000000000
--- a/id_table.c
+++ /dev/null
@@ -1,325 +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_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, rb_id_table_update_callback_func_t *replace, 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)(Qundef, tbl->items[i].val, data);
- assert(key != 0);
-
- if (ret == ID_TABLE_REPLACE) {
- VALUE val = tbl->items[i].val;
- ret = (*replace)(NULL, &val, data, TRUE);
- tbl->items[i].val = val;
- }
- else if (ret == ID_TABLE_STOP)
- return;
- }
- }
-}
-
-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 abd9eb5f38..0000000000
--- a/id_table.h
+++ /dev/null
@@ -1,34 +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_REPLACE = ST_REPLACE,
- 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_update_callback_func_t(ID *id, VALUE *val, void *data, int existing);
-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_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, rb_id_table_update_callback_func_t *replace, 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/assert.h b/include/ruby/assert.h
deleted file mode 100644
index d19d8e4e32..0000000000
--- a/include/ruby/assert.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef RUBY_ASSERT_H
-#define RUBY_ASSERT_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) \
- ((RUBY_DEBUG+0) ? RUBY_ASSERT_MESG((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(!((RUBY_DEBUG+0) || (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)
-#define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG_WHEN(TRUE, expr, #expr)
-
-#ifndef RUBY_DEBUG
-# define RUBY_DEBUG 0
-#endif
-#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/include/ruby/backward.h b/include/ruby/backward.h
deleted file mode 100644
index 863edf0ed5..0000000000
--- a/include/ruby/backward.h
+++ /dev/null
@@ -1,79 +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))))
-
-/* 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))))
-
-/* eval.c */
-NORETURN(ERRORFUNC(("internal function"), void rb_frozen_class_p(VALUE)));
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_exec_end_proc);
-
-/* 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);
-
-/* gc.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_gc_call_finalizer_at_exit);
-
-/* signal.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_trap_exit);
-
-/* struct.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_struct_ptr);
-
-/* thread.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_clear_trace_func);
-
-/* variable.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_generic_ivar_table);
-NORETURN(ERRORFUNC(("internal function"), VALUE rb_mod_const_missing(VALUE, VALUE)));
-
-/* 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/cxxanyargs.hpp b/include/ruby/backward/cxxanyargs.hpp
deleted file mode 100644
index 3585f678b8..0000000000
--- a/include/ruby/backward/cxxanyargs.hpp
+++ /dev/null
@@ -1,439 +0,0 @@
-#ifndef RUBY_BACKWARD_CXXANYARGS_HPP // -*- C++ -*-
-#define RUBY_BACKWARD_CXXANYARGS_HPP
-/// @file
-/// @brief Provides old prototypes for C++ programs.
-/// @author \@shyouhei
-/// @copyright This file is a part of the programming language Ruby.
-/// Permission is hereby granted, to either redistribute and/or
-/// modify this file, provided that the conditions mentioned in the
-/// file COPYING are met. Consult the file for details.
-/// @note DO NOT MODERNIZE THIS FILE! As the file name implies it is
-/// meant to be a backwards compatibility shim. Please stick to
-/// C++ 98 and never use newer features, like `constexpr`.
-
-/// @brief The main namespace.
-/// @note The name "ruby" might already be taken, but that must not be a
-/// problem because namespaces are allowed to reopen.
-namespace ruby {
-
-/// @brief Backwards compatibility layer.
-namespace backward {
-
-/// @brief Provides ANYARGS deprecation warnings.
-///
-/// In C, ANYARGS means there is no function prototype. Literally anything,
-/// even including nothing, can be a valid ANYARGS. So passing a correctly
-/// prototyped function pointer to an ANYARGS-ed function parameter is valid,
-/// at the same time passing an ANYARGS-ed function pointer to a granular typed
-/// function parameter is also valid. However on the other hand in C++,
-/// ANYARGS doesn't actually mean any number of arguments. C++'s ANYARGS means
-/// _variadic_ number of arguments. This is incompatible with ordinal, correct
-/// function prototypes.
-///
-/// Luckily, function prototypes being distinct each other means they can be
-/// overloaded. We can provide a compatibility layer for older Ruby APIs which
-/// used to have ANYARGS. This namespace includes such attempts.
-namespace cxxanyargs {
-
-/// @brief ANYARGS-ed function type.
-typedef VALUE type(ANYARGS);
-
-/// @brief ANYARGS-ed function type, void variant.
-typedef void void_type(ANYARGS);
-
-/// @brief ANYARGS-ed function type, int variant.
-typedef int int_type(ANYARGS);
-
-/// @name Hooking global variables
-/// @{
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Define a function-backended global variable.
-/// @param[in] q Name of the variable.
-/// @param[in] w Getter function.
-/// @param[in] e Setter function.
-/// @note Both functions can be nullptr.
-/// @see rb_define_hooked_variable()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_define_virtual_variable(const char *q, type *w, void_type *e)
-{
- rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
- rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
- ::rb_define_virtual_variable(q, r, t);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Define a function-backended global variable.
-/// @param[in] q Name of the variable.
-/// @param[in] w Getter function.
-/// @param[in] e Setter function.
-/// @note Both functions can be nullptr.
-/// @see rb_define_hooked_variable()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, void_type *e)
-{
- rb_gvar_setter_t *t = reinterpret_cast<rb_gvar_setter_t*>(e);
- ::rb_define_virtual_variable(q, w, t);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Define a function-backended global variable.
-/// @param[in] q Name of the variable.
-/// @param[in] w Getter function.
-/// @param[in] e Setter function.
-/// @note Both functions can be nullptr.
-/// @see rb_define_hooked_variable()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_define_virtual_variable(const char *q, type *w, rb_gvar_setter_t *e)
-{
- rb_gvar_getter_t *r = reinterpret_cast<rb_gvar_getter_t*>(w);
- ::rb_define_virtual_variable(q, r, e);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Define a function-backended global variable.
-/// @param[in] q Name of the variable.
-/// @param[in] w Variable storage.
-/// @param[in] e Getter function.
-/// @param[in] r Setter function.
-/// @note Both functions can be nullptr.
-/// @see rb_define_virtual_variable()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
-{
- rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
- rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
- ::rb_define_hooked_variable(q, w, t, y);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Define a function-backended global variable.
-/// @param[in] q Name of the variable.
-/// @param[in] w Variable storage.
-/// @param[in] e Getter function.
-/// @param[in] r Setter function.
-/// @note Both functions can be nullptr.
-/// @see rb_define_virtual_variable()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_define_hooked_variable(const char *q, VALUE *w, rb_gvar_getter_t *e, void_type *r)
-{
- rb_gvar_setter_t *y = reinterpret_cast<rb_gvar_setter_t*>(r);
- ::rb_define_hooked_variable(q, w, e, y);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Define a function-backended global variable.
-/// @param[in] q Name of the variable.
-/// @param[in] w Variable storage.
-/// @param[in] e Getter function.
-/// @param[in] r Setter function.
-/// @note Both functions can be nullptr.
-/// @see rb_define_virtual_variable()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_define_hooked_variable(const char *q, VALUE *w, type *e, rb_gvar_setter_t *r)
-{
- rb_gvar_getter_t *t = reinterpret_cast<rb_gvar_getter_t*>(e);
- ::rb_define_hooked_variable(q, w, t, r);
-}
-
-/// @}
-/// @name Exceptions and tag jumps
-/// @{
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Old way to implement iterators.
-/// @param[in] q A function that can yield.
-/// @param[in] w Passed to `q`.
-/// @param[in] e What is to be yielded.
-/// @param[in] r Passed to `e`.
-/// @return The return value of `q`.
-/// @note `e` can be nullptr.
-/// @deprecated This function is obsolated since long before 2.x era. Do not
-/// use it any longer. rb_block_call() is provided instead.
-inline VALUE
-rb_iterate(VALUE(*q)(VALUE), VALUE w, type *e, VALUE r)
-{
- rb_block_call_func_t t = reinterpret_cast<rb_block_call_func_t>(e);
- return ::rb_iterate(q, w, t, r);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Call a method with a block.
-/// @param[in] q The self.
-/// @param[in] w The method.
-/// @param[in] e The # of elems of `r`
-/// @param[in] r The arguments.
-/// @param[in] t What is to be yielded.
-/// @param[in] y Passed to `t`
-/// @return Return value of `q#w(*r,&t)`
-/// @note 't' can be nullptr.
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
-{
- rb_block_call_func_t u = reinterpret_cast<rb_block_call_func_t>(t);
- return ::rb_block_call(q, w, e, r, u, y);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief An equivalent of `rescue` clause.
-/// @param[in] q A function that can raise.
-/// @param[in] w Passed to `q`.
-/// @param[in] e A function that cleans-up.
-/// @param[in] r Passed to `e`.
-/// @return The return value of `q` if no exception occurs, or the return
-/// value of `e` if otherwise.
-/// @note `e` can be nullptr.
-/// @see rb_ensure()
-/// @see rb_rescue2()
-/// @see rb_protect()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_rescue(type *q, VALUE w, type *e, VALUE r)
-{
- typedef VALUE func1_t(VALUE);
- typedef VALUE func2_t(VALUE, VALUE);
- func1_t *t = reinterpret_cast<func1_t*>(q);
- func2_t *y = reinterpret_cast<func2_t*>(e);
- return ::rb_rescue(t, w, y, r);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief An equivalent of `rescue` clause.
-/// @param[in] q A function that can raise.
-/// @param[in] w Passed to `q`.
-/// @param[in] e A function that cleans-up.
-/// @param[in] r Passed to `e`.
-/// @param[in] ... 0-terminated list of subclass of @ref rb_eException.
-/// @return The return value of `q` if no exception occurs, or the return
-/// value of `e` if otherwise.
-/// @note `e` can be nullptr.
-/// @see rb_ensure()
-/// @see rb_rescue()
-/// @see rb_protect()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
-{
- typedef VALUE func1_t(VALUE);
- typedef VALUE func2_t(VALUE, VALUE);
- func1_t *t = reinterpret_cast<func1_t*>(q);
- func2_t *y = reinterpret_cast<func2_t*>(e);
- va_list ap;
- va_start(ap, r);
- VALUE ret = ::rb_vrescue2(t, w, y, r, ap);
- va_end(ap);
- return ret;
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief An equivalent of `ensure` clause.
-/// @param[in] q A function that can raise.
-/// @param[in] w Passed to `q`.
-/// @param[in] e A function that ensures.
-/// @param[in] r Passed to `e`.
-/// @return The return value of `q`.
-/// @note It makes no sense to pass nullptr to `e`.
-/// @see rb_rescue()
-/// @see rb_rescue2()
-/// @see rb_protect()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_ensure(type *q, VALUE w, type *e, VALUE r)
-{
- typedef VALUE func1_t(VALUE);
- func1_t *t = reinterpret_cast<func1_t*>(q);
- func1_t *y = reinterpret_cast<func1_t*>(e);
- return ::rb_ensure(t, w, y, r);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief An equivalent of `Kernel#catch`.
-/// @param[in] q The "tag" string.
-/// @param[in] w A function that can throw.
-/// @param[in] e Passed to `w`.
-/// @return What was thrown.
-/// @note `q` can be a nullptr but makes no sense to pass nullptr to`w`.
-/// @see rb_block_call()
-/// @see rb_protect()
-/// @see rb_rb_catch_obj()
-/// @see rb_rescue()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_catch(const char *q, type *w, VALUE e)
-{
- rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
- return ::rb_catch(q, r, e);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief An equivalent of `Kernel#catch`.
-/// @param[in] q The "tag" object.
-/// @param[in] w A function that can throw.
-/// @param[in] e Passed to `w`.
-/// @return What was thrown.
-/// @note It makes no sense to pass nullptr to`w`.
-/// @see rb_block_call()
-/// @see rb_protect()
-/// @see rb_rb_catch_obj()
-/// @see rb_rescue()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_catch_obj(VALUE q, type *w, VALUE e)
-{
- rb_block_call_func_t r = reinterpret_cast<rb_block_call_func_t>(w);
- return ::rb_catch_obj(q, r, e);
-}
-
-/// @}
-/// @name Procs, Fibers and Threads
-/// @{
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Creates a @ref rb_cFiber instance.
-/// @param[in] q The fiber body.
-/// @param[in] w Passed to `q`.
-/// @return What was allocated.
-/// @note It makes no sense to pass nullptr to`q`.
-/// @see rb_proc_new()
-/// @see rb_thread_creatr()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_fiber_new(type *q, VALUE w)
-{
- rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
- return ::rb_fiber_new(e, w);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Creates a @ref rb_cProc instance.
-/// @param[in] q The proc body.
-/// @param[in] w Passed to `q`.
-/// @return What was allocated.
-/// @note It makes no sense to pass nullptr to`q`.
-/// @see rb_fiber_new()
-/// @see rb_thread_creatr()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_proc_new(type *q, VALUE w)
-{
- rb_block_call_func_t e = reinterpret_cast<rb_block_call_func_t>(q);
- return ::rb_proc_new(e, w);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Creates a @ref rb_cThread instance.
-/// @param[in] q The thread body.
-/// @param[in] w Passed to `q`.
-/// @return What was allocated.
-/// @note It makes no sense to pass nullptr to`q`.
-/// @see rb_proc_new()
-/// @see rb_fiber_new()
-/// @deprecated Use glanular typed overload instead.
-inline VALUE
-rb_thread_create(type *q, void *w)
-{
- typedef VALUE ptr_t(void*);
- ptr_t *e = reinterpret_cast<ptr_t*>(q);
- return ::rb_thread_create(e, w);
-}
-
-/// @}
-/// @name Hash and st_table
-/// @{
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Iteration over the given table.
-/// @param[in] q A table to scan.
-/// @param[in] w A function to iterate.
-/// @param[in] e Passed to `w`.
-/// @retval 0 Always returns 0.
-/// @note It makes no sense to pass nullptr to`w`.
-/// @see st_foreach_check()
-/// @see rb_hash_foreach()
-/// @deprecated Use glanular typed overload instead.
-inline int
-st_foreach(st_table *q, int_type *w, st_data_t e)
-{
- st_foreach_callback_func *r =
- reinterpret_cast<st_foreach_callback_func*>(w);
- return ::st_foreach(q, r, e);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Iteration over the given table.
-/// @param[in] q A table to scan.
-/// @param[in] w A function to iterate.
-/// @param[in] e Passed to `w`.
-/// @retval 0 Successful end of iteration.
-/// @retval 1 Element removed during traversing.
-/// @note It makes no sense to pass nullptr to`w`.
-/// @see st_foreach()
-/// @deprecated Use glanular typed overload instead.
-inline int
-st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t)
-{
- st_foreach_check_callback_func *t =
- reinterpret_cast<st_foreach_check_callback_func*>(w);
- return ::st_foreach_check(q, t, e, 0);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Iteration over the given table.
-/// @param[in] q A table to scan.
-/// @param[in] w A function to iterate.
-/// @param[in] e Passed to `w`.
-/// @note It makes no sense to pass nullptr to`w`.
-/// @see st_foreach_check()
-/// @deprecated Use glanular typed overload instead.
-inline void
-st_foreach_safe(st_table *q, int_type *w, st_data_t e)
-{
- st_foreach_callback_func *r =
- reinterpret_cast<st_foreach_callback_func*>(w);
- ::st_foreach_safe(q, r, e);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Iteration over the given hash.
-/// @param[in] q A hash to scan.
-/// @param[in] w A function to iterate.
-/// @param[in] e Passed to `w`.
-/// @note It makes no sense to pass nullptr to`w`.
-/// @see st_foreach()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_hash_foreach(VALUE q, int_type *w, VALUE e)
-{
- st_foreach_callback_func *r =
- reinterpret_cast<st_foreach_callback_func*>(w);
- ::rb_hash_foreach(q, r, e);
-}
-
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
-/// @brief Iteration over each instance variable of the object.
-/// @param[in] q An object.
-/// @param[in] w A function to iterate.
-/// @param[in] e Passed to `w`.
-/// @note It makes no sense to pass nullptr to`w`.
-/// @see st_foreach()
-/// @deprecated Use glanular typed overload instead.
-inline void
-rb_ivar_foreach(VALUE q, int_type *w, VALUE e)
-{
- st_foreach_callback_func *r =
- reinterpret_cast<st_foreach_callback_func*>(w);
- ::rb_ivar_foreach(q, r, e);
-}
-
-/// @}
-}}}
-
-using namespace ruby::backward::cxxanyargs;
-#endif // RUBY_BACKWARD_CXXANYARGS_HPP
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 8a831e61ab..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);
@@ -83,11 +82,7 @@ VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg);
-/*
- * Postponed Job API
- * rb_postponed_job_register and rb_postponed_job_register_one are
- * async-signal-safe and used via SIGPROF by the "stackprof" RubyGem
- */
+/* Postponed Job API */
typedef void (*rb_postponed_job_func_t)(void *arg);
int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data);
int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data);
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 5e03d49985..f83ced006c 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -22,106 +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
-#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 RUBY_CXX_DEPRECATED
-# define RUBY_CXX_DEPRECATED(mesg) /* nothing */
-#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 */
-
-/*
- cold attribute for code layout improvements
- RUBY_FUNC_ATTRIBUTE not used because MSVC does not like nested func macros
- */
-#if defined(__clang__) || GCC_VERSION_SINCE(4, 3, 0)
-#define COLDFUNC __attribute__((cold))
-#else
-#define COLDFUNC
-#endif
-
-#ifdef __GNUC__
-#if defined __MINGW_PRINTF_FORMAT
-#define PRINTF_ARGS(decl, string_index, first_to_check) \
- decl __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, first_to_check)))
-#else
-#define PRINTF_ARGS(decl, string_index, first_to_check) \
- decl __attribute__((format(printf, string_index, first_to_check)))
-#endif
-#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
@@ -153,9 +53,6 @@ extern "C" {
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
-#ifdef HAVE_STDALIGN_H
-# include <stdalign.h>
-#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -164,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
@@ -215,118 +112,18 @@ 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))
-#elif defined(__has_attribute)
-# if __has_attribute(alloc_size)
-# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__((__alloc_size__ params))
-# endif
-#endif
-#ifndef RUBY_ATTR_ALLOC_SIZE
+#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
-#ifdef __has_attribute
-# if __has_attribute(malloc)
-# define RUBY_ATTR_MALLOC __attribute__((__malloc__))
-# endif
-#endif
-#ifndef RUBY_ATTR_MALLOC
-# define RUBY_ATTR_MALLOC
-#endif
-
-#ifdef __has_attribute
-# if __has_attribute(returns_nonnull)
-# define RUBY_ATTR_RETURNS_NONNULL __attribute__((__returns_nonnull__))
-# endif
-#endif
-#ifndef RUBY_ATTR_RETURNS_NONNULL
-# define RUBY_ATTR_RETURNS_NONNULL
-#endif
-
-void *ruby_xmalloc(size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1));
-void *ruby_xmalloc2(size_t,size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1,2));
-void *ruby_xcalloc(size_t,size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1,2));
-void *ruby_xrealloc(void*,size_t) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
-void *ruby_xrealloc2(void*,size_t,size_t) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2,3));
-void ruby_xfree(void*);
-
-#ifndef USE_GC_MALLOC_OBJ_INFO_DETAILS
-#define USE_GC_MALLOC_OBJ_INFO_DETAILS 0
-#endif
-
-#if USE_GC_MALLOC_OBJ_INFO_DETAILS
-
-void *ruby_xmalloc_body(size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1));
-void *ruby_xmalloc2_body(size_t,size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1,2));
-void *ruby_xcalloc_body(size_t,size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1,2));
-void *ruby_xrealloc_body(void*,size_t) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
-void *ruby_xrealloc2_body(void*,size_t,size_t) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2,3));
-
-#define ruby_xmalloc(s1) ruby_xmalloc_with_location(s1, __FILE__, __LINE__)
-#define ruby_xmalloc2(s1, s2) ruby_xmalloc2_with_location(s1, s2, __FILE__, __LINE__)
-#define ruby_xcalloc(s1, s2) ruby_xcalloc_with_location(s1, s2, __FILE__, __LINE__)
-#define ruby_xrealloc(ptr, s1) ruby_xrealloc_with_location(ptr, s1, __FILE__, __LINE__)
-#define ruby_xrealloc2(ptr, s1, s2) ruby_xrealloc2_with_location(ptr, s1, s2, __FILE__, __LINE__)
-
-extern const char *ruby_malloc_info_file;
-extern int ruby_malloc_info_line;
-
-static inline void *
-ruby_xmalloc_with_location(size_t s, const char *file, int line)
-{
- void *ptr;
- ruby_malloc_info_file = file;
- ruby_malloc_info_line = line;
- ptr = ruby_xmalloc_body(s);
- ruby_malloc_info_file = NULL;
- return ptr;
-}
-
-static inline void *
-ruby_xmalloc2_with_location(size_t s1, size_t s2, const char *file, int line)
-{
- void *ptr;
- ruby_malloc_info_file = file;
- ruby_malloc_info_line = line;
- ptr = ruby_xmalloc2_body(s1, s2);
- ruby_malloc_info_file = NULL;
- return ptr;
-}
-
-static inline void *
-ruby_xcalloc_with_location(size_t s1, size_t s2, const char *file, int line)
-{
- void *ptr;
- ruby_malloc_info_file = file;
- ruby_malloc_info_line = line;
- ptr = ruby_xcalloc_body(s1, s2);
- ruby_malloc_info_file = NULL;
- return ptr;
-}
-
-static inline void *
-ruby_xrealloc_with_location(void *ptr, size_t s, const char *file, int line)
-{
- void *rptr;
- ruby_malloc_info_file = file;
- ruby_malloc_info_line = line;
- rptr = ruby_xrealloc_body(ptr, s);
- ruby_malloc_info_file = NULL;
- return rptr;
-}
-
-static inline void *
-ruby_xrealloc2_with_location(void *ptr, size_t s1, size_t s2, const char *file, int line)
-{
- void *rptr;
- ruby_malloc_info_file = file;
- ruby_malloc_info_line = line;
- rptr = ruby_xrealloc2_body(ptr, s1, s2);
- ruby_malloc_info_file = NULL;
- return rptr;
-}
-#endif
+void *xmalloc(size_t) RUBY_ATTR_ALLOC_SIZE((1));
+void *xmalloc2(size_t,size_t) RUBY_ATTR_ALLOC_SIZE((1,2));
+void *xcalloc(size_t,size_t) RUBY_ATTR_ALLOC_SIZE((1,2));
+void *xrealloc(void*,size_t) RUBY_ATTR_ALLOC_SIZE((2));
+void *xrealloc2(void*,size_t,size_t) RUBY_ATTR_ALLOC_SIZE((2,3));
+void xfree(void*);
#define STRINGIZE(expr) STRINGIZE0(expr)
#ifndef STRINGIZE0
@@ -350,12 +147,7 @@ ruby_xrealloc2_with_location(void *ptr, size_t s1, size_t s2, const char *file,
#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
@@ -371,6 +163,10 @@ ruby_xrealloc2_with_location(void *ptr, size_t s1, size_t s2, const char *file,
#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
@@ -391,32 +187,12 @@ ruby_xrealloc2_with_location(void *ptr, size_t s1, size_t s2, const char *file,
#define RUBY_FUNC_EXPORTED
#endif
-/* These macros are used for functions which are exported only for MJIT
- and NOT ensured to be exported in future versions. */
-#define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED
-#define MJIT_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN
-#define MJIT_SYMBOL_EXPORT_END RUBY_SYMBOL_EXPORT_END
-
-#if defined(MJIT_HEADER) && defined(_MSC_VER)
-# undef MJIT_FUNC_EXPORTED
-# define MJIT_FUNC_EXPORTED static
-#endif
-
#ifndef RUBY_EXTERN
#define RUBY_EXTERN extern
#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
@@ -427,6 +203,10 @@ ruby_xrealloc2_with_location(void *ptr, size_t s1, size_t s2, const char *file,
#if defined(__sparc)
void rb_sparc_flush_register_windows(void);
# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
+#elif defined(__ia64)
+void *rb_ia64_bsp(void);
+void rb_ia64_flushrs(void);
+# define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
#else
# define FLUSH_REGISTER_WINDOWS ((void)0)
#endif
@@ -440,7 +220,7 @@ void rb_sparc_flush_register_windows(void);
#define PATH_ENV "PATH"
-#if defined(DOSISH)
+#if defined(DOSISH) && !defined(__EMX__)
#define ENV_IGNORECASE
#endif
@@ -463,24 +243,18 @@ void rb_sparc_flush_register_windows(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) \
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
#endif
-#ifndef RUBY_FUNC_NONNULL
-#define RUBY_FUNC_NONNULL(n, x) x
-#endif
#ifndef UNALIGNED_WORD_ACCESS
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
@@ -503,31 +277,6 @@ void rb_sparc_flush_register_windows(void);
# endif
#endif
-#ifndef RUBY_ALIGNAS
-#define RUBY_ALIGNAS(x) /* x */
-#endif
-
-#ifdef RUBY_ALIGNOF
-/* OK, take that definition */
-#elif defined(__cplusplus) && (__cplusplus >= 201103L)
-#define RUBY_ALIGNOF alignof
-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
-#define RUBY_ALIGNOF _Alignof
-#else
-#define RUBY_ALIGNOF(type) ((size_t)offsetof(struct { char f1; type f2; }, f2))
-#endif
-
-#define NORETURN_STYLE_NEW 1
-#ifdef NORETURN
-/* OK, take that definition */
-#elif defined(__cplusplus) && (__cplusplus >= 201103L)
-#define NORETURN(x) [[ noreturn ]] x
-#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
-#define NORETURN(x) _Noreturn x
-#else
-#define NORETURN(x) x
-#endif
-
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 93939ee7db..7d33e538de 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -12,10 +12,6 @@
#ifndef RUBY_ENCODING_H
#define RUBY_ENCODING_H 1
-#ifdef RUBY_INTERNAL_H
-#error "Include this file before internal.h"
-#endif
-
#if defined(__cplusplus)
extern "C" {
#if 0
@@ -24,107 +20,65 @@ 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_capable(VALUE obj);
int rb_enc_find_index(const char *name);
-int rb_enc_alias(const char *alias, const char *orig);
int rb_to_encoding_index(VALUE);
rb_encoding *rb_to_encoding(VALUE);
rb_encoding *rb_find_encoding(VALUE);
@@ -152,17 +106,19 @@ 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( \
+#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_enc_str_new(str, len, enc) __extension__ ( \
+{ \
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
rb_enc_str_new_static((str), (len), (enc)) : \
- rb_enc_str_new((str), (len), (enc)) \
-)
-#define rb_enc_str_new_cstr(str, enc) RB_GNUC_EXTENSION_BLOCK( \
+ rb_enc_str_new((str), (len), (enc)); \
+})
+#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_cstr((str), (enc)); \
+})
#endif
PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
@@ -237,16 +193,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*);
@@ -256,7 +207,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);
@@ -265,13 +216,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);
@@ -358,64 +309,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
- RUBY_ECONV_UNDEF_MASK = 0x000000f0,
- RUBY_ECONV_UNDEF_REPLACE = 0x00000020,
- RUBY_ECONV_UNDEF_HEX_CHARREF = 0x00000030,
+#define ECONV_INVALID_MASK 0x0000000f
+#define ECONV_INVALID_REPLACE 0x00000002
- 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_UNDEF_MASK 0x000000f0
+#define ECONV_UNDEF_REPLACE 0x00000020
+#define ECONV_UNDEF_HEX_CHARREF 0x00000030
- 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_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_STATEFUL_DECORATOR_MASK = 0x00f00000,
- RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR = 0x00100000,
+#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
+
+#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 2f60fb569e..3af7ecad89 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -21,10 +21,6 @@ extern "C" {
#endif
#endif
-#if !defined(__has_attribute)
-#define __has_attribute(x) 0
-#endif
-
#include "ruby/defines.h"
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
@@ -38,15 +34,6 @@ extern "C" {
#include "ruby/st.h"
-/* On mswin, MJIT header transformation can't be used since cl.exe can't output
- preprocessed output preserving macros. So this `MJIT_STATIC` is needed
- to force non-static function to static on MJIT header to avoid symbol conflict. */
-#ifdef MJIT_HEADER
-# define MJIT_STATIC static
-#else
-# define MJIT_STATIC
-#endif
-
RUBY_SYMBOL_EXPORT_BEGIN
/*
@@ -57,7 +44,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
#define UNLIMITED_ARGUMENTS (-1)
/* array.c */
-void rb_mem_clear(VALUE*, long);
+void rb_mem_clear(register VALUE*, register long);
VALUE rb_assoc_new(VALUE, VALUE);
VALUE rb_check_array_type(VALUE);
VALUE rb_ary_new(void);
@@ -144,6 +131,7 @@ VALUE rb_big_or(VALUE, VALUE);
VALUE rb_big_xor(VALUE, VALUE);
VALUE rb_big_lshift(VALUE, VALUE);
VALUE rb_big_rshift(VALUE, VALUE);
+VALUE rb_big_hash(VALUE);
/* For rb_integer_pack and rb_integer_unpack: */
/* "MS" in MSWORD and MSBYTE means "most significant" */
@@ -192,38 +180,27 @@ VALUE rb_complex_raw(VALUE, VALUE);
VALUE rb_complex_new(VALUE, VALUE);
#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0))
#define rb_complex_new2(x,y) rb_complex_new((x), (y))
-VALUE rb_complex_new_polar(VALUE abs, VALUE arg);
-DEPRECATED_BY(rb_complex_new_polar, VALUE rb_complex_polar(VALUE abs, VALUE arg));
-VALUE rb_complex_real(VALUE z);
-VALUE rb_complex_imag(VALUE z);
-VALUE rb_complex_plus(VALUE x, VALUE y);
-VALUE rb_complex_minus(VALUE x, VALUE y);
-VALUE rb_complex_mul(VALUE x, VALUE y);
-VALUE rb_complex_div(VALUE x, VALUE y);
-VALUE rb_complex_uminus(VALUE z);
-VALUE rb_complex_conjugate(VALUE z);
-VALUE rb_complex_abs(VALUE z);
-VALUE rb_complex_arg(VALUE z);
-VALUE rb_complex_pow(VALUE base, VALUE exp);
-VALUE rb_dbl_complex_new(double real, double imag);
-#define rb_complex_add rb_complex_plus
-#define rb_complex_sub rb_complex_minus
-#define rb_complex_nagate rb_complex_uminus
-
+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);
@@ -233,6 +210,7 @@ VALUE rb_class_protected_instance_methods(int, const VALUE*, VALUE);
VALUE rb_class_private_instance_methods(int, const VALUE*, VALUE);
VALUE rb_obj_singleton_methods(int, const VALUE*, VALUE);
void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
+void rb_frozen_class_p(VALUE);
void rb_undef(VALUE, ID);
void rb_define_protected_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
@@ -242,11 +220,9 @@ VALUE rb_singleton_class(VALUE);
int rb_cmpint(VALUE, VALUE, VALUE);
NORETURN(void rb_cmperr(VALUE, VALUE));
/* cont.c */
-VALUE rb_fiber_new(rb_block_call_func_t, VALUE);
+VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
VALUE rb_fiber_resume(VALUE fib, int argc, const VALUE *argv);
-VALUE rb_fiber_resume_kw(VALUE fib, int argc, const VALUE *argv, int kw_splat);
VALUE rb_fiber_yield(int argc, const VALUE *argv);
-VALUE rb_fiber_yield_kw(int argc, const VALUE *argv, int kw_splat);
VALUE rb_fiber_current(void);
VALUE rb_fiber_alive_p(VALUE);
/* enum.c */
@@ -255,36 +231,18 @@ VALUE rb_enum_values_pack(int, const VALUE*);
VALUE rb_enumeratorize(VALUE, VALUE, int, const VALUE *);
typedef VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE);
VALUE rb_enumeratorize_with_size(VALUE, VALUE, int, const VALUE *, rb_enumerator_size_func *);
-VALUE rb_enumeratorize_with_size_kw(VALUE, VALUE, int, const VALUE *, rb_enumerator_size_func *, int);
#ifndef RUBY_EXPORT
#define rb_enumeratorize_with_size(obj, id, argc, argv, size_fn) \
rb_enumeratorize_with_size(obj, id, argc, argv, (rb_enumerator_size_func *)(size_fn))
-#define rb_enumeratorize_with_size_kw(obj, id, argc, argv, size_fn, kw_splat) \
- rb_enumeratorize_with_size_kw(obj, id, argc, argv, (rb_enumerator_size_func *)(size_fn), kw_splat)
#endif
#define SIZED_ENUMERATOR(obj, argc, argv, size_fn) \
rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()), \
(argc), (argv), (size_fn))
-#define SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) \
- rb_enumeratorize_with_size_kw((obj), ID2SYM(rb_frame_this_func()), \
- (argc), (argv), (size_fn), (kw_splat))
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn) do { \
if (!rb_block_given_p()) \
return SIZED_ENUMERATOR(obj, argc, argv, size_fn); \
} while (0)
-#define RETURN_SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) do { \
- if (!rb_block_given_p()) \
- return SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat); \
- } while (0)
#define RETURN_ENUMERATOR(obj, argc, argv) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0)
-#define RETURN_ENUMERATOR_KW(obj, argc, argv, kw_splat) RETURN_SIZED_ENUMERATOR_KW(obj, argc, argv, 0, kw_splat)
-typedef struct {
- VALUE begin;
- VALUE end;
- VALUE step;
- int exclude_end;
-} rb_arithmetic_sequence_components_t;
-int rb_arithmetic_sequence_extract(VALUE, rb_arithmetic_sequence_components_t *);
/* error.c */
VALUE rb_exc_new(VALUE, const char*, long);
VALUE rb_exc_new_cstr(VALUE, const char*);
@@ -295,8 +253,10 @@ PRINTF_ARGS(NORETURN(void rb_loaderror(const char*, ...)), 1, 2);
PRINTF_ARGS(NORETURN(void rb_loaderror_with_path(VALUE path, const char*, ...)), 2, 3);
PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3);
PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3);
-PRINTF_ARGS(NORETURN(void rb_frozen_error_raise(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);
@@ -304,12 +264,14 @@ void rb_check_frozen(VALUE);
void rb_check_trusted(VALUE);
#define rb_check_frozen_internal(obj) do { \
VALUE frozen_obj = (obj); \
- if (RB_UNLIKELY(RB_OBJ_FROZEN(frozen_obj))) { \
+ if (OBJ_FROZEN(frozen_obj)) { \
rb_error_frozen_object(frozen_obj); \
} \
} while (0)
+#define rb_check_trusted_internal(obj) ((void) 0)
#ifdef __GNUC__
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
+#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
#else
static inline void
rb_check_frozen_inline(VALUE obj)
@@ -320,31 +282,28 @@ rb_check_frozen_inline(VALUE obj)
static inline void
rb_check_trusted_inline(VALUE obj)
{
- rb_check_trusted(obj);
+ rb_check_trusted_internal(obj);
}
#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
#endif
void rb_check_copyable(VALUE obj, VALUE orig);
-#define 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);
const char *rb_sourcefile(void);
VALUE rb_check_funcall(VALUE, ID, int, const VALUE*);
-VALUE rb_check_funcall_kw(VALUE, ID, int, const VALUE*, int);
-NORETURN(MJIT_STATIC void rb_error_arity(int, int, int));
-static inline int
+NORETURN(void rb_error_arity(int, int, 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 {
@@ -384,15 +343,7 @@ void rb_fd_set(int, rb_fdset_t *);
void rb_w32_fd_copy(rb_fdset_t *, const fd_set *, int);
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
void rb_w32_fd_dup(rb_fdset_t *dst, const rb_fdset_t *src);
-static inline int
-rb_fd_select(int n, rb_fdset_t *rfds, rb_fdset_t *wfds, rb_fdset_t *efds, struct timeval *timeout)
-{
- return rb_w32_select(n,
- rfds ? rfds->fdset : NULL,
- wfds ? wfds->fdset : NULL,
- efds ? efds->fdset : NULL,
- timeout);
-}
+#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
#define rb_fd_resize(n, f) ((void)(f))
#define rb_fd_ptr(f) ((f)->fdset)
@@ -419,15 +370,28 @@ 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);
+DEPRECATED(static inline void rb_disable_super(void));
+DEPRECATED(static inline void rb_enable_super(void));
+static inline void rb_disable_super(void)
+{
+ /* obsolete - no use */
+}
+static inline void rb_enable_super(void)
+{
+ rb_warning("rb_enable_super() is obsolete");
+}
+#define rb_disable_super(klass, name) rb_disable_super()
+#define rb_enable_super(klass, name) rb_enable_super()
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
typedef VALUE (*rb_alloc_func_t)(VALUE);
void rb_define_alloc_func(VALUE, rb_alloc_func_t);
void rb_undef_alloc_func(VALUE);
rb_alloc_func_t rb_get_alloc_func(VALUE);
+DEPRECATED(void rb_clear_cache(void));
void rb_clear_constant_cache(void);
void rb_clear_method_cache_by_class(VALUE);
void rb_alias(VALUE, ID, ID);
@@ -435,15 +399,10 @@ void rb_attr(VALUE,ID,int,int,int);
int rb_method_boundp(VALUE, ID, int);
int rb_method_basic_definition_p(VALUE, ID);
VALUE rb_eval_cmd(VALUE, VALUE, int);
-VALUE rb_eval_cmd_kw(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, VALUE marker));
-#if !defined(RUBY_EXPORT) && defined(_WIN32)
-RUBY_EXTERN VALUE (*const rb_f_notimplement_)(int, const VALUE *, VALUE, VALUE marker);
-#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);
@@ -458,33 +417,27 @@ int rb_provided(const char*);
int rb_feature_provided(const char *, const char **);
void rb_provide(const char*);
VALUE rb_f_require(VALUE, VALUE);
-VALUE rb_require_safe(VALUE, int); /* Remove in 3.0 */
-VALUE rb_require_string(VALUE);
+VALUE rb_require_safe(VALUE, int);
void rb_obj_call_init(VALUE, int, const VALUE*);
-void rb_obj_call_init_kw(VALUE, int, const VALUE*, int);
VALUE rb_class_new_instance(int, const VALUE*, VALUE);
-VALUE rb_class_new_instance_kw(int, const VALUE*, VALUE, int);
VALUE rb_block_proc(void);
VALUE rb_block_lambda(void);
-VALUE rb_proc_new(rb_block_call_func_t, VALUE);
+VALUE rb_proc_new(VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE);
VALUE rb_obj_is_proc(VALUE);
VALUE rb_proc_call(VALUE, VALUE);
-VALUE rb_proc_call_kw(VALUE, VALUE, int);
VALUE rb_proc_call_with_block(VALUE, int argc, const VALUE *argv, VALUE);
-VALUE rb_proc_call_with_block_kw(VALUE, int argc, const VALUE *argv, VALUE, int);
int rb_proc_arity(VALUE);
VALUE rb_proc_lambda_p(VALUE);
VALUE rb_binding_new(void);
VALUE rb_obj_method(VALUE, VALUE);
VALUE rb_obj_is_method(VALUE);
VALUE rb_method_call(int, const VALUE*, VALUE);
-VALUE rb_method_call_kw(int, const VALUE*, VALUE, int);
VALUE rb_method_call_with_block(int, const VALUE *, VALUE, VALUE);
-VALUE rb_method_call_with_block_kw(int, const VALUE *, VALUE, VALUE, int);
int rb_mod_method_arity(VALUE, ID);
int rb_obj_method_arity(VALUE, ID);
VALUE rb_protect(VALUE (*)(VALUE), VALUE, int*);
void rb_set_end_proc(void (*)(VALUE), VALUE);
+void rb_exec_end_proc(void);
void rb_thread_schedule(void);
void rb_thread_wait_fd(int);
int rb_thread_fd_writable(int);
@@ -498,7 +451,7 @@ VALUE rb_thread_wakeup(VALUE);
VALUE rb_thread_wakeup_alive(VALUE);
VALUE rb_thread_run(VALUE);
VALUE rb_thread_kill(VALUE);
-VALUE rb_thread_create(VALUE (*)(void *), void*);
+VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
void rb_thread_wait_for(struct timeval);
VALUE rb_thread_current(void);
@@ -519,29 +472,27 @@ VALUE rb_file_expand_path(VALUE, VALUE);
VALUE rb_file_s_absolute_path(int, const VALUE *);
VALUE rb_file_absolute_path(VALUE, VALUE);
VALUE rb_file_dirname(VALUE fname);
-int rb_find_file_ext_safe(VALUE*, const char* const*, int); /* Remove in 3.0 */
-VALUE rb_find_file_safe(VALUE, int); /* Remove in 3.0 */
+int rb_find_file_ext_safe(VALUE*, const char* const*, int);
+VALUE rb_find_file_safe(VALUE, int);
int rb_find_file_ext(VALUE*, const char* const*);
VALUE rb_find_file(VALUE);
VALUE rb_file_directory_p(VALUE,VALUE);
VALUE rb_str_encode_ospath(VALUE);
int rb_is_absolute_path(const char *);
/* gc.c */
-COLDFUNC NORETURN(void rb_memerror(void));
-PUREFUNC(int rb_during_gc(void));
+NORETURN(void rb_memerror(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_tbl_no_pin(struct st_table*);
void rb_mark_set(struct st_table*);
void rb_mark_hash(struct st_table*);
-void rb_gc_update_tbl_refs(st_table *ptr);
void rb_gc_mark_maybe(VALUE);
void rb_gc_mark(VALUE);
-void rb_gc_mark_movable(VALUE);
-VALUE rb_gc_location(VALUE);
void rb_gc_force_recycle(VALUE);
void rb_gc(void);
void rb_gc_copy_finalizer(VALUE,VALUE);
+void rb_gc_finalize_deferred(void);
+void rb_gc_call_finalizer_at_exit(void);
VALUE rb_gc_enable(void);
VALUE rb_gc_disable(void);
VALUE rb_gc_start(void);
@@ -550,12 +501,10 @@ 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 rb_st_foreach_safe(struct st_table *, int (*)(st_data_t, st_data_t, st_data_t), st_data_t);
-#define st_foreach_safe rb_st_foreach_safe
+void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
VALUE rb_check_hash_type(VALUE);
-void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);
+void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
VALUE rb_hash(VALUE);
VALUE rb_hash_new(void);
VALUE rb_hash_dup(VALUE);
@@ -569,15 +518,15 @@ VALUE rb_hash_clear(VALUE);
VALUE rb_hash_delete_if(VALUE);
VALUE rb_hash_delete(VALUE,VALUE);
VALUE rb_hash_set_ifnone(VALUE hash, VALUE ifnone);
-void rb_hash_bulk_insert(long, const VALUE *, VALUE);
typedef VALUE rb_hash_update_func(VALUE newkey, VALUE oldkey, VALUE value);
VALUE rb_hash_update_by(VALUE hash1, VALUE hash2, rb_hash_update_func *func);
-struct st_table *rb_hash_tbl(VALUE, const char *file, int line);
+struct st_table *rb_hash_tbl(VALUE);
int rb_path_check(const char*);
int rb_env_path_tainted(void);
VALUE rb_env_clear(void);
VALUE rb_hash_size(VALUE);
-void rb_hash_free(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;
@@ -630,7 +579,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);
@@ -642,18 +591,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_memory_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*);
@@ -671,25 +619,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*);
@@ -741,6 +692,8 @@ VALUE rb_f_kill(int, const VALUE*);
#define posix_signal ruby_posix_signal
RETSIGTYPE (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
#endif
+void rb_trap_exit(void);
+void rb_trap_exec(void);
const char *ruby_signal_name(int);
void ruby_default_signal(int);
/* sprintf.c */
@@ -825,80 +778,96 @@ VALUE rb_str_replace(VALUE, VALUE);
VALUE rb_str_inspect(VALUE);
VALUE rb_str_dump(VALUE);
VALUE rb_str_split(VALUE, const char*);
-rb_gvar_setter_t rb_str_setter;
+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( \
+#if defined(__GNUC__) && !defined(__PCC__)
+#define rb_str_new(str, len) __extension__ ( \
+{ \
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
rb_str_new_static((str), (len)) : \
- rb_str_new((str), (len)) \
-)
-#define rb_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
+ rb_str_new((str), (len)); \
+})
+#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( \
+ rb_str_new_cstr(str); \
+})
+#define rb_usascii_str_new(str, len) __extension__ ( \
+{ \
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
rb_usascii_str_new_static((str), (len)) : \
- rb_usascii_str_new((str), (len)) \
-)
-#define rb_utf8_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
+ rb_usascii_str_new((str), (len)); \
+})
+#define rb_utf8_str_new(str, len) __extension__ ( \
+{ \
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
rb_utf8_str_new_static((str), (len)) : \
- rb_utf8_str_new((str), (len)) \
-)
-#define rb_tainted_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
+ rb_utf8_str_new((str), (len)); \
+})
+#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( \
+ rb_usascii_str_new_cstr(str); \
+})
+#define rb_utf8_str_new_cstr(str) __extension__ ( \
+{ \
(__builtin_constant_p(str)) ? \
rb_utf8_str_new_static((str), (long)strlen(str)) : \
- rb_utf8_str_new_cstr(str) \
-)
-#define rb_external_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
+ rb_utf8_str_new_cstr(str); \
+})
+#define rb_str_new_literal(str) rb_str_new_static((str), sizeof(str)-1)
+#define rb_usascii_str_new_literal(str) rb_usascii_str_new_static((str), sizeof(str)-1)
+#define rb_utf8_str_new_literal(str) rb_utf8_str_new_static((str), sizeof(str)-1)
+#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_static((str), sizeof(str)-1, (enc))
+#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
@@ -910,16 +879,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*, ...);
@@ -931,7 +890,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, ...);
@@ -952,17 +910,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 */
-struct timespec;
-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);
-struct timespec rb_time_timespec_interval(VALUE num);
-VALUE rb_time_utc_offset(VALUE time);
/* variable.c */
VALUE rb_mod_name(VALUE);
VALUE rb_class_path(VALUE);
@@ -971,19 +924,22 @@ void rb_set_class_path(VALUE, VALUE, const char*);
void rb_set_class_path_string(VALUE, VALUE, VALUE);
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);
VALUE rb_ivar_set(VALUE, ID, VALUE);
VALUE rb_ivar_defined(VALUE, ID);
-void rb_ivar_foreach(VALUE, int (*)(ID, VALUE, st_data_t), st_data_t);
+void rb_ivar_foreach(VALUE, int (*)(ANYARGS), st_data_t);
st_index_t rb_ivar_count(VALUE);
VALUE rb_attr_get(VALUE, ID);
VALUE rb_obj_instance_variables(VALUE);
@@ -1001,9 +957,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);
-#if 0 /* EXPERIMENTAL: remove if no problem */
-NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
-#endif
+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);
@@ -1014,217 +968,23 @@ VALUE rb_mod_class_variables(int, const VALUE*, VALUE);
VALUE rb_mod_remove_cvar(VALUE, VALUE);
ID rb_frame_callee(void);
-int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
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*);
-RUBY_SYMBOL_EXPORT_END
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C" { */
-extern "C++" {
-#endif
-
-#if defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P)
-# define rb_f_notimplement_p(f) __builtin_types_compatible_p(__typeof__(f),__typeof__(rb_f_notimplement))
-#else
-# define rb_f_notimplement_p(f) 0
-#endif
-
-#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) && !defined(_WIN32) && !defined(__CYGWIN__)
-#if defined(__has_attribute) && __has_attribute(transparent_union) && __has_attribute(unused) && __has_attribute(weakref) && __has_attribute(nonnull)
-#define RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,funcargs) \
- __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
-#endif
-#endif
-
-#if defined(RB_METHOD_DEFINITION_DECL_C) || defined(__cplusplus)
-#ifndef RB_METHOD_DEFINITION_DECL_C
-#define RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,funcargs) \
- static inline void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity) \
- { \
- def(RB_UNWRAP_MACRO vars,(VALUE(*)(ANYARGS))(func),arity); \
- }
-#endif
-
-#define RB_UNWRAP_MACRO(...) __VA_ARGS__
-
-#ifdef __cplusplus
-#define RB_METHOD_DEFINITION_DECL_CXX_BEGIN(def) template <int Arity> struct def##_tmpl {};
-#define RB_METHOD_DEFINITION_DECL_CXX(def,defname,decl,vars,funcargs,arity) \
- template <> struct def##_tmpl<arity> { \
- static void define(RB_UNWRAP_MACRO decl, VALUE (*func)funcargs) {::defname(RB_UNWRAP_MACRO vars, func, arity);} \
- static void define(RB_UNWRAP_MACRO decl, VALUE (*func)(...)) {::defname(RB_UNWRAP_MACRO vars, reinterpret_cast<VALUE(*)funcargs>(func), arity);} \
- };
-#else
-#define RB_METHOD_DEFINITION_DECL_CXX_BEGIN(def) /* nothing */
-#define RB_METHOD_DEFINITION_DECL_CXX(def,defname,decl,vars,funcargs,arity) /* nothing */
-#endif
-#define RB_METHOD_DEFINITION_DECL_1(def,nonnull,defname,arity,decl,vars,funcargs) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,funcargs) \
- RB_METHOD_DEFINITION_DECL_CXX(def,defname,decl,vars,funcargs,arity)
-
-#define RB_METHOD_DEFINITION_DECL(def,nonnull,decl,vars) \
-RB_METHOD_DEFINITION_DECL_CXX_BEGIN(def) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##1 ,1 ,decl,vars,(VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##2 ,2 ,decl,vars,(VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##3 ,3 ,decl,vars,(VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##4 ,4 ,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##5 ,5 ,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##6 ,6 ,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##7 ,7 ,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##8 ,8 ,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##9 ,9 ,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##10,10,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##11,11,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##12,12,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##13,13,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##14,14,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##15,15,decl,vars,(VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_M3(def,nonnull,def##m3,decl,vars) \
-RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##m2,-2,decl,vars,(VALUE,VALUE)) \
-RB_METHOD_DEFINITION_DECL_M1(def,nonnull,def##m1,decl,vars) /* END */
-#ifdef __cplusplus
-#define RB_METHOD_DEFINITION_DECL_M1(def,nonnull,defname,decl,vars) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,(int,VALUE*,VALUE)) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,(int,const VALUE*,VALUE)) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,(int,const VALUE*,VALUE,VALUE)) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,(...)) \
- template <> struct def##_tmpl<-1> { \
- static void define(RB_UNWRAP_MACRO decl, VALUE (*func)(int,VALUE*,VALUE)) {::defname(RB_UNWRAP_MACRO vars, func, -1);} \
- static void define(RB_UNWRAP_MACRO decl, VALUE (*func)(int,const VALUE*,VALUE)) {::defname(RB_UNWRAP_MACRO vars, func, -1);} \
- static void define(RB_UNWRAP_MACRO decl, VALUE (*func)(int,const VALUE*,VALUE,VALUE)) {::defname(RB_UNWRAP_MACRO vars, func, -1);} \
- static void define(RB_UNWRAP_MACRO decl, VALUE (*func)(...)) {::defname(RB_UNWRAP_MACRO vars, func, -1);} \
- };
-#define RB_METHOD_DEFINITION_DECL_M3(def,nonnull,defname,decl,vars) /* nothing */
-#else
-#define RB_METHOD_DEFINITION_DECL_M1(def,nonnull,defname,decl,vars) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,(int,union{VALUE*x;const VALUE*y;}__attribute__((__transparent_union__)),VALUE))
-#define RB_METHOD_DEFINITION_DECL_M3(def,nonnull,defname,decl,vars) \
- RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,())
-#endif
-
-#endif
-
-#ifdef RB_METHOD_DEFINITION_DECL
-
-RB_METHOD_DEFINITION_DECL(rb_define_method_id, (3), (VALUE klass, ID name), (klass, name))
-#ifdef __cplusplus
-#define rb_define_method_id(m, n, f, a) rb_define_method_id_tmpl<a>::define(m, n, f)
-#else
-#define rb_define_method_id_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_method_id15,rb_define_method_idm3)
-#define rb_define_method_id_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_method_id14,rb_define_method_id_choose_prototype15(n))
-#define rb_define_method_id_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_method_id13,rb_define_method_id_choose_prototype14(n))
-#define rb_define_method_id_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_method_id12,rb_define_method_id_choose_prototype13(n))
-#define rb_define_method_id_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_method_id11,rb_define_method_id_choose_prototype12(n))
-#define rb_define_method_id_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_method_id10,rb_define_method_id_choose_prototype11(n))
-#define rb_define_method_id_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_method_id9, rb_define_method_id_choose_prototype10(n))
-#define rb_define_method_id_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_method_id8, rb_define_method_id_choose_prototype9(n))
-#define rb_define_method_id_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_method_id7, rb_define_method_id_choose_prototype8(n))
-#define rb_define_method_id_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_method_id6, rb_define_method_id_choose_prototype7(n))
-#define rb_define_method_id_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_method_id5, rb_define_method_id_choose_prototype6(n))
-#define rb_define_method_id_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_method_id4, rb_define_method_id_choose_prototype5(n))
-#define rb_define_method_id_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_method_id3, rb_define_method_id_choose_prototype4(n))
-#define rb_define_method_id_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_method_id2, rb_define_method_id_choose_prototype3(n))
-#define rb_define_method_id_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_method_id1, rb_define_method_id_choose_prototype2(n))
-#define rb_define_method_id_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_method_id0, rb_define_method_id_choose_prototype1(n))
-#define rb_define_method_id_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_method_idm1,rb_define_method_id_choose_prototype0(n))
-#define rb_define_method_id_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_method_idm2,rb_define_method_id_choose_prototypem1(n))
-#define rb_define_method_id_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_method_idm3,rb_define_method_id_choose_prototypem2(n))
-#define rb_define_method_id(klass, mid, func, arity) rb_define_method_id_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
-#endif
-
-RB_METHOD_DEFINITION_DECL(rb_define_protected_method, (2,3), (VALUE klass, const char *name), (klass, name))
-#ifdef __cplusplus
-#define rb_define_protected_method(m, n, f, a) rb_define_protected_method_tmpl<a>::define(m, n, f)
-#else
-#define rb_define_protected_method_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_protected_method15,rb_define_protected_methodm3)
-#define rb_define_protected_method_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_protected_method14,rb_define_protected_method_choose_prototype15(n))
-#define rb_define_protected_method_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_protected_method13,rb_define_protected_method_choose_prototype14(n))
-#define rb_define_protected_method_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_protected_method12,rb_define_protected_method_choose_prototype13(n))
-#define rb_define_protected_method_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_protected_method11,rb_define_protected_method_choose_prototype12(n))
-#define rb_define_protected_method_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_protected_method10,rb_define_protected_method_choose_prototype11(n))
-#define rb_define_protected_method_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_protected_method9, rb_define_protected_method_choose_prototype10(n))
-#define rb_define_protected_method_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_protected_method8, rb_define_protected_method_choose_prototype9(n))
-#define rb_define_protected_method_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_protected_method7, rb_define_protected_method_choose_prototype8(n))
-#define rb_define_protected_method_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_protected_method6, rb_define_protected_method_choose_prototype7(n))
-#define rb_define_protected_method_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_protected_method5, rb_define_protected_method_choose_prototype6(n))
-#define rb_define_protected_method_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_protected_method4, rb_define_protected_method_choose_prototype5(n))
-#define rb_define_protected_method_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_protected_method3, rb_define_protected_method_choose_prototype4(n))
-#define rb_define_protected_method_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_protected_method2, rb_define_protected_method_choose_prototype3(n))
-#define rb_define_protected_method_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_protected_method1, rb_define_protected_method_choose_prototype2(n))
-#define rb_define_protected_method_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_protected_method0, rb_define_protected_method_choose_prototype1(n))
-#define rb_define_protected_method_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_protected_methodm1,rb_define_protected_method_choose_prototype0(n))
-#define rb_define_protected_method_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_protected_methodm2,rb_define_protected_method_choose_prototypem1(n))
-#define rb_define_protected_method_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_protected_methodm3,rb_define_protected_method_choose_prototypem2(n))
-#define rb_define_protected_method(klass, mid, func, arity) rb_define_protected_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
-#endif
+/* deprecated */
+DEPRECATED(void rb_frame_pop(void));
-RB_METHOD_DEFINITION_DECL(rb_define_private_method, (2,3), (VALUE klass, const char *name), (klass, name))
-#ifdef __cplusplus
-#define rb_define_private_method(m, n, f, a) rb_define_private_method_tmpl<a>::define(m, n, f)
-#else
-#define rb_define_private_method_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_private_method15,rb_define_private_methodm3)
-#define rb_define_private_method_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_private_method14,rb_define_private_method_choose_prototype15(n))
-#define rb_define_private_method_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_private_method13,rb_define_private_method_choose_prototype14(n))
-#define rb_define_private_method_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_private_method12,rb_define_private_method_choose_prototype13(n))
-#define rb_define_private_method_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_private_method11,rb_define_private_method_choose_prototype12(n))
-#define rb_define_private_method_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_private_method10,rb_define_private_method_choose_prototype11(n))
-#define rb_define_private_method_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_private_method9, rb_define_private_method_choose_prototype10(n))
-#define rb_define_private_method_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_private_method8, rb_define_private_method_choose_prototype9(n))
-#define rb_define_private_method_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_private_method7, rb_define_private_method_choose_prototype8(n))
-#define rb_define_private_method_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_private_method6, rb_define_private_method_choose_prototype7(n))
-#define rb_define_private_method_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_private_method5, rb_define_private_method_choose_prototype6(n))
-#define rb_define_private_method_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_private_method4, rb_define_private_method_choose_prototype5(n))
-#define rb_define_private_method_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_private_method3, rb_define_private_method_choose_prototype4(n))
-#define rb_define_private_method_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_private_method2, rb_define_private_method_choose_prototype3(n))
-#define rb_define_private_method_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_private_method1, rb_define_private_method_choose_prototype2(n))
-#define rb_define_private_method_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_private_method0, rb_define_private_method_choose_prototype1(n))
-#define rb_define_private_method_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_private_methodm1,rb_define_private_method_choose_prototype0(n))
-#define rb_define_private_method_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_private_methodm2,rb_define_private_method_choose_prototypem1(n))
-#define rb_define_private_method_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_private_methodm3,rb_define_private_method_choose_prototypem2(n))
-#define rb_define_private_method(klass, mid, func, arity) rb_define_private_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
-#endif
-
-RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
-#ifdef __cplusplus
-#define rb_define_singleton_method(m, n, f, a) rb_define_singleton_method_tmpl<a>::define(m, n, f)
-#else
-#define rb_define_singleton_method_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_singleton_method15,rb_define_singleton_methodm3)
-#define rb_define_singleton_method_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_singleton_method14,rb_define_singleton_method_choose_prototype15(n))
-#define rb_define_singleton_method_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_singleton_method13,rb_define_singleton_method_choose_prototype14(n))
-#define rb_define_singleton_method_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_singleton_method12,rb_define_singleton_method_choose_prototype13(n))
-#define rb_define_singleton_method_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_singleton_method11,rb_define_singleton_method_choose_prototype12(n))
-#define rb_define_singleton_method_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_singleton_method10,rb_define_singleton_method_choose_prototype11(n))
-#define rb_define_singleton_method_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_singleton_method9, rb_define_singleton_method_choose_prototype10(n))
-#define rb_define_singleton_method_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_singleton_method8, rb_define_singleton_method_choose_prototype9(n))
-#define rb_define_singleton_method_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_singleton_method7, rb_define_singleton_method_choose_prototype8(n))
-#define rb_define_singleton_method_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_singleton_method6, rb_define_singleton_method_choose_prototype7(n))
-#define rb_define_singleton_method_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_singleton_method5, rb_define_singleton_method_choose_prototype6(n))
-#define rb_define_singleton_method_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_singleton_method4, rb_define_singleton_method_choose_prototype5(n))
-#define rb_define_singleton_method_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_singleton_method3, rb_define_singleton_method_choose_prototype4(n))
-#define rb_define_singleton_method_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_singleton_method2, rb_define_singleton_method_choose_prototype3(n))
-#define rb_define_singleton_method_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_singleton_method1, rb_define_singleton_method_choose_prototype2(n))
-#define rb_define_singleton_method_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_singleton_method0, rb_define_singleton_method_choose_prototype1(n))
-#define rb_define_singleton_method_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_singleton_methodm1,rb_define_singleton_method_choose_prototype0(n))
-#define rb_define_singleton_method_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_singleton_methodm2,rb_define_singleton_method_choose_prototypem1(n))
-#define rb_define_singleton_method_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_singleton_methodm3,rb_define_singleton_method_choose_prototypem2(n))
-#define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
-#endif
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
#endif
-} /* extern "C++" { */
+} /* extern "C" { */
#endif
#endif /* RUBY_INTERN_H */
diff --git a/include/ruby/io.h b/include/ruby/io.h
index 152f4ef763..048090c27a 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -12,10 +12,6 @@
#ifndef RUBY_IO_H
#define RUBY_IO_H 1
-#ifdef RUBY_INTERNAL_H
-#error "Include this file before internal.h"
-#endif
-
#if defined(__cplusplus)
extern "C" {
#if 0
@@ -24,6 +20,7 @@ extern "C" {
#endif
#include <stdio.h>
+#include <errno.h>
#include "ruby/encoding.h"
#if defined(HAVE_STDIO_EXT_H)
@@ -31,7 +28,6 @@ extern "C" {
#endif
#include "ruby/config.h"
-#include <errno.h>
#if defined(HAVE_POLL)
# ifdef _AIX
# define reqevents events
@@ -101,8 +97,6 @@ typedef struct rb_io_t {
VALUE write_lock;
} rb_io_t;
-typedef struct rb_io_enc_t rb_io_enc_t;
-
#define HAVE_RB_IO_T 1
#define FMODE_READABLE 0x00000001
@@ -115,21 +109,25 @@ typedef struct rb_io_enc_t rb_io_enc_t;
#define FMODE_APPEND 0x00000040
#define FMODE_CREATE 0x00000080
/* #define FMODE_NOREVLOOKUP 0x00000100 */
-#define FMODE_EXCL 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 {\
+ [<"internal macro RB_IO_BUFFER_INIT() is used">];\
+} while (0)
+
#define MakeOpenFile(obj, fp) do {\
(fp) = rb_io_make_open_file(obj);\
} while (0)
+#define RB_IO_FPTR_NEW(fp) do {\
+ [<"internal macro RB_IO_FPTR_NEW() is used">];\
+} while (0)
+
rb_io_t *rb_io_make_open_file(VALUE obj);
FILE *rb_io_stdio_file(rb_io_t *fptr);
@@ -137,7 +135,7 @@ 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);
@@ -155,7 +153,6 @@ int rb_io_wait_writable(int);
int rb_wait_for_single_fd(int fd, int events, struct timeval *tv);
void rb_io_set_nonblock(rb_io_t *fptr);
int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p);
-void rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash, int *oflags_p, int *fmode_p, rb_io_enc_t *convconfig_p);
ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
/* compatibility for ruby 1.8 and older */
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index 03657042ce..1c414112b6 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 */
@@ -143,22 +136,20 @@ union bytesequence4_or_float {
};
#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)
-# define USE_RB_INFINITY 1
#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)
-# define USE_RB_NAN 1
-#endif
-
-#ifndef HUGE_VAL
-# define HUGE_VAL ((double)INFINITY)
#endif
#ifndef isinf
@@ -168,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
@@ -178,11 +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
@@ -193,10 +178,6 @@ RUBY_EXTERN int isnan(double);
# endif
#endif
-#ifndef HAVE_NAN
-RUBY_EXTERN double nan(const char *);
-#endif
-
#ifndef HAVE_NEXTAFTER
RUBY_EXTERN double nextafter(double x, double y);
#endif
@@ -230,6 +211,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
@@ -259,13 +246,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 6187b37dc3..0000000000
--- a/include/ruby/onigmo.h
+++ /dev/null
@@ -1,941 +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 4
-#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])
-
-#ifdef USE_CAPTURE_HISTORY
-typedef struct OnigCaptureTreeNodeStruct {
- int group; /* group number */
- OnigPosition beg;
- OnigPosition end;
- int allocated;
- int num_childs;
- struct OnigCaptureTreeNodeStruct** childs;
-} OnigCaptureTreeNode;
-#endif
-
-/* match result region type */
-struct re_registers {
- int allocated;
- int num_regs;
- OnigPosition* beg;
- OnigPosition* end;
-#ifdef USE_CAPTURE_HISTORY
- /* extended */
- OnigCaptureTreeNode* history_root; /* capture history tree root */
-#endif
-};
-
-/* 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);
-#ifdef USE_CAPTURE_HISTORY
-ONIG_EXTERN
-OnigCaptureTreeNode* onig_get_capture_tree(OnigRegion* region);
-#endif
-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 7102c7ace4..166f254aa5 100644
--- a/include/ruby/re.h
+++ b/include/ruby/re.h
@@ -36,8 +36,9 @@ struct rmatch_offset {
struct rmatch {
struct re_registers regs;
- struct rmatch_offset *char_offset;
+ int char_offset_updated;
int char_offset_num_allocated;
+ struct rmatch_offset *char_offset;
};
struct RMatch {
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 9b7c9842f8..6e430da179 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -26,41 +26,34 @@ extern "C" {
#include RUBY_EXTCONF_H
#endif
-#include "defines.h"
-#include "ruby/assert.h"
-
-/* For MinGW, we need __declspec(dllimport) for RUBY_EXTERN on MJIT.
- mswin's RUBY_EXTERN already has that. See also: win32/Makefile.sub */
-#if defined(MJIT_HEADER) && defined(_WIN32) && defined(__GNUC__)
-# undef RUBY_EXTERN
-# define RUBY_EXTERN extern __declspec(dllimport)
-#endif
-
#if defined(__cplusplus)
/* __builtin_choose_expr and __builtin_types_compatible aren't available
* on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */
# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
# undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P
-#elif GCC_VERSION_BEFORE(4,8,6) /* Bug #14221 */
-# undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P
#endif
-#ifndef ASSUME
-# ifdef UNREACHABLE
-# define ASSUME(x) (RB_LIKELY(!!(x)) ? (void)0 : UNREACHABLE)
-# else
-# define ASSUME(x) ((void)(x))
-# endif
+#include "defines.h"
+
+#define NORETURN_STYLE_NEW 1
+#ifndef NORETURN
+# define NORETURN(x) x
#endif
-#ifndef UNREACHABLE_RETURN
-# ifdef UNREACHABLE
-# define UNREACHABLE_RETURN(val) UNREACHABLE
-# else
-# define UNREACHABLE_RETURN(val) return (val)
-# 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
+
+#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
#define RUBY_MACRO_SELECT(base, n) TOKEN_PASTE(base, n)
@@ -75,9 +68,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>
@@ -128,26 +123,12 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#ifndef PRI_LONG_PREFIX
#define PRI_LONG_PREFIX "l"
#endif
-#ifndef PRI_SHORT_PREFIX
-#define PRI_SHORT_PREFIX "h"
-#endif
-#ifndef PRI_64_PREFIX
#if SIZEOF_LONG == 8
#define PRI_64_PREFIX PRI_LONG_PREFIX
#elif SIZEOF_LONG_LONG == 8
#define PRI_64_PREFIX PRI_LL_PREFIX
#endif
-#endif
-
-#ifndef PRIdPTR
-#define PRIdPTR PRI_PTR_PREFIX"d"
-#define PRIiPTR PRI_PTR_PREFIX"i"
-#define PRIoPTR PRI_PTR_PREFIX"o"
-#define PRIuPTR PRI_PTR_PREFIX"u"
-#define PRIxPTR PRI_PTR_PREFIX"x"
-#define PRIXPTR PRI_PTR_PREFIX"X"
-#endif
#define RUBY_PRI_VALUE_MARK "\v"
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
@@ -254,20 +235,16 @@ 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)
-VALUE rb_int2inum(intptr_t);
+#define INT2FIX(i) (((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)
-VALUE rb_uint2inum(uintptr_t);
+VALUE rb_uint2inum(VALUE);
#define rb_uint_new(v) rb_uint2inum(v)
@@ -375,44 +352,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
@@ -423,11 +378,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
@@ -460,14 +414,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
@@ -476,10 +426,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))
@@ -507,13 +455,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_MOVED = 0x1e,
+ RUBY_T_UNDEF = 0x1b,
+ RUBY_T_NODE = 0x1c,
+ RUBY_T_ICLASS = 0x1d,
+ RUBY_T_ZOMBIE = 0x1e,
RUBY_T_MASK = 0x1f
};
@@ -540,50 +486,49 @@ enum ruby_value_type {
#define T_SYMBOL RUBY_T_SYMBOL
#define T_RATIONAL RUBY_T_RATIONAL
#define T_COMPLEX RUBY_T_COMPLEX
-#define T_IMEMO RUBY_T_IMEMO
#define T_UNDEF RUBY_T_UNDEF
#define T_NODE RUBY_T_NODE
#define T_ZOMBIE RUBY_T_ZOMBIE
-#define T_MOVED RUBY_T_MOVED
#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_FLOAT_TYPE_P(obj) (FLONUM_P(obj) || (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == 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)))
-
+ ((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)))
+
+/* 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))
@@ -604,18 +549,21 @@ char *rb_string_value_cstr(volatile VALUE*);
#define StringValueCStr(v) rb_string_value_cstr(&(v))
void rb_check_safe_obj(VALUE);
-#define SafeStringValue(v) StringValue(v)
-#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 StringValue() instead")));
+#define SafeStringValue(v) do {\
+ StringValue(v);\
+ rb_check_safe_obj(v);\
+} while (0)
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+void rb_check_safe_str(VALUE) __attribute__((error("rb_check_safe_str() and Check_SafeStr() are obsolete; use SafeStringValue() instead")));
# define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
#else
-# define rb_check_safe_str(x) [<"rb_check_safe_str() is obsolete; use StringValue() instead">]
-# define Check_SafeStr(v) [<"Check_SafeStr() is obsolete; use StringValue() instead">]
+# 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 {\
- StringValue(v);\
+ SafeStringValue(v);\
(v) = rb_str_export(v);\
} while (0)
VALUE rb_str_export_locale(VALUE);
@@ -624,39 +572,38 @@ VALUE rb_get_path(VALUE);
#define FilePathValue(v) (RB_GC_GUARD(v) = rb_get_path(v))
VALUE rb_get_path_no_checksafe(VALUE);
-#define FilePathStringValue(v) ((v) = rb_get_path(v))
+#define FilePathStringValue(v) ((v) = rb_get_path_no_checksafe(v))
-/* Remove in 3.0 */
-#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) \
+#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
+# define RUBY_SAFE_LEVEL_CHECK(level, type) \
+ __extension__(__builtin_choose_expr(RUBY_SAFE_LEVEL_INVALID_P(level), ruby_safe_level_4_##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))
+#endif
+#define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level, warning))
+#define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error))
#endif
void rb_set_safe_level_force(int);
void rb_secure_update(VALUE);
@@ -670,72 +617,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);
@@ -743,15 +681,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)
@@ -773,19 +709,24 @@ rb_num2ll_inline(VALUE x)
double rb_num2dbl(VALUE);
#define NUM2DBL(x) rb_num2dbl((VALUE)(x))
-VALUE rb_uint2big(uintptr_t);
-VALUE rb_int2big(intptr_t);
+VALUE rb_uint2big(VALUE);
+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
@@ -835,101 +776,33 @@ 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_SEEN_OBJ_ID = (1<<9),
- 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 RUBY_ALIGNAS(SIZEOF_VALUE) RBasic {
+struct RBasic {
VALUE flags;
const VALUE klass;
-};
+}
+#ifdef __GNUC__
+ __attribute__((aligned(sizeof(VALUE))))
+#endif
+;
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 RVALUE_EMBED_LEN_MAX RVALUE_EMBED_LEN_MAX
-enum ruby_rvalue_flags {
- RVALUE_EMBED_LEN_MAX = 3,
-};
-
-#define ROBJECT_EMBED_LEN_MAX ROBJECT_EMBED_LEN_MAX
-#define ROBJECT_EMBED ROBJECT_EMBED
-enum ruby_robject_flags {
- ROBJECT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX,
- 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 : \
@@ -943,48 +816,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)*RVALUE_EMBED_LEN_MAX)/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 {
@@ -999,6 +858,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))
@@ -1020,31 +883,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))
-#ifndef USE_TRANSIENT_HEAP
-#define USE_TRANSIENT_HEAP 1
-#endif
-
-enum ruby_rarray_flags {
- RARRAY_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX,
- 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),
-
-#if USE_TRANSIENT_HEAP
- RARRAY_TRANSIENT_FLAG = RUBY_FL_USER13,
-#define RARRAY_TRANSIENT_FLAG RARRAY_TRANSIENT_FLAG
-#else
-#define RARRAY_TRANSIENT_FLAG 0
-#endif
-
- 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 {
@@ -1052,44 +891,32 @@ struct RArray {
long len;
union {
long capa;
-#if defined(__clang__) /* <- clang++ is sane */ || \
- !defined(__cplusplus) /* <- C99 is sane */ || \
- (__cplusplus > 199711L) /* <- C++11 is sane */
- const
-#endif
- VALUE shared_root;
+ VALUE shared;
} aux;
const VALUE *ptr;
} heap;
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_TRANSIENT(a) rb_array_const_ptr_transient(a)
-#if USE_TRANSIENT_HEAP
-#define RARRAY_TRANSIENT_P(ary) FL_TEST_RAW((ary), RARRAY_TRANSIENT_FLAG)
-#else
-#define RARRAY_TRANSIENT_P(ary) 0
-#endif
+#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_TRANSIENT(a) rb_array_ptr_use_start(a, 1)
-#define RARRAY_PTR_USE_END_TRANSIENT(a) rb_array_ptr_use_end(a, 1)
-
-#define RARRAY_PTR_USE_TRANSIENT(ary, ptr_name, expr) do { \
- const VALUE _ary = (ary); \
- VALUE *ptr_name = (VALUE *)RARRAY_PTR_USE_START_TRANSIENT(_ary); \
- expr; \
- RARRAY_PTR_USE_END_TRANSIENT(_ary); \
-} while (0)
-
-#define RARRAY_PTR_USE_START(a) rb_array_ptr_use_start(a, 0)
-#define RARRAY_PTR_USE_END(a) rb_array_ptr_use_end(a, 0)
+#define RARRAY_PTR_USE_START(a) ((VALUE *)RARRAY_CONST_PTR(a))
+#define RARRAY_PTR_USE_END(a) /* */
#define RARRAY_PTR_USE(ary, ptr_name, expr) do { \
const VALUE _ary = (ary); \
@@ -1098,16 +925,15 @@ struct RArray {
RARRAY_PTR_USE_END(_ary); \
} while (0)
-#define RARRAY_AREF(a, i) (RARRAY_CONST_PTR_TRANSIENT(a)[i])
+#define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i])
#define RARRAY_ASET(a, i, v) do { \
const VALUE _ary = (a); \
- const VALUE _v = (v); \
- VALUE *ptr = (VALUE *)RARRAY_PTR_USE_START_TRANSIENT(_ary); \
- RB_OBJ_WRITE(_ary, &ptr[i], _v); \
- RARRAY_PTR_USE_END_TRANSIENT(_ary); \
+ VALUE *ptr = (VALUE *)RARRAY_PTR_USE_START(_ary); \
+ RB_OBJ_WRITE(_ary, &ptr[i], (v)); \
+ RARRAY_PTR_USE_END(_ary); \
} while (0)
-#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(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;
@@ -1115,19 +941,16 @@ 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)
-/* RHash is defined at internal.h */
-size_t rb_hash_size_num(VALUE hash);
-
-#define RHASH_TBL(h) rb_hash_tbl(h, __FILE__, __LINE__)
+/* RHASH_TBL allocates st_table if not available. */
+#define RHASH_TBL(h) rb_hash_tbl(h)
#define RHASH_ITER_LEV(h) rb_hash_iter_lev(h)
#define RHASH_IFNONE(h) rb_hash_ifnone(h)
-#define RHASH_SIZE(h) rb_hash_size_num(h)
+#define RHASH_SIZE(h) NUM2SIZET(rb_hash_size(h))
#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
#define RHASH_SET_IFNONE(h, ifnone) rb_hash_set_ifnone((VALUE)h, ifnone)
@@ -1136,6 +959,9 @@ struct RFile {
struct rb_io_t *fptr;
};
+#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))
+
struct RData {
struct RBasic basic;
void (*dmark)(void*);
@@ -1151,14 +977,13 @@ struct rb_data_type_struct {
void (*dmark)(void*);
void (*dfree)(void*);
size_t (*dsize)(const void *);
- void (*dcompact)(void*);
- void *reserved[1]; /* For future extension.
+ void *reserved[2]; /* For future extension.
This array *must* be filled with ZERO. */
} function;
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
@@ -1190,10 +1015,8 @@ typedef void (*RUBY_DATA_FUNC)(void*);
# 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 *);
@@ -1205,46 +1028,24 @@ 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 /* THIS FLAG DEPENDS ON Ruby version */
+#define RUBY_TYPED_PROMOTED1 FL_PROMOTED1 /* THIS FLAG DEPENDS ON Ruby version */
#define Data_Wrap_Struct(klass,mark,free,sval)\
- rb_data_object_wrap((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
-
-#define Data_Make_Struct0(result, klass, type, size, mark, free, sval) \
- VALUE result = rb_data_object_zalloc((klass), (size), \
- (RUBY_DATA_FUNC)(mark), \
- (RUBY_DATA_FUNC)(free)); \
- (void)((sval) = (type *)DATA_PTR(result));
+ rb_data_object_alloc((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free))
-#ifdef __GNUC__
-#define Data_Make_Struct(klass,type,mark,free,sval) RB_GNUC_EXTENSION_BLOCK(\
- 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))
-
-#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));
+ rb_data_typed_object_alloc((klass),(sval),(data_type))
-#ifdef __GNUC__
-#define TypedData_Make_Struct(klass, type, data_type, sval) RB_GNUC_EXTENSION_BLOCK(\
- 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))
@@ -1252,18 +1053,39 @@ void *rb_check_typeddata(VALUE, const rb_data_type_t *);
#define TypedData_Get_Struct(obj,type,data_type,sval) \
((sval) = (type*)rb_check_typeddata((obj), (data_type)))
-#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))
-
-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 RMOVED(obj) (R_CAST(RMoved)(obj))
#define RBASIC(obj) (R_CAST(RBasic)(obj))
#define ROBJECT(obj) (R_CAST(RObject)(obj))
#define RCLASS(obj) (R_CAST(RClass)(obj))
@@ -1273,226 +1095,148 @@ 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_SEEN_OBJ_ID ((VALUE)RUBY_FL_SEEN_OBJ_ID)
-#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)(unsigned int)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)
-
-/* \} */
+#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_RAW(x,f) FL_TEST_RAW((x),(f))
+#define FL_ANY(x,f) FL_TEST((x),(f))
+#define FL_ALL_RAW(x,f) (FL_TEST_RAW((x),(f)) == (f))
+#define FL_ALL(x,f) (FL_TEST((x),(f)) == (f))
+#define FL_SET_RAW(x,f) (RBASIC(x)->flags |= (f))
+#define FL_SET(x,f) (FL_ABLE(x) ? FL_SET_RAW(x, f) : 0)
+#define FL_UNSET_RAW(x,f) (RBASIC(x)->flags &= ~(f))
+#define FL_UNSET(x,f) (FL_ABLE(x) ? FL_UNSET_RAW(x, f) : 0)
+#define FL_REVERSE_RAW(x,f) (RBASIC(x)->flags ^= (f))
+#define FL_REVERSE(x,f) (FL_ABLE(x) ? FL_REVERSE_RAW(x, f) : 0)
+
+#define OBJ_TAINTABLE(x) (FL_ABLE(x) && BUILTIN_TYPE(x) != T_BIGNUM && BUILTIN_TYPE(x) != T_FLOAT)
+#define OBJ_TAINTED_RAW(x) FL_TEST_RAW(x, FL_TAINT)
+#define OBJ_TAINTED(x) (!!FL_TEST((x), FL_TAINT))
+#define OBJ_TAINT_RAW(x) FL_SET_RAW(x, FL_TAINT)
+#define OBJ_TAINT(x) (OBJ_TAINTABLE(x) ? OBJ_TAINT_RAW(x) : 0)
+#define OBJ_UNTRUSTED(x) OBJ_TAINTED(x)
+#define OBJ_UNTRUST(x) OBJ_TAINT(x)
+#define OBJ_INFECT_RAW(x,s) FL_SET_RAW(x, OBJ_TAINTED_RAW(s))
+#define OBJ_INFECT(x,s) ( \
+ (OBJ_TAINTABLE(x) && FL_ABLE(s)) ? \
+ OBJ_INFECT_RAW(x, s) : 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)
void rb_freeze_singleton_class(VALUE klass);
static inline void
rb_obj_freeze_inline(VALUE x)
{
- if (RB_FL_ABLE(x)) {
- RB_OBJ_FREEZE_RAW(x);
- if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & RUBY_FL_SINGLETON)) {
+ if (FL_ABLE(x)) {
+ OBJ_FREEZE_RAW(x);
+ if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & FL_SINGLETON)) {
rb_freeze_singleton_class(x);
}
}
}
-#if GCC_VERSION_SINCE(4,4,0)
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
# define RUBY_UNTYPED_DATA_FUNC(func) func __attribute__((warning("untyped Data is unsafe; use TypedData instead")))
#else
# define RUBY_UNTYPED_DATA_FUNC(func) DEPRECATED(func)
#endif
-#if defined(__GNUC__) && !defined(__NO_INLINE__)
-#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
-RUBY_UNTYPED_DATA_FUNC(static inline VALUE rb_data_object_wrap_warning(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
-#endif
+RUBY_UNTYPED_DATA_FUNC(static inline VALUE rb_data_object_alloc_warning(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
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)
+rb_data_object_alloc_warning(VALUE klass, void *ptr, RUBY_DATA_FUNC mark, RUBY_DATA_FUNC free)
{
- return rb_data_object_wrap(klass, ptr, mark, free);
+ return rb_data_object_alloc(klass, ptr, mark, free);
}
#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P)
-#define rb_data_object_wrap_warning(klass, ptr, mark, free) \
+#define rb_data_object_alloc_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
+ rb_data_object_alloc(klass, ptr, mark, free), \
+ rb_data_object_alloc_warning(klass, ptr, mark, free)))
#endif
static inline void *
rb_data_object_get(VALUE obj)
{
- Check_Type(obj, RUBY_T_DATA);
+ Check_Type(obj, 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_alloc_0 rb_data_object_alloc
+#define rb_data_object_alloc_1 rb_data_object_alloc_warning
+#define rb_data_object_alloc RUBY_MACRO_SELECT(rb_data_object_alloc_, 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'.
@@ -1537,8 +1281,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
@@ -1555,215 +1303,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 (RB_TYPE_P(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 NUM2CHR(x) rb_num2char_inline(x)
-#define RB_CHR2FIX(x) RB_INT2FIX((long)((x)&0xff))
+#define CHR2FIX(x) INT2FIX((long)((x)&0xff))
-#define LONG2NUM(x) RB_LONG2NUM(x)
-#define ULONG2NUM(x) RB_ULONG2NUM(x)
-#define USHORT2NUM(x) RB_INT2FIX(x)
-#define NUM2CHR(x) RB_NUM2CHR(x)
-#define CHR2FIX(x) RB_CHR2FIX(x)
+#define ALLOC_N(type,n) ((type*)xmalloc2((n),sizeof(type)))
+#define ALLOC(type) ((type*)xmalloc(sizeof(type)))
+#define 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)))
-#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 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 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)
-
-#if GCC_VERSION_BEFORE(4,9,5)
-/* GCC 4.9.2 reportedly has this feature and is broken.
- * The function is not officially documented below.
- * Seems we should not use it.
- * https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Other-Builtins.html#Other-Builtins */
-# undef HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN
-#endif
-
-#if defined(HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN) && defined(RUBY_ALIGNOF)
-/* I don't know why but __builtin_alloca_with_align's second argument
- takes bits rather than bytes. */
-#define ALLOCA_N(type, n) \
- (type*)__builtin_alloca_with_align((sizeof(type)*(n)), \
- RUBY_ALIGNOF(type) * CHAR_BIT)
-#else
#define ALLOCA_N(type,n) ((type*)alloca(sizeof(type)*(n)))
-#endif
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 ? \
- ((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)) ? \
- ((v) = 0, alloca((size_t)(n) * sizeof(type))) : \
- rb_alloc_tmp_buffer2(&(v), (long)(n), sizeof(type))))
-#endif
-#define RB_ALLOCV_END(v) rb_free_tmp_buffer(&(v))
-
-#define ALLOCV(v, n) RB_ALLOCV(v, n)
-#define ALLOCV_N(type, v, n) RB_ALLOCV_N(type, v, n)
-#define ALLOCV_END(v) RB_ALLOCV_END(v)
-
-#define MEMZERO(p,type,n) memset((p), 0, sizeof(type)*(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))
-#ifdef __GLIBC__
-static inline void *
-ruby_nonempty_memcpy(void *dest, const void *src, size_t n)
-{
- /* if nothing to be copied, src may be NULL */
- return (n ? memcpy(dest, src, n) : dest);
-}
-#define memcpy(p1,p2,n) ruby_nonempty_memcpy(p1, p2, n)
+# define ALLOCV(v, n) ((n) < 1024 ? (RB_GC_GUARD(v) = 0, alloca(n)) : rb_alloc_tmp_buffer(&(v), (n)))
#endif
+#define ALLOCV_N(type, v, n) ((type*)ALLOCV((v), sizeof(type)*(n)))
+#define ALLOCV_END(v) rb_free_tmp_buffer(&(v))
-void rb_obj_infect(VALUE victim, VALUE carrier);
+#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))
+
+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);
@@ -1779,31 +1406,34 @@ void rb_include_module(VALUE,VALUE);
void rb_extend_object(VALUE,VALUE);
void rb_prepend_module(VALUE,VALUE);
-typedef VALUE rb_gvar_getter_t(ID id, VALUE *data);
-typedef void rb_gvar_setter_t(VALUE val, ID id, VALUE *data);
+struct rb_global_variable;
+
+typedef VALUE rb_gvar_getter_t(ID id, void *data, struct rb_global_variable *gvar);
+typedef void rb_gvar_setter_t(VALUE val, ID id, void *data, struct rb_global_variable *gvar);
typedef void rb_gvar_marker_t(VALUE *var);
-rb_gvar_getter_t rb_gvar_undef_getter;
-rb_gvar_setter_t rb_gvar_undef_setter;
-rb_gvar_marker_t rb_gvar_undef_marker;
+VALUE rb_gvar_undef_getter(ID id, void *data, struct rb_global_variable *gvar);
+void rb_gvar_undef_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar);
+void rb_gvar_undef_marker(VALUE *var);
-rb_gvar_getter_t rb_gvar_val_getter;
-rb_gvar_setter_t rb_gvar_val_setter;
-rb_gvar_marker_t rb_gvar_val_marker;
+VALUE rb_gvar_val_getter(ID id, void *data, struct rb_global_variable *gvar);
+void rb_gvar_val_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar);
+void rb_gvar_val_marker(VALUE *var);
-rb_gvar_getter_t rb_gvar_var_getter;
-rb_gvar_setter_t rb_gvar_var_setter;
-rb_gvar_marker_t rb_gvar_var_marker;
+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(rb_gvar_setter_t rb_gvar_readonly_setter);
+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*,rb_gvar_getter_t*,rb_gvar_setter_t*);
-void rb_define_hooked_variable(const char*,VALUE*,rb_gvar_getter_t*,rb_gvar_setter_t*);
+void rb_define_virtual_variable(const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
+void rb_define_hooked_variable(const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS));
void rb_define_readonly_variable(const char*,const VALUE*);
void rb_define_const(VALUE,const char*,VALUE);
void rb_define_global_const(const char*,VALUE);
+#define RUBY_METHOD_FUNC(func) ((VALUE (*)(ANYARGS))(func))
void rb_define_method(VALUE,const char*,VALUE(*)(ANYARGS),int);
void rb_define_module_function(VALUE,const char*,VALUE(*)(ANYARGS),int);
void rb_define_global_function(const char*,VALUE(*)(ANYARGS),int);
@@ -1828,53 +1458,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)
-#if defined(HAVE_BUILTIN___BUILTIN_CONSTANT_P) && defined(HAVE_STMT_AND_DECL_IN_EXPR)
+#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
@@ -1889,23 +1492,13 @@ VALUE rb_eval_string_protect(const char*, int*);
VALUE rb_eval_string_wrap(const char*, int*);
VALUE rb_funcall(VALUE, ID, int, ...);
VALUE rb_funcallv(VALUE, ID, int, const VALUE*);
-VALUE rb_funcallv_kw(VALUE, ID, int, const VALUE*, int);
VALUE rb_funcallv_public(VALUE, ID, int, const VALUE*);
-VALUE rb_funcallv_public_kw(VALUE, ID, int, const VALUE*, int);
#define rb_funcall2 rb_funcallv
#define rb_funcall3 rb_funcallv_public
VALUE rb_funcall_passing_block(VALUE, ID, int, const VALUE*);
-VALUE rb_funcall_passing_block_kw(VALUE, ID, int, const VALUE*, int);
VALUE rb_funcall_with_block(VALUE, ID, int, const VALUE*, VALUE);
-VALUE rb_funcall_with_block_kw(VALUE, ID, int, const VALUE*, VALUE, int);
int rb_scan_args(int, const VALUE*, const char*, ...);
-#define RB_SCAN_ARGS_PASS_CALLED_KEYWORDS 0
-#define RB_SCAN_ARGS_KEYWORDS 1
-#define RB_SCAN_ARGS_EMPTY_KEYWORDS 2 /* Will be removed in 3.0 */
-#define RB_SCAN_ARGS_LAST_HASH_KEYWORDS 3
-int rb_scan_args_kw(int, int, const VALUE*, const char*, ...);
VALUE rb_call_super(int, const VALUE*);
-VALUE rb_call_super_kw(int, const VALUE*, int);
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);
@@ -1925,20 +1518,15 @@ 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);
-COLDFUNC PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
+PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
NORETURN(void rb_bug_errno(const char*, int));
NORETURN(void rb_sys_fail(const char*));
NORETURN(void rb_sys_fail_str(VALUE));
NORETURN(void rb_mod_sys_fail(VALUE, const char*));
NORETURN(void rb_mod_sys_fail_str(VALUE, VALUE));
-NORETURN(void rb_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));
@@ -1949,47 +1537,45 @@ 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);
PRINTF_ARGS(void rb_compile_warning(const char *, int, const char*, ...), 3, 4);
PRINTF_ARGS(void rb_sys_warning(const char*, ...), 1, 2);
/* reports always */
-COLDFUNC PRINTF_ARGS(void rb_warn(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);
-#define RB_BLOCK_CALL_FUNC_STRICT 1
+/* 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
typedef VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg));
+
+#if defined RB_BLOCK_CALL_FUNC_STRICT && RB_BLOCK_CALL_FUNC_STRICT
typedef rb_block_call_func *rb_block_call_func_t;
+#else
+typedef VALUE (*rb_block_call_func_t)(ANYARGS);
+#endif
VALUE rb_each(VALUE);
VALUE rb_yield(VALUE);
VALUE rb_yield_values(int n, ...);
VALUE rb_yield_values2(int n, const VALUE *argv);
-VALUE rb_yield_values_kw(int n, const VALUE *argv, int kw_splat);
VALUE rb_yield_splat(VALUE);
-VALUE rb_yield_splat_kw(VALUE, int);
-VALUE rb_yield_block(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)); /* rb_block_call_func */
-#define RB_NO_KEYWORDS 0
-#define RB_PASS_KEYWORDS 1
-#define RB_PASS_EMPTY_KEYWORDS 2 /* Will be removed in 3.0 */
-#define RB_PASS_CALLED_KEYWORDS 3
-int rb_keyword_given_p(void);
+VALUE rb_yield_block(VALUE, VALUE, int, const VALUE *, VALUE); /* rb_block_call_func */
int rb_block_given_p(void);
void rb_need_block(void);
-VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
+VALUE rb_iterate(VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE);
VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
-VALUE rb_block_call_kw(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE,int);
-VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
-VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
-VALUE rb_vrescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,va_list);
-VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
-VALUE rb_catch(const char*,rb_block_call_func_t,VALUE);
-VALUE rb_catch_obj(VALUE,rb_block_call_func_t,VALUE);
+VALUE rb_rescue(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
+VALUE rb_rescue2(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...);
+VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
+VALUE rb_catch(const char*,VALUE(*)(ANYARGS),VALUE);
+VALUE rb_catch_obj(VALUE,VALUE(*)(ANYARGS),VALUE);
NORETURN(void rb_throw(const char*,VALUE));
NORETURN(void rb_throw_obj(VALUE,VALUE));
@@ -2009,26 +1595,21 @@ 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;
-RUBY_EXTERN VALUE rb_cData;
RUBY_EXTERN VALUE rb_cDir;
+RUBY_EXTERN VALUE rb_cData;
+RUBY_EXTERN VALUE rb_cFalseClass;
RUBY_EXTERN VALUE rb_cEncoding;
RUBY_EXTERN VALUE rb_cEnumerator;
-RUBY_EXTERN VALUE rb_cFalseClass;
RUBY_EXTERN VALUE rb_cFile;
-#ifndef RUBY_INTEGER_UNIFICATION
RUBY_EXTERN VALUE rb_cFixnum;
-#endif
-RUBY_EXTERN VALUE rb_cComplex;
RUBY_EXTERN VALUE rb_cFloat;
RUBY_EXTERN VALUE rb_cHash;
-RUBY_EXTERN VALUE rb_cIO;
RUBY_EXTERN VALUE rb_cInteger;
+RUBY_EXTERN VALUE rb_cIO;
RUBY_EXTERN VALUE rb_cMatch;
RUBY_EXTERN VALUE rb_cMethod;
RUBY_EXTERN VALUE rb_cModule;
@@ -2039,6 +1620,7 @@ RUBY_EXTERN VALUE rb_cProc;
RUBY_EXTERN VALUE rb_cRandom;
RUBY_EXTERN VALUE rb_cRange;
RUBY_EXTERN VALUE rb_cRational;
+RUBY_EXTERN VALUE rb_cComplex;
RUBY_EXTERN VALUE rb_cRegexp;
RUBY_EXTERN VALUE rb_cStat;
RUBY_EXTERN VALUE rb_cString;
@@ -2063,7 +1645,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;
@@ -2078,7 +1659,6 @@ RUBY_EXTERN VALUE rb_eSysStackError;
RUBY_EXTERN VALUE rb_eRegexpError;
RUBY_EXTERN VALUE rb_eEncodingError;
RUBY_EXTERN VALUE rb_eEncCompatError;
-RUBY_EXTERN VALUE rb_eNoMatchingPatternError;
RUBY_EXTERN VALUE rb_eScriptError;
RUBY_EXTERN VALUE rb_eNameError;
@@ -2092,15 +1672,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;
}
@@ -2108,18 +1688,18 @@ 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);
}
#ifdef __GNUC__
@@ -2132,102 +1712,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
-
-/* internal function. do not use this function */
-static inline const VALUE *
-rb_array_const_ptr_transient(VALUE a)
-{
- return FIX_CONST_VALUE_PTR((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ?
- RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr);
-}
-
-/* internal function. do not use this function */
-static inline const VALUE *
-rb_array_const_ptr(VALUE a)
-{
-#if USE_TRANSIENT_HEAP
- void rb_ary_detransient(VALUE a);
-
- if (RARRAY_TRANSIENT_P(a)) {
- rb_ary_detransient(a);
- }
-#endif
- return rb_array_const_ptr_transient(a);
-}
-
-/* internal function. do not use this function */
-static inline VALUE *
-rb_array_ptr_use_start(VALUE a, int allow_transient)
-{
- VALUE *rb_ary_ptr_use_start(VALUE ary);
-
-#if USE_TRANSIENT_HEAP
- if (!allow_transient) {
- if (RARRAY_TRANSIENT_P(a)) {
- void rb_ary_detransient(VALUE a);
- rb_ary_detransient(a);
- }
- }
-#endif
- (void)allow_transient;
-
- return rb_ary_ptr_use_start(a);
-}
-
-/* internal function. do not use this function */
-static inline void
-rb_array_ptr_use_end(VALUE a, int allow_transient)
-{
- void rb_ary_ptr_use_end(VALUE a);
- rb_ary_ptr_use_end(a);
- (void)allow_transient;
-}
-
#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
/* hook for external modules */
static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
@@ -2254,12 +1750,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_SCRIPT_COMPILED 0x2000
#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
@@ -2273,7 +1768,7 @@ 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 void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass);
@@ -2284,39 +1779,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)
-#define ISBLANK(c) rb_isblank(c)
-#define ISCNTRL(c) rb_iscntrl(c)
-#define ISPUNCT(c) rb_ispunct(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);
@@ -2331,367 +1824,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);
-/* -- Remove In 3.0, Only public for rb_scan_args optimized version -- */
-int rb_empty_keyword_given_p(void);
-
-#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) && defined(HAVE_VA_ARGS_MACRO) && 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"), void rb_scan_args_bad_format(const char*));
-ERRORFUNC(("variable argument length doesn't match"), void rb_scan_args_length_mismatch(const char*,int));
-# else
-# define rb_scan_args_bad_format(fmt) ((void)0)
-# define rb_scan_args_length_mismatch(fmt, varc) ((void)0)
-# endif
-
-# define rb_scan_args_isdigit(c) ((unsigned char)((c)-'0')<10)
-
-# define rb_scan_args_count_end(fmt, ofs, vari) \
- (fmt[ofs] ? -1 : (vari))
-
-# define rb_scan_args_count_block(fmt, ofs, vari) \
- (fmt[ofs]!='&' ? \
- rb_scan_args_count_end(fmt, ofs, vari) : \
- rb_scan_args_count_end(fmt, ofs+1, vari+1))
-
-# define rb_scan_args_count_hash(fmt, ofs, vari) \
- (fmt[ofs]!=':' ? \
- rb_scan_args_count_block(fmt, ofs, vari) : \
- rb_scan_args_count_block(fmt, ofs+1, vari+1))
-
-# define rb_scan_args_count_trail(fmt, ofs, vari) \
- (!rb_scan_args_isdigit(fmt[ofs]) ? \
- rb_scan_args_count_hash(fmt, ofs, vari) : \
- rb_scan_args_count_hash(fmt, ofs+1, vari+(fmt[ofs]-'0')))
-
-# define rb_scan_args_count_var(fmt, ofs, vari) \
- (fmt[ofs]!='*' ? \
- rb_scan_args_count_trail(fmt, ofs, vari) : \
- rb_scan_args_count_trail(fmt, ofs+1, vari+1))
-
-# define rb_scan_args_count_opt(fmt, ofs, vari) \
- (!rb_scan_args_isdigit(fmt[ofs]) ? \
- rb_scan_args_count_var(fmt, ofs, vari) : \
- rb_scan_args_count_var(fmt, ofs+1, vari+fmt[ofs]-'0'))
-
-# define rb_scan_args_count_lead(fmt, ofs, vari) \
- (!rb_scan_args_isdigit(fmt[ofs]) ? \
- rb_scan_args_count_var(fmt, ofs, vari) : \
- rb_scan_args_count_opt(fmt, ofs+1, vari+fmt[ofs]-'0'))
-
-# define rb_scan_args_count(fmt) rb_scan_args_count_lead(fmt, 0, 0)
-
-# if defined(__has_attribute) && __has_attribute(diagnose_if)
-# define rb_scan_args_verify(fmt, varc) (void)0
-# else
-# define rb_scan_args_verify(fmt, varc) \
- (sizeof(char[1-2*(rb_scan_args_count(fmt)<0)])!=1 ? \
- rb_scan_args_bad_format(fmt) : \
- sizeof(char[1-2*(rb_scan_args_count(fmt)!=(varc))])!=1 ? \
- rb_scan_args_length_mismatch(fmt, varc) : \
- (void)0)
-# 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
-
-/* NOTE: Use `char *fmt` instead of `const char *fmt` because of clang's bug*/
-/* https://bugs.llvm.org/show_bug.cgi?id=38095 */
-# 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), (char *)fmt, varc)
-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[], char *fmt, int varc));
-
-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[], RB_UNUSED_VAR(char *fmt), RB_UNUSED_VAR(int varc))
-# if defined(__has_attribute) && __has_attribute(diagnose_if)
- __attribute__((diagnose_if(rb_scan_args_count(fmt)<0,"bad scan arg format","error")))
- __attribute__((diagnose_if(rb_scan_args_count(fmt)!=varc,"variable argument length doesn't match","error")))
-# endif
-{
- int i, argi = 0, vari = 0, last_idx = -1;
- VALUE *var, hash = Qnil, last_hash = 0;
- const int n_mand = n_lead + n_trail;
- int keyword_given = rb_keyword_given_p();
- int empty_keyword_given = 0;
- VALUE tmp_buffer = 0;
-
- if (!keyword_given) {
- empty_keyword_given = rb_empty_keyword_given_p();
- }
-
- /* capture an option hash - phase 1: pop */
- /* Ignore final positional hash if empty keywords given */
- if (argc > 0 && !(f_hash && empty_keyword_given)) {
- VALUE last = argv[argc - 1];
-
- if (f_hash && n_mand < argc) {
- if (keyword_given) {
- if (!RB_TYPE_P(last, T_HASH)) {
- rb_warn("Keyword flag set when calling rb_scan_args, but last entry is not a hash");
- }
- else {
- hash = last;
- }
- }
- else if (NIL_P(last)) {
- /* For backwards compatibility, 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.
- This will be removed in Ruby 3. */
- if (!f_var && n_mand + n_opt < argc) {
- rb_warn("The last argument is nil, treating as empty keywords");
- argc--;
- }
- }
- else {
- hash = rb_check_hash_type(last);
- }
-
- /* Ruby 3: Remove if branch, as it will not attempt to split hashes */
- if (!NIL_P(hash)) {
- VALUE opts = rb_extract_keywords(&hash);
-
- if (!(last_hash = hash)) {
- if (!keyword_given) {
- /* Warn if treating positional as keyword, as in Ruby 3,
- this will be an error */
- rb_warn("Using the last argument as keyword parameters is deprecated");
- }
- argc--;
- }
- else {
- /* Warn if splitting either positional hash to keywords or keywords
- to positional hash, as in Ruby 3, no splitting will be done */
- rb_warn("The last argument is split into positional and keyword parameters");
- last_idx = argc - 1;
- }
- hash = opts ? opts : Qnil;
- }
- }
- else if (f_hash && keyword_given && n_mand == argc) {
- /* Warn if treating keywords as positional, as in Ruby 3, this will be an error */
- rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
- }
- }
- if (f_hash && n_mand > 0 && n_mand == argc+1 && empty_keyword_given) {
- VALUE *ptr = (VALUE *)rb_alloc_tmp_buffer2(&tmp_buffer, argc+1, sizeof(VALUE));
- memcpy(ptr, argv, sizeof(VALUE)*argc);
- ptr[argc] = rb_hash_new();
- argc++;
- *(&argv) = ptr;
- rb_warn("Passing the keyword argument as the last hash parameter is deprecated");
- }
-
-
- if (argc < n_mand) {
- goto argc_error;
- }
-
- /* 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;
- }
- }
-
- if (argi < argc) {
- argc_error:
- if (tmp_buffer) rb_free_tmp_buffer(&tmp_buffer);
- rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
- }
-
- if (tmp_buffer) rb_free_tmp_buffer(&tmp_buffer);
- return argc;
-}
-#endif
-
-#if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO) && 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
@@ -2730,7 +1862,13 @@ void ruby_show_copyright(void);
ruby_init_stack(&variable_in_this_stack_frame);
/*! @} */
+#ifdef __ia64
+void ruby_init_stack(volatile VALUE*, void*);
+#define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
+#else
void ruby_init_stack(volatile VALUE*);
+#endif
+#define Init_stack(addr) ruby_init_stack(addr)
int ruby_setup(void);
int ruby_cleanup(volatile int);
@@ -2756,10 +1894,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)
@@ -2767,105 +1901,5 @@ RUBY_SYMBOL_EXPORT_END
{ /* satisfy cc-mode */
#endif
} /* extern "C" { */
-extern "C++" {
#endif
-
-#ifdef RB_METHOD_DEFINITION_DECL
-
-RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
-#ifdef __cplusplus
-#define rb_define_method(m, n, f, a) rb_define_method_tmpl<a>::define(m, n, f)
-#else
-#define rb_define_method_if_constexpr(x, t, f) __builtin_choose_expr(__builtin_choose_expr(__builtin_constant_p(x),(x),0),(t),(f))
-#define rb_define_method_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_method15,rb_define_methodm3)
-#define rb_define_method_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_method14,rb_define_method_choose_prototype15(n))
-#define rb_define_method_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_method13,rb_define_method_choose_prototype14(n))
-#define rb_define_method_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_method12,rb_define_method_choose_prototype13(n))
-#define rb_define_method_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_method11,rb_define_method_choose_prototype12(n))
-#define rb_define_method_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_method10,rb_define_method_choose_prototype11(n))
-#define rb_define_method_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_method9, rb_define_method_choose_prototype10(n))
-#define rb_define_method_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_method8, rb_define_method_choose_prototype9(n))
-#define rb_define_method_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_method7, rb_define_method_choose_prototype8(n))
-#define rb_define_method_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_method6, rb_define_method_choose_prototype7(n))
-#define rb_define_method_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_method5, rb_define_method_choose_prototype6(n))
-#define rb_define_method_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_method4, rb_define_method_choose_prototype5(n))
-#define rb_define_method_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_method3, rb_define_method_choose_prototype4(n))
-#define rb_define_method_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_method2, rb_define_method_choose_prototype3(n))
-#define rb_define_method_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_method1, rb_define_method_choose_prototype2(n))
-#define rb_define_method_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_method0, rb_define_method_choose_prototype1(n))
-#define rb_define_method_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_methodm1,rb_define_method_choose_prototype0(n))
-#define rb_define_method_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_methodm2,rb_define_method_choose_prototypem1(n))
-#define rb_define_method_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_methodm3,rb_define_method_choose_prototypem2(n))
-#define rb_define_method(klass, mid, func, arity) rb_define_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
-#endif
-
-RB_METHOD_DEFINITION_DECL(rb_define_module_function, (2,3), (VALUE klass, const char *name), (klass, name))
-#ifdef __cplusplus
-#define rb_define_module_function(m, n, f, a) rb_define_module_function_tmpl<a>::define(m, n, f)
-#else
-#define rb_define_module_function_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_module_function15,rb_define_module_functionm3)
-#define rb_define_module_function_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_module_function14,rb_define_module_function_choose_prototype15(n))
-#define rb_define_module_function_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_module_function13,rb_define_module_function_choose_prototype14(n))
-#define rb_define_module_function_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_module_function12,rb_define_module_function_choose_prototype13(n))
-#define rb_define_module_function_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_module_function11,rb_define_module_function_choose_prototype12(n))
-#define rb_define_module_function_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_module_function10,rb_define_module_function_choose_prototype11(n))
-#define rb_define_module_function_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_module_function9, rb_define_module_function_choose_prototype10(n))
-#define rb_define_module_function_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_module_function8, rb_define_module_function_choose_prototype9(n))
-#define rb_define_module_function_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_module_function7, rb_define_module_function_choose_prototype8(n))
-#define rb_define_module_function_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_module_function6, rb_define_module_function_choose_prototype7(n))
-#define rb_define_module_function_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_module_function5, rb_define_module_function_choose_prototype6(n))
-#define rb_define_module_function_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_module_function4, rb_define_module_function_choose_prototype5(n))
-#define rb_define_module_function_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_module_function3, rb_define_module_function_choose_prototype4(n))
-#define rb_define_module_function_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_module_function2, rb_define_module_function_choose_prototype3(n))
-#define rb_define_module_function_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_module_function1, rb_define_module_function_choose_prototype2(n))
-#define rb_define_module_function_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_module_function0, rb_define_module_function_choose_prototype1(n))
-#define rb_define_module_function_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_module_functionm1,rb_define_module_function_choose_prototype0(n))
-#define rb_define_module_function_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_module_functionm2,rb_define_module_function_choose_prototypem1(n))
-#define rb_define_module_function_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_module_functionm3,rb_define_module_function_choose_prototypem2(n))
-#define rb_define_module_function(klass, mid, func, arity) rb_define_module_function_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
-#endif
-
-RB_METHOD_DEFINITION_DECL(rb_define_global_function, (1,2), (const char *name), (name))
-#ifdef __cplusplus
-#define rb_define_global_function(n, f, a) rb_define_global_function_tmpl<a>::define(n, f)
-#else
-#define rb_define_global_function_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_global_function15,rb_define_global_functionm3)
-#define rb_define_global_function_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_global_function14,rb_define_global_function_choose_prototype15(n))
-#define rb_define_global_function_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_global_function13,rb_define_global_function_choose_prototype14(n))
-#define rb_define_global_function_choose_prototype12(n) rb_define_method_if_constexpr((n)==12,rb_define_global_function12,rb_define_global_function_choose_prototype13(n))
-#define rb_define_global_function_choose_prototype11(n) rb_define_method_if_constexpr((n)==11,rb_define_global_function11,rb_define_global_function_choose_prototype12(n))
-#define rb_define_global_function_choose_prototype10(n) rb_define_method_if_constexpr((n)==10,rb_define_global_function10,rb_define_global_function_choose_prototype11(n))
-#define rb_define_global_function_choose_prototype9(n) rb_define_method_if_constexpr((n)== 9,rb_define_global_function9, rb_define_global_function_choose_prototype10(n))
-#define rb_define_global_function_choose_prototype8(n) rb_define_method_if_constexpr((n)== 8,rb_define_global_function8, rb_define_global_function_choose_prototype9(n))
-#define rb_define_global_function_choose_prototype7(n) rb_define_method_if_constexpr((n)== 7,rb_define_global_function7, rb_define_global_function_choose_prototype8(n))
-#define rb_define_global_function_choose_prototype6(n) rb_define_method_if_constexpr((n)== 6,rb_define_global_function6, rb_define_global_function_choose_prototype7(n))
-#define rb_define_global_function_choose_prototype5(n) rb_define_method_if_constexpr((n)== 5,rb_define_global_function5, rb_define_global_function_choose_prototype6(n))
-#define rb_define_global_function_choose_prototype4(n) rb_define_method_if_constexpr((n)== 4,rb_define_global_function4, rb_define_global_function_choose_prototype5(n))
-#define rb_define_global_function_choose_prototype3(n) rb_define_method_if_constexpr((n)== 3,rb_define_global_function3, rb_define_global_function_choose_prototype4(n))
-#define rb_define_global_function_choose_prototype2(n) rb_define_method_if_constexpr((n)== 2,rb_define_global_function2, rb_define_global_function_choose_prototype3(n))
-#define rb_define_global_function_choose_prototype1(n) rb_define_method_if_constexpr((n)== 1,rb_define_global_function1, rb_define_global_function_choose_prototype2(n))
-#define rb_define_global_function_choose_prototype0(n) rb_define_method_if_constexpr((n)== 0,rb_define_global_function0, rb_define_global_function_choose_prototype1(n))
-#define rb_define_global_function_choose_prototypem1(n) rb_define_method_if_constexpr((n)==-1,rb_define_global_functionm1,rb_define_global_function_choose_prototype0(n))
-#define rb_define_global_function_choose_prototypem2(n) rb_define_method_if_constexpr((n)==-2,rb_define_global_functionm2,rb_define_global_function_choose_prototypem1(n))
-#define rb_define_global_function_choose_prototypem3(n, f) rb_define_method_if_constexpr(rb_f_notimplement_p(f),rb_define_global_functionm3,rb_define_global_function_choose_prototypem2(n))
-#define rb_define_global_function(mid, func, arity) rb_define_global_function_choose_prototypem3((arity),(func))((mid),(func),(arity));
-#endif
-
-#endif
-
-#if defined(RUBY_DEVEL) && RUBY_DEVEL && (!defined(__cplusplus) || defined(RB_METHOD_DEFINITION_DECL))
-# define RUBY_METHOD_FUNC(func) (func)
-#else
-# define RUBY_METHOD_FUNC(func) ((VALUE (*)(ANYARGS))(func))
-#endif
-
-#ifdef __cplusplus
-#include "backward/cxxanyargs.hpp"
-
-#if 0
-{ /* satisfy cc-mode */
-#endif
-} /* extern "C++" { */
-#endif
-
#endif /* RUBY_RUBY_H */
diff --git a/include/ruby/st.h b/include/ruby/st.h
index ea1637bd9f..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);
@@ -59,11 +53,11 @@ typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index
#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP
struct st_hash_type {
- int (*compare)(st_data_t, st_data_t); /* st_compare_func* */
- st_index_t (*hash)(st_data_t); /* st_hash_func* */
+ int (*compare)(ANYARGS /*st_data_t, st_data_t*/); /* st_compare_func* */
+ 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,119 +66,85 @@ 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)
-enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK, ST_REPLACE};
-
-st_table *rb_st_init_table(const struct st_hash_type *);
-#define st_init_table rb_st_init_table
-st_table *rb_st_init_table_with_size(const struct st_hash_type *, st_index_t);
-#define st_init_table_with_size rb_st_init_table_with_size
-st_table *rb_st_init_numtable(void);
-#define st_init_numtable rb_st_init_numtable
-st_table *rb_st_init_numtable_with_size(st_index_t);
-#define st_init_numtable_with_size rb_st_init_numtable_with_size
-st_table *rb_st_init_strtable(void);
-#define st_init_strtable rb_st_init_strtable
-st_table *rb_st_init_strtable_with_size(st_index_t);
-#define st_init_strtable_with_size rb_st_init_strtable_with_size
-st_table *rb_st_init_strcasetable(void);
-#define st_init_strcasetable rb_st_init_strcasetable
-st_table *rb_st_init_strcasetable_with_size(st_index_t);
-#define st_init_strcasetable_with_size rb_st_init_strcasetable_with_size
-int rb_st_delete(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
-#define st_delete rb_st_delete
-int rb_st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
-#define st_delete_safe rb_st_delete_safe
-int rb_st_shift(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
-#define st_shift rb_st_shift
-int rb_st_insert(st_table *, st_data_t, st_data_t);
-#define st_insert rb_st_insert
-int rb_st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
-#define st_insert2 rb_st_insert2
-int rb_st_lookup(st_table *, st_data_t, st_data_t *);
-#define st_lookup rb_st_lookup
-int rb_st_get_key(st_table *, st_data_t, st_data_t *);
-#define st_get_key rb_st_get_key
+enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE, ST_CHECK};
+
+st_table *st_init_table(const struct st_hash_type *);
+st_table *st_init_table_with_size(const struct st_hash_type *, st_index_t);
+st_table *st_init_numtable(void);
+st_table *st_init_numtable_with_size(st_index_t);
+st_table *st_init_strtable(void);
+st_table *st_init_strtable_with_size(st_index_t);
+st_table *st_init_strcasetable(void);
+st_table *st_init_strcasetable_with_size(st_index_t);
+int st_delete(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
+int st_delete_safe(st_table *, st_data_t *, st_data_t *, st_data_t);
+int st_shift(st_table *, st_data_t *, st_data_t *); /* returns 0:notfound 1:deleted */
+int st_insert(st_table *, st_data_t, st_data_t);
+int st_insert2(st_table *, st_data_t, st_data_t, st_data_t (*)(st_data_t));
+int st_lookup(st_table *, st_data_t, st_data_t *);
+int st_get_key(st_table *, st_data_t, st_data_t *);
typedef int st_update_callback_func(st_data_t *key, st_data_t *value, st_data_t arg, int existing);
/* *key may be altered, but must equal to the old key, i.e., the
* results of hash() are same and compare() returns 0, otherwise the
* behavior is undefined */
-int rb_st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg);
-#define st_update rb_st_update
-typedef int st_foreach_callback_func(st_data_t, st_data_t, st_data_t);
-typedef int st_foreach_check_callback_func(st_data_t, st_data_t, st_data_t, int);
-int rb_st_foreach_with_replace(st_table *tab, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
-#define st_foreach_with_replace rb_st_foreach_with_replace
-int rb_st_foreach(st_table *, st_foreach_callback_func *, st_data_t);
-#define st_foreach rb_st_foreach
-int rb_st_foreach_check(st_table *, st_foreach_check_callback_func *, st_data_t, st_data_t);
-#define st_foreach_check rb_st_foreach_check
-st_index_t rb_st_keys(st_table *table, st_data_t *keys, st_index_t size);
-#define st_keys rb_st_keys
-st_index_t rb_st_keys_check(st_table *table, st_data_t *keys, st_index_t size, st_data_t never);
-#define st_keys_check rb_st_keys_check
-st_index_t rb_st_values(st_table *table, st_data_t *values, st_index_t size);
-#define st_values rb_st_values
-st_index_t rb_st_values_check(st_table *table, st_data_t *values, st_index_t size, st_data_t never);
-#define st_values_check rb_st_values_check
-void rb_st_add_direct(st_table *, st_data_t, st_data_t);
-#define st_add_direct rb_st_add_direct
-void rb_st_free_table(st_table *);
-#define st_free_table rb_st_free_table
-void rb_st_cleanup_safe(st_table *, st_data_t);
-#define st_cleanup_safe rb_st_cleanup_safe
-void rb_st_clear(st_table *);
-#define st_clear rb_st_clear
-st_table *rb_st_copy(st_table *);
-#define st_copy rb_st_copy
-CONSTFUNC(int rb_st_numcmp(st_data_t, st_data_t));
-#define st_numcmp rb_st_numcmp
-CONSTFUNC(st_index_t rb_st_numhash(st_data_t));
-#define st_numhash rb_st_numhash
-PUREFUNC(int rb_st_locale_insensitive_strcasecmp(const char *s1, const char *s2));
-#define st_locale_insensitive_strcasecmp rb_st_locale_insensitive_strcasecmp
-PUREFUNC(int rb_st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n));
-#define st_locale_insensitive_strncasecmp rb_st_locale_insensitive_strncasecmp
-#define st_strcasecmp rb_st_locale_insensitive_strcasecmp
-#define st_strncasecmp rb_st_locale_insensitive_strncasecmp
-PUREFUNC(size_t rb_st_memsize(const st_table *));
-#define st_memsize rb_st_memsize
-PUREFUNC(st_index_t rb_st_hash(const void *ptr, size_t len, st_index_t h));
-#define st_hash rb_st_hash
-CONSTFUNC(st_index_t rb_st_hash_uint32(st_index_t h, uint32_t i));
-#define st_hash_uint32 rb_st_hash_uint32
-CONSTFUNC(st_index_t rb_st_hash_uint(st_index_t h, st_index_t i));
-#define st_hash_uint rb_st_hash_uint
-CONSTFUNC(st_index_t rb_st_hash_end(st_index_t h));
-#define st_hash_end rb_st_hash_end
-CONSTFUNC(st_index_t rb_st_hash_start(st_index_t h));
+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);
+st_index_t st_values_check(st_table *table, st_data_t *values, st_index_t size, st_data_t never);
+void st_add_direct(st_table *, st_data_t, st_data_t);
+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 *);
+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
+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))
-void rb_hash_bulk_insert_into_st_table(long, const VALUE *, VALUE);
-
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/include/ruby/thread.h b/include/ruby/thread.h
index d398cc127e..550f678e54 100644
--- a/include/ruby/thread.h
+++ b/include/ruby/thread.h
@@ -21,10 +21,6 @@ extern "C" {
#include "ruby/intern.h"
-/* flags for rb_nogvl */
-#define RB_NOGVL_INTR_FAIL (0x1)
-#define RB_NOGVL_UBF_ASYNC_SAFE (0x2)
-
RUBY_SYMBOL_EXPORT_BEGIN
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
@@ -34,14 +30,6 @@ void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
rb_unblock_function_t *ubf, void *data2);
-/*
- * XXX: unstable/unapproved - out-of-tree code should NOT not depend
- * on this until it hits Ruby 2.6.1
- */
-void *rb_nogvl(void *(*func)(void *), void *data1,
- rb_unblock_function_t *ubf, void *data2,
- int flags);
-
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
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 64c5c614e0..dbfecefb95 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -13,7 +13,7 @@
/*
* This file contains only
- * - never-changeable information, and
+ * - never-changeable informations, and
* - interfaces accessible from extension libraries.
*
* Never try to check RUBY_VERSION_CODE etc in extension libraries,
@@ -31,7 +31,7 @@
/* API version */
#define RUBY_API_VERSION_MAJOR 2
-#define RUBY_API_VERSION_MINOR 7
+#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/vm.h b/include/ruby/vm.h
index b137a280c9..73345264bd 100644
--- a/include/ruby/vm.h
+++ b/include/ruby/vm.h
@@ -24,7 +24,8 @@ RUBY_SYMBOL_EXPORT_BEGIN
/* Place holder.
*
* We will prepare VM creation/control APIs on 1.9.2 or later.
- *
+ * If you have an interest about it, please see mvm branch.
+ * http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/mvm/
*/
/* VM type declaration */
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index b29470b0c4..89de30de72 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,26 +124,33 @@ 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) rb_w32_lseek(_f, _o, _w)
+#define lseek(_f, _o, _w) _lseeki64(_f, _o, _w)
#define pipe(p) rb_w32_pipe(p)
#define open rb_w32_open
@@ -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 *);
@@ -330,7 +330,9 @@ 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 +341,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 +396,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,8 +439,6 @@ __declspec(dllimport) extern int finite(double);
#define S_IXOTH 0001
#endif
-#define S_IFLNK 0xa000
-
/*
* define this so we can do inplace editing
*/
@@ -463,6 +481,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 +620,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 +764,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, ...);
@@ -751,13 +774,8 @@ int rb_w32_fclose(FILE*);
int rb_w32_pipe(int[2]);
ssize_t rb_w32_read(int, void *, size_t);
ssize_t rb_w32_write(int, const void *, size_t);
-off_t rb_w32_lseek(int, off_t, int);
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);
@@ -779,8 +797,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__ ({\
@@ -798,6 +815,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.
@@ -807,19 +831,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 79a6cf014e..12b2d526a9 100644
--- a/inits.c
+++ b/inits.c
@@ -10,21 +10,14 @@
**********************************************************************/
#include "internal.h"
-#include "builtin.h"
-#include "prelude.rbinc"
#define CALL(n) {void Init_##n(void); Init_##n();}
void
rb_call_inits(void)
{
-#if USE_TRANSIENT_HEAP
- CALL(TransientHeap);
-#endif
- CALL(vm_postponed_job);
CALL(Method);
- CALL(RandomSeedCore);
- CALL(encodings);
+ CALL(RandomSeed);
CALL(sym);
CALL(var_tables);
CALL(Object);
@@ -44,6 +37,7 @@ rb_call_inits(void)
CALL(Hash);
CALL(Struct);
CALL(Regexp);
+ CALL(pack);
CALL(transcode);
CALL(marshal);
CALL(Range);
@@ -56,6 +50,7 @@ rb_call_inits(void)
CALL(Proc);
CALL(Binding);
CALL(Math);
+ CALL(GC);
CALL(Enumerator);
CALL(VM);
CALL(ISeq);
@@ -65,18 +60,6 @@ rb_call_inits(void)
CALL(Rational);
CALL(Complex);
CALL(version);
- CALL(vm_stack_canary);
- CALL(gc_stress);
-
- // enable builtin loading
- CALL(builtin);
-
- CALL(GC);
- CALL(IO_nonblock);
- CALL(ast);
CALL(vm_trace);
- CALL(pack);
- CALL(warning);
- load_prelude();
}
#undef CALL
diff --git a/insns.def b/insns.def
index bd1bffbe02..834f3dd691 100644
--- a/insns.def
+++ b/insns.def
@@ -1,62 +1,36 @@
-/* -*- C -*-
+/** ##skip -*- mode:c; style:ruby; coding: utf-8 -*-
insns.def - YARV instruction definitions
$Author: $
created at: 04/01/01 01:17:55 JST
Copyright (C) 2004-2007 Koichi Sasada
- Massive rewrite by @shyouhei in 2017.
- */
-
-/* Some comments about this file's contents:
-
- - The new format aims to be editable by C editor of your choice;
- your mileage might vary of course.
-
- - Each instructions are in following format:
-
- DEFINE_INSN
- instruction_name
- (type operand, type operand, ..)
- (pop_values, ..)
- (return values ..)
- // attr type name contents..
- {
+*/
+
+/** ##skip
+ instruction comment
+ @c: category
+ @e: english description
+ @j: japanese description
+
+ instruction form:
+ DEFINE_INSN
+ instruction_name
+ (instruction_operands, ..)
+ (pop_values, ..)
+ (return value)
+ {
.. // insn body
- }
-
- - Unlike the old format which was line-oriented, you can now place
- newlines and comments at liberal positions.
-
- - `DEFINE_INSN` is a keyword.
-
- - An instruction name must be a valid C identifier.
-
- - Operands, pop values, return values are series of either variable
- declarations, keyword `void`, or keyword `...`. They are much
- like C function declarations.
-
- - Attribute pragmas are optional, and can include arbitrary C
- expressions. You can write anything there but as of writing,
- supported attributes are:
-
- * sp_inc: Used to dynamically calculate sp increase in
- `insn_stack_increase`.
-
- * handles_sp: If it is true, VM deals with sp in the insn.
- Default is if the instruction takes ISEQ operand or not.
+ }
- * leaf: indicates that the instruction is "leaf" i.e. it does
- not introduce new stack frame on top of it.
- If an instruction handles sp, that can never be a leaf.
+ */
- - Attributes can access operands, but not stack (push/pop) variables.
- - An instruction's body is a pure C block, copied verbatimly into
- the generated C source code.
+/**
+ @c nop
+ @e nop
+ @j nop
*/
-
-/* nop */
DEFINE_INSN
nop
()
@@ -70,8 +44,12 @@ nop
/* deal with variables */
/**********************************************************/
-/* Get local variable (pointed by `idx' and `level').
+/**
+ @c variable
+ @e Get local variable (pointed by `idx' and `level').
'level' indicates the nesting depth from the current block.
+ @j level, idx ã§æŒ‡å®šã•れãŸãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã®å€¤ã‚’スタックã«ç½®ã。
+ level ã¯ãƒ–ロックã®ãƒã‚¹ãƒˆãƒ¬ãƒ™ãƒ«ã§ã€ä½•段上ã‹ã‚’示ã™ã€‚
*/
DEFINE_INSN
getlocal
@@ -79,13 +57,22 @@ 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();
+
+ /* optimized insns generated for level == (0|1) in defs/opt_operand.def */
+ for (i = 0; i < lev; i++) {
+ ep = GET_PREV_EP(ep);
+ }
+ val = *(ep - idx);
}
-/* Set a local variable (pointed to by 'idx') as val.
+/**
+ @c variable
+ @e Set a local variable (pointed to by 'idx') as val.
'level' indicates the nesting depth from the current block.
+ @j level, idx ã§æŒ‡å®šã•れãŸãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã®å€¤ã‚’ val ã«ã™ã‚‹ã€‚
+ level ã¯ãƒ–ロックã®ãƒã‚¹ãƒˆãƒ¬ãƒ™ãƒ«ã§ã€ä½•段上ã‹ã‚’示ã™ã€‚
*/
DEFINE_INSN
setlocal
@@ -93,227 +80,186 @@ 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();
-/* Get a block parameter. */
-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);
+ /* optimized insns generated for level == (0|1) in defs/opt_operand.def */
+ for (i = 0; i < lev; i++) {
+ ep = GET_PREV_EP(ep);
}
- else {
- val = *(ep - idx);
- RB_DEBUG_COUNTER_INC(lvar_get);
- (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0);
- }
-}
-
-/* Set block parameter. */
-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;
}
-/* Get special proxy object which only responds to `call` method if the block parameter
- represents a iseq/ifunc block. Otherwise, same as `getblockparam`.
+/**
+ @c variable
+ @e Get value of special local variable ($~, $_, ..).
+ @j 特殊ãªãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ï¼ˆ$~, $_, ...)ã®å€¤ã‚’得る。
*/
DEFINE_INSN
-getblockparamproxy
-(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)) {
- VALUE block_handler = VM_ENV_BLOCK_HANDLER(ep);
-
- if (block_handler) {
- switch (vm_block_handler_type(block_handler)) {
- case block_handler_type_iseq:
- case block_handler_type_ifunc:
- val = rb_block_param_proxy;
- break;
- case block_handler_type_symbol:
- val = rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler));
- goto INSN_LABEL(set);
- case block_handler_type_proc:
- val = VM_BH_TO_PROC(block_handler);
- goto INSN_LABEL(set);
- default:
- VM_UNREACHABLE(getblockparamproxy);
- }
- }
- else {
- val = Qnil;
- INSN_LABEL(set):
- 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);
- }
-}
-
-/* Get value of special local variable ($~, $_, ..). */
-DEFINE_INSN
getspecial
(rb_num_t key, rb_num_t type)
()
(VALUE val)
-/* `$~ = MatchData.allocate; $&` can raise. */
-// attr bool leaf = (type == 0) ? true : false;
{
- val = vm_getspecial(ec, GET_LEP(), key, type);
+ val = vm_getspecial(th, GET_LEP(), key, type);
}
-/* Set value of special local variable ($~, $_, ...) to obj. */
+/**
+ @c variable
+ @e Set value of special local variable ($~, $_, ...) to obj.
+ @j 特別ãªãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ï¼ˆ$~, $_, ...)ã®å€¤ã‚’設定ã™ã‚‹ã€‚
+ */
DEFINE_INSN
setspecial
(rb_num_t key)
(VALUE obj)
()
{
- lep_svar_set(ec, GET_LEP(), key, obj);
+ lep_svar_set(th, GET_LEP(), key, obj);
}
-/* Get value of instance variable id of self. */
+/**
+ @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
getinstancevariable
-(ID id, IVC ic)
+(ID id, IC ic)
()
(VALUE val)
-/* "instance variable not initialized" warning can be hooked. */
-// attr bool leaf = false; /* has rb_warning() */
{
val = vm_getinstancevariable(GET_SELF(), id, ic);
}
-/* Set value of instance variable id of self to val. */
+/**
+ @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
setinstancevariable
-(ID id, IVC ic)
+(ID id, IC ic)
(VALUE val)
()
-// attr bool leaf = false; /* has rb_check_frozen_internal() */
{
vm_setinstancevariable(GET_SELF(), id, val, ic);
}
-/* Get value of class variable id of klass as val. */
+/**
+ @c variable
+ @e Get value of class variable id of klass as val.
+ @j ç¾åœ¨ã®ã‚¹ã‚³ãƒ¼ãƒ—ã®ã‚¯ãƒ©ã‚¹å¤‰æ•° id ã®å€¤ã‚’得る。
+ */
DEFINE_INSN
getclassvariable
(ID id)
()
(VALUE val)
-/* "class variable access from toplevel" warning can be hooked. */
-// attr bool leaf = false; /* has rb_warning() */
{
- val = rb_cvar_get(vm_get_cvar_base(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);
}
-/* Set value of class variable id of klass as val. */
+/**
+ @c variable
+ @e Set value of class variable id of klass as val.
+ @j klass ã®ã‚¯ãƒ©ã‚¹å¤‰æ•° id ã‚’ val ã«ã™ã‚‹ã€‚
+ */
DEFINE_INSN
setclassvariable
(ID id)
(VALUE val)
()
-/* "class variable access from toplevel" warning can be hooked. */
-// attr bool leaf = false; /* has rb_warning() */
{
- vm_ensure_not_refinement_module(GET_SELF());
- rb_cvar_set(vm_get_cvar_base(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);
}
-/* Get constant variable id. If klass is Qnil and allow_nil is Qtrue, constants
- are searched in the current scope. Otherwise, get constant under klass
+/**
+ @c variable
+ @e
+ Get constant variable id. If klass is Qnil, constants
+ are searched in the current scope. If klass is Qfalse, constants
+ are searched as top level constants. Otherwise, get constant under klass
class or module.
+ @j 定数 id ã®å€¤ã‚’得る。
+ klass ㌠Qnil ãªã‚‰ã€ãã®ã‚¹ã‚³ãƒ¼ãƒ—ã§å¾—られる定数ã®å€¤ã‚’得る。
+ Qfalse ãªã‚‰ã€ãƒˆãƒƒãƒ—レベルスコープを得る。
+ ãれ以外ãªã‚‰ã€klass クラスã®ä¸‹ã®å®šæ•°ã‚’得る。
*/
DEFINE_INSN
getconstant
(ID id)
-(VALUE klass, VALUE allow_nil)
+(VALUE klass)
(VALUE val)
-/* getconstant can kick autoload */
-// attr bool leaf = false; /* has rb_autoload_load() */
{
- val = vm_get_ev_const(ec, klass, id, allow_nil == Qtrue, 0);
+ val = vm_get_ev_const(th, GET_ISEQ(), klass, id, 0);
}
-/* Set constant variable id under cbase class or module.
+/**
+ @c variable
+ @e
+ Set constant variable id. If klass is Qfalse, constant
+ is able to access in this scope. if klass is Qnil, set
+ top level constant. otherwise, set constant under klass
+ class or module.
+
+ @j 定数 id ã®å€¤ã‚’ val ã«ã™ã‚‹ã€‚
+ klass ㌠Qfalse ãªã‚‰ã€ãã®ã‚¹ã‚³ãƒ¼ãƒ—ã§å¾—られる定数 id ã®å€¤ã‚’設定ã™ã‚‹ã€‚
+ Qnil ãªã‚‰ã€ãƒˆãƒƒãƒ—レベルスコープã®å€¤ã‚’設定ã™ã‚‹ã€‚
+ ãれ以外ãªã‚‰ã€klass クラスã®ä¸‹ã®å®šæ•°ã‚’設定ã™ã‚‹ã€‚
*/
DEFINE_INSN
setconstant
(ID id)
(VALUE val, VALUE cbase)
()
-/* Assigning an object to a constant is basically a leaf operation.
- * The problem is, assigning a Module instance to a constant _names_
- * that module. Naming involves string manipulations, which are
- * method calls. */
-// attr bool leaf = false; /* has StringValue() */
{
vm_check_if_namespace(cbase);
- vm_ensure_not_refinement_module(GET_SELF());
rb_const_set(cbase, id, val);
}
-/* get global variable id. */
+/**
+ @c variable
+ @e get global variable id.
+ @j グローãƒãƒ«å¤‰æ•° id ã®å€¤ã‚’得る。
+ */
DEFINE_INSN
getglobal
(GENTRY entry)
()
(VALUE val)
-// attr bool leaf = leafness_of_getglobal(entry);
{
- struct rb_global_entry *gentry = (void *)entry;
- val = rb_gvar_get(gentry);
+ val = GET_GLOBAL((VALUE)entry);
}
-/* set global variable id as val. */
+/**
+ @c variable
+ @e set global variable id as val.
+ @j グローãƒãƒ«å¤‰æ•° id ã®å€¤ã‚’設定ã™ã‚‹ã€‚
+ */
DEFINE_INSN
setglobal
(GENTRY entry)
(VALUE val)
()
-// attr bool leaf = leafness_of_setglobal(entry);
{
- struct rb_global_entry *gentry = (void *)entry;
- rb_gvar_set(gentry, val);
+ SET_GLOBAL((VALUE)entry, val);
}
+
/**********************************************************/
/* deal with values */
/**********************************************************/
-/* put nil to stack. */
+/**
+ @c put
+ @e put nil to stack.
+ @j スタック㫠nil をプッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
putnil
()
@@ -323,7 +269,11 @@ putnil
val = Qnil;
}
-/* put self. */
+/**
+ @c put
+ @e put self.
+ @j スタック㫠self をプッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
putself
()
@@ -333,7 +283,11 @@ putself
val = GET_SELF();
}
-/* put some object.
+/**
+ @c put
+ @e put some object.
+ i.e. Fixnum, true, false, nil, and so on.
+ @j オブジェクト val をスタックã«ãƒ—ッシュã™ã‚‹ã€‚
i.e. Fixnum, true, false, nil, and so on.
*/
DEFINE_INSN
@@ -345,20 +299,54 @@ putobject
/* */
}
-/* put special object. "value_type" is for expansion. */
+/**
+ @c put
+ @e put special object. "value_type" is for expansion.
+ @j 特別ãªã‚ªãƒ–ジェクト val をスタックã«ãƒ—ッシュã™ã‚‹ã€‚
+ オブジェクトã®ç¨®é¡žã¯ value_type ã«ã‚ˆã‚‹ï¼Ž
+ */
DEFINE_INSN
putspecialobject
(rb_num_t value_type)
()
(VALUE val)
{
- enum vm_special_object_type 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");
+ }
+}
- type = (enum vm_special_object_type)value_type;
- val = vm_get_special_object(GET_EP(), type);
+/**
+ @c put
+ @e put iseq value.
+ @j put iseq value.
+ */
+DEFINE_INSN
+putiseq
+(ISEQ iseq)
+()
+(VALUE ret)
+{
+ ret = iseq->self;
}
-/* put string val. string will be copied. */
+/**
+ @c put
+ @e put string val. string will be copied.
+ @j 文字列をコピーã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
putstring
(VALUE str)
@@ -368,189 +356,202 @@ putstring
val = rb_str_resurrect(str);
}
-/* put concatenate strings */
+/**
+ @c put
+ @e put concatenate strings
+ @j ã‚¹ã‚¿ãƒƒã‚¯ãƒˆãƒƒãƒ—ã®æ–‡å­—列を n 個連çµã—ï¼Œçµæžœã‚’スタックã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
concatstrings
(rb_num_t num)
(...)
-(VALUE val)
-/* This instruction can concat UTF-8 and binary strings, resulting in
- * Encoding::CompatiblityError. */
-// attr bool leaf = false; /* has rb_enc_cr_str_buf_cat() */
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
+(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);
}
-/* push the result of to_s. */
+/**
+ @c put
+ @e to_str
+ @j to_str ã®çµæžœã‚’スタックã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
tostring
()
-(VALUE val, VALUE str)
+(VALUE val)
(VALUE val)
{
- val = rb_obj_as_string_result(str, val);
-}
-
-/* Freeze (dynamically) created strings. if debug_info is given, set it. */
-DEFINE_INSN
-freezestring
-(VALUE debug_info)
-(VALUE str)
-(VALUE str)
-{
- vm_freezestring(str, debug_info);
+ val = rb_obj_as_string(val);
}
-/* compile str to Regexp and push it.
- opt is the option for the Regexp.
+/**
+ @c put
+ @e to Regexp
+ @j 文字列 str ã‚’æ­£è¦è¡¨ç¾ã«ã‚³ãƒ³ãƒ‘イルã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã«ãƒ—ッシュã™ã‚‹ã€‚
+ コンパイル時,opt ã‚’æ­£è¦è¡¨ç¾ã®ã‚ªãƒ—ションã¨ã™ã‚‹ã€‚
*/
DEFINE_INSN
toregexp
(rb_num_t opt, rb_num_t cnt)
(...)
-(VALUE val)
-/* This instruction can raise RegexpError, thus can call
- * RegexpError#initialize */
-// attr bool leaf = false;
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)cnt;
+(VALUE val) // inc += 1 - cnt;
{
- const VALUE ary = rb_ary_tmp_new_from_values(0, cnt, STACK_ADDR_FROM_TOP(cnt));
+ VALUE rb_reg_new_ary(VALUE ary, int options);
+ 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);
}
-/* intern str to Symbol and push it. */
-DEFINE_INSN
-intern
-()
-(VALUE str)
-(VALUE sym)
-{
- sym = rb_str_intern(str);
-}
-
-/* put new array initialized with num values on the stack. */
+/**
+ @c put
+ @e put new array.
+ @j æ–°ã—ã„é…列をスタック上㮠num 個ã®å€¤ã§åˆæœŸåŒ–ã—ã¦ç”Ÿæˆã—プッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
newarray
(rb_num_t num)
(...)
-(VALUE val)
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
+(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);
}
-/* put new array initialized with num values on the stack. There
- should be at least one element on the stack, and the top element
- should be a hash. If the top element is empty, it is not
- included in the array.
+/**
+ @c put
+ @e dup array
+ @j é…列 ary ã‚’ dup ã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã«ãƒ—ッシュã™ã‚‹ã€‚
*/
DEFINE_INSN
-newarraykwsplat
-(rb_num_t num)
-(...)
-(VALUE val)
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
-{
- if (RHASH_EMPTY_P(*STACK_ADDR_FROM_TOP(1))) {
- val = rb_ary_new4(num-1, STACK_ADDR_FROM_TOP(num));
- }
- else {
- val = rb_ary_new4(num, STACK_ADDR_FROM_TOP(num));
- }
-}
-
-/* dup array */
-DEFINE_INSN
duparray
(VALUE ary)
()
(VALUE val)
{
- RUBY_DTRACE_CREATE_HOOK(ARRAY, RARRAY_LEN(ary));
val = rb_ary_resurrect(ary);
}
-/* dup hash */
-DEFINE_INSN
-duphash
-(VALUE hash)
-()
-(VALUE val)
-{
- RUBY_DTRACE_CREATE_HOOK(HASH, RHASH_SIZE(hash) << 1);
- val = rb_hash_resurrect(hash);
-}
-
-/* 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
+/**
+ @c put
+ @e expand array to num objects.
+ @j スタックトップã®ã‚ªãƒ–ジェクトãŒé…列ã§ã‚れã°ã€ãれを展開ã™ã‚‹ã€‚
+ é…列オブジェクトã®è¦ç´ æ•°ãŒ num以下ãªã‚‰ã°ã€ä»£ã‚り㫠nil ã‚’ç©ã‚€ã€‚num以上ãªã‚‰ã€
+ num以上ã®è¦ç´ ã¯åˆ‡ã‚Šæ¨ã¦ã‚‹ã€‚
+ é…列オブジェクトã§ãªã‘れã°ã€num - 1 個㮠nil ã‚’ç©ã‚€ã€‚
+ ã‚‚ã— flag ãŒçœŸãªã‚‰ã€æ®‹ã‚Šè¦ç´ ã®é…列をç©ã‚€
+ flag: 0x01 - 最後をé…列ã«
+ flag: 0x02 - postarg 用
flag: 0x04 - reverse?
*/
DEFINE_INSN
expandarray
(rb_num_t num, rb_num_t flag)
(..., VALUE ary)
-(...)
-// attr bool leaf = false; /* has rb_check_array_type() */
-// attr rb_snum_t sp_inc = (rb_snum_t)num - 1 + (flag & 1 ? 1 : 0);
+(...) // inc += num - 1 + (flag & 1 ? 1 : 0);
{
- vm_expandarray(GET_SP(), ary, num, (int)flag);
+ vm_expandarray(GET_CFP(), ary, num, (int)flag);
}
-/* concat two arrays */
+/**
+ @c put
+ @e concat two arrays
+ @j 二ã¤ã®é…列 ary1, ary2 を連çµã—スタックã¸ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
concatarray
()
-(VALUE ary1, VALUE ary2)
+(VALUE ary1, VALUE ary2st)
(VALUE ary)
-// attr bool leaf = false; /* has rb_check_array_type() */
{
- 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);
}
-/* call to_a on array ary to splat */
+/**
+ @c put
+ @e splat array
+ @j é…列 ary ã«å¯¾ã—㦠to_a を呼ã³å‡ºã™ã€‚
+ */
DEFINE_INSN
splatarray
(VALUE flag)
(VALUE ary)
(VALUE obj)
-// attr bool leaf = false; /* has rb_check_array_type() */
{
- 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;
}
-/* put new Hash from n elements. n must be an even number. */
+/**
+ @c put
+ @e put new Hash.
+ @j æ–°ã—ã„ãƒãƒƒã‚·ãƒ¥ã‚’スタックトップ㮠n å€‹ã‚’åˆæœŸå€¤ã¨ã—ã¦ç”Ÿæˆã™ã‚‹ã€‚
+ n ã¯ã‚­ãƒ¼ã¨å€¤ã®ãƒšã‚¢ãªã®ã§ 2 ã®å€æ•°ã§ãªã‘れã°ãªã‚‰ãªã„。
+ */
DEFINE_INSN
newhash
(rb_num_t num)
(...)
-(VALUE val)
-// attr bool leaf = false; /* has rb_hash_key_str() */
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
+(VALUE val) // inc += 1 - num;
{
- RUBY_DTRACE_CREATE_HOOK(HASH, num);
+ rb_num_t i;
+
+ if(RUBY_DTRACE_HASH_CREATE_ENABLED()) {
+ RUBY_DTRACE_HASH_CREATE(num, rb_sourcefile(), rb_sourceline());
+ }
- val = rb_hash_new_with_size(num / 2);
+ 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);
}
-/* put new Range object.(Range.new(low, high, flag)) */
+/**
+ @c put
+ @e put new Range object.(Range.new(low, high, flag))
+ @j Range.new(low, high, flag) ã®ã‚ˆã†ãªã‚ªãƒ–ジェクトを生æˆã—スタックã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
newrange
(rb_num_t flag)
(VALUE low, VALUE high)
(VALUE val)
-/* rb_range_new() exercises "bad value for range" check. */
-// attr bool leaf = false; /* see also: range.c:range_init() */
{
val = rb_range_new(low, high, (int)flag);
}
@@ -559,7 +560,11 @@ newrange
/* deal with stack operation */
/**********************************************************/
-/* pop from stack. */
+/**
+ @c stack
+ @e pop from stack.
+ @j スタックã‹ã‚‰ä¸€ã¤ãƒãƒƒãƒ—ã™ã‚‹ã€‚
+ */
DEFINE_INSN
pop
()
@@ -570,7 +575,11 @@ pop
/* none */
}
-/* duplicate stack top. */
+/**
+ @c stack
+ @e duplicate stack top.
+ @j スタックトップをコピーã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
dup
()
@@ -580,21 +589,31 @@ dup
val1 = val2 = val;
}
-/* duplicate stack top n elements */
+/**
+ @c stack
+ @e duplicate stack top n elements
+ @j スタックトップ㮠n 個をコピーã—ã¦ã‚¹ã‚¿ãƒƒã‚¯ã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
dupn
(rb_num_t n)
(...)
-(...)
-// attr rb_snum_t sp_inc = n;
+(...) // inc += n;
{
- void *dst = GET_SP();
- void *src = STACK_ADDR_FROM_TOP(n);
-
- 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);
}
-/* swap top 2 vals */
+
+/**
+ @c stack
+ @e swap top 2 vals
+ @j スタックトップ㮠2 ã¤ã®å€¤ã‚’交æ›ã™ã‚‹ã€‚
+ */
DEFINE_INSN
swap
()
@@ -604,127 +623,286 @@ swap
/* none */
}
-/* reverse stack top N order. */
+/**
+ @c stack
+ @e for stack caching.
+ @j スタックキャッシングã®çŠ¶æ…‹ã‚’èª¿æ•´ã™ã‚‹ãŸã‚ã«å¿…è¦ãªå‘½ä»¤ã€‚
+ */
DEFINE_INSN
-reverse
-(rb_num_t n)
-(...)
-(...)
-// attr rb_snum_t sp_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;
- }
-}
-
-/* for stack caching. */
-DEFINE_INSN_IF(STACK_CACHING)
reput
()
(..., VALUE val)
-(VALUE val)
-// attr rb_snum_t sp_inc = 0;
+(VALUE val) // inc += 0;
{
/* none */
}
-/* get nth stack value from stack top */
+/**
+ @c stack
+ @e get nth stack value from stack top
+ @j スタックトップã‹ã‚‰ n 個目をスタックã«ãƒ—ッシュã™ã‚‹ã€‚
+ */
DEFINE_INSN
topn
(rb_num_t n)
(...)
-(VALUE val)
-// attr rb_snum_t sp_inc = 1;
+(VALUE val) // inc += 1;
{
val = TOPN(n);
}
-/* set Nth stack entry to stack top */
+/**
+ @c stack
+ @e set Nth stack entry to stack top
+ @j スタックトップã®å€¤ã‚’ n 個目ã®ã‚¹ã‚¿ãƒƒã‚¯ã«ã‚³ãƒ”ー
+ */
DEFINE_INSN
setn
(rb_num_t n)
(..., VALUE val)
-(VALUE val)
-// attr rb_snum_t sp_inc = 0;
+(VALUE val) // inc += 0
{
- TOPN(n) = val;
+ TOPN(n-1) = val;
}
-/* empty current stack */
+/**
+ @c stack
+ @e empt current stack
+ @j current stack を空ã«ã™ã‚‹ã€‚
+ */
DEFINE_INSN
adjuststack
(rb_num_t n)
(...)
-(...)
-// attr rb_snum_t sp_inc = -(rb_snum_t)n;
+(...) // inc -= n
{
- /* none */
+ DEC_SP(n);
}
+
/**********************************************************/
/* deal with setting */
/**********************************************************/
-/* defined? */
+/**
+ @c setting
+ @e defined?
+ @j defined? を行ã†ã€‚
+ */
DEFINE_INSN
defined
(rb_num_t op_type, VALUE obj, VALUE needstr)
(VALUE v)
(VALUE val)
-// attr bool leaf = leafness_of_defined(op_type);
{
- 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) &&
+ !((me->flag & NOEX_PROTECTED) && !rb_obj_is_kind_of(GET_SELF(), rb_class_real(klass)))) {
+ expr_type = DEFINED_METHOD;
+ }
+ }
+ else {
+ 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;
+ }
+ }
}
-/* check `target' matches `pattern'.
+/**
+ @c setting
+ @e check `target' matches `pattern'.
`flag & VM_CHECKMATCH_TYPE_MASK' describe how to check pattern.
VM_CHECKMATCH_TYPE_WHEN: ignore target and check pattern is truthy.
VM_CHECKMATCH_TYPE_CASE: check `patten === target'.
- VM_CHECKMATCH_TYPE_RESCUE: check `pattern.kind_op?(Module) && pattern === target'.
+ VM_CHECKMATCH_TYPE_RESCUE: check `pattern.kind_op?(Module) && pattern == target'.
if `flag & VM_CHECKMATCH_ARRAY' is not 0, then `patten' is array of patterns.
+ @j see above comments.
*/
DEFINE_INSN
checkmatch
(rb_num_t flag)
(VALUE target, VALUE pattern)
(VALUE result)
-// attr bool leaf = leafness_of_checkmatch(flag);
{
- result = vm_check_match(ec, target, pattern, flag);
+ 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;
+ }
+ }
}
-/* check keywords are specified or not. */
+/**
+ @c setting
+ @e check keywords are specified or not.
+ @j ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ãƒã‚§ãƒƒã‚¯ã™ã‚‹
+ */
DEFINE_INSN
checkkeyword
-(lindex_t kw_bits_index, lindex_t keyword_index)
+(lindex_t kw_bits_index, rb_num_t keyword_index)
()
(VALUE ret)
{
- ret = vm_check_keyword(kw_bits_index, keyword_index, GET_EP());
+ const VALUE *ep = GET_EP();
+ const VALUE kw_bits = *(ep - kw_bits_index);
+
+ if (FIXNUM_P(kw_bits)) {
+ int bits = FIX2INT(kw_bits);
+ ret = (bits & (0x01 << keyword_index)) ? Qfalse : Qtrue;
+ }
+ else {
+ assert(RB_TYPE_P(kw_bits, T_HASH));
+ ret = rb_hash_has_key(kw_bits, INT2FIX(keyword_index)) ? Qfalse : Qtrue;
+ }
}
-/* check if val is type. */
+/**
+ @c setting
+ @e trace
+ @j trace 用ã®å‘½ä»¤ã€‚
+ */
DEFINE_INSN
-checktype
-(rb_num_t type)
-(VALUE val)
-(VALUE ret)
+trace
+(rb_num_t nf)
+()
+()
{
- ret = (TYPE(val) == (int)type) ? Qtrue : Qfalse;
+ rb_event_flag_t flag = (rb_event_flag_t)nf;
+
+ 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);
}
/**********************************************************/
/* deal with control flow 1: class/module */
/**********************************************************/
-/* enter class definition scope. if super is Qfalse, and class
+/**
+ @c class/module
+ @e
+ enter class definition scope. if super is Qfalse, and class
"klass" is defined, it's redefine. otherwise, define "klass" class.
+ @j クラス定義スコープã¸ç§»è¡Œã™ã‚‹ã€‚
+ ã‚‚ã— super ㌠Qfalse ã§ klassクラスãŒå®šç¾©ã•れã¦ã„れã°å†å®šç¾©ã§ã‚る。
+ ãã†ã§ãªã‘れã°ã€klass クラスを定義ã™ã‚‹ã€‚
*/
DEFINE_INSN
defineclass
@@ -732,218 +910,236 @@ defineclass
(VALUE cbase, VALUE super)
(VALUE val)
{
- VALUE klass = vm_find_or_create_class_by_id(id, flags, cbase, super);
+ VALUE klass;
+ VALUE class_iseq_val = class_iseq->self;
+ rb_iseq_t *orig_class_iseq = NULL;
+ rb_vm_defineclass_type_t type = VM_DEFINECLASS_TYPE(flags);
- rb_iseq_check(class_iseq);
+ 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));
+ }
+
+ 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 (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
+ VALUE tmp;
+ tmp = rb_class_real(RCLASS_SUPER(klass));
+
+ if (tmp != super) {
+ rb_raise(rb_eTypeError, "superclass mismatch for class %s",
+ rb_id2name(id));
+ }
+ }
+ }
+ else {
+ if (!VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
+ super = rb_cObject;
+ }
+ /* new class declaration */
+ klass = rb_define_class_id(id, super);
+ rb_set_class_path_string(klass, cbase, rb_id2str(id));
+ 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);
+
+ /* Copy iseq to duplicate cref_stack place.
+ * This is ad-hoc solution for [Bug #10871].
+ * and this does not solve more complicated source code with singleton class.
+ * If you need to solve everything, use Ruby 2.3 and later.
+ */
+ orig_class_iseq = class_iseq;
+ class_iseq_val = rb_iseq_clone(class_iseq->self, cbase);
+ GetISeqPtr(class_iseq_val, class_iseq);
+ }
+ 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));
+ if (orig_class_iseq) {
+ COPY_CREF(orig_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);
+
+ RB_GC_GUARD(class_iseq_val);
+
RESTORE_REGS();
NEXT_INSN();
}
-DEFINE_INSN
-definemethod
-(ID id, ISEQ iseq)
-()
-()
-{
- vm_define_method(ec, Qnil, id, (VALUE)iseq, FALSE);
-}
-
-DEFINE_INSN
-definesmethod
-(ID id, ISEQ iseq)
-(VALUE obj)
-()
-{
- vm_define_method(ec, obj, id, (VALUE)iseq, TRUE);
-}
/**********************************************************/
/* deal with control flow 2: method/iterator */
/**********************************************************/
-/* invoke method. */
+/**
+ @c method/iterator
+ @e invoke method.
+ @j メソッド呼ã³å‡ºã—を行ã†ã€‚ci ã«å¿…è¦ãªæƒ…å ±ãŒæ ¼ç´ã•れã¦ã„る。
+ */
DEFINE_INSN
send
-(CALL_DATA cd, ISEQ blockiseq)
+(CALL_INFO ci)
(...)
-(VALUE val)
-// attr rb_snum_t sp_inc = sp_inc_of_sendish(&cd->ci);
-// attr rb_snum_t comptime_sp_inc = sp_inc_of_sendish(ci);
+(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), &cd->ci, blockiseq, false);
- val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);
-
- if (val == Qundef) {
- RESTORE_REGS();
- NEXT_INSN();
- }
-}
-
-/* Invoke method without block */
-DEFINE_INSN
-opt_send_without_block
-(CALL_DATA cd)
-(...)
-(VALUE val)
-// attr bool handles_sp = true;
-// attr rb_snum_t sp_inc = sp_inc_of_sendish(&cd->ci);
-// attr rb_snum_t comptime_sp_inc = sp_inc_of_sendish(ci);
-{
- VALUE bh = VM_BLOCK_HANDLER_NONE;
- val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);
-
- if (val == Qundef) {
- RESTORE_REGS();
- NEXT_INSN();
- }
+ ci->argc = ci->orig_argc;
+ vm_caller_setup_arg_block(th, reg_cfp, ci, FALSE);
+ vm_search_method(ci, ci->recv = TOPN(ci->argc));
+ CALL_METHOD(ci);
}
DEFINE_INSN
opt_str_freeze
-(VALUE str, CALL_DATA cd)
+(VALUE str)
()
(VALUE val)
{
- val = vm_opt_str_freeze(str, BOP_FREEZE, idFreeze);
-
- if (val == Qundef) {
- PUSH(rb_str_resurrect(str));
- CALL_SIMPLE_METHOD();
+ if (BASIC_OP_UNREDEFINED_P(BOP_FREEZE, STRING_REDEFINED_OP_FLAG)) {
+ val = str;
}
-}
-
-/* optimized nil? */
-DEFINE_INSN
-opt_nil_p
-(CALL_DATA cd)
-(VALUE recv)
-(VALUE val)
-{
- val = vm_opt_nil_p(cd, recv);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
- }
-}
-
-DEFINE_INSN
-opt_str_uminus
-(VALUE str, CALL_DATA cd)
-()
-(VALUE val)
-{
- val = vm_opt_str_freeze(str, BOP_UMINUS, idUMinus);
-
- if (val == Qundef) {
- PUSH(rb_str_resurrect(str));
- CALL_SIMPLE_METHOD();
+ else {
+ val = rb_funcall(rb_str_resurrect(str), idFreeze, 0);
}
}
+/**
+ @c optimize
+ @e Invoke method without block
+ @j Invoke method without block
+ */
DEFINE_INSN
-opt_newarray_max
-(rb_num_t num)
-(...)
-(VALUE val)
-/* This instruction typically has no funcalls. But it compares array
- * contents each other by nature. That part could call methods when
- * necessary. No way to detect such method calls beforehand. We
- * cannot but mark it being not leaf. */
-// attr bool leaf = false; /* has rb_funcall() */
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
-{
- val = vm_opt_newarray_max(num, STACK_ADDR_FROM_TOP(num));
-}
-
-DEFINE_INSN
-opt_newarray_min
-(rb_num_t num)
+opt_send_without_block
+(CALL_INFO ci)
(...)
-(VALUE val)
-/* Same discussion as opt_newarray_max. */
-// attr bool leaf = false; /* has rb_funcall() */
-// attr rb_snum_t sp_inc = 1 - (rb_snum_t)num;
+(VALUE val) // inc += -ci->orig_argc;
{
- val = vm_opt_newarray_min(num, STACK_ADDR_FROM_TOP(num));
+ ci->argc = ci->orig_argc;
+ vm_search_method(ci, ci->recv = TOPN(ci->argc));
+ CALL_METHOD(ci);
}
-/* super(args) # args.size => num */
+/**
+ @c method/iterator
+ @e super(args) # args.size => num
+ @j super を実行ã™ã‚‹ã€‚ci ã«å¿…è¦ãªæƒ…å ±ãŒæ ¼ç´ã•れã¦ã„る。
+ */
DEFINE_INSN
invokesuper
-(CALL_DATA cd, ISEQ blockiseq)
+(CALL_INFO ci)
(...)
-(VALUE val)
-// attr rb_snum_t sp_inc = sp_inc_of_sendish(&cd->ci);
-// attr rb_snum_t comptime_sp_inc = sp_inc_of_sendish(ci);
+(VALUE val) // inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));
{
- VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), &cd->ci, blockiseq, true);
- val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_super_method);
-
- if (val == Qundef) {
- RESTORE_REGS();
- NEXT_INSN();
- }
+ ci->argc = ci->orig_argc;
+ vm_caller_setup_arg_block(th, reg_cfp, ci, TRUE);
+ ci->recv = GET_SELF();
+ vm_search_super_method(th, GET_CFP(), ci);
+ CALL_METHOD(ci);
}
-/* yield(args) */
+/**
+ @c method/iterator
+ @e yield(args)
+ @j yield を実行ã™ã‚‹ã€‚
+ */
DEFINE_INSN
invokeblock
-(CALL_DATA cd)
+(CALL_INFO ci)
(...)
-(VALUE val)
-// attr bool handles_sp = true;
-// attr rb_snum_t sp_inc = sp_inc_of_invokeblock(&cd->ci);
-// attr rb_snum_t comptime_sp_inc = sp_inc_of_invokeblock(ci);
+(VALUE val) // inc += 1 - ci->orig_argc;
{
- if (UNLIKELY(cd->cc.call != vm_invokeblock_i)) {
- cd->cc.call = vm_invokeblock_i; // check before setting to avoid CoW
- }
-
- VALUE bh = VM_BLOCK_HANDLER_NONE;
- val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_invokeblock);
-
+ 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();
+ RESTORE_REGS();
+ NEXT_INSN();
}
}
-/* return from this scope. */
+/**
+ @c method/iterator
+ @e return from this scope.
+ @j ã“ã®ã‚¹ã‚³ãƒ¼ãƒ—ã‹ã‚‰æŠœã‘る。
+ */
DEFINE_INSN
leave
()
(VALUE val)
(VALUE val)
-/* This is super surprising but when leaving from a frame, we check
- * for interrupts. If any, that should be executed on top of the
- * current execution context. This is a method call. */
-// attr bool leaf = false; /* has rb_threadptr_execute_interrupts() */
-// attr bool handles_sp = true;
{
if (OPT_CHECKED_RUN) {
- const VALUE *const bp = vm_base_ptr(GET_CFP());
- if (GET_SP() != bp) {
- vm_stack_consistency_error(ec, GET_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)));
}
}
- if (vm_pop_frame(ec, GET_CFP(), GET_EP())) {
+ RUBY_VM_CHECK_INTS(th);
+
+ if (UNLIKELY(VM_FRAME_TYPE_FINISH_P(GET_CFP()))) {
+ vm_pop_frame(th);
+
#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();
}
}
@@ -952,16 +1148,19 @@ leave
/* deal with control flow 3: exception */
/**********************************************************/
-/* longjump */
+/**
+ @c exception
+ @e longjump
+ @j 大域ジャンプを行ã†ã€‚
+ */
DEFINE_INSN
throw
(rb_num_t throw_state)
(VALUE throwobj)
(VALUE val)
-/* Same discussion as leave. */
-// attr bool leaf = false; /* has rb_threadptr_execute_interrupts() */
{
- 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 */
}
@@ -970,503 +1169,1051 @@ throw
/* deal with control flow 4: local jump */
/**********************************************************/
-/* set PC to (PC + dst). */
+/**
+ @c jump
+ @e set PC to (PC + dst).
+ @j PC ã‚’ (PC + dst) ã«ã™ã‚‹ã€‚
+ */
DEFINE_INSN
jump
(OFFSET dst)
()
()
-/* Same discussion as leave. */
-// attr bool leaf = false; /* has rb_threadptr_execute_interrupts() */
{
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
-/* if val is not false or nil, set PC to (PC + dst). */
+/**
+ @c jump
+ @e if val is not false or nil, set PC to (PC + dst).
+ @j ã‚‚ã— val ㌠false ã‹ nil ã§ãªã‘れã°ã€PC ã‚’ (PC + dst) ã«ã™ã‚‹ã€‚
+ */
DEFINE_INSN
branchif
(OFFSET dst)
(VALUE val)
()
-/* Same discussion as jump. */
-// attr bool leaf = false; /* has rb_threadptr_execute_interrupts() */
{
if (RTEST(val)) {
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
}
-/* if val is false or nil, set PC to (PC + dst). */
+/**
+ @c jump
+ @e if val is false or nil, set PC to (PC + dst).
+ @j ã‚‚ã— val ㌠false ã‹ nil ãªã‚‰ã°ã€PC ã‚’ (PC + dst) ã«ã™ã‚‹ã€‚
+ */
DEFINE_INSN
branchunless
(OFFSET dst)
(VALUE val)
()
-/* Same discussion as jump. */
-// attr bool leaf = false; /* has rb_threadptr_execute_interrupts() */
{
if (!RTEST(val)) {
- RUBY_VM_CHECK_INTS(ec);
+ RUBY_VM_CHECK_INTS(th);
JUMP(dst);
}
}
-/* if val is nil, set PC to (PC + dst). */
-DEFINE_INSN
-branchnil
-(OFFSET dst)
-(VALUE val)
-()
-/* Same discussion as jump. */
-// attr bool leaf = false; /* has rb_threadptr_execute_interrupts() */
-{
- if (NIL_P(val)) {
- RUBY_VM_CHECK_INTS(ec);
- JUMP(dst);
- }
-}
/**********************************************************/
/* for optimize */
/**********************************************************/
-/* push inline-cached value and go to dst if it is valid */
+/**
+ @c optimize
+ @e push inline-cached value and go to dst if it is valid
+ @j ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³ã‚­ãƒ£ãƒƒã‚·ãƒ¥ãŒæœ‰åйãªã‚‰ã€å€¤ã‚’スタックã«ãƒ—ッシュã—㦠dst ã¸ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã€‚
+ */
DEFINE_INSN
-opt_getinlinecache
+getinlinecache
(OFFSET dst, IC ic)
()
(VALUE val)
{
- if (vm_ic_hit_p(ic, GET_EP())) {
- val = ic->value;
+ if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE()) {
+ val = ic->ic_value.value;
JUMP(dst);
}
else {
+ /* none */
val = Qnil;
}
}
-/* set inline cache */
+/**
+ @c optimize
+ @e set inline cache
+ @j インラインキャッシュã®å€¤ã‚’設定ã™ã‚‹ã€‚
+ */
DEFINE_INSN
-opt_setinlinecache
+setinlinecache
(IC ic)
(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;
}
-/* run iseq only once */
+/**
+ @c optimize
+ @e run iseq only once
+ @j once を実ç¾ã™ã‚‹ã€‚
+ */
DEFINE_INSN
once
-(ISEQ iseq, ISE ise)
+(ISEQ iseq, IC ic)
()
(VALUE val)
{
- val = vm_once_dispatch(ec, iseq, ise);
+ 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;
+ }
}
-/* case dispatcher, jump by table if possible */
+/**
+ @c optimize
+ @e case dispatcher, jump by table if possible
+ @j case æ–‡ã§ã€å¯èƒ½ãªã‚‰è¡¨å¼•ãã§ã‚¸ãƒ£ãƒ³ãƒ—ã™ã‚‹ã€‚
+ */
DEFINE_INSN
opt_case_dispatch
(CDHASH hash, OFFSET else_offset)
(..., VALUE key)
-()
-// attr rb_snum_t sp_inc = -1;
+() // 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 && !isinf(ival)) {
+ 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 |
+ FLOAT_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;
}
}
/** simple functions */
-/* optimized X+Y. */
+/**
+ @c optimize
+ @e optimized X+Y.
+ @j 最é©åŒ–ã•れ㟠X+Y。
+ */
DEFINE_INSN
opt_plus
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_plus(recv, obj);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized X-Y. */
+/**
+ @c optimize
+ @e optimized X-Y.
+ @j 最é©åŒ–ã•れ㟠X-Y。
+ */
DEFINE_INSN
opt_minus
-(CALL_DATA cd)
+(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) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized X*Y. */
+/**
+ @c optimize
+ @e optimized X*Y.
+ @j 最é©åŒ–ã•れ㟠X*Y。
+ */
DEFINE_INSN
opt_mult
-(CALL_DATA cd)
+(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) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized X/Y. */
+/**
+ @c optimize
+ @e optimized X/Y.
+ @j 最é©åŒ–ã•れ㟠X/Y。
+ */
DEFINE_INSN
opt_div
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
-/* In case of division by zero, it raises. Thus
- * ZeroDivisionError#initialize is called. */
-// attr bool leaf = false;
{
- val = vm_opt_div(recv, obj);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized X%Y. */
+/**
+ @c optimize
+ @e optimized X%Y.
+ @j 最é©åŒ–ã•れ㟠X%Y。
+ */
DEFINE_INSN
opt_mod
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
-/* Same discussion as opt_mod. */
-// attr bool leaf = false;
{
- 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) {
- CALL_SIMPLE_METHOD();
+ 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)
+ 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 = 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);
}
}
-/* optimized X==Y. */
+/**
+ @c optimize
+ @e optimized X==Y.
+ @j 最é©åŒ–ã•れ㟠X==Y。
+ */
DEFINE_INSN
opt_eq
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = opt_eq_func(recv, obj, cd);
+ val = opt_eq_func(recv, obj, ci);
if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ /* other */
+ PUSH(recv);
+ PUSH(obj);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized X!=Y. */
+/**
+ @c optimize
+ @e optimized X!=Y.
+ @j 最é©åŒ–ã•れ㟠X!=Y。
+ */
DEFINE_INSN
opt_neq
-(CALL_DATA cd_eq, CALL_DATA cd)
+(CALL_INFO ci, CALL_INFO ci_eq)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_neq(cd, cd_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) {
- CALL_SIMPLE_METHOD();
+ /* other */
+ PUSH(recv);
+ PUSH(obj);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized X<Y. */
+/**
+ @c optimize
+ @e optimized X<Y.
+ @j 最é©åŒ–ã•れ㟠X<Y。
+ */
DEFINE_INSN
opt_lt
-(CALL_DATA cd)
+(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) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized X<=Y. */
+/**
+ @c optimize
+ @e optimized X<=Y.
+ @j 最é©åŒ–ã•れ㟠X<=Y。
+ */
DEFINE_INSN
opt_le
-(CALL_DATA cd)
+(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) {
- CALL_SIMPLE_METHOD();
+ 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);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized X>Y. */
+/**
+ @c optimize
+ @e optimized X>Y.
+ @j 最é©åŒ–ã•れ㟠X>Y。
+ */
DEFINE_INSN
opt_gt
-(CALL_DATA cd)
+(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) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized X>=Y. */
+/**
+ @c optimize
+ @e optimized X>=Y.
+ @j 最é©åŒ–ã•れ㟠X>=Y。
+ */
DEFINE_INSN
opt_ge
-(CALL_DATA cd)
+(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) {
- CALL_SIMPLE_METHOD();
+ if (a >= b) {
+ val = Qtrue;
+ }
+ else {
+ val = Qfalse;
+ }
}
-}
-
-/* << */
-DEFINE_INSN
-opt_ltlt
-(CALL_DATA cd)
-(VALUE recv, VALUE obj)
-(VALUE val)
-/* This instruction can append an integer, as a codepoint, into a
- * string. Then what happens if that codepoint does not exist in the
- * string's encoding? Of course an exception. That's not a leaf. */
-// attr bool leaf = false; /* has "invalid codepoint" exception */
-{
- val = vm_opt_ltlt(recv, obj);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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;
}
-}
-
-/* optimized X&Y. */
-DEFINE_INSN
-opt_and
-(CALL_DATA cd)
-(VALUE recv, VALUE obj)
-(VALUE val)
-{
- val = vm_opt_and(recv, obj);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ else {
+ PUSH(recv);
+ PUSH(obj);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized X|Y. */
+/**
+ @c optimize
+ @e <<
+ @j 最é©åŒ–ã•れ㟠X<<Y。
+ */
DEFINE_INSN
-opt_or
-(CALL_DATA cd)
+opt_ltlt
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
{
- val = vm_opt_or(recv, obj);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* [] */
+/**
+ @c optimize
+ @e []
+ @j 最é©åŒ–ã•れ㟠recv[obj]。
+ */
DEFINE_INSN
opt_aref
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv, VALUE obj)
(VALUE val)
-/* This is complicated. In case of hash, vm_opt_aref() resorts to
- * rb_hash_aref(). If `recv` has no `obj`, this function then yields
- * default_proc. This is a method call. So opt_aref is
- * (surprisingly) not leaf. */
-// attr bool leaf = false; /* has rb_funcall() */ /* calls #yield */
{
- val = vm_opt_aref(recv, obj);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* recv[obj] = set */
+/**
+ @c optimize
+ @e recv[obj] = set
+ @j 最é©åŒ–ã•れ㟠recv[obj] = set。
+ */
DEFINE_INSN
opt_aset
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv, VALUE obj, VALUE set)
(VALUE val)
-/* This is another story than opt_aref. When vm_opt_aset() resorts
- * to rb_hash_aset(), which should call #hash for `obj`. */
-// attr bool leaf = false; /* has rb_funcall() */ /* calls #hash */
{
- val = vm_opt_aset(recv, obj, set);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* recv[str] = set */
+/**
+ @c optimize
+ @e recv[str] = set
+ @j 最é©åŒ–ã•れ㟠recv[str] = set。
+ */
DEFINE_INSN
opt_aset_with
-(VALUE key, CALL_DATA cd)
+(CALL_INFO ci, VALUE key)
(VALUE recv, VALUE val)
(VALUE val)
-/* Same discussion as opt_aset. */
-// attr bool leaf = false; /* has rb_funcall() */ /* calls #hash */
{
- 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 {
-#ifndef MJIT_HEADER
- TOPN(0) = rb_str_resurrect(key);
+ PUSH(recv);
+ PUSH(rb_str_resurrect(key));
PUSH(val);
-#endif
- CALL_SIMPLE_METHOD();
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* recv[str] */
+/**
+ @c optimize
+ @e recv[str]
+ @j 最é©åŒ–ã•れ㟠recv[str]。
+ */
DEFINE_INSN
opt_aref_with
-(VALUE key, CALL_DATA cd)
+(CALL_INFO ci, VALUE key)
(VALUE recv)
(VALUE val)
-/* Same discussion as opt_aref. */
-// attr bool leaf = false; /* has rb_funcall() */ /* calls #yield */
{
- val = vm_opt_aref_with(recv, key);
-
- if (val == Qundef) {
-#ifndef MJIT_HEADER
+ 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));
-#endif
- CALL_SIMPLE_METHOD();
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized length */
+/**
+ @c optimize
+ @e optimized length
+ @j 最é©åŒ–ã•れ㟠recv.length()。
+ */
DEFINE_INSN
opt_length
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_length(recv, BOP_LENGTH);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized size */
+/**
+ @c optimize
+ @e optimized size
+ @j 最é©åŒ–ã•れ㟠recv.size()。
+ */
DEFINE_INSN
opt_size
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_length(recv, BOP_SIZE);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized empty? */
+/**
+ @c optimize
+ @e optimized empty?
+ @j 最é©åŒ–ã•れ㟠recv.empty?()。
+ */
DEFINE_INSN
opt_empty_p
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_empty_p(recv);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* optimized succ */
+/**
+ @c optimize
+ @e optimized succ
+ @j 最é©åŒ–ã•れ㟠recv.succ()。
+ */
DEFINE_INSN
opt_succ
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_succ(recv);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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
+ {
+ goto INSN_LABEL(normal_dispatch);
+ }
+ }
+ if (0) {
+ INSN_LABEL(normal_dispatch):
+ PUSH(recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized not */
+/**
+ @c optimize
+ @e optimized not
+ @j 最é©åŒ–ã•れ㟠recv.!()。
+ */
DEFINE_INSN
opt_not
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE recv)
(VALUE val)
{
- val = vm_opt_not(cd, recv);
+ extern VALUE rb_obj_not(VALUE obj);
+ vm_search_method(ci, recv);
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ if (check_cfunc(ci->me, rb_obj_not)) {
+ val = RTEST(recv) ? Qfalse : Qtrue;
+ }
+ else {
+ PUSH(recv);
+ CALL_SIMPLE_METHOD(recv);
}
}
-/* optimized regexp match 2 */
+
+/**
+ @c optimize
+ @e optimized regexp match
+ @j 最é©åŒ–ã•ã‚ŒãŸæ­£è¦è¡¨ç¾ãƒžãƒƒãƒã€‚
+ */
+DEFINE_INSN
+opt_regexpmatch1
+(VALUE r)
+(VALUE obj)
+(VALUE val)
+{
+ 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);
+ }
+}
+
+/**
+ @c optimize
+ @e optimized regexp match 2
+ @j 最é©åŒ–ã•ã‚ŒãŸæ­£è¦è¡¨ç¾ãƒžãƒƒãƒ 2
+ */
DEFINE_INSN
opt_regexpmatch2
-(CALL_DATA cd)
+(CALL_INFO ci)
(VALUE obj2, VALUE obj1)
(VALUE val)
-// attr bool leaf = false; /* match_at() has rb_thread_check_ints() */
{
- val = vm_opt_regexpmatch2(obj2, obj1);
-
- if (val == Qundef) {
- CALL_SIMPLE_METHOD();
+ 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);
}
}
-/* call native compiled method */
+/**
+ @c optimize
+ @e call native compiled method
+ @j ãƒã‚¤ãƒ†ã‚£ãƒ–コンパイルã—ãŸãƒ¡ã‚½ãƒƒãƒ‰ã‚’起動。
+ */
DEFINE_INSN
opt_call_c_function
(rb_insn_func_t funcptr)
()
()
-// attr bool leaf = false; /* anything can happen inside */
-// attr bool handles_sp = true;
{
- 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);
}
@@ -1474,56 +2221,12 @@ opt_call_c_function
NEXT_INSN();
}
-/* call specific function with args */
-DEFINE_INSN
-invokebuiltin
-(RB_BUILTIN bf)
-(...)
-(VALUE ret)
-// attr bool leaf = false; /* anything can happen inside */
-// attr rb_snum_t sp_inc = 1 - bf->argc;
-{
- ret = vm_invoke_builtin(ec, reg_cfp, bf, STACK_ADDR_FROM_TOP(bf->argc));
-}
-
-/* call specific function with args (same parameters) */
-DEFINE_INSN
-opt_invokebuiltin_delegate
-(RB_BUILTIN bf, rb_num_t index)
-()
-(VALUE ret)
-// attr bool leaf = false; /* anything can happen inside */
-{
- ret = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index);
-}
-
-/* call specific function with args (same parameters) and leave */
+/**
+ @c joke
+ @e BLT
+ @j BLT
+ */
DEFINE_INSN
-opt_invokebuiltin_delegate_leave
-(RB_BUILTIN bf, rb_num_t index)
-()
-(VALUE val)
-// attr bool leaf = false; /* anything can happen inside */
-{
- val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index);
-
- /* leave fastpath */
- /* TracePoint/return should fallback this insn to opt_invokebuiltin_delegate */
- if (vm_pop_frame(ec, GET_CFP(), GET_EP())) {
-#if OPT_CALL_THREADED_CODE
- rb_ec_thread_ptr(ec)->retval = val;
- return 0;
-#else
- return val;
-#endif
- }
- else {
- RESTORE_REGS();
- }
-}
-
-/* BLT */
-DEFINE_INSN_IF(SUPPORT_JOKE)
bitblt
()
()
@@ -1532,8 +2235,12 @@ bitblt
ret = rb_str_new2("a bit of bacon, lettuce and tomato");
}
-/* The Answer to Life, the Universe, and Everything */
-DEFINE_INSN_IF(SUPPORT_JOKE)
+/**
+ @c joke
+ @e The Answer to Life, the Universe, and Everything
+ @j 人生ã€å®‡å®™ã€ã™ã¹ã¦ã®ç­”ãˆã€‚
+ */
+DEFINE_INSN
answer
()
()
@@ -1541,3 +2248,4 @@ answer
{
ret = INT2FIX(42);
}
+
diff --git a/internal.h b/internal.h
index baefb36c02..7a76ba2548 100644
--- a/internal.h
+++ b/internal.h
@@ -13,6 +13,8 @@
#define RUBY_INTERNAL_H 1
#include "ruby.h"
+#include "ruby/encoding.h"
+#include "ruby/io.h"
#if defined(__cplusplus)
extern "C" {
@@ -21,66 +23,33 @@ extern "C" {
#endif
#endif
-#ifdef HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-# include "missing/stdbool.h"
-#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
-#endif
-
-#ifndef WARN_UNUSED_RESULT
-# define WARN_UNUSED_RESULT(x) x
-#endif
-
-#ifndef __has_feature
-# define __has_feature(x) 0
-#endif
+/* likely */
+#if __GNUC__ >= 3
+#define LIKELY(x) (__builtin_expect((x), 1))
+#define UNLIKELY(x) (__builtin_expect((x), 0))
+#else /* __GNUC__ >= 3 */
+#define LIKELY(x) (x)
+#define UNLIKELY(x) (x)
+#endif /* __GNUC__ >= 3 */
-#ifndef __has_extension
-# define __has_extension __has_feature
+#ifndef __has_attribute
+# define __has_attribute(x) 0
#endif
-#if 0
-#elif defined(NO_SANITIZE) && __has_feature(memory_sanitizer)
-# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
- NO_SANITIZE("memory", NO_SANITIZE("address", NOINLINE(x)))
-#elif defined(NO_SANITIZE)
-# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
- NO_SANITIZE("address", NOINLINE(x))
-#elif defined(NO_SANITIZE_ADDRESS)
-# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
- NO_SANITIZE_ADDRESS(NOINLINE(x))
-#elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
-# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
- NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(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 ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
-#endif
-
-#if defined(NO_SANITIZE) && defined(__GNUC__) &&! defined(__clang__)
-/* GCC warns about unknown sanitizer, which is annoying. */
-#undef NO_SANITIZE
-#define NO_SANITIZE(x, y) \
- COMPILER_WARNING_PUSH; \
- COMPILER_WARNING_IGNORED(-Wattributes); \
- __attribute__((__no_sanitize__(x))) y; \
- COMPILER_WARNING_POP
+#define UNINITIALIZED_VAR(x) x
#endif
-#ifndef NO_SANITIZE
-# define NO_SANITIZE(x, y) y
+#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
@@ -98,134 +67,22 @@ extern "C" {
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
-#ifndef MJIT_HEADER
-
-#ifdef HAVE_SANITIZER_ASAN_INTERFACE_H
-# include <sanitizer/asan_interface.h>
-#endif
-
-#if !__has_feature(address_sanitizer)
-# define __asan_poison_memory_region(x, y)
-# define __asan_unpoison_memory_region(x, y)
-# define __asan_region_is_poisoned(x, y) 0
-#endif
-
-#ifdef HAVE_SANITIZER_MSAN_INTERFACE_H
-# if __has_feature(memory_sanitizer)
-# include <sanitizer/msan_interface.h>
-# endif
-#endif
-
-#if !__has_feature(memory_sanitizer)
-# define __msan_allocated_memory(x, y) ((void)(x), (void)(y))
-# define __msan_poison(x, y) ((void)(x), (void)(y))
-# define __msan_unpoison(x, y) ((void)(x), (void)(y))
-# define __msan_unpoison_string(x) ((void)(x))
-#endif
-
-/*!
- * This function asserts that a (continuous) memory region from ptr to size
- * being "poisoned". Both read / write access to such memory region are
- * prohibited until properly unpoisoned. The region must be previously
- * allocated (do not pass a freed pointer here), but not necessarily be an
- * entire object that the malloc returns. You can punch hole a part of a
- * gigantic heap arena. This is handy when you do not free an allocated memory
- * region to reuse later: poison when you keep it unused, and unpoison when you
- * reuse.
- *
- * \param[in] ptr pointer to the beginning of the memory region to poison.
- * \param[in] size the length of the memory region to poison.
- */
-static inline void
-asan_poison_memory_region(const volatile void *ptr, size_t size)
-{
- __msan_poison(ptr, size);
- __asan_poison_memory_region(ptr, size);
-}
-
-/*!
- * This is a variant of asan_poison_memory_region that takes a VALUE.
- *
- * \param[in] obj target object.
- */
-static inline void
-asan_poison_object(VALUE obj)
-{
- MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
- asan_poison_memory_region(ptr, SIZEOF_VALUE);
-}
+#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))))
-#if !__has_feature(address_sanitizer)
-#define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj))
-#else
-#define asan_poison_object_if(ptr, obj) do { \
- if (ptr) asan_poison_object(obj); \
- } while (0)
+#ifndef __has_feature
+# define __has_feature(x) 0
#endif
-/*!
- * This function predicates if the given object is fully addressable or not.
- *
- * \param[in] obj target object.
- * \retval 0 the given object is fully addressable.
- * \retval otherwise pointer to first such byte who is poisoned.
- */
-static inline void *
-asan_poisoned_object_p(VALUE obj)
-{
- MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
- return __asan_region_is_poisoned(ptr, SIZEOF_VALUE);
-}
-
-/*!
- * This function asserts that a (formally poisoned) memory region from ptr to
- * size is now addressable. Write access to such memory region gets allowed.
- * However read access might or might not be possible depending on situations,
- * because the region can have contents of previous usages. That information
- * should be passed by the malloc_p flag. If that is true, the contents of the
- * region is _not_ fully defined (like the return value of malloc behaves).
- * Reading from there is NG; write something first. If malloc_p is false on
- * the other hand, that memory region is fully defined and can be read
- * immediately.
- *
- * \param[in] ptr pointer to the beginning of the memory region to unpoison.
- * \param[in] size the length of the memory region.
- * \param[in] malloc_p if the memory region is like a malloc's return value or not.
- */
-static inline void
-asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p)
-{
- __asan_unpoison_memory_region(ptr, size);
- if (malloc_p) {
- __msan_allocated_memory(ptr, size);
- }
- else {
- __msan_unpoison(ptr, size);
- }
-}
-
-/*!
- * This is a variant of asan_unpoison_memory_region that takes a VALUE.
- *
- * \param[in] obj target object.
- * \param[in] malloc_p if the memory region is like a malloc's return value or not.
- */
-static inline void
-asan_unpoison_object(VALUE obj, bool newobj_p)
-{
- MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
- asan_unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p);
-}
-
+#ifndef __has_extension
+# define __has_extension __has_feature
#endif
-/* Prevent compiler from reordering access */
-#define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
-
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
+#if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
# define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
-#elif GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
-# define STATIC_ASSERT(name, expr) RB_GNUC_EXTENSION _Static_assert(expr, #name ": " #expr)
#else
# define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
#endif
@@ -247,41 +104,15 @@ asan_unpoison_object(VALUE obj, bool newobj_p)
#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) \
- RB_GNUC_EXTENSION_BLOCK(__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) RB_GNUC_EXTENSION_BLOCK( \
- 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
@@ -326,20 +157,20 @@ asan_unpoison_object(VALUE obj, bool newobj_p)
# 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;}
@@ -352,24 +183,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;}
@@ -382,25 +213,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;}
@@ -413,17 +244,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;}
@@ -431,258 +262,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_UINTPTR_T == SIZEOF_INT
- return nlz_int(x);
-#elif SIZEOF_UINTPTR_T == SIZEOF_LONG
- return nlz_long(x);
-#elif SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG
- return nlz_long_long(x);
-#else
- #error no known integer type corresponds uintptr_t
- return /* sane compiler */ ~0;
-#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
+ return (int)(n - x);
}
-
-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
-}
-
-/* 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) && defined(HAVE_LONG_LONG)
+#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_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_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
@@ -739,8 +385,8 @@ rb_fix_mod_fix(VALUE x, VALUE y)
#define BIGNUM_EMBED_LEN_NUMBITS 3
#ifndef BIGNUM_EMBED_LEN_MAX
-# if (SIZEOF_VALUE*RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1
-# define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*RVALUE_EMBED_LEN_MAX/SIZEOF_ACTUAL_BDIGIT)
+# if (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT) < (1 << BIGNUM_EMBED_LEN_NUMBITS)-1
+# define BIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_ACTUAL_BDIGIT)
# else
# define BIGNUM_EMBED_LEN_MAX ((1 << BIGNUM_EMBED_LEN_NUMBITS)-1)
# endif
@@ -756,7 +402,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) \
@@ -764,17 +410,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)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT)
-#define BIGNUM_EMBED_LEN_SHIFT \
- (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */
+#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) \
@@ -787,13 +430,11 @@ struct RBignum {
struct RRational {
struct RBasic basic;
- VALUE num;
- VALUE den;
+ const VALUE num;
+ const VALUE den;
};
#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 RFloat {
struct RBasic basic;
@@ -804,298 +445,64 @@ struct RFloat {
struct RComplex {
struct RBasic basic;
- VALUE real;
- VALUE imag;
+ const VALUE real;
+ const VALUE imag;
};
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
-/* shortcut macro for internal only */
+#ifdef RCOMPLEX_SET_REAL /* shortcut macro for internal only */
+#undef RCOMPLEX_SET_REAL
+#undef RCOMPLEX_SET_IMAG
#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
-
-enum ruby_rhash_flags {
- RHASH_PASS_AS_KEYWORDS = FL_USER1, /* FL 1 */
- RHASH_PROC_DEFAULT = FL_USER2, /* FL 2 */
- RHASH_ST_TABLE_FLAG = FL_USER3, /* FL 3 */
-#define RHASH_AR_TABLE_MAX_SIZE SIZEOF_VALUE
- RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7), /* FL 4..7 */
- RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4),
- RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */
- RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8),
-
- // we can not put it in "enum" because it can exceed "int" range.
-#define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \
- FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19)
-
-#if USE_TRANSIENT_HEAP
- RHASH_TRANSIENT_FLAG = FL_USER12, /* FL 12 */
-#endif
-
- RHASH_LEV_SHIFT = (FL_USHIFT + 13),
- RHASH_LEV_MAX = 127, /* 7 bits */
-
- RHASH_ENUM_END
-};
-
-#define RHASH_AR_TABLE_SIZE_RAW(h) \
- ((unsigned int)((RBASIC(h)->flags & RHASH_AR_TABLE_SIZE_MASK) >> RHASH_AR_TABLE_SIZE_SHIFT))
-
-void rb_hash_st_table_set(VALUE hash, st_table *st);
-
-#if 0 /* for debug */
-int rb_hash_ar_table_p(VALUE hash);
-struct ar_table_struct *rb_hash_ar_table(VALUE hash);
-st_table *rb_hash_st_table(VALUE hash);
-#define RHASH_AR_TABLE_P(hash) rb_hash_ar_table_p(hash)
-#define RHASH_AR_TABLE(h) rb_hash_ar_table(h)
-#define RHASH_ST_TABLE(h) rb_hash_st_table(h)
-#else
-#define RHASH_AR_TABLE_P(hash) (!FL_TEST_RAW((hash), RHASH_ST_TABLE_FLAG))
-#define RHASH_AR_TABLE(hash) (RHASH(hash)->as.ar)
-#define RHASH_ST_TABLE(hash) (RHASH(hash)->as.st)
-#endif
-
-#define RHASH(obj) (R_CAST(RHash)(obj))
-#define RHASH_ST_SIZE(h) (RHASH_ST_TABLE(h)->num_entries)
-#define RHASH_ST_TABLE_P(h) (!RHASH_AR_TABLE_P(h))
-#define RHASH_ST_CLEAR(h) (FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG), RHASH(h)->as.ar = NULL)
-
-#define RHASH_AR_TABLE_SIZE_MASK (VALUE)RHASH_AR_TABLE_SIZE_MASK
-#define RHASH_AR_TABLE_SIZE_SHIFT RHASH_AR_TABLE_SIZE_SHIFT
-#define RHASH_AR_TABLE_BOUND_MASK (VALUE)RHASH_AR_TABLE_BOUND_MASK
-#define RHASH_AR_TABLE_BOUND_SHIFT RHASH_AR_TABLE_BOUND_SHIFT
-
-#if USE_TRANSIENT_HEAP
-#define RHASH_TRANSIENT_P(hash) FL_TEST_RAW((hash), RHASH_TRANSIENT_FLAG)
-#define RHASH_SET_TRANSIENT_FLAG(h) FL_SET_RAW(h, RHASH_TRANSIENT_FLAG)
-#define RHASH_UNSET_TRANSIENT_FLAG(h) FL_UNSET_RAW(h, RHASH_TRANSIENT_FLAG)
-#else
-#define RHASH_TRANSIENT_P(hash) 0
-#define RHASH_SET_TRANSIENT_FLAG(h) ((void)0)
-#define RHASH_UNSET_TRANSIENT_FLAG(h) ((void)0)
-#endif
-
-#if SIZEOF_VALUE / RHASH_AR_TABLE_MAX_SIZE == 2
-typedef uint16_t ar_hint_t;
-#elif SIZEOF_VALUE / RHASH_AR_TABLE_MAX_SIZE == 1
-typedef unsigned char ar_hint_t;
-#else
-#error unsupported
#endif
struct RHash {
struct RBasic basic;
- union {
- st_table *st;
- struct ar_table_struct *ar; /* possibly 0 */
- } as;
+ struct st_table *ntbl; /* possibly 0 */
+ int iter_lev;
const VALUE ifnone;
- union {
- ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE];
- VALUE word;
- } ar_hint;
};
-#ifdef RHASH_IFNONE
-# undef RHASH_IFNONE
-# undef RHASH_SIZE
-
-# define RHASH_IFNONE(h) (RHASH(h)->ifnone)
-# define RHASH_SIZE(h) (RHASH_AR_TABLE_P(h) ? RHASH_AR_TABLE_SIZE_RAW(h) : RHASH_ST_SIZE(h))
-#endif /* ifdef RHASH_IFNONE */
+#define RHASH(obj) (R_CAST(RHash)(obj))
-struct RMoved {
- VALUE flags;
- VALUE destination;
- VALUE next;
-};
+#ifdef RHASH_ITER_LEV
+#undef RHASH_ITER_LEV
+#undef RHASH_IFNONE
+#undef RHASH_SIZE
+#define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
+#define RHASH_IFNONE(h) (RHASH(h)->ifnone)
+#define RHASH_SIZE(h) (RHASH(h)->ntbl ? (st_index_t)RHASH(h)->ntbl->num_entries : 0)
+#endif
/* missing/setproctitle.c */
#ifndef HAVE_SETPROCTITLE
extern void ruby_init_setproctitle(int argc, char *argv[]);
#endif
-#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 = RVALUE_EMBED_LEN_MAX,
- RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
- RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
- RSTRUCT_TRANSIENT_FLAG = FL_USER3,
-
- RSTRUCT_ENUM_END
-};
-
-#if USE_TRANSIENT_HEAP
-#define RSTRUCT_TRANSIENT_P(st) FL_TEST_RAW((obj), RSTRUCT_TRANSIENT_FLAG)
-#define RSTRUCT_TRANSIENT_SET(st) FL_SET_RAW((st), RSTRUCT_TRANSIENT_FLAG)
-#define RSTRUCT_TRANSIENT_UNSET(st) FL_UNSET_RAW((st), RSTRUCT_TRANSIENT_FLAG)
-#else
-#define RSTRUCT_TRANSIENT_P(st) 0
-#define RSTRUCT_TRANSIENT_SET(st) ((void)0)
-#define RSTRUCT_TRANSIENT_UNSET(st) ((void)0)
-#endif
-
-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);
-}
-
-static inline const VALUE *
-rb_struct_const_heap_ptr(VALUE st)
-{
- /* TODO: check embed on debug mode */
- return 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
-#define PRI_SERIALT_PREFIX PRI_LL_PREFIX
-#define SIZEOF_SERIAL_T SIZEOF_LONG_LONG
-#elif defined(HAVE_UINT64_T)
-typedef uint64_t rb_serial_t;
-#define SERIALT2NUM SIZET2NUM
-#define PRI_SERIALT_PREFIX PRI_64_PREFIX
-#define SIZEOF_SERIAL_T SIZEOF_UINT64_T
-#else
-typedef unsigned long rb_serial_t;
-#define SERIALT2NUM ULONG2NUM
-#define PRI_SERIALT_PREFIX PRI_LONG_PREFIX
-#define SIZEOF_SERIAL_T SIZEOF_LONG
-#endif
-
-struct rb_classext_struct {
- struct st_table *iv_index_tbl;
- struct st_table *iv_tbl;
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
- struct rb_id_table *m_tbl;
-#endif
- 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;
-#if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
- rb_serial_t class_serial;
-#endif
- const VALUE origin_;
- const VALUE refined_class;
- rb_alloc_func_t allocator;
- const VALUE includer;
-};
-
-typedef struct rb_classext_struct rb_classext_t;
-
-#undef RClass
-struct RClass {
- struct RBasic basic;
- VALUE super;
- rb_classext_t *ptr;
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE
- /* Class serial is as wide as VALUE. Place it here. */
- rb_serial_t class_serial;
-#else
- /* Class serial does not fit into struct RClass. Place m_tbl instead. */
- struct rb_id_table *m_tbl;
-#endif
-};
-
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)
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE
-# define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
-#else
-# define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
-#endif
-#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)
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE
-# define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
-#else
-# define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
-#endif
-#define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
-
-#define RCLASS_CLONED FL_USER6
-#define RICLASS_IS_ORIGIN FL_USER5
-#define RCLASS_REFINED_BY_ANY FL_USER7
+#define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
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);
-}
-
-static inline void
-RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
-{
- RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
+ 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
@@ -1115,291 +522,16 @@ 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_tmpbuf = 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;
- }
-}
-
-VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
-
-/* 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;
- int 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;
- rb_block_call_func_t func;
- 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(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
-static inline struct vm_ifunc *
-rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data)
-{
- return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
-}
-
-typedef struct rb_imemo_tmpbuf_struct {
- VALUE flags;
- VALUE reserved;
- VALUE *ptr; /* malloc'ed buffer */
- struct rb_imemo_tmpbuf_struct *next; /* next imemo */
- size_t cnt; /* buffer size in VALUE */
-} rb_imemo_tmpbuf_t;
-
-#define rb_imemo_tmpbuf_auto_free_pointer() rb_imemo_new(imemo_tmpbuf, 0, 0, 0, 0)
-rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
-
-#define RB_IMEMO_TMPBUF_PTR(v) \
- ((void *)(((const struct rb_imemo_tmpbuf_struct *)(v))->ptr))
-
-static inline void *
-rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
-{
- return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr;
-}
-
-static inline VALUE
-rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
-{
- const void *src;
- VALUE imemo;
- rb_imemo_tmpbuf_t *tmpbuf;
- void *dst;
- size_t len;
-
- SafeStringValue(str);
- /* create tmpbuf to keep the pointer before xmalloc */
- imemo = rb_imemo_tmpbuf_auto_free_pointer();
- tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
- len = RSTRING_LEN(str);
- src = RSTRING_PTR(str);
- dst = ruby_xmalloc(len);
- memcpy(dst, src, len);
- tmpbuf->ptr = dst;
- return imemo;
-}
-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;
- void (*func)(void);
- } 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 */
/* array.c */
-
-#ifndef ARRAY_DEBUG
-#define ARRAY_DEBUG (0+RUBY_DEBUG)
-#endif
-
-#ifdef ARRAY_DEBUG
-#define RARRAY_PTR_IN_USE_FLAG FL_USER14
-#define ARY_PTR_USING_P(ary) FL_TEST_RAW((ary), RARRAY_PTR_IN_USE_FLAG)
-#else
-
-/* disable debug function */
-#undef RARRAY_PTR_USE_START_TRANSIENT
-#undef RARRAY_PTR_USE_END_TRANSIENT
-#define RARRAY_PTR_USE_START_TRANSIENT(a) ((VALUE *)RARRAY_CONST_PTR_TRANSIENT(a))
-#define RARRAY_PTR_USE_END_TRANSIENT(a)
-#define ARY_PTR_USING_P(ary) 0
-
-#endif
-
-#if USE_TRANSIENT_HEAP
-#define RARY_TRANSIENT_SET(ary) FL_SET_RAW((ary), RARRAY_TRANSIENT_FLAG);
-#define RARY_TRANSIENT_UNSET(ary) FL_UNSET_RAW((ary), RARRAY_TRANSIENT_FLAG);
-#else
-#undef RARRAY_TRANSIENT_P
-#define RARRAY_TRANSIENT_P(a) 0
-#define RARY_TRANSIENT_SET(ary) ((void)0)
-#define RARY_TRANSIENT_UNSET(ary) ((void)0)
-#endif
-
-
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);
size_t rb_ary_memsize(VALUE);
-VALUE rb_to_array_type(VALUE obj);
-VALUE rb_check_to_array(VALUE ary);
-VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *);
-VALUE rb_ary_behead(VALUE, long);
-#if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO)
+#ifdef __GNUC__
#define rb_ary_new_from_args(n, ...) \
__extension__ ({ \
const VALUE args_to_new_ary[] = {__VA_ARGS__}; \
@@ -1410,69 +542,15 @@ VALUE rb_ary_behead(VALUE, long);
})
#endif
-static inline VALUE
-rb_ary_entry_internal(VALUE ary, long offset)
-{
- long len = RARRAY_LEN(ary);
- const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
- if (len == 0) return Qnil;
- if (offset < 0) {
- offset += len;
- if (offset < 0) return Qnil;
- }
- else if (len <= offset) {
- return Qnil;
- }
- return ptr[offset];
-}
-
-/* MRI debug support */
-void rb_obj_info_dump(VALUE obj);
-void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func);
-void ruby_debug_breakpoint(void);
-
-// show obj data structure without any side-effect
-#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, __func__)
-
-// same as rp, but add message header
-#define rp_m(msg, obj) do { \
- fprintf(stderr, "%s", (msg)); \
- rb_obj_info_dump((VALUE)obj); \
-} while (0)
-
-// `ruby_debug_breakpoint()` does nothing,
-// but breakpoint is set in run.gdb, so `make gdb` can stop here.
-#define bp() ruby_debug_breakpoint()
-
/* 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_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception);
-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);
@@ -1480,51 +558,63 @@ 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;
-struct rb_iseq_struct;
-int rb_dvar_defined(ID, const struct rb_iseq_struct *);
-int rb_local_defined(ID, const struct rb_iseq_struct *);
+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);
-int rb_vm_insn_addr2insn(const void *);
-
-/* complex.c */
-VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
-struct rb_thread_struct;
/* cont.c */
VALUE rb_obj_is_fiber(VALUE);
-void rb_fiber_reset_root_local_storage(struct rb_thread_struct *);
-void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE));
+void rb_fiber_reset_root_local_storage(VALUE);
+void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE (*rollback_func)(ANYARGS));
/* 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 */
+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
+};
+
+#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);
-#ifdef RUBY_ENCODING_H
+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);
-#endif
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);
@@ -1532,63 +622,28 @@ 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 */
-extern VALUE rb_cArithSeq;
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);
+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_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3);
-#ifdef RUBY_ENCODING_H
-VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
+PRINTF_ARGS(void rb_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
-PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
-#endif
-
-typedef enum {
- RB_WARN_CATEGORY_NONE,
- RB_WARN_CATEGORY_DEPRECATED,
- RB_WARN_CATEGORY_EXPERIMENTAL,
-} rb_warning_category_t;
-rb_warning_category_t rb_warning_category_from_name(VALUE category);
-bool rb_warning_category_enabled_p(rb_warning_category_t category);
-
-#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_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv);
-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))
-PRINTF_ARGS(VALUE rb_warning_string(const char *fmt, ...), 1, 2);
-NORETURN(void rb_vraise(VALUE, const char *, va_list));
/* eval.c */
VALUE rb_refinement_module_get_refined_class(VALUE module);
-extern ID ruby_static_id_signo, ruby_static_id_status;
-void rb_class_modify_check(VALUE);
-#define id_signo ruby_static_id_signo
-#define id_status ruby_static_id_status
-NORETURN(VALUE rb_f_raise(int argc, VALUE *argv));
/* eval_error.c */
+void ruby_error_print(void);
VALUE rb_get_backtrace(VALUE info);
/* eval_jump.c */
@@ -1596,21 +651,16 @@ void rb_call_end_proc(VALUE data);
void rb_mark_end_proc(void);
/* file.c */
-extern const char ruby_null_device[];
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);
-#ifdef RUBY_ENCODING_H
-VALUE rb_check_realpath(VALUE basedir, VALUE path, rb_encoding *origenc);
-#endif
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);
-VALUE rb_get_path_check_convert(VALUE);
+VALUE rb_get_path_check_to_string(VALUE, int);
+VALUE rb_get_path_check_convert(VALUE, VALUE, int);
void Init_File(void);
-int ruby_is_fd_loadable(int fd);
#ifdef RUBY_FUNCTION_NAME_STRING
# if defined __GNUC__ && __GNUC__ >= 4
@@ -1632,7 +682,7 @@ NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path)
extern VALUE *ruby_initial_gc_stress_ptr;
extern int ruby_disable_gc;
void Init_heap(void);
-void *ruby_mimmalloc(size_t size) RUBY_ATTR_MALLOC;
+void *ruby_mimmalloc(size_t size);
void ruby_mimfree(void *ptr);
void rb_objspace_set_event_hook(const rb_event_flag_t event);
#if USE_RGENGC
@@ -1640,96 +690,64 @@ void rb_gc_writebarrier_remember(VALUE obj);
#else
#define rb_gc_writebarrier_remember(obj) 0
#endif
-void ruby_gc_set_params(void);
+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)
-#define ruby_sized_xrealloc2(ptr, new_count, element_size, old_count) ruby_xrealloc2(ptr, new_count, element_size)
+#define ruby_sized_xrealloc2(ptr, new_count, element_size, old_count) ruby_xrealloc(ptr, new_count, element_size)
#define ruby_sized_xfree(ptr, size) ruby_xfree(ptr)
#define SIZED_REALLOC_N(var,type,n,old_n) REALLOC_N(var, type, n)
#else
-RUBY_SYMBOL_EXPORT_BEGIN
-void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
-void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
+void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_ALLOC_SIZE((2));
+void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_ALLOC_SIZE((2, 3));
void ruby_sized_xfree(void *x, size_t size);
-RUBY_SYMBOL_EXPORT_END
-#define SIZED_REALLOC_N(var,type,n,old_n) ((var)=(type*)ruby_sized_xrealloc2((void*)(var), (n), sizeof(type), (old_n)))
+#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)
-
-#ifdef __has_attribute
-#if __has_attribute(alloc_align)
-__attribute__((__alloc_align__(1)))
-#endif
-#endif
-void *rb_aligned_malloc(size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_ALLOC_SIZE((2));
-
-size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */
-size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */
-void *rb_xmalloc_mul_add(size_t, size_t, size_t) RUBY_ATTR_MALLOC;
-void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t);
-void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t) RUBY_ATTR_MALLOC;
-void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t) RUBY_ATTR_MALLOC;
+void rb_gc_resurrect(VALUE ptr);
/* hash.c */
-#if RHASH_CONVERT_TABLE_DEBUG
-struct st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line);
-#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__)
-#else
struct st_table *rb_hash_tbl_raw(VALUE hash);
-#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
-#endif
-
-VALUE rb_hash_new_with_size(st_index_t size);
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_dbl_long_hash(double d);
+long rb_objid_hash(st_index_t index);
+VALUE rb_ident_hash_new(void);
st_table *rb_init_identtable(void);
-VALUE rb_hash_compare_by_id_p(VALUE hash);
-VALUE rb_to_hash_type(VALUE obj);
-VALUE rb_hash_key_str(VALUE);
+st_table *rb_init_identtable_with_size(st_index_t size);
+
+#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);
-VALUE rb_hash_resurrect(VALUE hash);
-int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val);
-VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
-
-int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval);
-int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
-RUBY_SYMBOL_EXPORT_BEGIN
-int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg);
-RUBY_SYMBOL_EXPORT_END
-int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
-int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func func, st_data_t arg);
+#define HASH_DELETED FL_USER1
+#define HASH_PROC_DEFAULT FL_USER2
/* inits.c */
void rb_call_inits(void);
/* io.c */
+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);
-#ifdef RUBY_IO_H
size_t rb_io_memsize(const rb_io_t *);
-#endif
-int rb_stderr_tty_p(void);
-void rb_io_fptr_finalize_internal(void *ptr);
-#define rb_io_fptr_finalize rb_io_fptr_finalize_internal
+
+/* 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 rb_require_internal(VALUE fname, int safe);
NORETURN(void rb_load_fail(VALUE, const char*));
/* loadpath.c */
@@ -1748,142 +766,22 @@ 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);
-
-/* mjit.c */
-
-#if USE_MJIT
-extern bool mjit_enabled;
-VALUE mjit_pause(bool wait_p);
-VALUE mjit_resume(void);
-void mjit_finish(bool close_handle_p);
-#else
-#define mjit_enabled 0
-static inline VALUE mjit_pause(bool wait_p){ return Qnil; } // unreachable
-static inline VALUE mjit_resume(void){ return Qnil; } // unreachable
-static inline void mjit_finish(bool close_handle_p){}
+#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))
-
-#define FLOAT_ZERO_P(x) (RFLOAT_VALUE(x) == 0.0)
-
-#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);
-double ruby_float_step_size(double beg, double end, double unit, int excl);
-int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
+int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
double ruby_float_mod(double x, double y);
int rb_num_negative_p(VALUE);
VALUE rb_int_succ(VALUE num);
-VALUE rb_int_uminus(VALUE num);
-VALUE rb_float_uminus(VALUE num);
-VALUE rb_int_plus(VALUE x, VALUE y);
-VALUE rb_float_plus(VALUE x, VALUE y);
-VALUE rb_int_minus(VALUE x, VALUE y);
-VALUE rb_int_mul(VALUE x, VALUE y);
-VALUE rb_float_mul(VALUE x, VALUE y);
-VALUE rb_float_div(VALUE x, VALUE y);
-VALUE rb_int_idiv(VALUE x, VALUE y);
-VALUE rb_int_modulo(VALUE x, VALUE y);
-VALUE rb_int2str(VALUE num, int base);
-VALUE rb_fix_plus(VALUE x, VALUE y);
-VALUE rb_fix_aref(VALUE fix, VALUE idx);
-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);
-int rb_int_positive_p(VALUE num);
-int rb_int_negative_p(VALUE num);
-VALUE rb_num_pow(VALUE x, VALUE y);
-VALUE rb_float_ceil(VALUE num, int ndigits);
-
-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);
-VALUE rb_flo_div_flo(VALUE x, VALUE y);
+VALUE rb_int_pred(VALUE num);
+VALUE rb_dbl_hash(double d);
#if USE_FLONUM
#define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
@@ -1891,41 +789,31 @@ VALUE rb_flo_div_flo(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)
{
@@ -1961,25 +849,17 @@ 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);
-int rb_bool_expected(VALUE, const char *);
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); \
@@ -1989,33 +869,37 @@ struct RBasicRaw {
#ifndef USE_SYMBOL_GC
#define USE_SYMBOL_GC 1
#endif
+VALUE rb_parser_get_yydebug(VALUE);
VALUE rb_parser_set_yydebug(VALUE, VALUE);
-RUBY_SYMBOL_EXPORT_BEGIN
-VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int);
-RUBY_SYMBOL_EXPORT_END
-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);
int rb_is_instance_name(VALUE name);
+int rb_is_attrset_name(VALUE name);
int rb_is_local_name(VALUE name);
-PUREFUNC(int rb_is_const_sym(VALUE sym));
-PUREFUNC(int rb_is_attrset_sym(VALUE sym));
+int rb_is_method_name(VALUE name);
+int rb_is_junk_name(VALUE name);
+int rb_is_const_sym(VALUE sym);
+int rb_is_class_sym(VALUE sym);
+int rb_is_global_sym(VALUE sym);
+int rb_is_instance_sym(VALUE sym);
+int rb_is_attrset_sym(VALUE sym);
+int rb_is_local_sym(VALUE sym);
+int rb_is_method_sym(VALUE sym);
+int rb_is_junk_sym(VALUE sym);
ID rb_make_internal_id(void);
void rb_gc_free_dsymbol(VALUE);
+ID rb_id_attrget(ID id);
/* proc.c */
VALUE rb_proc_location(VALUE self);
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
int rb_block_arity(void);
-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 waitpid_state;
struct rb_execarg {
union {
struct {
@@ -2044,9 +928,6 @@ struct rb_execarg {
unsigned new_pgroup_flag : 1;
unsigned uid_given : 1;
unsigned gid_given : 1;
- unsigned exception : 1;
- unsigned exception_given : 1;
- struct waitpid_state *waitpid_state; /* for async process management */
rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
mode_t umask_mask;
@@ -2058,7 +939,6 @@ struct rb_execarg {
VALUE fd_open;
VALUE fd_dup2_child;
VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
- VALUE path_env;
VALUE chdir_dir;
};
@@ -2066,91 +946,51 @@ struct rb_execarg {
* The beginning one is for /bin/sh used by exec_with_sh.
* The last one for terminating NULL used by execve.
* See rb_exec_fillarg() in process.c. */
-#define ARGVSTR2ARGV(argv_str) ((char **)RB_IMEMO_TMPBUF_PTR(argv_str) + 1)
-
-static inline size_t
-ARGVSTR2ARGC(VALUE argv_str)
-{
- size_t i = 0;
- char *const *p = ARGVSTR2ARGV(argv_str);
- while (p[i++])
- ;
- return i - 1;
-}
+#define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2)
+#define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1)
rb_pid_t rb_fork_ruby(int *status);
void rb_last_status_clear(void);
-/* range.c */
-#define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
-#define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
-#define RANGE_EXCL(r) (RSTRUCT(r)->as.ary[2])
-
/* rational.c */
-VALUE rb_rational_canonicalize(VALUE x);
-VALUE rb_rational_uminus(VALUE self);
-VALUE rb_rational_plus(VALUE self, VALUE other);
-VALUE rb_rational_mul(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_rational_pow(VALUE self, VALUE other);
-VALUE rb_numeric_quo(VALUE x, VALUE y);
-VALUE rb_float_numerator(VALUE x);
-VALUE rb_float_denominator(VALUE x);
/* 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);
-void rb_match_unbusy(VALUE);
-int rb_match_count(VALUE match);
-int rb_match_nth_defined(int nth, VALUE match);
-VALUE rb_reg_new_ary(VALUE ary, int options);
/* signal.c */
extern int ruby_enable_coredump;
int rb_get_next_signal(void);
+int rb_sigaltstack_size(void);
+
+/* strftime.c */
+#ifdef RUBY_ENCODING_H
+size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, rb_encoding *enc,
+ const struct vtm *vtm, struct timespec *ts, int gmt);
+size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc,
+ const struct vtm *vtm, VALUE timev, int gmt);
+#endif
/* string.c */
+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)
-#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_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 */
@@ -2159,121 +999,50 @@ VALUE rb_str_initialize(VALUE str, const char *ptr, long len, rb_encoding *enc);
#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, int kw_splat, 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);
-VALUE rb_obj_as_string_result(VALUE str, VALUE obj);
-const char *ruby_escaped_char(int c);
-VALUE rb_str_opt_plus(VALUE, VALUE);
-
-/* expect tail call optimization */
-static inline VALUE
-rb_str_eql_internal(const VALUE str1, const VALUE str2)
-{
- const long len = RSTRING_LEN(str1);
- const char *ptr1, *ptr2;
-
- if (len != RSTRING_LEN(str2)) return Qfalse;
- if (!rb_str_comparable(str1, str2)) return Qfalse;
- if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2)))
- return Qtrue;
- if (memcmp(ptr1, ptr2, len) == 0)
- return Qtrue;
- return Qfalse;
-}
-
-/* symbol.c */
-#ifdef RUBY_ENCODING_H
-VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
-#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
-#define COVERAGE_TARGET_ONESHOT_LINES 8
-
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);
-int rb_get_coverage_mode(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)(VALUE), VALUE data);
+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 */
+void Init_native_thread(void);
/* transcode.c */
extern VALUE rb_cEncodingConverter;
-#ifdef RUBY_ENCODING_H
size_t rb_econv_memsize(rb_econv_t *);
-#endif
/* us_ascii.c */
-#ifdef RUBY_ENCODING_H
extern rb_encoding OnigEncodingUS_ASCII;
-#endif
/* 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 */
-#ifdef RUBY_ENCODING_H
extern rb_encoding OnigEncodingUTF_8;
-#endif
/* variable.c */
-#if USE_TRANSIENT_HEAP
-#define ROBJECT_TRANSIENT_FLAG FL_USER13
-#define ROBJ_TRANSIENT_P(obj) FL_TEST_RAW((obj), ROBJECT_TRANSIENT_FLAG)
-#define ROBJ_TRANSIENT_SET(obj) FL_SET_RAW((obj), ROBJECT_TRANSIENT_FLAG)
-#define ROBJ_TRANSIENT_UNSET(obj) FL_UNSET_RAW((obj), ROBJECT_TRANSIENT_FLAG)
-#else
-#define ROBJ_TRANSIENT_P(obj) 0
-#define ROBJ_TRANSIENT_SET(obj) ((void)0)
-#define ROBJ_TRANSIENT_UNSET(obj) ((void)0)
-#endif
-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);
-VALUE rb_autoload_at_p(VALUE, ID, int);
-void rb_deprecate_constant(VALUE mod, const char *name);
-NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
-rb_gvar_getter_t *rb_gvar_getter_function_of(const struct rb_global_entry *);
-rb_gvar_setter_t *rb_gvar_setter_function_of(const struct rb_global_entry *);
-bool rb_gvar_is_traced(const struct rb_global_entry *);
-void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
+
+/* version.c */
+extern VALUE ruby_engine_name;
/* vm_insnhelper.h */
rb_serial_t rb_next_class_serial(void);
@@ -2283,135 +1052,40 @@ 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);
-MJIT_STATIC void rb_vm_pop_cfunc_frame(void);
+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);
-int rb_vm_check_optimizable_mid(VALUE mid);
VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
-MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE);
-PUREFUNC(st_table *rb_vm_fstring_table(void));
-
+VALUE ruby_vm_sysstack_error_copy(void);
/* vm_dump.c */
void rb_print_backtrace(void);
/* vm_eval.c */
void Init_vm_eval(void);
-VALUE rb_adjust_argv_kw_splat(int *, const VALUE **, int *);
VALUE rb_current_realfilepath(void);
VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE);
typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
rb_check_funcall_hook *hook, VALUE arg);
-VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv,
- rb_check_funcall_hook *hook, VALUE arg, int kw_splat);
-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);
-void Init_vm_stack_canary(void);
/* vm_method.c */
void Init_eval_method(void);
+int rb_method_defined_by(VALUE obj, ID mid, VALUE (*cfunc)(ANYARGS));
-enum method_missing_reason {
- MISSING_NOENTRY = 0x00,
- MISSING_PRIVATE = 0x01,
- MISSING_PROTECTED = 0x02,
- MISSING_FCALL = 0x04,
- MISSING_VCALL = 0x08,
- MISSING_SUPER = 0x10,
- MISSING_MISSING = 0x20,
- MISSING_NONE = 0x40
-};
-struct rb_callable_method_entry_struct;
-struct rb_method_definition_struct;
-struct rb_execution_context_struct;
-struct rb_control_frame_struct;
-struct rb_calling_info;
-struct rb_call_data;
-/* I have several reasons to chose 64 here:
- *
- * - A cache line must be a power-of-two size.
- * - Setting this to anything less than or equal to 32 boosts nothing.
- * - I have never seen an architecture that has 128 byte L1 cache line.
- * - I know Intel Core and Sparc T4 at least uses 64.
- * - I know jemalloc internally has this exact same `#define CACHE_LINE 64`.
- * https://github.com/jemalloc/jemalloc/blob/dev/include/jemalloc/internal/jemalloc_internal_types.h
- */
-#define CACHELINE 64
-struct rb_call_cache {
- /* inline cache: keys */
- rb_serial_t method_state;
- rb_serial_t class_serial[
- (CACHELINE
- - sizeof(rb_serial_t) /* method_state */
- - sizeof(struct rb_callable_method_entry_struct *) /* me */
- - sizeof(uintptr_t) /* method_serial */
- - sizeof(enum method_missing_reason) /* aux */
- - sizeof(VALUE (*)( /* call */
- struct rb_execution_context_struct *e,
- struct rb_control_frame_struct *,
- struct rb_calling_info *,
- const struct rb_call_data *)))
- / sizeof(rb_serial_t)
- ];
-
- /* inline cache: values */
- const struct rb_callable_method_entry_struct *me;
- uintptr_t method_serial; /* me->def->method_serial */
-
- VALUE (*call)(struct rb_execution_context_struct *ec,
- struct rb_control_frame_struct *cfp,
- struct rb_calling_info *calling,
- struct rb_call_data *cd);
-
- union {
- unsigned int index; /* used by ivar */
- enum method_missing_reason method_missing_reason; /* used by method_missing */
- } aux;
-};
-STATIC_ASSERT(cachelined, sizeof(struct rb_call_cache) <= CACHELINE);
-struct rb_call_info {
- /* fixed at compile time */
- ID mid;
- unsigned int flag;
- int orig_argc;
-};
-struct rb_call_data {
- struct rb_call_cache cc;
- struct rb_call_info ci;
-};
-RUBY_FUNC_EXPORTED
-RUBY_FUNC_NONNULL(1, VALUE rb_funcallv_with_cc(struct rb_call_data*, VALUE, ID, int, const VALUE*));
-RUBY_FUNC_EXPORTED
-RUBY_FUNC_NONNULL(1, bool rb_method_basic_definition_p_with_cc(struct rb_call_data *, VALUE, ID));
-
-#ifdef __GNUC__
-# define rb_funcallv(recv, mid, argc, argv) \
- __extension__({ \
- static struct rb_call_data rb_funcallv_data; \
- rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \
- })
-# define rb_method_basic_definition_p(klass, mid) \
- __extension__({ \
- static struct rb_call_data rb_mbdp; \
- (klass == Qfalse) ? /* hidden object cannot be overridden */ true : \
- rb_method_basic_definition_p_with_cc(&rb_mbdp, klass, mid); \
- })
-#endif
+/* miniprelude.c, prelude.c */
+void Init_prelude(void);
/* vm_backtrace.c */
void Init_vm_backtrace(void);
@@ -2423,7 +1097,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);
@@ -2431,11 +1106,6 @@ 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);
-/* array.c (export) */
-void rb_ary_detransient(VALUE a);
-VALUE *rb_ary_ptr_use_start(VALUE ary);
-void rb_ary_ptr_use_end(VALUE ary);
-
/* bignum.c (export) */
VALUE rb_big_mul_normal(VALUE x, VALUE y);
VALUE rb_big_mul_balance(VALUE x, VALUE y);
@@ -2454,239 +1124,69 @@ 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);
-
-/* enumerator.c (export) */
-VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv,
- rb_enumerator_size_func *size_fn,
- VALUE beg, VALUE end, VALUE step, int excl);
/* error.c (export) */
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)
-
-static inline int
-rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type)
-{
- return RB_TYPE_P(obj, T_DATA) && RTYPEDDATA_P(obj) && (RTYPEDDATA_TYPE(obj) == data_type);
-}
-#define rb_typeddata_is_instance_of rb_typeddata_is_instance_of_inline
/* file.c (export) */
-#if defined HAVE_READLINK && defined RUBY_ENCODING_H
-VALUE rb_readlink(VALUE path, rb_encoding *enc);
-#endif
#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) */
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) */
VALUE rb_int_positive_pow(long x, unsigned long y);
-/* object.c (export) */
-int rb_opts_exception_p(VALUE opts, int default_value);
-
/* process.c (export) */
int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
-VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell, int allow_exc_opt);
+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);
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
-/* signal.c (export) */
-int rb_grantpt(int fd);
-
/* string.c (export) */
-VALUE rb_str_tmp_frozen_acquire(VALUE str);
-void rb_str_tmp_frozen_release(VALUE str, VALUE tmp);
#ifdef RUBY_ENCODING_H
/* internal use */
VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc);
#endif
-VALUE rb_str_upto_each(VALUE, VALUE, int, int (*each)(VALUE, VALUE), VALUE);
-VALUE rb_str_upto_endless_each(VALUE, int (*each)(VALUE, VALUE), VALUE);
-
-/* thread.c (export) */
-int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
-
-/* time.c (export) */
-void ruby_reset_leap_second_info(void);
/* util.c (export) */
extern const signed char ruby_digit36_to_number_table[];
-extern const char ruby_hexdigits[];
extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
/* variable.c (export) */
+void rb_gc_mark_global_tbl(void);
void rb_mark_generic_ivar(VALUE);
-void rb_mv_generic_ivar(VALUE src, VALUE dst);
+void rb_mark_generic_ivar_tbl(void);
VALUE rb_const_missing(VALUE klass, VALUE name);
-int rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
-void rb_iv_tbl_copy(VALUE dst, VALUE src);
-/* 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 (export) */
size_t rb_obj_memsize_of(VALUE);
-void rb_gc_verify_internal_consistency(void);
-
-#define RB_OBJ_GC_FLAGS_MAX 6
+#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);
-void rb_gc_mark_vm_stack_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
-
-/* random.c */
-int ruby_fill_random_bytes(void *, size_t, int);
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
-
-/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-# define FLEX_ARY_LEN /* VALUE ary[]; */
-#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
-# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
-#else
-# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
-#endif
-
-/*
- * For declaring bitfields out of non-unsigned int types:
- * struct date {
- * BITFIELD(enum months, month, 4);
- * ...
- * };
- */
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-# define BITFIELD(type, name, size) type name : size
-#else
-# define BITFIELD(type, name, size) unsigned int name : size
-#endif
-
-#if defined(_MSC_VER)
-# define COMPILER_WARNING_PUSH __pragma(warning(push))
-# define COMPILER_WARNING_POP __pragma(warning(pop))
-# define COMPILER_WARNING_ERROR(flag) __pragma(warning(error: flag)))
-# define COMPILER_WARNING_IGNORED(flag) __pragma(warning(suppress: flag)))
-
-#elif defined(__clang__) /* clang 2.6 already had this feature */
-# define COMPILER_WARNING_PUSH _Pragma("clang diagnostic push")
-# define COMPILER_WARNING_POP _Pragma("clang diagnostic pop")
-# define COMPILER_WARNING_SPECIFIER(kind, msg) \
- clang diagnostic kind # msg
-# define COMPILER_WARNING_ERROR(flag) \
- COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(error, flag))
-# define COMPILER_WARNING_IGNORED(flag) \
- COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(ignored, flag))
-
-#elif GCC_VERSION_SINCE(4, 6, 0)
-/* https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Diagnostic-Pragmas.html */
-# define COMPILER_WARNING_PUSH _Pragma("GCC diagnostic push")
-# define COMPILER_WARNING_POP _Pragma("GCC diagnostic pop")
-# define COMPILER_WARNING_SPECIFIER(kind, msg) \
- GCC diagnostic kind # msg
-# define COMPILER_WARNING_ERROR(flag) \
- COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(error, flag))
-# define COMPILER_WARNING_IGNORED(flag) \
- COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(ignored, flag))
-
-#else /* other compilers to follow? */
-# define COMPILER_WARNING_PUSH /* nop */
-# define COMPILER_WARNING_POP /* nop */
-# define COMPILER_WARNING_ERROR(flag) /* nop */
-# define COMPILER_WARNING_IGNORED(flag) /* nop */
-#endif
-
-#define COMPILER_WARNING_PRAGMA(str) COMPILER_WARNING_PRAGMA_(str)
-#define COMPILER_WARNING_PRAGMA_(str) _Pragma(#str)
-
-#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \
- (defined(__clang__) || GCC_VERSION_SINCE(9, 0, 0))
-# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
- COMPILER_WARNING_PUSH; \
- COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
- typeof(expr) unaligned_member_access_result = (expr); \
- COMPILER_WARNING_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__))
-
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
diff --git a/io.c b/io.c
index 42528c0fd5..0cd5414a0d 100644
--- a/io.c
+++ b/io.c
@@ -11,37 +11,14 @@
**********************************************************************/
-#include "ruby/encoding.h"
+#include "internal.h"
#include "ruby/io.h"
#include "ruby/thread.h"
-#include "internal.h"
#include "dln.h"
-#include "encindex.h"
#include "id.h"
#include <ctype.h>
#include <errno.h>
#include "ruby_atomic.h"
-#include "ccan/list/list.h"
-
-/* non-Linux poll may not work on all FDs */
-#if defined(HAVE_POLL)
-# if defined(__linux__)
-# define USE_POLL 1
-# endif
-# if defined(__FreeBSD_version) && __FreeBSD_version >= 1100000
-# define USE_POLL 1
-# endif
-#endif
-
-#ifndef USE_POLL
-# define USE_POLL 0
-#endif
-
-#if !USE_POLL
-# include "vm_core.h"
-#endif
-
-#include "builtin.h"
#undef free
#define free(x) xfree(x)
@@ -57,7 +34,7 @@
# include <sys/socket.h>
#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
@@ -66,7 +43,7 @@
#endif
#ifdef __QNXNTO__
-#include <unix.h>
+#include "unix.h"
#endif
#include <sys/types.h>
@@ -82,6 +59,13 @@
#if !HAVE_OFF_T && !defined(off_t)
# define off_t long
#endif
+#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+# define PRI_OFF_T_PREFIX "ll"
+#elif SIZEOF_OFF_T == SIZEOF_LONG
+# define PRI_OFF_T_PREFIX "l"
+#else
+# define PRI_OFF_T_PREFIX ""
+#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
@@ -89,7 +73,8 @@
#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
@@ -111,12 +96,10 @@
#include <sys/uio.h>
#endif
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h> /* for WNOHANG on BSD */
-#endif
-
-#ifdef HAVE_COPYFILE_H
-# include <copyfile.h>
+#if defined(__BEOS__) || defined(__HAIKU__)
+# ifndef NOFILE
+# define NOFILE (OPEN_MAX)
+# endif
#endif
#include "ruby/util.h"
@@ -146,6 +129,13 @@
off_t __syscall(quad_t number, ...);
#endif
+#ifdef __native_client__
+# undef F_GETFD
+# ifdef NACL_NEWLIB
+# undef HAVE_IOCTL
+# endif
+#endif
+
#define IO_RBUF_CAPA_MIN 8192
#define IO_CBUF_CAPA_MIN (128*1024)
#define IO_RBUF_CAPA_FOR(fptr) (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN)
@@ -155,17 +145,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
-
-#if defined(_WIN32)
-# define RUBY_PIPE_NONBLOCK_DEFAULT (0)
-#elif defined(O_NONBLOCK)
- /* disabled for [Bug #15356] (Rack::Deflater + rails) failure: */
-# define RUBY_PIPE_NONBLOCK_DEFAULT (0)
-#else /* any platforms where O_NONBLOCK does not exist? */
-# define RUBY_PIPE_NONBLOCK_DEFAULT (0)
#endif
VALUE rb_cIO;
@@ -182,6 +161,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;
@@ -191,11 +171,11 @@ 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_mode, sym_perm, sym_extenc, sym_intenc, sym_encoding, sym_open_args;
static VALUE sym_textmode, sym_binmode, sym_autoclose;
static VALUE sym_SET, sym_CUR, sym_END;
-static VALUE sym_wait_readable, sym_wait_writable;
#ifdef SEEK_DATA
static VALUE sym_DATA;
#endif
@@ -208,7 +188,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;
};
@@ -217,27 +197,18 @@ static rb_atomic_t max_file_descriptor = NOFILE;
void
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;
- int err;
- if (fd < 0 || afd <= max_fd)
+ if (afd <= max_file_descriptor)
return;
-#if defined(HAVE_FCNTL) && defined(F_GETFL)
- err = fcntl(fd, F_GETFL) == -1;
-#else
- {
- struct stat buf;
- err = fstat(fd, &buf) != 0;
- }
-#endif
- if (err && errno == EBADF) {
+ 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);
}
}
@@ -257,7 +228,7 @@ rb_maygvl_fd_fix_cloexec(int fd)
flags2 = flags | FD_CLOEXEC; /* Set CLOEXEC for non-standard file descriptors: 3, 4, 5, ... */
if (flags != flags2) {
ret = fcntl(fd, F_SETFD, flags2);
- if (ret != 0) {
+ if (ret == -1) {
rb_bug("rb_maygvl_fd_fix_cloexec: fcntl(%d, F_SETFD, %d) failed: %s", fd, flags2, strerror(errno));
}
}
@@ -301,7 +272,7 @@ rb_cloexec_open(const char *pathname, int flags, mode_t mode)
flags |= O_NOINHERIT;
#endif
ret = open(pathname, flags, mode);
- if (ret < 0) return ret;
+ if (ret == -1) return -1;
if (ret <= 2 || o_cloexec_state == 0) {
rb_maygvl_fd_fix_cloexec(ret);
}
@@ -350,30 +321,12 @@ rb_cloexec_dup2(int oldfd, int newfd)
#else
ret = dup2(oldfd, newfd);
#endif
- if (ret < 0) return ret;
+ if (ret == -1) return -1;
}
rb_maygvl_fd_fix_cloexec(ret);
return ret;
}
-static int
-rb_fd_set_nonblock(int fd)
-{
-#ifdef _WIN32
- return rb_w32_set_nonblock(fd);
-#elif defined(F_GETFL)
- int oflags = fcntl(fd, F_GETFL);
-
- if (oflags == -1)
- return -1;
- if (oflags & O_NONBLOCK)
- return 0;
- oflags |= O_NONBLOCK;
- return fcntl(fd, F_SETFL, oflags);
-#endif
- return 0;
-}
-
int
rb_cloexec_pipe(int fildes[2])
{
@@ -382,7 +335,7 @@ rb_cloexec_pipe(int fildes[2])
#if defined(HAVE_PIPE2)
static int try_pipe2 = 1;
if (try_pipe2) {
- ret = pipe2(fildes, O_CLOEXEC | RUBY_PIPE_NONBLOCK_DEFAULT);
+ ret = pipe2(fildes, O_CLOEXEC);
if (ret != -1)
return ret;
/* pipe2 is available since Linux 2.6.27, glibc 2.9. */
@@ -397,7 +350,7 @@ rb_cloexec_pipe(int fildes[2])
#else
ret = pipe(fildes);
#endif
- if (ret < 0) return ret;
+ if (ret == -1) return -1;
#ifdef __CYGWIN__
if (ret == 0 && fildes[1] == -1) {
close(fildes[0]);
@@ -408,10 +361,6 @@ rb_cloexec_pipe(int fildes[2])
#endif
rb_maygvl_fd_fix_cloexec(fildes[0]);
rb_maygvl_fd_fix_cloexec(fildes[1]);
- if (RUBY_PIPE_NONBLOCK_DEFAULT) {
- rb_fd_set_nonblock(fildes[0]);
- rb_fd_set_nonblock(fildes[1]);
- }
return ret;
}
@@ -444,7 +393,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
ret = fcntl(fd, F_DUPFD, minfd);
#elif defined(HAVE_DUP)
ret = dup(fd);
- if (ret >= 0 && ret < minfd) {
+ if (ret != -1 && ret < minfd) {
const int prev_fd = ret;
ret = rb_cloexec_fcntl_dupfd(fd, minfd);
close(prev_fd);
@@ -453,7 +402,7 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
#else
# error "dup() or fcntl(F_DUPFD) must be supported."
#endif
- if (ret < 0) return ret;
+ if (ret == -1) return -1;
rb_maygvl_fd_fix_cloexec(ret);
return ret;
}
@@ -483,7 +432,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
@@ -517,14 +466,7 @@ static rb_io_t *flush_before_seek(rb_io_t *fptr);
* conversion IO process and universal newline decorator by default.
*/
#define NEED_READCONV(fptr) ((fptr)->encs.enc2 != NULL || (fptr)->encs.ecflags & ~ECONV_CRLF_NEWLINE_DECORATOR)
-#define WRITECONV_MASK ( \
- (ECONV_DECORATOR_MASK & ~ECONV_CRLF_NEWLINE_DECORATOR)|\
- ECONV_STATEFUL_DECORATOR_MASK|\
- 0)
-#define NEED_WRITECONV(fptr) ( \
- ((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || \
- ((fptr)->encs.ecflags & WRITECONV_MASK) || \
- 0)
+#define NEED_WRITECONV(fptr) (((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || ((fptr)->encs.ecflags & ((ECONV_DECORATOR_MASK & ~ECONV_CRLF_NEWLINE_DECORATOR)|ECONV_STATEFUL_DECORATOR_MASK)))
#define SET_BINARY_MODE(fptr) setmode((fptr)->fd, O_BINARY)
#define NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr) do {\
@@ -610,9 +552,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);
@@ -652,11 +593,7 @@ set_binary_mode_with_seek_cur(rb_io_t *fptr)
/* Unix */
# define DEFAULT_TEXTMODE 0
#define NEED_READCONV(fptr) ((fptr)->encs.enc2 != NULL || NEED_NEWLINE_DECORATOR_ON_READ(fptr))
-#define NEED_WRITECONV(fptr) ( \
- ((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || \
- NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) || \
- ((fptr)->encs.ecflags & (ECONV_DECORATOR_MASK|ECONV_STATEFUL_DECORATOR_MASK)) || \
- 0)
+#define NEED_WRITECONV(fptr) (((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) || ((fptr)->encs.ecflags & (ECONV_DECORATOR_MASK|ECONV_STATEFUL_DECORATOR_MASK)))
#define SET_BINARY_MODE(fptr) (void)(fptr)
#define NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr) (void)(fptr)
#define SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags) ((void)(enc2), (void)(ecflags))
@@ -684,15 +621,6 @@ is_socket(int fd, VALUE path)
static const char closed_stream[] = "closed stream";
-static void
-io_fd_check_closed(int fd)
-{
- if (fd < 0) {
- rb_thread_check_ints(); /* check for ruby_error_stream_closed */
- rb_raise(rb_eIOError, closed_stream);
- }
-}
-
void
rb_eof_error(void)
{
@@ -718,34 +646,30 @@ void
rb_io_check_closed(rb_io_t *fptr)
{
rb_io_check_initialized(fptr);
- io_fd_check_closed(fptr->fd);
+ if (fptr->fd < 0) {
+ rb_raise(rb_eIOError, closed_stream);
+ }
}
-static rb_io_t *
-rb_io_get_fptr(VALUE io)
-{
- rb_io_t *fptr = RFILE(io)->fptr;
- rb_io_check_initialized(fptr);
- return fptr;
-}
VALUE
rb_io_get_io(VALUE io)
{
- 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;
}
@@ -756,24 +680,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
@@ -949,16 +873,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)
{
@@ -966,12 +880,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);
@@ -994,7 +908,6 @@ io_alloc(VALUE klass)
struct io_internal_read_struct {
int fd;
- int nonblock;
void *buf;
size_t capa;
};
@@ -1013,44 +926,25 @@ struct io_internal_writev_struct {
};
#endif
-static int nogvl_wait_for_single_fd(int fd, short events);
static VALUE
internal_read_func(void *ptr)
{
struct io_internal_read_struct *iis = ptr;
- ssize_t r;
-retry:
- r = read(iis->fd, iis->buf, iis->capa);
- if (r < 0 && !iis->nonblock) {
- int e = errno;
- if (e == EAGAIN || e == EWOULDBLOCK) {
- if (nogvl_wait_for_single_fd(iis->fd, RB_WAITFD_IN) != -1) {
- goto retry;
- }
- errno = e;
- }
- }
- return r;
+ 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*
internal_write_func2(void *ptr)
{
- return (void*)internal_write_func(ptr);
+ struct io_internal_write_struct *iis = ptr;
+ return (void*)(intptr_t)write(iis->fd, iis->buf, iis->capa);
}
#ifdef HAVE_WRITEV
@@ -1058,9 +952,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
@@ -1068,9 +960,7 @@ static ssize_t
rb_read_internal(int fd, void *buf, size_t count)
{
struct io_internal_read_struct iis;
-
iis.fd = fd;
- iis.nonblock = 0;
iis.buf = buf;
iis.capa = count;
@@ -1192,6 +1082,7 @@ io_fflush(rb_io_t *fptr)
rb_io_check_closed(fptr);
if (fptr->wbuf.len == 0)
return 0;
+ rb_io_check_closed(fptr);
while (fptr->wbuf.len > 0 && io_flush_buffer(fptr) != 0) {
if (!rb_io_wait_writable(fptr->fd))
return -1;
@@ -1203,7 +1094,9 @@ io_fflush(rb_io_t *fptr)
int
rb_io_wait_readable(int f)
{
- io_fd_check_closed(f);
+ if (f < 0) {
+ rb_raise(rb_eIOError, closed_stream);
+ }
switch (errno) {
case EINTR:
#if defined(ERESTART)
@@ -1227,7 +1120,9 @@ rb_io_wait_readable(int f)
int
rb_io_wait_writable(int f)
{
- io_fd_check_closed(f);
+ if (f < 0) {
+ rb_raise(rb_eIOError, closed_stream);
+ }
switch (errno) {
case EINTR:
#if defined(ERESTART)
@@ -1344,8 +1239,8 @@ io_binwrite_string(VALUE arg)
r = rb_writev_internal(fptr->fd, iov, 2);
- if (r < 0)
- return r;
+ if (r == -1)
+ return -1;
if (fptr->wbuf.len <= r) {
r -= fptr->wbuf.len;
@@ -1458,11 +1353,6 @@ io_binwrite(VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
# define MODE_BTMODE(a,b,c) ((fmode & FMODE_BINMODE) ? (b) : \
(fmode & FMODE_TEXTMODE) ? (c) : (a))
-
-#define MODE_BTXMODE(a, b, c, d, e, f) ((fmode & FMODE_EXCL) ? \
- MODE_BTMODE(d, e, f) : \
- MODE_BTMODE(a, b, c))
-
static VALUE
do_writeconv(VALUE str, rb_io_t *fptr, int *converted)
{
@@ -1524,9 +1414,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);
@@ -1536,13 +1423,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
@@ -1576,210 +1461,21 @@ io_write(VALUE io, VALUE str, int nosync)
rb_io_check_writable(fptr);
n = io_fwrite(str, fptr, nosync);
- if (n < 0L) rb_sys_fail_path(fptr->pathv);
+ if (n == -1L) rb_sys_fail_path(fptr->pathv);
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;
-}
-
-static int
-iovcnt_ok(int iovcnt)
-{
-#ifdef IOV_MAX
- return iovcnt < IOV_MAX;
-#else /* GNU/Hurd has writev, but no IOV_MAX */
- return 1;
-#endif
-}
-#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)) && iovcnt_ok(cnt = argc - i)) {
- 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 < 0L) 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>
@@ -1789,15 +1485,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
@@ -1806,23 +1496,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
@@ -1967,7 +1640,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>:
@@ -2033,7 +1706,7 @@ static void clear_readconv(rb_io_t *fptr);
* ios.rewind -> 0
*
* Positions <em>ios</em> to the beginning of input, resetting
- * #lineno to zero.
+ * <code>lineno</code> to zero.
*
* f = File.new("testfile")
* f.readline #=> "This is line one\n"
@@ -2063,16 +1736,6 @@ rb_io_rewind(VALUE io)
}
static int
-fptr_wait_readable(rb_io_t *fptr)
-{
- int ret = rb_io_wait_readable(fptr->fd);
-
- if (ret)
- rb_io_check_closed(fptr);
- return ret;
-}
-
-static int
io_fillbuf(rb_io_t *fptr)
{
ssize_t r;
@@ -2092,18 +1755,16 @@ io_fillbuf(rb_io_t *fptr)
r = rb_read_internal(fptr->fd, fptr->rbuf.ptr, fptr->rbuf.capa);
}
if (r < 0) {
- if (fptr_wait_readable(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)
@@ -2119,14 +1780,14 @@ io_fillbuf(rb_io_t *fptr)
*
* Returns true if <em>ios</em> is at end of file that means
* there are no more data to read.
- * The stream must be opened for reading or an IOError will be
+ * The stream must be opened for reading or an <code>IOError</code> will be
* raised.
*
* f = File.new("testfile")
* dummy = f.readlines
* f.eof #=> true
*
- * If <em>ios</em> is a stream such as pipe or socket, IO#eof?
+ * If <em>ios</em> is a stream such as pipe or socket, <code>IO#eof?</code>
* blocks until the other end sends some data or closes it.
*
* r, w = IO.pipe
@@ -2140,9 +1801,10 @@ io_fillbuf(rb_io_t *fptr)
* r, w = IO.pipe
* r.eof? # blocks forever
*
- * Note that IO#eof? reads data to the input byte buffer. So
- * IO#sysread may not behave as you intend with IO#eof?, unless you
- * call IO#rewind first (which is not available for some streams).
+ * Note that <code>IO#eof?</code> reads data to the input byte buffer.
+ * So <code>IO#sysread</code> may not behave as you intend with
+ * <code>IO#eof?</code>, unless you call <code>IO#rewind</code>
+ * first (which is not available for some streams).
*/
VALUE
@@ -2174,7 +1836,7 @@ rb_io_eof(VALUE io)
* Returns the current ``sync mode'' of <em>ios</em>. When sync mode is
* true, all output is immediately flushed to the underlying operating
* system and is not buffered by Ruby internally. See also
- * IO#fsync.
+ * <code>IO#fsync</code>.
*
* f = File.new("testfile")
* f.sync #=> false
@@ -2199,10 +1861,12 @@ rb_io_sync(VALUE io)
* Sets the ``sync mode'' to <code>true</code> or <code>false</code>.
* When sync mode is true, all output is immediately flushed to the
* underlying operating system and is not buffered internally. Returns
- * the new state. See also IO#fsync.
+ * the new state. See also <code>IO#fsync</code>.
*
* f = File.new("testfile")
* f.sync = true
+ *
+ * <em>(produces no output)</em>
*/
static VALUE
@@ -2226,11 +1890,12 @@ rb_io_set_sync(VALUE io, VALUE sync)
* ios.fsync -> 0 or nil
*
* Immediately writes all buffered data in <em>ios</em> to disk.
- * Note that #fsync differs from using IO#sync=. The latter ensures
- * that data is flushed from Ruby's buffers, but does not guarantee
- * that the underlying operating system actually writes it to disk.
+ * Note that <code>fsync</code> differs from
+ * using <code>IO#sync=</code>. The latter ensures that data is flushed
+ * from Ruby's buffers, but does not guarantee that the underlying
+ * operating system actually writes it to disk.
*
- * NotImplementedError is raised
+ * <code>NotImplementedError</code> is raised
* if the underlying operating system does not support <em>fsync(2)</em>.
*/
@@ -2279,8 +1944,8 @@ nogvl_fdatasync(void *ptr)
* Immediately writes all buffered data in <em>ios</em> to disk.
*
* If the underlying operating system does not support <em>fdatasync(2)</em>,
- * IO#fsync is called instead (which might raise a
- * NotImplementedError).
+ * <code>IO#fsync</code> is called instead (which might raise a
+ * <code>NotImplementedError</code>).
*/
static VALUE
@@ -2306,8 +1971,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>.
@@ -2330,10 +1995,10 @@ 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 IO.popen.
+ * <em>ios</em>. This will be set by <code>IO.popen</code>.
*
* pipe = IO.popen("-")
* if pipe
@@ -2398,7 +2063,7 @@ rb_io_inspect(VALUE obj)
/*
* call-seq:
- * ios.to_io -> ios
+ * ios.to_io -> ios
*
* Returns <em>ios</em>.
*/
@@ -2437,7 +2102,7 @@ io_bufread(char *ptr, long len, rb_io_t *fptr)
c = rb_read_internal(fptr->fd, ptr+offset, n);
if (c == 0) break;
if (c < 0) {
- if (fptr_wait_readable(fptr))
+ if (rb_io_wait_readable(fptr->fd))
goto again;
return -1;
}
@@ -2461,7 +2126,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;
@@ -2493,6 +2158,16 @@ io_fread(VALUE str, long offset, long size, rb_io_t *fptr)
return len;
}
+ssize_t
+rb_io_bufread(VALUE io, void *buf, size_t size)
+{
+ rb_io_t *fptr;
+
+ GetOpenFile(io, fptr);
+ rb_io_check_readable(fptr);
+ return (ssize_t)io_bufread(buf, (long)size, fptr);
+}
+
static long
remain_size(rb_io_t *fptr)
{
@@ -2501,7 +2176,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
)
@@ -2525,6 +2200,7 @@ remain_size(rb_io_t *fptr)
static VALUE
io_enc_str(VALUE str, rb_io_t *fptr)
{
+ OBJ_TAINT(str);
rb_enc_associate(str, io_read_encoding(fptr));
return str;
}
@@ -2612,7 +2288,7 @@ fill_cbuf(rb_io_t *fptr, int ec_flags)
if (res == econv_source_buffer_empty) {
if (fptr->rbuf.len == 0) {
READ_CHECK(fptr);
- if (io_fillbuf(fptr) < 0) {
+ if (io_fillbuf(fptr) == -1) {
if (!fptr->readconv) {
return MORE_CHAR_FINISHED;
}
@@ -2654,6 +2330,7 @@ io_shift_cbuf(rb_io_t *fptr, int len, VALUE *strp)
else {
rb_str_cat(str, fptr->cbuf.ptr+fptr->cbuf.off, len);
}
+ OBJ_TAINT(str);
rb_enc_associate(str, fptr->encs.enc);
}
fptr->cbuf.off += len;
@@ -2668,45 +2345,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);
}
}
@@ -2718,12 +2383,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;
@@ -2742,7 +2406,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);
}
}
@@ -2756,7 +2419,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);
@@ -2772,7 +2435,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;
@@ -2781,43 +2443,62 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
void
rb_io_set_nonblock(rb_io_t *fptr)
{
- if (rb_fd_set_nonblock(fptr->fd) != 0) {
+#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);
+ if (oflags == -1) {
+ rb_sys_fail_path(fptr->pathv);
+ }
+#else
+ oflags = 0;
+#endif
+ if ((oflags & O_NONBLOCK) == 0) {
+ oflags |= O_NONBLOCK;
+ if (fcntl(fptr->fd, F_SETFL, oflags) == -1) {
+ rb_sys_fail_path(fptr->pathv);
+ }
+ }
+#endif
}
-static VALUE
-read_internal_call(VALUE arg)
-{
- struct io_internal_read_struct *iis = (struct io_internal_read_struct *)arg;
+void
+rb_readwrite_sys_fail(int writable, const char *mesg);
- return rb_thread_io_blocking_region(internal_read_func, iis, iis->fd);
-}
+struct read_internal_arg {
+ int fd;
+ char *str_ptr;
+ long len;
+};
-static long
-read_internal_locktmp(VALUE str, struct io_internal_read_struct *iis)
+static VALUE
+read_internal_call(VALUE arg)
{
- return (long)rb_str_locktmp_ensure(str, read_internal_call, (VALUE)iis);
+ struct read_internal_arg *p = (struct read_internal_arg *)arg;
+ p->len = rb_read_internal(p->fd, p->str_ptr, p->len);
+ return Qundef;
}
-#define no_exception_p(opts) !rb_opts_exception_p((opts), TRUE)
-
static VALUE
-io_getpartial(int argc, VALUE *argv, VALUE io, int no_exception, 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 io_internal_read_struct iis;
- int shrinkable;
+ struct read_internal_arg arg;
- 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);
rb_io_check_byte_readable(fptr);
@@ -2834,26 +2515,24 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int no_exception, int nonblock)
rb_io_set_nonblock(fptr);
}
io_setstrbuf(&str, len);
- iis.fd = fptr->fd;
- iis.nonblock = nonblock;
- iis.buf = RSTRING_PTR(str);
- iis.capa = len;
- n = read_internal_locktmp(str, &iis);
+ 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 (!nonblock && fptr_wait_readable(fptr))
+ if (!nonblock && rb_io_wait_readable(fptr->fd))
goto again;
- if (nonblock && (e == EWOULDBLOCK || e == EAGAIN)) {
+ if (nonblock && (errno == EWOULDBLOCK || errno == EAGAIN)) {
if (no_exception)
- return sym_wait_readable;
+ 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;
@@ -2869,13 +2548,11 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int no_exception, 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 EOFError on end of file.
+ * It raises <code>EOFError</code> on end of file.
*
* readpartial is designed for streams such as pipe, socket, tty, etc.
* It blocks only when no data immediately available.
@@ -2914,15 +2591,11 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int no_exception, int nonblock)
*
* Note that readpartial behaves similar to sysread.
* The differences are:
- * * 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.
+ * * 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.
- * It blocks on the situation IO#sysread causes Errno::EWOULDBLOCK as
- * if the fd is blocking mode.
+ * 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.
*
*/
@@ -2931,82 +2604,109 @@ 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(int no_exception)
+get_kwargs_exception(VALUE opts)
{
- if (!no_exception) {
- rb_eof_error();
- }
- return Qnil;
-}
+ static ID ids[1];
+ VALUE except;
-/* :nodoc: */
-static VALUE
-io_read_nonblock(rb_execution_context_t *ec, VALUE io, VALUE length, VALUE str, VALUE ex)
-{
- rb_io_t *fptr;
- long n, len;
- struct io_internal_read_struct iis;
- int shrinkable;
+ if (!ids[0])
+ ids[0] = id_exception;
- if ((len = NUM2LONG(length)) < 0) {
- rb_raise(rb_eArgError, "negative length %ld given", len);
- }
+ rb_get_kwargs(opts, ids, 0, 1, &except);
+ return except;
+}
- shrinkable = io_setstrbuf(&str, len);
- rb_bool_expected(ex, "exception");
+/*
+ * 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.
+ */
- GetOpenFile(io, fptr);
- rb_io_check_byte_readable(fptr);
+static VALUE
+io_read_nonblock(int argc, VALUE *argv, VALUE io)
+{
+ VALUE ret;
+ VALUE opts = Qnil;
+ int no_exception = 0;
- if (len == 0)
- return str;
+ rb_scan_args(argc, argv, "11:", NULL, NULL, &opts);
- n = read_buffered_data(RSTRING_PTR(str), len, fptr);
- if (n <= 0) {
- rb_io_set_nonblock(fptr);
- shrinkable |= io_setstrbuf(&str, len);
- iis.fd = fptr->fd;
- iis.nonblock = 1;
- iis.buf = RSTRING_PTR(str);
- iis.capa = len;
- n = read_internal_locktmp(str, &iis);
- if (n < 0) {
- int e = errno;
- if ((e == EWOULDBLOCK || e == EAGAIN)) {
- if (!ex) return sym_wait_readable;
- rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE,
- e, "read would block");
- }
- rb_syserr_fail_path(e, fptr->pathv);
- }
+ if (!NIL_P(opts) && Qfalse == get_kwargs_exception(opts)) {
+ no_exception = 1;
+ argc--;
}
- io_set_read_length(str, n, shrinkable);
- if (n == 0) {
- if (!ex) return Qnil;
- rb_eof_error();
- }
+ ret = io_getpartial(argc, argv, io, 1, no_exception);
- return str;
+ if (NIL_P(ret)) {
+ if (no_exception)
+ return Qnil;
+ else
+ rb_eof_error();
+ }
+ return ret;
}
-/* :nodoc: */
static VALUE
-io_write_nonblock(rb_execution_context_t *ec, VALUE io, VALUE str, VALUE ex)
+io_write_nonblock(VALUE io, VALUE str, int no_exception)
{
rb_io_t *fptr;
long n;
if (!RB_TYPE_P(str, T_STRING))
str = rb_obj_as_string(str);
- rb_bool_expected(ex, "exception");
io = GetWriteIO(io);
GetOpenFile(io, fptr);
@@ -3017,19 +2717,17 @@ io_write_nonblock(rb_execution_context_t *ec, 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 < 0) {
- int e = errno;
- if (e == EWOULDBLOCK || e == EAGAIN) {
- if (!ex) {
- return sym_wait_writable;
+ if (n == -1) {
+ 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);
@@ -3037,69 +2735,141 @@ io_write_nonblock(rb_execution_context_t *ec, 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 tries 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
@@ -3108,7 +2878,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
@@ -3125,12 +2894,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;
}
@@ -3139,13 +2908,14 @@ 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);
}
#endif
if (n == 0) return Qnil;
+ OBJ_TAINT(str);
return str;
}
@@ -3290,7 +3060,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;
@@ -3303,33 +3073,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;
@@ -3341,37 +3099,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;
@@ -3384,20 +3127,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;
@@ -3410,7 +3143,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",
@@ -3419,30 +3151,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));
@@ -3450,7 +3175,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;
@@ -3458,7 +3183,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);
@@ -3483,10 +3207,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;
@@ -3498,13 +3221,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);
@@ -3532,28 +3249,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;
}
}
@@ -3563,57 +3264,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 IOError will be raised.
- * The line read in will be returned and also assigned to
- * <code>$_</code>. Returns +nil+ if called at end of file. If the
- * first argument is an integer, or optional second argument is given,
- * the returning string would not be longer than the given value in
- * bytes.
+ * The stream must be opened for reading or an <code>IOError</code>
+ * will be raised. The line read in will be returned and also assigned
+ * to <code>$_</code>. Returns <code>nil</code> if called at end of
+ * 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
@@ -3632,12 +3314,12 @@ rb_io_gets_m(int argc, VALUE *argv, VALUE io)
* ios.lineno -> integer
*
* Returns the current line number in <em>ios</em>. The stream must be
- * opened for reading. #lineno counts the number of times #gets is called
- * rather than the number of newlines encountered. The two values will
- * differ if #gets is called with a separator other than newline.
+ * opened for reading. <code>lineno</code> counts the number of times
+ * #gets is called rather than the number of newlines encountered. The two
+ * values will differ if #gets is called with a separator other than newline.
*
* Methods that use <code>$/</code> like #each, #lines and #readline will
- * also increment #lineno.
+ * also increment <code>lineno</code>.
*
* See also the <code>$.</code> variable.
*
@@ -3689,11 +3371,12 @@ 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 IO#gets, but raises an EOFError on end of file.
+ * Reads a line as with <code>IO#gets</code>, but raises an
+ * <code>EOFError</code> on end of file.
*/
static VALUE
@@ -3707,50 +3390,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 IOError will be raised.
+ * 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;
@@ -3758,19 +3426,19 @@ 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
- * reading or an IOError will be raised.
+ * reading or an <code>IOError</code> will be raised.
*
* If no block is given, an enumerator is returned instead.
*
@@ -3783,34 +3451,32 @@ 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;
}
/*
- * This is a deprecated alias for #each_line.
+ * This is a deprecated alias for <code>each_line</code>.
*/
static VALUE
rb_io_lines(int argc, VALUE *argv, VALUE io)
{
- rb_warn_deprecated("IO#lines", "#each_line");
+ rb_warn("IO#lines is deprecated; use #each_line instead");
if (!rb_block_given_p())
return rb_enumeratorize(io, ID2SYM(rb_intern("each_line")), argc, argv);
return rb_io_each_line(argc, argv, io);
@@ -3823,7 +3489,7 @@ rb_io_lines(int argc, VALUE *argv, VALUE io)
*
* Calls the given block once for each byte (0..255) in <em>ios</em>,
* passing the byte as an argument. The stream must be opened for
- * reading or an IOError will be raised.
+ * reading or an <code>IOError</code> will be raised.
*
* If no block is given, an enumerator is returned instead.
*
@@ -3855,13 +3521,13 @@ rb_io_each_byte(VALUE io)
}
/*
- * This is a deprecated alias for #each_byte.
+ * This is a deprecated alias for <code>each_byte</code>.
*/
static VALUE
rb_io_bytes(VALUE io)
{
- rb_warn_deprecated("IO#bytes", "#each_byte");
+ rb_warn("IO#bytes is deprecated; use #each_byte instead");
if (!rb_block_given_p())
return rb_enumeratorize(io, ID2SYM(rb_intern("each_byte")), 0, 0);
return rb_io_each_byte(io);
@@ -3874,9 +3540,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);
@@ -3981,7 +3647,7 @@ io_getc(rb_io_t *fptr, rb_encoding *enc)
*
* Calls the given block once for each character in <em>ios</em>,
* passing the character as an argument. The stream must be opened for
- * reading or an IOError will be raised.
+ * reading or an <code>IOError</code> will be raised.
*
* If no block is given, an enumerator is returned instead.
*
@@ -4009,13 +3675,13 @@ rb_io_each_char(VALUE io)
}
/*
- * This is a deprecated alias for #each_char.
+ * This is a deprecated alias for <code>each_char</code>.
*/
static VALUE
rb_io_chars(VALUE io)
{
- rb_warn_deprecated("IO#chars", "#each_char");
+ rb_warn("IO#chars is deprecated; use #each_char instead");
if (!rb_block_given_p())
return rb_enumeratorize(io, ID2SYM(rb_intern("each_char")), 0, 0);
return rb_io_each_char(io);
@@ -4029,9 +3695,9 @@ rb_io_chars(VALUE io)
* ios.each_codepoint -> an_enumerator
* ios.codepoints -> an_enumerator
*
- * Passes the Integer ordinal of each character in <i>ios</i>,
+ * Passes the <code>Integer</code> ordinal of each character in <i>ios</i>,
* passing the codepoint as an argument. The stream must be opened for
- * reading or an IOError will be raised.
+ * reading or an <code>IOError</code> will be raised.
*
* If no block is given, an enumerator is returned instead.
*
@@ -4137,13 +3803,13 @@ rb_io_each_codepoint(VALUE io)
}
/*
- * This is a deprecated alias for #each_codepoint.
+ * This is a deprecated alias for <code>each_codepoint</code>.
*/
static VALUE
rb_io_codepoints(VALUE io)
{
- rb_warn_deprecated("IO#codepoints", "#each_codepoint");
+ rb_warn("IO#codepoints is deprecated; use #each_codepoint instead");
if (!rb_block_given_p())
return rb_enumeratorize(io, ID2SYM(rb_intern("each_codepoint")), 0, 0);
return rb_io_each_codepoint(io);
@@ -4155,7 +3821,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"
@@ -4181,7 +3847,7 @@ rb_io_getc(VALUE io)
* ios.readchar -> string
*
* Reads a one-character string from <em>ios</em>. Raises an
- * EOFError on end of file.
+ * <code>EOFError</code> on end of file.
*
* f = File.new("testfile")
* f.readchar #=> "h"
@@ -4201,10 +3867,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
@@ -4238,10 +3904,10 @@ rb_io_getbyte(VALUE io)
/*
* call-seq:
- * ios.readbyte -> integer
+ * ios.readbyte -> fixnum
*
- * Reads a byte as with IO#getbyte, but raises an EOFError on end of
- * file.
+ * Reads a byte as with <code>IO#getbyte</code>, but raises an
+ * <code>EOFError</code> on end of file.
*/
static VALUE
@@ -4258,13 +3924,13 @@ 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
* may be pushed back before a subsequent read operation (that is,
* you will be able to read only the last of several bytes that have been pushed
- * back). Has no effect with unbuffered reads (such as IO#sysread).
+ * back). Has no effect with unbuffered reads (such as <code>IO#sysread</code>).
*
* f = File.new("testfile") #=> #<File:testfile>
* b = f.getbyte #=> 0x38
@@ -4279,17 +3945,13 @@ rb_io_ungetbyte(VALUE io, VALUE b)
GetOpenFile(io, fptr);
rb_io_check_byte_readable(fptr);
- switch (TYPE(b)) {
- case T_NIL:
- return Qnil;
- case T_FIXNUM:
- case T_BIGNUM: ;
- VALUE v = rb_int_modulo(b, INT2FIX(256));
- unsigned char c = NUM2INT(v) & 0xFF;
- b = rb_str_new((const char *)&c, 1);
- break;
- default:
- SafeStringValue(b);
+ if (NIL_P(b)) return Qnil;
+ if (FIXNUM_P(b)) {
+ char cc = FIX2INT(b);
+ b = rb_str_new(&cc, 1);
+ }
+ else {
+ SafeStringValue(b);
}
io_ungetbyte(b, fptr);
return Qnil;
@@ -4303,7 +3965,7 @@ rb_io_ungetbyte(VALUE io, VALUE b)
* such that a subsequent buffered character read will return it. Only one character
* may be pushed back before a subsequent read operation (that is,
* you will be able to read only the last of several characters that have been pushed
- * back). Has no effect with unbuffered reads (such as IO#sysread).
+ * back). Has no effect with unbuffered reads (such as <code>IO#sysread</code>).
*
* f = File.new("testfile") #=> #<File:testfile>
* c = f.getc #=> "8"
@@ -4458,7 +4120,7 @@ rb_io_set_close_on_exec(VALUE io, VALUE arg)
if ((ret & FD_CLOEXEC) != flag) {
ret = (ret & ~FD_CLOEXEC) | flag;
ret = fcntl(fd, F_SETFD, ret);
- if (ret != 0) rb_sys_fail_path(fptr->pathv);
+ if (ret == -1) rb_sys_fail_path(fptr->pathv);
}
}
@@ -4470,7 +4132,7 @@ rb_io_set_close_on_exec(VALUE io, VALUE arg)
if ((ret & FD_CLOEXEC) != flag) {
ret = (ret & ~FD_CLOEXEC) | flag;
ret = fcntl(fd, F_SETFD, ret);
- if (ret != 0) rb_sys_fail_path(fptr->pathv);
+ if (ret == -1) rb_sys_fail_path(fptr->pathv);
}
}
return Qnil;
@@ -4600,13 +4262,11 @@ 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,
- struct list_head *busy)
+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) {
@@ -4621,7 +4281,8 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl,
}
if (fptr->wbuf.len) {
if (noraise) {
- io_flush_buffer_sync(fptr);
+ if ((int)io_flush_buffer_sync(fptr) < 0 && NIL_P(err))
+ err = Qtrue;
}
else {
if (io_fflush(fptr) < 0 && NIL_P(err))
@@ -4633,14 +4294,6 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl,
fptr->stdio_file = 0;
fptr->mode &= ~(FMODE_READABLE|FMODE_WRITABLE);
- /*
- * ensure waiting_fd users do not hit EBADF, wait for them
- * to exit before we call close().
- */
- if (busy) {
- do rb_thread_schedule(); while (!list_empty(busy));
- }
-
if (IS_PREP_STDIO(fptr) || fd <= 2) {
/* need to keep FILE objects of stdin, stdout and stderr */
}
@@ -4648,32 +4301,27 @@ fptr_finalize_flush(rb_io_t *fptr, int noraise, int keepgvl,
/* stdio_file is deallocated anyway
* even if fclose failed. */
if ((maygvl_fclose(stdio_file, noraise) < 0) && NIL_P(err))
- if (!noraise) err = INT2NUM(errno);
+ err = noraise ? Qtrue : INT2NUM(errno);
}
else if (0 <= fd) {
/* 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 (!noraise) err = INT2NUM(errno);
+ 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, 0);
+ default:
+ rb_exc_raise(err);
+ }
+ }
free_io_buffer(&fptr->rbuf);
free_io_buffer(&fptr->wbuf);
clear_codeconv(fptr);
@@ -4726,36 +4374,21 @@ clear_codeconv(rb_io_t *fptr)
clear_writeconv(fptr);
}
-void
-rb_io_fptr_finalize_internal(void *ptr)
+int
+rb_io_fptr_finalize(rb_io_t *fptr)
{
- rb_io_t *fptr = ptr;
-
- if (!ptr) return;
+ if (!fptr) return 0;
fptr->pathv = Qnil;
if (0 <= fptr->fd)
- rb_io_fptr_cleanup(fptr, TRUE);
+ rb_io_fptr_cleanup(fptr, TRUE);
fptr->write_lock = 0;
free_io_buffer(&fptr->rbuf);
free_io_buffer(&fptr->wbuf);
clear_codeconv(fptr);
free(fptr);
+ return 1;
}
-#undef rb_io_fptr_finalize
-int
-rb_io_fptr_finalize(rb_io_t *fptr)
-{
- if (!fptr) {
- return 0;
- }
- else {
- rb_io_fptr_finalize_internal(fptr);
- return 1;
- }
-}
-#define rb_io_fptr_finalize(fptr) rb_io_fptr_finalize_internal(fptr)
-
RUBY_FUNC_EXPORTED size_t
rb_io_memsize(const rb_io_t *fptr)
{
@@ -4768,23 +4401,14 @@ 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, struct list_head *);
-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;
- struct list_head busy;
- list_head_init(&busy);
write_io = GetWriteIO(io);
if (io != write_io) {
write_fptr = RFILE(write_io)->fptr;
@@ -4794,33 +4418,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;
- if (rb_notify_fd_close(fptr->fd, &busy)) {
- /* calls close(fptr->fd): */
- fptr_finalize_flush(fptr, FALSE, KEEPGVL, &busy);
- }
+ fd = fptr->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;
}
@@ -4830,22 +4440,18 @@ rb_io_close(VALUE io)
*
* Closes <em>ios</em> and flushes any pending writes to the operating
* system. The stream is unavailable for any further data operations;
- * an IOError is raised if such an attempt is made. I/O streams are
- * automatically closed when they are claimed by the garbage collector.
+ * an <code>IOError</code> is raised if such an attempt is made. I/O
+ * streams are automatically closed when they are claimed by the
+ * garbage collector.
*
- * If <em>ios</em> is opened by IO.popen, #close sets
- * <code>$?</code>.
- *
- * Calling this method on closed IO object is just ignored since Ruby 2.3.
+ * If <em>ios</em> is opened by <code>IO.popen</code>,
+ * <code>close</code> sets <code>$?</code>.
*/
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;
}
@@ -4861,7 +4467,7 @@ static VALUE
ignore_closed_stream(VALUE io, VALUE exc)
{
enum {mesg_len = sizeof(closed_stream)-1};
- VALUE mesg = rb_attr_get(exc, idMesg);
+ VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
if (!RB_TYPE_P(mesg, T_STRING) ||
RSTRING_LEN(mesg) != mesg_len ||
memcmp(RSTRING_PTR(mesg), closed_stream, mesg_len)) {
@@ -4914,7 +4520,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;
}
@@ -4924,7 +4531,7 @@ rb_io_closed(VALUE io)
*
* Closes the read end of a duplex I/O stream (i.e., one that contains
* both a read and a write stream, such as a pipe). Will raise an
- * IOError if the stream is not duplexed.
+ * <code>IOError</code> if the stream is not duplexed.
*
* f = IO.popen("/bin/sh","r+")
* f.close_read
@@ -4934,8 +4541,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
@@ -4944,8 +4549,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
@@ -4961,19 +4565,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);
@@ -4985,7 +4590,7 @@ rb_io_close_read(VALUE io)
*
* Closes the write end of a duplex I/O stream (i.e., one that contains
* both a read and a write stream, such as a pipe). Will raise an
- * IOError if the stream is not duplexed.
+ * <code>IOError</code> if the stream is not duplexed.
*
* f = IO.popen("/bin/sh","r+")
* f.close_write
@@ -4996,8 +4601,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
@@ -5007,8 +4610,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
@@ -5021,13 +4623,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;
@@ -5038,8 +4641,8 @@ rb_io_close_write(VALUE io)
* ios.sysseek(offset, whence=IO::SEEK_SET) -> integer
*
* Seeks to a given <i>offset</i> in the stream according to the value
- * of <i>whence</i> (see IO#seek for values of <i>whence</i>). Returns
- * the new offset into the file.
+ * of <i>whence</i> (see <code>IO#seek</code> for values of
+ * <i>whence</i>). Returns the new offset into the file.
*
* f = File.new("testfile")
* f.sysseek(-13, IO::SEEK_END) #=> 53
@@ -5068,7 +4671,7 @@ rb_io_sysseek(int argc, VALUE *argv, VALUE io)
}
errno = 0;
pos = lseek(fptr->fd, pos, whence);
- if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
+ if (pos == -1 && errno) rb_sys_fail_path(fptr->pathv);
return OFFT2NUM(pos);
}
@@ -5080,7 +4683,7 @@ rb_io_sysseek(int argc, VALUE *argv, VALUE io)
* Writes the given string to <em>ios</em> using a low-level write.
* Returns the number of bytes written. Do not mix with other methods
* that write to <em>ios</em> or you may get unpredictable results.
- * Raises SystemCallError on error.
+ * Raises <code>SystemCallError</code> on error.
*
* f = File.new("out", "w")
* f.syswrite("ABCDEF") #=> 6
@@ -5089,10 +4692,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);
@@ -5101,15 +4702,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);
- if (n < 0) rb_sys_fail_path(fptr->pathv);
- rb_str_tmp_frozen_release(str, tmp);
+ 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);
return LONG2FIX(n);
}
@@ -5121,13 +4723,12 @@ rb_io_syswrite(VALUE io, VALUE str)
* Reads <i>maxlen</i> bytes from <em>ios</em> using a low-level
* read and returns them as a string. Do not mix with other methods
* that read from <em>ios</em> or you may get unpredictable results.
- *
- * If the optional _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 SystemCallError on error and EOFError at end of file.
+ * Raises <code>SystemCallError</code> on error and
+ * <code>EOFError</code> at end of file.
*
* f = File.new("testfile")
* f.sysread(16) #=> "This is line one"
@@ -5139,13 +4740,12 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
VALUE len, str;
rb_io_t *fptr;
long n, ilen;
- struct io_internal_read_struct iis;
- int shrinkable;
+ struct read_internal_arg arg;
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);
@@ -5167,168 +4767,24 @@ rb_io_sysread(int argc, VALUE *argv, VALUE io)
rb_io_check_closed(fptr);
io_setstrbuf(&str, ilen);
- iis.fd = fptr->fd;
- iis.nonblock = 1; /* for historical reasons, maybe (see above) */
- iis.buf = RSTRING_PTR(str);
- iis.capa = ilen;
- n = read_internal_locktmp(str, &iis);
-
- if (n < 0) {
- rb_sys_fail_path(fptr->pathv);
- }
- io_set_read_length(str, n, shrinkable);
- if (n == 0 && ilen > 0) {
- rb_eof_error();
- }
-
- 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 SystemCallError on error, EOFError at end of file and
- * NotImplementedError 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);
+ arg.fd = fptr->fd;
+ arg.str_ptr = RSTRING_PTR(str);
+ arg.len = ilen;
+ rb_ensure(read_internal_call, (VALUE)&arg, rb_str_unlocktmp, str);
+ n = arg.len;
- if (n < 0) {
+ if (n == -1) {
rb_sys_fail_path(fptr->pathv);
}
- io_set_read_length(str, n, shrinkable);
- if (n == 0 && arg.count > 0) {
+ io_set_read_length(str, n);
+ if (n == 0 && ilen > 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 SystemCallError on error and NotImplementedError
- * 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 < 0) 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)
@@ -5397,6 +4853,7 @@ rb_io_ascii8bit_binmode(VALUE io)
* - newline conversion disabled
* - encoding conversion disabled
* - content is treated as ASCII-8BIT
+ *
*/
static VALUE
@@ -5441,23 +4898,24 @@ rb_io_fmode_modestr(int fmode)
case FMODE_READABLE:
return MODE_BTMODE("r", "rb", "rt");
case FMODE_WRITABLE:
- return MODE_BTXMODE("w", "wb", "wt", "wx", "wbx", "wtx");
+ return MODE_BTMODE("w", "wb", "wt");
case FMODE_READWRITE:
if (fmode & FMODE_CREATE) {
- return MODE_BTXMODE("w+", "wb+", "wt+", "w+x", "wb+x", "wt+x");
+ return MODE_BTMODE("w+", "wb+", "wt+");
}
return MODE_BTMODE("r+", "rb+", "rt+");
}
}
-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;
}
@@ -5493,17 +4951,10 @@ rb_io_modestr_fmode(const char *modestr)
case '+':
fmode |= FMODE_READWRITE;
break;
- case 'x':
- if (modestr[0] != 'w')
- goto error;
- fmode |= FMODE_EXCL;
- break;
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;
}
}
@@ -5511,6 +4962,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;
}
@@ -5520,7 +4973,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;
@@ -5541,9 +4994,6 @@ rb_io_oflags_fmode(int oflags)
if (oflags & O_CREAT) {
fmode |= FMODE_CREATE;
}
- if (oflags & O_EXCL) {
- fmode |= FMODE_EXCL;
- }
#ifdef O_BINARY
if (oflags & O_BINARY) {
fmode |= FMODE_BINMODE;
@@ -5579,9 +5029,6 @@ rb_io_fmode_oflags(int fmode)
if (fmode & FMODE_CREATE) {
oflags |= O_CREAT;
}
- if (fmode & FMODE_EXCL) {
- oflags |= O_EXCL;
- }
#ifdef O_BINARY
if (fmode & FMODE_BINMODE) {
oflags |= O_BINARY;
@@ -5605,11 +5052,7 @@ rb_io_oflags_modestr(int oflags)
#else
# define MODE_BINARY(a,b) (a)
#endif
- int accmode;
- if (oflags & O_EXCL) {
- rb_raise(rb_eArgError, "exclusive access mode is not supported");
- }
- accmode = oflags & (O_RDONLY|O_WRONLY|O_RDWR);
+ int accmode = oflags & (O_RDONLY|O_WRONLY|O_RDWR);
if (oflags & O_APPEND) {
if (accmode == O_WRONLY) {
return MODE_BINARY("a", "ab");
@@ -5618,7 +5061,7 @@ rb_io_oflags_modestr(int oflags)
return MODE_BINARY("a+", "ab+");
}
}
- switch (accmode) {
+ switch (oflags & (O_RDONLY|O_WRONLY|O_RDWR)) {
default:
rb_raise(rb_eArgError, "invalid access oflags 0x%x", oflags);
case O_RDONLY:
@@ -5667,45 +5110,50 @@ 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 (len == 0 || len > ENCODING_MAXNAMELEN) {
- idx = -1;
- }
- else {
- if (p) {
+ 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);
+ }
+ }
+ else {
+ long len = strlen(estr);
+ if (io_encname_bom_p(estr, len)) {
+ fmode |= FMODE_SETENC_BY_BOM;
+ estr += 4;
+ len -= 4;
+ if (len > 0 && len <= ENCODING_MAXNAMELEN) {
+ memcpy(encname, estr, len);
+ encname[len] = '\0';
+ estr = encname;
+ }
}
idx = rb_enc_find_index(estr);
}
@@ -5715,7 +5163,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;
}
@@ -5728,7 +5176,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;
}
@@ -5795,8 +5243,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);
@@ -5822,12 +5269,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
@@ -5867,7 +5311,7 @@ extract_binmode(VALUE opthash, int *fmode)
}
}
-void
+static void
rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
int *oflags_p, int *fmode_p, convconfig_t *convconfig_p)
{
@@ -5904,7 +5348,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;
@@ -5928,24 +5372,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
@@ -5959,6 +5385,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) {
@@ -6032,18 +5469,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;
@@ -6059,25 +5495,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);
}
}
@@ -6089,13 +5524,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);
@@ -6105,10 +5538,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):
@@ -6139,9 +5569,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;
@@ -6164,30 +5597,25 @@ io_strip_bom(VALUE io)
return 0;
}
-static rb_encoding *
+static void
io_set_encoding_by_bom(VALUE io)
{
int idx = io_strip_bom(io);
rb_io_t *fptr;
- rb_encoding *extenc = NULL;
GetOpenFile(io, fptr);
if (idx) {
- extenc = rb_enc_from_index(idx);
- io_encoding_set(fptr, rb_enc_from_encoding(extenc),
- rb_io_internal_encoding(io), Qnil);
+ io_encoding_set(fptr, rb_enc_from_encoding(rb_enc_from_index(idx)),
+ rb_io_internal_encoding(io), Qnil);
}
else {
fptr->encs.enc2 = NULL;
}
- return extenc;
}
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) {
@@ -6203,15 +5631,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);
@@ -6226,10 +5647,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);
- convconfig.ecflags = 0;
- convconfig.ecopts = Qnil;
+ parse_mode_enc(p+1, &convconfig.enc, &convconfig.enc2, &fmode);
}
else {
rb_encoding *e;
@@ -6281,20 +5699,26 @@ pipe_add_fptr(rb_io_t *fptr)
static void
pipe_del_fptr(rb_io_t *fptr)
{
- struct pipe_list **prev = &pipe_list;
+ struct pipe_list *list = pipe_list;
struct pipe_list *tmp;
- while ((tmp = *prev) != 0) {
- if (tmp->fptr == fptr) {
- *prev = tmp->next;
+ if (list->fptr == fptr) {
+ pipe_list = list->next;
+ free(list);
+ return;
+ }
+
+ while (list->next) {
+ if (list->next->fptr == fptr) {
+ tmp = list->next;
+ list->next = list->next->next;
free(tmp);
return;
}
- prev = &tmp->next;
+ list = list->next;
}
}
-#if defined (_WIN32) || defined(__CYGWIN__)
static void
pipe_atexit(void)
{
@@ -6307,7 +5731,6 @@ pipe_atexit(void)
list = tmp;
}
}
-#endif
static void
pipe_finalize(rb_io_t *fptr, int noraise)
@@ -6327,31 +5750,6 @@ pipe_finalize(rb_io_t *fptr, int noraise)
}
#endif
-static void
-fptr_copy_finalizer(rb_io_t *fptr, const rb_io_t *orig)
-{
-#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
- void (*const old_finalize)(struct rb_io_t*,int) = fptr->finalize;
-
- if (old_finalize == orig->finalize) return;
-#endif
-
- fptr->finalize = orig->finalize;
-
-#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
- if (old_finalize != pipe_finalize) {
- struct pipe_list *list;
- for (list = pipe_list; list; list = list->next) {
- if (list->fptr == fptr) break;
- }
- if (!list) pipe_add_fptr(fptr);
- }
- else {
- pipe_del_fptr(fptr);
- }
-#endif
-}
-
void
rb_io_synchronized(rb_io_t *fptr)
{
@@ -6370,8 +5768,9 @@ rb_pipe(int *pipes)
{
int ret;
ret = rb_cloexec_pipe(pipes);
- if (ret < 0) {
- if (rb_gc_for_fd(errno)) {
+ if (ret == -1) {
+ if (errno == EMFILE || errno == ENFILE) {
+ rb_gc();
ret = rb_cloexec_pipe(pipes);
}
}
@@ -6447,9 +5846,9 @@ linux_get_maxfd(void)
char buf[4096], *p, *np, *e;
ssize_t ss;
fd = rb_cloexec_open("/proc/self/status", O_RDONLY|O_NOCTTY, 0);
- if (fd < 0) return fd;
+ if (fd == -1) return -1;
ss = read(fd, buf, sizeof(buf));
- if (ss < 0) goto err;
+ if (ss == -1) goto err;
p = buf;
e = buf + ss;
while ((int)sizeof("FDSize:\t0\n")-1 <= e-p &&
@@ -6468,7 +5867,7 @@ linux_get_maxfd(void)
err:
close(fd);
- return (int)ss;
+ return -1;
}
#endif
@@ -6518,20 +5917,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 ;
@@ -6547,8 +5941,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) ? \
@@ -6574,6 +5968,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);
@@ -6595,10 +5993,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]));
@@ -6627,7 +6026,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);
}
@@ -6638,7 +6036,7 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
# if defined(HAVE_SPAWNVE)
if (eargp->envp_str) envp = (char **)RSTRING_PTR(eargp->envp_str);
# endif
- while ((pid = DO_SPAWN(cmd, args, envp)) < 0) {
+ while ((pid = DO_SPAWN(cmd, args, envp)) == -1) {
/* exec failed */
switch (e = errno) {
case EAGAIN:
@@ -6653,7 +6051,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)
@@ -6671,7 +6068,7 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode,
}
/* parent */
- if (pid < 0) {
+ if (pid == -1) {
# if defined(HAVE_WORKING_FORK)
e = errno;
# endif
@@ -6681,11 +6078,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]);
@@ -6702,18 +6100,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
@@ -6774,28 +6172,17 @@ 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;
VALUE execarg_obj = Qnil;
if (!is_popen_fork(prog))
- execarg_obj = rb_execarg_new(argc, argv, TRUE, FALSE);
+ execarg_obj = rb_execarg_new(argc, argv, TRUE);
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
@@ -6803,7 +6190,7 @@ pipe_close(VALUE io)
*
* Runs the specified command as a subprocess; the subprocess's
* standard input and output will be connected to the returned
- * IO object.
+ * <code>IO</code> object.
*
* The PID of the started process can be obtained by IO#pid method.
*
@@ -6821,8 +6208,8 @@ 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
- * a hash at last for options similar to #spawn.
+ * 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'',
* but <i>mode</i> may be set to any of the modes listed in the description for class IO.
@@ -6844,19 +6231,21 @@ pipe_close(VALUE io)
* ls_result_with_error = ls_io.read
* }
*
- * Raises exceptions which IO.pipe and Kernel.spawn raise.
+ * Raises exceptions which <code>IO.pipe</code> and
+ * <code>Kernel.spawn</code> raise.
*
* 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>.
- * In this case IO.popen returns the value of the block.
+ * In this case <code>IO.popen</code> returns
+ * the value of the block.
*
* If a block is given with a _cmd_ of ``<code>-</code>'',
* 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.
*
@@ -6864,7 +6253,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|
@@ -6913,14 +6302,14 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass)
rb_raise(rb_eArgError, "too many arguments");
}
#endif
- execarg_obj = rb_execarg_new((int)len, RARRAY_CONST_PTR(tmp), FALSE, FALSE);
+ execarg_obj = rb_execarg_new((int)len, RARRAY_CONST_PTR(tmp), FALSE);
RB_GC_GUARD(tmp);
}
else {
SafeStringValue(pname);
execarg_obj = Qnil;
if (!is_popen_fork(pname))
- execarg_obj = rb_execarg_new(1, &pname, TRUE, FALSE);
+ execarg_obj = rb_execarg_new(1, &pname, TRUE);
}
if (!NIL_P(execarg_obj)) {
if (!NIL_P(opt))
@@ -6944,7 +6333,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;
}
@@ -6995,11 +6384,11 @@ rb_open_file(int argc, const VALUE *argv, VALUE io)
* File.open(filename, mode="r" [, opt]) {|file| block } -> obj
* File.open(filename [, mode [, perm]] [, opt]) {|file| block } -> obj
*
- * With no associated block, File.open is a synonym for
+ * With no associated block, <code>File.open</code> is a synonym for
* File.new. If the optional code block is given, it will
* be passed the opened +file+ as an argument and the File object will
* automatically be closed when the block terminates. The value of the block
- * will be returned from File.open.
+ * will be returned from <code>File.open</code>.
*
* If a file is being created, its initial permissions may be set using the
* +perm+ parameter. See File.new for further discussion.
@@ -7012,9 +6401,9 @@ 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, IO.open is a synonym for IO.new. If
+ * With no associated block, <code>IO.open</code> is a synonym for IO.new. If
* the optional code block is given, it will be passed +io+ as an argument,
* and the IO object will automatically be closed when the block terminates.
* In this instance, IO.open returns the value of the block.
@@ -7025,7 +6414,7 @@ rb_open_file(int argc, const VALUE *argv, VALUE io)
static VALUE
rb_io_s_open(int argc, VALUE *argv, VALUE klass)
{
- VALUE io = rb_class_new_instance_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
+ VALUE io = rb_class_new_instance(argc, argv, klass);
if (rb_block_given_p()) {
return rb_ensure(rb_yield, io, io_close, io);
@@ -7036,16 +6425,16 @@ 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
- * Integer.
+ * <code>Fixnum</code>.
*
* IO.sysopen("testfile") #=> 3
*/
static VALUE
-rb_io_s_sysopen(int argc, VALUE *argv, VALUE _)
+rb_io_s_sysopen(int argc, VALUE *argv)
{
VALUE fname, vmode, vperm;
VALUE intmode;
@@ -7081,6 +6470,7 @@ check_pipe_command(VALUE filename_or_command)
if (rb_enc_ascget(s, e, &chlen, rb_enc_get(filename_or_command)) == '|') {
VALUE cmd = rb_str_new(s+chlen, l-chlen);
+ OBJ_INFECT(cmd, filename_or_command);
return cmd;
}
return Qnil;
@@ -7123,7 +6513,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.
*
@@ -7156,7 +6546,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
@@ -7185,7 +6575,7 @@ check_pipe_command(VALUE filename_or_command)
*/
static VALUE
-rb_f_open(int argc, VALUE *argv, VALUE _)
+rb_f_open(int argc, VALUE *argv)
{
ID to_open = 0;
int redirect = FALSE;
@@ -7211,7 +6601,7 @@ rb_f_open(int argc, VALUE *argv, VALUE _)
}
}
if (redirect) {
- VALUE io = rb_funcallv_kw(argv[0], to_open, argc-1, argv+1, RB_PASS_CALLED_KEYWORDS);
+ 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);
@@ -7221,35 +6611,37 @@ rb_f_open(int argc, VALUE *argv, VALUE _)
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;
- if (klass == rb_cIO && !NIL_P(cmd = check_pipe_command(filename))) {
- 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;
@@ -7276,7 +6668,7 @@ io_reopen(VALUE io, VALUE nfile)
rb_sys_fail(0);
}
else {
- flush_before_seek(fptr);
+ io_tell(fptr);
}
if (orig->mode & FMODE_READABLE) {
pos = io_tell(orig);
@@ -7292,7 +6684,11 @@ io_reopen(VALUE io, VALUE nfile)
fptr->lineno = orig->lineno;
if (RTEST(orig->pathv)) fptr->pathv = orig->pathv;
else if (!IS_PREP_STDIO(fptr)) fptr->pathv = Qnil;
- fptr_copy_finalizer(fptr, orig);
+ fptr->finalize = orig->finalize;
+#if defined (__CYGWIN__) || !defined(HAVE_WORKING_FORK)
+ if (fptr->finalize == pipe_finalize)
+ pipe_add_fptr(fptr);
+#endif
fd = fptr->fd;
fd2 = orig->fd;
@@ -7331,29 +6727,14 @@ 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
- * ios.reopen(path, mode [, opt]) -> ios
+ * ios.reopen(other_IO) -> ios
+ * ios.reopen(path, mode_str) -> ios
*
* Reassociates <em>ios</em> with the I/O stream given in
* <i>other_IO</i> or to a new stream opened on <i>path</i>. This may
* dynamically change the actual class of this stream.
- * The +mode+ and +opt+ parameters accept the same values as IO.open.
*
* f1 = File.new("testfile")
* f2 = File.new("testfile")
@@ -7403,7 +6784,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;
@@ -7417,10 +6798,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
@@ -7472,7 +6852,11 @@ rb_io_init_copy(VALUE dest, VALUE io)
fptr->pid = orig->pid;
fptr->lineno = orig->lineno;
if (!NIL_P(orig->pathv)) fptr->pathv = orig->pathv;
- fptr_copy_finalizer(fptr, orig);
+ fptr->finalize = orig->finalize;
+#if defined (__CYGWIN__) || !defined(HAVE_WORKING_FORK)
+ if (fptr->finalize == pipe_finalize)
+ pipe_add_fptr(fptr);
+#endif
fd = ruby_dup(orig->fd);
fptr->fd = fd;
@@ -7498,7 +6882,8 @@ rb_io_init_copy(VALUE dest, VALUE io)
* ios.printf(format_string [, obj, ...]) -> nil
*
* Formats and writes to <em>ios</em>, converting parameters under
- * control of the format string. See Kernel#sprintf for details.
+ * control of the format string. See <code>Kernel#sprintf</code>
+ * for details.
*/
VALUE
@@ -7520,7 +6905,7 @@ rb_io_printf(int argc, const VALUE *argv, VALUE out)
*/
static VALUE
-rb_f_printf(int argc, VALUE *argv, VALUE _)
+rb_f_printf(int argc, VALUE *argv)
{
VALUE out;
@@ -7538,32 +6923,20 @@ rb_f_printf(int argc, VALUE *argv, VALUE _)
return Qnil;
}
-static void
-rb_output_fs_setter(VALUE val, ID id, VALUE *var)
-{
- rb_str_setter(val, id, &val);
- if (!NIL_P(val)) {
- rb_warn_deprecated("`$,'", NULL);
- }
- *var = val;
-}
-
/*
* 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")
*
@@ -7621,7 +6994,7 @@ rb_io_print(int argc, const VALUE *argv, VALUE out)
*/
static VALUE
-rb_f_print(int argc, const VALUE *argv, VALUE _)
+rb_f_print(int argc, const VALUE *argv)
{
rb_io_print(argc, argv, rb_stdout);
return Qnil;
@@ -7631,10 +7004,11 @@ rb_f_print(int argc, const VALUE *argv, VALUE _)
* call-seq:
* ios.putc(obj) -> obj
*
- * If <i>obj</i> is Numeric, write the character whose code is the
- * least-significant byte of <i>obj</i>. If <i>obj</i> is String,
- * write the first character of <i>obj</i> to <em>ios</em>. Otherwise,
- * raise TypeError.
+ * If <i>obj</i> is <code>Numeric</code>, write the character whose code is
+ * 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
@@ -7667,8 +7041,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
@@ -7677,12 +7051,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);
@@ -7720,17 +7094,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>
*
@@ -7738,16 +7108,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) {
@@ -7764,13 +7131,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;
@@ -7791,21 +7156,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);
}
}
@@ -7875,7 +7240,6 @@ rb_f_p(int argc, VALUE *argv, VALUE self)
*
* def display(port=$>)
* port.write self
- * nil
* end
*
* For example:
@@ -7887,7 +7251,7 @@ rb_f_p(int argc, VALUE *argv, VALUE self)
*
* <em>produces:</em>
*
- * 1cat[4, 5, 6]
+ * 1cat456
*/
static VALUE
@@ -7895,27 +7259,21 @@ rb_obj_display(int argc, VALUE *argv, VALUE self)
{
VALUE out;
- out = (!rb_check_arity(argc, 0, 1) ? rb_stdout : argv[0]);
+ if (argc == 0) {
+ out = rb_stdout;
+ }
+ else {
+ rb_scan_args(argc, argv, "01", &out);
+ }
rb_io_write(out, self);
return Qnil;
}
-static int
-rb_stderr_to_original_p(void)
-{
- return (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0);
-}
-
void
rb_write_error2(const char *mesg, long len)
{
- if (rb_stderr_to_original_p()) {
-#ifdef _WIN32
- if (isatty(fileno(stderr))) {
- if (rb_w32_write_console(rb_str_new(mesg, len), fileno(stderr)) > 0) return;
- }
-#endif
+ if (rb_stderr == orig_stderr || RFILE(orig_stderr)->fptr->fd < 0) {
if (fwrite(mesg, sizeof(char), (size_t)len, stderr) < (size_t)len) {
/* failed to write to stderr, what can we do? */
return;
@@ -7936,7 +7294,7 @@ void
rb_write_error_str(VALUE mesg)
{
/* a stopgap measure for the time being */
- if (rb_stderr_to_original_p()) {
+ 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))) {
@@ -7954,14 +7312,6 @@ rb_write_error_str(VALUE mesg)
}
}
-int
-rb_stderr_tty_p(void)
-{
- if (rb_stderr_to_original_p())
- return isatty(fileno(stderr));
- return 0;
-}
-
static void
must_respond_to(ID mid, VALUE val, ID id)
{
@@ -7987,13 +7337,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);
@@ -8032,7 +7383,7 @@ FILE *
rb_io_stdio_file(rb_io_t *fptr)
{
if (!fptr->stdio_file) {
- int oflags = rb_io_fmode_oflags(fptr->mode) & ~O_EXCL;
+ int oflags = rb_io_fmode_oflags(fptr->mode);
fptr->stdio_file = rb_fdopen(fptr->fd, rb_io_oflags_modestr(oflags));
}
return fptr->stdio_file;
@@ -8106,8 +7457,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:
*
@@ -8150,10 +7501,6 @@ rb_io_make_open_file(VALUE obj)
*
* "t" Text file mode
*
- * The exclusive access mode ("x") can be used together with "w" to ensure
- * the file is created. Errno::EEXIST is raised when it already exists.
- * It may not be supported with all kinds of streams (e.g. pipes).
- *
* When the open mode of original IO is read only, the mode cannot be
* changed to be writable. Similarly, the open mode cannot be changed from
* write only to readable.
@@ -8172,7 +7519,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
@@ -8187,18 +7534,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".
@@ -8242,7 +7586,7 @@ rb_io_make_open_file(VALUE obj)
* io.puts "Hello, World!"
*
* Both of above print "Hello, World!" in UTF-16LE to standard error output
- * with converting EOL generated by #puts to CR.
+ * with converting EOL generated by <code>puts</code> to CR.
*/
static VALUE
@@ -8271,7 +7615,7 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
oflags = fcntl(fd, F_GETFL);
if (oflags == -1) rb_sys_fail(0);
#else
- if (fstat(fd, &st) < 0) rb_sys_fail(0);
+ if (fstat(fd, &st) == -1) rb_sys_fail(0);
#endif
rb_update_max_fd(fd);
#if defined(HAVE_FCNTL) && defined(F_GETFL)
@@ -8306,44 +7650,6 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io)
/*
* call-seq:
- * ios.set_encoding_by_bom -> encoding or nil
- *
- * Checks if +ios+ starts with a BOM, and then consumes it and sets
- * the external encoding. Returns the result encoding if found, or
- * nil. If +ios+ is not binmode or its encoding has been set
- * already, an exception will be raised.
- *
- * File.write("bom.txt", "\u{FEFF}abc")
- * ios = File.open("bom.txt", "rb")
- * ios.set_encoding_by_bom #=> #<Encoding:UTF-8>
- *
- * File.write("nobom.txt", "abc")
- * ios = File.open("nobom.txt", "rb")
- * ios.set_encoding_by_bom #=> nil
- */
-
-static VALUE
-rb_io_set_encoding_by_bom(VALUE io)
-{
- rb_io_t *fptr;
-
- GetOpenFile(io, fptr);
- if (!(fptr->mode & FMODE_BINMODE)) {
- rb_raise(rb_eArgError, "ASCII incompatible encoding needs binmode");
- }
- if (fptr->encs.enc2) {
- rb_raise(rb_eArgError, "encoding conversion is set");
- }
- else if (fptr->encs.enc && fptr->encs.enc != rb_ascii8bit_encoding()) {
- rb_raise(rb_eArgError, "encoding is set to %s already",
- rb_enc_name(fptr->encs.enc));
- }
- if (!io_set_encoding_by_bom(io)) return Qnil;
- return rb_enc_from_encoding(fptr->encs.enc);
-}
-
-/*
- * call-seq:
* File.new(filename, mode="r" [, opt]) -> file
* File.new(filename [, mode [, perm]] [, opt]) -> file
*
@@ -8356,10 +7662,6 @@ rb_io_set_encoding_by_bom(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 IO#sync= about sync mode.
- *
* === Examples
*
* f = File.new("testfile", "r")
@@ -8374,7 +7676,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;
@@ -8396,7 +7698,7 @@ rb_io_s_new(int argc, VALUE *argv, VALUE klass)
rb_warn("%"PRIsVALUE"::new() does not take block; use %"PRIsVALUE"::open() instead",
cname, cname);
}
- return rb_class_new_instance_kw(argc, argv, klass, RB_PASS_CALLED_KEYWORDS);
+ return rb_class_new_instance(argc, argv, klass);
}
@@ -8404,7 +7706,7 @@ rb_io_s_new(int argc, VALUE *argv, VALUE klass)
* call-seq:
* IO.for_fd(fd, mode [, opt]) -> io
*
- * Synonym for IO.new.
+ * Synonym for <code>IO.new</code>.
*
*/
@@ -8441,12 +7743,12 @@ rb_io_autoclose_p(VALUE io)
* f = open("/dev/null")
* IO.for_fd(f.fileno)
* # ...
- * f.gets # may cause Errno::EBADF
+ * f.gets # may cause IOError
*
* f = open("/dev/null")
- * IO.for_fd(f.fileno).autoclose = false
+ * IO.for_fd(f.fileno).autoclose = true
* # ...
- * f.gets # won't cause Errno::EBADF
+ * f.gets # won't cause IOError
*/
static VALUE
@@ -8458,7 +7760,7 @@ rb_io_set_autoclose(VALUE io, VALUE autoclose)
fptr->mode |= FMODE_PREP;
else
fptr->mode &= ~FMODE_PREP;
- return autoclose;
+ return io;
}
static void
@@ -8468,21 +7770,30 @@ 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},
+ {argf_mark, argf_free, argf_memsize},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
};
@@ -8524,6 +7835,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;
}
@@ -8555,7 +7871,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=+.
@@ -8598,7 +7914,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;
}
@@ -8635,13 +7951,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;
- filename = rb_str_encode_ospath(filename);
+ StringValueCStr(filename);
+ ARGF.filename = rb_str_encode_ospath(filename);
fn = StringValueCStr(filename);
if (RSTRING_LEN(filename) == 1 && fn[0] == '-') {
ARGF.current_file = rb_stdin;
@@ -8667,14 +7981,10 @@ argf_next_argv(VALUE argf)
}
fstat(fr, &st);
str = filename;
- if (!NIL_P(ARGF.inplace)) {
- VALUE suffix = ARGF.inplace;
+ 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));
@@ -8743,7 +8053,6 @@ argf_next_argv(VALUE argf)
if (!NIL_P(write_io)) {
rb_io_set_write_io(ARGF.current_file, write_io);
}
- RB_GC_GUARD(filename);
}
if (ARGF.binmode) rb_io_ascii8bit_binmode(ARGF.current_file);
GetOpenFile(ARGF.current_file, fptr);
@@ -8829,9 +8138,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
@@ -8843,8 +8152,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
@@ -8866,26 +8175,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)
@@ -8932,7 +8238,7 @@ static VALUE argf_readline(int, VALUE *, VALUE);
* readline(limit) -> string
* readline(sep, limit) -> string
*
- * Equivalent to Kernel::gets, except
+ * Equivalent to <code>Kernel::gets</code>, except
* +readline+ raises +EOFError+ at end of file.
*/
@@ -8942,7 +8248,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);
}
@@ -8954,11 +8260,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.
@@ -8982,9 +8287,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.
@@ -8996,7 +8301,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);
}
/*
@@ -9068,7 +8373,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 */
@@ -9305,12 +8609,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);
@@ -9365,17 +8669,17 @@ advice_arg_check(VALUE advice)
*
* If an error occurs, one of the following exceptions will be raised:
*
- * IOError:: The IO stream is closed.
- * Errno::EBADF::
+ * <code>IOError</code>:: The <code>IO</code> stream is closed.
+ * <code>Errno::EBADF</code>::
* The file descriptor of the current file is invalid.
- * Errno::EINVAL:: An invalid value for _advice_ was given.
- * Errno::ESPIPE::
+ * <code>Errno::EINVAL</code>:: An invalid value for _advice_ was given.
+ * <code>Errno::ESPIPE</code>::
* The file descriptor of the current file refers to a FIFO or
- * pipe. (Linux raises Errno::EINVAL in this case).
- * TypeError::
+ * pipe. (Linux raises <code>Errno::EINVAL</code> in this case).
+ * <code>TypeError</code>::
* Either _advice_ was not a Symbol, or one of the
- * other arguments was not an Integer.
- * RangeError:: One of the arguments given was too big/small.
+ * other arguments was not an <code>Integer</code>.
+ * <code>RangeError</code>:: One of the arguments given was too big/small.
*
* This list is not exhaustive; other Errno:: exceptions are also possible.
*/
@@ -9405,31 +8709,35 @@ 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 IO objects, waits until one or more of
- * IO objects are ready for reading, are ready for writing, and have
- * pending exceptions respectively, and returns an array that contains
- * arrays of those IO objects. It will return +nil+ if optional
- * <i>timeout</i> value is given and no IO object is ready in
- * <i>timeout</i> seconds.
- *
- * IO.select peeks the buffer of IO objects for testing readability.
- * If the IO buffer is not empty, IO.select immediately notifies
- * readability. This "peek" only happens for IO objects. It does not
- * happen for IO-like objects such as OpenSSL::SSL::SSLSocket.
- *
- * The best way to use IO.select is invoking it after nonblocking
- * methods such as #read_nonblock, #write_nonblock, etc. The methods
- * raise an exception which is extended by IO::WaitReadable or
- * IO::WaitWritable. The modules notify how the caller should wait
- * with IO.select. If IO::WaitReadable is raised, the caller should
- * wait for reading. If IO::WaitWritable is raised, the caller should
- * wait for writing.
- *
- * So, blocking read (#readpartial) can be emulated using
- * #read_nonblock and IO.select as follows:
+ * 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 <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 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 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.
+ * If <code>IO::WaitWritable</code> is raised, the caller should wait for writing.
+ *
+ * So, blocking read (<code>readpartial</code>) can be emulated using
+ * <code>read_nonblock</code> and <code>IO.select</code> as follows:
*
* begin
* result = io_like.read_nonblock(maxlen)
@@ -9441,57 +8749,57 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
* retry
* end
*
- * Especially, the combination of nonblocking methods and IO.select is
- * preferred for IO like objects such as OpenSSL::SSL::SSLSocket. It
- * has #to_io method to return underlying IO object. IO.select calls
- * #to_io to obtain the file descriptor to wait.
+ * Especially, the combination of nonblocking methods and
+ * <code>IO.select</code> is preferred for <code>IO</code> like
+ * objects such as <code>OpenSSL::SSL::SSLSocket</code>.
+ * It has <code>to_io</code> method to return underlying <code>IO</code> object.
+ * <code>IO.select</code> calls <code>to_io</code> to obtain the file descriptor to wait.
*
- * This means that readability notified by IO.select doesn't mean
- * readability from OpenSSL::SSL::SSLSocket object.
+ * 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 OpenSSL::SSL::SSLSocket buffers
- * some data. IO.select doesn't see the buffer. So IO.select can
- * block when OpenSSL::SSL::SSLSocket#readpartial doesn't block.
+ * 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.
- * So, the remote side of SSL sends a partial record, IO.select
- * notifies readability but OpenSSL::SSL::SSLSocket cannot decrypt a
- * byte and OpenSSL::SSL::SSLSocket#readpartial will block.
+ * 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.
- * This means OpenSSL::SSL::SSLSocket#readpartial may invoke #write
- * system call and it can block.
- * In such a situation, OpenSSL::SSL::SSLSocket#read_nonblock raises
- * IO::WaitWritable instead of blocking.
- * So, the caller should wait for ready for writability as above
- * example.
- *
- * The combination of nonblocking methods and IO.select is also useful
- * for streams such as tty, pipe socket socket when multiple processes
- * read from a stream.
- *
- * Finally, Linux kernel developers don't guarantee that
+ * 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 situation, <code>OpenSSL::SSL::SSLSocket#read_nonblock</code>
+ * raises IO::WaitWritable instead of blocking.
+ * So, the caller should wait for ready for writability as above example.
+ *
+ * The combination of nonblocking methods and <code>IO.select</code> is
+ * also useful for streams such as tty, pipe socket socket when
+ * multiple process read form a stream.
+ *
+ * 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 IO.select before IO#readpartial works well as usual.
- * However it is not the best way to use IO.select.
+ * 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
- * how many bytes are writable.
- * IO#write method blocks until given whole string is written.
- * So, <code>IO#write(two or more bytes)</code> can block after
- * writability is notified by IO.select. IO#write_nonblock is required
- * to avoid the blocking.
+ * how many bytes writable.
+ * <code>IO#write</code> method blocks until given whole string is written.
+ * So, <code>IO#write(two or more bytes)</code> can block after writability is notified by <code>IO.select</code>.
+ * <code>IO#write_nonblock</code> is required to avoid the blocking.
*
- * Blocking write (#write) can be emulated using #write_nonblock and
- * IO.select as follows: IO::WaitReadable should also be rescued for
- * SSL renegotiation in OpenSSL::SSL::SSLSocket.
+ * Blocking write (<code>write</code>) can be emulated using
+ * <code>write_nonblock</code> and <code>IO.select</code> as follows:
+ * IO::WaitReadable should also be rescued for SSL renegotiation in <code>OpenSSL::SSL::SSLSocket</code>.
*
* while 0 < string.bytesize
* begin
@@ -9507,9 +8815,9 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
* end
*
* === Parameters
- * read_array:: an array of IO objects that wait until ready for read
- * write_array:: an array of IO objects that wait until ready for write
- * error_array:: an array of IO objects that wait for exceptions
+ * read_array:: an array of <code>IO</code> objects that wait until ready for read
+ * write_array:: an array of <code>IO</code> objects that wait until ready for write
+ * error_array:: an array of <code>IO</code> objects that wait for exceptions
* timeout:: a numeric value in second
*
* === Example
@@ -9566,12 +8874,12 @@ rb_f_select(int argc, VALUE *argv, VALUE obj)
return rb_ensure(select_call, (VALUE)&args, select_end, (VALUE)&args);
}
-#if (defined(__linux__) && !defined(__ANDROID__)) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
typedef unsigned long ioctl_req_t;
# define NUM2IOCTLREQ(num) NUM2ULONG(num)
#else
typedef int ioctl_req_t;
-# define NUM2IOCTLREQ(num) ((int)NUM2LONG(num))
+# define NUM2IOCTLREQ(num) NUM2INT(num)
#endif
#ifdef HAVE_IOCTL
@@ -9658,6 +8966,14 @@ typedef long fcntl_arg_t;
typedef int fcntl_arg_t;
#endif
+#if defined __native_client__ && !defined __GLIBC__
+// struct flock is currently missing the NaCl newlib headers
+// TODO(sbc): remove this once it gets added.
+#undef F_GETLK
+#undef F_SETLK
+#undef F_SETLKW
+#endif
+
static long
fcntl_narg_len(int cmd)
{
@@ -9807,8 +9123,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)
@@ -9817,17 +9132,13 @@ 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);
}
}
@@ -9843,17 +9154,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);
@@ -9913,17 +9223,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;
}
@@ -9936,17 +9240,16 @@ 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';
}
return INT2NUM(retval);
@@ -9960,9 +9263,9 @@ rb_fcntl(VALUE io, VALUE req, VALUE arg)
* query file-oriented I/O streams. Arguments and results are platform
* dependent. If <i>arg</i> is a number, its value is passed
* directly. If it is a string, it is interpreted as a binary sequence
- * of bytes (Array#pack might be a useful way to build this string). On
- * Unix platforms, see <code>fcntl(2)</code> for details. Not
- * implemented on all platforms.
+ * of bytes (<code>Array#pack</code> might be a useful way to build this
+ * string). On Unix platforms, see <code>fcntl(2)</code> for details.
+ * Not implemented on all platforms.
*/
static VALUE
@@ -9990,7 +9293,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
@@ -10002,20 +9305,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, 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)
@@ -10051,6 +9357,7 @@ rb_f_syscall(int argc, VALUE *argv, VALUE _)
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))
@@ -10094,6 +9401,32 @@ rb_f_syscall(int argc, VALUE *argv, VALUE _)
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)
@@ -10117,7 +9450,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;
}
@@ -10163,8 +9496,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);
}
@@ -10216,7 +9549,7 @@ pipe_pair_close(VALUE rw)
* IO.pipe(...) {|read_io, write_io| ... }
*
* Creates a pair of pipe endpoints (connected to each other) and
- * returns them as a two-element array of IO objects:
+ * returns them as a two-element array of <code>IO</code> objects:
* <code>[</code> <i>read_io</i>, <i>write_io</i> <code>]</code>.
*
* If a block is given, the block is called and
@@ -10278,7 +9611,7 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
VALUE ret;
argc = rb_scan_args(argc, argv, "02:", &v1, &v2, &opt);
- if (rb_pipe(pipes) < 0)
+ if (rb_pipe(pipes) == -1)
rb_sys_fail(0);
args[0] = klass;
@@ -10315,12 +9648,6 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
rb_io_synchronized(fptr2);
extract_binmode(opt, &fmode);
-
- if ((fmode & FMODE_BINMODE) && v1 == Qnil) {
- rb_io_ascii8bit_binmode(r);
- rb_io_ascii8bit_binmode(w);
- }
-
#if DEFAULT_TEXTMODE
if ((fptr->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE)) {
fptr->mode &= ~FMODE_TEXTMODE;
@@ -10358,10 +9685,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--;
@@ -10370,39 +9696,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_kw(RB_SCAN_ARGS_LAST_HASH_KEYWORDS, 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(VALUE v)
+io_s_foreach(struct foreach_arg *arg)
{
- struct getline_arg *arg = (void *)v;
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
@@ -10420,8 +9754,7 @@ io_s_foreach(VALUE v)
* 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.
*
*/
@@ -10431,30 +9764,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(VALUE v)
+io_s_readlines(struct foreach_arg *arg)
{
- struct getline_arg *arg = (void *)v;
- 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
@@ -10463,21 +9791,9 @@ io_s_readlines(VALUE v)
* 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
@@ -10485,21 +9801,16 @@ 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
-io_s_read(VALUE v)
+io_s_read(struct foreach_arg *arg)
{
- struct foreach_arg *arg = (void *)v;
return io_read(arg->argc, arg->argv, arg->io);
}
@@ -10522,34 +9833,31 @@ seek_before_access(VALUE argp)
* IO.read(name, [length [, offset]] [, opt] ) -> string
*
* Opens the file, optionally seeks to the given +offset+, then returns
- * +length+ bytes (defaulting to the rest of the file). #read 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.
+ * +length+ bytes (defaulting to the rest of the file). <code>read</code>
+ * ensures the file is closed before returning.
*
* === 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:
*
@@ -10566,7 +9874,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;
@@ -10588,10 +9896,10 @@ rb_io_s_read(int argc, VALUE *argv, VALUE io)
* call-seq:
* IO.binread(name, [length [, offset]] ) -> string
*
- * Opens the file, optionally seeks to the given <i>offset</i>, then
- * returns <i>length</i> bytes (defaulting to the rest of the file).
- * #binread ensures the file is closed before returning. The open mode
- * would be <code>"rb:ASCII-8BIT"</code>.
+ * Opens the file, optionally seeks to the given <i>offset</i>, then returns
+ * <i>length</i> bytes (defaulting to the rest of the file).
+ * <code>binread</code> ensures the file is closed before returning.
+ * The open mode would be "rb:ASCII-8BIT".
*
* IO.binread("testfile") #=> "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
* IO.binread("testfile", 20) #=> "This is line one\nThi"
@@ -10603,46 +9911,27 @@ 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);
}
static VALUE
-io_s_write0(VALUE v)
+io_s_write0(struct write_arg *arg)
{
- struct write_arg *arg = (void * )v;
return io_write(arg->io,arg->str,arg->nosync);
}
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;
@@ -10662,7 +9951,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);
@@ -10691,66 +9980,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. #write 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.
+ * <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, 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").
*
- * Same as IO.write except opening the file in binary mode and
- * ASCII-8BIT encoding (<code>"wb:ASCII-8BIT"</code>).
*/
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 {
@@ -10761,18 +10047,14 @@ struct copy_stream_struct {
int src_fd;
int dst_fd;
- unsigned close_src : 1;
- unsigned close_dst : 1;
- int error_no;
+ int close_src;
+ int close_dst;
off_t total;
const char *syserr;
+ int error_no;
const char *notimp;
+ rb_fdset_t fds;
VALUE th;
- struct stat src_stat;
- struct stat dst_stat;
-#ifdef HAVE_FCOPYFILE
- copyfile_state_t copyfile_state;
-#endif
};
static void *
@@ -10807,46 +10089,14 @@ maygvl_copy_stream_continue_p(int has_gvl, struct copy_stream_struct *stp)
return FALSE;
}
-#if USE_POLL
-# define IOWAIT_SYSCALL "poll"
-STATIC_ASSERT(pollin_expected, POLLIN == RB_WAITFD_IN);
-STATIC_ASSERT(pollout_expected, POLLOUT == RB_WAITFD_OUT);
static int
-nogvl_wait_for_single_fd(int fd, short events)
+maygvl_select(int has_gvl, int n, rb_fdset_t *rfds, rb_fdset_t *wfds, rb_fdset_t *efds, struct timeval *timeout)
{
- struct pollfd fds;
-
- fds.fd = fd;
- fds.events = events;
-
- return poll(&fds, 1, -1);
-}
-#else /* !USE_POLL */
-# define IOWAIT_SYSCALL "select"
-static int
-nogvl_wait_for_single_fd(int fd, short events)
-{
- rb_fdset_t fds;
- int ret;
-
- rb_fd_init(&fds);
- rb_fd_set(fd, &fds);
-
- switch (events) {
- case RB_WAITFD_IN:
- ret = rb_fd_select(fd + 1, &fds, 0, 0, 0);
- break;
- case RB_WAITFD_OUT:
- ret = rb_fd_select(fd + 1, 0, &fds, 0, 0);
- break;
- default:
- VM_UNREACHABLE(nogvl_wait_for_single_fd);
- }
-
- rb_fd_term(&fds);
- return ret;
+ if (has_gvl)
+ return rb_thread_fd_select(n, rfds, wfds, efds, timeout);
+ else
+ return rb_fd_select(n, rfds, wfds, efds, timeout);
}
-#endif /* !USE_POLL */
static int
maygvl_copy_stream_wait_read(int has_gvl, struct copy_stream_struct *stp)
@@ -10854,18 +10104,15 @@ 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, RB_WAITFD_IN);
- }
- } while (ret < 0 && maygvl_copy_stream_continue_p(has_gvl, stp));
+ rb_fd_zero(&stp->fds);
+ rb_fd_set(stp->src_fd, &stp->fds);
+ ret = maygvl_select(has_gvl, rb_fd_max(&stp->fds), &stp->fds, NULL, NULL, NULL);
+ } while (ret == -1 && maygvl_copy_stream_continue_p(has_gvl, stp));
- if (ret < 0) {
- stp->syserr = IOWAIT_SYSCALL;
+ if (ret == -1) {
+ stp->syserr = "select";
stp->error_no = errno;
- return ret;
+ return -1;
}
return 0;
}
@@ -10876,200 +10123,19 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
int ret;
do {
- ret = nogvl_wait_for_single_fd(stp->dst_fd, RB_WAITFD_OUT);
- } while (ret < 0 && maygvl_copy_stream_continue_p(0, stp));
+ 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);
+ } while (ret == -1 && maygvl_copy_stream_continue_p(0, stp));
- if (ret < 0) {
- stp->syserr = IOWAIT_SYSCALL;
+ if (ret == -1) {
+ stp->syserr = "select";
stp->error_no = errno;
- return ret;
+ return -1;
}
return 0;
}
-#if defined HAVE_COPY_FILE_RANGE || (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)
-{
-#ifdef HAVE_COPY_FILE_RANGE
- return copy_file_range(in_fd, in_offset, out_fd, out_offset, count, flags);
-#else
- return syscall(__NR_copy_file_range, in_fd, in_offset, out_fd, out_offset, count, flags);
-#endif
-}
-
-static int
-nogvl_copy_file_range(struct copy_stream_struct *stp)
-{
- ssize_t ss;
- off_t src_size;
- off_t copy_length, src_offset, *src_offset_ptr;
-
- if (!S_ISREG(stp->src_stat.st_mode))
- return 0;
-
- src_size = stp->src_stat.st_size;
- src_offset = stp->src_offset;
- if (src_offset >= (off_t)0) {
- 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)0) {
- if (src_offset < (off_t)0) {
- off_t current_offset;
- errno = 0;
- current_offset = lseek(stp->src_fd, 0, SEEK_CUR);
- if (current_offset < (off_t)0 && errno) {
- stp->syserr = "lseek";
- stp->error_no = errno;
- return (int)current_offset;
- }
- copy_length = src_size - current_offset;
- }
- else {
- copy_length = src_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 < 0) {
- 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
- {
- int ret = nogvl_copy_stream_wait_write(stp);
- if (ret < 0) return ret;
- }
- 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 (int)ss;
- }
- return 1;
-}
-#endif
-
-#ifdef HAVE_FCOPYFILE
-static int
-nogvl_fcopyfile(struct copy_stream_struct *stp)
-{
- off_t cur, ss = 0;
- const off_t src_offset = stp->src_offset;
- int ret;
-
- if (stp->copy_length >= (off_t)0) {
- /* copy_length can't be specified in fcopyfile(3) */
- return 0;
- }
-
- if (!S_ISREG(stp->src_stat.st_mode))
- return 0;
-
- if (!S_ISREG(stp->dst_stat.st_mode))
- return 0;
- if (lseek(stp->dst_fd, 0, SEEK_CUR) > (off_t)0) /* if dst IO was already written */
- return 0;
-
- if (src_offset > (off_t)0) {
- off_t r;
-
- /* get current offset */
- errno = 0;
- cur = lseek(stp->src_fd, 0, SEEK_CUR);
- if (cur < (off_t)0 && errno) {
- stp->error_no = errno;
- return 1;
- }
-
- errno = 0;
- r = lseek(stp->src_fd, src_offset, SEEK_SET);
- if (r < (off_t)0 && errno) {
- stp->error_no = errno;
- return 1;
- }
- }
-
- stp->copyfile_state = copyfile_state_alloc(); /* this will be freed by copy_stream_finalize() */
- ret = fcopyfile(stp->src_fd, stp->dst_fd, stp->copyfile_state, COPYFILE_DATA);
- copyfile_state_get(stp->copyfile_state, COPYFILE_STATE_COPIED, &ss); /* get copied bytes */
-
- if (ret == 0) { /* success */
- stp->total = ss;
- if (src_offset > (off_t)0) {
- off_t r;
- errno = 0;
- /* reset offset */
- r = lseek(stp->src_fd, cur, SEEK_SET);
- if (r < (off_t)0 && errno) {
- stp->error_no = errno;
- return 1;
- }
- }
- }
- else {
- switch (errno) {
- case ENOTSUP:
- case EPERM:
- case EINVAL:
- return 0;
- }
- stp->syserr = "fcopyfile";
- stp->error_no = errno;
- return (int)ret;
- }
- return 1;
-}
-#endif
-
#ifdef HAVE_SENDFILE
# ifdef __linux__
@@ -11103,7 +10169,7 @@ simple_sendfile(int out_fd, int in_fd, off_t *offset, off_t count)
# else
r = sendfile(in_fd, out_fd, pos, (size_t)count, NULL, &sbytes, 0);
# endif
- if (r != 0 && sbytes == 0) return r;
+ if (r != 0 && sbytes == 0) return -1;
if (offset) {
*offset += sbytes;
}
@@ -11121,38 +10187,51 @@ simple_sendfile(int out_fd, int in_fd, off_t *offset, off_t count)
static int
nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
{
+ struct stat src_stat, dst_stat;
ssize_t ss;
- off_t src_size;
+ int ret;
+
off_t copy_length;
off_t src_offset;
int use_pread;
- if (!S_ISREG(stp->src_stat.st_mode))
+ 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;
- src_size = stp->src_stat.st_size;
+ ret = fstat(stp->dst_fd, &dst_stat);
+ if (ret == -1) {
+ stp->syserr = "fstat";
+ stp->error_no = errno;
+ return -1;
+ }
#ifndef __linux__
- if ((stp->dst_stat.st_mode & S_IFMT) != S_IFSOCK)
+ if ((dst_stat.st_mode & S_IFMT) != S_IFSOCK)
return 0;
#endif
src_offset = stp->src_offset;
- use_pread = src_offset >= (off_t)0;
+ use_pread = src_offset != (off_t)-1;
copy_length = stp->copy_length;
- if (copy_length < (off_t)0) {
+ if (copy_length == (off_t)-1) {
if (use_pread)
- copy_length = src_size - src_offset;
+ copy_length = src_stat.st_size - src_offset;
else {
off_t cur;
errno = 0;
cur = lseek(stp->src_fd, 0, SEEK_CUR);
- if (cur < (off_t)0 && errno) {
+ if (cur == (off_t)-1 && errno) {
stp->syserr = "lseek";
stp->error_no = errno;
- return (int)cur;
+ return -1;
}
- copy_length = src_size - cur;
+ copy_length = src_stat.st_size - cur;
}
}
@@ -11176,7 +10255,7 @@ nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
goto retry_sendfile;
}
}
- if (ss < 0) {
+ if (ss == -1) {
if (maygvl_copy_stream_continue_p(0, stp))
goto retry_sendfile;
switch (errno) {
@@ -11189,27 +10268,24 @@ nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- {
- int ret;
#ifndef __linux__
- /*
- * Linux requires stp->src_fd to be a mmap-able (regular) file,
- * select() reports regular files to always be "ready", so
- * there is no need to select() on it.
- * Other OSes may have the same limitation for sendfile() which
- * allow us to bypass maygvl_copy_stream_wait_read()...
- */
- ret = maygvl_copy_stream_wait_read(0, stp);
- if (ret < 0) return ret;
-#endif
- ret = nogvl_copy_stream_wait_write(stp);
- if (ret < 0) return ret;
- }
+ /*
+ * Linux requires stp->src_fd to be a mmap-able (regular) file,
+ * select() reports regular files to always be "ready", so
+ * there is no need to select() on it.
+ * Other OSes may have the same limitation for sendfile() which
+ * allow us to bypass maygvl_copy_stream_wait_read()...
+ */
+ if (maygvl_copy_stream_wait_read(0, stp) == -1)
+ return -1;
+#endif
+ if (nogvl_copy_stream_wait_write(stp) == -1)
+ return -1;
goto retry_sendfile;
}
stp->syserr = "sendfile";
stp->error_no = errno;
- return (int)ss;
+ return -1;
}
return 1;
}
@@ -11229,7 +10305,7 @@ maygvl_copy_stream_read(int has_gvl, struct copy_stream_struct *stp, char *buf,
{
ssize_t ss;
retry_read:
- if (offset < (off_t)0) {
+ if (offset == (off_t)-1) {
ss = maygvl_read(has_gvl, stp->src_fd, buf, len);
}
else {
@@ -11243,7 +10319,7 @@ maygvl_copy_stream_read(int has_gvl, struct copy_stream_struct *stp, char *buf,
if (ss == 0) {
return 0;
}
- if (ss < 0) {
+ if (ss == -1) {
if (maygvl_copy_stream_continue_p(has_gvl, stp))
goto retry_read;
switch (errno) {
@@ -11251,19 +10327,18 @@ maygvl_copy_stream_read(int has_gvl, struct copy_stream_struct *stp, char *buf,
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- {
- int ret = maygvl_copy_stream_wait_read(has_gvl, stp);
- if (ret < 0) return ret;
- }
+ if (maygvl_copy_stream_wait_read(has_gvl, stp) == -1)
+ return -1;
goto retry_read;
#ifdef ENOSYS
case ENOSYS:
stp->notimp = "pread";
- return ss;
+ return -1;
#endif
}
- stp->syserr = offset < (off_t)0 ? "read" : "pread";
+ stp->syserr = offset == (off_t)-1 ? "read" : "pread";
stp->error_no = errno;
+ return -1;
}
return ss;
}
@@ -11275,17 +10350,17 @@ nogvl_copy_stream_write(struct copy_stream_struct *stp, char *buf, size_t len)
int off = 0;
while (len) {
ss = write(stp->dst_fd, buf+off, len);
- if (ss < 0) {
- if (maygvl_copy_stream_continue_p(0, stp))
- continue;
+ if (ss == -1) {
+ if (maygvl_copy_stream_continue_p(0, stp))
+ continue;
if (errno == EAGAIN || errno == EWOULDBLOCK) {
- int ret = nogvl_copy_stream_wait_write(stp);
- if (ret < 0) return ret;
+ if (nogvl_copy_stream_wait_write(stp) == -1)
+ return -1;
continue;
}
stp->syserr = "write";
stp->error_no = errno;
- return (int)ss;
+ return -1;
}
off += (int)ss;
len -= (int)ss;
@@ -11307,15 +10382,15 @@ nogvl_copy_stream_read_write(struct copy_stream_struct *stp)
int use_pread;
copy_length = stp->copy_length;
- use_eof = copy_length < (off_t)0;
+ use_eof = copy_length == (off_t)-1;
src_offset = stp->src_offset;
- use_pread = src_offset >= (off_t)0;
+ use_pread = src_offset != (off_t)-1;
if (use_pread && stp->close_src) {
off_t r;
errno = 0;
r = lseek(stp->src_fd, src_offset, SEEK_SET);
- if (r < (off_t)0 && errno) {
+ if (r == (off_t)-1 && errno) {
stp->syserr = "lseek";
stp->error_no = errno;
return;
@@ -11355,22 +10430,10 @@ static void *
nogvl_copy_stream_func(void *arg)
{
struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
-#if defined(USE_SENDFILE) || defined(USE_COPY_FILE_RANGE) || defined(HAVE_FCOPYFILE)
+#ifdef USE_SENDFILE
int ret;
#endif
-#ifdef USE_COPY_FILE_RANGE
- ret = nogvl_copy_file_range(stp);
- if (ret != 0)
- goto finish; /* error or success */
-#endif
-
-#ifdef HAVE_FCOPYFILE
- ret = nogvl_fcopyfile(stp);
- if (ret != 0)
- goto finish; /* error or success */
-#endif
-
#ifdef USE_SENDFILE
ret = nogvl_copy_stream_sendfile(stp);
if (ret != 0)
@@ -11379,7 +10442,7 @@ nogvl_copy_stream_func(void *arg)
nogvl_copy_stream_read_write(stp);
-#if defined(USE_SENDFILE) || defined(USE_COPY_FILE_RANGE) || defined(HAVE_FCOPYFILE)
+#ifdef USE_SENDFILE
finish:
#endif
return 0;
@@ -11396,7 +10459,7 @@ copy_stream_fallback_body(VALUE arg)
off_t off = stp->src_offset;
ID read_method = id_readpartial;
- if (stp->src_fd < 0) {
+ if (stp->src_fd == -1) {
if (!rb_respond_to(stp->src, read_method)) {
read_method = id_read;
}
@@ -11405,17 +10468,15 @@ copy_stream_fallback_body(VALUE arg)
while (1) {
long numwrote;
long l;
- if (stp->copy_length < (off_t)0) {
+ if (stp->copy_length == (off_t)-1) {
l = buflen;
}
else {
- if (rest == 0) {
- rb_str_resize(buf, 0);
- break;
- }
+ if (rest == 0)
+ break;
l = buflen < rest ? buflen : (long)rest;
}
- if (stp->src_fd < 0) {
+ if (stp->src_fd == -1) {
VALUE rc = rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf);
if (read_method == id_read && NIL_P(rc))
@@ -11425,12 +10486,12 @@ 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 < 0)
+ if (ss == -1)
return Qnil;
if (ss == 0)
rb_eof_error();
- if (off >= (off_t)0)
+ rb_str_resize(buf, ss);
+ if (off != (off_t)-1)
off += ss;
}
n = rb_io_write(stp->dst, buf);
@@ -11448,11 +10509,11 @@ copy_stream_fallback_body(VALUE arg)
static VALUE
copy_stream_fallback(struct copy_stream_struct *stp)
{
- if (stp->src_fd < 0 && stp->src_offset >= (off_t)0) {
+ if (stp->src_fd == -1 && stp->src_offset != (off_t)-1) {
rb_raise(rb_eArgError, "cannot specify src_offset for non-IO");
}
rb_rescue2(copy_stream_fallback_body, (VALUE)stp,
- (VALUE (*) (VALUE, VALUE))0, (VALUE)0,
+ (VALUE (*) (ANYARGS))0, (VALUE)0,
rb_eEOFError, (VALUE)0);
return Qnil;
}
@@ -11475,75 +10536,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 {
- int stat_ret;
- 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;
-
- stat_ret = fstat(src_fd, &stp->src_stat);
- if (stat_ret < 0) {
- stp->syserr = "fstat";
- stp->error_no = errno;
- return Qnil;
+ 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 {
- int stat_ret;
- 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;
-
- stat_ret = fstat(dst_fd, &stp->dst_stat);
- if (stat_ret < 0) {
- stp->syserr = "fstat";
- stp->error_no = errno;
- return Qnil;
+ 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;
@@ -11554,10 +10591,10 @@ copy_stream_body(VALUE arg)
if (dst_fptr)
io_ascii8bit_binmode(dst_fptr);
- if (stp->src_offset < (off_t)0 && src_fptr && src_fptr->rbuf.len) {
+ if (stp->src_offset == (off_t)-1 && src_fptr && src_fptr->rbuf.len) {
size_t len = src_fptr->rbuf.len;
VALUE str;
- if (stp->copy_length >= (off_t)0 && stp->copy_length < (off_t)len) {
+ if (stp->copy_length != (off_t)-1 && stp->copy_length < (off_t)len) {
len = (size_t)stp->copy_length;
}
str = rb_str_buf_new(len);
@@ -11569,9 +10606,8 @@ copy_stream_body(VALUE arg)
}
else /* others such as StringIO */
rb_io_write(dst_io, str);
- rb_str_resize(str, 0);
stp->total += len;
- if (stp->copy_length >= (off_t)0)
+ if (stp->copy_length != (off_t)-1)
stp->copy_length -= len;
}
@@ -11582,10 +10618,13 @@ copy_stream_body(VALUE arg)
if (stp->copy_length == 0)
return Qnil;
- if (src_fd < 0 || dst_fd < 0) {
+ if (src_fd == -1 || dst_fd == -1) {
return copy_stream_fallback(stp);
}
+ rb_fd_set(src_fd, &stp->fds);
+ rb_fd_set(dst_fd, &stp->fds);
+
rb_thread_call_without_gvl(nogvl_copy_stream_func, (void*)stp, RUBY_UBF_IO, 0);
return Qnil;
}
@@ -11594,21 +10633,16 @@ static VALUE
copy_stream_finalize(VALUE arg)
{
struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
-
-#ifdef HAVE_FCOPYFILE
- if (stp->copyfile_state) {
- copyfile_state_free(stp->copyfile_state);
- }
-#endif
-
if (stp->close_src) {
rb_io_close_m(stp->src);
}
if (stp->close_dst) {
rb_io_close_m(stp->dst);
}
+ 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);
@@ -11623,11 +10657,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 #readpartial or #read
- * method. IO-like object for <i>dst</i> should have #write 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.
*
@@ -11671,6 +10701,7 @@ rb_io_s_copy_stream(int argc, VALUE *argv, VALUE io)
else
st.src_offset = NUM2OFFT(src_offset);
+ rb_fd_init(&st.fds);
rb_ensure(copy_stream_body, (VALUE)&st, copy_stream_finalize, (VALUE)&st);
return OFFT2NUM(st.total);
@@ -11681,7 +10712,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
@@ -11706,7 +10737,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
@@ -11745,7 +10776,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);
@@ -11757,6 +10788,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);
@@ -11764,12 +10796,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
@@ -11781,7 +10807,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>
*
@@ -11806,7 +10832,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)
@@ -11839,7 +10865,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:
*
@@ -11886,10 +10912,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)
@@ -11937,25 +10963,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.
@@ -12034,28 +11052,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
@@ -12066,11 +11078,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
@@ -12109,9 +11118,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;
}
@@ -12133,8 +11141,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:
@@ -12145,27 +11152,27 @@ 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 EOFError on end of ARGF stream.
+ * It raises <code>EOFError</code> on end of ARGF stream.
* Since ARGF stream is a concatenation of multiple files,
* internally EOF is occur for each file.
* ARGF.readpartial returns empty strings for EOFs except the last one and
- * raises EOFError for the last one.
+ * raises <code>EOFError</code> for the last one.
*
*/
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.
*/
@@ -12173,28 +11180,19 @@ 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;
- int no_exception;
rb_scan_args(argc, argv, "11", &length, &str);
if (!NIL_P(str)) {
StringValue(str);
argv[1] = str;
}
- no_exception = no_exception_p(opts);
if (!next_argv()) {
if (!NIL_P(str)) {
@@ -12203,26 +11201,24 @@ argf_getpartial(int argc, VALUE *argv, VALUE argf, VALUE opts, int nonblock)
rb_eof_error();
}
if (ARGF_GENERIC_INPUT_P()) {
- VALUE (*const rescue_does_nothing)(VALUE, VALUE) = 0;
struct argf_call_arg arg;
arg.argc = argc;
arg.argv = argv;
arg.argf = argf;
tmp = rb_rescue2(argf_forward_call, (VALUE)&arg,
- rescue_does_nothing, Qnil, rb_eEOFError, (VALUE)0);
+ RUBY_METHOD_FUNC(0), Qnil, rb_eEOFError, (VALUE)0);
}
else {
- tmp = io_getpartial(argc, argv, ARGF.current_file, no_exception, nonblock);
+ tmp = io_getpartial(argc, argv, ARGF.current_file, nonblock, 0);
}
if (NIL_P(tmp)) {
if (ARGF.next_p == -1) {
- return io_nonblock_eof(no_exception);
+ rb_eof_error();
}
argf_close(argf);
ARGF.next_p = 1;
- if (RARRAY_LEN(ARGF.argv) == 0) {
- return io_nonblock_eof(no_exception);
- }
+ if (RARRAY_LEN(ARGF.argv) == 0)
+ rb_eof_error();
if (NIL_P(str))
str = rb_str_new(NULL, 0);
return str;
@@ -12277,7 +11273,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.
@@ -12357,9 +11353,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:
@@ -12406,58 +11402,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
@@ -12467,19 +11439,19 @@ 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;
}
/*
- * This is a deprecated alias for #each_line.
+ * This is a deprecated alias for <code>each_line</code>.
*/
static VALUE
argf_lines(int argc, VALUE *argv, VALUE argf)
{
- rb_warn_deprecated("ARGF#lines", "#each_line");
+ rb_warn("ARGF#lines is deprecated; use #each_line instead");
if (!rb_block_given_p())
return rb_enumeratorize(argf, ID2SYM(rb_intern("each_line")), argc, argv);
return argf_each_line(argc, argv, argf);
@@ -12494,7 +11466,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
@@ -12504,7 +11476,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]
*
@@ -12520,13 +11492,13 @@ argf_each_byte(VALUE argf)
}
/*
- * This is a deprecated alias for #each_byte.
+ * This is a deprecated alias for <code>each_byte</code>.
*/
static VALUE
argf_bytes(VALUE argf)
{
- rb_warn_deprecated("ARGF#bytes", "#each_byte");
+ rb_warn("ARGF#bytes is deprecated; use #each_byte instead");
if (!rb_block_given_p())
return rb_enumeratorize(argf, ID2SYM(rb_intern("each_byte")), 0, 0);
return argf_each_byte(argf);
@@ -12534,8 +11506,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+.
*
@@ -12559,13 +11531,13 @@ argf_each_char(VALUE argf)
}
/*
- * This is a deprecated alias for #each_char.
+ * This is a deprecated alias for <code>each_char</code>.
*/
static VALUE
argf_chars(VALUE argf)
{
- rb_warn_deprecated("ARGF#chars", "#each_char");
+ rb_warn("ARGF#chars is deprecated; use #each_char instead");
if (!rb_block_given_p())
return rb_enumeratorize(argf, ID2SYM(rb_intern("each_char")), 0, 0);
return argf_each_char(argf);
@@ -12573,8 +11545,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+.
*
@@ -12598,13 +11570,13 @@ argf_each_codepoint(VALUE argf)
}
/*
- * This is a deprecated alias for #each_codepoint.
+ * This is a deprecated alias for <code>each_codepoint</code>.
*/
static VALUE
argf_codepoints(VALUE argf)
{
- rb_warn_deprecated("ARGF#codepoints", "#each_codepoint");
+ rb_warn("ARGF#codepoints is deprecated; use #each_codepoint instead");
if (!rb_block_given_p())
return rb_enumeratorize(argf, ID2SYM(rb_intern("each_codepoint")), 0, 0);
return argf_each_codepoint(argf);
@@ -12649,8 +11621,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:
*
@@ -12695,10 +11667,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
@@ -12717,7 +11689,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"
@@ -12738,11 +11710,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
*
@@ -12750,6 +11722,7 @@ argf_skip(VALUE argf)
* ARGF.close
* ARGF.filename #=> "bar"
* ARGF.close
+ * ARGF.close #=> closed stream (IOError)
*/
static VALUE
argf_close_m(VALUE argf)
@@ -12795,15 +11768,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
@@ -12816,7 +11788,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.
*
@@ -12829,20 +11801,24 @@ 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)
{
+ if (rb_safe_level() >= 1 && OBJ_TAINTED(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;
}
@@ -12853,10 +11829,18 @@ opt_i_set(VALUE val, ID id, VALUE *var)
argf_inplace_mode_set(*var, val);
}
+const char *
+ruby_get_inplace_mode(void)
+{
+ 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);
}
/*
@@ -12920,15 +11904,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) {
@@ -12969,18 +11948,6 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *
}
}
-static VALUE
-get_LAST_READ_LINE(ID _x, VALUE *_y)
-{
- return rb_lastline_get();
-}
-
-static void
-set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
-{
- rb_lastline_set(val);
-}
-
/*
* Document-class: IOError
*
@@ -12992,8 +11959,8 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* 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
@@ -13006,7 +11973,7 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* 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+.
*
@@ -13094,13 +12061,13 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* <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
@@ -13132,7 +12099,7 @@ set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
* Example:
*
* require 'io/console'
- * rows, columns = $stdout.winsize
+ * rows, columns = $stdin.winsize
* puts "Your screen is #{columns} wide and #{rows} tall"
*/
@@ -13187,14 +12154,10 @@ Init_IO(void)
rb_cIO = rb_define_class("IO", rb_cObject);
rb_include_module(rb_cIO, rb_mEnumerable);
- /* exception to wait for reading. see IO.select. */
rb_mWaitReadable = rb_define_module_under(rb_cIO, "WaitReadable");
- /* exception to wait for writing. see IO.select. */
rb_mWaitWritable = rb_define_module_under(rb_cIO, "WaitWritable");
- /* exception to wait for reading by EAGAIN. see IO.select. */
rb_eEAGAINWaitReadable = rb_define_class_under(rb_cIO, "EAGAINWaitReadable", rb_eEAGAIN);
rb_include_module(rb_eEAGAINWaitReadable, rb_mWaitReadable);
- /* exception to wait for writing by EAGAIN. see IO.select. */
rb_eEAGAINWaitWritable = rb_define_class_under(rb_cIO, "EAGAINWaitWritable", rb_eEAGAIN);
rb_include_module(rb_eEAGAINWaitWritable, rb_mWaitWritable);
#if EAGAIN == EWOULDBLOCK
@@ -13205,17 +12168,13 @@ Init_IO(void)
/* same as IO::EAGAINWaitWritable */
rb_define_const(rb_cIO, "EWOULDBLOCKWaitWritable", rb_eEAGAINWaitWritable);
#else
- /* exception to wait for reading by EWOULDBLOCK. see IO.select. */
rb_eEWOULDBLOCKWaitReadable = rb_define_class_under(rb_cIO, "EWOULDBLOCKWaitReadable", rb_eEWOULDBLOCK);
rb_include_module(rb_eEWOULDBLOCKWaitReadable, rb_mWaitReadable);
- /* exception to wait for writing by EWOULDBLOCK. see IO.select. */
rb_eEWOULDBLOCKWaitWritable = rb_define_class_under(rb_cIO, "EWOULDBLOCKWaitWritable", rb_eEWOULDBLOCK);
rb_include_module(rb_eEWOULDBLOCKWaitWritable, rb_mWaitWritable);
#endif
- /* exception to wait for reading by EINPROGRESS. see IO.select. */
rb_eEINPROGRESSWaitReadable = rb_define_class_under(rb_cIO, "EINPROGRESSWaitReadable", rb_eEINPROGRESS);
rb_include_module(rb_eEINPROGRESSWaitReadable, rb_mWaitReadable);
- /* exception to wait for writing by EINPROGRESS. see IO.select. */
rb_eEINPROGRESSWaitWritable = rb_define_class_under(rb_cIO, "EINPROGRESSWaitWritable", rb_eEINPROGRESS);
rb_include_module(rb_eEINPROGRESSWaitWritable, rb_mWaitWritable);
@@ -13244,17 +12203,17 @@ Init_IO(void)
rb_define_method(rb_cIO, "initialize", rb_io_initialize, -1);
rb_output_fs = Qnil;
- rb_define_hooked_variable("$,", &rb_output_fs, 0, rb_output_fs_setter);
+ rb_define_hooked_variable("$,", &rb_output_fs, 0, rb_str_setter);
- rb_default_rs = rb_fstring_lit("\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);
- rb_define_virtual_variable("$_", get_LAST_READ_LINE, set_LAST_READ_LINE);
+ rb_define_virtual_variable("$_", rb_lastline_get, rb_lastline_set);
rb_define_method(rb_cIO, "initialize_copy", rb_io_init_copy, 1);
rb_define_method(rb_cIO, "reopen", rb_io_reopen, -1);
@@ -13277,9 +12236,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);
@@ -13294,9 +12250,11 @@ Init_IO(void)
rb_define_method(rb_cIO, "readlines", rb_io_readlines, -1);
+ rb_define_method(rb_cIO, "read_nonblock", io_read_nonblock, -1);
+ rb_define_method(rb_cIO, "write_nonblock", rb_io_write_nonblock, -1);
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);
@@ -13352,7 +12310,6 @@ Init_IO(void)
rb_define_method(rb_cIO, "external_encoding", rb_io_external_encoding, 0);
rb_define_method(rb_cIO, "internal_encoding", rb_io_internal_encoding, 0);
rb_define_method(rb_cIO, "set_encoding", rb_io_set_encoding, -1);
- rb_define_method(rb_cIO, "set_encoding_by_bom", rb_io_set_encoding_by_bom, 0);
rb_define_method(rb_cIO, "autoclose?", rb_io_autoclose_p, 0);
rb_define_method(rb_cIO, "autoclose=", rb_io_set_autoclose, 1);
@@ -13365,7 +12322,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);
@@ -13376,7 +12333,7 @@ Init_IO(void)
#if 0
/* Hack to get rdoc to regard ARGF as a class: */
- rb_cARGF = rb_define_class("ARGF", rb_cObject);
+ rb_cARGF = rb_define_class("ARGF.class", rb_cObject);
#endif
rb_cARGF = rb_class_new(rb_cObject);
@@ -13477,10 +12434,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"));
@@ -13500,14 +12456,4 @@ 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"));
-}
-
-#include "io.rbinc"
-
-void
-Init_IO_nonblock(void)
-{
- load_io();
}
diff --git a/io.rb b/io.rb
deleted file mode 100644
index 1b6dddf9e5..0000000000
--- a/io.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-class IO
- # other IO methods are defined in io.c
-
- # 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.
- #
- # On some platforms, such as Windows, non-blocking mode is not supported
- # on IO objects other than sockets. In such cases, Errno::EBADF will
- # be raised.
- #
- # 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)
- __builtin_io_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)
- __builtin_io_write_nonblock(buf, exception)
- end
-end
diff --git a/iseq.c b/iseq.c
index cbf62176bd..abd29e8865 100644
--- a/iseq.c
+++ b/iseq.c
@@ -17,27 +17,18 @@
# include <dlfcn.h>
#endif
-#define RUBY_VM_INSNS_INFO 1
/* #define RUBY_MARK_FREE_DEBUG 1 */
#include "gc.h"
#include "vm_core.h"
#include "iseq.h"
-#include "id_table.h"
-#include "builtin.h"
#include "insns.inc"
#include "insns_info.inc"
-#include "mjit.h"
-VALUE rb_cISeq;
-static VALUE iseqw_new(const rb_iseq_t *iseq);
-static const rb_iseq_t *iseqw_check(VALUE iseqw);
+#define ISEQ_MAJOR_VERSION 2
+#define ISEQ_MINOR_VERSION 2
-#if VM_INSN_INFO_TABLE_IMPL == 2
-static struct succ_index_table *succ_index_table_create(int max_pos, int *data, int size);
-static unsigned int *succ_index_table_invert(int max_pos, struct succ_index_table *sd, int size);
-static int succ_index_lookup(const struct succ_index_table *sd, int x);
-#endif
+VALUE rb_cISeq;
#define hidden_obj_p(obj) (!SPECIAL_CONST_P(obj) && !RBASIC(obj)->klass)
@@ -52,610 +43,292 @@ obj_resurrect(VALUE obj)
case T_ARRAY:
obj = rb_ary_resurrect(obj);
break;
- case T_HASH:
- obj = rb_hash_resurrect(obj);
- break;
}
}
return obj;
}
static void
-free_arena(struct iseq_compile_data_storage *cur)
-{
- struct iseq_compile_data_storage *next;
-
- while (cur) {
- next = cur->next;
- ruby_xfree(cur);
- cur = next;
- }
-}
-
-static void
compile_data_free(struct iseq_compile_data *compile_data)
{
if (compile_data) {
- free_arena(compile_data->node.storage_head);
- free_arena(compile_data->insn.storage_head);
- if (compile_data->ivar_cache_table) {
- rb_id_table_free(compile_data->ivar_cache_table);
+ struct iseq_compile_data_storage *cur, *next;
+ cur = compile_data->storage_head;
+ while (cur) {
+ next = cur->next;
+ ruby_xfree(cur);
+ cur = next;
}
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 && iseq->body) {
- struct rb_iseq_constant_body *const body = iseq->body;
- mjit_free_iseq(iseq); /* Notify MJIT */
- ruby_xfree((void *)body->iseq_encoded);
- ruby_xfree((void *)body->insns_info.body);
- if (body->insns_info.positions) ruby_xfree((void *)body->insns_info.positions);
-#if VM_INSN_INFO_TABLE_IMPL == 2
- if (body->insns_info.succ_index_table) ruby_xfree(body->insns_info.succ_index_table);
-#endif
- if (LIKELY(body->local_table != rb_iseq_shared_exc_local_tbl))
- ruby_xfree((void *)body->local_table);
- ruby_xfree((void *)body->is_entries);
-
- if (body->call_data) {
- unsigned int i;
- struct rb_kwarg_call_data *kw_calls = (struct rb_kwarg_call_data *)&body->call_data[body->ci_size];
- for (i=0; i<body->ci_kw_size; i++) {
- const struct rb_call_info_kw_arg *kw_arg = kw_calls[i].ci_kw.kw_arg;
- ruby_xfree((void *)kw_arg);
+ if (ptr) {
+ int i;
+ 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(body->call_data);
- }
- ruby_xfree((void *)body->catch_table);
- ruby_xfree((void *)body->param.opt_table);
- if (body->param.keyword != NULL) {
- ruby_xfree((void *)body->param.keyword->default_values);
- ruby_xfree((void *)body->param.keyword);
+ 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);
+ if (iseq->callinfo_entries) {
+ for (i=0; i<iseq->callinfo_size; i++) {
+ /* TODO: revisit callinfo data structure */
+ rb_call_info_kw_arg_t *kw_arg = iseq->callinfo_entries[i].kw_arg;
+ RUBY_FREE_UNLESS_NULL(kw_arg);
+ }
+ RUBY_FREE_UNLESS_NULL(iseq->callinfo_entries);
+ }
+ RUBY_FREE_UNLESS_NULL(iseq->catch_table);
+ RUBY_FREE_UNLESS_NULL(iseq->param.opt_table);
+ if (iseq->param.keyword != NULL) {
+ RUBY_FREE_UNLESS_NULL(iseq->param.keyword->default_values);
+ RUBY_FREE_UNLESS_NULL(iseq->param.keyword);
+ }
+ compile_data_free(iseq->compile_data);
+ RUBY_FREE_UNLESS_NULL(iseq->iseq);
}
- compile_data_free(ISEQ_COMPILE_DATA(iseq));
- ruby_xfree(body);
- }
-
- if (iseq && ISEQ_EXECUTABLE_P(iseq) && iseq->aux.exec.local_hooks) {
- rb_hook_list_free(iseq->aux.exec.local_hooks);
+ ruby_xfree(ptr);
}
-
RUBY_FREE_LEAVE("iseq");
}
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
-static VALUE
-rb_vm_insn_addr2insn2(const void *addr)
-{
- return (VALUE)rb_vm_insn_addr2insn(addr);
-}
-#endif
-
-static VALUE
-rb_vm_insn_null_translator(const void *addr)
-{
- return (VALUE)addr;
-}
-
-typedef VALUE iseq_value_itr_t(void *ctx, VALUE obj);
-typedef VALUE rb_vm_insns_translator_t(const void *addr);
-
-static int
-iseq_extract_values(VALUE *code, size_t pos, iseq_value_itr_t * func, void *data, rb_vm_insns_translator_t * translator)
-{
- VALUE insn = translator((void *)code[pos]);
- int len = insn_len(insn);
- int op_no;
- const char *types = insn_op_types(insn);
-
- for (op_no = 0; types[op_no]; op_no++) {
- char type = types[op_no];
- switch (type) {
- case TS_CDHASH:
- case TS_ISEQ:
- case TS_VALUE:
- {
- VALUE op = code[pos + op_no + 1];
- if (!SPECIAL_CONST_P(op)) {
- VALUE newop = func(data, op);
- if (newop != op) {
- code[pos + op_no + 1] = newop;
- }
- }
- }
- break;
- case TS_ISE:
- {
- union iseq_inline_storage_entry *const is = (union iseq_inline_storage_entry *)code[pos + op_no + 1];
- if (is->once.value) {
- VALUE nv = func(data, is->once.value);
- if (is->once.value != nv) {
- is->once.value = nv;
- }
- }
- }
- break;
- default:
- break;
- }
- }
-
- return len;
-}
-
static void
-rb_iseq_each_value(const rb_iseq_t *iseq, iseq_value_itr_t * func, void *data)
-{
- unsigned int size;
- VALUE *code;
- size_t n;
- rb_vm_insns_translator_t *const translator =
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- (FL_TEST(iseq, ISEQ_TRANSLATED)) ? rb_vm_insn_addr2insn2 :
-#endif
- rb_vm_insn_null_translator;
- const struct rb_iseq_constant_body *const body = iseq->body;
-
- size = body->iseq_size;
- code = body->iseq_encoded;
-
- for (n = 0; n < size;) {
- n += iseq_extract_values(code, n, func, data, translator);
- }
-}
-
-static VALUE
-update_each_insn_value(void *ctx, VALUE obj)
-{
- return rb_gc_location(obj);
-}
-
-void
-rb_iseq_update_references(rb_iseq_t *iseq)
-{
- if (iseq->body) {
- struct rb_iseq_constant_body *body = iseq->body;
-
- body->variable.coverage = rb_gc_location(body->variable.coverage);
- body->variable.pc2branchindex = rb_gc_location(body->variable.pc2branchindex);
- body->location.label = rb_gc_location(body->location.label);
- body->location.base_label = rb_gc_location(body->location.base_label);
- body->location.pathobj = rb_gc_location(body->location.pathobj);
- if (body->local_iseq) {
- body->local_iseq = (struct rb_iseq_struct *)rb_gc_location((VALUE)body->local_iseq);
- }
- if (body->parent_iseq) {
- body->parent_iseq = (struct rb_iseq_struct *)rb_gc_location((VALUE)body->parent_iseq);
- }
- if (FL_TEST(iseq, ISEQ_MARKABLE_ISEQ)) {
- rb_iseq_each_value(iseq, update_each_insn_value, NULL);
- VALUE *original_iseq = ISEQ_ORIGINAL_ISEQ(iseq);
- if (original_iseq) {
- size_t n = 0;
- const unsigned int size = body->iseq_size;
- while (n < size) {
- n += iseq_extract_values(original_iseq, n, update_each_insn_value, NULL, rb_vm_insn_null_translator);
- }
- }
- }
-
- if (body->param.flags.has_kw && ISEQ_COMPILE_DATA(iseq) == NULL) {
- int i, j;
-
- i = body->param.keyword->required_num;
-
- for (j = 0; i < body->param.keyword->num; i++, j++) {
- VALUE obj = body->param.keyword->default_values[j];
- if (obj != Qundef) {
- body->param.keyword->default_values[j] = rb_gc_location(obj);
- }
- }
- }
-
- if (body->catch_table) {
- struct iseq_catch_table *table = body->catch_table;
- unsigned int i;
- for (i = 0; i < table->size; i++) {
- struct iseq_catch_table_entry *entry;
- entry = UNALIGNED_MEMBER_PTR(table, entries[i]);
- if (entry->iseq) {
- entry->iseq = (rb_iseq_t *)rb_gc_location((VALUE)entry->iseq);
- }
- }
- }
-#if USE_MJIT
- mjit_update_references(iseq);
-#endif
- }
-}
-
-static VALUE
-each_insn_value(void *ctx, VALUE obj)
-{
- rb_gc_mark_movable(obj);
- return obj;
-}
-
-void
-rb_iseq_mark(const rb_iseq_t *iseq)
+iseq_mark(void *ptr)
{
RUBY_MARK_ENTER("iseq");
- RUBY_MARK_UNLESS_NULL(iseq->wrapper);
-
- if (iseq->body) {
- const struct rb_iseq_constant_body *const body = iseq->body;
-
- if (FL_TEST(iseq, ISEQ_MARKABLE_ISEQ)) {
- rb_iseq_each_value(iseq, each_insn_value, NULL);
- }
-
- rb_gc_mark_movable(body->variable.coverage);
- rb_gc_mark_movable(body->variable.pc2branchindex);
- rb_gc_mark_movable(body->location.label);
- rb_gc_mark_movable(body->location.base_label);
- rb_gc_mark_movable(body->location.pathobj);
- RUBY_MARK_NO_PIN_UNLESS_NULL((VALUE)body->parent_iseq);
+ if (ptr) {
+ rb_iseq_t *iseq = ptr;
- if (body->param.flags.has_kw && ISEQ_COMPILE_DATA(iseq) == NULL) {
- const struct rb_iseq_param_keyword *const keyword = body->param.keyword;
- int i, j;
+ RUBY_GC_INFO("%s @ %s\n", RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path));
+ RUBY_MARK_UNLESS_NULL(iseq->mark_ary);
- i = keyword->required_num;
+ 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);
- for (j = 0; i < keyword->num; i++, j++) {
- VALUE obj = keyword->default_values[j];
- if (!SPECIAL_CONST_P(obj)) {
- rb_gc_mark_movable(obj);
- }
- }
- }
+ 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);
- if (body->catch_table) {
- const struct iseq_catch_table *table = body->catch_table;
- unsigned int i;
- for (i = 0; i < table->size; i++) {
- const struct iseq_catch_table_entry *entry;
- entry = UNALIGNED_MEMBER_PTR(table, entries[i]);
- if (entry->iseq) {
- rb_gc_mark_movable((VALUE)entry->iseq);
- }
- }
+ if (iseq->compile_data != 0) {
+ struct iseq_compile_data *const compile_data = iseq->compile_data;
+ RUBY_MARK_UNLESS_NULL(compile_data->mark_ary);
+ RUBY_MARK_UNLESS_NULL(compile_data->err_info);
+ RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary);
}
}
-
- if (FL_TEST_RAW(iseq, ISEQ_NOT_LOADED_YET)) {
- rb_gc_mark(iseq->aux.loader.obj);
- }
- else if (FL_TEST_RAW(iseq, ISEQ_USE_COMPILE_DATA)) {
- const struct iseq_compile_data *const compile_data = ISEQ_COMPILE_DATA(iseq);
-
- rb_iseq_mark_insn_storage(compile_data->insn.storage_head);
-
- RUBY_MARK_UNLESS_NULL(compile_data->err_info);
- if (RTEST(compile_data->catch_table_ary)) {
- rb_gc_mark(compile_data->catch_table_ary);
- }
- VM_ASSERT(compile_data != NULL);
- }
- else {
- /* executable */
- VM_ASSERT(ISEQ_EXECUTABLE_P(iseq));
- if (iseq->aux.exec.local_hooks) {
- rb_hook_list_mark(iseq->aux.exec.local_hooks);
- }
- }
-
RUBY_MARK_LEAVE("iseq");
}
static size_t
-param_keyword_size(const struct rb_iseq_param_keyword *pkw)
-{
- size_t size = 0;
-
- if (!pkw) return size;
-
- size += sizeof(struct rb_iseq_param_keyword);
- size += sizeof(VALUE) * (pkw->num - pkw->required_num);
-
- return size;
-}
-
-size_t
-rb_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 (ISEQ_EXECUTABLE_P(iseq) && body) {
- struct rb_kwarg_call_data *kw_calls = (struct rb_kwarg_call_data *)&body->call_data[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) + sizeof(unsigned int));
- 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->call_data */
- size += body->ci_size * sizeof(struct rb_call_data);
- size += body->ci_kw_size * sizeof(struct rb_kwarg_call_data);
-
- if (kw_calls) {
- unsigned int i;
-
- for (i = 0; i < body->ci_kw_size; i++) {
- const struct rb_call_info_kw_arg *kw_arg = kw_calls[i].ci_kw.kw_arg;
-
- if (kw_arg) {
- size += rb_call_info_kw_arg_bytes(kw_arg->keyword_len);
- }
- }
- }
- }
-
- compile_data = ISEQ_COMPILE_DATA(iseq);
- if (compile_data) {
- struct iseq_compile_data_storage *cur;
+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->param.opt_num + 1) * sizeof(VALUE);
+ if (iseq->param.keyword != NULL) {
+ size += sizeof(struct rb_iseq_param_keyword);
+ size += sizeof(VALUE) * (iseq->param.keyword->num - iseq->param.keyword->required_num);
+ }
+ size += iseq->is_size * sizeof(union iseq_inline_storage_entry);
+ size += iseq->callinfo_size * sizeof(rb_call_info_t);
- size += sizeof(struct iseq_compile_data);
+ if (iseq->compile_data) {
+ struct iseq_compile_data_storage *cur;
- cur = compile_data->node.storage_head;
- while (cur) {
- size += cur->size + offsetof(struct iseq_compile_data_storage, buff);
- cur = cur->next;
+ 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);
+ }
}
}
return size;
}
-static uintptr_t fresh_iseq_unique_id = 0; /* -- Remove In 3.0 -- */
-
-struct rb_iseq_constant_body *
-rb_iseq_constant_body_alloc(void)
-{
- struct rb_iseq_constant_body *iseq_body;
- iseq_body = ZALLOC(struct rb_iseq_constant_body);
- iseq_body->iseq_unique_id = fresh_iseq_unique_id++; /* -- Remove In 3.0 -- */
- return iseq_body;
-}
-
-static rb_iseq_t *
-iseq_alloc(void)
-{
- rb_iseq_t *iseq = iseq_imemo_alloc();
- iseq->body = rb_iseq_constant_body_alloc();
- 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 */
+ 0, 0,
+ RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_PROMOTED1 /* start from age == 2 */ | 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_location_t *code_location, const int node_id)
+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_location) {
- loc->node_id = node_id;
- loc->code_location = *code_location;
+ 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_location.beg_pos.lineno = 0;
- loc->code_location.beg_pos.column = 0;
- loc->code_location.end_pos.lineno = -1;
- loc->code_location.end_pos.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)
{
- struct rb_iseq_constant_body *const body = iseq->body;
- const VALUE type = 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) {
- 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) {
- 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) {
- 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) {
- body->parent_iseq = piseq;
+ if (RTEST(parent)) {
+ GetISeqPtr(parent, piseq);
+ iseq->parent_iseq = piseq;
}
if (type == ISEQ_TYPE_MAIN) {
- body->local_iseq = iseq;
+ iseq->local_iseq = iseq;
}
}
-static struct iseq_compile_data_storage *
-new_arena(void)
+void
+rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj)
{
- struct iseq_compile_data_storage * new_arena =
- (struct iseq_compile_data_storage *)
- ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE +
- offsetof(struct iseq_compile_data_storage, buff));
-
- new_arena->pos = 0;
- new_arena->next = 0;
- new_arena->size = INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE;
-
- return new_arena;
+ 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_location_t *code_location, const int node_id,
- 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,
const rb_compile_option_t *option)
{
- VALUE coverage = Qfalse;
- VALUE err_info = Qnil;
- struct rb_iseq_constant_body *const body = iseq->body;
-
- if (parent && (type == ISEQ_TYPE_MAIN || type == ISEQ_TYPE_TOP))
- err_info = Qfalse;
-
- body->type = type;
+ iseq->type = type;
+ 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_location, node_id);
- if (iseq != body->local_iseq) {
- RB_OBJ_WRITE(iseq, &body->location.base_label, body->local_iseq->body->location.label);
- }
- ISEQ_COVERAGE_SET(iseq, Qnil);
- ISEQ_ORIGINAL_ISEQ_CLEAR(iseq);
- body->variable.flip_count = 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)->catch_table_ary, Qnil);
-
- ISEQ_COMPILE_DATA(iseq)->node.storage_head = ISEQ_COMPILE_DATA(iseq)->node.storage_current = new_arena();
- ISEQ_COMPILE_DATA(iseq)->insn.storage_head = ISEQ_COMPILE_DATA(iseq)->insn.storage_current = new_arena();
- ISEQ_COMPILE_DATA(iseq)->option = option;
-
- ISEQ_COMPILE_DATA(iseq)->ivar_cache_table = NULL;
-
- ISEQ_COMPILE_DATA(iseq)->builtin_function_table = GET_VM()->builtin_function_table;
-
- if (option->coverage_enabled) {
+ 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);
+ }
+ iseq->defined_method_id = 0;
+ RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, 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->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->option = option;
+ iseq->compile_data->last_coverable_line = -1;
+
+ 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);
- if (coverage && ISEQ_BRANCH_COVERAGE(iseq))
- ISEQ_PC2BRANCHINDEX_SET(iseq, rb_ary_tmp_new(0));
return Qtrue;
}
-#if VM_CHECK_MODE > 0 && VM_INSN_INFO_TABLE_IMPL > 0
-static void validate_get_insn_info(const rb_iseq_t *iseq);
-#endif
-
-void
-rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq)
-{
-#if VM_INSN_INFO_TABLE_IMPL == 2
- struct rb_iseq_constant_body *const body = iseq->body;
- int size = body->insns_info.size;
- int max_pos = body->iseq_size;
- int *data = (int *)body->insns_info.positions;
- if (body->insns_info.succ_index_table) ruby_xfree(body->insns_info.succ_index_table);
- body->insns_info.succ_index_table = succ_index_table_create(max_pos, data, size);
-#if VM_CHECK_MODE == 0
- ruby_xfree(body->insns_info.positions);
- body->insns_info.positions = NULL;
-#endif
-#endif
-}
-
-#if VM_INSN_INFO_TABLE_IMPL == 2
-unsigned int *
-rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body)
-{
- int size = body->insns_info.size;
- int max_pos = body->iseq_size;
- struct succ_index_table *sd = body->insns_info.succ_index_table;
- return succ_index_table_invert(max_pos, sd, size);
-}
-#endif
-
-void
-rb_iseq_init_trace(rb_iseq_t *iseq)
-{
- iseq->aux.exec.global_trace_events = 0;
- if (ruby_vm_event_enabled_global_flags & ISEQ_TRACE_EVENTS) {
- rb_iseq_trace_set(iseq, ruby_vm_event_enabled_global_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);
- const struct rb_iseq_constant_body *const body = iseq->body;
+ 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_INSN_INFO_TABLE_IMPL == 2 /* succinct bitvector */
- /* create succ_index_table */
- if (body->insns_info.succ_index_table == NULL) {
- rb_iseq_insns_info_encode_positions(iseq);
- }
-#endif
-
-#if VM_CHECK_MODE > 0 && VM_INSN_INFO_TABLE_IMPL > 0
- validate_get_insn_info(iseq);
-#endif
-
if (RTEST(err)) {
- VALUE path = pathobj_path(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;
}
@@ -667,48 +340,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
-}
-
-static 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) {
@@ -722,9 +358,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");
@@ -734,7 +390,7 @@ make_compile_option(rb_compile_option_t *option, VALUE opt)
static VALUE
make_compile_option_value(rb_compile_option_t *option)
{
- VALUE opt = rb_hash_new_with_size(11);
+ VALUE opt = rb_hash_new();
#define SET_COMPILE_OPTION(o, h, mem) \
rb_hash_aset((h), ID2SYM(rb_intern(#mem)), (o)->mem ? Qtrue : Qfalse)
#define SET_COMPILE_OPTION_NUM(o, h, mem) \
@@ -747,9 +403,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
@@ -757,108 +411,55 @@ make_compile_option_value(rb_compile_option_t *option)
return opt;
}
-rb_iseq_t *
-rb_iseq_new(const rb_ast_body_t *ast, 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(ast, 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 rb_ast_body_t *ast, 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)
{
- VALUE coverages = rb_get_coverages();
- if (RTEST(coverages)) {
- if (ast->line_count >= 0) {
- int len = (rb_get_coverage_mode() & COVERAGE_TARGET_ONESHOT_LINES) ? 0 : ast->line_count;
- VALUE coverage = rb_default_coverage(len);
- rb_hash_aset(coverages, path, coverage);
- }
- }
-
- return rb_iseq_new_with_opt(ast, 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 rb_ast_body_t *ast, 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(ast, rb_fstring_lit("<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)
-{
- 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);
- }
- }
-
- return iseq;
-}
-
-rb_iseq_t *
-rb_iseq_new_with_opt(const rb_ast_body_t *ast, 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)
{
- const NODE *node = ast ? ast->root : 0;
/* TODO: argument check */
- rb_iseq_t *iseq = iseq_alloc();
- rb_compile_option_t new_opt;
-
- new_opt = option ? *option : COMPILE_OPTION_DEFAULT;
- if (ast && ast->compile_option) rb_iseq_make_compile_option(&new_opt, ast->compile_option);
-
- prepare_iseq_build(iseq, name, path, realpath, first_lineno, node ? &node->nd_loc : NULL, node ? nd_node_id(node) : -1, parent, type, &new_opt);
-
- rb_iseq_compile_node(iseq, node);
- finish_iseq_build(iseq);
+ rb_iseq_t *iseq;
+ VALUE self = iseq_alloc(rb_cISeq);
- return iseq_translate(iseq);
-}
-
-rb_iseq_t *
-rb_iseq_new_with_callback(
- const struct rb_iseq_new_with_callback_callback_func * ifunc,
- VALUE name, VALUE path, VALUE realpath,
- VALUE first_lineno, const rb_iseq_t *parent,
- enum iseq_type type, const rb_compile_option_t *option)
-{
- /* TODO: argument check */
- rb_iseq_t *iseq = iseq_alloc();
+ GetISeqPtr(self, iseq);
+ iseq->self = self;
if (!option) option = &COMPILE_OPTION_DEFAULT;
- prepare_iseq_build(iseq, name, path, realpath, first_lineno, NULL, -1, parent, type, option);
-
- rb_iseq_compile_callback(iseq, ifunc);
- finish_iseq_build(iseq);
-
- return iseq_translate(iseq);
-}
-
-const rb_iseq_t *
-rb_iseq_load_iseq(VALUE fname)
-{
- VALUE iseqv = rb_check_funcall(rb_cISeq, rb_intern("load_iseq"), 1, &fname);
+ prepare_iseq_build(iseq, name, path, absolute_path, first_lineno, parent,
+ type, option);
- if (!SPECIAL_CONST_P(iseqv) && RBASIC_CLASS(iseqv) == rb_cISeq) {
- return iseqw_check(iseqv);
- }
-
- return NULL;
+ rb_iseq_compile_node(self, node);
+ cleanup_iseq_build(iseq);
+ return self;
}
-#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_HASH(v) rb_convert_type((v), T_HASH, "Hash", "to_hash")
+#define CHECK_STRING(v) rb_convert_type((v), T_STRING, "String", "to_str")
+#define CHECK_SYMBOL(v) rb_convert_type((v), T_SYMBOL, "Symbol", "to_sym")
static inline VALUE CHECK_INTEGER(VALUE v) {(void)NUM2LONG(v); return v;}
static enum iseq_type
@@ -872,7 +473,7 @@ iseq_type_from_sym(VALUE type)
const ID id_ensure = rb_intern("ensure");
const ID id_eval = rb_intern("eval");
const ID id_main = rb_intern("main");
- const ID id_plain = rb_intern("plain");
+ const ID id_defined_guard = rb_intern("defined_guard");
/* ensure all symbols are static or pinned down before
* conversion */
const ID typeid = rb_check_id(&type);
@@ -884,23 +485,23 @@ iseq_type_from_sym(VALUE type)
if (typeid == id_ensure) return ISEQ_TYPE_ENSURE;
if (typeid == id_eval) return ISEQ_TYPE_EVAL;
if (typeid == id_main) return ISEQ_TYPE_MAIN;
- if (typeid == id_plain) return ISEQ_TYPE_PLAIN;
+ if (typeid == id_defined_guard) return ISEQ_TYPE_DEFINED_GUARD;
return (enum iseq_type)-1;
}
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_location, node_id;
+ VALUE name, path, absolute_path, first_lineno;
VALUE type, body, locals, params, exception;
st_data_t iseq_type;
+ rb_iseq_t *iseq;
rb_compile_option_t option;
int i = 0;
- rb_code_location_t tmp_loc = { {0, 0}, {-1, -1} };
/* [magic, major_version, minor_version, format_type, misc,
* label, path, first_lineno,
@@ -918,8 +519,8 @@ iseq_load(VALUE data, const rb_iseq_t *parent, VALUE opt)
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++));
@@ -928,33 +529,28 @@ iseq_load(VALUE data, const rb_iseq_t *parent, VALUE opt)
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, "unsupported type: :%"PRIsVALUE, rb_sym2str(type));
+ rb_raise(rb_eTypeError, "unsupport type: :%"PRIsVALUE, rb_sym2str(type));
}
- node_id = rb_hash_aref(misc, ID2SYM(rb_intern("node_id")));
-
- code_location = rb_hash_aref(misc, ID2SYM(rb_intern("code_location")));
- if (RB_TYPE_P(code_location, T_ARRAY) && RARRAY_LEN(code_location) == 4) {
- tmp_loc.beg_pos.lineno = NUM2INT(rb_ary_entry(code_location, 0));
- tmp_loc.beg_pos.column = NUM2INT(rb_ary_entry(code_location, 1));
- tmp_loc.end_pos.lineno = NUM2INT(rb_ary_entry(code_location, 2));
- tmp_loc.end_pos.column = NUM2INT(rb_ary_entry(code_location, 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, NUM2INT(node_id),
+
+ prepare_iseq_build(iseq, name, path, absolute_path, first_lineno,
parent, (enum iseq_type)iseq_type, &option);
rb_iseq_build_from_ary(iseq, misc, locals, params, exception, body);
- finish_iseq_build(iseq);
-
- return iseqw_new(iseq);
+ cleanup_iseq_build(iseq);
+ return iseqval;
}
/*
@@ -965,198 +561,80 @@ 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);
-}
-
-static rb_iseq_t *
-rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, VALUE opt)
-{
- rb_iseq_t *iseq = NULL;
- rb_compile_option_t option;
-#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();
- VALUE name = rb_fstring_lit("<compiled>");
- const rb_iseq_t *outer_scope = rb_iseq_new(NULL, name, name, Qnil, 0, ISEQ_TYPE_TOP);
- VALUE outer_scope_v = (VALUE)outer_scope;
- rb_parser_set_context(parser, outer_scope, FALSE);
- RB_GC_GUARD(outer_scope_v);
- ast = (*parse)(parser, file, src, ln);
- }
-
- if (!ast->body.root) {
- rb_ast_dispose(ast);
- rb_exc_raise(GET_EC()->errinfo);
- }
- else {
- INITIALIZED VALUE label = rb_fstring_lit("<compiled>");
- iseq = rb_iseq_new_with_opt(&ast->body, label, file, realpath, line,
- 0, ISEQ_TYPE_TOP, &option);
- rb_ast_dispose(ast);
- }
-
- return iseq;
-}
-
-VALUE
-rb_iseq_path(const rb_iseq_t *iseq)
-{
- return pathobj_path(iseq->body->location.pathobj);
-}
-
-VALUE
-rb_iseq_realpath(const rb_iseq_t *iseq)
-{
- return pathobj_realpath(iseq->body->location.pathobj);
-}
-
-VALUE
-rb_iseq_absolute_path(const rb_iseq_t *iseq)
-{
- return rb_iseq_realpath(iseq);
-}
-
-VALUE
-rb_iseq_label(const rb_iseq_t *iseq)
-{
- return iseq->body->location.label;
+ return iseq_load(self, data, 0, opt);
}
VALUE
-rb_iseq_base_label(const rb_iseq_t *iseq)
+rb_iseq_load(VALUE data, VALUE parent, VALUE opt)
{
- return iseq->body->location.base_label;
+ return iseq_load(rb_cISeq, data, parent, opt);
}
VALUE
-rb_iseq_first_lineno(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 iseq->body->location.first_lineno;
-}
+ int state;
+ rb_thread_t *th = GET_THREAD();
+ rb_block_t *prev_base_block = th->base_block;
+ VALUE iseqval = Qundef;
-VALUE
-rb_iseq_method_name(const rb_iseq_t *iseq)
-{
- struct rb_iseq_constant_body *const body = iseq->body->local_iseq->body;
+ th->base_block = base_block;
- if (body->type == ISEQ_TYPE_METHOD) {
- return body->location.base_label;
- }
- else {
- return Qnil;
- }
-}
+ TH_PUSH_TAG(th);
+ if ((state = EXEC_TAG()) == 0) {
+ VALUE parser;
+ int ln = NUM2INT(line);
+ NODE *node;
+ rb_compile_option_t option;
-void
-rb_iseq_code_location(const rb_iseq_t *iseq, int *beg_pos_lineno, int *beg_pos_column, int *end_pos_lineno, int *end_pos_column)
-{
- const rb_code_location_t *loc = &iseq->body->location.code_location;
- if (beg_pos_lineno) *beg_pos_lineno = loc->beg_pos.lineno;
- if (beg_pos_column) *beg_pos_column = loc->beg_pos.column;
- if (end_pos_lineno) *end_pos_lineno = loc->end_pos.lineno;
- if (end_pos_column) *end_pos_column = loc->end_pos.column;
-}
+ StringValueCStr(file);
+ make_compile_option(&option, opt);
-VALUE
-rb_iseq_coverage(const rb_iseq_t *iseq)
-{
- return ISEQ_COVERAGE(iseq);
-}
+ parser = rb_parser_new();
-static int
-remove_coverage_i(void *vstart, void *vend, size_t stride, void *data)
-{
- VALUE v = (VALUE)vstart;
- for (; v != (VALUE)vend; v += stride) {
- void *ptr = asan_poisoned_object_p(v);
- asan_unpoison_object(v, false);
+ if (RB_TYPE_P((src), T_FILE))
+ node = rb_parser_compile_file_path(parser, file, src, ln);
+ else {
+ StringValue(src);
+ node = rb_parser_compile_string_path(parser, file, src, ln);
- if (rb_obj_is_iseq(v)) {
- rb_iseq_t *iseq = (rb_iseq_t *)v;
- ISEQ_COVERAGE_SET(iseq, Qnil);
+ if (!node) {
+ rb_exc_raise(GET_THREAD()->errinfo); /* TODO: check err */
+ }
}
- asan_poison_object_if(ptr, v);
+ 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);
+ }
}
- return 0;
-}
+ TH_POP_TAG();
-void
-rb_iseq_remove_coverage_all(void)
-{
- rb_objspace_each_objects(remove_coverage_i, NULL);
-}
-
-/* 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 rb_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)
{
- if (iseq->wrapper) {
- return iseq->wrapper;
- }
- else {
- 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);
-
- /* cache a wrapper object */
- RB_OBJ_WRITE((VALUE)iseq, &iseq->wrapper, obj);
- RB_OBJ_FREEZE((VALUE)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);
}
/*
@@ -1167,14 +645,10 @@ rb_iseqw_new(const rb_iseq_t *iseq)
* Takes +source+, a String of Ruby code and compiles it to an
* InstructionSequence.
*
- * Optionally takes +file+, +path+, and +line+ which describe the file path,
- * real path and first line number of the ruby code in +source+ which are
+ * Optionally takes +file+, +path+, and +line+ which describe the filename,
+ * absolute path and first line number of the ruby code in +source+ which are
* metadata attached to the returned +iseq+.
*
- * +file+ is used for `__FILE__` and exception backtrace. +path+ is used for
- * +require_relative+ base. It is recommended these should be the same full
- * path.
- *
* +options+, which can be +true+, +false+ or a +Hash+, is used to
* modify the default behavior of the Ruby iseq compiler.
*
@@ -1183,38 +657,19 @@ rb_iseqw_new(const rb_iseq_t *iseq)
* RubyVM::InstructionSequence.compile("a = 1 + 2")
* #=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
*
- * path = "test.rb"
- * RubyVM::InstructionSequence.compile(File.read(path), path, File.expand_path(path))
- * #=> <RubyVM::InstructionSequence:<compiled>@test.rb:1>
- *
- * path = File.expand_path("test.rb")
- * RubyVM::InstructionSequence.compile(File.read(path), path, path)
- * #=> <RubyVM::InstructionSequence:<compiled>@/absolute/path/to/test.rb:1>
- *
*/
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;
- 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];
- }
+ rb_secure(1);
- if (NIL_P(file)) file = rb_fstring_lit("<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, opt));
+ return rb_iseq_compile_with_option(src, file, path, line, 0, opt);
}
/*
@@ -1238,43 +693,31 @@ 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;
- 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_secure(1);
+ 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->body.root) exc = GET_EC()->errinfo;
+ node = rb_parser_compile_file(parser, fname, f, NUM2INT(line));
rb_io_close(f);
- if (!ast->body.root) {
- rb_ast_dispose(ast);
- rb_exc_raise(exc);
- }
make_compile_option(&option, opt);
-
- ret = iseqw_new(rb_iseq_new_with_opt(&ast->body, rb_fstring_lit("<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);
}
/*
@@ -1301,6 +744,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.
*
@@ -1309,9 +753,10 @@ 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);
make_compile_option(&option, opt);
COMPILE_OPTION_DEFAULT = option;
return opt;
@@ -1326,32 +771,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
@@ -1361,9 +796,10 @@ rb_iseqw_to_iseq(VALUE iseqw)
* RubyVM::InstructionSequence.compile("1 + 2").eval #=> 3
*/
static VALUE
-iseqw_eval(VALUE self)
+iseq_eval(VALUE self)
{
- return rb_iseq_eval(iseqw_check(self));
+ rb_secure(1);
+ return rb_iseq_eval(self);
}
/*
@@ -1371,21 +807,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);
- const struct rb_iseq_constant_body *const body = iseq->body;
- VALUE klass = rb_class_name(rb_obj_class(self));
-
- if (!body->location.label) {
- return rb_sprintf("#<%"PRIsVALUE": uninitialized>", klass);
- }
- else {
- return rb_sprintf("<%"PRIsVALUE":%"PRIsVALUE"@%"PRIsVALUE":%d>",
- klass,
- 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));
}
/*
@@ -1411,10 +843,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;
}
/*
@@ -1433,10 +867,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.
@@ -1462,10 +898,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.
@@ -1488,10 +926,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
@@ -1504,13 +944,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:
@@ -1571,7 +1036,7 @@ static VALUE iseq_data_to_ary(const rb_iseq_t *iseq);
* The type of the instruction sequence.
*
* Valid values are +:top+, +:method+, +:block+, +:class+, +:rescue+,
- * +:ensure+, +:eval+, +:main+, and +plain+.
+ * +:ensure+, +:eval+, +:main+, and +:defined_guard+.
*
* [locals]
* An array containing the names of all arguments and local variables as
@@ -1594,174 +1059,55 @@ static VALUE iseq_data_to_ary(const rb_iseq_t *iseq);
*
*/
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);
}
-#if VM_INSN_INFO_TABLE_IMPL == 1 /* binary search */
-static const struct iseq_insn_info_entry *
-get_insn_info_binary_search(const rb_iseq_t *iseq, size_t pos)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- size_t size = body->insns_info.size;
- const struct iseq_insn_info_entry *insns_info = body->insns_info.body;
- const unsigned int *positions = body->insns_info.positions;
- 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, positions[0], insns_info[0].line_no, pos);
- }
-
- 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 (positions[m] == pos) {
- return &insns_info[m];
- }
- if (positions[m] < pos) {
- l = m + 1;
- }
- else {
- r = m - 1;
- }
- }
- if (l >= size) {
- return &insns_info[size-1];
- }
- if (positions[l] > pos) {
- return &insns_info[l-1];
- }
- return &insns_info[l];
- }
-}
-
-static const struct iseq_insn_info_entry *
-get_insn_info(const rb_iseq_t *iseq, size_t pos)
-{
- return get_insn_info_binary_search(iseq, pos);
-}
-#endif
-
-#if VM_INSN_INFO_TABLE_IMPL == 2 /* succinct bitvector */
-static const struct iseq_insn_info_entry *
-get_insn_info_succinct_bitvector(const rb_iseq_t *iseq, size_t pos)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- size_t size = body->insns_info.size;
- const struct iseq_insn_info_entry *insns_info = body->insns_info.body;
- const int debug = 0;
-
- if (debug) {
-#if VM_CHECK_MODE > 0
- const unsigned int *positions = body->insns_info.positions;
- printf("size: %"PRIuSIZE"\n", size);
- printf("insns_info[%"PRIuSIZE"]: position: %d, line: %d, pos: %"PRIuSIZE"\n",
- (size_t)0, positions[0], insns_info[0].line_no, pos);
-#else
- printf("size: %"PRIuSIZE"\n", size);
- printf("insns_info[%"PRIuSIZE"]: line: %d, pos: %"PRIuSIZE"\n",
- (size_t)0, insns_info[0].line_no, pos);
-#endif
- }
-
- if (size == 0) {
- return NULL;
- }
- else if (size == 1) {
- return &insns_info[0];
- }
- else {
- int index;
- VM_ASSERT(body->insns_info.succ_index_table != NULL);
- index = succ_index_lookup(body->insns_info.succ_index_table, (int)pos);
- return &insns_info[index-1];
- }
-}
-
-static const struct iseq_insn_info_entry *
-get_insn_info(const rb_iseq_t *iseq, size_t pos)
-{
- return get_insn_info_succinct_bitvector(iseq, pos);
-}
-#endif
+/* TODO: search algorithm is brute force.
+ this should be binary search or so. */
-#if VM_CHECK_MODE > 0 || VM_INSN_INFO_TABLE_IMPL == 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)
{
- const struct rb_iseq_constant_body *const body = iseq->body;
- size_t i = 0, size = body->insns_info.size;
- const struct iseq_insn_info_entry *insns_info = body->insns_info.body;
- const unsigned int *positions = body->insns_info.positions;
+ 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, positions[i], 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, positions[i], 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 (positions[i] == pos) {
- return &insns_info[i];
+ if (table[i].position == pos) {
+ return &table[i];
}
- if (positions[i] > pos) {
- return &insns_info[i-1];
+ if (table[i].position > pos) {
+ return &table[i-1];
}
}
}
- return &insns_info[i-1];
+ return &table[i-1];
}
-#endif
-#if VM_INSN_INFO_TABLE_IMPL == 0 /* linear search */
-static const struct iseq_insn_info_entry *
-get_insn_info(const rb_iseq_t *iseq, size_t pos)
+static unsigned int
+find_line_no(const rb_iseq_t *iseq, size_t pos)
{
- return get_insn_info_linear_search(iseq, pos);
-}
-#endif
-
-#if VM_CHECK_MODE > 0 && VM_INSN_INFO_TABLE_IMPL > 0
-static void
-validate_get_insn_info(const rb_iseq_t *iseq)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- size_t i;
- for (i = 0; i < body->iseq_size; i++) {
- if (get_insn_info_linear_search(iseq, i) != get_insn_info(iseq, i)) {
- rb_bug("validate_get_insn_info: get_insn_info_linear_search(iseq, %"PRIuSIZE") != get_insn_info(iseq, %"PRIuSIZE")", i, i);
- }
- }
-}
-#endif
-
-unsigned int
-rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos)
-{
- const struct iseq_insn_info_entry *entry = get_insn_info(iseq, pos);
-
+ struct iseq_line_info_entry *entry = get_line_info(iseq, pos);
if (entry) {
return entry->line_no;
}
@@ -1770,60 +1116,30 @@ rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos)
}
}
-MJIT_FUNC_EXPORTED 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(iseq, pos);
- if (entry) {
- return entry->events;
+ if (pos == 0) {
+ return find_line_no(iseq, pos);
}
else {
- return 0;
- }
-}
-
-void
-rb_iseq_clear_event_flags(const rb_iseq_t *iseq, size_t pos, rb_event_flag_t reset)
-{
- struct iseq_insn_info_entry *entry = (struct iseq_insn_info_entry *)get_insn_info(iseq, pos);
- if (entry) {
- entry->events &= ~reset;
- if (!(entry->events & iseq->aux.exec.global_trace_events)) {
- void rb_iseq_trace_flag_cleared(const rb_iseq_t *iseq, size_t pos);
- rb_iseq_trace_flag_cleared(iseq, pos);
- }
+ return find_line_no(iseq, pos - 1);
}
}
static VALUE
-local_var_name(const rb_iseq_t *diseq, VALUE level, VALUE op)
+id_to_name(ID id, VALUE default_value)
{
- VALUE i;
- VALUE name;
- ID lid;
- int idx;
-
- for (i = 0; i < level; i++) {
- diseq = diseq->body->parent_iseq;
- }
- idx = diseq->body->local_table_size - (int)op - 1;
- lid = diseq->body->local_table[idx];
- name = rb_id2str(lid);
- if (!name) {
- name = rb_str_new_cstr("?");
+ VALUE str = rb_id2str(id);
+ if (!str) {
+ str = default_value;
}
- else if (!rb_str_symname_p(name)) {
- name = rb_str_inspect(name);
+ else if (!rb_str_symname_p(str)) {
+ str = rb_str_inspect(str);
}
- else {
- name = rb_str_dup(name);
- }
- rb_str_catf(name, "@%d", idx);
- return name;
+ return str;
}
-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,
@@ -1831,7 +1147,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 */
@@ -1839,40 +1155,23 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
break;
case TS_NUM: /* ULONG */
- if (insn == BIN(defined) && op_no == 0) {
- enum defined_type deftype = (enum defined_type)op;
- switch (deftype) {
- case DEFINED_FUNC:
- ret = rb_fstring_lit("func");
- break;
- case DEFINED_REF:
- ret = rb_fstring_lit("ref");
- break;
- case DEFINED_CONST_FROM:
- ret = rb_fstring_lit("constant-from");
- break;
- default:
- ret = rb_iseq_defined_string(deftype);
- break;
- }
- if (ret) break;
- }
- else if (insn == BIN(checktype) && op_no == 0) {
- const char *type_str = rb_type_str((enum ruby_value_type)op);
- if (type_str) {
- ret = rb_str_new_cstr(type_str); break;
- }
- }
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 - VM_ENV_DATA_SIZE);
- }
- else if ((level = rb_insn_unified_local_var_level(insn)) >= 0) {
- ret = local_var_name(iseq, (VALUE)level, op - VM_ENV_DATA_SIZE);
+ 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);
+ }
}
else {
ret = rb_inspect(INT2FIX(op));
@@ -1880,24 +1179,10 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
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) {
@@ -1908,11 +1193,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 {
@@ -1928,15 +1213,12 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
break;
case TS_IC:
- case TS_IVC:
- case TS_ISE:
- 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_CALLDATA:
+ case TS_CALLINFO:
{
- struct rb_call_data *cd = (struct rb_call_data *)op;
- struct rb_call_info *ci = &cd->ci;
+ rb_call_info_t *ci = (rb_call_info_t *)op;
VALUE ary = rb_ary_new();
if (ci->mid) {
@@ -1945,32 +1227,30 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
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->kw_arg) {
+ rb_ary_push(ary, rb_sprintf("kw:%d", ci->kw_arg->keyword_len));
+ }
+ 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(FCALL);
- CALL_FLAG(VCALL);
- CALL_FLAG(ARGS_SIMPLE);
- CALL_FLAG(BLOCKISEQ);
- CALL_FLAG(TAILCALL);
- CALL_FLAG(SUPER);
- CALL_FLAG(ZSUPER);
- 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_SIMPLE) rb_ary_push(flags, rb_str_new2("ARGS_SIMPLE")); /* maybe not reachable */
rb_ary_push(ary, rb_ary_join(flags, rb_str_new2("|")));
}
-
- ret = rb_sprintf("<calldata!%"PRIsVALUE">", rb_ary_join(ary, rb_str_new2(", ")));
- }
+ ret = rb_sprintf("<callinfo!%"PRIsVALUE">", rb_ary_join(ary, rb_str_new2(", ")));
+ }
break;
case TS_CDHASH:
@@ -1990,38 +1270,21 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
}
break;
- case TS_BUILTIN:
- {
- const struct rb_builtin_function *bf = (const struct rb_builtin_function *)op;
- ret = rb_sprintf("<builtin!%s/%d>",
- bf->name, bf->argc);
- }
- break;
-
default:
- rb_bug("unknown operand type: %c", type);
+ rb_bug("insn_operand_intern: unknown operand type: %c", type);
}
return ret;
}
-static VALUE
-right_strip(VALUE str)
-{
- const char *beg = RSTRING_PTR(str), *end = RSTRING_END(str);
- while (end-- > beg && *end == ' ');
- rb_str_set_len(str, end - beg + 1);
- return str;
-}
-
/**
* Disassemble a instruction
* 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);
@@ -2030,17 +1293,17 @@ rb_iseq_disasm_insn(VALUE ret, const VALUE *code, size_t pos,
insn_name_buff = insn_name(insn);
if (1) {
- extern const int rb_vm_max_insn_name_size;
- rb_str_catf(str, "%04"PRIuSIZE" %-*s ", pos, rb_vm_max_insn_name_size, insn_name_buff);
+ rb_str_catf(str, "%04"PRIdSIZE" %-16s ", pos, insn_name_buff);
}
else {
- rb_str_catf(str, "%04"PRIuSIZE" %-28.*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);
@@ -2050,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);
@@ -2059,31 +1322,12 @@ 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%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" : "",
- events & RUBY_EVENT_COVERAGE_LINE ? "Cli" : "",
- events & RUBY_EVENT_COVERAGE_BRANCH ? "Cbr" : "");
- }
- }
-
- right_strip(str);
if (ret) {
rb_str_cat2(str, "\n");
rb_str_concat(ret, str);
}
else {
- printf("%.*s\n", (int)RSTRING_LEN(str), RSTRING_PTR(str));
+ printf("%s\n", RSTRING_PTR(str));
}
return len;
}
@@ -2105,315 +1349,140 @@ catch_type(int type)
case CATCH_TYPE_NEXT:
return "next";
default:
- rb_bug("unknown catch type: %d", type);
+ rb_bug("unknown catch type (%d)", type);
return 0;
}
}
-static VALUE
-iseq_inspect(const rb_iseq_t *iseq)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- if (!body->location.label) {
- return rb_sprintf("#<ISeq: uninitialized>");
- }
- else {
- const rb_code_location_t *loc = &body->location.code_location;
- return rb_sprintf("#<ISeq:%"PRIsVALUE"@%"PRIsVALUE":%d (%d,%d)-(%d,%d)>",
- body->location.label, rb_iseq_path(iseq),
- loc->beg_pos.lineno,
- loc->beg_pos.lineno,
- loc->beg_pos.column,
- loc->end_pos.lineno,
- loc->end_pos.column);
- }
-}
-
-static const rb_data_type_t tmp_set = {
- "tmpset",
- {(void (*)(void *))rb_mark_set, (void (*)(void *))st_free_table, 0, 0,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
-};
-
-static VALUE
-rb_iseq_disasm_recursive(const rb_iseq_t *iseq, VALUE indent)
+/*
+ * call-seq:
+ * iseq.disasm -> str
+ * iseq.disassemble -> str
+ *
+ * Returns the instruction sequence as a +String+ in human readable form.
+ *
+ * puts RubyVM::InstructionSequence.compile('1 + 2').disasm
+ *
+ * Produces:
+ *
+ * == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
+ * 0000 trace 1 ( 1)
+ * 0002 putobject 1
+ * 0004 putobject 2
+ * 0006 opt_plus <ic:1>
+ * 0008 leave
+ */
+VALUE
+rb_iseq_disasm(VALUE self)
{
- const struct rb_iseq_constant_body *const body = iseq->body;
- VALUE *code;
+ rb_iseq_t *iseqdat = iseq_check(self); /* TODO: rename to iseq */
+ 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;
+ ID *tbl;
size_t n;
enum {header_minlen = 72};
- st_table *done_iseq = 0;
- VALUE done_iseq_wrapper = Qnil;
- const char *indent_str;
- long indent_len;
- size = body->iseq_size;
+ rb_secure(1);
- indent_len = RSTRING_LEN(indent);
- indent_str = RSTRING_PTR(indent);
+ size = iseqdat->iseq_size;
- rb_str_cat(str, indent_str, indent_len);
rb_str_cat2(str, "== disasm: ");
- rb_str_append(str, iseq_inspect(iseq));
- rb_str_catf(str, " (catch: %s)", body->catch_except_p ? "TRUE" : "FALSE");
- if ((l = RSTRING_LEN(str) - indent_len) < header_minlen) {
- rb_str_modify_expand(str, header_minlen - l);
- memset(RSTRING_END(str), '=', header_minlen - l);
+ 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);
}
rb_str_cat2(str, "\n");
/* show catch table information */
- if (body->catch_table) {
- rb_str_cat(str, indent_str, indent_len);
+ if (iseqdat->catch_table) {
rb_str_cat2(str, "== catch table\n");
}
- if (body->catch_table) {
- rb_str_cat_cstr(indent, "| ");
- indent_str = RSTRING_PTR(indent);
- for (i = 0; i < body->catch_table->size; i++) {
- const struct iseq_catch_table_entry *entry =
- UNALIGNED_MEMBER_PTR(body->catch_table, entries[i]);
- rb_str_cat(str, indent_str, indent_len);
- 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_recursive(rb_iseq_check(entry->iseq), indent));
- if (!done_iseq) {
- done_iseq = st_init_numtable();
- done_iseq_wrapper = TypedData_Wrap_Struct(0, &tmp_set, done_iseq);
- }
- st_insert(done_iseq, (st_data_t)entry->iseq, (st_data_t)0);
- indent_str = RSTRING_PTR(indent);
- }
+ 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));
}
- rb_str_resize(indent, indent_len);
- indent_str = RSTRING_PTR(indent);
}
- if (body->catch_table) {
- rb_str_cat(str, indent_str, indent_len);
+ if (iseqdat->catch_table) {
rb_str_cat2(str, "|-------------------------------------"
"-----------------------------------\n");
}
/* show local table information */
- if (body->local_table) {
- const struct rb_iseq_param_keyword *const keyword = body->param.keyword;
- rb_str_cat(str, indent_str, indent_len);
+ 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",
- body->local_table_size,
- body->param.lead_num,
- body->param.opt_num,
- body->param.flags.has_rest ? body->param.rest_start : -1,
- body->param.post_num,
- body->param.flags.has_block ? body->param.block_start : -1,
- body->param.flags.has_kw ? keyword->num : -1,
- body->param.flags.has_kw ? keyword->required_num : -1,
- body->param.flags.has_kwrest ? keyword->rest_start : -1);
-
- for (i = body->local_table_size; i > 0;) {
- int li = body->local_table_size - --i - 1;
+ iseqdat->local_size,
+ iseqdat->param.lead_num,
+ iseqdat->param.opt_num,
+ iseqdat->param.flags.has_rest ? iseqdat->param.rest_start : -1,
+ iseqdat->param.post_num,
+ iseqdat->param.flags.has_block ? iseqdat->param.block_start : -1,
+ iseqdat->param.flags.has_kw ? iseqdat->param.keyword->num : -1,
+ iseqdat->param.flags.has_kw ? iseqdat->param.keyword->required_num : -1,
+ iseqdat->param.flags.has_kwrest ? iseqdat->param.keyword->rest_start : -1);
+
+ for (i = 0; i < iseqdat->local_table_size; i++) {
long width;
- VALUE name = local_var_name(iseq, 0, i);
- char argi[0x100];
- char opti[0x100];
-
- opti[0] = '\0';
- if (body->param.flags.has_opt) {
- int argc = body->param.lead_num;
- int opts = body->param.opt_num;
- if (li >= argc && li < argc + opts) {
+ VALUE name = id_to_name(tbl[i], 0);
+ char argi[0x100] = "";
+ char opti[0x100] = "";
+
+ if (iseqdat->param.flags.has_opt) {
+ int argc = iseqdat->param.lead_num;
+ int opts = iseqdat->param.opt_num;
+ if (i >= argc && i < argc + opts) {
snprintf(opti, sizeof(opti), "Opt=%"PRIdVALUE,
- body->param.opt_table[li - argc]);
+ iseqdat->param.opt_table[i - argc]);
}
}
- snprintf(argi, sizeof(argi), "%s%s%s%s%s%s", /* arg, opts, rest, post, kwrest, block */
- body->param.lead_num > li ? "Arg" : "",
+ snprintf(argi, sizeof(argi), "%s%s%s%s%s", /* arg, opts, rest, post block */
+ iseqdat->param.lead_num > i ? "Arg" : "",
opti,
- (body->param.flags.has_rest && body->param.rest_start == li) ? "Rest" : "",
- (body->param.flags.has_post && body->param.post_start <= li && li < body->param.post_start + body->param.post_num) ? "Post" : "",
- (body->param.flags.has_kwrest && keyword->rest_start == li) ? "Kwrest" : "",
- (body->param.flags.has_block && body->param.block_start == li) ? "Block" : "");
+ (iseqdat->param.flags.has_rest && iseqdat->param.rest_start == i) ? "Rest" : "",
+ (iseqdat->param.flags.has_post && iseqdat->param.post_start <= i && i < iseqdat->param.post_start + iseqdat->param.post_num) ? "Post" : "",
+ (iseqdat->param.flags.has_block && iseqdat->param.block_start == i) ? "Block" : "");
- rb_str_cat(str, indent_str, indent_len);
- rb_str_catf(str, "[%2d] ", i + 1);
+ rb_str_catf(str, "[%2d] ", iseqdat->local_size - i);
width = RSTRING_LEN(str) + 11;
- rb_str_append(str, name);
+ if (name)
+ rb_str_append(str, name);
+ else
+ rb_str_cat2(str, "?");
if (*argi) rb_str_catf(str, "<%s>", argi);
if ((width -= RSTRING_LEN(str)) > 0) rb_str_catf(str, "%*s", (int)width, "");
}
- rb_str_cat_cstr(right_strip(str), "\n");
+ rb_str_cat2(str, "\n");
}
/* show each line */
- code = rb_iseq_original_iseq(iseq);
+ iseq = rb_iseq_original_iseq(iseqdat);
for (n = 0; n < size;) {
- rb_str_cat(str, indent_str, indent_len);
- 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_cat_cstr(str, "\n");
- rb_str_concat(str, rb_iseq_disasm_recursive(rb_iseq_check((rb_iseq_t *)isv), indent));
- indent_str = RSTRING_PTR(indent);
+ for (i = 0; i < RARRAY_LEN(child); i++) {
+ VALUE isv = rb_ary_entry(child, i);
+ rb_str_concat(str, rb_iseq_disasm(isv));
}
- RB_GC_GUARD(done_iseq_wrapper);
return str;
}
-VALUE
-rb_iseq_disasm(const rb_iseq_t *iseq)
-{
- return rb_iseq_disasm_recursive(iseq, rb_str_new(0, 0));
-}
-
-/*
- * 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
-iseq_iterate_children(const rb_iseq_t *iseq, void (*iter_func)(const rb_iseq_t *child_iseq, void *data), void *data)
-{
- unsigned int i;
- VALUE *code = rb_iseq_original_iseq(iseq);
- const struct rb_iseq_constant_body *const body = iseq->body;
- const rb_iseq_t *child;
- VALUE all_children = rb_obj_hide(rb_ident_hash_new());
-
- if (body->catch_table) {
- for (i = 0; i < body->catch_table->size; i++) {
- const struct iseq_catch_table_entry *entry =
- UNALIGNED_MEMBER_PTR(body->catch_table, entries[i]);
- child = entry->iseq;
- if (child) {
- if (rb_hash_aref(all_children, (VALUE)child) == Qnil) {
- rb_hash_aset(all_children, (VALUE)child, Qtrue);
- (*iter_func)(child, data);
- }
- }
- }
- }
-
- for (i=0; i<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 = (const rb_iseq_t *)code[i+j+1];
- if (child) {
- if (rb_hash_aref(all_children, (VALUE)child) == Qnil) {
- rb_hash_aset(all_children, (VALUE)child, Qtrue);
- (*iter_func)(child, data);
- }
- }
- break;
- default:
- break;
- }
- }
- i += len;
- }
-
- return (int)RHASH_SIZE(all_children);
-}
-
-static void
-yield_each_children(const rb_iseq_t *child_iseq, void *data)
-{
- rb_yield(iseqw_new(child_iseq));
-}
-
-/*
- * 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);
- iseq_iterate_children(iseq, yield_each_children, NULL);
- 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);
- const struct rb_iseq_constant_body *const body = iseq->body;
- unsigned int i;
- VALUE ary = rb_ary_new();
-
- for (i=0; i<body->insns_info.size; i++) {
- const struct iseq_insn_info_entry *entry = &body->insns_info.body[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.
*
@@ -2450,25 +1519,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;
- if (rb_obj_is_proc(body)) {
- iseq = vm_proc_iseq(body);
+ rb_secure(1);
- if (!rb_obj_is_iseq((VALUE)iseq)) {
- iseq = NULL;
- }
- }
- else if (rb_obj_is_method(body)) {
- iseq = rb_method_iseq(body);
+ if (rb_obj_is_proc(body)) {
+ rb_proc_t *proc;
+ GetProcPtr(body, proc);
+ iseq = proc->block.iseq;
+ if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+ ret = iseq->self;
+ }
}
- else if (rb_typeddata_is_instance_of(body, &iseqw_data_type)) {
- return body;
+ else if ((iseq = rb_method_get_iseq(body)) != 0) {
+ ret = iseq->self;
}
-
- return iseq ? iseqw_new(iseq) : Qnil;
+ return ret;
}
/*
@@ -2523,11 +1592,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 *
@@ -2536,16 +1606,16 @@ ruby_node_name(int node)
switch (node) {
#include "node_name.inc"
default:
- rb_bug("unknown node: %d", node);
+ rb_bug("unknown node (%d)", node);
return 0;
}
}
#define DECL_SYMBOL(name) \
- static ID sym_##name
+ static VALUE sym_##name
#define INIT_SYMBOL(name) \
- sym_##name = rb_intern(#name)
+ sym_##name = ID2SYM(rb_intern(#name))
static VALUE
register_label(struct st_table *table, unsigned long idx)
@@ -2567,7 +1637,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("unknown exception type: %d", (int)type);
+ rb_bug("...");
}
return ID2SYM(id);
}
@@ -2580,25 +1650,17 @@ cdhash_each(VALUE key, VALUE value, VALUE ary)
return ST_CONTINUE;
}
-static const rb_data_type_t label_wrapper = {
- "label_wrapper",
- {(void (*)(void *))rb_mark_tbl, (void (*)(void *))st_free_table, 0, 0,},
- 0, 0, RUBY_TYPED_FREE_IMMEDIATELY
-};
-
static VALUE
-iseq_data_to_ary(const rb_iseq_t *iseq)
+iseq_data_to_ary(rb_iseq_t *iseq)
{
- unsigned int i;
- long l;
- const struct rb_iseq_constant_body *const iseq_body = iseq->body;
- const struct iseq_insn_info_entry *prev_insn_info;
+ 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();
- ID type; /* Symbol */
+ VALUE type; /* Symbol */
VALUE locals = rb_ary_new();
VALUE params = rb_hash_new();
VALUE body = rb_ary_new(); /* [[:insn1, ...], ...] */
@@ -2606,9 +1668,8 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
VALUE exception = rb_ary_new(); /* [[....]] */
VALUE misc = rb_hash_new();
- static ID insn_syms[VM_INSTRUCTION_SIZE/2]; /* w/o-trace only */
+ static VALUE insn_syms[VM_INSTRUCTION_SIZE];
struct st_table *labels_table = st_init_numtable();
- VALUE labels_wrapper = TypedData_Wrap_Struct(0, &label_wrapper, labels_table);
DECL_SYMBOL(top);
DECL_SYMBOL(method);
@@ -2618,12 +1679,12 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
DECL_SYMBOL(ensure);
DECL_SYMBOL(eval);
DECL_SYMBOL(main);
- DECL_SYMBOL(plain);
+ DECL_SYMBOL(defined_guard);
if (sym_top == 0) {
int i;
- for (i=0; i<numberof(insn_syms); i++) {
- insn_syms[i] = rb_intern(insn_name(i));
+ for (i=0; i<VM_INSTRUCTION_SIZE; i++) {
+ insn_syms[i] = ID2SYM(rb_intern(insn_name(i)));
}
INIT_SYMBOL(top);
INIT_SYMBOL(method);
@@ -2633,11 +1694,11 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
INIT_SYMBOL(ensure);
INIT_SYMBOL(eval);
INIT_SYMBOL(main);
- INIT_SYMBOL(plain);
+ INIT_SYMBOL(defined_guard);
}
/* 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;
@@ -2646,19 +1707,19 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
case ISEQ_TYPE_ENSURE: type = sym_ensure; break;
case ISEQ_TYPE_EVAL: type = sym_eval; break;
case ISEQ_TYPE_MAIN: type = sym_main; break;
- case ISEQ_TYPE_PLAIN: type = sym_plain; break;
- default: rb_bug("unsupported iseq type: %d", (int)iseq_body->type);
+ case ISEQ_TYPE_DEFINED_GUARD: type = sym_defined_guard; break;
+ default: rb_bug("unsupported iseq type");
};
/* 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));
+ rb_ary_push(locals, ULONG2NUM(iseq->local_table_size-i+1));
}
}
else {
@@ -2668,58 +1729,57 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
/* params */
{
- const struct rb_iseq_param_keyword *const keyword = iseq_body->param.keyword;
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);
+ if (iseq->param.flags.has_opt) {
+ int len = iseq->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 < len; j++) {
+ VALUE l = register_label(labels_table, iseq->param.opt_table[j]);
+ rb_ary_push(arg_opt_labels, l);
+ }
+ rb_hash_aset(params, ID2SYM(rb_intern("opt")), arg_opt_labels);
}
/* commit */
- if (iseq_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) {
+ if (iseq->param.flags.has_lead) rb_hash_aset(params, ID2SYM(rb_intern("lead_num")), INT2FIX(iseq->param.lead_num));
+ if (iseq->param.flags.has_post) rb_hash_aset(params, ID2SYM(rb_intern("post_num")), INT2FIX(iseq->param.post_num));
+ if (iseq->param.flags.has_post) rb_hash_aset(params, ID2SYM(rb_intern("post_start")), INT2FIX(iseq->param.post_start));
+ if (iseq->param.flags.has_rest) rb_hash_aset(params, ID2SYM(rb_intern("rest_start")), INT2FIX(iseq->param.rest_start));
+ if (iseq->param.flags.has_block) rb_hash_aset(params, ID2SYM(rb_intern("block_start")), INT2FIX(iseq->param.block_start));
+ if (iseq->param.flags.has_kw) {
VALUE keywords = rb_ary_new();
int i, j;
- for (i=0; i<keyword->required_num; i++) {
- rb_ary_push(keywords, ID2SYM(keyword->table[i]));
+ for (i=0; i<iseq->param.keyword->required_num; i++) {
+ rb_ary_push(keywords, ID2SYM(iseq->param.keyword->table[i]));
}
- for (j=0; i<keyword->num; i++, j++) {
- VALUE key = rb_ary_new_from_args(1, ID2SYM(keyword->table[i]));
- if (keyword->default_values[j] != Qundef) {
- rb_ary_push(key, keyword->default_values[j]);
+ for (j=0; i<iseq->param.keyword->num; i++, j++) {
+ VALUE key = rb_ary_new_from_args(1, ID2SYM(iseq->param.keyword->table[i]));
+ if (iseq->param.keyword->default_values[j] != Qundef) {
+ rb_ary_push(key, iseq->param.keyword->default_values[j]);
}
rb_ary_push(keywords, key);
}
rb_hash_aset(params, ID2SYM(rb_intern("kwbits")),
- INT2FIX(keyword->bits_start));
+ INT2FIX(iseq->param.keyword->bits_start));
rb_hash_aset(params, ID2SYM(rb_intern("keyword")), keywords);
}
- if (iseq_body->param.flags.has_kwrest) rb_hash_aset(params, ID2SYM(rb_intern("kwrest")), INT2FIX(keyword->rest_start));
- if (iseq_body->param.flags.ambiguous_param0) rb_hash_aset(params, ID2SYM(rb_intern("ambiguous_param0")), Qtrue);
+ if (iseq->param.flags.has_kwrest) rb_hash_aset(params, ID2SYM(rb_intern("kwrest")), INT2FIX(iseq->param.keyword->rest_start));
+ if (iseq->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;
VALUE ary = rb_ary_new2(len);
- rb_ary_push(ary, ID2SYM(insn_syms[insn%numberof(insn_syms)]));
+ rb_ary_push(ary, insn_syms[insn]);
for (j=0; j<len-1; j++, seq++) {
switch (insn_op_type(insn, j)) {
case TS_OFFSET: {
@@ -2736,9 +1796,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 {
@@ -2753,31 +1813,28 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
}
break;
case TS_IC:
- case TS_IVC:
- case TS_ISE:
{
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_CALLDATA:
+ case TS_CALLINFO:
{
- struct rb_call_data *cd = (struct rb_call_data *)*seq;
- struct rb_call_info *ci = &cd->ci;
+ 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));
+ rb_hash_aset(e, ID2SYM(rb_intern("blockptr")), ci->blockiseq ? iseq_data_to_ary(ci->blockiseq) : Qnil);
- if (ci->flag & VM_CALL_KWARG) {
- struct rb_call_info_with_kwarg *ci_kw = (struct rb_call_info_with_kwarg *)ci;
+ if (ci->kw_arg) {
int i;
- VALUE kw = rb_ary_new2((long)ci_kw->kw_arg->keyword_len);
+ VALUE kw = rb_ary_new2((long)ci->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]);
+ orig_argc -= ci->kw_arg->keyword_len;
+ for (i = 0; i < ci->kw_arg->keyword_len; i++) {
+ rb_ary_push(kw, ci->kw_arg->keywords[i]);
}
rb_hash_aset(e, ID2SYM(rb_intern("kw_arg")), kw);
}
@@ -2818,21 +1875,6 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
rb_ary_push(ary, val);
}
break;
- case TS_BUILTIN:
- {
- VALUE val = rb_hash_new();
-#if SIZEOF_VALUE <= SIZEOF_LONG
- VALUE func_ptr = LONG2NUM((SIGNED_VALUE)((RB_BUILTIN)*seq)->func_ptr);
-#else
- VALUE func_ptr = LL2NUM((SIGNED_VALUE)((RB_BUILTIN)*seq)->func_ptr);
-#endif
- rb_hash_aset(val, ID2SYM(rb_intern("func_ptr")), func_ptr);
- rb_hash_aset(val, ID2SYM(rb_intern("argc")), INT2NUM(((RB_BUILTIN)*seq)->argc));
- rb_hash_aset(val, ID2SYM(rb_intern("index")), INT2NUM(((RB_BUILTIN)*seq)->index));
- rb_hash_aset(val, ID2SYM(rb_intern("name")), rb_str_new_cstr(((RB_BUILTIN)*seq)->name));
- rb_ary_push(ary, val);
- }
- break;
default:
rb_bug("unknown operand: %c", insn_op_type(insn, j));
}
@@ -2843,13 +1885,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 =
- UNALIGNED_MEMBER_PTR(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);
@@ -2863,56 +1906,34 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
/* make body with labels and insert line number */
body = rb_ary_new();
- prev_insn_info = NULL;
+ ti = 0;
- for (l=0, pos=0; l<RARRAY_LEN(nbody); l++) {
- const struct iseq_insn_info_entry *info;
- 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);
}
- info = get_insn_info(iseq, pos);
-
- if (prev_insn_info != info) {
- 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
- prev_insn_info = info;
+ 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);
- RB_GC_GUARD(labels_wrapper);
-
- 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("node_id")), INT2FIX(iseq_body->location.node_id));
- rb_hash_aset(misc, ID2SYM(rb_intern("code_location")),
- rb_ary_new_from_args(4,
- INT2FIX(iseq_body->location.code_location.beg_pos.lineno),
- INT2FIX(iseq_body->location.code_location.beg_pos.column),
- INT2FIX(iseq_body->location.code_location.end_pos.lineno),
- INT2FIX(iseq_body->location.code_location.end_pos.column)));
+ st_free_table(labels_table);
+
+ rb_hash_aset(misc, ID2SYM(rb_intern("arg_size")), INT2FIX(iseq->param.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,
@@ -2923,11 +1944,11 @@ 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, ID2SYM(type));
+ 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, exception);
@@ -2936,15 +1957,44 @@ iseq_data_to_ary(const rb_iseq_t *iseq)
}
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;
- const struct rb_iseq_constant_body *const body = iseq->body;
- const struct rb_iseq_param_keyword *const keyword = body->param.keyword;
- VALUE a, args = rb_ary_new2(body->param.size);
+ VALUE a, args = rb_ary_new2(iseq->param.size);
ID req, opt, rest, block, key, keyrest;
#define PARAM_TYPE(type) rb_ary_push(a = rb_ary_new2(2), ID2SYM(type))
-#define PARAM_ID(i) body->local_table[(i)]
+#define PARAM_ID(i) iseq->local_table[(i)]
#define PARAM(i, type) ( \
PARAM_TYPE(type), \
rb_id2str(PARAM_ID(i)) ? \
@@ -2954,18 +2004,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 < body->param.lead_num; i++) {
+ for (i = 0; i < iseq->param.lead_num; i++) {
PARAM_TYPE(opt);
rb_ary_push(a, rb_id2str(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
rb_ary_push(args, a);
}
}
else {
- for (i = 0; i < body->param.lead_num; i++) {
+ for (i = 0; i < iseq->param.lead_num; i++) {
rb_ary_push(args, PARAM(i, req));
}
}
- r = body->param.lead_num + body->param.opt_num;
+ r = iseq->param.lead_num + iseq->param.opt_num;
for (; i < r; i++) {
PARAM_TYPE(opt);
if (rb_id2str(PARAM_ID(i))) {
@@ -2973,58 +2023,52 @@ rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
}
rb_ary_push(args, a);
}
- if (body->param.flags.has_rest) {
+ if (iseq->param.flags.has_rest) {
CONST_ID(rest, "rest");
- rb_ary_push(args, PARAM(body->param.rest_start, rest));
+ rb_ary_push(args, PARAM(iseq->param.rest_start, rest));
}
- r = body->param.post_start + body->param.post_num;
+ r = iseq->param.post_start + iseq->param.post_num;
if (is_proc) {
- for (i = body->param.post_start; i < r; i++) {
+ for (i = iseq->param.post_start; i < r; i++) {
PARAM_TYPE(opt);
rb_ary_push(a, rb_id2str(PARAM_ID(i)) ? ID2SYM(PARAM_ID(i)) : Qnil);
rb_ary_push(args, a);
}
}
else {
- for (i = body->param.post_start; i < r; i++) {
+ for (i = iseq->param.post_start; i < r; i++) {
rb_ary_push(args, PARAM(i, req));
}
}
- if (body->param.flags.accepts_no_kwarg) {
- ID nokey;
- CONST_ID(nokey, "nokey");
- PARAM_TYPE(nokey);
- rb_ary_push(args, a);
- }
- if (body->param.flags.has_kw) {
+ if (iseq->param.flags.has_kw) {
i = 0;
- if (keyword->required_num > 0) {
+ if (iseq->param.keyword->required_num > 0) {
ID keyreq;
CONST_ID(keyreq, "keyreq");
- for (; i < keyword->required_num; i++) {
+ for (; i < iseq->param.keyword->required_num; i++) {
PARAM_TYPE(keyreq);
- if (rb_id2str(keyword->table[i])) {
- rb_ary_push(a, ID2SYM(keyword->table[i]));
+ if (rb_id2str(iseq->param.keyword->table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->param.keyword->table[i]));
}
rb_ary_push(args, a);
}
}
CONST_ID(key, "key");
- for (; i < keyword->num; i++) {
+ for (; i < iseq->param.keyword->num; i++) {
PARAM_TYPE(key);
- if (rb_id2str(keyword->table[i])) {
- rb_ary_push(a, ID2SYM(keyword->table[i]));
+ if (rb_id2str(iseq->param.keyword->table[i])) {
+ rb_ary_push(a, ID2SYM(iseq->param.keyword->table[i]));
}
rb_ary_push(args, a);
}
}
- if (body->param.flags.has_kwrest) {
+ if (iseq->param.flags.has_kwrest) {
CONST_ID(keyrest, "keyrest");
- rb_ary_push(args, PARAM(keyword->rest_start, keyrest));
+ rb_ary_push(args, PARAM(iseq->param.keyword->rest_start, keyrest));
}
- if (body->param.flags.has_block) {
+ if (iseq->param.flags.has_block) {
CONST_ID(block, "block");
- rb_ary_push(args, PARAM(body->param.block_start, block));
+ rb_ary_push(args, PARAM(iseq->param.block_start, block));
}
return args;
}
@@ -3069,462 +2113,205 @@ rb_iseq_defined_string(enum defined_type type)
return str;
}
-/* A map from encoded_insn to insn_data: decoded insn number, its len,
- * non-trace version of encoded insn, and trace version. */
-
-static st_table *encoded_insn_data;
-typedef struct insn_data_struct {
- int insn;
- int insn_len;
- void *notrace_encoded_insn;
- void *trace_encoded_insn;
-} insn_data_t;
-static insn_data_t insn_data[VM_INSTRUCTION_SIZE/2];
-
-void
-rb_vm_encoded_insn_data_table_init(void)
-{
-#if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE
- const void * const *table = rb_vm_get_insns_address_table();
-#define INSN_CODE(insn) ((VALUE)table[insn])
-#else
-#define INSN_CODE(insn) (insn)
-#endif
- st_data_t insn;
- encoded_insn_data = st_init_numtable_with_size(VM_INSTRUCTION_SIZE / 2);
-
- for (insn = 0; insn < VM_INSTRUCTION_SIZE/2; insn++) {
- st_data_t key1 = (st_data_t)INSN_CODE(insn);
- st_data_t key2 = (st_data_t)INSN_CODE(insn + VM_INSTRUCTION_SIZE/2);
-
- insn_data[insn].insn = (int)insn;
- insn_data[insn].insn_len = insn_len(insn);
- insn_data[insn].notrace_encoded_insn = (void *) key1;
- insn_data[insn].trace_encoded_insn = (void *) key2;
-
- st_add_direct(encoded_insn_data, key1, (st_data_t)&insn_data[insn]);
- st_add_direct(encoded_insn_data, key2, (st_data_t)&insn_data[insn]);
- }
-}
-
-int
-rb_vm_insn_addr2insn(const void *addr)
-{
- st_data_t key = (st_data_t)addr;
- st_data_t val;
+/* ruby2cext */
- if (st_lookup(encoded_insn_data, key, &val)) {
- insn_data_t *e = (insn_data_t *)val;
- return (int)e->insn;
- }
-
- rb_bug("rb_vm_insn_addr2insn: invalid insn address: %p", addr);
-}
-
-static inline int
-encoded_iseq_trace_instrument(VALUE *iseq_encoded_insn, rb_event_flag_t turnon)
-{
- st_data_t key = (st_data_t)*iseq_encoded_insn;
- st_data_t val;
+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 (st_lookup(encoded_insn_data, key, &val)) {
- insn_data_t *e = (insn_data_t *)val;
- *iseq_encoded_insn = (VALUE) (turnon ? e->trace_encoded_insn : e->notrace_encoded_insn);
- return e->insn_len;
+ /*
+ * 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);
}
- rb_bug("trace_instrument: invalid insn address: %p", (void *)*iseq_encoded_insn);
-}
+ ALLOC_AND_COPY(iseq->param.opt_table, arg_opt_table, VALUE, iseq->param.opt_num + 1);
-void
-rb_iseq_trace_flag_cleared(const rb_iseq_t *iseq, size_t pos)
-{
- const struct rb_iseq_constant_body *const body = iseq->body;
- VALUE *iseq_encoded = (VALUE *)body->iseq_encoded;
- encoded_iseq_trace_instrument(&iseq_encoded[pos], 0);
-}
-
-static int
-iseq_add_local_tracepoint(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line)
-{
- unsigned int pc;
- int n = 0;
- const struct rb_iseq_constant_body *const body = iseq->body;
- VALUE *iseq_encoded = (VALUE *)body->iseq_encoded;
+ set_relation(iseq, 0);
- VM_ASSERT(ISEQ_EXECUTABLE_P(iseq));
-
- for (pc=0; pc<body->iseq_size;) {
- const struct iseq_insn_info_entry *entry = get_insn_info(iseq, pc);
- rb_event_flag_t pc_events = entry->events;
- rb_event_flag_t target_events = turnon_events;
- unsigned int line = (int)entry->line_no;
-
- if (target_line == 0 || target_line == line) {
- /* ok */
- }
- else {
- target_events &= ~RUBY_EVENT_LINE;
- }
-
- if (pc_events & target_events) {
- n++;
- }
- pc += encoded_iseq_trace_instrument(&iseq_encoded[pc], pc_events & (target_events | iseq->aux.exec.global_trace_events));
- }
-
- if (n > 0) {
- if (iseq->aux.exec.local_hooks == NULL) {
- ((rb_iseq_t *)iseq)->aux.exec.local_hooks = RB_ZALLOC(rb_hook_list_t);
- }
- rb_hook_list_connect_tracepoint((VALUE)iseq, iseq->aux.exec.local_hooks, tpval, target_line);
- }
-
- return n;
+ return iseqval;
}
-struct trace_set_local_events_struct {
- rb_event_flag_t turnon_events;
- VALUE tpval;
- unsigned int target_line;
- int n;
-};
-
-static void
-iseq_add_local_tracepoint_i(const rb_iseq_t *iseq, void *p)
-{
- struct trace_set_local_events_struct *data = (struct trace_set_local_events_struct *)p;
- data->n += iseq_add_local_tracepoint(iseq, data->turnon_events, data->tpval, data->target_line);
- iseq_iterate_children(iseq, iseq_add_local_tracepoint_i, p);
-}
+/* Experimental tracing support: trace(line) -> trace(specified_line)
+ * MRI Specific.
+ */
int
-rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line)
-{
- struct trace_set_local_events_struct data;
- data.turnon_events = turnon_events;
- data.tpval = tpval;
- data.target_line = target_line;
- data.n = 0;
-
- iseq_add_local_tracepoint_i(iseq, (void *)&data);
- if (0) rb_funcall(Qnil, rb_intern("puts"), 1, rb_iseq_disasm(iseq)); /* for debug */
- return data.n;
-}
-
-static int
-iseq_remove_local_tracepoint(const rb_iseq_t *iseq, VALUE tpval)
+rb_iseq_line_trace_each(VALUE iseqval, int (*func)(int line, rb_event_flag_t *events_ptr, void *d), void *data)
{
- int n = 0;
-
- if (iseq->aux.exec.local_hooks) {
- unsigned int pc;
- const struct rb_iseq_constant_body *const body = iseq->body;
- VALUE *iseq_encoded = (VALUE *)body->iseq_encoded;
- rb_event_flag_t local_events = 0;
-
- rb_hook_list_remove_tracepoint(iseq->aux.exec.local_hooks, tpval);
- local_events = iseq->aux.exec.local_hooks->events;
-
- if (local_events == 0) {
- if (iseq->aux.exec.local_hooks->running == 0) {
- rb_hook_list_free(iseq->aux.exec.local_hooks);
- }
- ((rb_iseq_t *)iseq)->aux.exec.local_hooks = NULL;
- }
-
- for (pc = 0; pc<body->iseq_size;) {
- rb_event_flag_t pc_events = rb_iseq_event_flags(iseq, pc);
- pc += encoded_iseq_trace_instrument(&iseq_encoded[pc], pc_events & (local_events | iseq->aux.exec.global_trace_events));
- }
+ 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;
+
+ current_events = (rb_event_flag_t)iseq_original[pos+1];
+
+ if (current_events & RUBY_EVENT_LINE) {
+ rb_event_flag_t events = current_events & RUBY_EVENT_SPECIFIED_LINE;
+ 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));
+ }
+ }
+ }
+ }
}
- return n;
+ return trace_num;
}
-struct trace_clear_local_events_struct {
- VALUE tpval;
- int n;
-};
-
-static void
-iseq_remove_local_tracepoint_i(const rb_iseq_t *iseq, void *p)
+static int
+collect_trace(int line, rb_event_flag_t *events_ptr, void *ptr)
{
- struct trace_clear_local_events_struct *data = (struct trace_clear_local_events_struct *)p;
- data->n += iseq_remove_local_tracepoint(iseq, data->tpval);
- iseq_iterate_children(iseq, iseq_remove_local_tracepoint_i, p);
+ VALUE result = (VALUE)ptr;
+ rb_ary_push(result, INT2NUM(line));
+ return 1;
}
-int
-rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval)
+/*
+ * <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)
{
- struct trace_clear_local_events_struct data;
- data.tpval = tpval;
- data.n = 0;
-
- iseq_remove_local_tracepoint_i(iseq, (void *)&data);
- return data.n;
+ VALUE result = rb_ary_new();
+ rb_iseq_line_trace_each(iseqval, collect_trace, (void *)result);
+ return result;
}
-void
-rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events)
-{
- if (iseq->aux.exec.global_trace_events == turnon_events) {
- return;
- }
-
- if (!ISEQ_EXECUTABLE_P(iseq)) {
- /* this is building ISeq */
- return;
- }
- else {
- unsigned int pc;
- const struct rb_iseq_constant_body *const body = iseq->body;
- VALUE *iseq_encoded = (VALUE *)body->iseq_encoded;
- rb_event_flag_t enabled_events;
- rb_event_flag_t local_events = iseq->aux.exec.local_hooks ? iseq->aux.exec.local_hooks->events : 0;
- ((rb_iseq_t *)iseq)->aux.exec.global_trace_events = turnon_events;
- enabled_events = turnon_events | local_events;
-
- for (pc=0; pc<body->iseq_size;) {
- rb_event_flag_t pc_events = rb_iseq_event_flags(iseq, pc);
- pc += encoded_iseq_trace_instrument(&iseq_encoded[pc], pc_events & enabled_events);
- }
- }
-}
+struct set_specifc_data {
+ int pos;
+ int set;
+ int prev; /* 1: set, 2: unset, 0: not found */
+};
static int
-trace_set_i(void *vstart, void *vend, size_t stride, void *data)
+line_trace_specify(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) {
- void *ptr = asan_poisoned_object_p(v);
- asan_unpoison_object(v, false);
+ struct set_specifc_data *data = (struct set_specifc_data *)ptr;
- if (rb_obj_is_iseq(v)) {
- rb_iseq_trace_set(rb_iseq_check((rb_iseq_t *)v), turnon_events);
+ 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;
}
-
- asan_poison_object_if(ptr, v);
+ else {
+ *events_ptr = *events_ptr & ~RUBY_EVENT_SPECIFIED_LINE;
+ }
+ return 0; /* found */
+ }
+ else {
+ data->pos--;
+ return 1;
}
- return 0;
-}
-
-void
-rb_iseq_trace_set_all(rb_event_flag_t turnon_events)
-{
- rb_objspace_each_objects(trace_set_i, &turnon_events);
-}
-
-VALUE
-rb_iseqw_local_variables(VALUE iseqval)
-{
- return rb_iseq_local_variables(iseqw_check(iseqval));
-}
-
-/*
- * call-seq:
- * iseq.to_binary(extra_data = nil) -> binary str
- *
- * Returns serialized iseq binary format data as a String object.
- * A corresponding iseq object is created by
- * RubyVM::InstructionSequence.load_from_binary() method.
- *
- * String extra_data will be saved with binary data.
- * You can access this data with
- * RubyVM::InstructionSequence.load_from_binary_extra_data(binary).
- *
- * Note that the translated binary data is not portable.
- * You can not move this binary data to another machine.
- * You can not use the binary data which is created by another
- * version/another architecture of Ruby.
- */
-static VALUE
-iseqw_to_binary(int argc, VALUE *argv, VALUE self)
-{
- VALUE opt = !rb_check_arity(argc, 0, 1) ? Qnil : argv[0];
- return rb_iseq_ibf_dump(iseqw_check(self), opt);
}
/*
- * 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;
-#if VM_INSN_INFO_TABLE_IMPL == 2
+ data.prev = 0;
+ data.pos = NUM2INT(pos);
+ if (data.pos < 0) rb_raise(rb_eTypeError, "`pos' is negative");
-/* An implementation of succinct bit-vector for insn_info table.
- *
- * A succinct bit-vector is a small and efficient data structure that provides
- * a bit-vector augmented with an index for O(1) rank operation:
- *
- * rank(bv, n): the number of 1's within a range from index 0 to index n
- *
- * This can be used to lookup insn_info table from PC.
- * For example, consider the following iseq and insn_info_table:
- *
- * iseq insn_info_table
- * PC insn+operand position lineno event
- * 0: insn1 0: 1 [Li]
- * 2: insn2 2: 2 [Li] <= (A)
- * 5: insn3 8: 3 [Li] <= (B)
- * 8: insn4
- *
- * In this case, a succinct bit-vector whose indexes 0, 2, 8 is "1" and
- * other indexes is "0", i.e., "101000001", is created.
- * To lookup the lineno of insn2, calculate rank("10100001", 2) = 2, so
- * the line (A) is the entry in question.
- * To lookup the lineno of insn4, calculate rank("10100001", 8) = 3, so
- * the line (B) is the entry in question.
- *
- * A naive implementation of succinct bit-vector works really well
- * not only for large size but also for small size. However, it has
- * tiny overhead for very small size. So, this implementation consist
- * of two parts: one part is the "immediate" table that keeps rank result
- * as a raw table, and the other part is a normal succinct bit-vector.
- */
-
-#define IMMEDIATE_TABLE_SIZE 54 /* a multiple of 9, and < 128 */
-
-struct succ_index_table {
- uint64_t imm_part[IMMEDIATE_TABLE_SIZE / 9];
- struct succ_dict_block {
- unsigned int rank;
- uint64_t small_block_ranks; /* 9 bits * 7 = 63 bits */
- uint64_t bits[512/64];
- } succ_part[FLEX_ARY_LEN];
-};
-
-#define imm_block_rank_set(v, i, r) (v) |= (uint64_t)(r) << (7 * (i))
-#define imm_block_rank_get(v, i) (((int)((v) >> ((i) * 7))) & 0x7f)
-#define small_block_rank_set(v, i, r) (v) |= (uint64_t)(r) << (9 * ((i) - 1))
-#define small_block_rank_get(v, i) ((i) == 0 ? 0 : (((int)((v) >> (((i) - 1) * 9))) & 0x1ff))
-
-static struct succ_index_table *
-succ_index_table_create(int max_pos, int *data, int size)
-{
- const int imm_size = (max_pos < IMMEDIATE_TABLE_SIZE ? max_pos + 8 : IMMEDIATE_TABLE_SIZE) / 9;
- const int succ_size = (max_pos < IMMEDIATE_TABLE_SIZE ? 0 : (max_pos - IMMEDIATE_TABLE_SIZE + 511)) / 512;
- struct succ_index_table *sd =
- rb_xcalloc_mul_add_mul(
- imm_size, sizeof(uint64_t),
- succ_size, sizeof(struct succ_dict_block));
- int i, j, k, r;
-
- r = 0;
- for (j = 0; j < imm_size; j++) {
- for (i = 0; i < 9; i++) {
- if (r < size && data[r] == j * 9 + i) r++;
- imm_block_rank_set(sd->imm_part[j], i, r);
- }
- }
- for (k = 0; k < succ_size; k++) {
- struct succ_dict_block *sd_block = &sd->succ_part[k];
- int small_rank = 0;
- sd_block->rank = r;
- for (j = 0; j < 8; j++) {
- uint64_t bits = 0;
- if (j) small_block_rank_set(sd_block->small_block_ranks, j, small_rank);
- for (i = 0; i < 64; i++) {
- if (r < size && data[r] == k * 512 + j * 64 + i + IMMEDIATE_TABLE_SIZE) {
- bits |= ((uint64_t)1) << i;
- r++;
- }
- }
- sd_block->bits[j] = bits;
- small_rank += rb_popcount64(bits);
- }
- }
- return sd;
-}
-
-static unsigned int *
-succ_index_table_invert(int max_pos, struct succ_index_table *sd, int size)
-{
- const int imm_size = (max_pos < IMMEDIATE_TABLE_SIZE ? max_pos + 8 : IMMEDIATE_TABLE_SIZE) / 9;
- const int succ_size = (max_pos < IMMEDIATE_TABLE_SIZE ? 0 : (max_pos - IMMEDIATE_TABLE_SIZE + 511)) / 512;
- unsigned int *positions = ALLOC_N(unsigned int, size), *p;
- int i, j, k, r = -1;
- p = positions;
- for (j = 0; j < imm_size; j++) {
- for (i = 0; i < 9; i++) {
- int nr = imm_block_rank_get(sd->imm_part[j], i);
- if (r != nr) *p++ = j * 9 + i;
- r = nr;
- }
- }
- for (k = 0; k < succ_size; k++) {
- for (j = 0; j < 8; j++) {
- for (i = 0; i < 64; i++) {
- if (sd->succ_part[k].bits[j] & (((uint64_t)1) << i)) {
- *p++ = k * 512 + j * 64 + i + IMMEDIATE_TABLE_SIZE;
- }
- }
- }
+ switch (set) {
+ case Qtrue: data.set = 1; break;
+ case Qfalse: data.set = 0; break;
+ default:
+ rb_raise(rb_eTypeError, "`set' should be true/false");
}
- return positions;
-}
-static int
-succ_index_lookup(const struct succ_index_table *sd, int x)
-{
- if (x < IMMEDIATE_TABLE_SIZE) {
- const int i = x / 9;
- const int j = x % 9;
- return imm_block_rank_get(sd->imm_part[i], j);
- }
- else {
- const int block_index = (x - IMMEDIATE_TABLE_SIZE) / 512;
- const struct succ_dict_block *block = &sd->succ_part[block_index];
- const int block_bit_index = (x - IMMEDIATE_TABLE_SIZE) % 512;
- const int small_block_index = block_bit_index / 64;
- const int small_block_popcount = small_block_rank_get(block->small_block_ranks, small_block_index);
- const int popcnt = rb_popcount64(block->bits[small_block_index] << (63 - block_bit_index % 64));
+ rb_iseq_line_trace_each(iseqval, line_trace_specify, (void *)&data);
- return block->rank + small_block_popcount + popcnt;
+ if (data.prev == 0) {
+ rb_raise(rb_eTypeError, "`pos' is out of range.");
}
+ return data.prev == 1 ? Qtrue : Qfalse;
}
-#endif
/*
* Document-class: RubyVM::InstructionSequence
*
* The InstructionSequence class represents a compiled sequence of
- * instructions for the Virtual Machine used in MRI. Not all implementations of Ruby
- * may implement this class, and for the implementations that implement it,
- * the methods defined and behavior of the methods can change in any version.
+ * instructions for the Ruby Virtual Machine.
*
* With it, you can get a handle to the instructions that make up a method or
* a proc, compile strings of Ruby code down to VM instructions, and
* disassemble instruction sequences to strings for easy inspection. It is
- * mostly useful if you want to learn how YARV works, but it also lets
+ * mostly useful if you want to learn how the Ruby VM works, but it also lets
* you control various settings for the Ruby iseq compiler.
*
* You can find the source for the VM instructions in +insns.def+ in the Ruby
@@ -3533,8 +2320,6 @@ succ_index_lookup(const struct succ_index_table *sd, int x)
* The instruction sequence results will almost certainly change as Ruby
* changes, so example output in this documentation may be different from what
* you see.
- *
- * Of course, this class is MRI specific.
*/
void
@@ -3542,44 +2327,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 25c62a384f..2dec51585d 100644
--- a/iseq.h
+++ b/iseq.h
@@ -9,217 +9,49 @@
**********************************************************************/
-#ifndef RUBY_ISEQ_H
-#define RUBY_ISEQ_H 1
-
-RUBY_EXTERN const int ruby_api_version[];
-#define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])
-#define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1])
-
-#ifndef rb_iseq_t
-typedef struct rb_iseq_struct rb_iseq_t;
-#define rb_iseq_t rb_iseq_t
-#endif
-
-extern const ID rb_iseq_shared_exc_local_tbl[];
-
-static inline size_t
-rb_call_info_kw_arg_bytes(int keyword_len)
-{
- return rb_size_mul_add_or_raise(
- keyword_len - 1, sizeof(VALUE), sizeof(struct rb_call_info_kw_arg),
- rb_eRuntimeError);
-}
-
-#define ISEQ_COVERAGE(iseq) iseq->body->variable.coverage
-#define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &iseq->body->variable.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_PC2BRANCHINDEX(iseq) iseq->body->variable.pc2branchindex
-#define ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &iseq->body->variable.pc2branchindex, h)
-
-#define ISEQ_FLIP_CNT(iseq) (iseq)->body->variable.flip_count
-
-static inline rb_snum_t
-ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq)
-{
- rb_snum_t cnt = iseq->body->variable.flip_count;
- iseq->body->variable.flip_count += 1;
- return cnt;
-}
-
-static inline VALUE *
-ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq)
-{
- return iseq->body->variable.original_iseq;
-}
-
-static inline void
-ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq)
-{
- void *ptr = iseq->body->variable.original_iseq;
- iseq->body->variable.original_iseq = NULL;
- if (ptr) {
- ruby_xfree(ptr);
- }
-}
-
-static inline VALUE *
-ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
-{
- return iseq->body->variable.original_iseq =
- ALLOC_N(VALUE, size);
-}
-
-#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| \
- RUBY_EVENT_COVERAGE_LINE| \
- RUBY_EVENT_COVERAGE_BRANCH)
-
-#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
-#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2
-#define ISEQ_TRANSLATED IMEMO_FL_USER3
-#define ISEQ_MARKABLE_ISEQ IMEMO_FL_USER4
-
-#define ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW((iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0)
-
-struct iseq_compile_data {
- /* GC is needed */
- const VALUE err_info;
- 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;
- struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
- struct {
- struct iseq_compile_data_storage *storage_head;
- struct iseq_compile_data_storage *storage_current;
- } node;
- struct {
- struct iseq_compile_data_storage *storage_head;
- struct iseq_compile_data_storage *storage_current;
- } insn;
- int loopval_popped; /* used by NODE_BREAK */
- 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;
- const struct rb_builtin_function *builtin_function_table;
-#if OPT_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->aux.compile_data = ZALLOC(struct iseq_compile_data);
- iseq->flags |= ISEQ_USE_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);
-const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
-VALUE rb_iseq_ibf_load_extra_data(VALUE str);
-void rb_iseq_init_trace(rb_iseq_t *iseq);
-int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line);
-int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval);
-const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
-
-#if VM_INSN_INFO_TABLE_IMPL == 2
-unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body);
-#endif
+#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_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc);
-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);
-void rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *arena);
+VALUE rb_iseq_compile_node(VALUE self, NODE *node);
+int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
+VALUE *rb_iseq_original_iseq(rb_iseq_t *iseq);
+VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
+ VALUE locals, VALUE args,
+ VALUE exception, VALUE body);
/* iseq.c */
+void rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj);
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_insns_info_encode_positions(const rb_iseq_t *iseq);
-
-struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(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_location(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
-void rb_iseq_remove_coverage_all(void);
+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 {
- int line_no;
- rb_event_flag_t events;
+struct iseq_line_info_entry {
+ unsigned int position;
+ unsigned int line_no;
};
struct iseq_catch_table_entry {
@@ -231,21 +63,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.
- */
- rb_iseq_t *iseq;
-
+ VALUE iseq;
unsigned int start;
unsigned int end;
unsigned int cont;
@@ -253,20 +71,19 @@ struct iseq_catch_table_entry {
};
PACKED_STRUCT_UNALIGNED(struct iseq_catch_table {
- unsigned int size;
- struct iseq_catch_table_entry entries[FLEX_ARY_LEN];
+ int size;
+ struct iseq_catch_table_entry entries[1]; /* flexible array */
});
static inline int
iseq_catch_table_bytes(int n)
{
enum {
- catch_table_entry_size = sizeof(struct iseq_catch_table_entry),
- catch_table_entries_max = (INT_MAX - offsetof(struct iseq_catch_table, entries)) / catch_table_entry_size
+ catch_table_entries_max = (INT_MAX - sizeof(struct iseq_catch_table)) / sizeof(struct iseq_catch_table_entry)
};
if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n);
- return (int)(offsetof(struct iseq_catch_table, entries) +
- n * catch_table_entry_size);
+ return (int)(sizeof(struct iseq_catch_table) +
+ (n - 1) * sizeof(struct iseq_catch_table_entry));
}
#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
@@ -275,13 +92,44 @@ struct iseq_compile_data_storage {
struct iseq_compile_data_storage *next;
unsigned int pos;
unsigned int size;
- char buff[FLEX_ARY_LEN];
+ char buff[1]; /* flexible array */
+};
+
+/* account for flexible array */
+#define SIZEOF_ISEQ_COMPILE_DATA_STORAGE \
+ (sizeof(struct iseq_compile_data_storage) - 1)
+
+struct iseq_compile_data {
+ /* GC is needed */
+ const VALUE err_info;
+ 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 {
- DEFINED_NOT_DEFINED,
DEFINED_NIL = 1,
DEFINED_IVAR,
DEFINED_LVAR,
@@ -298,15 +146,13 @@ enum defined_type {
DEFINED_EXPR,
DEFINED_IVAR2,
DEFINED_REF,
- DEFINED_FUNC,
- DEFINED_CONST_FROM
+ DEFINED_FUNC
};
VALUE rb_iseq_defined_string(enum defined_type type);
-/* 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 92a4793b00..42c7a4eae5 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 {short 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|EXPR_FITEM},
#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|EXPR_FITEM},
#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 668152021d..0000000000
--- a/lib/.document
+++ /dev/null
@@ -1,25 +0,0 @@
-# Add files to this as they become documented
-
-*.rb
-
-bundler
-cgi
-csv
-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 ec90ff10cd..838e5afc74 100644
--- a/lib/English.rb
+++ b/lib/English.rb
@@ -1,7 +1,6 @@
-# frozen_string_literal: true
# Include the English library file in a Ruby script, and you can
-# reference the global variables such as <tt>$_</tt> using less
-# cryptic names, listed below.
+# reference the global variables such as \VAR{\$\_} using less
+# cryptic names, listed in the following table.% \vref{tab:english}.
#
# Without 'English':
#
@@ -52,43 +51,45 @@ module English end if false
alias $ERROR_INFO $!
# The stack backtrace generated by the last
-# exception. See Kernel#caller for details. Thread local.
+# exception. <tt>See Kernel.caller</tt> for details. Thread local.
alias $ERROR_POSITION $@
-# The default separator pattern used by String#split. May be set from
-# the command line using the <tt>-F</tt> flag.
+# The default separator pattern used by <tt>String.split</tt>. May be
+# set from the command line using the <tt>-F</tt> flag.
alias $FS $;
-# The default separator pattern used by String#split. May be set from
-# the command line using the <tt>-F</tt> flag.
+# The default separator pattern used by <tt>String.split</tt>. May be
+# set from the command line using the <tt>-F</tt> flag.
alias $FIELD_SEPARATOR $;
# The separator string output between the parameters to methods such
-# as Kernel#print and Array#join. Defaults to +nil+, which adds no
-# text.
+# as <tt>Kernel.print</tt> and <tt>Array.join</tt>. Defaults to +nil+,
+# which adds no text.
alias $OFS $,
# The separator string output between the parameters to methods such
-# as Kernel#print and Array#join. Defaults to +nil+, which adds no
-# text.
+# as <tt>Kernel.print</tt> and <tt>Array.join</tt>. Defaults to +nil+,
+# which adds no text.
alias $OUTPUT_FIELD_SEPARATOR $,
# The input record separator (newline by default). This is the value
-# that routines such as Kernel#gets use to determine record
+# that routines such as <tt>Kernel.gets</tt> use to determine record
# boundaries. If set to +nil+, +gets+ will read the entire file.
alias $RS $/
# The input record separator (newline by default). This is the value
-# that routines such as Kernel#gets use to determine record
+# that routines such as <tt>Kernel.gets</tt> use to determine record
# boundaries. If set to +nil+, +gets+ will read the entire file.
alias $INPUT_RECORD_SEPARATOR $/
# The string appended to the output of every call to methods such as
-# Kernel#print and IO#write. The default value is +nil+.
+# <tt>Kernel.print</tt> and <tt>IO.write</tt>. The default value is
+# +nil+.
alias $ORS $\
# The string appended to the output of every call to methods such as
-# Kernel#print and IO#write. The default value is +nil+.
+# <tt>Kernel.print</tt> and <tt>IO.write</tt>. The default value is
+# +nil+.
alias $OUTPUT_RECORD_SEPARATOR $\
# The number of the last line read from the current input file.
@@ -97,14 +98,14 @@ alias $INPUT_LINE_NUMBER $.
# The number of the last line read from the current input file.
alias $NR $.
-# The last line read by Kernel#gets or
-# Kernel#readline. Many string-related functions in the
-# Kernel module operate on <tt>$_</tt> by default. The variable is
+# The last line read by <tt>Kernel.gets</tt> or
+# <tt>Kernel.readline</tt>. Many string-related functions in the
+# +Kernel+ module operate on <tt>$_</tt> by default. The variable is
# local to the current scope. Thread local.
alias $LAST_READ_LINE $_
-# The destination of output for Kernel#print
-# and Kernel#printf. The default value is
+# The destination of output for <tt>Kernel.print</tt>
+# and <tt>Kernel.printf</tt>. The default value is
# <tt>$stdout</tt>.
alias $DEFAULT_OUTPUT $>
@@ -113,7 +114,7 @@ alias $DEFAULT_OUTPUT $>
# given as command-line arguments, or <tt>$stdin</tt>
# (in the case where there are no
# arguments). <tt>$<</tt> supports methods similar to a
-# File object:
+# +File+ object:
# +inmode+, +close+,
# <tt>closed?</tt>, +each+,
# <tt>each_byte</tt>, <tt>each_line</tt>,
@@ -127,8 +128,8 @@ alias $DEFAULT_OUTPUT $>
# +rewind+, +seek+, +skip+,
# +tell+, <tt>to_a</tt>, <tt>to_i</tt>,
# <tt>to_io</tt>, <tt>to_s</tt>, along with the
-# methods in Enumerable. The method +file+
-# returns a File object for the file currently
+# methods in +Enumerable+. The method +file+
+# returns a +File+ object for the file currently
# being read. This may change as <tt>$<</tt> reads
# through the files on the command line. Read only.
alias $DEFAULT_INPUT $<
@@ -151,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 5c8df841f1..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,38 +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)
- str.tr!("+/", "-_")
- 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 5ce9710586..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
@@ -439,9 +434,6 @@ module Benchmark
#
# An in-place version of #add.
- # Changes the times of this Tms object by making it the sum of the times
- # for this Tms object, plus the time required to execute
- # the code block (+blk+).
#
def add!(&blk)
t = Benchmark.measure(&blk)
@@ -455,7 +447,7 @@ module Benchmark
#
# Returns a new Tms object obtained by memberwise summation
- # of the individual times for this Tms object with those of the +other+
+ # of the individual times for this Tms object with those of the other
# Tms object.
# This method and #/() are useful for taking statistics.
#
@@ -463,27 +455,27 @@ module Benchmark
#
# Returns a new Tms object obtained by memberwise subtraction
- # of the individual times for the +other+ Tms object from those of this
+ # of the individual times for the other Tms object from those of this
# Tms object.
#
def -(other); memberwise(:-, other) end
#
# Returns a new Tms object obtained by memberwise multiplication
- # of the individual times for this Tms object by +x+.
+ # of the individual times for this Tms object by _x_.
#
def *(x); memberwise(:*, x) end
#
# Returns a new Tms object obtained by memberwise division
- # of the individual times for this Tms object by +x+.
+ # of the individual times for this Tms object by _x_.
# This method and #+() are useful for taking statistics.
#
def /(x); memberwise(:/, x) end
#
# 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:
#
@@ -495,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)
@@ -532,7 +524,7 @@ module Benchmark
#
# Returns a new Tms object obtained by memberwise operation +op+
# of the individual times for this Tms object with those of the other
- # Tms object (+x+).
+ # Tms object.
#
# +op+ can be a mathematical operation such as <tt>+</tt>, <tt>-</tt>,
# <tt>*</tt>, <tt>/</tt>
diff --git a/lib/benchmark/benchmark.gemspec b/lib/benchmark/benchmark.gemspec
deleted file mode 100644
index aad5205f8d..0000000000
--- a/lib/benchmark/benchmark.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-begin
- require_relative "lib/benchmark/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "benchmark"
- spec.version = Benchmark::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{a performance benchmarking library}
- spec.description = spec.summary
- spec.homepage = "https://github.com/ruby/benchmark"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- # Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/benchmark/version.rb b/lib/benchmark/version.rb
deleted file mode 100644
index d74cc74ee7..0000000000
--- a/lib/benchmark/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-module Benchmark
- VERSION = "0.1.0"
-end
diff --git a/lib/bundler.rb b/lib/bundler.rb
deleted file mode 100644
index df345539c8..0000000000
--- a/lib/bundler.rb
+++ /dev/null
@@ -1,682 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "bundler/vendored_fileutils"
-require "pathname"
-require "rbconfig"
-
-require_relative "bundler/errors"
-require_relative "bundler/environment_preserver"
-require_relative "bundler/plugin"
-require_relative "bundler/rubygems_ext"
-require_relative "bundler/rubygems_integration"
-require_relative "bundler/version"
-require_relative "bundler/constants"
-require_relative "bundler/current_ruby"
-require_relative "bundler/build_metadata"
-
-# Bundler provides a consistent environment for Ruby projects by
-# tracking and installing the exact gems and versions that are needed.
-#
-# Since Ruby 2.6, Bundler is a part of Ruby's standard library.
-#
-# Bunder is used by creating _gemfiles_ listing all the project dependencies
-# and (optionally) their versions and then using
-#
-# require 'bundler/setup'
-#
-# or Bundler.setup to setup environment where only specified gems and their
-# specified versions could be used.
-#
-# See {Bundler website}[https://bundler.io/docs.html] for extensive documentation
-# on gemfiles creation and Bundler usage.
-#
-# As a standard library inside project, Bundler could be used for introspection
-# of loaded and required modules.
-#
-module Bundler
- environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
- ORIGINAL_ENV = environment_preserver.restore
- ENV.replace(environment_preserver.backup)
- SUDO_MUTEX = Mutex.new
-
- autoload :Definition, File.expand_path("bundler/definition", __dir__)
- autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
- autoload :DepProxy, File.expand_path("bundler/dep_proxy", __dir__)
- autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
- autoload :Dsl, File.expand_path("bundler/dsl", __dir__)
- autoload :EndpointSpecification, File.expand_path("bundler/endpoint_specification", __dir__)
- autoload :Env, File.expand_path("bundler/env", __dir__)
- autoload :Fetcher, File.expand_path("bundler/fetcher", __dir__)
- autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
- autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
- autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
- autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
- autoload :Graph, File.expand_path("bundler/graph", __dir__)
- autoload :Index, File.expand_path("bundler/index", __dir__)
- autoload :Injector, File.expand_path("bundler/injector", __dir__)
- autoload :Installer, File.expand_path("bundler/installer", __dir__)
- autoload :LazySpecification, File.expand_path("bundler/lazy_specification", __dir__)
- autoload :LockfileParser, File.expand_path("bundler/lockfile_parser", __dir__)
- autoload :MatchPlatform, File.expand_path("bundler/match_platform", __dir__)
- autoload :ProcessLock, File.expand_path("bundler/process_lock", __dir__)
- autoload :RemoteSpecification, File.expand_path("bundler/remote_specification", __dir__)
- autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
- autoload :Retry, File.expand_path("bundler/retry", __dir__)
- autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
- autoload :RubyGemsGemInstaller, File.expand_path("bundler/rubygems_gem_installer", __dir__)
- autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
- autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
- autoload :Settings, File.expand_path("bundler/settings", __dir__)
- autoload :SharedHelpers, File.expand_path("bundler/shared_helpers", __dir__)
- autoload :Source, File.expand_path("bundler/source", __dir__)
- autoload :SourceList, File.expand_path("bundler/source_list", __dir__)
- autoload :SpecSet, File.expand_path("bundler/spec_set", __dir__)
- autoload :StubSpecification, File.expand_path("bundler/stub_specification", __dir__)
- autoload :UI, File.expand_path("bundler/ui", __dir__)
- autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
- autoload :VersionRanges, File.expand_path("bundler/version_ranges", __dir__)
-
- class << self
- def configure
- @configured ||= configure_gem_home_and_path
- end
-
- def ui
- (defined?(@ui) && @ui) || (self.ui = UI::Shell.new)
- end
-
- def ui=(ui)
- Bundler.rubygems.ui = UI::RGProxy.new(ui)
- @ui = ui
- end
-
- # Returns absolute path of where gems are installed on the filesystem.
- def bundle_path
- @bundle_path ||= Pathname.new(configured_bundle_path.path).expand_path(root)
- end
-
- def configured_bundle_path
- @configured_bundle_path ||= settings.path.tap(&:validate!)
- end
-
- # Returns absolute location of where binstubs are installed to.
- def bin_path
- @bin_path ||= begin
- path = settings[:bin] || "bin"
- path = Pathname.new(path).expand_path(root).expand_path
- SharedHelpers.filesystem_access(path) {|p| FileUtils.mkdir_p(p) }
- path
- end
- end
-
- # Turns on the Bundler runtime. After +Bundler.setup+ call, all +load+ or
- # +require+ of the gems would be allowed only if they are part of
- # the Gemfile or Ruby's standard library. If the versions specified
- # in Gemfile, only those versions would be loaded.
- #
- # Assuming Gemfile
- #
- # gem 'first_gem', '= 1.0'
- # group :test do
- # gem 'second_gem', '= 1.0'
- # end
- #
- # The code using Bundler.setup works as follows:
- #
- # require 'third_gem' # allowed, required from global gems
- # require 'first_gem' # allowed, loads the last installed version
- # Bundler.setup
- # require 'fourth_gem' # fails with LoadError
- # require 'second_gem' # loads exactly version 1.0
- #
- # +Bundler.setup+ can be called only once, all subsequent calls are no-op.
- #
- # If _groups_ list is provided, only gems from specified groups would
- # be allowed (gems specified outside groups belong to special +:default+ group).
- #
- # To require all gems from Gemfile (or only some groups), see Bundler.require.
- #
- def setup(*groups)
- # Return if all groups are already loaded
- return @setup if defined?(@setup) && @setup
-
- definition.validate_runtime!
-
- SharedHelpers.print_major_deprecations!
-
- if groups.empty?
- # Load all groups, but only once
- @setup = load.setup
- else
- load.setup(*groups)
- end
- end
-
- # Setups Bundler environment (see Bundler.setup) if it is not already set,
- # and loads all gems from groups specified. Unlike ::setup, can be called
- # multiple times with different groups (if they were allowed by setup).
- #
- # Assuming Gemfile
- #
- # gem 'first_gem', '= 1.0'
- # group :test do
- # gem 'second_gem', '= 1.0'
- # end
- #
- # The code will work as follows:
- #
- # Bundler.setup # allow all groups
- # Bundler.require(:default) # requires only first_gem
- # # ...later
- # Bundler.require(:test) # requires second_gem
- #
- def require(*groups)
- setup(*groups).require(*groups)
- end
-
- def load
- @load ||= Runtime.new(root, definition)
- end
-
- def environment
- SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", :print_caller_location => true
- load
- end
-
- # Returns an instance of Bundler::Definition for given Gemfile and lockfile
- #
- # @param unlock [Hash, Boolean, nil] Gems that have been requested
- # to be updated or true if all gems should be updated
- # @return [Bundler::Definition]
- def definition(unlock = nil)
- @definition = nil if unlock
- @definition ||= begin
- configure
- Definition.build(default_gemfile, default_lockfile, unlock)
- end
- end
-
- def frozen_bundle?
- frozen = settings[:deployment]
- frozen ||= settings[:frozen] unless feature_flag.deployment_means_frozen?
- frozen
- end
-
- def locked_gems
- @locked_gems ||=
- if defined?(@definition) && @definition
- definition.locked_gems
- elsif Bundler.default_lockfile.file?
- lock = Bundler.read_file(Bundler.default_lockfile)
- LockfileParser.new(lock)
- end
- end
-
- def ruby_scope
- "#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
- end
-
- def user_home
- @user_home ||= begin
- home = Bundler.rubygems.user_home
- bundle_home = home ? File.join(home, ".bundle") : nil
-
- warning = if home.nil?
- "Your home directory is not set."
- elsif !File.directory?(home)
- "`#{home}` is not a directory."
- elsif !File.writable?(home) && (!File.directory?(bundle_home) || !File.writable?(bundle_home))
- "`#{home}` is not writable."
- end
-
- if warning
- user_home = tmp_home_path(warning)
- Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
- user_home
- else
- Pathname.new(home)
- end
- end
- end
-
- def user_bundle_path(dir = "home")
- env_var, fallback = case dir
- when "home"
- ["BUNDLE_USER_HOME", proc { Pathname.new(user_home).join(".bundle") }]
- when "cache"
- ["BUNDLE_USER_CACHE", proc { user_bundle_path.join("cache") }]
- when "config"
- ["BUNDLE_USER_CONFIG", proc { user_bundle_path.join("config") }]
- when "plugin"
- ["BUNDLE_USER_PLUGIN", proc { user_bundle_path.join("plugin") }]
- else
- raise BundlerError, "Unknown user path requested: #{dir}"
- end
- # `fallback` will already be a Pathname, but Pathname.new() is
- # idempotent so it's OK
- Pathname.new(ENV.fetch(env_var, &fallback))
- end
-
- def user_cache
- user_bundle_path("cache")
- end
-
- def home
- bundle_path.join("bundler")
- end
-
- def install_path
- home.join("gems")
- end
-
- def specs_path
- bundle_path.join("specifications")
- end
-
- def root
- @root ||= begin
- SharedHelpers.root
- rescue GemfileNotFound
- bundle_dir = default_bundle_dir
- raise GemfileNotFound, "Could not locate Gemfile or .bundle/ directory" unless bundle_dir
- Pathname.new(File.expand_path("..", bundle_dir))
- end
- end
-
- def app_config_path
- if app_config = ENV["BUNDLE_APP_CONFIG"]
- Pathname.new(app_config).expand_path(root)
- else
- root.join(".bundle")
- end
- end
-
- def app_cache(custom_path = nil)
- path = custom_path || root
- Pathname.new(path).join(settings.app_cache_path)
- end
-
- def tmp(name = Process.pid.to_s)
- Kernel.send(:require, "tmpdir")
- Pathname.new(Dir.mktmpdir(["bundler", name]))
- end
-
- def rm_rf(path)
- FileUtils.remove_entry_secure(path) if path && File.exist?(path)
- rescue ArgumentError
- message = <<EOF
-It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue.
-You should probably consider fixing this issue by running `chmod o-w ~` on *nix.
-Please refer to https://ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details.
-EOF
- File.world_writable?(path) ? Bundler.ui.warn(message) : raise
- raise PathError, "Please fix the world-writable issue with your #{path} directory"
- end
-
- def settings
- @settings ||= Settings.new(app_config_path)
- rescue GemfileNotFound
- @settings = Settings.new(Pathname.new(".bundle").expand_path)
- end
-
- # @return [Hash] Environment present before Bundler was activated
- def original_env
- ORIGINAL_ENV.clone
- end
-
- # @deprecated Use `unbundled_env` instead
- def clean_env
- Bundler::SharedHelpers.major_deprecation(
- 2,
- "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
- "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`",
- :print_caller_location => true
- )
-
- unbundled_env
- end
-
- # @return [Hash] Environment with all bundler-related variables removed
- def unbundled_env
- env = original_env
-
- if env.key?("BUNDLER_ORIG_MANPATH")
- env["MANPATH"] = env["BUNDLER_ORIG_MANPATH"]
- end
-
- env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
-
- if env.key?("RUBYOPT")
- env["RUBYOPT"] = env["RUBYOPT"].sub "-rbundler/setup", ""
- end
-
- if env.key?("RUBYLIB")
- rubylib = env["RUBYLIB"].split(File::PATH_SEPARATOR)
- rubylib.delete(File.expand_path("..", __FILE__))
- env["RUBYLIB"] = rubylib.join(File::PATH_SEPARATOR)
- end
-
- env
- end
-
- # Run block with environment present before Bundler was activated
- def with_original_env
- with_env(original_env) { yield }
- end
-
- # @deprecated Use `with_unbundled_env` instead
- def with_clean_env
- Bundler::SharedHelpers.major_deprecation(
- 2,
- "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
- "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`",
- :print_caller_location => true
- )
-
- with_env(unbundled_env) { yield }
- end
-
- # Run block with all bundler-related variables removed
- def with_unbundled_env
- with_env(unbundled_env) { yield }
- end
-
- # Run subcommand with the environment present before Bundler was activated
- def original_system(*args)
- with_original_env { Kernel.system(*args) }
- end
-
- # @deprecated Use `unbundled_system` instead
- def clean_system(*args)
- Bundler::SharedHelpers.major_deprecation(
- 2,
- "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
- "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`",
- :print_caller_location => true
- )
-
- with_env(unbundled_env) { Kernel.system(*args) }
- end
-
- # Run subcommand in an environment with all bundler related variables removed
- def unbundled_system(*args)
- with_unbundled_env { Kernel.system(*args) }
- end
-
- # Run a `Kernel.exec` to a subcommand with the environment present before Bundler was activated
- def original_exec(*args)
- with_original_env { Kernel.exec(*args) }
- end
-
- # @deprecated Use `unbundled_exec` instead
- def clean_exec(*args)
- Bundler::SharedHelpers.major_deprecation(
- 2,
- "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
- "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`",
- :print_caller_location => true
- )
-
- with_env(unbundled_env) { Kernel.exec(*args) }
- end
-
- # Run a `Kernel.exec` to a subcommand in an environment with all bundler related variables removed
- def unbundled_exec(*args)
- with_env(unbundled_env) { Kernel.exec(*args) }
- end
-
- def local_platform
- return Gem::Platform::RUBY if settings[:force_ruby_platform]
- Gem::Platform.local
- end
-
- def default_gemfile
- SharedHelpers.default_gemfile
- end
-
- def default_lockfile
- SharedHelpers.default_lockfile
- end
-
- def default_bundle_dir
- SharedHelpers.default_bundle_dir
- end
-
- def system_bindir
- # Gem.bindir doesn't always return the location that RubyGems will install
- # system binaries. If you put '-n foo' in your .gemrc, RubyGems will
- # install binstubs there instead. Unfortunately, RubyGems doesn't expose
- # that directory at all, so rather than parse .gemrc ourselves, we allow
- # the directory to be set as well, via `bundle config set bindir foo`.
- Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
- end
-
- def use_system_gems?
- configured_bundle_path.use_system_gems?
- end
-
- def requires_sudo?
- return @requires_sudo if defined?(@requires_sudo_ran)
-
- sudo_present = which "sudo" if settings.allow_sudo?
-
- if sudo_present
- # the bundle path and subdirectories need to be writable for RubyGems
- # to be able to unpack and install gems without exploding
- path = bundle_path
- path = path.parent until path.exist?
-
- # bins are written to a different location on OS X
- bin_dir = Pathname.new(Bundler.system_bindir)
- bin_dir = bin_dir.parent until bin_dir.exist?
-
- # if any directory is not writable, we need sudo
- files = [path, bin_dir] | Dir[bundle_path.join("build_info/*").to_s] | Dir[bundle_path.join("*").to_s]
- unwritable_files = files.reject {|f| File.writable?(f) }
- sudo_needed = !unwritable_files.empty?
- if sudo_needed
- Bundler.ui.warn "Following files may not be writable, so sudo is needed:\n #{unwritable_files.map(&:to_s).sort.join("\n ")}"
- end
- end
-
- @requires_sudo_ran = true
- @requires_sudo = settings.allow_sudo? && sudo_present && sudo_needed
- end
-
- def mkdir_p(path, options = {})
- if requires_sudo? && !options[:no_sudo]
- sudo "mkdir -p '#{path}'" unless File.exist?(path)
- else
- SharedHelpers.filesystem_access(path, :write) do |p|
- FileUtils.mkdir_p(p)
- end
- end
- end
-
- def which(executable)
- if File.file?(executable) && File.executable?(executable)
- executable
- elsif paths = ENV["PATH"]
- quote = '"'.freeze
- paths.split(File::PATH_SEPARATOR).find do |path|
- path = path[1..-2] if path.start_with?(quote) && path.end_with?(quote)
- executable_path = File.expand_path(executable, path)
- return executable_path if File.file?(executable_path) && File.executable?(executable_path)
- end
- end
- end
-
- def sudo(str)
- SUDO_MUTEX.synchronize do
- prompt = "\n\n" + <<-PROMPT.gsub(/^ {6}/, "").strip + " "
- Your user account isn't allowed to install to the system RubyGems.
- You can cancel this installation and run:
-
- bundle install --path vendor/bundle
-
- to install the gems into ./vendor/bundle/, or you can enter your password
- and install the bundled gems to RubyGems using sudo.
-
- Password:
- PROMPT
-
- unless @prompted_for_sudo ||= system(%(sudo -k -p "#{prompt}" true))
- raise SudoNotPermittedError,
- "Bundler requires sudo access to install at the moment. " \
- "Try installing again, granting Bundler sudo access when prompted, or installing into a different path."
- end
-
- `sudo -p "#{prompt}" #{str}`
- end
- end
-
- def read_file(file)
- SharedHelpers.filesystem_access(file, :read) do
- File.open(file, "r:UTF-8", &:read)
- end
- end
-
- def load_marshal(data)
- Marshal.load(data)
- rescue StandardError => e
- raise MarshalError, "#{e.class}: #{e.message}"
- end
-
- def load_gemspec(file, validate = false)
- @gemspec_cache ||= {}
- key = File.expand_path(file)
- @gemspec_cache[key] ||= load_gemspec_uncached(file, validate)
- # Protect against caching side-effected gemspecs by returning a
- # new instance each time.
- @gemspec_cache[key].dup if @gemspec_cache[key]
- end
-
- def load_gemspec_uncached(file, validate = false)
- path = Pathname.new(file)
- contents = read_file(file)
- spec = if contents.start_with?("---") # YAML header
- eval_yaml_gemspec(path, contents)
- else
- # Eval the gemspec from its parent directory, because some gemspecs
- # depend on "./" relative paths.
- SharedHelpers.chdir(path.dirname.to_s) do
- eval_gemspec(path, contents)
- end
- end
- return unless spec
- spec.loaded_from = path.expand_path.to_s
- Bundler.rubygems.validate(spec) if validate
- spec
- end
-
- def clear_gemspec_cache
- @gemspec_cache = {}
- end
-
- def git_present?
- return @git_present if defined?(@git_present)
- @git_present = Bundler.which("git") || Bundler.which("git.exe")
- end
-
- def feature_flag
- @feature_flag ||= FeatureFlag.new(VERSION)
- end
-
- def reset!
- reset_paths!
- Plugin.reset!
- reset_rubygems!
- end
-
- def reset_paths!
- @bin_path = nil
- @bundler_major_version = nil
- @bundle_path = nil
- @configured = nil
- @configured_bundle_path = nil
- @definition = nil
- @load = nil
- @locked_gems = nil
- @root = nil
- @settings = nil
- @setup = nil
- @user_home = nil
- end
-
- def reset_rubygems!
- return unless defined?(@rubygems) && @rubygems
- rubygems.undo_replacements
- rubygems.reset
- @rubygems = nil
- end
-
- private
-
- def eval_yaml_gemspec(path, contents)
- require_relative "bundler/psyched_yaml"
-
- # If the YAML is invalid, Syck raises an ArgumentError, and Psych
- # raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
- Gem::Specification.from_yaml(contents)
- rescue YamlLibrarySyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
- eval_gemspec(path, contents)
- end
-
- def eval_gemspec(path, contents)
- eval(contents, TOPLEVEL_BINDING.dup, path.expand_path.to_s)
- rescue ScriptError, StandardError => e
- msg = "There was an error while loading `#{path.basename}`: #{e.message}"
-
- if e.is_a?(LoadError)
- msg += "\nDoes it try to require a relative path? That's been removed in Ruby 1.9"
- end
-
- raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
- end
-
- def configure_gem_home_and_path
- configure_gem_path
- configure_gem_home
- bundle_path
- end
-
- def configure_gem_path(env = ENV)
- blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
- if !use_system_gems?
- # this needs to be empty string to cause
- # PathSupport.split_gem_path to only load up the
- # Bundler --path setting as the GEM_PATH.
- env["GEM_PATH"] = ""
- elsif blank_home
- possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
- paths = possibles.flatten.compact.uniq.reject(&:empty?)
- env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
- end
- end
-
- def configure_gem_home
- Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
- Bundler.rubygems.clear_paths
- end
-
- def tmp_home_path(warning)
- Kernel.send(:require, "tmpdir")
- SharedHelpers.filesystem_access(Dir.tmpdir) do
- path = Bundler.tmp
- at_exit { Bundler.rm_rf(path) }
- path
- end
- rescue RuntimeError => e
- raise e.exception("#{warning}\nBundler also failed to create a temporary home directory':\n#{e}")
- end
-
- # @param env [Hash]
- def with_env(env)
- backup = ENV.to_hash
- ENV.replace(env)
- yield
- ensure
- ENV.replace(backup)
- end
- end
-end
diff --git a/lib/bundler/build_metadata.rb b/lib/bundler/build_metadata.rb
deleted file mode 100644
index 4dfad2f8d8..0000000000
--- a/lib/bundler/build_metadata.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # Represents metadata from when the Bundler gem was built.
- module BuildMetadata
- # begin ivars
- @release = false
- # end ivars
-
- # A hash representation of the build metadata.
- def self.to_h
- {
- "Built At" => built_at,
- "Git SHA" => git_commit_sha,
- "Released Version" => release?,
- }
- end
-
- # A string representing the date the bundler gem was built.
- def self.built_at
- @built_at ||= Time.now.utc.strftime("%Y-%m-%d").freeze
- end
-
- # The SHA for the git commit the bundler gem was built from.
- def self.git_commit_sha
- return @git_commit_sha if instance_variable_defined? :@git_commit_sha
-
- # If Bundler has been installed without its .git directory and without a
- # commit instance variable then we can't determine its commits SHA.
- git_dir = File.join(File.expand_path("../../..", __FILE__), ".git")
- if File.directory?(git_dir)
- return @git_commit_sha = Dir.chdir(git_dir) { `git rev-parse --short HEAD`.strip.freeze }
- end
-
- # If Bundler is a submodule in RubyGems, get the submodule commit
- git_sub_dir = File.join(File.expand_path("../../../..", __FILE__), ".git")
- if File.directory?(git_sub_dir)
- return @git_commit_sha = Dir.chdir(git_sub_dir) do
- `git ls-tree --abbrev=8 HEAD bundler`.split(/\s/).fetch(2, "").strip.freeze
- end
- end
-
- @git_commit_sha ||= "unknown"
- end
-
- # Whether this is an official release build of Bundler.
- def self.release?
- @release
- end
- end
-end
diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec
deleted file mode 100644
index 30a21f155f..0000000000
--- a/lib/bundler/bundler.gemspec
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-begin
- require_relative "lib/bundler/version"
-rescue LoadError
- # for Ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |s|
- s.name = "bundler"
- s.version = Bundler::VERSION
- s.license = "MIT"
- s.authors = [
- "André Arko", "Samuel Giddins", "Colby Swandale", "Hiroshi Shibata",
- "David Rodríguez", "Grey Baker", "Stephanie Morillo", "Chris Morris", "James Wen", "Tim Moore",
- "André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche",
- "Yehuda Katz"
- ]
- s.email = ["team@bundler.io"]
- s.homepage = "https://bundler.io"
- s.summary = "The best way to manage your application's dependencies"
- s.description = "Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably"
-
- if s.respond_to?(:metadata=)
- s.metadata = {
- "bug_tracker_uri" => "https://github.com/bundler/bundler/issues",
- "changelog_uri" => "https://github.com/bundler/bundler/blob/master/CHANGELOG.md",
- "homepage_uri" => "https://bundler.io/",
- "source_code_uri" => "https://github.com/bundler/bundler/",
- }
- end
-
- s.required_ruby_version = ">= 2.3.0"
- s.required_rubygems_version = ">= 2.5.2"
-
- s.files = (Dir.glob("lib/bundler/**/*", File::FNM_DOTMATCH) + Dir.glob("man/bundler*") + Dir.glob("libexec/bundle*")).reject {|f| File.directory?(f) }
-
- s.files += ["lib/bundler.rb"]
-
- s.bindir = "libexec"
- s.executables = %w[bundle bundler]
- s.require_paths = ["lib"]
-end
diff --git a/lib/bundler/capistrano.rb b/lib/bundler/capistrano.rb
deleted file mode 100644
index 1f3712d48e..0000000000
--- a/lib/bundler/capistrano.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "shared_helpers"
-Bundler::SharedHelpers.major_deprecation 2,
- "The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler"
-
-# Capistrano task for Bundler.
-#
-# Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
-# Bundler will be activated after each new deployment.
-require_relative "deployment"
-require "capistrano/version"
-
-if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
- raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler"
-end
-
-Capistrano::Configuration.instance(:must_exist).load do
- before "deploy:finalize_update", "bundle:install"
- Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
- set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
-end
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
deleted file mode 100644
index 443458f2d9..0000000000
--- a/lib/bundler/cli.rb
+++ /dev/null
@@ -1,828 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "vendored_thor"
-
-module Bundler
- class CLI < Thor
- require_relative "cli/common"
-
- package_name "Bundler"
-
- AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
- PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze
-
- COMMAND_ALIASES = {
- "check" => "c",
- "install" => "i",
- "list" => "ls",
- "exec" => ["e", "ex", "exe"],
- "cache" => ["package", "pack"],
- "version" => ["-v", "--version"],
- }.freeze
-
- def self.start(*)
- super
- ensure
- Bundler::SharedHelpers.print_major_deprecations!
- end
-
- def self.dispatch(*)
- super do |i|
- i.send(:print_command)
- i.send(:warn_on_outdated_bundler)
- end
- end
-
- def self.all_aliases
- @all_aliases ||= begin
- command_aliases = {}
-
- COMMAND_ALIASES.each do |name, aliases|
- Array(aliases).each do |one_alias|
- command_aliases[one_alias] = name
- end
- end
-
- command_aliases
- end
- end
-
- def self.aliases_for(command_name)
- COMMAND_ALIASES.select {|k, _| k == command_name }.invert
- end
-
- def initialize(*args)
- super
-
- custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
- if custom_gemfile && !custom_gemfile.empty?
- Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
- Bundler.reset_paths!
- end
-
- Bundler.settings.set_command_option_if_given :retry, options[:retry]
-
- current_cmd = args.last[:current_command].name
- auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
- rescue UnknownArgumentError => e
- raise InvalidOption, e.message
- ensure
- self.options ||= {}
- unprinted_warnings = Bundler.ui.unprinted_warnings
- Bundler.ui = UI::Shell.new(options)
- Bundler.ui.level = "debug" if options["verbose"]
- unprinted_warnings.each {|w| Bundler.ui.warn(w) }
-
- if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
- Bundler.ui.warn(
- "The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
- "experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
- "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
- )
- end
- end
-
- check_unknown_options!(:except => [:config, :exec])
- stop_on_unknown_option! :exec
-
- desc "cli_help", "Prints a summary of bundler commands", :hide => true
- def cli_help
- version
- Bundler.ui.info "\n"
-
- primary_commands = ["install", "update", "cache", "exec", "config", "help"]
-
- list = self.class.printable_commands(true)
- by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
- utilities = by_name.keys.sort - primary_commands
- primary_commands.map! {|name| (by_name[name] || raise("no primary command #{name}")).first }
- utilities.map! {|name| by_name[name].first }
-
- shell.say "Bundler commands:\n\n"
-
- shell.say " Primary commands:\n"
- shell.print_table(primary_commands, :indent => 4, :truncate => true)
- shell.say
- shell.say " Utilities:\n"
- shell.print_table(utilities, :indent => 4, :truncate => true)
- shell.say
- self.class.send(:class_options_help, shell)
- end
- default_task(Bundler.feature_flag.default_cli_command)
-
- class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
- class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
- :desc => "Specify the number of times you wish to attempt network commands"
- class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V"
-
- def help(cli = nil)
- case cli
- when "gemfile" then command = "gemfile"
- when nil then command = "bundle"
- else command = "bundle-#{cli}"
- end
-
- man_path = File.expand_path("../../../man", __FILE__)
- man_pages = Hash[Dir.glob(File.join(man_path, "*")).grep(/.*\.\d*\Z/).collect do |f|
- [File.basename(f, ".*"), f]
- end]
-
- if man_pages.include?(command)
- if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
- Kernel.exec "man #{man_pages[command]}"
- else
- puts File.read("#{man_path}/#{File.basename(man_pages[command])}.txt")
- end
- elsif command_path = Bundler.which("bundler-#{cli}")
- Kernel.exec(command_path, "--help")
- else
- super
- end
- end
-
- def self.handle_no_command_error(command, has_namespace = $thor_runner)
- if Bundler.feature_flag.plugins? && Bundler::Plugin.command?(command)
- return Bundler::Plugin.exec_command(command, ARGV[1..-1])
- end
-
- return super unless command_path = Bundler.which("bundler-#{command}")
-
- Kernel.exec(command_path, *ARGV[1..-1])
- end
-
- desc "init [OPTIONS]", "Generates a Gemfile into the current working directory"
- long_desc <<-D
- Init generates a default Gemfile in the current working directory. When adding a
- Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
- dependency listed in the gemspec file to the newly created Gemfile.
- D
- method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
- def init
- require_relative "cli/init"
- Init.new(options.dup).run
- end
-
- desc "check [OPTIONS]", "Checks if the dependencies listed in Gemfile are satisfied by currently installed gems"
- long_desc <<-D
- Check searches the local machine for each of the gems requested in the Gemfile. If
- all gems are found, Bundler prints a success message and exits with a status of 0.
- If not, the first missing gem is listed and Bundler exits status 1.
- D
- method_option "dry-run", :type => :boolean, :default => false, :banner =>
- "Lock the Gemfile"
- method_option "gemfile", :type => :string, :banner =>
- "Use the specified gemfile instead of Gemfile"
- method_option "path", :type => :string, :banner =>
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
- def check
- remembered_flag_deprecation("path")
-
- require_relative "cli/check"
- Check.new(options).run
- end
-
- map aliases_for("check")
-
- desc "remove [GEM [GEM ...]]", "Removes gems from the Gemfile"
- long_desc <<-D
- Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
- D
- method_option "install", :type => :boolean, :banner =>
- "Runs 'bundle install' after removing the gems from the Gemfile"
- def remove(*gems)
- require_relative "cli/remove"
- Remove.new(gems, options).run
- end
-
- desc "install [OPTIONS]", "Install the current environment to the system"
- long_desc <<-D
- Install will install all of the gems in the current bundle, making them available
- for use. In a freshly checked out repository, this command will give you the same
- gem versions as the last person who updated the Gemfile and ran `bundle update`.
-
- Passing [DIR] to install (e.g. vendor) will cause the unpacked gems to be installed
- into the [DIR] directory rather than into system gems.
-
- If the bundle has already been installed, bundler will tell you so and then exit.
- D
- method_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
- "Generate bin stubs for bundled gems to ./bin"
- method_option "clean", :type => :boolean, :banner =>
- "Run bundle clean automatically after install"
- method_option "deployment", :type => :boolean, :banner =>
- "Install using defaults tuned for deployment environments"
- method_option "frozen", :type => :boolean, :banner =>
- "Do not allow the Gemfile.lock to be updated after this install"
- method_option "full-index", :type => :boolean, :banner =>
- "Fall back to using the single-file index of all gems"
- method_option "gemfile", :type => :string, :banner =>
- "Use the specified gemfile instead of Gemfile"
- method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
- "Specify the number of jobs to run in parallel"
- method_option "local", :type => :boolean, :banner =>
- "Do not attempt to fetch gems remotely and use the gem cache instead"
- method_option "no-cache", :type => :boolean, :banner =>
- "Don't update the existing gem cache."
- method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
- "Force downloading every gem."
- method_option "no-prune", :type => :boolean, :banner =>
- "Don't remove stale gems from the cache."
- method_option "path", :type => :string, :banner =>
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
- method_option "quiet", :type => :boolean, :banner =>
- "Only output warnings and errors."
- method_option "shebang", :type => :string, :banner =>
- "Specify a different shebang executable name than the default (usually 'ruby')"
- method_option "standalone", :type => :array, :lazy_default => [], :banner =>
- "Make a bundle that can work without the Bundler runtime"
- method_option "system", :type => :boolean, :banner =>
- "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
- method_option "trust-policy", :alias => "P", :type => :string, :banner =>
- "Gem trust policy (like gem install -P). Must be one of " +
- Bundler.rubygems.security_policy_keys.join("|")
- method_option "without", :type => :array, :banner =>
- "Exclude gems that are part of the specified named group."
- method_option "with", :type => :array, :banner =>
- "Include gems that are part of the specified named group."
- def install
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
-
- %w[clean deployment frozen no-cache no-prune path shebang system without with].each do |option|
- remembered_flag_deprecation(option)
- end
-
- require_relative "cli/install"
- Bundler.settings.temporary(:no_install => false) do
- Install.new(options.dup).run
- end
- end
-
- map aliases_for("install")
-
- desc "update [OPTIONS]", "Update the current environment"
- long_desc <<-D
- Update will install the newest versions of the gems listed in the Gemfile. Use
- update when you have changed the Gemfile, or if you want to get the newest
- possible versions of the gems in the bundle.
- D
- method_option "full-index", :type => :boolean, :banner =>
- "Fall back to using the single-file index of all gems"
- method_option "gemfile", :type => :string, :banner =>
- "Use the specified gemfile instead of Gemfile"
- method_option "group", :aliases => "-g", :type => :array, :banner =>
- "Update a specific group"
- method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
- "Specify the number of jobs to run in parallel"
- method_option "local", :type => :boolean, :banner =>
- "Do not attempt to fetch gems remotely and use the gem cache instead"
- method_option "quiet", :type => :boolean, :banner =>
- "Only output warnings and errors."
- method_option "source", :type => :array, :banner =>
- "Update a specific source (and all gems associated with it)"
- method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
- "Force downloading every gem."
- method_option "ruby", :type => :boolean, :banner =>
- "Update ruby specified in Gemfile.lock"
- method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
- "Update the locked version of bundler"
- method_option "patch", :type => :boolean, :banner =>
- "Prefer updating only to next patch version"
- method_option "minor", :type => :boolean, :banner =>
- "Prefer updating only to next minor version"
- method_option "major", :type => :boolean, :banner =>
- "Prefer updating to next major version (default)"
- method_option "strict", :type => :boolean, :banner =>
- "Do not allow any gem to be updated past latest --patch | --minor | --major"
- method_option "conservative", :type => :boolean, :banner =>
- "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
- method_option "all", :type => :boolean, :banner =>
- "Update everything."
- def update(*gems)
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
- require_relative "cli/update"
- Bundler.settings.temporary(:no_install => false) do
- Update.new(options, gems).run
- end
- end
-
- unless Bundler.feature_flag.bundler_3_mode?
- desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
- long_desc <<-D
- Show lists the names and versions of all gems that are required by your Gemfile.
- Calling show with [GEM] will list the exact location of that gem on your machine.
- D
- method_option "paths", :type => :boolean,
- :banner => "List the paths of all gems that are required by your Gemfile."
- method_option "outdated", :type => :boolean,
- :banner => "Show verbose output including whether gems are outdated."
- def show(gem_name = nil)
- if ARGV[0] == "show"
- rest = ARGV[1..-1]
-
- if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
- Bundler::SharedHelpers.major_deprecation(2, "the `#{flag}` flag to `bundle show` was undocumented and will be removed without replacement")
- else
- new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
-
- new_arguments = rest.map do |arg|
- next arg if arg != "--paths"
- next "--path" if new_command == "info"
- end
-
- old_argv = ARGV.join(" ")
- new_argv = [new_command, *new_arguments.compact].join(" ")
-
- Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
- end
- end
- require_relative "cli/show"
- Show.new(options, gem_name).run
- end
- end
-
- desc "list", "List all gems in the bundle"
- method_option "name-only", :type => :boolean, :banner => "print only the gem names"
- method_option "only-group", :type => :string, :banner => "print gems from a particular group"
- method_option "without-group", :type => :string, :banner => "print all gems except from a group"
- method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
- def list
- require_relative "cli/list"
- List.new(options).run
- end
-
- map aliases_for("list")
-
- desc "info GEM [OPTIONS]", "Show information for the given gem"
- method_option "path", :type => :boolean, :banner => "Print full path to gem"
- def info(gem_name)
- require_relative "cli/info"
- Info.new(options, gem_name).run
- end
-
- desc "binstubs GEM [OPTIONS]", "Install the binstubs of the listed gem"
- long_desc <<-D
- Generate binstubs for executables in [GEM]. Binstubs are put into bin,
- or the --binstubs directory if one has been set. Calling binstubs with [GEM [GEM]]
- will create binstubs for all given gems.
- D
- method_option "force", :type => :boolean, :default => false, :banner =>
- "Overwrite existing binstubs if they exist"
- method_option "path", :type => :string, :lazy_default => "bin", :banner =>
- "Binstub destination directory (default bin)"
- method_option "shebang", :type => :string, :banner =>
- "Specify a different shebang executable name than the default (usually 'ruby')"
- method_option "standalone", :type => :boolean, :banner =>
- "Make binstubs that can work without the Bundler runtime"
- method_option "all", :type => :boolean, :banner =>
- "Install binstubs for all gems"
- def binstubs(*gems)
- require_relative "cli/binstubs"
- Binstubs.new(options, gems).run
- end
-
- desc "add GEM VERSION", "Add gem to Gemfile and run bundle install"
- long_desc <<-D
- Adds the specified gem to Gemfile (if valid) and run 'bundle install' in one step.
- D
- method_option "version", :aliases => "-v", :type => :string
- method_option "group", :aliases => "-g", :type => :string
- method_option "source", :aliases => "-s", :type => :string
- method_option "git", :type => :string
- method_option "branch", :type => :string
- method_option "skip-install", :type => :boolean, :banner =>
- "Adds gem to the Gemfile but does not install it"
- method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
- method_option "strict", :type => :boolean, :banner => "Adds strict declaration of version to gem"
- def add(*gems)
- require_relative "cli/add"
- Add.new(options.dup, gems).run
- end
-
- desc "outdated GEM [OPTIONS]", "List installed gems with newer versions available"
- long_desc <<-D
- Outdated lists the names and versions of gems that have a newer version available
- in the given source. Calling outdated with [GEM [GEM]] will only check for newer
- versions of the given gems. Prerelease gems are ignored by default. If your gems
- are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
-
- For more information on patch level options (--major, --minor, --patch,
- --update-strict) see documentation on the same options on the update command.
- D
- method_option "group", :type => :string, :banner => "List gems from a specific group"
- method_option "groups", :type => :boolean, :banner => "List gems organized by groups"
- method_option "local", :type => :boolean, :banner =>
- "Do not attempt to fetch gems remotely and use the gem cache instead"
- method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
- method_option "source", :type => :array, :banner => "Check against a specific source"
- strict_is_update = Bundler.feature_flag.forget_cli_options?
- method_option "filter-strict", :type => :boolean, :aliases => strict_is_update ? [] : %w[--strict], :banner =>
- "Only list newer versions allowed by your Gemfile requirements"
- method_option "update-strict", :type => :boolean, :aliases => strict_is_update ? %w[--strict] : [], :banner =>
- "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
- method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
- method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
- method_option "patch", :type => :boolean, :banner => "Prefer updating only to next patch version"
- method_option "filter-major", :type => :boolean, :banner => "Only list major newer versions"
- method_option "filter-minor", :type => :boolean, :banner => "Only list minor newer versions"
- method_option "filter-patch", :type => :boolean, :banner => "Only list patch newer versions"
- method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
- "Use minimal formatting for more parseable output"
- method_option "only-explicit", :type => :boolean, :banner =>
- "Only list gems specified in your Gemfile, not their dependencies"
- def outdated(*gems)
- require_relative "cli/outdated"
- Outdated.new(options, gems).run
- end
-
- desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
- unless Bundler.feature_flag.cache_all?
- method_option "all", :type => :boolean,
- :banner => "Include all sources (including path and git)."
- end
- method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
- method_option "cache-path", :type => :string, :banner =>
- "Specify a different cache path than the default (vendor/cache)."
- method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
- method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only update the cache."
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
- method_option "path", :type => :string, :banner =>
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
- method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
- method_option "frozen", :type => :boolean, :banner =>
- "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
- long_desc <<-D
- The cache command will copy the .gem files for every gem in the bundle into the
- directory ./vendor/cache. If you then check that directory into your source
- control repository, others who check out your source will be able to install the
- bundle without having to download any additional gems.
- D
- def cache
- require_relative "cli/cache"
- Cache.new(options).run
- end
-
- map aliases_for("cache")
-
- desc "exec [OPTIONS]", "Run the command in context of the bundle"
- method_option :keep_file_descriptors, :type => :boolean, :default => false
- method_option :gemfile, :type => :string, :required => false
- long_desc <<-D
- Exec runs a command, providing it access to the gems in the bundle. While using
- bundle exec you can require and call the bundled gems as if they were installed
- into the system wide RubyGems repository.
- D
- def exec(*args)
- require_relative "cli/exec"
- Exec.new(options, args).run
- end
-
- map aliases_for("exec")
-
- desc "config NAME [VALUE]", "Retrieve or set a configuration value"
- long_desc <<-D
- Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
- existing value with the newly provided one.
-
- By default, setting a configuration value sets it for all projects
- on the machine.
-
- If a global setting is superceded by local configuration, this command
- will show the current value, as well as any superceded values and
- where they were specified.
- D
- require_relative "cli/config"
- subcommand "config", Config
-
- desc "open GEM", "Opens the source directory of the given bundled gem"
- def open(name)
- require_relative "cli/open"
- Open.new(options, name).run
- end
-
- unless Bundler.feature_flag.bundler_3_mode?
- desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
- def console(group = nil)
- require_relative "cli/console"
- Console.new(options, group).run
- end
- end
-
- desc "version", "Prints the bundler's version information"
- def version
- cli_help = current_command.name == "cli_help"
- if cli_help || ARGV.include?("version")
- build_info = " (#{BuildMetadata.built_at} commit #{BuildMetadata.git_commit_sha})"
- end
-
- if !cli_help && Bundler.feature_flag.print_only_version_number?
- Bundler.ui.info "#{Bundler::VERSION}#{build_info}"
- else
- Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
- end
- end
-
- map aliases_for("version")
-
- desc "licenses", "Prints the license of all gems in the bundle"
- def licenses
- Bundler.load.specs.sort_by {|s| s.license.to_s }.reverse_each do |s|
- gem_name = s.name
- license = s.license || s.licenses
-
- if license.empty?
- Bundler.ui.warn "#{gem_name}: Unknown"
- else
- Bundler.ui.info "#{gem_name}: #{license}"
- end
- end
- end
-
- unless Bundler.feature_flag.bundler_3_mode?
- desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
- long_desc <<-D
- Viz generates a PNG file of the current Gemfile as a dependency graph.
- Viz requires the ruby-graphviz gem (and its dependencies).
- The associated gems must also be installed via 'bundle install'.
- D
- method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
- method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
- method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
- method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
- method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
- def viz
- SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
- require_relative "cli/viz"
- Viz.new(options.dup).run
- end
- end
-
- old_gem = instance_method(:gem)
-
- desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
- method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
- method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set gem.coc true`."
- method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
- :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
- :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
- method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
- method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
- method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
- method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
- :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config set gem.test rspec`."
- def gem(name)
- end
-
- commands["gem"].tap do |gem_command|
- def gem_command.run(instance, args = [])
- arity = 1 # name
-
- require_relative "cli/gem"
- cmd_args = args + [instance]
- cmd_args.unshift(instance.options)
-
- cmd = begin
- Gem.new(*cmd_args)
- rescue ArgumentError => e
- instance.class.handle_argument_error(self, e, args, arity)
- end
-
- cmd.run
- end
- end
-
- undef_method(:gem)
- define_method(:gem, old_gem)
- private :gem
-
- def self.source_root
- File.expand_path(File.join(File.dirname(__FILE__), "templates"))
- end
-
- desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
- method_option "dry-run", :type => :boolean, :default => false, :banner =>
- "Only print out changes, do not clean gems"
- method_option "force", :type => :boolean, :default => false, :banner =>
- "Forces clean even if --path is not set"
- def clean
- require_relative "cli/clean"
- Clean.new(options.dup).run
- end
-
- desc "platform [OPTIONS]", "Displays platform compatibility information"
- method_option "ruby", :type => :boolean, :default => false, :banner =>
- "only display ruby related platform information"
- def platform
- require_relative "cli/platform"
- Platform.new(options).run
- end
-
- desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :hide => true
- method_option "source", :type => :string, :banner =>
- "Install gem from the given source"
- method_option "group", :type => :string, :banner =>
- "Install gem into a bundler group"
- def inject(name, version)
- SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
- require_relative "cli/inject"
- Inject.new(options.dup, name, version).run
- end
-
- desc "lock", "Creates a lockfile without installing"
- method_option "update", :type => :array, :lazy_default => true, :banner =>
- "ignore the existing lockfile, update all gems by default, or update list of given gems"
- method_option "local", :type => :boolean, :default => false, :banner =>
- "do not attempt to fetch remote gemspecs and use the local gem cache only"
- method_option "print", :type => :boolean, :default => false, :banner =>
- "print the lockfile to STDOUT instead of writing to the file system"
- method_option "gemfile", :type => :string, :banner =>
- "Use the specified gemfile instead of Gemfile"
- method_option "lockfile", :type => :string, :default => nil, :banner =>
- "the path the lockfile should be written to"
- method_option "full-index", :type => :boolean, :default => false, :banner =>
- "Fall back to using the single-file index of all gems"
- method_option "add-platform", :type => :array, :default => [], :banner =>
- "Add a new platform to the lockfile"
- method_option "remove-platform", :type => :array, :default => [], :banner =>
- "Remove a platform from the lockfile"
- method_option "patch", :type => :boolean, :banner =>
- "If updating, prefer updating only to next patch version"
- method_option "minor", :type => :boolean, :banner =>
- "If updating, prefer updating only to next minor version"
- method_option "major", :type => :boolean, :banner =>
- "If updating, prefer updating to next major version (default)"
- method_option "strict", :type => :boolean, :banner =>
- "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
- method_option "conservative", :type => :boolean, :banner =>
- "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
- def lock
- require_relative "cli/lock"
- Lock.new(options).run
- end
-
- desc "env", "Print information about the environment Bundler is running under"
- def env
- Env.write($stdout)
- end
-
- desc "doctor [OPTIONS]", "Checks the bundle for common problems"
- long_desc <<-D
- Doctor scans the OS dependencies of each of the gems requested in the Gemfile. If
- missing dependencies are detected, Bundler prints them and exits status 1.
- Otherwise, Bundler prints a success message and exits with a status of 0.
- D
- method_option "gemfile", :type => :string, :banner =>
- "Use the specified gemfile instead of Gemfile"
- method_option "quiet", :type => :boolean, :banner =>
- "Only output warnings and errors."
- def doctor
- require_relative "cli/doctor"
- Doctor.new(options).run
- end
-
- desc "issue", "Learn how to report an issue in Bundler"
- def issue
- require_relative "cli/issue"
- Issue.new.run
- end
-
- desc "pristine [GEMS...]", "Restores installed gems to pristine condition"
- long_desc <<-D
- Restores installed gems to pristine condition from files located in the
- gem cache. Gems installed from a git repository will be issued `git
- checkout --force`.
- D
- def pristine(*gems)
- require_relative "cli/pristine"
- Pristine.new(gems).run
- end
-
- if Bundler.feature_flag.plugins?
- require_relative "cli/plugin"
- desc "plugin", "Manage the bundler plugins"
- subcommand "plugin", Plugin
- end
-
- # Reformat the arguments passed to bundle that include a --help flag
- # into the corresponding `bundle help #{command}` call
- def self.reformatted_help_args(args)
- bundler_commands = (COMMAND_ALIASES.keys + COMMAND_ALIASES.values).flatten
-
- help_flags = %w[--help -h]
- exec_commands = ["exec"] + COMMAND_ALIASES["exec"]
-
- help_used = args.index {|a| help_flags.include? a }
- exec_used = args.index {|a| exec_commands.include? a }
-
- command = args.find {|a| bundler_commands.include? a }
- command = all_aliases[command] if all_aliases[command]
-
- if exec_used && help_used
- if exec_used + help_used == 1
- %w[help exec]
- else
- args
- end
- elsif help_used
- args = args.dup
- args.delete_at(help_used)
- ["help", command || args].flatten.compact
- else
- args
- end
- end
-
- private
-
- # Automatically invoke `bundle install` and resume if
- # Bundler.settings[:auto_install] exists. This is set through config cmd
- # `bundle config set auto_install 1`.
- #
- # Note that this method `nil`s out the global Definition object, so it
- # should be called first, before you instantiate anything like an
- # `Installer` that'll keep a reference to the old one instead.
- def auto_install
- return unless Bundler.settings[:auto_install]
-
- begin
- Bundler.definition.specs
- rescue GemNotFound
- Bundler.ui.info "Automatically installing missing gems."
- Bundler.reset!
- invoke :install, []
- Bundler.reset!
- end
- end
-
- def current_command
- _, _, config = @_initializer
- config[:current_command]
- end
-
- def print_command
- return unless Bundler.ui.debug?
- cmd = current_command
- command_name = cmd.name
- return if PARSEABLE_COMMANDS.include?(command_name)
- command = ["bundle", command_name] + args
- options_to_print = options.dup
- options_to_print.delete_if do |k, v|
- next unless o = cmd.options[k]
- o.default == v
- end
- command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
- command.reject!(&:empty?)
- Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
- end
-
- def warn_on_outdated_bundler
- return if Bundler.settings[:disable_version_check]
-
- command_name = current_command.name
- return if PARSEABLE_COMMANDS.include?(command_name)
-
- return unless SharedHelpers.md5_available?
-
- latest = Fetcher::CompactIndex.
- new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
- send(:compact_index_client).
- instance_variable_get(:@cache).
- dependencies("bundler").
- map {|d| Gem::Version.new(d.first) }.
- max
- return unless latest
-
- current = Gem::Version.new(VERSION)
- return if current >= latest
- latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
-
- installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
- if latest_installed && latest_installed > current
- suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
- suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
- else
- suggestion = installation
- end
-
- Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
- rescue RuntimeError
- nil
- end
-
- def remembered_flag_deprecation(name)
- option = current_command.options[name]
- flag_name = option.switch_name
-
- name_index = ARGV.find {|arg| flag_name == arg }
- return unless name_index
-
- value = options[name]
- value = value.join(" ").to_s if option.type == :array
-
- Bundler::SharedHelpers.major_deprecation 2,\
- "The `#{flag_name}` flag is deprecated because it relies on being " \
- "remembered across bundler invocations, which bundler will no longer " \
- "do in future versions. Instead please use `bundle config set #{name} " \
- "'#{value}'`, and stop using this flag"
- end
- end
-end
diff --git a/lib/bundler/cli/add.rb b/lib/bundler/cli/add.rb
deleted file mode 100644
index 07b951f1ef..0000000000
--- a/lib/bundler/cli/add.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Add
- attr_reader :gems, :options, :version
-
- def initialize(options, gems)
- @gems = gems
- @options = options
- @options[:group] = options[:group].split(",").map(&:strip) unless options[:group].nil?
- @version = options[:version].split(",").map(&:strip) unless options[:version].nil?
- end
-
- def run
- validate_options!
- inject_dependencies
- perform_bundle_install unless options["skip-install"]
- end
-
- private
-
- def perform_bundle_install
- Installer.install(Bundler.root, Bundler.definition)
- Bundler.load.cache if Bundler.app_cache.exist?
- end
-
- def inject_dependencies
- dependencies = gems.map {|g| Bundler::Dependency.new(g, version, options) }
-
- Injector.inject(dependencies,
- :conservative_versioning => options[:version].nil?, # Perform conservative versioning only when version is not specified
- :optimistic => options[:optimistic],
- :strict => options[:strict])
- end
-
- def validate_options!
- raise InvalidOption, "You can not specify `--strict` and `--optimistic` at the same time." if options[:strict] && options[:optimistic]
-
- # raise error when no gems are specified
- raise InvalidOption, "Please specify gems to add." if gems.empty?
-
- version.to_a.each do |v|
- raise InvalidOption, "Invalid gem requirement pattern '#{v}'" unless Gem::Requirement::PATTERN =~ v.to_s
- end
- end
- end
-end
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb
deleted file mode 100644
index 266396eedc..0000000000
--- a/lib/bundler/cli/binstubs.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Binstubs
- attr_reader :options, :gems
- def initialize(options, gems)
- @options = options
- @gems = gems
- end
-
- def run
- Bundler.definition.validate_runtime!
- path_option = options["path"]
- path_option = nil if path_option && path_option.empty?
- Bundler.settings.set_command_option :bin, path_option if options["path"]
- Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
- installer = Installer.new(Bundler.root, Bundler.definition)
-
- installer_opts = { :force => options[:force], :binstubs_cmd => true }
-
- if options[:all]
- raise InvalidOption, "Cannot specify --all with specific gems" unless gems.empty?
- @gems = Bundler.definition.specs.map(&:name)
- installer_opts.delete(:binstubs_cmd)
- elsif gems.empty?
- Bundler.ui.error "`bundle binstubs` needs at least one gem to run."
- exit 1
- end
-
- gems.each do |gem_name|
- spec = Bundler.definition.specs.find {|s| s.name == gem_name }
- unless spec
- raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(
- gem_name, Bundler.definition.specs
- )
- end
-
- if options[:standalone]
- next Bundler.ui.warn("Sorry, Bundler can only be run via RubyGems.") if gem_name == "bundler"
- Bundler.settings.temporary(:path => (Bundler.settings[:path] || Bundler.root)) do
- installer.generate_standalone_bundler_executable_stubs(spec)
- end
- else
- installer.generate_bundler_executable_stubs(spec, installer_opts)
- end
- end
- end
- end
-end
diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb
deleted file mode 100644
index 5e8420990f..0000000000
--- a/lib/bundler/cli/cache.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Cache
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def run
- Bundler.ui.level = "error" if options[:quiet]
- Bundler.settings.set_command_option_if_given :path, options[:path]
- Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
-
- setup_cache_all
- install
-
- # TODO: move cache contents here now that all bundles are locked
- custom_path = Bundler.settings[:path] if options[:path]
-
- Bundler.settings.temporary(:cache_all_platforms => options["all-platforms"]) do
- Bundler.load.cache(custom_path)
- end
- end
-
- private
-
- def install
- require_relative "install"
- options = self.options.dup
- options["local"] = false if Bundler.settings[:cache_all_platforms]
- Bundler::CLI::Install.new(options).run
- end
-
- def setup_cache_all
- all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
-
- Bundler.settings.set_command_option_if_given :cache_all, all
-
- if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
- Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
- "to cache them as well, please pass the --all flag. This will be the default " \
- "on Bundler 3.0."
- end
- end
- end
-end
diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb
deleted file mode 100644
index 19c0aaea06..0000000000
--- a/lib/bundler/cli/check.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Check
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def run
- Bundler.settings.set_command_option_if_given :path, options[:path]
-
- begin
- definition = Bundler.definition
- definition.validate_runtime!
- not_installed = definition.missing_specs
- rescue GemNotFound, VersionConflict
- Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
- Bundler.ui.warn "Install missing gems with `bundle install`."
- exit 1
- end
-
- if not_installed.any?
- Bundler.ui.error "The following gems are missing"
- not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
- Bundler.ui.warn "Install missing gems with `bundle install`"
- exit 1
- elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
- Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
- exit 1
- else
- Bundler.load.lock(:preserve_unknown_sections => true) unless options[:"dry-run"]
- Bundler.ui.info "The Gemfile's dependencies are satisfied"
- end
- end
- end
-end
diff --git a/lib/bundler/cli/clean.rb b/lib/bundler/cli/clean.rb
deleted file mode 100644
index 4a407fbae7..0000000000
--- a/lib/bundler/cli/clean.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Clean
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def run
- require_path_or_force unless options[:"dry-run"]
- Bundler.load.clean(options[:"dry-run"])
- end
-
- protected
-
- def require_path_or_force
- return unless Bundler.use_system_gems? && !options[:force]
- raise InvalidOption, "Cleaning all the gems on your system is dangerous! " \
- "If you're sure you want to remove every system gem not in this " \
- "bundle, run `bundle clean --force`."
- end
- end
-end
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb
deleted file mode 100644
index cec7bcadb4..0000000000
--- a/lib/bundler/cli/common.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module CLI::Common
- def self.output_post_install_messages(messages)
- return if Bundler.settings["ignore_messages"]
- messages.to_a.each do |name, msg|
- print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
- end
- end
-
- def self.print_post_install_message(name, msg)
- Bundler.ui.confirm "Post-install message from #{name}:"
- Bundler.ui.info msg
- end
-
- def self.output_without_groups_message(command)
- return if Bundler.settings[:without].empty?
- Bundler.ui.confirm without_groups_message(command)
- end
-
- def self.without_groups_message(command)
- command_in_past_tense = command == :install ? "installed" : "updated"
- groups = Bundler.settings[:without]
- group_list = [groups[0...-1].join(", "), groups[-1..-1]].
- reject {|s| s.to_s.empty? }.join(" and ")
- group_str = groups.size == 1 ? "group" : "groups"
- "Gems in the #{group_str} #{group_list} were not #{command_in_past_tense}."
- end
-
- def self.select_spec(name, regex_match = nil)
- specs = []
- regexp = Regexp.new(name) if regex_match
-
- Bundler.definition.specs.each do |spec|
- return spec if spec.name == name
- specs << spec if regexp && spec.name =~ regexp
- end
-
- case specs.count
- when 0
- raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
- when 1
- specs.first
- else
- ask_for_spec_from(specs)
- end
- rescue RegexpError
- raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
- end
-
- def self.ask_for_spec_from(specs)
- specs.each_with_index do |spec, index|
- Bundler.ui.info "#{index.succ} : #{spec.name}", true
- end
- Bundler.ui.info "0 : - exit -", true
-
- num = Bundler.ui.ask("> ").to_i
- num > 0 ? specs[num - 1] : nil
- end
-
- def self.gem_not_found_message(missing_gem_name, alternatives)
- require_relative "../similarity_detector"
- message = "Could not find gem '#{missing_gem_name}'."
- alternate_names = alternatives.map {|a| a.respond_to?(:name) ? a.name : a }
- suggestions = SimilarityDetector.new(alternate_names).similar_word_list(missing_gem_name)
- message += "\nDid you mean #{suggestions}?" if suggestions
- message
- end
-
- def self.ensure_all_gems_in_lockfile!(names, locked_gems = Bundler.locked_gems)
- locked_names = locked_gems.specs.map(&:name).uniq
- names.-(locked_names).each do |g|
- raise GemNotFound, gem_not_found_message(g, locked_names)
- end
- end
-
- def self.configure_gem_version_promoter(definition, options)
- patch_level = patch_level_options(options)
- patch_level << :patch if patch_level.empty? && Bundler.settings[:prefer_patch]
- raise InvalidOption, "Provide only one of the following options: #{patch_level.join(", ")}" unless patch_level.length <= 1
-
- definition.gem_version_promoter.tap do |gvp|
- gvp.level = patch_level.first || :major
- gvp.strict = options[:strict] || options["update-strict"] || options["filter-strict"]
- end
- end
-
- def self.patch_level_options(options)
- [:major, :minor, :patch].select {|v| options.keys.include?(v.to_s) }
- end
-
- def self.clean_after_install?
- clean = Bundler.settings[:clean]
- return clean unless clean.nil?
- clean ||= Bundler.feature_flag.auto_clean_without_path? && Bundler.settings[:path].nil?
- clean &&= !Bundler.use_system_gems?
- clean
- end
- end
-end
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
deleted file mode 100644
index 8d2aba0916..0000000000
--- a/lib/bundler/cli/config.rb
+++ /dev/null
@@ -1,194 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Config < Thor
- class_option :parseable, :type => :boolean, :banner => "Use minimal formatting for more parseable output"
-
- def self.scope_options
- method_option :global, :type => :boolean, :banner => "Only change the global config"
- method_option :local, :type => :boolean, :banner => "Only change the local config"
- end
- private_class_method :scope_options
-
- desc "base NAME [VALUE]", "The Bundler 1 config interface", :hide => true
- scope_options
- method_option :delete, :type => :boolean, :banner => "delete"
- def base(name = nil, *value)
- new_args =
- if ARGV.size == 1
- ["config", "list"]
- elsif ARGV.include?("--delete")
- ARGV.map {|arg| arg == "--delete" ? "unset" : arg }
- elsif ARGV.include?("--global") || ARGV.include?("--local") || ARGV.size == 3
- ["config", "set", *ARGV[1..-1]]
- else
- ["config", "get", ARGV[1]]
- end
-
- SharedHelpers.major_deprecation 3,
- "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
-
- Base.new(options, name, value, self).run
- end
-
- desc "list", "List out all configured settings"
- def list
- Base.new(options, nil, nil, self).run
- end
-
- desc "get NAME", "Returns the value for the given key"
- def get(name)
- Base.new(options, name, nil, self).run
- end
-
- desc "set NAME VALUE", "Sets the given value for the given key"
- scope_options
- def set(name, value, *value_)
- Base.new(options, name, value_.unshift(value), self).run
- end
-
- desc "unset NAME", "Unsets the value for the given key"
- scope_options
- def unset(name)
- options[:delete] = true
- Base.new(options, name, nil, self).run
- end
-
- default_task :base
-
- class Base
- attr_reader :name, :value, :options, :scope, :thor
-
- def initialize(options, name, value, thor)
- @options = options
- @name = name
- value = Array(value)
- @value = value.empty? ? nil : value.join(" ")
- @thor = thor
- validate_scope!
- end
-
- def run
- unless name
- warn_unused_scope "Ignoring --#{scope}"
- confirm_all
- return
- end
-
- if options[:delete]
- if !explicit_scope? || scope != "global"
- Bundler.settings.set_local(name, nil)
- end
- if !explicit_scope? || scope != "local"
- Bundler.settings.set_global(name, nil)
- end
- return
- end
-
- if value.nil?
- warn_unused_scope "Ignoring --#{scope} since no value to set was given"
-
- if options[:parseable]
- if value = Bundler.settings[name]
- Bundler.ui.info("#{name}=#{value}")
- end
- return
- end
-
- confirm(name)
- return
- end
-
- Bundler.ui.info(message) if message
- Bundler.settings.send("set_#{scope}", name, new_value)
- end
-
- def confirm_all
- if @options[:parseable]
- thor.with_padding do
- Bundler.settings.all.each do |setting|
- val = Bundler.settings[setting]
- Bundler.ui.info "#{setting}=#{val}"
- end
- end
- else
- Bundler.ui.confirm "Settings are listed in order of priority. The top value will be used.\n"
- Bundler.settings.all.each do |setting|
- Bundler.ui.confirm setting
- show_pretty_values_for(setting)
- Bundler.ui.confirm ""
- end
- end
- end
-
- def confirm(name)
- Bundler.ui.confirm "Settings for `#{name}` in order of priority. The top value will be used"
- show_pretty_values_for(name)
- end
-
- def new_value
- pathname = Pathname.new(value)
- if name.start_with?("local.") && pathname.directory?
- pathname.expand_path.to_s
- else
- value
- end
- end
-
- def message
- locations = Bundler.settings.locations(name)
- if @options[:parseable]
- "#{name}=#{new_value}" if new_value
- elsif scope == "global"
- if !locations[:local].nil?
- "Your application has set #{name} to #{locations[:local].inspect}. " \
- "This will override the global value you are currently setting"
- elsif locations[:env]
- "You have a bundler environment variable for #{name} set to " \
- "#{locations[:env].inspect}. This will take precedence over the global value you are setting"
- elsif !locations[:global].nil? && locations[:global] != value
- "You are replacing the current global value of #{name}, which is currently " \
- "#{locations[:global].inspect}"
- end
- elsif scope == "local" && !locations[:local].nil? && locations[:local] != value
- "You are replacing the current local value of #{name}, which is currently " \
- "#{locations[:local].inspect}"
- end
- end
-
- def show_pretty_values_for(setting)
- thor.with_padding do
- Bundler.settings.pretty_values_for(setting).each do |line|
- Bundler.ui.info line
- end
- end
- end
-
- def explicit_scope?
- @explicit_scope
- end
-
- def warn_unused_scope(msg)
- return unless explicit_scope?
- return if options[:parseable]
-
- Bundler.ui.warn(msg)
- end
-
- def validate_scope!
- @explicit_scope = true
- scopes = %w[global local].select {|s| options[s] }
- case scopes.size
- when 0
- @scope = "global"
- @explicit_scope = false
- when 1
- @scope = scopes.first
- else
- raise InvalidOption,
- "The options #{scopes.join " and "} were specified. Please only use one of the switches at a time."
- end
- end
- end
- end
-end
diff --git a/lib/bundler/cli/console.rb b/lib/bundler/cli/console.rb
deleted file mode 100644
index 6e0dfe28af..0000000000
--- a/lib/bundler/cli/console.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Console
- attr_reader :options, :group
- def initialize(options, group)
- @options = options
- @group = group
- end
-
- def run
- Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \
- "by `bin/console` generated by `bundle gem <name>`"
-
- group ? Bundler.require(:default, *group.split.map!(&:to_sym)) : Bundler.require
- ARGV.clear
-
- console = get_console(Bundler.settings[:console] || "irb")
- console.start
- end
-
- def get_console(name)
- require name
- get_constant(name)
- rescue LoadError
- Bundler.ui.error "Couldn't load console #{name}, falling back to irb"
- require "irb"
- get_constant("irb")
- end
-
- def get_constant(name)
- const_name = {
- "pry" => :Pry,
- "ripl" => :Ripl,
- "irb" => :IRB,
- }[name]
- Object.const_get(const_name)
- rescue NameError
- Bundler.ui.error "Could not find constant #{const_name}"
- exit 1
- end
- end
-end
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb
deleted file mode 100644
index fcf139ed1e..0000000000
--- a/lib/bundler/cli/doctor.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-# frozen_string_literal: true
-
-require "rbconfig"
-
-module Bundler
- class CLI::Doctor
- DARWIN_REGEX = /\s+(.+) \(compatibility /.freeze
- LDD_REGEX = /\t\S+ => (\S+) \(\S+\)/.freeze
-
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def otool_available?
- Bundler.which("otool")
- end
-
- def ldd_available?
- Bundler.which("ldd")
- end
-
- def dylibs_darwin(path)
- output = `/usr/bin/otool -L "#{path}"`.chomp
- dylibs = output.split("\n")[1..-1].map {|l| l.match(DARWIN_REGEX).captures[0] }.uniq
- # ignore @rpath and friends
- dylibs.reject {|dylib| dylib.start_with? "@" }
- end
-
- def dylibs_ldd(path)
- output = `/usr/bin/ldd "#{path}"`.chomp
- output.split("\n").map do |l|
- match = l.match(LDD_REGEX)
- next if match.nil?
- match.captures[0]
- end.compact
- end
-
- def dylibs(path)
- case RbConfig::CONFIG["host_os"]
- when /darwin/
- return [] unless otool_available?
- dylibs_darwin(path)
- when /(linux|solaris|bsd)/
- return [] unless ldd_available?
- dylibs_ldd(path)
- else # Windows, etc.
- Bundler.ui.warn("Dynamic library check not supported on this platform.")
- []
- end
- end
-
- def bundles_for_gem(spec)
- Dir.glob("#{spec.full_gem_path}/**/*.bundle")
- end
-
- def check!
- require_relative "check"
- Bundler::CLI::Check.new({}).run
- end
-
- def run
- Bundler.ui.level = "error" if options[:quiet]
- Bundler.settings.validate!
- check!
-
- definition = Bundler.definition
- broken_links = {}
-
- definition.specs.each do |spec|
- bundles_for_gem(spec).each do |bundle|
- bad_paths = dylibs(bundle).select {|f| !File.exist?(f) }
- if bad_paths.any?
- broken_links[spec] ||= []
- broken_links[spec].concat(bad_paths)
- end
- end
- end
-
- permissions_valid = check_home_permissions
-
- if broken_links.any?
- message = "The following gems are missing OS dependencies:"
- broken_links.map do |spec, paths|
- paths.uniq.map do |path|
- "\n * #{spec.name}: #{path}"
- end
- end.flatten.sort.each {|m| message += m }
- raise ProductionError, message
- elsif !permissions_valid
- Bundler.ui.info "No issues found with the installed bundle"
- end
- end
-
- private
-
- def check_home_permissions
- require "find"
- files_not_readable_or_writable = []
- files_not_rw_and_owned_by_different_user = []
- files_not_owned_by_current_user_but_still_rw = []
- Find.find(Bundler.bundle_path.to_s).each do |f|
- if !File.writable?(f) || !File.readable?(f)
- if File.stat(f).uid != Process.uid
- files_not_rw_and_owned_by_different_user << f
- else
- files_not_readable_or_writable << f
- end
- elsif File.stat(f).uid != Process.uid
- files_not_owned_by_current_user_but_still_rw << f
- end
- end
-
- ok = true
- if files_not_owned_by_current_user_but_still_rw.any?
- Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
- "user, but are still readable/writable. These files are:\n - #{files_not_owned_by_current_user_but_still_rw.join("\n - ")}"
-
- ok = false
- end
-
- if files_not_rw_and_owned_by_different_user.any?
- Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
- "user, and are not readable/writable. These files are:\n - #{files_not_rw_and_owned_by_different_user.join("\n - ")}"
-
- ok = false
- end
-
- if files_not_readable_or_writable.any?
- Bundler.ui.warn "Files exist in the Bundler home that are not " \
- "readable/writable by the current user. These files are:\n - #{files_not_readable_or_writable.join("\n - ")}"
-
- ok = false
- end
-
- ok
- end
- end
-end
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb
deleted file mode 100644
index 0a1edbdbbd..0000000000
--- a/lib/bundler/cli/exec.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../current_ruby"
-
-module Bundler
- class CLI::Exec
- attr_reader :options, :args, :cmd
-
- TRAPPED_SIGNALS = %w[INT].freeze
-
- def initialize(options, args)
- @options = options
- @cmd = args.shift
- @args = args
-
- if !Bundler.current_ruby.jruby?
- @args << { :close_others => !options.keep_file_descriptors? }
- elsif options.keep_file_descriptors?
- Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
- end
- end
-
- def run
- validate_cmd!
- SharedHelpers.set_bundle_environment
- if bin_path = Bundler.which(cmd)
- if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
- return kernel_load(bin_path, *args)
- end
- kernel_exec(bin_path, *args)
- else
- # exec using the given command
- kernel_exec(cmd, *args)
- end
- end
-
- private
-
- def validate_cmd!
- return unless cmd.nil?
- Bundler.ui.error "bundler: exec needs a command to run"
- exit 128
- end
-
- def kernel_exec(*args)
- Kernel.exec(*args)
- rescue Errno::EACCES, Errno::ENOEXEC
- Bundler.ui.error "bundler: not executable: #{cmd}"
- exit 126
- rescue Errno::ENOENT
- Bundler.ui.error "bundler: command not found: #{cmd}"
- Bundler.ui.warn "Install missing gem executables with `bundle install`"
- exit 127
- end
-
- def kernel_load(file, *args)
- args.pop if args.last.is_a?(Hash)
- ARGV.replace(args)
- $0 = file
- Process.setproctitle(process_title(file, args)) if Process.respond_to?(:setproctitle)
- require_relative "../setup"
- TRAPPED_SIGNALS.each {|s| trap(s, "DEFAULT") }
- Kernel.load(file)
- rescue SystemExit, SignalException
- raise
- rescue Exception => e # rubocop:disable Lint/RescueException
- Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
- backtrace = e.backtrace ? e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) } : []
- abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
- end
-
- def process_title(file, args)
- "#{file} #{args.join(" ")}".strip
- end
-
- def ruby_shebang?(file)
- possibilities = [
- "#!/usr/bin/env ruby\n",
- "#!/usr/bin/env jruby\n",
- "#!/usr/bin/env truffleruby\n",
- "#!#{Gem.ruby}\n",
- ]
-
- if File.zero?(file)
- Bundler.ui.warn "#{file} is empty"
- return false
- end
-
- first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
- possibilities.any? {|shebang| first_line.start_with?(shebang) }
- end
- end
-end
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
deleted file mode 100644
index d3e5831759..0000000000
--- a/lib/bundler/cli/gem.rb
+++ /dev/null
@@ -1,252 +0,0 @@
-# frozen_string_literal: true
-
-require "pathname"
-
-module Bundler
- class CLI
- Bundler.require_thor_actions
- include Thor::Actions
- end
-
- class CLI::Gem
- TEST_FRAMEWORK_VERSIONS = {
- "rspec" => "3.0",
- "minitest" => "5.0",
- }.freeze
-
- attr_reader :options, :gem_name, :thor, :name, :target
-
- def initialize(options, gem_name, thor)
- @options = options
- @gem_name = resolve_name(gem_name)
-
- @thor = thor
- thor.behavior = :invoke
- thor.destination_root = nil
-
- @name = @gem_name
- @target = SharedHelpers.pwd.join(gem_name)
-
- validate_ext_name if options[:ext]
- end
-
- def run
- Bundler.ui.confirm "Creating gem '#{name}'..."
-
- underscored_name = name.tr("-", "_")
- namespaced_path = name.tr("-", "/")
- constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
- constant_array = constant_name.split("::")
-
- git_installed = Bundler.git_present?
-
- git_author_name = git_installed ? `git config user.name`.chomp : ""
- github_username = git_installed ? `git config github.user`.chomp : ""
- git_user_email = git_installed ? `git config user.email`.chomp : ""
-
- config = {
- :name => name,
- :underscored_name => underscored_name,
- :namespaced_path => namespaced_path,
- :makefile_path => "#{underscored_name}/#{underscored_name}",
- :constant_name => constant_name,
- :constant_array => constant_array,
- :author => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
- :email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
- :test => options[:test],
- :ext => options[:ext],
- :exe => options[:exe],
- :bundler_version => bundler_dependency_version,
- :github_username => github_username.empty? ? "[USERNAME]" : github_username,
- }
- ensure_safe_gem_name(name, constant_array)
-
- templates = {
- "Gemfile.tt" => "Gemfile",
- "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
- "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
- "newgem.gemspec.tt" => "#{name}.gemspec",
- "Rakefile.tt" => "Rakefile",
- "README.md.tt" => "README.md",
- "bin/console.tt" => "bin/console",
- "bin/setup.tt" => "bin/setup",
- }
-
- executables = %w[
- bin/console
- bin/setup
- ]
-
- templates.merge!("gitignore.tt" => ".gitignore") if Bundler.git_present?
-
- if test_framework = ask_and_set_test_framework
- config[:test] = test_framework
- config[:test_framework_version] = TEST_FRAMEWORK_VERSIONS[test_framework]
-
- templates.merge!("travis.yml.tt" => ".travis.yml")
-
- case test_framework
- when "rspec"
- templates.merge!(
- "rspec.tt" => ".rspec",
- "spec/spec_helper.rb.tt" => "spec/spec_helper.rb",
- "spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb"
- )
- when "minitest"
- templates.merge!(
- "test/test_helper.rb.tt" => "test/test_helper.rb",
- "test/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
- )
- end
- end
-
- config[:test_task] = config[:test] == "minitest" ? "test" : "spec"
-
- if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
- "This means that any other developer or company will be legally allowed to use your code " \
- "for free as long as they admit you created it. You can read more about the MIT license " \
- "at https://choosealicense.com/licenses/mit.")
- config[:mit] = true
- Bundler.ui.info "MIT License enabled in config"
- templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
- end
-
- if ask_and_set(:coc, "Do you want to include a code of conduct in gems you generate?",
- "Codes of conduct can increase contributions to your project by contributors who " \
- "prefer collaborative, safe spaces. You can read more about the code of conduct at " \
- "contributor-covenant.org. Having a code of conduct means agreeing to the responsibility " \
- "of enforcing it, so be sure that you are prepared to do that. Be sure that your email " \
- "address is specified as a contact in the generated code of conduct so that people know " \
- "who to contact in case of a violation. For suggestions about " \
- "how to enforce codes of conduct, see https://bit.ly/coc-enforcement.")
- config[:coc] = true
- Bundler.ui.info "Code of conduct enabled in config"
- templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
- end
-
- templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
-
- if options[:ext]
- templates.merge!(
- "ext/newgem/extconf.rb.tt" => "ext/#{name}/extconf.rb",
- "ext/newgem/newgem.h.tt" => "ext/#{name}/#{underscored_name}.h",
- "ext/newgem/newgem.c.tt" => "ext/#{name}/#{underscored_name}.c"
- )
- end
-
- templates.each do |src, dst|
- destination = target.join(dst)
- SharedHelpers.filesystem_access(destination) do
- thor.template("newgem/#{src}", destination, config)
- end
- end
-
- executables.each do |file|
- SharedHelpers.filesystem_access(target.join(file)) do |path|
- executable = (path.stat.mode | 0o111)
- path.chmod(executable)
- end
- end
-
- if Bundler.git_present? && options[:git]
- Bundler.ui.info "Initializing git repo in #{target}"
- Dir.chdir(target) do
- `git init`
- `git add .`
- end
- end
-
- # Open gemspec in editor
- open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
-
- Bundler.ui.info "Gem '#{name}' was successfully created. " \
- "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
- rescue Errno::EEXIST => e
- raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
- end
-
- private
-
- def resolve_name(name)
- SharedHelpers.pwd.join(name).basename.to_s
- end
-
- def ask_and_set(key, header, message)
- choice = options[key]
- choice = Bundler.settings["gem.#{key}"] if choice.nil?
-
- if choice.nil?
- Bundler.ui.confirm header
- choice = Bundler.ui.yes? "#{message} y/(n):"
- Bundler.settings.set_global("gem.#{key}", choice)
- end
-
- choice
- end
-
- def validate_ext_name
- return unless gem_name.index("-")
-
- Bundler.ui.error "You have specified a gem name which does not conform to the \n" \
- "naming guidelines for C extensions. For more information, \n" \
- "see the 'Extension Naming' section at the following URL:\n" \
- "https://guides.rubygems.org/gems-with-extensions/\n"
- exit 1
- end
-
- def ask_and_set_test_framework
- test_framework = options[:test] || Bundler.settings["gem.test"]
-
- if test_framework.nil?
- Bundler.ui.confirm "Do you want to generate tests with your gem?"
- result = Bundler.ui.ask "Type 'rspec' or 'minitest' to generate those test files now and " \
- "in the future. rspec/minitest/(none):"
- if result =~ /rspec|minitest/
- test_framework = result
- else
- test_framework = false
- end
- end
-
- if Bundler.settings["gem.test"].nil?
- Bundler.settings.set_global("gem.test", test_framework)
- end
-
- test_framework
- end
-
- def bundler_dependency_version
- v = Gem::Version.new(Bundler::VERSION)
- req = v.segments[0..1]
- req << "a" if v.prerelease?
- req.join(".")
- end
-
- def ensure_safe_gem_name(name, constant_array)
- if name =~ /^\d/
- Bundler.ui.error "Invalid gem name #{name} Please give a name which does not start with numbers."
- exit 1
- end
-
- constant_name = constant_array.join("::")
-
- existing_constant = constant_array.inject(Object) do |c, s|
- defined = begin
- c.const_defined?(s)
- rescue NameError
- Bundler.ui.error "Invalid gem name #{name} -- `#{constant_name}` is an invalid constant name"
- exit 1
- end
- (defined && c.const_get(s)) || break
- end
-
- return unless existing_constant
- Bundler.ui.error "Invalid gem name #{name} constant #{constant_name} is already in use. Please choose another gem name."
- exit 1
- end
-
- def open_editor(editor, file)
- thor.run(%(#{editor} "#{file}"))
- end
- end
-end
diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
deleted file mode 100644
index 4733675e8c..0000000000
--- a/lib/bundler/cli/info.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Info
- attr_reader :gem_name, :options
- def initialize(options, gem_name)
- @options = options
- @gem_name = gem_name
- end
-
- def run
- Bundler.ui.silence do
- Bundler.definition.validate_runtime!
- Bundler.load.lock
- end
-
- spec = spec_for_gem(gem_name)
-
- if spec
- return print_gem_path(spec) if @options[:path]
- print_gem_info(spec)
- end
- end
-
- private
-
- def spec_for_gem(gem_name)
- spec = Bundler.definition.specs.find {|s| s.name == gem_name }
- spec || default_gem_spec(gem_name) || Bundler::CLI::Common.select_spec(gem_name, :regex_match)
- end
-
- def default_gem_spec(gem_name)
- return unless Gem::Specification.respond_to?(:find_all_by_name)
- gem_spec = Gem::Specification.find_all_by_name(gem_name).last
- return gem_spec if gem_spec && gem_spec.respond_to?(:default_gem?) && gem_spec.default_gem?
- end
-
- def spec_not_found(gem_name)
- raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
- end
-
- def print_gem_path(spec)
- path = if spec.name == "bundler"
- File.expand_path("../../../..", __FILE__)
- else
- spec.full_gem_path
- end
-
- Bundler.ui.info path
- end
-
- def print_gem_info(spec)
- gem_info = String.new
- gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
- gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
- gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
- gem_info << "\tPath: #{spec.full_gem_path}\n"
- gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
- Bundler.ui.info gem_info
- end
- end
-end
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb
deleted file mode 100644
index 65dd08dfe9..0000000000
--- a/lib/bundler/cli/init.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Init
- attr_reader :options
- def initialize(options)
- @options = options
- end
-
- def run
- if File.exist?(gemfile)
- Bundler.ui.error "#{gemfile} already exists at #{File.expand_path(gemfile)}"
- exit 1
- end
-
- unless File.writable?(Dir.pwd)
- Bundler.ui.error "Can not create #{gemfile} as the current directory is not writable."
- exit 1
- end
-
- if options[:gemspec]
- gemspec = File.expand_path(options[:gemspec])
- unless File.exist?(gemspec)
- Bundler.ui.error "Gem specification #{gemspec} doesn't exist"
- exit 1
- end
-
- spec = Bundler.load_gemspec_uncached(gemspec)
-
- File.open(gemfile, "wb") do |file|
- file << "# Generated from #{gemspec}\n"
- file << spec.to_gemfile
- end
- else
- FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
- end
-
- puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
- end
-
- private
-
- def gemfile
- @gemfile ||= Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
- end
- end
-end
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb
deleted file mode 100644
index b00675d348..0000000000
--- a/lib/bundler/cli/inject.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Inject
- attr_reader :options, :name, :version, :group, :source, :gems
- def initialize(options, name, version)
- @options = options
- @name = name
- @version = version || last_version_number
- @group = options[:group].split(",") unless options[:group].nil?
- @source = options[:source]
- @gems = []
- end
-
- def run
- # The required arguments allow Thor to give useful feedback when the arguments
- # are incorrect. This adds those first two arguments onto the list as a whole.
- gems.unshift(source).unshift(group).unshift(version).unshift(name)
-
- # Build an array of Dependency objects out of the arguments
- deps = []
- # when `inject` support addition of more than one gem, then this loop will
- # help. Currently this loop is running once.
- gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
- ops = Gem::Requirement::OPS.map {|key, _val| key }
- has_op = ops.any? {|op| gem_version.start_with? op }
- gem_version = "~> #{gem_version}" unless has_op
- deps << Bundler::Dependency.new(gem_name, gem_version, "group" => gem_group, "source" => gem_source)
- end
-
- added = Injector.inject(deps, options)
-
- if added.any?
- Bundler.ui.confirm "Added to Gemfile:"
- Bundler.ui.confirm(added.map do |d|
- name = "'#{d.name}'"
- requirement = ", '#{d.requirement}'"
- group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
- source = ", :source => '#{d.source}'" unless d.source.nil?
- %(gem #{name}#{requirement}#{group}#{source})
- end.join("\n"))
- else
- Bundler.ui.confirm "All gems were already present in the Gemfile"
- end
- end
-
- private
-
- def last_version_number
- definition = Bundler.definition(true)
- definition.resolve_remotely!
- specs = definition.index[name].sort_by(&:version)
- unless options[:pre]
- specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
- end
- spec = specs.last
- spec.version.to_s
- end
- end
-end
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb
deleted file mode 100644
index d823fb632f..0000000000
--- a/lib/bundler/cli/install.rb
+++ /dev/null
@@ -1,218 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Install
- attr_reader :options
- def initialize(options)
- @options = options
- end
-
- def run
- Bundler.ui.level = "error" if options[:quiet]
-
- warn_if_root
-
- normalize_groups
-
- Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
-
- # Disable color in deployment mode
- Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
-
- check_for_options_conflicts
-
- check_trust_policy
-
- if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
- unless Bundler.default_lockfile.exist?
- flag = "--deployment flag" if options[:deployment]
- flag ||= "--frozen flag" if options[:frozen]
- flag ||= "deployment setting"
- raise ProductionError, "The #{flag} requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
- "sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
- "before deploying."
- end
-
- options[:local] = true if Bundler.app_cache.exist?
-
- if Bundler.feature_flag.deployment_means_frozen?
- Bundler.settings.set_command_option :deployment, true
- else
- Bundler.settings.set_command_option :frozen, true
- end
- end
-
- # When install is called with --no-deployment, disable deployment mode
- if options[:deployment] == false
- Bundler.settings.set_command_option :frozen, nil
- options[:system] = true
- end
-
- normalize_settings
-
- Bundler::Fetcher.disable_endpoint = options["full-index"]
-
- if options["binstubs"]
- Bundler::SharedHelpers.major_deprecation 2,
- "The --binstubs option will be removed in favor of `bundle binstubs`"
- end
-
- Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
-
- definition = Bundler.definition
- definition.validate_runtime!
-
- installer = Installer.install(Bundler.root, definition, options)
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
-
- Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
- Bundler::CLI::Common.output_without_groups_message(:install)
-
- if Bundler.use_system_gems?
- Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
- else
- relative_path = Bundler.configured_bundle_path.base_path_relative_to_pwd
- Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
- end
-
- Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
-
- warn_ambiguous_gems
-
- if CLI::Common.clean_after_install?
- require_relative "clean"
- Bundler::CLI::Clean.new(options).run
- end
- rescue GemNotFound, VersionConflict => e
- if options[:local] && Bundler.app_cache.exist?
- Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
- end
-
- unless Bundler.definition.has_rubygems_remotes?
- Bundler.ui.warn <<-WARN, :wrap => true
- Your Gemfile has no gem server sources. If you need gems that are \
- not already on your machine, add a line like this to your Gemfile:
- source 'https://rubygems.org'
- WARN
- end
- raise e
- rescue Gem::InvalidSpecificationException => e
- Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
- raise e
- end
-
- private
-
- def warn_if_root
- return if Bundler.settings[:silence_root_warning] || Bundler::WINDOWS || !Process.uid.zero?
- Bundler.ui.warn "Don't run Bundler as root. Bundler can ask for sudo " \
- "if it is needed, and installing your bundle as root will break this " \
- "application for all non-root users on this machine.", :wrap => true
- end
-
- def dependencies_count_for(definition)
- count = definition.dependencies.count
- "#{count} Gemfile #{count == 1 ? "dependency" : "dependencies"}"
- end
-
- def gems_installed_for(definition)
- count = definition.specs.count
- "#{count} #{count == 1 ? "gem" : "gems"} now installed"
- end
-
- def check_for_group_conflicts_in_cli_options
- conflicting_groups = Array(options[:without]) & Array(options[:with])
- return if conflicting_groups.empty?
- raise InvalidOption, "You can't list a group in both with and without." \
- " The offending groups are: #{conflicting_groups.join(", ")}."
- end
-
- def check_for_options_conflicts
- if (options[:path] || options[:deployment]) && options[:system]
- error_message = String.new
- error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path]
- error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment]
- raise InvalidOption.new(error_message)
- end
- end
-
- def check_trust_policy
- trust_policy = options["trust-policy"]
- unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy)
- raise InvalidOption, "RubyGems doesn't know about trust policy '#{trust_policy}'. " \
- "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
- end
- Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy
- end
-
- def normalize_groups
- options[:with] &&= options[:with].join(":").tr(" ", ":").split(":")
- options[:without] &&= options[:without].join(":").tr(" ", ":").split(":")
-
- check_for_group_conflicts_in_cli_options
-
- Bundler.settings.set_command_option :with, nil if options[:with] == []
- Bundler.settings.set_command_option :without, nil if options[:without] == []
-
- with = options.fetch(:with, [])
- with |= Bundler.settings[:with].map(&:to_s)
- with -= options[:without] if options[:without]
-
- without = options.fetch(:without, [])
- without |= Bundler.settings[:without].map(&:to_s)
- without -= options[:with] if options[:with]
-
- options[:with] = with
- options[:without] = without
- end
-
- def normalize_settings
- Bundler.settings.set_command_option :path, nil if options[:system]
- Bundler.settings.temporary(:path_relative_to_cwd => false) do
- Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
- end
- Bundler.settings.set_command_option_if_given :path, options[:path]
- Bundler.settings.temporary(:path_relative_to_cwd => false) do
- Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
- end
-
- bin_option = options["binstubs"]
- bin_option = nil if bin_option && bin_option.empty?
- Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
-
- Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
-
- Bundler.settings.set_command_option_if_given :jobs, options["jobs"]
-
- Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
-
- Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
-
- Bundler.settings.set_command_option_if_given :clean, options["clean"]
-
- unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
- # need to nil them out first to get around validation for backwards compatibility
- Bundler.settings.set_command_option :without, nil
- Bundler.settings.set_command_option :with, nil
- Bundler.settings.set_command_option :without, options[:without] - options[:with]
- Bundler.settings.set_command_option :with, options[:with]
- end
-
- options[:force] = options[:redownload]
- end
-
- def warn_ambiguous_gems
- # TODO: remove this when we drop Bundler 1.x support
- Installer.ambiguous_gems.to_a.each do |name, installed_from_uri, *also_found_in_uris|
- Bundler.ui.warn "Warning: the gem '#{name}' was found in multiple sources."
- Bundler.ui.warn "Installed from: #{installed_from_uri}"
- Bundler.ui.warn "Also found in:"
- also_found_in_uris.each {|uri| Bundler.ui.warn " * #{uri}" }
- Bundler.ui.warn "You should add a source requirement to restrict this gem to your preferred source."
- Bundler.ui.warn "For example:"
- Bundler.ui.warn " gem '#{name}', :source => '#{installed_from_uri}'"
- Bundler.ui.warn "Then uninstall the gem '#{name}' (or delete all bundled gems) and then install again."
- end
- end
- end
-end
diff --git a/lib/bundler/cli/issue.rb b/lib/bundler/cli/issue.rb
deleted file mode 100644
index 054ce76315..0000000000
--- a/lib/bundler/cli/issue.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-require "rbconfig"
-
-module Bundler
- class CLI::Issue
- def run
- Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
- Did you find an issue with Bundler? Before filing a new issue,
- be sure to check out these resources:
-
- 1. Check out our troubleshooting guide for quick fixes to common issues:
- https://github.com/bundler/bundler/blob/master/doc/TROUBLESHOOTING.md
-
- 2. Instructions for common Bundler uses can be found on the documentation
- site: https://bundler.io/
-
- 3. Information about each Bundler command can be found in the Bundler
- man pages: https://bundler.io/man/bundle.1.html
-
- Hopefully the troubleshooting steps above resolved your problem! If things
- still aren't working the way you expect them to, please let us know so
- that we can diagnose and help fix the problem you're having. Please
- view the Filing Issues guide for more information:
- https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md
-
- EOS
-
- Bundler.ui.info Bundler::Env.report
-
- Bundler.ui.info "\n## Bundle Doctor"
- doctor
- end
-
- def doctor
- require_relative "doctor"
- Bundler::CLI::Doctor.new({}).run
- end
- end
-end
diff --git a/lib/bundler/cli/list.rb b/lib/bundler/cli/list.rb
deleted file mode 100644
index d1799196e7..0000000000
--- a/lib/bundler/cli/list.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::List
- def initialize(options)
- @options = options
- end
-
- def run
- raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @options["only-group"] && @options["without-group"]
-
- raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths]
-
- specs = if @options["only-group"] || @options["without-group"]
- filtered_specs_by_groups
- else
- Bundler.load.specs
- end.reject {|s| s.name == "bundler" }.sort_by(&:name)
-
- return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
-
- return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
- return specs.each {|s| Bundler.ui.info s.full_gem_path } if @options["paths"]
-
- Bundler.ui.info "Gems included by the bundle:"
-
- specs.each {|s| Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})" }
-
- Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
- end
-
- private
-
- def verify_group_exists(groups)
- raise InvalidOption, "`#{@options["without-group"]}` group could not be found." if @options["without-group"] && !groups.include?(@options["without-group"].to_sym)
-
- raise InvalidOption, "`#{@options["only-group"]}` group could not be found." if @options["only-group"] && !groups.include?(@options["only-group"].to_sym)
- end
-
- def filtered_specs_by_groups
- definition = Bundler.definition
- groups = definition.groups
-
- verify_group_exists(groups)
-
- show_groups =
- if @options["without-group"]
- groups.reject {|g| g == @options["without-group"].to_sym }
- elsif @options["only-group"]
- groups.select {|g| g == @options["only-group"].to_sym }
- else
- groups
- end.map(&:to_sym)
-
- definition.specs_for(show_groups)
- end
- end
-end
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
deleted file mode 100644
index 7dd078b1ef..0000000000
--- a/lib/bundler/cli/lock.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Lock
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def run
- unless Bundler.default_gemfile
- Bundler.ui.error "Unable to find a Gemfile to lock"
- exit 1
- end
-
- print = options[:print]
- ui = Bundler.ui
- Bundler.ui = UI::Silent.new if print
-
- Bundler::Fetcher.disable_endpoint = options["full-index"]
-
- update = options[:update]
- if update.is_a?(Array) # unlocking specific gems
- Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
- update = { :gems => update, :lock_shared_dependencies => options[:conservative] }
- end
- definition = Bundler.definition(update)
-
- Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options) if options[:update]
-
- options["remove-platform"].each do |platform|
- definition.remove_platform(platform)
- end
-
- options["add-platform"].each do |platform_string|
- platform = Gem::Platform.new(platform_string)
- if platform.to_s == "unknown"
- Bundler.ui.warn "The platform `#{platform_string}` is unknown to RubyGems " \
- "and adding it will likely lead to resolution errors"
- end
- definition.add_platform(platform)
- end
-
- if definition.platforms.empty?
- raise InvalidOption, "Removing all platforms from the bundle is not allowed"
- end
-
- definition.resolve_remotely! unless options[:local]
-
- if print
- puts definition.to_lock
- else
- file = options[:lockfile]
- file = file ? File.expand_path(file) : Bundler.default_lockfile
- puts "Writing lockfile to #{file}"
- definition.lock(file)
- end
-
- Bundler.ui = ui
- end
- end
-end
diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb
deleted file mode 100644
index df32e2f38b..0000000000
--- a/lib/bundler/cli/open.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-require "shellwords"
-
-module Bundler
- class CLI::Open
- attr_reader :options, :name
- def initialize(options, name)
- @options = options
- @name = name
- end
-
- def run
- editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }
- return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
- return unless spec = Bundler::CLI::Common.select_spec(name, :regex_match)
- if spec.default_gem?
- Bundler.ui.info "Unable to open #{name} because it's a default gem, so the directory it would normally be installed to does not exist."
- else
- path = spec.full_gem_path
- Dir.chdir(path) do
- command = Shellwords.split(editor) + [path]
- Bundler.with_original_env do
- system(*command)
- end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
- end
- end
- end
- end
-end
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
deleted file mode 100644
index 0b710e9782..0000000000
--- a/lib/bundler/cli/outdated.rb
+++ /dev/null
@@ -1,270 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Outdated
- attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
- attr_accessor :outdated_gems_by_groups, :outdated_gems_list
-
- def initialize(options, gems)
- @options = options
- @gems = gems
- @sources = Array(options[:source])
-
- @filter_options_patch = options.keys &
- %w[filter-major filter-minor filter-patch]
-
- @outdated_gems_by_groups = {}
- @outdated_gems_list = []
-
- @options_include_groups = [:group, :groups].any? do |v|
- options.keys.include?(v.to_s)
- end
-
- # the patch level options imply strict is also true. It wouldn't make
- # sense otherwise.
- @strict = options["filter-strict"] ||
- Bundler::CLI::Common.patch_level_options(options).any?
- end
-
- def run
- check_for_deployment_mode!
-
- gems.each do |gem_name|
- Bundler::CLI::Common.select_spec(gem_name)
- end
-
- Bundler.definition.validate_runtime!
- current_specs = Bundler.ui.silence { Bundler.definition.resolve }
-
- current_dependencies = Bundler.ui.silence do
- Bundler.load.dependencies.map {|dep| [dep.name, dep] }.to_h
- end
-
- definition = if gems.empty? && sources.empty?
- # We're doing a full update
- Bundler.definition(true)
- else
- Bundler.definition(:gems => gems, :sources => sources)
- end
-
- Bundler::CLI::Common.configure_gem_version_promoter(
- Bundler.definition,
- options
- )
-
- definition_resolution = proc do
- options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
- end
-
- if options[:parseable]
- Bundler.ui.silence(&definition_resolution)
- else
- definition_resolution.call
- end
-
- Bundler.ui.info ""
-
- # Loop through the current specs
- gemfile_specs, dependency_specs = current_specs.partition do |spec|
- current_dependencies.key? spec.name
- end
-
- specs = if options["only-explicit"]
- gemfile_specs
- else
- gemfile_specs + dependency_specs
- end
-
- specs.sort_by(&:name).each do |current_spec|
- next if !gems.empty? && !gems.include?(current_spec.name)
-
- dependency = current_dependencies[current_spec.name]
- active_spec = retrieve_active_spec(definition, current_spec)
-
- next if active_spec.nil?
- next if filter_options_patch.any? &&
- !update_present_via_semver_portions(current_spec, active_spec, options)
-
- gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
- next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
- groups = nil
- if dependency && !options[:parseable]
- groups = dependency.groups.join(", ")
- end
-
- outdated_gems_list << { :active_spec => active_spec,
- :current_spec => current_spec,
- :dependency => dependency,
- :groups => groups }
-
- outdated_gems_by_groups[groups] ||= []
- outdated_gems_by_groups[groups] << outdated_gems_list[-1]
- end
-
- if outdated_gems_list.empty?
- display_nothing_outdated_message
- else
- unless options[:parseable]
- Bundler.ui.info(header_outdated_message)
- end
-
- if options_include_groups
- ordered_groups = outdated_gems_by_groups.keys.compact.sort
- ordered_groups.insert(0, nil).each do |groups|
- gems = outdated_gems_by_groups[groups]
- contains_group = if groups
- groups.split(", ").include?(options[:group])
- else
- options[:group] == "group"
- end
-
- next if (!options[:groups] && !contains_group) || gems.nil?
-
- unless options[:parseable]
- Bundler.ui.info(header_group_message(groups))
- end
-
- print_gems(gems)
- end
- else
- print_gems(outdated_gems_list)
- end
-
- exit 1
- end
- end
-
- private
-
- def groups_text(group_text, groups)
- "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
- end
-
- def header_outdated_message
- if options[:pre]
- "Outdated gems included in the bundle (including pre-releases):"
- else
- "Outdated gems included in the bundle:"
- end
- end
-
- def header_group_message(groups)
- if groups
- "===== #{groups_text("Group", groups)} ====="
- else
- "===== Without group ====="
- end
- end
-
- def nothing_outdated_message
- if filter_options_patch.any?
- display = filter_options_patch.map do |o|
- o.sub("filter-", "")
- end.join(" or ")
-
- "No #{display} updates to display.\n"
- else
- "Bundle up to date!\n"
- end
- end
-
- def retrieve_active_spec(definition, current_spec)
- if strict
- active_spec = definition.find_resolved_spec(current_spec)
- else
- active_specs = definition.find_indexed_specs(current_spec)
- if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
- active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
- end
- active_spec = active_specs.last
- end
-
- active_spec
- end
-
- def display_nothing_outdated_message
- unless options[:parseable]
- Bundler.ui.info(nothing_outdated_message)
- end
- end
-
- def print_gems(gems_list)
- gems_list.each do |gem|
- print_gem(
- gem[:current_spec],
- gem[:active_spec],
- gem[:dependency],
- gem[:groups],
- )
- end
- end
-
- def print_gem(current_spec, active_spec, dependency, groups)
- spec_version = "#{active_spec.version}#{active_spec.git_version}"
- spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
- current_version = "#{current_spec.version}#{current_spec.git_version}"
-
- if dependency && dependency.specific?
- dependency_version = %(, requested #{dependency.requirement})
- end
-
- spec_outdated_info = "#{active_spec.name} (newest #{spec_version}, " \
- "installed #{current_version}#{dependency_version})"
-
- output_message = if options[:parseable]
- spec_outdated_info.to_s
- elsif options_include_groups || !groups
- " * #{spec_outdated_info}"
- else
- " * #{spec_outdated_info} in #{groups_text("group", groups)}"
- end
-
- Bundler.ui.info output_message.rstrip
- end
-
- def check_for_deployment_mode!
- return unless Bundler.frozen_bundle?
- suggested_command = if Bundler.settings.locations("frozen")[:global]
- "bundle config unset frozen"
- elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
- "bundle config unset deployment"
- else
- "bundle install --no-deployment"
- end
- raise ProductionError, "You are trying to check outdated gems in " \
- "deployment mode. Run `bundle outdated` elsewhere.\n" \
- "\nIf this is a development machine, remove the " \
- "#{Bundler.default_gemfile} freeze" \
- "\nby running `#{suggested_command}`."
- end
-
- def update_present_via_semver_portions(current_spec, active_spec, options)
- current_major = current_spec.version.segments.first
- active_major = active_spec.version.segments.first
-
- update_present = false
- update_present = active_major > current_major if options["filter-major"]
-
- if !update_present && (options["filter-minor"] || options["filter-patch"]) && current_major == active_major
- current_minor = get_version_semver_portion_value(current_spec, 1)
- active_minor = get_version_semver_portion_value(active_spec, 1)
-
- update_present = active_minor > current_minor if options["filter-minor"]
-
- if !update_present && options["filter-patch"] && current_minor == active_minor
- current_patch = get_version_semver_portion_value(current_spec, 2)
- active_patch = get_version_semver_portion_value(active_spec, 2)
-
- update_present = active_patch > current_patch
- end
- end
-
- update_present
- end
-
- def get_version_semver_portion_value(spec, version_portion_index)
- version_section = spec.version.segments[version_portion_index, 1]
- version_section.to_a[0].to_i
- end
- end
-end
diff --git a/lib/bundler/cli/package.rb b/lib/bundler/cli/package.rb
deleted file mode 100644
index b31b67776d..0000000000
--- a/lib/bundler/cli/package.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Package
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def run
- Bundler.ui.level = "error" if options[:quiet]
- Bundler.settings.set_command_option_if_given :path, options[:path]
- Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
-
- setup_cache_all
- install
-
- # TODO: move cache contents here now that all bundles are locked
- custom_path = Bundler.settings[:path] if options[:path]
-
- Bundler.settings.temporary(:cache_all_platforms => options["all-platforms"]) do
- Bundler.load.cache(custom_path)
- end
- end
-
- private
-
- def install
- require_relative "install"
- options = self.options.dup
- options["local"] = false if Bundler.settings[:cache_all_platforms]
- Bundler::CLI::Install.new(options).run
- end
-
- def setup_cache_all
- all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
-
- Bundler.settings.set_command_option_if_given :cache_all, all
-
- if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
- Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
- "to package them as well, please pass the --all flag. This will be the default " \
- "on Bundler 3.0."
- end
- end
- end
-end
diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb
deleted file mode 100644
index e97cad49a4..0000000000
--- a/lib/bundler/cli/platform.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Platform
- attr_reader :options
- def initialize(options)
- @options = options
- end
-
- def run
- platforms, ruby_version = Bundler.ui.silence do
- locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version
- gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string
- [Bundler.definition.platforms.map {|p| "* #{p}" },
- locked_ruby_version || gemfile_ruby_version]
- end
- output = []
-
- if options[:ruby]
- if ruby_version
- output << ruby_version
- else
- output << "No ruby version specified"
- end
- else
- output << "Your platform is: #{RUBY_PLATFORM}"
- output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
-
- if ruby_version
- output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"
-
- begin
- Bundler.definition.validate_runtime!
- output << "Your current platform satisfies the Ruby version requirement."
- rescue RubyVersionMismatch => e
- output << e.message
- end
- else
- output << "Your Gemfile does not specify a Ruby version requirement."
- end
- end
-
- Bundler.ui.info output.join("\n\n")
- end
- end
-end
diff --git a/lib/bundler/cli/plugin.rb b/lib/bundler/cli/plugin.rb
deleted file mode 100644
index 1155c4ec9b..0000000000
--- a/lib/bundler/cli/plugin.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../vendored_thor"
-module Bundler
- class CLI::Plugin < Thor
- desc "install PLUGINS", "Install the plugin from the source"
- long_desc <<-D
- Install plugins either from the rubygems source provided (with --source option) or from a git source provided with --git (for remote repos) or --local_git (for local repos). If no sources are provided, it uses Gem.sources
- D
- method_option "source", :type => :string, :default => nil, :banner =>
- "URL of the RubyGems source to fetch the plugin from"
- method_option "version", :type => :string, :default => nil, :banner =>
- "The version of the plugin to fetch"
- method_option "git", :type => :string, :default => nil, :banner =>
- "URL of the git repo to fetch from"
- method_option "local_git", :type => :string, :default => nil, :banner =>
- "Path of the local git repo to fetch from"
- method_option "branch", :type => :string, :default => nil, :banner =>
- "The git branch to checkout"
- method_option "ref", :type => :string, :default => nil, :banner =>
- "The git revision to check out"
- def install(*plugins)
- Bundler::Plugin.install(plugins, options)
- end
-
- desc "list", "List the installed plugins and available commands"
- def list
- Bundler::Plugin.list
- end
- end
-end
diff --git a/lib/bundler/cli/pristine.rb b/lib/bundler/cli/pristine.rb
deleted file mode 100644
index 532b3e0b5b..0000000000
--- a/lib/bundler/cli/pristine.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Pristine
- def initialize(gems)
- @gems = gems
- end
-
- def run
- CLI::Common.ensure_all_gems_in_lockfile!(@gems)
- definition = Bundler.definition
- definition.validate_runtime!
- installer = Bundler::Installer.new(Bundler.root, definition)
-
- Bundler.load.specs.each do |spec|
- next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
- next if !@gems.empty? && !@gems.include?(spec.name)
-
- gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
- gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
-
- case source = spec.source
- when Source::Rubygems
- cached_gem = spec.cache_file
- unless File.exist?(cached_gem)
- Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
- next
- end
-
- FileUtils.rm_rf spec.full_gem_path
- when Source::Git
- source.remote!
- if extension_cache_path = source.extension_cache_path(spec)
- FileUtils.rm_rf extension_cache_path
- end
- FileUtils.rm_rf spec.extension_dir
- FileUtils.rm_rf spec.full_gem_path
- else
- Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
- next
- end
-
- Bundler::GemInstaller.new(spec, installer, false, 0, true).install_from_spec
- end
- end
- end
-end
diff --git a/lib/bundler/cli/remove.rb b/lib/bundler/cli/remove.rb
deleted file mode 100644
index cd6a2cec28..0000000000
--- a/lib/bundler/cli/remove.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Remove
- def initialize(gems, options)
- @gems = gems
- @options = options
- end
-
- def run
- raise InvalidOption, "Please specify gems to remove." if @gems.empty?
-
- Injector.remove(@gems, {})
-
- Installer.install(Bundler.root, Bundler.definition) if @options["install"]
- end
- end
-end
diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb
deleted file mode 100644
index 3748c25b89..0000000000
--- a/lib/bundler/cli/show.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Show
- attr_reader :options, :gem_name, :latest_specs
- def initialize(options, gem_name)
- @options = options
- @gem_name = gem_name
- @verbose = options[:verbose] || options[:outdated]
- @latest_specs = fetch_latest_specs if @verbose
- end
-
- def run
- Bundler.ui.silence do
- Bundler.definition.validate_runtime!
- Bundler.load.lock
- end
-
- if gem_name
- if gem_name == "bundler"
- path = File.expand_path("../../../..", __FILE__)
- else
- spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
- return unless spec
- path = spec.full_gem_path
- unless File.directory?(path)
- return Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at: #{path}"
- end
- end
- return Bundler.ui.info(path)
- end
-
- if options[:paths]
- Bundler.load.specs.sort_by(&:name).map do |s|
- Bundler.ui.info s.full_gem_path
- end
- else
- Bundler.ui.info "Gems included by the bundle:"
- Bundler.load.specs.sort_by(&:name).each do |s|
- desc = " * #{s.name} (#{s.version}#{s.git_version})"
- if @verbose
- latest = latest_specs.find {|l| l.name == s.name }
- Bundler.ui.info <<-END.gsub(/^ +/, "")
- #{desc}
- \tSummary: #{s.summary || "No description available."}
- \tHomepage: #{s.homepage || "No website available."}
- \tStatus: #{outdated?(s, latest) ? "Outdated - #{s.version} < #{latest.version}" : "Up to date"}
- END
- else
- Bundler.ui.info desc
- end
- end
- end
- end
-
- private
-
- def fetch_latest_specs
- definition = Bundler.definition(true)
- if options[:outdated]
- Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
- Bundler.ui.silence { definition.resolve_remotely! }
- else
- definition.resolve_with_cache!
- end
- Bundler.reset!
- definition.specs
- end
-
- def outdated?(current, latest)
- return false unless latest
- Gem::Version.new(current.version) < Gem::Version.new(latest.version)
- end
- end
-end
diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb
deleted file mode 100644
index 529dd9c94d..0000000000
--- a/lib/bundler/cli/update.rb
+++ /dev/null
@@ -1,111 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Update
- attr_reader :options, :gems
- def initialize(options, gems)
- @options = options
- @gems = gems
- end
-
- def run
- Bundler.ui.level = "error" if options[:quiet]
-
- Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
-
- sources = Array(options[:source])
- groups = Array(options[:group]).map(&:to_sym)
-
- full_update = gems.empty? && sources.empty? && groups.empty? && !options[:ruby] && !options[:bundler]
-
- if full_update && !options[:all]
- if Bundler.feature_flag.update_requires_all_flag?
- raise InvalidOption, "To update everything, pass the `--all` flag."
- end
- SharedHelpers.major_deprecation 3, "Pass --all to `bundle update` to update everything"
- elsif !full_update && options[:all]
- raise InvalidOption, "Cannot specify --all along with specific options."
- end
-
- if full_update
- # We're doing a full update
- Bundler.definition(true)
- else
- unless Bundler.default_lockfile.exist?
- raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
- "Run `bundle install` to update and install the bundled gems."
- end
- Bundler::CLI::Common.ensure_all_gems_in_lockfile!(gems)
-
- if groups.any?
- deps = Bundler.definition.dependencies.select {|d| (d.groups & groups).any? }
- gems.concat(deps.map(&:name))
- end
-
- Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
- :lock_shared_dependencies => options[:conservative],
- :bundler => options[:bundler])
- end
-
- Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
-
- Bundler::Fetcher.disable_endpoint = options["full-index"]
-
- opts = options.dup
- opts["update"] = true
- opts["local"] = options[:local]
-
- Bundler.settings.set_command_option_if_given :jobs, opts["jobs"]
-
- Bundler.definition.validate_runtime!
-
- if locked_gems = Bundler.definition.locked_gems
- previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
- h[s.name] = { :spec => s, :version => s.version, :source => s.source.to_s }
- h
- end
- end
-
- installer = Installer.install Bundler.root, Bundler.definition, opts
- Bundler.load.cache if Bundler.app_cache.exist?
-
- if CLI::Common.clean_after_install?
- require_relative "clean"
- Bundler::CLI::Clean.new(options).run
- end
-
- if locked_gems
- gems.each do |name|
- locked_info = previous_locked_info[name]
- next unless locked_info
-
- locked_spec = locked_info[:spec]
- new_spec = Bundler.definition.specs[name].first
- unless new_spec
- if Bundler.rubygems.platforms.none? {|p| locked_spec.match_platform(p) }
- Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
- end
-
- next
- end
-
- locked_source = locked_info[:source]
- new_source = new_spec.source.to_s
- next if locked_source != new_source
-
- new_version = new_spec.version
- locked_version = locked_info[:version]
- if new_version < locked_version
- Bundler.ui.warn "Note: #{name} version regressed from #{locked_version} to #{new_version}"
- elsif new_version == locked_version
- Bundler.ui.warn "Bundler attempted to update #{name} but its version stayed the same"
- end
- end
- end
-
- Bundler.ui.confirm "Bundle updated!"
- Bundler::CLI::Common.output_without_groups_message(:update)
- Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
- end
- end
-end
diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb
deleted file mode 100644
index 644f9b25cf..0000000000
--- a/lib/bundler/cli/viz.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CLI::Viz
- attr_reader :options, :gem_name
- def initialize(options)
- @options = options
- end
-
- def run
- # make sure we get the right `graphviz`. There is also a `graphviz`
- # gem we're not built to support
- gem "ruby-graphviz"
- require "graphviz"
-
- options[:without] = options[:without].join(":").tr(" ", ":").split(":")
- output_file = File.expand_path(options[:file])
-
- graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
- graph.viz
- rescue LoadError => e
- Bundler.ui.error e.inspect
- Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:"
- Bundler.ui.warn "`gem install ruby-graphviz`"
- rescue StandardError => e
- raise unless e.message =~ /GraphViz not installed or dot not in PATH/
- Bundler.ui.error e.message
- Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
- end
- end
-end
diff --git a/lib/bundler/compact_index_client.rb b/lib/bundler/compact_index_client.rb
deleted file mode 100644
index a5120dbba4..0000000000
--- a/lib/bundler/compact_index_client.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# frozen_string_literal: true
-
-require "pathname"
-require "set"
-
-module Bundler
- class CompactIndexClient
- DEBUG_MUTEX = Mutex.new
- def self.debug
- return unless ENV["DEBUG_COMPACT_INDEX"]
- DEBUG_MUTEX.synchronize { warn("[#{self}] #{yield}") }
- end
-
- class Error < StandardError; end
-
- require_relative "compact_index_client/cache"
- require_relative "compact_index_client/updater"
-
- attr_reader :directory
-
- def initialize(directory, fetcher)
- @directory = Pathname.new(directory)
- @updater = Updater.new(fetcher)
- @cache = Cache.new(@directory)
- @endpoints = Set.new
- @info_checksums_by_name = {}
- @parsed_checksums = false
- @mutex = Mutex.new
- end
-
- def execution_mode=(block)
- Bundler::CompactIndexClient.debug { "execution_mode=" }
- @endpoints = Set.new
-
- @execution_mode = block
- end
-
- # @return [Lambda] A lambda that takes an array of inputs and a block, and
- # maps the inputs with the block in parallel.
- #
- def execution_mode
- @execution_mode || sequentially
- end
-
- def sequential_execution_mode!
- self.execution_mode = sequentially
- end
-
- def sequentially
- @sequentially ||= lambda do |inputs, &blk|
- inputs.map(&blk)
- end
- end
-
- def names
- Bundler::CompactIndexClient.debug { "/names" }
- update(@cache.names_path, "names")
- @cache.names
- end
-
- def versions
- Bundler::CompactIndexClient.debug { "/versions" }
- update(@cache.versions_path, "versions")
- versions, @info_checksums_by_name = @cache.versions
- versions
- end
-
- def dependencies(names)
- Bundler::CompactIndexClient.debug { "dependencies(#{names})" }
- execution_mode.call(names) do |name|
- update_info(name)
- @cache.dependencies(name).map {|d| d.unshift(name) }
- end.flatten(1)
- end
-
- def spec(name, version, platform = nil)
- Bundler::CompactIndexClient.debug { "spec(name = #{name}, version = #{version}, platform = #{platform})" }
- update_info(name)
- @cache.specific_dependency(name, version, platform)
- end
-
- def update_and_parse_checksums!
- Bundler::CompactIndexClient.debug { "update_and_parse_checksums!" }
- return @info_checksums_by_name if @parsed_checksums
- update(@cache.versions_path, "versions")
- @info_checksums_by_name = @cache.checksums
- @parsed_checksums = true
- end
-
- private
-
- def update(local_path, remote_path)
- Bundler::CompactIndexClient.debug { "update(#{local_path}, #{remote_path})" }
- unless synchronize { @endpoints.add?(remote_path) }
- Bundler::CompactIndexClient.debug { "already fetched #{remote_path}" }
- return
- end
- @updater.update(local_path, url(remote_path))
- end
-
- def update_info(name)
- Bundler::CompactIndexClient.debug { "update_info(#{name})" }
- path = @cache.info_path(name)
- checksum = @updater.checksum_for_file(path)
- unless existing = @info_checksums_by_name[name]
- Bundler::CompactIndexClient.debug { "skipping updating info for #{name} since it is missing from versions" }
- return
- end
- if checksum == existing
- Bundler::CompactIndexClient.debug { "skipping updating info for #{name} since the versions checksum matches the local checksum" }
- return
- end
- Bundler::CompactIndexClient.debug { "updating info for #{name} since the versions checksum #{existing} != the local checksum #{checksum}" }
- update(path, "info/#{name}")
- end
-
- def url(path)
- path
- end
-
- def synchronize
- @mutex.synchronize { yield }
- end
- end
-end
diff --git a/lib/bundler/compact_index_client/cache.rb b/lib/bundler/compact_index_client/cache.rb
deleted file mode 100644
index f6105d3bb3..0000000000
--- a/lib/bundler/compact_index_client/cache.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class CompactIndexClient
- class Cache
- attr_reader :directory
-
- def initialize(directory)
- @directory = Pathname.new(directory).expand_path
- info_roots.each do |dir|
- SharedHelpers.filesystem_access(dir) do
- FileUtils.mkdir_p(dir)
- end
- end
- end
-
- def names
- lines(names_path)
- end
-
- def names_path
- directory.join("names")
- end
-
- def versions
- versions_by_name = Hash.new {|hash, key| hash[key] = [] }
- info_checksums_by_name = {}
-
- lines(versions_path).each do |line|
- name, versions_string, info_checksum = line.split(" ", 3)
- info_checksums_by_name[name] = info_checksum || ""
- versions_string.split(",").each do |version|
- if version.start_with?("-")
- version = version[1..-1].split("-", 2).unshift(name)
- versions_by_name[name].delete(version)
- else
- version = version.split("-", 2).unshift(name)
- versions_by_name[name] << version
- end
- end
- end
-
- [versions_by_name, info_checksums_by_name]
- end
-
- def versions_path
- directory.join("versions")
- end
-
- def checksums
- checksums = {}
-
- lines(versions_path).each do |line|
- name, _, checksum = line.split(" ", 3)
- checksums[name] = checksum
- end
-
- checksums
- end
-
- def dependencies(name)
- lines(info_path(name)).map do |line|
- parse_gem(line)
- end
- end
-
- def info_path(name)
- name = name.to_s
- if name =~ /[^a-z0-9_-]/
- name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
- info_roots.last.join(name)
- else
- info_roots.first.join(name)
- end
- end
-
- def specific_dependency(name, version, platform)
- pattern = [version, platform].compact.join("-")
- return nil if pattern.empty?
-
- gem_lines = info_path(name).read
- gem_line = gem_lines[/^#{Regexp.escape(pattern)}\b.*/, 0]
- gem_line ? parse_gem(gem_line) : nil
- end
-
- private
-
- def lines(path)
- return [] unless path.file?
- lines = SharedHelpers.filesystem_access(path, :read, &:read).split("\n")
- header = lines.index("---")
- header ? lines[header + 1..-1] : lines
- end
-
- def parse_gem(string)
- version_and_platform, rest = string.split(" ", 2)
- version, platform = version_and_platform.split("-", 2)
- dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
- dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
- requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
- [version, platform, dependencies, requirements]
- end
-
- def parse_dependency(string)
- dependency = string.split(":")
- dependency[-1] = dependency[-1].split("&") if dependency.size > 1
- dependency
- end
-
- def info_roots
- [
- directory.join("info"),
- directory.join("info-special-characters"),
- ]
- end
- end
- end
-end
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
deleted file mode 100644
index 40232019bc..0000000000
--- a/lib/bundler/compact_index_client/updater.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../vendored_fileutils"
-require "stringio"
-require "zlib"
-
-module Bundler
- class CompactIndexClient
- class Updater
- class MisMatchedChecksumError < Error
- def initialize(path, server_checksum, local_checksum)
- @path = path
- @server_checksum = server_checksum
- @local_checksum = local_checksum
- end
-
- def message
- "The checksum of /#{@path} does not match the checksum provided by the server! Something is wrong " \
- "(local checksum is #{@local_checksum.inspect}, was expecting #{@server_checksum.inspect})."
- end
- end
-
- def initialize(fetcher)
- @fetcher = fetcher
- require "tmpdir"
- end
-
- def update(local_path, remote_path, retrying = nil)
- headers = {}
-
- Dir.mktmpdir("bundler-compact-index-") do |local_temp_dir|
- local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
-
- # first try to fetch any new bytes on the existing file
- if retrying.nil? && local_path.file?
- SharedHelpers.filesystem_access(local_temp_path) do
- FileUtils.cp local_path, local_temp_path
- end
- headers["If-None-Match"] = etag_for(local_temp_path)
- headers["Range"] =
- if local_temp_path.size.nonzero?
- # Subtract a byte to ensure the range won't be empty.
- # Avoids 416 (Range Not Satisfiable) responses.
- "bytes=#{local_temp_path.size - 1}-"
- else
- "bytes=#{local_temp_path.size}-"
- end
- else
- # Fastly ignores Range when Accept-Encoding: gzip is set
- headers["Accept-Encoding"] = "gzip"
- end
-
- response = @fetcher.call(remote_path, headers)
- return nil if response.is_a?(Net::HTTPNotModified)
-
- content = response.body
- if response["Content-Encoding"] == "gzip"
- content = Zlib::GzipReader.new(StringIO.new(content)).read
- end
-
- SharedHelpers.filesystem_access(local_temp_path) do
- if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero?
- local_temp_path.open("a") {|f| f << slice_body(content, 1..-1) }
- else
- local_temp_path.open("w") {|f| f << content }
- end
- end
-
- response_etag = (response["ETag"] || "").gsub(%r{\AW/}, "")
- if etag_for(local_temp_path) == response_etag
- SharedHelpers.filesystem_access(local_path) do
- FileUtils.mv(local_temp_path, local_path)
- end
- return nil
- end
-
- if retrying
- raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_temp_path))
- end
-
- update(local_path, remote_path, :retrying)
- end
- rescue Errno::EACCES
- raise Bundler::PermissionError,
- "Bundler does not have write access to create a temp directory " \
- "within #{Dir.tmpdir}. Bundler must have write access to your " \
- "systems temp directory to function properly. "
- rescue Zlib::GzipFile::Error
- raise Bundler::HTTPError
- end
-
- def etag_for(path)
- sum = checksum_for_file(path)
- sum ? %("#{sum}") : nil
- end
-
- def slice_body(body, range)
- body.byteslice(range)
- end
-
- def checksum_for_file(path)
- return nil unless path.file?
- # This must use IO.read instead of Digest.file().hexdigest
- # because we need to preserve \n line endings on windows when calculating
- # the checksum
- SharedHelpers.filesystem_access(path, :read) do
- SharedHelpers.digest(:MD5).hexdigest(IO.read(path))
- end
- end
- end
- end
-end
diff --git a/lib/bundler/constants.rb b/lib/bundler/constants.rb
deleted file mode 100644
index 2e4ebb37ee..0000000000
--- a/lib/bundler/constants.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- WINDOWS = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/
- FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/
- NULL = WINDOWS ? "NUL" : "/dev/null"
-end
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
deleted file mode 100644
index c132e8ecc0..0000000000
--- a/lib/bundler/current_ruby.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # Returns current version of Ruby
- #
- # @return [CurrentRuby] Current version of Ruby
- def self.current_ruby
- @current_ruby ||= CurrentRuby.new
- end
-
- class CurrentRuby
- KNOWN_MINOR_VERSIONS = %w[
- 1.8
- 1.9
- 2.0
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- ].freeze
-
- KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
-
- KNOWN_PLATFORMS = %w[
- jruby
- maglev
- mingw
- mri
- mswin
- mswin64
- rbx
- ruby
- truffleruby
- x64_mingw
- ].freeze
-
- def ruby?
- return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY
-
- !mswin? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
- end
-
- def mri?
- !mswin? && RUBY_ENGINE == "ruby"
- end
-
- def rbx?
- ruby? && RUBY_ENGINE == "rbx"
- end
-
- def jruby?
- RUBY_ENGINE == "jruby"
- end
-
- def maglev?
- RUBY_ENGINE == "maglev"
- end
-
- def truffleruby?
- RUBY_ENGINE == "truffleruby"
- end
-
- def mswin?
- Bundler::WINDOWS
- end
-
- def mswin64?
- Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
- end
-
- def mingw?
- Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
- end
-
- def x64_mingw?
- Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
- end
-
- (KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
- trimmed_version = version.tr(".", "")
- define_method(:"on_#{trimmed_version}?") do
- RUBY_VERSION.start_with?("#{version}.")
- end
-
- KNOWN_PLATFORMS.each do |platform|
- define_method(:"#{platform}_#{trimmed_version}?") do
- send(:"#{platform}?") && send(:"on_#{trimmed_version}?")
- end
- end
- end
- end
-end
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
deleted file mode 100644
index d6fbb0b5b7..0000000000
--- a/lib/bundler/definition.rb
+++ /dev/null
@@ -1,1002 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "lockfile_parser"
-require "set"
-
-module Bundler
- class Definition
- include GemHelpers
-
- attr_reader(
- :dependencies,
- :locked_deps,
- :locked_gems,
- :platforms,
- :requires,
- :ruby_version,
- :lockfile,
- :gemfiles
- )
-
- # Given a gemfile and lockfile creates a Bundler definition
- #
- # @param gemfile [Pathname] Path to Gemfile
- # @param lockfile [Pathname,nil] Path to Gemfile.lock
- # @param unlock [Hash, Boolean, nil] Gems that have been requested
- # to be updated or true if all gems should be updated
- # @return [Bundler::Definition]
- def self.build(gemfile, lockfile, unlock)
- unlock ||= {}
- gemfile = Pathname.new(gemfile).expand_path
-
- raise GemfileNotFound, "#{gemfile} not found" unless gemfile.file?
-
- Dsl.evaluate(gemfile, lockfile, unlock)
- end
-
- #
- # How does the new system work?
- #
- # * Load information from Gemfile and Lockfile
- # * Invalidate stale locked specs
- # * All specs from stale source are stale
- # * All specs that are reachable only through a stale
- # dependency are stale.
- # * If all fresh dependencies are satisfied by the locked
- # specs, then we can try to resolve locally.
- #
- # @param lockfile [Pathname] Path to Gemfile.lock
- # @param dependencies [Array(Bundler::Dependency)] array of dependencies from Gemfile
- # @param sources [Bundler::SourceList]
- # @param unlock [Hash, Boolean, nil] Gems that have been requested
- # to be updated or true if all gems should be updated
- # @param ruby_version [Bundler::RubyVersion, nil] Requested Ruby Version
- # @param optional_groups [Array(String)] A list of optional groups
- def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
- if [true, false].include?(unlock)
- @unlocking_bundler = false
- @unlocking = unlock
- else
- unlock = unlock.dup
- @unlocking_bundler = unlock.delete(:bundler)
- unlock.delete_if {|_k, v| Array(v).empty? }
- @unlocking = !unlock.empty?
- end
-
- @dependencies = dependencies
- @sources = sources
- @unlock = unlock
- @optional_groups = optional_groups
- @remote = false
- @specs = nil
- @ruby_version = ruby_version
- @gemfiles = gemfiles
-
- @lockfile = lockfile
- @lockfile_contents = String.new
- @locked_bundler_version = nil
- @locked_ruby_version = nil
- @locked_specs_incomplete_for_platform = false
-
- if lockfile && File.exist?(lockfile)
- @lockfile_contents = Bundler.read_file(lockfile)
- @locked_gems = LockfileParser.new(@lockfile_contents)
- @locked_platforms = @locked_gems.platforms
- @platforms = @locked_platforms.dup
- @locked_bundler_version = @locked_gems.bundler_version
- @locked_ruby_version = @locked_gems.ruby_version
-
- if unlock != true
- @locked_deps = @locked_gems.dependencies
- @locked_specs = SpecSet.new(@locked_gems.specs)
- @locked_sources = @locked_gems.sources
- else
- @unlock = {}
- @locked_deps = {}
- @locked_specs = SpecSet.new([])
- @locked_sources = []
- end
- else
- @unlock = {}
- @platforms = []
- @locked_gems = nil
- @locked_deps = {}
- @locked_specs = SpecSet.new([])
- @locked_sources = []
- @locked_platforms = []
- end
-
- @unlock[:gems] ||= []
- @unlock[:sources] ||= []
- @unlock[:ruby] ||= if @ruby_version && locked_ruby_version_object
- @ruby_version.diff(locked_ruby_version_object)
- end
- @unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
-
- add_current_platform unless Bundler.frozen_bundle?
-
- converge_path_sources_to_gemspec_sources
- @path_changes = converge_paths
- @source_changes = converge_sources
-
- unless @unlock[:lock_shared_dependencies]
- eager_unlock = expand_dependencies(@unlock[:gems], true)
- @unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
- end
-
- @dependency_changes = converge_dependencies
- @local_changes = converge_locals
-
- @requires = compute_requires
- end
-
- def gem_version_promoter
- @gem_version_promoter ||= begin
- locked_specs =
- if unlocking? && @locked_specs.empty? && !@lockfile_contents.empty?
- # Definition uses an empty set of locked_specs to indicate all gems
- # are unlocked, but GemVersionPromoter needs the locked_specs
- # for conservative comparison.
- Bundler::SpecSet.new(@locked_gems.specs)
- else
- @locked_specs
- end
- GemVersionPromoter.new(locked_specs, @unlock[:gems])
- end
- end
-
- def resolve_with_cache!
- raise "Specs already loaded" if @specs
- sources.cached!
- specs
- end
-
- def resolve_remotely!
- raise "Specs already loaded" if @specs
- @remote = true
- sources.remote!
- specs
- end
-
- # For given dependency list returns a SpecSet with Gemspec of all the required
- # dependencies.
- # 1. The method first resolves the dependencies specified in Gemfile
- # 2. After that it tries and fetches gemspec of resolved dependencies
- #
- # @return [Bundler::SpecSet]
- def specs
- @specs ||= begin
- begin
- specs = resolve.materialize(requested_dependencies)
- rescue GemNotFound => e # Handle yanked gem
- gem_name, gem_version = extract_gem_info(e)
- locked_gem = @locked_specs[gem_name].last
- raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
- raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version could not " \
- "be found in any of the sources listed in your Gemfile. If you haven't changed sources, " \
- "that means the author of #{locked_gem} has removed it. You'll need to update your bundle " \
- "to a version other than #{locked_gem} that hasn't been removed in order to install."
- end
- unless specs["bundler"].any?
- bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
- specs["bundler"] = bundler
- end
-
- specs
- end
- end
-
- def new_specs
- specs - @locked_specs
- end
-
- def removed_specs
- @locked_specs - specs
- end
-
- def new_platform?
- @new_platform
- end
-
- def missing_specs
- missing = []
- resolve.materialize(requested_dependencies, missing)
- missing
- end
-
- def missing_specs?
- missing = missing_specs
- return false if missing.empty?
- Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
- true
- rescue BundlerError => e
- @index = nil
- @resolve = nil
- @specs = nil
- @gem_version_promoter = nil
-
- Bundler.ui.debug "The definition is missing dependencies, failed to resolve & materialize locally (#{e})"
- true
- end
-
- def requested_specs
- @requested_specs ||= begin
- groups = requested_groups
- groups.map!(&:to_sym)
- specs_for(groups)
- end
- end
-
- def current_dependencies
- dependencies.select(&:should_include?)
- end
-
- def specs_for(groups)
- deps = dependencies.select {|d| (d.groups & groups).any? }
- deps.delete_if {|d| !d.should_include? }
- specs.for(expand_dependencies(deps))
- end
-
- # Resolve all the dependencies specified in Gemfile. It ensures that
- # dependencies that have been already resolved via locked file and are fresh
- # are reused when resolving dependencies
- #
- # @return [SpecSet] resolved dependencies
- def resolve
- @resolve ||= begin
- last_resolve = converge_locked_specs
- resolve =
- if Bundler.frozen_bundle?
- Bundler.ui.debug "Frozen, using resolution from the lockfile"
- last_resolve
- elsif !unlocking? && nothing_changed?
- Bundler.ui.debug("Found no changes, using resolution from the lockfile")
- last_resolve
- else
- # Run a resolve against the locally available gems
- Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
- last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
- end
-
- # filter out gems that _can_ be installed on multiple platforms, but don't need
- # to be
- resolve.for(expand_dependencies(dependencies, true), [], false, false, false)
- end
- end
-
- def index
- @index ||= Index.build do |idx|
- dependency_names = @dependencies.map(&:name)
-
- sources.all_sources.each do |source|
- source.dependency_names = dependency_names - pinned_spec_names(source)
- idx.add_source source.specs
- dependency_names.concat(source.unmet_deps).uniq!
- end
-
- double_check_for_index(idx, dependency_names)
- end
- end
-
- # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
- # sources A and B. At this point, the API request will have found all the versions of Bar in source A,
- # but will not have found any versions of Bar from source B, which is a problem if the requested version
- # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
- # each spec we found, we add all possible versions from all sources to the index.
- def double_check_for_index(idx, dependency_names)
- pinned_names = pinned_spec_names
- loop do
- idxcount = idx.size
-
- names = :names # do this so we only have to traverse to get dependency_names from the index once
- unmet_dependency_names = lambda do
- return names unless names == :names
- new_names = sources.all_sources.map(&:dependency_names_to_double_check)
- return names = nil if new_names.compact!
- names = new_names.flatten(1).concat(dependency_names)
- names.uniq!
- names -= pinned_names
- names
- end
-
- sources.all_sources.each do |source|
- source.double_check_for(unmet_dependency_names)
- end
-
- break if idxcount == idx.size
- end
- end
- private :double_check_for_index
-
- def has_rubygems_remotes?
- sources.rubygems_sources.any? {|s| s.remotes.any? }
- end
-
- def has_local_dependencies?
- !sources.path_sources.empty? || !sources.git_sources.empty?
- end
-
- def spec_git_paths
- sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
- end
-
- def groups
- dependencies.map(&:groups).flatten.uniq
- end
-
- def lock(file, preserve_unknown_sections = false)
- contents = to_lock
-
- # Convert to \r\n if the existing lock has them
- # i.e., Windows with `git config core.autocrlf=true`
- contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n")
-
- if @locked_bundler_version
- locked_major = @locked_bundler_version.segments.first
- current_major = Gem::Version.create(Bundler::VERSION).segments.first
-
- if updating_major = locked_major < current_major
- Bundler.ui.warn "Warning: the lockfile is being updated to Bundler #{current_major}, " \
- "after which you will be unable to return to Bundler #{@locked_bundler_version.segments.first}."
- end
- end
-
- preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
-
- return if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
-
- if Bundler.frozen_bundle?
- Bundler.ui.error "Cannot write a changed lockfile while frozen."
- return
- end
-
- SharedHelpers.filesystem_access(file) do |p|
- File.open(p, "wb") {|f| f.puts(contents) }
- end
- end
-
- def locked_bundler_version
- if @locked_bundler_version && @locked_bundler_version < Gem::Version.new(Bundler::VERSION)
- new_version = Bundler::VERSION
- end
-
- new_version || @locked_bundler_version || Bundler::VERSION
- end
-
- def locked_ruby_version
- return unless ruby_version
- if @unlock[:ruby] || !@locked_ruby_version
- Bundler::RubyVersion.system
- else
- @locked_ruby_version
- end
- end
-
- def locked_ruby_version_object
- return unless @locked_ruby_version
- @locked_ruby_version_object ||= begin
- unless version = RubyVersion.from_string(@locked_ruby_version)
- raise LockfileError, "The Ruby version #{@locked_ruby_version} from " \
- "#{@lockfile} could not be parsed. " \
- "Try running bundle update --ruby to resolve this."
- end
- version
- end
- end
-
- def to_lock
- require_relative "lockfile_generator"
- LockfileGenerator.generate(self)
- end
-
- def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
- msg = String.new
- msg << "You are trying to install in deployment mode after changing\n" \
- "your Gemfile. Run `bundle install` elsewhere and add the\n" \
- "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
-
- unless explicit_flag
- suggested_command = if Bundler.settings.locations("frozen")[:global]
- "bundle config unset frozen"
- elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
- "bundle config unset deployment"
- else
- "bundle install --no-deployment"
- end
- msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
- "freeze \nby running `#{suggested_command}`."
- end
-
- added = []
- deleted = []
- changed = []
-
- new_platforms = @platforms - @locked_platforms
- deleted_platforms = @locked_platforms - @platforms
- added.concat new_platforms.map {|p| "* platform: #{p}" }
- deleted.concat deleted_platforms.map {|p| "* platform: #{p}" }
-
- gemfile_sources = sources.lock_sources
-
- new_sources = gemfile_sources - @locked_sources
- deleted_sources = @locked_sources - gemfile_sources
-
- new_deps = @dependencies - @locked_deps.values
- deleted_deps = @locked_deps.values - @dependencies
-
- # Check if it is possible that the source is only changed thing
- if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
- new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
- deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
- end
-
- if @locked_sources != gemfile_sources
- if new_sources.any?
- added.concat new_sources.map {|source| "* source: #{source}" }
- end
-
- if deleted_sources.any?
- deleted.concat deleted_sources.map {|source| "* source: #{source}" }
- end
- end
-
- added.concat new_deps.map {|d| "* #{pretty_dep(d)}" } if new_deps.any?
- if deleted_deps.any?
- deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" }
- end
-
- both_sources = Hash.new {|h, k| h[k] = [] }
- @dependencies.each {|d| both_sources[d.name][0] = d }
- @locked_deps.each {|name, d| both_sources[name][1] = d.source }
-
- both_sources.each do |name, (dep, lock_source)|
- next unless (dep.nil? && !lock_source.nil?) || (!dep.nil? && !lock_source.nil? && !lock_source.can_lock?(dep))
- gemfile_source_name = (dep && dep.source) || "no specified source"
- lockfile_source_name = lock_source || "no specified source"
- changed << "* #{name} from `#{gemfile_source_name}` to `#{lockfile_source_name}`"
- end
-
- reason = change_reason
- msg << "\n\n#{reason.split(", ").map(&:capitalize).join("\n")}" unless reason.strip.empty?
- msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
- msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
- msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?
- msg << "\n"
-
- raise ProductionError, msg if added.any? || deleted.any? || changed.any? || !nothing_changed?
- end
-
- def validate_runtime!
- validate_ruby!
- validate_platforms!
- end
-
- def validate_ruby!
- return unless ruby_version
-
- if diff = ruby_version.diff(Bundler::RubyVersion.system)
- problem, expected, actual = diff
-
- msg = case problem
- when :engine
- "Your Ruby engine is #{actual}, but your Gemfile specified #{expected}"
- when :version
- "Your Ruby version is #{actual}, but your Gemfile specified #{expected}"
- when :engine_version
- "Your #{Bundler::RubyVersion.system.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}"
- when :patchlevel
- if !expected.is_a?(String)
- "The Ruby patchlevel in your Gemfile must be a string"
- else
- "Your Ruby patchlevel is #{actual}, but your Gemfile specified #{expected}"
- end
- end
-
- raise RubyVersionMismatch, msg
- end
- end
-
- def validate_platforms!
- return if @platforms.any? do |bundle_platform|
- Bundler.rubygems.platforms.any? do |local_platform|
- MatchPlatform.platforms_match?(bundle_platform, local_platform)
- end
- end
-
- raise ProductionError, "Your bundle only supports platforms #{@platforms.map(&:to_s)} " \
- "but your local platforms are #{Bundler.rubygems.platforms.map(&:to_s)}, and " \
- "there's no compatible match between those two lists."
- end
-
- def add_platform(platform)
- @new_platform ||= !@platforms.include?(platform)
- @platforms |= [platform]
- end
-
- def remove_platform(platform)
- return if @platforms.delete(Gem::Platform.new(platform))
- raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}"
- end
-
- def add_current_platform
- current_platforms.each {|platform| add_platform(platform) }
- end
-
- def find_resolved_spec(current_spec)
- specs.find_by_name_and_platform(current_spec.name, current_spec.platform)
- end
-
- def find_indexed_specs(current_spec)
- index[current_spec.name].select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
- end
-
- attr_reader :sources
- private :sources
-
- def nothing_changed?
- !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@locked_specs_incomplete_for_platform
- end
-
- def unlocking?
- @unlocking
- end
-
- private
-
- def current_platforms
- current_platform = Bundler.local_platform
- [].tap do |platforms|
- platforms << current_platform if Bundler.feature_flag.specific_platform?
- platforms << generic(current_platform)
- end
- end
-
- def change_reason
- if unlocking?
- unlock_reason = @unlock.reject {|_k, v| Array(v).empty? }.map do |k, v|
- if v == true
- k.to_s
- else
- v = Array(v)
- "#{k}: (#{v.join(", ")})"
- end
- end.join(", ")
- return "bundler is unlocking #{unlock_reason}"
- end
- [
- [@source_changes, "the list of sources changed"],
- [@dependency_changes, "the dependencies in your gemfile changed"],
- [@new_platform, "you added a new platform to your gemfile"],
- [@path_changes, "the gemspecs for path gems changed"],
- [@local_changes, "the gemspecs for git local gems changed"],
- [@locked_specs_incomplete_for_platform, "the lockfile does not have all gems needed for the current platform"],
- ].select(&:first).map(&:last).join(", ")
- end
-
- def pretty_dep(dep, source = false)
- SharedHelpers.pretty_dependency(dep, source)
- end
-
- # Check if the specs of the given source changed
- # according to the locked source.
- def specs_changed?(source)
- locked = @locked_sources.find {|s| s == source }
-
- !locked || dependencies_for_source_changed?(source, locked) || specs_for_source_changed?(source)
- end
-
- def dependencies_for_source_changed?(source, locked_source = source)
- deps_for_source = @dependencies.select {|s| s.source == source }
- locked_deps_for_source = @locked_deps.values.select {|dep| dep.source == locked_source }
-
- Set.new(deps_for_source) != Set.new(locked_deps_for_source)
- end
-
- def specs_for_source_changed?(source)
- locked_index = Index.new
- locked_index.use(@locked_specs.select {|s| source.can_lock?(s) })
-
- # order here matters, since Index#== is checking source.specs.include?(locked_index)
- locked_index != source.specs
- rescue PathError, GitError => e
- Bundler.ui.debug "Assuming that #{source} has not changed since fetching its specs errored (#{e})"
- false
- end
-
- # Get all locals and override their matching sources.
- # Return true if any of the locals changed (for example,
- # they point to a new revision) or depend on new specs.
- def converge_locals
- locals = []
-
- Bundler.settings.local_overrides.map do |k, v|
- spec = @dependencies.find {|s| s.name == k }
- source = spec && spec.source
- if source && source.respond_to?(:local_override!)
- source.unlock! if @unlock[:gems].include?(spec.name)
- locals << [source, source.local_override!(v)]
- end
- end
-
- sources_with_changes = locals.select do |source, changed|
- changed || specs_changed?(source)
- end.map(&:first)
- !sources_with_changes.each {|source| @unlock[:sources] << source.name }.empty?
- end
-
- def converge_paths
- sources.path_sources.any? do |source|
- specs_changed?(source)
- end
- end
-
- def converge_path_source_to_gemspec_source(source)
- return source unless source.instance_of?(Source::Path)
- gemspec_source = sources.path_sources.find {|s| s.is_a?(Source::Gemspec) && s.as_path_source == source }
- gemspec_source || source
- end
-
- def converge_path_sources_to_gemspec_sources
- @locked_sources.map! do |source|
- converge_path_source_to_gemspec_source(source)
- end
- @locked_specs.each do |spec|
- spec.source &&= converge_path_source_to_gemspec_source(spec.source)
- end
- @locked_deps.each do |_, dep|
- dep.source &&= converge_path_source_to_gemspec_source(dep.source)
- end
- end
-
- def converge_rubygems_sources
- return false if Bundler.feature_flag.disable_multisource?
-
- changes = false
-
- # Get the RubyGems sources from the Gemfile.lock
- locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
- # Get the RubyGems remotes from the Gemfile
- actual_remotes = sources.rubygems_remotes
-
- # If there is a RubyGems source in both
- if !locked_gem_sources.empty? && !actual_remotes.empty?
- locked_gem_sources.each do |locked_gem|
- # Merge the remotes from the Gemfile into the Gemfile.lock
- changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
- end
- end
-
- changes
- end
-
- def converge_sources
- changes = false
-
- changes |= converge_rubygems_sources
-
- # Replace the sources from the Gemfile with the sources from the Gemfile.lock,
- # if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent
- # source in the Gemfile.lock, use the one from the Gemfile.
- changes |= sources.replace_sources!(@locked_sources)
-
- sources.all_sources.each do |source|
- # If the source is unlockable and the current command allows an unlock of
- # the source (for example, you are doing a `bundle update <foo>` of a git-pinned
- # gem), unlock it. For git sources, this means to unlock the revision, which
- # will cause the `ref` used to be the most recent for the branch (or master) if
- # an explicit `ref` is not used.
- if source.respond_to?(:unlock!) && @unlock[:sources].include?(source.name)
- source.unlock!
- changes = true
- end
- end
-
- changes
- end
-
- def converge_dependencies
- frozen = Bundler.frozen_bundle?
- (@dependencies + @locked_deps.values).each do |dep|
- locked_source = @locked_deps[dep.name]
- # This is to make sure that if bundler is installing in deployment mode and
- # after locked_source and sources don't match, we still use locked_source.
- if frozen && !locked_source.nil? &&
- locked_source.respond_to?(:source) && locked_source.source.instance_of?(Source::Path) && locked_source.source.path.exist?
- dep.source = locked_source.source
- elsif dep.source
- dep.source = sources.get(dep.source)
- end
- if dep.source.is_a?(Source::Gemspec)
- dep.platforms.concat(@platforms.map {|p| Dependency::REVERSE_PLATFORM_MAP[p] }.flatten(1)).uniq!
- end
- end
-
- changes = false
- # We want to know if all match, but don't want to check all entries
- # This means we need to return false if any dependency doesn't match
- # the lock or doesn't exist in the lock.
- @dependencies.each do |dependency|
- unless locked_dep = @locked_deps[dependency.name]
- changes = true
- next
- end
-
- # Gem::Dependency#== matches Gem::Dependency#type. As the lockfile
- # doesn't carry a notion of the dependency type, if you use
- # add_development_dependency in a gemspec that's loaded with the gemspec
- # directive, the lockfile dependencies and resolved dependencies end up
- # with a mismatch on #type. Work around that by setting the type on the
- # dep from the lockfile.
- locked_dep.instance_variable_set(:@type, dependency.type)
-
- # We already know the name matches from the hash lookup
- # so we only need to check the requirement now
- changes ||= dependency.requirement != locked_dep.requirement
- end
-
- changes
- end
-
- # Remove elements from the locked specs that are expired. This will most
- # commonly happen if the Gemfile has changed since the lockfile was last
- # generated
- def converge_locked_specs
- deps = []
-
- # Build a list of dependencies that are the same in the Gemfile
- # and Gemfile.lock. If the Gemfile modified a dependency, but
- # the gem in the Gemfile.lock still satisfies it, this is fine
- # too.
- @dependencies.each do |dep|
- locked_dep = @locked_deps[dep.name]
-
- # If the locked_dep doesn't match the dependency we're looking for then we ignore the locked_dep
- locked_dep = nil unless locked_dep == dep
-
- if in_locked_deps?(dep, locked_dep) || satisfies_locked_spec?(dep)
- deps << dep
- elsif dep.source.is_a?(Source::Path) && dep.current_platform? && (!locked_dep || dep.source != locked_dep.source)
- @locked_specs.each do |s|
- @unlock[:gems] << s.name if s.source == dep.source
- end
-
- dep.source.unlock! if dep.source.respond_to?(:unlock!)
- dep.source.specs.each {|s| @unlock[:gems] << s.name }
- end
- end
-
- unlock_source_unlocks_spec = Bundler.feature_flag.unlock_source_unlocks_spec?
-
- converged = []
- @locked_specs.each do |s|
- # Replace the locked dependency's source with the equivalent source from the Gemfile
- dep = @dependencies.find {|d| s.satisfies?(d) }
- s.source = (dep && dep.source) || sources.get(s.source)
-
- # Don't add a spec to the list if its source is expired. For example,
- # if you change a Git gem to RubyGems.
- next if s.source.nil?
- next if @unlock[:sources].include?(s.source.name)
-
- # XXX This is a backwards-compatibility fix to preserve the ability to
- # unlock a single gem by passing its name via `--source`. See issue #3759
- # TODO: delete in Bundler 2
- next if unlock_source_unlocks_spec && @unlock[:sources].include?(s.name)
-
- # If the spec is from a path source and it doesn't exist anymore
- # then we unlock it.
-
- # Path sources have special logic
- if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
- new_specs = begin
- s.source.specs
- rescue PathError, GitError
- # if we won't need the source (according to the lockfile),
- # don't error if the path/git source isn't available
- next if @locked_specs.
- for(requested_dependencies, [], false, true, false).
- none? {|locked_spec| locked_spec.source == s.source }
-
- raise
- end
-
- new_spec = new_specs[s].first
-
- # If the spec is no longer in the path source, unlock it. This
- # commonly happens if the version changed in the gemspec
- next unless new_spec
-
- new_runtime_deps = new_spec.dependencies.select {|d| d.type != :development }
- old_runtime_deps = s.dependencies.select {|d| d.type != :development }
- # If the dependencies of the path source have changed and locked spec can't satisfy new dependencies, unlock it
- next unless new_runtime_deps.sort == old_runtime_deps.sort || new_runtime_deps.all? {|d| satisfies_locked_spec?(d) }
-
- s.dependencies.replace(new_spec.dependencies)
- end
-
- converged << s
- end
-
- resolve = SpecSet.new(converged)
- @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(deps), @unlock[:gems], true, true)
- resolve = resolve.for(expand_dependencies(deps, true), @unlock[:gems], false, false, false)
- diff = nil
-
- # Now, we unlock any sources that do not have anymore gems pinned to it
- sources.all_sources.each do |source|
- next unless source.respond_to?(:unlock!)
-
- unless resolve.any? {|s| s.source == source }
- diff ||= @locked_specs.to_a - resolve.to_a
- source.unlock! if diff.any? {|s| s.source == source }
- end
- end
-
- resolve
- end
-
- def in_locked_deps?(dep, locked_dep)
- # Because the lockfile can't link a dep to a specific remote, we need to
- # treat sources as equivalent anytime the locked dep has all the remotes
- # that the Gemfile dep does.
- locked_dep && locked_dep.source && dep.source && locked_dep.source.include?(dep.source)
- end
-
- def satisfies_locked_spec?(dep)
- @locked_specs[dep].any? {|s| s.satisfies?(dep) && (!dep.source || s.source.include?(dep.source)) }
- end
-
- # This list of dependencies is only used in #resolve, so it's OK to add
- # the metadata dependencies here
- def expanded_dependencies
- @expanded_dependencies ||= begin
- expand_dependencies(dependencies + metadata_dependencies, @remote)
- end
- end
-
- def metadata_dependencies
- @metadata_dependencies ||= begin
- ruby_versions = concat_ruby_version_requirements(@ruby_version)
- if ruby_versions.empty? || !@ruby_version.exact?
- concat_ruby_version_requirements(RubyVersion.system)
- concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby]
- end
- [
- Dependency.new("Ruby\0", ruby_versions),
- Dependency.new("RubyGems\0", Gem::VERSION),
- ]
- end
- end
-
- def concat_ruby_version_requirements(ruby_version, ruby_versions = [])
- return ruby_versions unless ruby_version
- if ruby_version.patchlevel
- ruby_versions << ruby_version.to_gem_version_with_patchlevel
- else
- ruby_versions.concat(ruby_version.versions.map do |version|
- requirement = Gem::Requirement.new(version)
- if requirement.exact?
- "~> #{version}.0"
- else
- requirement
- end
- end)
- end
- end
-
- def expand_dependencies(dependencies, remote = false)
- sorted_platforms = Resolver.sort_platforms(@platforms)
- deps = []
- dependencies.each do |dep|
- dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
- next if !remote && !dep.current_platform?
- platforms = dep.gem_platforms(sorted_platforms)
- if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
- mapped_platforms = dep.expanded_platforms
- Bundler.ui.warn \
- "The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
- "Bundler is installing for #{@platforms.join ", "} but the dependency " \
- "is only for #{mapped_platforms.join ", "}. " \
- "To add those platforms to the bundle, " \
- "run `bundle lock --add-platform #{mapped_platforms.join " "}`."
- end
- platforms.each do |p|
- deps << DepProxy.new(dep, p) if remote || p == generic_local_platform
- end
- end
- deps
- end
-
- def requested_dependencies
- groups = requested_groups
- groups.map!(&:to_sym)
- dependencies.reject {|d| !d.should_include? || (d.groups & groups).empty? }
- end
-
- def source_requirements
- # Load all specs from remote sources
- index
-
- # Record the specs available in each gem's source, so that those
- # specs will be available later when the resolver knows where to
- # look for that gemspec (or its dependencies)
- default = sources.default_source
- source_requirements = { :default => default }
- default = nil unless Bundler.feature_flag.disable_multisource?
- dependencies.each do |dep|
- next unless source = dep.source || default
- source_requirements[dep.name] = source
- end
- metadata_dependencies.each do |dep|
- source_requirements[dep.name] = sources.metadata_source
- end
- source_requirements["bundler"] = sources.metadata_source # needs to come last to override
- source_requirements
- end
-
- def pinned_spec_names(skip = nil)
- pinned_names = []
- default = Bundler.feature_flag.disable_multisource? && sources.default_source
- @dependencies.each do |dep|
- next unless dep_source = dep.source || default
- next if dep_source == skip
- pinned_names << dep.name
- end
- pinned_names
- end
-
- def requested_groups
- groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
- end
-
- def lockfiles_equal?(current, proposed, preserve_unknown_sections)
- if preserve_unknown_sections
- sections_to_ignore = LockfileParser.sections_to_ignore(@locked_bundler_version)
- sections_to_ignore += LockfileParser.unknown_sections_in_lockfile(current)
- sections_to_ignore += LockfileParser::ENVIRONMENT_VERSION_SECTIONS
- pattern = /#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/
- whitespace_cleanup = /\n{2,}/
- current = current.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip
- proposed = proposed.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip
- end
- current == proposed
- end
-
- def extract_gem_info(error)
- # This method will extract the error message like "Could not find foo-1.2.3 in any of the sources"
- # to an array. The first element will be the gem name (e.g. foo), the second will be the version number.
- error.message.scan(/Could not find (\w+)-(\d+(?:\.\d+)+)/).flatten
- end
-
- def compute_requires
- dependencies.reduce({}) do |requires, dep|
- next requires unless dep.should_include?
- requires[dep.name] = Array(dep.autorequire || dep.name).map do |file|
- # Allow `require: true` as an alias for `require: <name>`
- file == true ? dep.name : file
- end
- requires
- end
- end
-
- def additional_base_requirements_for_resolve
- return [] unless @locked_gems && Bundler.feature_flag.only_update_to_newer_versions?
- dependencies_by_name = dependencies.inject({}) {|memo, dep| memo.update(dep.name => dep) }
- @locked_gems.specs.reduce({}) do |requirements, locked_spec|
- name = locked_spec.name
- dependency = dependencies_by_name[name]
- next requirements if @locked_gems.dependencies[name] != dependency
- next requirements if dependency && dependency.source.is_a?(Source::Path)
- dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
- requirements[name] = DepProxy.new(dep, locked_spec.platform)
- requirements
- end.values
- end
-
- def equivalent_rubygems_remotes?(source)
- return false unless source.is_a?(Source::Rubygems)
-
- Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
- end
- end
-end
diff --git a/lib/bundler/dep_proxy.rb b/lib/bundler/dep_proxy.rb
deleted file mode 100644
index 6c32179ac1..0000000000
--- a/lib/bundler/dep_proxy.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class DepProxy
- attr_reader :__platform, :dep
-
- def initialize(dep, platform)
- @dep = dep
- @__platform = platform
- end
-
- def hash
- @hash ||= [dep, __platform].hash
- end
-
- def ==(other)
- return false if other.class != self.class
- dep == other.dep && __platform == other.__platform
- end
-
- alias_method :eql?, :==
-
- def type
- @dep.type
- end
-
- def name
- @dep.name
- end
-
- def requirement
- @dep.requirement
- end
-
- def to_s
- s = name.dup
- s << " (#{requirement})" unless requirement == Gem::Requirement.default
- s << " #{__platform}" unless __platform == Gem::Platform::RUBY
- s
- end
-
- private
-
- def method_missing(*args, &blk)
- @dep.send(*args, &blk)
- end
- end
-end
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
deleted file mode 100644
index 6c2642163e..0000000000
--- a/lib/bundler/dependency.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-# frozen_string_literal: true
-
-require "rubygems/dependency"
-require_relative "shared_helpers"
-require_relative "rubygems_ext"
-
-module Bundler
- class Dependency < Gem::Dependency
- attr_reader :autorequire
- attr_reader :groups, :platforms, :gemfile, :git, :branch
-
- PLATFORM_MAP = {
- :ruby => Gem::Platform::RUBY,
- :ruby_18 => Gem::Platform::RUBY,
- :ruby_19 => Gem::Platform::RUBY,
- :ruby_20 => Gem::Platform::RUBY,
- :ruby_21 => Gem::Platform::RUBY,
- :ruby_22 => Gem::Platform::RUBY,
- :ruby_23 => Gem::Platform::RUBY,
- :ruby_24 => Gem::Platform::RUBY,
- :ruby_25 => Gem::Platform::RUBY,
- :ruby_26 => Gem::Platform::RUBY,
- :mri => Gem::Platform::RUBY,
- :mri_18 => Gem::Platform::RUBY,
- :mri_19 => Gem::Platform::RUBY,
- :mri_20 => Gem::Platform::RUBY,
- :mri_21 => Gem::Platform::RUBY,
- :mri_22 => Gem::Platform::RUBY,
- :mri_23 => Gem::Platform::RUBY,
- :mri_24 => Gem::Platform::RUBY,
- :mri_25 => Gem::Platform::RUBY,
- :mri_26 => Gem::Platform::RUBY,
- :rbx => Gem::Platform::RUBY,
- :truffleruby => Gem::Platform::RUBY,
- :jruby => Gem::Platform::JAVA,
- :jruby_18 => Gem::Platform::JAVA,
- :jruby_19 => Gem::Platform::JAVA,
- :mswin => Gem::Platform::MSWIN,
- :mswin_18 => Gem::Platform::MSWIN,
- :mswin_19 => Gem::Platform::MSWIN,
- :mswin_20 => Gem::Platform::MSWIN,
- :mswin_21 => Gem::Platform::MSWIN,
- :mswin_22 => Gem::Platform::MSWIN,
- :mswin_23 => Gem::Platform::MSWIN,
- :mswin_24 => Gem::Platform::MSWIN,
- :mswin_25 => Gem::Platform::MSWIN,
- :mswin_26 => Gem::Platform::MSWIN,
- :mswin64 => Gem::Platform::MSWIN64,
- :mswin64_19 => Gem::Platform::MSWIN64,
- :mswin64_20 => Gem::Platform::MSWIN64,
- :mswin64_21 => Gem::Platform::MSWIN64,
- :mswin64_22 => Gem::Platform::MSWIN64,
- :mswin64_23 => Gem::Platform::MSWIN64,
- :mswin64_24 => Gem::Platform::MSWIN64,
- :mswin64_25 => Gem::Platform::MSWIN64,
- :mswin64_26 => Gem::Platform::MSWIN64,
- :mingw => Gem::Platform::MINGW,
- :mingw_18 => Gem::Platform::MINGW,
- :mingw_19 => Gem::Platform::MINGW,
- :mingw_20 => Gem::Platform::MINGW,
- :mingw_21 => Gem::Platform::MINGW,
- :mingw_22 => Gem::Platform::MINGW,
- :mingw_23 => Gem::Platform::MINGW,
- :mingw_24 => Gem::Platform::MINGW,
- :mingw_25 => Gem::Platform::MINGW,
- :mingw_26 => Gem::Platform::MINGW,
- :x64_mingw => Gem::Platform::X64_MINGW,
- :x64_mingw_20 => Gem::Platform::X64_MINGW,
- :x64_mingw_21 => Gem::Platform::X64_MINGW,
- :x64_mingw_22 => Gem::Platform::X64_MINGW,
- :x64_mingw_23 => Gem::Platform::X64_MINGW,
- :x64_mingw_24 => Gem::Platform::X64_MINGW,
- :x64_mingw_25 => Gem::Platform::X64_MINGW,
- :x64_mingw_26 => Gem::Platform::X64_MINGW,
- }.freeze
-
- REVERSE_PLATFORM_MAP = {}.tap do |reverse_platform_map|
- PLATFORM_MAP.each do |key, value|
- reverse_platform_map[value] ||= []
- reverse_platform_map[value] << key
- end
-
- reverse_platform_map.each {|_, platforms| platforms.freeze }
- end.freeze
-
- def initialize(name, version, options = {}, &blk)
- type = options["type"] || :runtime
- super(name, version, type)
-
- @autorequire = nil
- @groups = Array(options["group"] || :default).map(&:to_sym)
- @source = options["source"]
- @git = options["git"]
- @branch = options["branch"]
- @platforms = Array(options["platforms"])
- @env = options["env"]
- @should_include = options.fetch("should_include", true)
- @gemfile = options["gemfile"]
-
- @autorequire = Array(options["require"] || []) if options.key?("require")
- end
-
- # Returns the platforms this dependency is valid for, in the same order as
- # passed in the `valid_platforms` parameter
- def gem_platforms(valid_platforms)
- return valid_platforms if @platforms.empty?
-
- @gem_platforms ||= expanded_platforms.compact.uniq
-
- valid_platforms & @gem_platforms
- end
-
- def expanded_platforms
- @platforms.map {|pl| PLATFORM_MAP[pl] }
- end
-
- def should_include?
- @should_include && current_env? && current_platform?
- end
-
- def current_env?
- return true unless @env
- if @env.is_a?(Hash)
- @env.all? do |key, val|
- ENV[key.to_s] && (val.is_a?(String) ? ENV[key.to_s] == val : ENV[key.to_s] =~ val)
- end
- else
- ENV[@env.to_s]
- end
- end
-
- def current_platform?
- return true if @platforms.empty?
- @platforms.any? do |p|
- Bundler.current_ruby.send("#{p}?")
- end
- end
-
- def to_lock
- out = super
- out << "!" if source
- out << "\n"
- end
-
- def specific?
- super
- rescue NoMethodError
- requirement != ">= 0"
- end
- end
-end
diff --git a/lib/bundler/deployment.rb b/lib/bundler/deployment.rb
deleted file mode 100644
index b432ae6ae1..0000000000
--- a/lib/bundler/deployment.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "shared_helpers"
-Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \
- "Capistrano, but Capistrano provides its own integration with " \
- "Bundler via the capistrano-bundler gem. Use it instead."
-
-module Bundler
- class Deployment
- def self.define_task(context, task_method = :task, opts = {})
- if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
- context_name = "capistrano"
- role_default = "{:except => {:no_release => true}}"
- error_type = ::Capistrano::CommandError
- else
- context_name = "vlad"
- role_default = "[:app]"
- error_type = ::Rake::CommandFailedError
- end
-
- roles = context.fetch(:bundle_roles, false)
- opts[:roles] = roles if roles
-
- context.send :namespace, :bundle do
- send :desc, <<-DESC
- Install the current Bundler environment. By default, gems will be \
- installed to the shared/bundle path. Gems in the development and \
- test group will not be installed. The install command is executed \
- with the --deployment and --quiet flags. If the bundle cmd cannot \
- be found then you can override the bundle_cmd variable to specify \
- which one it should use. The base path to the app is fetched from \
- the :latest_release variable. Set it for custom deploy layouts.
-
- You can override any of these defaults by setting the variables shown below.
-
- N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \
- in your deploy.rb file.
-
- set :bundle_gemfile, "Gemfile"
- set :bundle_dir, File.join(fetch(:shared_path), 'bundle')
- set :bundle_flags, "--deployment --quiet"
- set :bundle_without, [:development, :test]
- set :bundle_with, [:mysql]
- set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle"
- set :bundle_roles, #{role_default} # e.g. [:app, :batch]
- DESC
- send task_method, :install, opts do
- bundle_cmd = context.fetch(:bundle_cmd, "bundle")
- bundle_flags = context.fetch(:bundle_flags, "--deployment --quiet")
- bundle_dir = context.fetch(:bundle_dir, File.join(context.fetch(:shared_path), "bundle"))
- bundle_gemfile = context.fetch(:bundle_gemfile, "Gemfile")
- bundle_without = [*context.fetch(:bundle_without, [:development, :test])].compact
- bundle_with = [*context.fetch(:bundle_with, [])].compact
- app_path = context.fetch(:latest_release)
- if app_path.to_s.empty?
- raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.")
- end
- args = ["--gemfile #{File.join(app_path, bundle_gemfile)}"]
- args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty?
- args << bundle_flags.to_s
- args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty?
- args << "--with #{bundle_with.join(" ")}" unless bundle_with.empty?
-
- run "cd #{app_path} && #{bundle_cmd} install #{args.join(" ")}"
- end
- end
- end
- end
-end
diff --git a/lib/bundler/deprecate.rb b/lib/bundler/deprecate.rb
deleted file mode 100644
index f59533630e..0000000000
--- a/lib/bundler/deprecate.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-begin
- require "rubygems/deprecate"
-rescue LoadError
- # it's fine if it doesn't exist on the current RubyGems...
- nil
-end
-
-module Bundler
- # If Bundler::Deprecate is an autoload constant, we need to define it
- if defined?(Bundler::Deprecate) && !autoload?(:Deprecate)
- # nothing to do!
- elsif defined? ::Deprecate
- Deprecate = ::Deprecate
- elsif defined? Gem::Deprecate
- Deprecate = Gem::Deprecate
- else
- class Deprecate
- end
- end
-
- unless Deprecate.respond_to?(:skip_during)
- def Deprecate.skip_during
- original = skip
- self.skip = true
- yield
- ensure
- self.skip = original
- end
- end
-
- unless Deprecate.respond_to?(:skip)
- def Deprecate.skip
- @skip ||= false
- end
- end
-
- unless Deprecate.respond_to?(:skip=)
- def Deprecate.skip=(skip)
- @skip = skip
- end
- end
-end
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
deleted file mode 100644
index 99a369281a..0000000000
--- a/lib/bundler/dsl.rb
+++ /dev/null
@@ -1,591 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "dependency"
-require_relative "ruby_dsl"
-
-module Bundler
- class Dsl
- include RubyDsl
-
- def self.evaluate(gemfile, lockfile, unlock)
- builder = new
- builder.eval_gemfile(gemfile)
- builder.to_definition(lockfile, unlock)
- end
-
- VALID_PLATFORMS = Bundler::Dependency::PLATFORM_MAP.keys.freeze
-
- VALID_KEYS = %w[group groups git path glob name branch ref tag require submodules
- platform platforms type source install_if gemfile].freeze
-
- attr_reader :gemspecs
- attr_accessor :dependencies
-
- def initialize
- @source = nil
- @sources = SourceList.new
- @git_sources = {}
- @dependencies = []
- @groups = []
- @install_conditionals = []
- @optional_groups = []
- @platforms = []
- @env = nil
- @ruby_version = nil
- @gemspecs = []
- @gemfile = nil
- @gemfiles = []
- add_git_sources
- end
-
- def eval_gemfile(gemfile, contents = nil)
- expanded_gemfile_path = Pathname.new(gemfile).expand_path(@gemfile && @gemfile.parent)
- original_gemfile = @gemfile
- @gemfile = expanded_gemfile_path
- @gemfiles << expanded_gemfile_path
- contents ||= Bundler.read_file(@gemfile.to_s)
- instance_eval(contents.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" }, gemfile.to_s, 1)
- rescue Exception => e # rubocop:disable Lint/RescueException
- message = "There was an error " \
- "#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \
- "`#{File.basename gemfile.to_s}`: #{e.message}"
-
- raise DSLError.new(message, gemfile, e.backtrace, contents)
- ensure
- @gemfile = original_gemfile
- end
-
- def gemspec(opts = nil)
- opts ||= {}
- path = opts[:path] || "."
- glob = opts[:glob]
- name = opts[:name]
- development_group = opts[:development_group] || :development
- expanded_path = gemfile_root.join(path)
-
- gemspecs = Dir[File.join(expanded_path, "{,*}.gemspec")].map {|g| Bundler.load_gemspec(g) }.compact
- gemspecs.reject! {|s| s.name != name } if name
- Index.sort_specs(gemspecs)
- specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
-
- case specs_by_name_and_version.size
- when 1
- specs = specs_by_name_and_version.values.first
- spec = specs.find {|s| s.match_platform(Bundler.local_platform) } || specs.first
-
- @gemspecs << spec
-
- gem_platforms = Bundler::Dependency::REVERSE_PLATFORM_MAP[Bundler::GemHelpers.generic_local_platform]
- gem spec.name, :name => spec.name, :path => path, :glob => glob, :platforms => gem_platforms
-
- group(development_group) do
- spec.development_dependencies.each do |dep|
- gem dep.name, *(dep.requirement.as_list + [:type => :development])
- end
- end
- when 0
- raise InvalidOption, "There are no gemspecs at #{expanded_path}"
- else
- raise InvalidOption, "There are multiple gemspecs at #{expanded_path}. " \
- "Please use the :name option to specify which one should be used"
- end
- end
-
- def gem(name, *args)
- options = args.last.is_a?(Hash) ? args.pop.dup : {}
- options["gemfile"] = @gemfile
- version = args || [">= 0"]
-
- normalize_options(name, version, options)
-
- dep = Dependency.new(name, version, options)
-
- # if there's already a dependency with this name we try to prefer one
- if current = @dependencies.find {|d| d.name == dep.name }
- deleted_dep = @dependencies.delete(current) if current.type == :development
-
- if current.requirement != dep.requirement
- unless deleted_dep
- return if dep.type == :development
-
- update_prompt = ""
-
- if File.basename(@gemfile) == Injector::INJECTED_GEMS
- if dep.requirements_list.include?(">= 0") && !current.requirements_list.include?(">= 0")
- update_prompt = ". Gem already added"
- else
- update_prompt = ". If you want to update the gem version, run `bundle update #{current.name}`"
-
- update_prompt += ". You may also need to change the version requirement specified in the Gemfile if it's too restrictive." unless current.requirements_list.include?(">= 0")
- end
- end
-
- raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
- "You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
- "#{update_prompt}"
- end
-
- else
- Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
- "You should probably keep only one of them.\n" \
- "Remove any duplicate entries and specify the gem only once.\n" \
- "While it's not a problem now, it could cause errors if you change the version of one of them later."
- end
-
- if current.source != dep.source
- unless deleted_dep
- return if dep.type == :development
- raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
- "You specified that #{dep.name} (#{dep.requirement}) should come from " \
- "#{current.source || "an unspecified source"} and #{dep.source}\n"
- end
- end
- end
-
- @dependencies << dep
- end
-
- def source(source, *args, &blk)
- options = args.last.is_a?(Hash) ? args.pop.dup : {}
- options = normalize_hash(options)
- source = normalize_source(source)
-
- if options.key?("type")
- options["type"] = options["type"].to_s
- unless Plugin.source?(options["type"])
- raise InvalidOption, "No plugin sources available for #{options["type"]}"
- end
-
- unless block_given?
- raise InvalidOption, "You need to pass a block to #source with :type option"
- end
-
- source_opts = options.merge("uri" => source)
- with_source(@sources.add_plugin_source(options["type"], source_opts), &blk)
- elsif block_given?
- with_source(@sources.add_rubygems_source("remotes" => source), &blk)
- else
- check_primary_source_safety(@sources)
- @sources.global_rubygems_source = source
- end
- end
-
- def git_source(name, &block)
- unless block_given?
- raise InvalidOption, "You need to pass a block to #git_source"
- end
-
- if valid_keys.include?(name.to_s)
- raise InvalidOption, "You cannot use #{name} as a git source. It " \
- "is a reserved key. Reserved keys are: #{valid_keys.join(", ")}"
- end
-
- @git_sources[name.to_s] = block
- end
-
- def path(path, options = {}, &blk)
- unless block_given?
- msg = "You can no longer specify a path source by itself. Instead, \n" \
- "either use the :path option on a gem, or specify the gems that \n" \
- "bundler should find in the path source by passing a block to \n" \
- "the path method, like: \n\n" \
- " path 'dir/containing/rails' do\n" \
- " gem 'rails'\n" \
- " end\n\n"
-
- raise DeprecatedError, msg if Bundler.feature_flag.disable_multisource?
- SharedHelpers.major_deprecation(2, msg.strip)
- end
-
- source_options = normalize_hash(options).merge(
- "path" => Pathname.new(path),
- "root_path" => gemfile_root,
- "gemspec" => gemspecs.find {|g| g.name == options["name"] }
- )
- source = @sources.add_path_source(source_options)
- with_source(source, &blk)
- end
-
- def git(uri, options = {}, &blk)
- unless block_given?
- msg = "You can no longer specify a git source by itself. Instead, \n" \
- "either use the :git option on a gem, or specify the gems that \n" \
- "bundler should find in the git source by passing a block to \n" \
- "the git method, like: \n\n" \
- " git 'git://github.com/rails/rails.git' do\n" \
- " gem 'rails'\n" \
- " end"
- raise DeprecatedError, msg
- end
-
- with_source(@sources.add_git_source(normalize_hash(options).merge("uri" => uri)), &blk)
- end
-
- def github(repo, options = {})
- raise ArgumentError, "GitHub sources require a block" unless block_given?
- raise DeprecatedError, "The #github method has been removed" if Bundler.feature_flag.skip_default_git_sources?
- github_uri = @git_sources["github"].call(repo)
- git_options = normalize_hash(options).merge("uri" => github_uri)
- git_source = @sources.add_git_source(git_options)
- with_source(git_source) { yield }
- end
-
- def to_definition(lockfile, unlock)
- Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
- end
-
- def group(*args, &blk)
- options = args.last.is_a?(Hash) ? args.pop.dup : {}
- normalize_group_options(options, args)
-
- @groups.concat args
-
- if options["optional"]
- optional_groups = args - @optional_groups
- @optional_groups.concat optional_groups
- end
-
- yield
- ensure
- args.each { @groups.pop }
- end
-
- def install_if(*args)
- @install_conditionals.concat args
- yield
- ensure
- args.each { @install_conditionals.pop }
- end
-
- def platforms(*platforms)
- @platforms.concat platforms
- yield
- ensure
- platforms.each { @platforms.pop }
- end
- alias_method :platform, :platforms
-
- def env(name)
- old = @env
- @env = name
- yield
- ensure
- @env = old
- end
-
- def plugin(*args)
- # Pass on
- end
-
- def method_missing(name, *args)
- raise GemfileError, "Undefined local variable or method `#{name}' for Gemfile"
- end
-
- private
-
- def add_git_sources
- return if Bundler.feature_flag.skip_default_git_sources?
-
- git_source(:github) do |repo_name|
- warn_deprecated_git_source(:github, <<-'RUBY'.strip, 'Change any "reponame" :github sources to "username/reponame".')
-"https://github.com/#{repo_name}.git"
- RUBY
- repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
- "https://github.com/#{repo_name}.git"
- end
-
- git_source(:gist) do |repo_name|
- warn_deprecated_git_source(:gist, '"https://gist.github.com/#{repo_name}.git"')
-
- "https://gist.github.com/#{repo_name}.git"
- end
-
- git_source(:bitbucket) do |repo_name|
- warn_deprecated_git_source(:bitbucket, <<-'RUBY'.strip)
-user_name, repo_name = repo_name.split("/")
-repo_name ||= user_name
-"https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git"
- RUBY
-
- user_name, repo_name = repo_name.split("/")
- repo_name ||= user_name
- "https://#{user_name}@bitbucket.org/#{user_name}/#{repo_name}.git"
- end
- end
-
- def with_source(source)
- old_source = @source
- if block_given?
- @source = source
- yield
- end
- source
- ensure
- @source = old_source
- end
-
- def normalize_hash(opts)
- opts.keys.each do |k|
- opts[k.to_s] = opts.delete(k) unless k.is_a?(String)
- end
- opts
- end
-
- def valid_keys
- @valid_keys ||= VALID_KEYS
- end
-
- def normalize_options(name, version, opts)
- if name.is_a?(Symbol)
- raise GemfileError, %(You need to specify gem names as Strings. Use 'gem "#{name}"' instead)
- end
- if name =~ /\s/
- raise GemfileError, %('#{name}' is not a valid gem name because it contains whitespace)
- end
- raise GemfileError, %(an empty gem name is not valid) if name.empty?
-
- normalize_hash(opts)
-
- git_names = @git_sources.keys.map(&:to_s)
- validate_keys("gem '#{name}'", opts, valid_keys + git_names)
-
- groups = @groups.dup
- opts["group"] = opts.delete("groups") || opts["group"]
- groups.concat Array(opts.delete("group"))
- groups = [:default] if groups.empty?
-
- install_if = @install_conditionals.dup
- install_if.concat Array(opts.delete("install_if"))
- install_if = install_if.reduce(true) do |memo, val|
- memo && (val.respond_to?(:call) ? val.call : val)
- end
-
- platforms = @platforms.dup
- opts["platforms"] = opts["platform"] || opts["platforms"]
- platforms.concat Array(opts.delete("platforms"))
- platforms.map!(&:to_sym)
- platforms.each do |p|
- next if VALID_PLATFORMS.include?(p)
- raise GemfileError, "`#{p}` is not a valid platform. The available options are: #{VALID_PLATFORMS.inspect}"
- end
-
- # Save sources passed in a key
- if opts.key?("source")
- source = normalize_source(opts["source"])
- opts["source"] = @sources.add_rubygems_source("remotes" => source)
- end
-
- git_name = (git_names & opts.keys).last
- if @git_sources[git_name]
- opts["git"] = @git_sources[git_name].call(opts[git_name])
- end
-
- %w[git path].each do |type|
- next unless param = opts[type]
- if version.first && version.first =~ /^\s*=?\s*(\d[^\s]*)\s*$/
- options = opts.merge("name" => name, "version" => $1)
- else
- options = opts.dup
- end
- source = send(type, param, options) {}
- opts["source"] = source
- end
-
- opts["source"] ||= @source
- opts["env"] ||= @env
- opts["platforms"] = platforms.dup
- opts["group"] = groups
- opts["should_include"] = install_if
- end
-
- def normalize_group_options(opts, groups)
- normalize_hash(opts)
-
- groups = groups.map {|group| ":#{group}" }.join(", ")
- validate_keys("group #{groups}", opts, %w[optional])
-
- opts["optional"] ||= false
- end
-
- def validate_keys(command, opts, valid_keys)
- invalid_keys = opts.keys - valid_keys
-
- git_source = opts.keys & @git_sources.keys.map(&:to_s)
- if opts["branch"] && !(opts["git"] || opts["github"] || git_source.any?)
- raise GemfileError, %(The `branch` option for `#{command}` is not allowed. Only gems with a git source can specify a branch)
- end
-
- return true unless invalid_keys.any?
-
- message = String.new
- message << "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} "
- message << if invalid_keys.size > 1
- "as options for #{command}, but they are invalid."
- else
- "as an option for #{command}, but it is invalid."
- end
-
- message << " Valid options are: #{valid_keys.join(", ")}."
- message << " You may be able to resolve this by upgrading Bundler to the newest version."
- raise InvalidOption, message
- end
-
- def normalize_source(source)
- case source
- when :gemcutter, :rubygems, :rubyforge
- Bundler::SharedHelpers.major_deprecation 2, "The source :#{source} is deprecated because HTTP " \
- "requests are insecure.\nPlease change your source to 'https://" \
- "rubygems.org' if possible, or 'http://rubygems.org' if not."
- "http://rubygems.org"
- when String
- source
- else
- raise GemfileError, "Unknown source '#{source}'"
- end
- end
-
- def check_primary_source_safety(source_list)
- return if source_list.rubygems_primary_remotes.empty? && source_list.global_rubygems_source.nil?
-
- if Bundler.feature_flag.disable_multisource?
- msg = "This Gemfile contains multiple primary sources. " \
- "Each source after the first must include a block to indicate which gems " \
- "should come from that source"
- unless Bundler.feature_flag.bundler_2_mode?
- msg += ". To downgrade this error to a warning, run " \
- "`bundle config unset disable_multisource`"
- end
- raise GemfileEvalError, msg
- else
- Bundler::SharedHelpers.major_deprecation 2, "Your Gemfile contains multiple primary sources. " \
- "Using `source` more than once without a block is a security risk, and " \
- "may result in installing unexpected gems. To resolve this warning, use " \
- "a block to indicate which gems should come from the secondary source. " \
- "To upgrade this warning to an error, run `bundle config set " \
- "disable_multisource true`."
- end
- end
-
- def warn_deprecated_git_source(name, replacement, additional_message = nil)
- additional_message &&= " #{additional_message}"
- replacement = if replacement.count("\n").zero?
- "{|repo_name| #{replacement} }"
- else
- "do |repo_name|\n#{replacement.to_s.gsub(/^/, " ")}\n end"
- end
-
- Bundler::SharedHelpers.major_deprecation 3, <<-EOS
-The :#{name} git source is deprecated, and will be removed in the future.#{additional_message} Add this code to the top of your Gemfile to ensure it continues to work:
-
- git_source(:#{name}) #{replacement}
-
- EOS
- end
-
- class DSLError < GemfileError
- # @return [String] the description that should be presented to the user.
- #
- attr_reader :description
-
- # @return [String] the path of the dsl file that raised the exception.
- #
- attr_reader :dsl_path
-
- # @return [Exception] the backtrace of the exception raised by the
- # evaluation of the dsl file.
- #
- attr_reader :backtrace
-
- # @param [Exception] backtrace @see backtrace
- # @param [String] dsl_path @see dsl_path
- #
- def initialize(description, dsl_path, backtrace, contents = nil)
- @status_code = $!.respond_to?(:status_code) && $!.status_code
-
- @description = description
- @dsl_path = dsl_path
- @backtrace = backtrace
- @contents = contents
- end
-
- def status_code
- @status_code || super
- end
-
- # @return [String] the contents of the DSL that cause the exception to
- # be raised.
- #
- def contents
- @contents ||= begin
- dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
- end
- end
-
- # The message of the exception reports the content of podspec for the
- # line that generated the original exception.
- #
- # @example Output
- #
- # Invalid podspec at `RestKit.podspec` - undefined method
- # `exclude_header_search_paths=' for #<Pod::Specification for
- # `RestKit/Network (0.9.3)`>
- #
- # from spec-repos/master/RestKit/0.9.3/RestKit.podspec:36
- # -------------------------------------------
- # # because it would break: #import <CoreData/CoreData.h>
- # > ns.exclude_header_search_paths = 'Code/RestKit.h'
- # end
- # -------------------------------------------
- #
- # @return [String] the message of the exception.
- #
- def to_s
- @to_s ||= begin
- trace_line, description = parse_line_number_from_description
-
- m = String.new("\n[!] ")
- m << description
- m << ". Bundler cannot continue.\n"
-
- return m unless backtrace && dsl_path && contents
-
- trace_line = backtrace.find {|l| l.include?(dsl_path.to_s) } || trace_line
- return m unless trace_line
- line_numer = trace_line.split(":")[1].to_i - 1
- return m unless line_numer
-
- lines = contents.lines.to_a
- indent = " # "
- indicator = indent.tr("#", ">")
- first_line = line_numer.zero?
- last_line = (line_numer == (lines.count - 1))
-
- m << "\n"
- m << "#{indent}from #{trace_line.gsub(/:in.*$/, "")}\n"
- m << "#{indent}-------------------------------------------\n"
- m << "#{indent}#{lines[line_numer - 1]}" unless first_line
- m << "#{indicator}#{lines[line_numer]}"
- m << "#{indent}#{lines[line_numer + 1]}" unless last_line
- m << "\n" unless m.end_with?("\n")
- m << "#{indent}-------------------------------------------\n"
- end
- end
-
- private
-
- def parse_line_number_from_description
- description = self.description
- if dsl_path && description =~ /((#{Regexp.quote File.expand_path(dsl_path)}|#{Regexp.quote dsl_path.to_s}):\d+)/
- trace_line = Regexp.last_match[1]
- description = description.sub(/\n.*\n(\.\.\.)? *\^~+$/, "").sub(/#{Regexp.quote trace_line}:\s*/, "").sub("\n", " - ")
- end
- [trace_line, description]
- end
- end
-
- def gemfile_root
- @gemfile ||= Bundler.default_gemfile
- @gemfile.dirname
- end
- end
-end
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
deleted file mode 100644
index 9a00b64e0e..0000000000
--- a/lib/bundler/endpoint_specification.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # used for Creating Specifications from the Gemcutter Endpoint
- class EndpointSpecification < Gem::Specification
- ILLFORMED_MESSAGE = 'Ill-formed requirement ["#<YAML::Syck::DefaultKey'.freeze
- include MatchPlatform
-
- attr_reader :name, :version, :platform, :required_rubygems_version, :required_ruby_version, :checksum
- attr_accessor :source, :remote, :dependencies
-
- def initialize(name, version, platform, dependencies, metadata = nil)
- super()
- @name = name
- @version = Gem::Version.create version
- @platform = platform
- @dependencies = dependencies.map {|dep, reqs| build_dependency(dep, reqs) }
-
- @loaded_from = nil
- @remote_specification = nil
-
- parse_metadata(metadata)
- end
-
- def fetch_platform
- @platform
- end
-
- # needed for standalone, load required_paths from local gemspec
- # after the gem is installed
- def require_paths
- if @remote_specification
- @remote_specification.require_paths
- elsif _local_specification
- _local_specification.require_paths
- else
- super
- end
- end
-
- # needed for inline
- def load_paths
- # remote specs aren't installed, and can't have load_paths
- if _local_specification
- _local_specification.load_paths
- else
- super
- end
- end
-
- # needed for binstubs
- def executables
- if @remote_specification
- @remote_specification.executables
- elsif _local_specification
- _local_specification.executables
- else
- super
- end
- end
-
- # needed for bundle clean
- def bindir
- if @remote_specification
- @remote_specification.bindir
- elsif _local_specification
- _local_specification.bindir
- else
- super
- end
- end
-
- # needed for post_install_messages during install
- def post_install_message
- if @remote_specification
- @remote_specification.post_install_message
- elsif _local_specification
- _local_specification.post_install_message
- else
- super
- end
- end
-
- # needed for "with native extensions" during install
- def extensions
- if @remote_specification
- @remote_specification.extensions
- elsif _local_specification
- _local_specification.extensions
- else
- super
- end
- end
-
- def _local_specification
- return unless @loaded_from && File.exist?(local_specification_path)
- eval(File.read(local_specification_path)).tap do |spec|
- spec.loaded_from = @loaded_from
- end
- end
-
- def __swap__(spec)
- SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
- @remote_specification = spec
- end
-
- private
-
- def local_specification_path
- "#{base_dir}/specifications/#{full_name}.gemspec"
- end
-
- def parse_metadata(data)
- return unless data
- data.each do |k, v|
- next unless v
- case k.to_s
- when "checksum"
- @checksum = v.last
- when "rubygems"
- @required_rubygems_version = Gem::Requirement.new(v)
- when "ruby"
- @required_ruby_version = Gem::Requirement.new(v)
- end
- end
- rescue StandardError => e
- raise GemspecError, "There was an error parsing the metadata for the gem #{name} (#{version}): #{e.class}\n#{e}\nThe metadata was #{data.inspect}"
- end
-
- def build_dependency(name, requirements)
- Gem::Dependency.new(name, requirements)
- rescue ArgumentError => e
- raise unless e.message.include?(ILLFORMED_MESSAGE)
- puts # we shouldn't print the error message on the "fetching info" status line
- raise GemspecError,
- "Unfortunately, the gem #{name} (#{version}) has an invalid " \
- "gemspec.\nPlease ask the gem author to yank the bad version to fix " \
- "this issue. For more information, see http://bit.ly/syck-defaultkey."
- end
- end
-end
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
deleted file mode 100644
index 17624b4fe9..0000000000
--- a/lib/bundler/env.rb
+++ /dev/null
@@ -1,150 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "rubygems_integration"
-require_relative "source/git/git_proxy"
-
-module Bundler
- class Env
- def self.write(io)
- io.write report
- end
-
- def self.report(options = {})
- print_gemfile = options.delete(:print_gemfile) { true }
- print_gemspecs = options.delete(:print_gemspecs) { true }
-
- out = String.new
- append_formatted_table("Environment", environment, out)
- append_formatted_table("Bundler Build Metadata", BuildMetadata.to_h, out)
-
- unless Bundler.settings.all.empty?
- out << "\n## Bundler settings\n\n```\n"
- Bundler.settings.all.each do |setting|
- out << setting << "\n"
- Bundler.settings.pretty_values_for(setting).each do |line|
- out << " " << line << "\n"
- end
- end
- out << "```\n"
- end
-
- return out unless SharedHelpers.in_bundle?
-
- if print_gemfile
- gemfiles = [Bundler.default_gemfile]
- begin
- gemfiles = Bundler.definition.gemfiles
- rescue GemfileNotFound
- nil
- end
-
- out << "\n## Gemfile\n"
- gemfiles.each do |gemfile|
- out << "\n### #{Pathname.new(gemfile).relative_path_from(SharedHelpers.pwd)}\n\n"
- out << "```ruby\n" << read_file(gemfile).chomp << "\n```\n"
- end
-
- out << "\n### #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
- out << "```\n" << read_file(Bundler.default_lockfile).chomp << "\n```\n"
- end
-
- if print_gemspecs
- dsl = Dsl.new.tap {|d| d.eval_gemfile(Bundler.default_gemfile) }
- out << "\n## Gemspecs\n" unless dsl.gemspecs.empty?
- dsl.gemspecs.each do |gs|
- out << "\n### #{File.basename(gs.loaded_from)}"
- out << "\n\n```ruby\n" << read_file(gs.loaded_from).chomp << "\n```\n"
- end
- end
-
- out
- end
-
- def self.read_file(filename)
- Bundler.read_file(filename.to_s).strip
- rescue Errno::ENOENT
- "<No #{filename} found>"
- rescue RuntimeError => e
- "#{e.class}: #{e.message}"
- end
-
- def self.ruby_version
- str = String.new(RUBY_VERSION)
- str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
- str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{RUBY_PLATFORM}]"
- end
-
- def self.git_version
- Bundler::Source::Git::GitProxy.new(nil, nil, nil).full_version
- rescue Bundler::Source::Git::GitNotInstalledError
- "not installed"
- end
-
- def self.version_of(script)
- return "not installed" unless Bundler.which(script)
- `#{script} --version`.chomp
- end
-
- def self.chruby_version
- return "not installed" unless Bundler.which("chruby-exec")
- `chruby-exec -- chruby --version`.
- sub(/.*^chruby: (#{Gem::Version::VERSION_PATTERN}).*/m, '\1')
- end
-
- def self.environment
- out = []
-
- out << ["Bundler", Bundler::VERSION]
- out << [" Platforms", Gem.platforms.join(", ")]
- out << ["Ruby", ruby_version]
- out << [" Full Path", Gem.ruby]
- out << [" Config Dir", Pathname.new(Gem::ConfigFile::SYSTEM_WIDE_CONFIG_FILE).dirname]
- out << ["RubyGems", Gem::VERSION]
- out << [" Gem Home", Gem.dir]
- out << [" Gem Path", Gem.path.join(File::PATH_SEPARATOR)]
- out << [" User Home", Gem.user_home]
- out << [" User Path", Gem.user_dir]
- out << [" Bin Dir", Gem.bindir]
- if defined?(OpenSSL)
- out << ["OpenSSL"]
- out << [" Compiled", OpenSSL::OPENSSL_VERSION] if defined?(OpenSSL::OPENSSL_VERSION)
- out << [" Loaded", OpenSSL::OPENSSL_LIBRARY_VERSION] if defined?(OpenSSL::OPENSSL_LIBRARY_VERSION)
- out << [" Cert File", OpenSSL::X509::DEFAULT_CERT_FILE] if defined?(OpenSSL::X509::DEFAULT_CERT_FILE)
- out << [" Cert Dir", OpenSSL::X509::DEFAULT_CERT_DIR] if defined?(OpenSSL::X509::DEFAULT_CERT_DIR)
- end
- out << ["Tools"]
- out << [" Git", git_version]
- out << [" RVM", ENV.fetch("rvm_version") { version_of("rvm") }]
- out << [" rbenv", version_of("rbenv")]
- out << [" chruby", chruby_version]
-
- %w[rubygems-bundler open_gem].each do |name|
- specs = Bundler.rubygems.find_name(name)
- out << [" #{name}", "(#{specs.map(&:version).join(",")})"] unless specs.empty?
- end
- if (exe = caller.last.split(":").first) && exe =~ %r{(exe|bin)/bundler?\z}
- shebang = File.read(exe).lines.first
- shebang.sub!(/^#!\s*/, "")
- unless shebang.start_with?(Gem.ruby, "/usr/bin/env ruby")
- out << ["Gem.ruby", Gem.ruby]
- out << ["bundle #!", shebang]
- end
- end
-
- out
- end
-
- def self.append_formatted_table(title, pairs, out)
- return if pairs.empty?
- out << "\n" unless out.empty?
- out << "## #{title}\n\n```\n"
- ljust = pairs.map {|k, _v| k.to_s.length }.max
- pairs.each do |k, v|
- out << "#{k.to_s.ljust(ljust)} #{v}\n"
- end
- out << "```\n"
- end
-
- private_class_method :read_file, :ruby_version, :git_version, :append_formatted_table, :version_of, :chruby_version
- end
-end
diff --git a/lib/bundler/environment_preserver.rb b/lib/bundler/environment_preserver.rb
deleted file mode 100644
index c9014badad..0000000000
--- a/lib/bundler/environment_preserver.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class EnvironmentPreserver
- INTENTIONALLY_NIL = "BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL".freeze
- BUNDLER_KEYS = %w[
- BUNDLE_BIN_PATH
- BUNDLE_GEMFILE
- BUNDLER_VERSION
- GEM_HOME
- GEM_PATH
- MANPATH
- PATH
- RB_USER_INSTALL
- RUBYLIB
- RUBYOPT
- ].map(&:freeze).freeze
- BUNDLER_PREFIX = "BUNDLER_ORIG_".freeze
-
- # @param env [ENV]
- # @param keys [Array<String>]
- def initialize(env, keys)
- @original = env.to_hash
- @keys = keys
- @prefix = BUNDLER_PREFIX
- end
-
- # @return [Hash]
- def backup
- env = @original.clone
- @keys.each do |key|
- value = env[key]
- if !value.nil? && !value.empty?
- env[@prefix + key] ||= value
- elsif value.nil?
- env[@prefix + key] ||= INTENTIONALLY_NIL
- end
- end
- env
- end
-
- # @return [Hash]
- def restore
- env = @original.clone
- @keys.each do |key|
- value_original = env[@prefix + key]
- next if value_original.nil? || value_original.empty?
- if value_original == INTENTIONALLY_NIL
- env.delete(key)
- else
- env[key] = value_original
- end
- env.delete(@prefix + key)
- end
- env
- end
- end
-end
diff --git a/lib/bundler/errors.rb b/lib/bundler/errors.rb
deleted file mode 100644
index e471bce0b6..0000000000
--- a/lib/bundler/errors.rb
+++ /dev/null
@@ -1,158 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class BundlerError < StandardError
- def self.status_code(code)
- define_method(:status_code) { code }
- if match = BundlerError.all_errors.find {|_k, v| v == code }
- error, _ = match
- raise ArgumentError,
- "Trying to register #{self} for status code #{code} but #{error} is already registered"
- end
- BundlerError.all_errors[self] = code
- end
-
- def self.all_errors
- @all_errors ||= {}
- end
- end
-
- class GemfileError < BundlerError; status_code(4); end
- class InstallError < BundlerError; status_code(5); end
-
- # Internal error, should be rescued
- class VersionConflict < BundlerError
- attr_reader :conflicts
-
- def initialize(conflicts, msg = nil)
- super(msg)
- @conflicts = conflicts
- end
-
- status_code(6)
- end
-
- class GemNotFound < BundlerError; status_code(7); end
- class InstallHookError < BundlerError; status_code(8); end
- class GemfileNotFound < BundlerError; status_code(10); end
- class GitError < BundlerError; status_code(11); end
- class DeprecatedError < BundlerError; status_code(12); end
- class PathError < BundlerError; status_code(13); end
- class GemspecError < BundlerError; status_code(14); end
- class InvalidOption < BundlerError; status_code(15); end
- class ProductionError < BundlerError; status_code(16); end
- class HTTPError < BundlerError
- status_code(17)
- def filter_uri(uri)
- URICredentialsFilter.credential_filtered_uri(uri)
- end
- end
- class RubyVersionMismatch < BundlerError; status_code(18); end
- class SecurityError < BundlerError; status_code(19); end
- class LockfileError < BundlerError; status_code(20); end
- class CyclicDependencyError < BundlerError; status_code(21); end
- class GemfileLockNotFound < BundlerError; status_code(22); end
- class PluginError < BundlerError; status_code(29); end
- class SudoNotPermittedError < BundlerError; status_code(30); end
- class ThreadCreationError < BundlerError; status_code(33); end
- class APIResponseMismatchError < BundlerError; status_code(34); end
- class GemfileEvalError < GemfileError; end
- class MarshalError < StandardError; end
-
- class PermissionError < BundlerError
- def initialize(path, permission_type = :write)
- @path = path
- @permission_type = permission_type
- end
-
- def action
- case @permission_type
- when :read then "read from"
- when :write then "write to"
- when :executable, :exec then "execute"
- else @permission_type.to_s
- end
- end
-
- def message
- "There was an error while trying to #{action} `#{@path}`. " \
- "It is likely that you need to grant #{@permission_type} permissions " \
- "for that path."
- end
-
- status_code(23)
- end
-
- class GemRequireError < BundlerError
- attr_reader :orig_exception
-
- def initialize(orig_exception, msg)
- full_message = msg + "\nGem Load Error is: #{orig_exception.message}\n"\
- "Backtrace for gem load error is:\n"\
- "#{orig_exception.backtrace.join("\n")}\n"\
- "Bundler Error Backtrace:\n"
- super(full_message)
- @orig_exception = orig_exception
- end
-
- status_code(24)
- end
-
- class YamlSyntaxError < BundlerError
- attr_reader :orig_exception
-
- def initialize(orig_exception, msg)
- super(msg)
- @orig_exception = orig_exception
- end
-
- status_code(25)
- end
-
- class TemporaryResourceError < PermissionError
- def message
- "There was an error while trying to #{action} `#{@path}`. " \
- "Some resource was temporarily unavailable. It's suggested that you try" \
- "the operation again."
- end
-
- status_code(26)
- end
-
- class VirtualProtocolError < BundlerError
- def message
- "There was an error relating to virtualization and file access." \
- "It is likely that you need to grant access to or mount some file system correctly."
- end
-
- status_code(27)
- end
-
- class OperationNotSupportedError < PermissionError
- def message
- "Attempting to #{action} `#{@path}` is unsupported by your OS."
- end
-
- status_code(28)
- end
-
- class NoSpaceOnDeviceError < PermissionError
- def message
- "There was an error while trying to #{action} `#{@path}`. " \
- "There was insufficient space remaining on the device."
- end
-
- status_code(31)
- end
-
- class GenericSystemCallError < BundlerError
- attr_reader :underlying_error
-
- def initialize(underlying_error, message)
- @underlying_error = underlying_error
- super("#{message}\nThe underlying system error is #{@underlying_error.class}: #{@underlying_error}")
- end
-
- status_code(32)
- end
-end
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
deleted file mode 100644
index 01739ec4aa..0000000000
--- a/lib/bundler/feature_flag.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class FeatureFlag
- def self.settings_flag(flag, &default)
- unless Bundler::Settings::BOOL_KEYS.include?(flag.to_s)
- raise "Cannot use `#{flag}` as a settings feature flag since it isn't a bool key"
- end
-
- settings_method("#{flag}?", flag, &default)
- end
- private_class_method :settings_flag
-
- def self.settings_option(key, &default)
- settings_method(key, key, &default)
- end
- private_class_method :settings_option
-
- def self.settings_method(name, key, &default)
- define_method(name) do
- value = Bundler.settings[key]
- value = instance_eval(&default) if value.nil?
- value
- end
- end
- private_class_method :settings_method
-
- (1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
-
- settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
- settings_flag(:allow_offline_install) { bundler_3_mode? }
- settings_flag(:auto_clean_without_path) { bundler_3_mode? }
- settings_flag(:auto_config_jobs) { bundler_3_mode? }
- settings_flag(:cache_all) { bundler_3_mode? }
- settings_flag(:default_install_uses_path) { bundler_3_mode? }
- settings_flag(:deployment_means_frozen) { bundler_3_mode? }
- settings_flag(:disable_multisource) { bundler_3_mode? }
- settings_flag(:forget_cli_options) { bundler_3_mode? }
- settings_flag(:global_gem_cache) { bundler_3_mode? }
- settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
- settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
- settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
- settings_flag(:print_only_version_number) { bundler_3_mode? }
- settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
- settings_flag(:skip_default_git_sources) { bundler_3_mode? }
- settings_flag(:specific_platform) { bundler_3_mode? }
- settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
- settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
- settings_flag(:update_requires_all_flag) { bundler_4_mode? }
- settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
-
- settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
-
- def initialize(bundler_version)
- @bundler_version = Gem::Version.create(bundler_version)
- end
-
- def major_version
- @bundler_version.segments.first
- end
- private :major_version
- end
-end
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
deleted file mode 100644
index caf33bcfc9..0000000000
--- a/lib/bundler/fetcher.rb
+++ /dev/null
@@ -1,315 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "vendored_persistent"
-require "cgi"
-require "securerandom"
-require "zlib"
-require "rubygems/request"
-
-module Bundler
- # Handles all the fetching with the rubygems server
- class Fetcher
- autoload :CompactIndex, File.expand_path("fetcher/compact_index", __dir__)
- autoload :Downloader, File.expand_path("fetcher/downloader", __dir__)
- autoload :Dependency, File.expand_path("fetcher/dependency", __dir__)
- autoload :Index, File.expand_path("fetcher/index", __dir__)
-
- # This error is raised when it looks like the network is down
- class NetworkDownError < HTTPError; end
- # This error is raised if we should rate limit our requests to the API
- class TooManyRequestsError < HTTPError; end
- # This error is raised if the API returns a 413 (only printed in verbose)
- class FallbackError < HTTPError; end
- # This is the error raised if OpenSSL fails the cert verification
- class CertificateFailureError < HTTPError
- def initialize(remote_uri)
- remote_uri = filter_uri(remote_uri)
- super "Could not verify the SSL certificate for #{remote_uri}.\nThere" \
- " is a chance you are experiencing a man-in-the-middle attack, but" \
- " most likely your system doesn't have the CA certificates needed" \
- " for verification. For information about OpenSSL certificates, see" \
- " http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile" \
- " sources and change 'https' to 'http'."
- end
- end
- # This is the error raised when a source is HTTPS and OpenSSL didn't load
- class SSLError < HTTPError
- def initialize(msg = nil)
- super msg || "Could not load OpenSSL.\n" \
- "You must recompile Ruby with OpenSSL support or change the sources in your " \
- "Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL " \
- "using RVM are available at rvm.io/packages/openssl."
- end
- end
- # This error is raised if HTTP authentication is required, but not provided.
- class AuthenticationRequiredError < HTTPError
- def initialize(remote_uri)
- remote_uri = filter_uri(remote_uri)
- super "Authentication is required for #{remote_uri}.\n" \
- "Please supply credentials for this source. You can do this by running:\n" \
- " bundle config set #{remote_uri} username:password"
- end
- end
- # This error is raised if HTTP authentication is provided, but incorrect.
- class BadAuthenticationError < HTTPError
- def initialize(remote_uri)
- remote_uri = filter_uri(remote_uri)
- super "Bad username or password for #{remote_uri}.\n" \
- "Please double-check your credentials and correct them."
- end
- end
-
- # Exceptions classes that should bypass retry attempts. If your password didn't work the
- # first time, it's not going to the third time.
- NET_ERRORS = [:HTTPBadGateway, :HTTPBadRequest, :HTTPFailedDependency,
- :HTTPForbidden, :HTTPInsufficientStorage, :HTTPMethodNotAllowed,
- :HTTPMovedPermanently, :HTTPNoContent, :HTTPNotFound,
- :HTTPNotImplemented, :HTTPPreconditionFailed, :HTTPRequestEntityTooLarge,
- :HTTPRequestURITooLong, :HTTPUnauthorized, :HTTPUnprocessableEntity,
- :HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
- FAIL_ERRORS = begin
- fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
- fail_errors << Gem::Requirement::BadRequirementError if defined?(Gem::Requirement::BadRequirementError)
- fail_errors.concat(NET_ERRORS.map {|e| SharedHelpers.const_get_safely(e, Net) }.compact)
- end.freeze
-
- class << self
- attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries
- end
-
- self.redirect_limit = Bundler.settings[:redirect] # How many redirects to allow in one request
- self.api_timeout = Bundler.settings[:timeout] # How long to wait for each API call
- self.max_retries = Bundler.settings[:retry] # How many retries for the API call
-
- def initialize(remote)
- @remote = remote
-
- Socket.do_not_reverse_lookup = true
- connection # create persistent connection
- end
-
- def uri
- @remote.anonymized_uri
- end
-
- # fetch a gem specification
- def fetch_spec(spec)
- spec -= [nil, "ruby", ""]
- spec_file_name = "#{spec.join "-"}.gemspec"
-
- uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
- if uri.scheme == "file"
- path = Bundler.rubygems.correct_for_windows_path(uri.path)
- Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
- elsif cached_spec_path = gemspec_cached_path(spec_file_name)
- Bundler.load_gemspec(cached_spec_path)
- else
- Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
- end
- rescue MarshalError
- raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
- "Your network or your gem server is probably having issues right now."
- end
-
- # return the specs in the bundler format as an index with retries
- def specs_with_retry(gem_names, source)
- Bundler::Retry.new("fetcher", FAIL_ERRORS).attempts do
- specs(gem_names, source)
- end
- end
-
- # return the specs in the bundler format as an index
- def specs(gem_names, source)
- old = Bundler.rubygems.sources
- index = Bundler::Index.new
-
- if Bundler::Fetcher.disable_endpoint
- @use_api = false
- specs = fetchers.last.specs(gem_names)
- else
- specs = []
- fetchers.shift until fetchers.first.available? || fetchers.empty?
- fetchers.dup.each do |f|
- break unless f.api_fetcher? && !gem_names || !specs = f.specs(gem_names)
- fetchers.delete(f)
- end
- @use_api = false if fetchers.none?(&:api_fetcher?)
- end
-
- specs.each do |name, version, platform, dependencies, metadata|
- next if name == "bundler"
- spec = if dependencies
- EndpointSpecification.new(name, version, platform, dependencies, metadata)
- else
- RemoteSpecification.new(name, version, platform, self)
- end
- spec.source = source
- spec.remote = @remote
- index << spec
- end
-
- index
- rescue CertificateFailureError
- Bundler.ui.info "" if gem_names && use_api # newline after dots
- raise
- ensure
- Bundler.rubygems.sources = old
- end
-
- def use_api
- return @use_api if defined?(@use_api)
-
- fetchers.shift until fetchers.first.available?
-
- @use_api = if remote_uri.scheme == "file" || Bundler::Fetcher.disable_endpoint
- false
- else
- fetchers.first.api_fetcher?
- end
- end
-
- def user_agent
- @user_agent ||= begin
- ruby = Bundler::RubyVersion.system
-
- agent = String.new("bundler/#{Bundler::VERSION}")
- agent << " rubygems/#{Gem::VERSION}"
- agent << " ruby/#{ruby.versions_string(ruby.versions)}"
- agent << " (#{ruby.host})"
- agent << " command/#{ARGV.first}"
-
- if ruby.engine != "ruby"
- # engine_version raises on unknown engines
- engine_version = begin
- ruby.engine_versions
- rescue RuntimeError
- "???"
- end
- agent << " #{ruby.engine}/#{ruby.versions_string(engine_version)}"
- end
-
- agent << " options/#{Bundler.settings.all.join(",")}"
-
- agent << " ci/#{cis.join(",")}" if cis.any?
-
- # add a random ID so we can consolidate runs server-side
- agent << " " << SecureRandom.hex(8)
-
- # add any user agent strings set in the config
- extra_ua = Bundler.settings[:user_agent]
- agent << " " << extra_ua if extra_ua
-
- agent
- end
- end
-
- def fetchers
- @fetchers ||= FETCHERS.map {|f| f.new(downloader, @remote, uri) }
- end
-
- def http_proxy
- return unless uri = connection.proxy_uri
- uri.to_s
- end
-
- def inspect
- "#<#{self.class}:0x#{object_id} uri=#{uri}>"
- end
-
- private
-
- FETCHERS = [CompactIndex, Dependency, Index].freeze
-
- def cis
- env_cis = {
- "TRAVIS" => "travis",
- "CIRCLECI" => "circle",
- "SEMAPHORE" => "semaphore",
- "JENKINS_URL" => "jenkins",
- "BUILDBOX" => "buildbox",
- "GO_SERVER_URL" => "go",
- "SNAP_CI" => "snap",
- "CI_NAME" => ENV["CI_NAME"],
- "CI" => "ci",
- }
- env_cis.find_all {|env, _| ENV[env] }.map {|_, ci| ci }
- end
-
- def connection
- @connection ||= begin
- needs_ssl = remote_uri.scheme == "https" ||
- Bundler.settings[:ssl_verify_mode] ||
- Bundler.settings[:ssl_client_cert]
- raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
-
- con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
- if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
- con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
- end
-
- if remote_uri.scheme == "https"
- con.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
- OpenSSL::SSL::VERIFY_PEER)
- con.cert_store = bundler_cert_store
- end
-
- ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
- (Bundler.rubygems.configuration.ssl_client_cert if
- Bundler.rubygems.configuration.respond_to?(:ssl_client_cert))
- if ssl_client_cert
- pem = File.read(ssl_client_cert)
- con.cert = OpenSSL::X509::Certificate.new(pem)
- con.key = OpenSSL::PKey::RSA.new(pem)
- end
-
- con.read_timeout = Fetcher.api_timeout
- con.open_timeout = Fetcher.api_timeout
- con.override_headers["User-Agent"] = user_agent
- con.override_headers["X-Gemfile-Source"] = @remote.original_uri.to_s if @remote.original_uri
- con
- end
- end
-
- # cached gem specification path, if one exists
- def gemspec_cached_path(spec_file_name)
- paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
- paths = paths.select {|path| File.file? path }
- paths.first
- end
-
- HTTP_ERRORS = [
- Timeout::Error, EOFError, SocketError, Errno::ENETDOWN, Errno::ENETUNREACH,
- Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
- Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
- PersistentHTTP::Error, Zlib::BufError, Errno::EHOSTUNREACH
- ].freeze
-
- def bundler_cert_store
- store = OpenSSL::X509::Store.new
- ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
- (Bundler.rubygems.configuration.ssl_ca_cert if
- Bundler.rubygems.configuration.respond_to?(:ssl_ca_cert))
- if ssl_ca_cert
- if File.directory? ssl_ca_cert
- store.add_path ssl_ca_cert
- else
- store.add_file ssl_ca_cert
- end
- else
- store.set_default_paths
- Gem::Request.get_cert_files.each {|c| store.add_file c }
- end
- store
- end
-
- private
-
- def remote_uri
- @remote.uri
- end
-
- def downloader
- @downloader ||= Downloader.new(connection, self.class.redirect_limit)
- end
- end
-end
diff --git a/lib/bundler/fetcher/base.rb b/lib/bundler/fetcher/base.rb
deleted file mode 100644
index 27987f670a..0000000000
--- a/lib/bundler/fetcher/base.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Fetcher
- class Base
- attr_reader :downloader
- attr_reader :display_uri
- attr_reader :remote
-
- def initialize(downloader, remote, display_uri)
- raise "Abstract class" if self.class == Base
- @downloader = downloader
- @remote = remote
- @display_uri = display_uri
- end
-
- def remote_uri
- @remote.uri
- end
-
- def fetch_uri
- @fetch_uri ||= begin
- if remote_uri.host == "rubygems.org"
- uri = remote_uri.dup
- uri.host = "index.rubygems.org"
- uri
- else
- remote_uri
- end
- end
- end
-
- def available?
- true
- end
-
- def api_fetcher?
- false
- end
-
- private
-
- def log_specs(debug_msg)
- if Bundler.ui.debug?
- Bundler.ui.debug debug_msg
- else
- Bundler.ui.info ".", false
- end
- end
- end
- end
-end
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
deleted file mode 100644
index f36d76d4ae..0000000000
--- a/lib/bundler/fetcher/compact_index.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "base"
-require_relative "../worker"
-
-module Bundler
- autoload :CompactIndexClient, File.expand_path("../compact_index_client", __dir__)
-
- class Fetcher
- class CompactIndex < Base
- def self.compact_index_request(method_name)
- method = instance_method(method_name)
- undef_method(method_name)
- define_method(method_name) do |*args, &blk|
- begin
- method.bind(self).call(*args, &blk)
- rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
- raise HTTPError, e.message
- rescue AuthenticationRequiredError
- # Fail since we got a 401 from the server.
- raise
- rescue HTTPError => e
- Bundler.ui.trace(e)
- nil
- end
- end
- end
-
- def specs(gem_names)
- specs_for_names(gem_names)
- end
- compact_index_request :specs
-
- def specs_for_names(gem_names)
- gem_info = []
- complete_gems = []
- remaining_gems = gem_names.dup
-
- until remaining_gems.empty?
- log_specs "Looking up gems #{remaining_gems.inspect}"
-
- deps = begin
- parallel_compact_index_client.dependencies(remaining_gems)
- rescue TooManyRequestsError
- @bundle_worker.stop if @bundle_worker
- @bundle_worker = nil # reset it. Not sure if necessary
- serial_compact_index_client.dependencies(remaining_gems)
- end
- next_gems = deps.map {|d| d[3].map(&:first).flatten(1) }.flatten(1).uniq
- deps.each {|dep| gem_info << dep }
- complete_gems.concat(deps.map(&:first)).uniq!
- remaining_gems = next_gems - complete_gems
- end
- @bundle_worker.stop if @bundle_worker
- @bundle_worker = nil # reset it. Not sure if necessary
-
- gem_info
- end
-
- def fetch_spec(spec)
- spec -= [nil, "ruby", ""]
- contents = compact_index_client.spec(*spec)
- return nil if contents.nil?
- contents.unshift(spec.first)
- contents[3].map! {|d| Gem::Dependency.new(*d) }
- EndpointSpecification.new(*contents)
- end
- compact_index_request :fetch_spec
-
- def available?
- return nil unless SharedHelpers.md5_available?
- user_home = Bundler.user_home
- return nil unless user_home.directory? && user_home.writable?
- # Read info file checksums out of /versions, so we can know if gems are up to date
- fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums!
- rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
- Bundler.ui.debug(e.message)
- nil
- end
- compact_index_request :available?
-
- def api_fetcher?
- true
- end
-
- private
-
- def compact_index_client
- @compact_index_client ||=
- SharedHelpers.filesystem_access(cache_path) do
- CompactIndexClient.new(cache_path, client_fetcher)
- end
- end
-
- def parallel_compact_index_client
- compact_index_client.execution_mode = lambda do |inputs, &blk|
- func = lambda {|object, _index| blk.call(object) }
- worker = bundle_worker(func)
- inputs.each {|input| worker.enq(input) }
- inputs.map { worker.deq }
- end
-
- compact_index_client
- end
-
- def serial_compact_index_client
- compact_index_client.sequential_execution_mode!
- compact_index_client
- end
-
- def bundle_worker(func = nil)
- @bundle_worker ||= begin
- worker_name = "Compact Index (#{display_uri.host})"
- Bundler::Worker.new(Bundler.current_ruby.rbx? ? 1 : 25, worker_name, func)
- end
- @bundle_worker.tap do |worker|
- worker.instance_variable_set(:@func, func) if func
- end
- end
-
- def cache_path
- Bundler.user_cache.join("compact_index", remote.cache_slug)
- end
-
- def client_fetcher
- ClientFetcher.new(self, Bundler.ui)
- end
-
- ClientFetcher = Struct.new(:fetcher, :ui) do
- def call(path, headers)
- fetcher.downloader.fetch(fetcher.fetch_uri + path, headers)
- rescue NetworkDownError => e
- raise unless Bundler.feature_flag.allow_offline_install? && headers["If-None-Match"]
- ui.warn "Using the cached data for the new index because of a network error: #{e}"
- Net::HTTPNotModified.new(nil, nil, nil)
- end
- end
- end
- end
-end
diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb
deleted file mode 100644
index c52c32fb5b..0000000000
--- a/lib/bundler/fetcher/dependency.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "base"
-require "cgi"
-
-module Bundler
- class Fetcher
- class Dependency < Base
- def available?
- @available ||= fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri)
- rescue NetworkDownError => e
- raise HTTPError, e.message
- rescue AuthenticationRequiredError
- # Fail since we got a 401 from the server.
- raise
- rescue HTTPError
- false
- end
-
- def api_fetcher?
- true
- end
-
- def specs(gem_names, full_dependency_list = [], last_spec_list = [])
- query_list = gem_names.uniq - full_dependency_list
-
- log_specs "Query List: #{query_list.inspect}"
-
- return last_spec_list if query_list.empty?
-
- spec_list, deps_list = Bundler::Retry.new("dependency api", FAIL_ERRORS).attempts do
- dependency_specs(query_list)
- end
-
- returned_gems = spec_list.map(&:first).uniq
- specs(deps_list, full_dependency_list + returned_gems, spec_list + last_spec_list)
- rescue MarshalError
- Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
- Bundler.ui.debug "could not fetch from the dependency API, trying the full index"
- nil
- rescue HTTPError, GemspecError
- Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
- Bundler.ui.debug "could not fetch from the dependency API\nit's suggested to retry using the full index via `bundle install --full-index`"
- nil
- end
-
- def dependency_specs(gem_names)
- Bundler.ui.debug "Query Gemcutter Dependency Endpoint API: #{gem_names.join(",")}"
-
- gem_list = unmarshalled_dep_gems(gem_names)
- get_formatted_specs_and_deps(gem_list)
- end
-
- def unmarshalled_dep_gems(gem_names)
- gem_list = []
- gem_names.each_slice(Source::Rubygems::API_REQUEST_SIZE) do |names|
- marshalled_deps = downloader.fetch(dependency_api_uri(names)).body
- gem_list.concat(Bundler.load_marshal(marshalled_deps))
- end
- gem_list
- end
-
- def get_formatted_specs_and_deps(gem_list)
- deps_list = []
- spec_list = []
-
- gem_list.each do |s|
- deps_list.concat(s[:dependencies].map(&:first))
- deps = s[:dependencies].map {|n, d| [n, d.split(", ")] }
- spec_list.push([s[:name], s[:number], s[:platform], deps])
- end
- [spec_list, deps_list]
- end
-
- def dependency_api_uri(gem_names = [])
- uri = fetch_uri + "api/v1/dependencies"
- uri.query = "gems=#{CGI.escape(gem_names.sort.join(","))}" if gem_names.any?
- uri
- end
- end
- end
-end
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
deleted file mode 100644
index 498852c174..0000000000
--- a/lib/bundler/fetcher/downloader.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Fetcher
- class Downloader
- attr_reader :connection
- attr_reader :redirect_limit
-
- def initialize(connection, redirect_limit)
- @connection = connection
- @redirect_limit = redirect_limit
- end
-
- def fetch(uri, headers = {}, counter = 0)
- raise HTTPError, "Too many redirects" if counter >= redirect_limit
-
- response = request(uri, headers)
- Bundler.ui.debug("HTTP #{response.code} #{response.message} #{uri}")
-
- case response
- when Net::HTTPSuccess, Net::HTTPNotModified
- response
- when Net::HTTPRedirection
- new_uri = Bundler::URI.parse(response["location"])
- if new_uri.host == uri.host
- new_uri.user = uri.user
- new_uri.password = uri.password
- end
- fetch(new_uri, headers, counter + 1)
- when Net::HTTPRequestedRangeNotSatisfiable
- new_headers = headers.dup
- new_headers.delete("Range")
- new_headers["Accept-Encoding"] = "gzip"
- fetch(uri, new_headers)
- when Net::HTTPRequestEntityTooLarge
- raise FallbackError, response.body
- when Net::HTTPTooManyRequests
- raise TooManyRequestsError, response.body
- when Net::HTTPUnauthorized
- raise BadAuthenticationError, uri.host if uri.userinfo
- raise AuthenticationRequiredError, uri.host
- when Net::HTTPNotFound
- raise FallbackError, "Net::HTTPNotFound: #{URICredentialsFilter.credential_filtered_uri(uri)}"
- else
- raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
- end
- end
-
- def request(uri, headers)
- validate_uri_scheme!(uri)
-
- Bundler.ui.debug "HTTP GET #{uri}"
- req = Net::HTTP::Get.new uri.request_uri, headers
- if uri.user
- user = CGI.unescape(uri.user)
- password = uri.password ? CGI.unescape(uri.password) : nil
- req.basic_auth(user, password)
- end
- connection.request(uri, req)
- rescue NoMethodError => e
- raise unless ["undefined method", "use_ssl="].all? {|snippet| e.message.include? snippet }
- raise LoadError.new("cannot load such file -- openssl")
- rescue OpenSSL::SSL::SSLError
- raise CertificateFailureError.new(uri)
- rescue *HTTP_ERRORS => e
- Bundler.ui.trace e
- case e.message
- when /host down:/, /getaddrinfo: nodename nor servname provided/
- raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
- "connection and try again."
- else
- raise HTTPError, "Network error while fetching #{URICredentialsFilter.credential_filtered_uri(uri)}" \
- " (#{e})"
- end
- end
-
- private
-
- def validate_uri_scheme!(uri)
- return if uri.scheme =~ /\Ahttps?\z/
- raise InvalidOption,
- "The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). " \
- "Did you mean `http` or `https`?"
- end
- end
- end
-end
diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb
deleted file mode 100644
index 034a225198..0000000000
--- a/lib/bundler/fetcher/index.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "base"
-require "rubygems/remote_fetcher"
-
-module Bundler
- class Fetcher
- class Index < Base
- def specs(_gem_names)
- Bundler.rubygems.fetch_all_remote_specs(remote)
- rescue Gem::RemoteFetcher::FetchError, OpenSSL::SSL::SSLError, Net::HTTPFatalError => e
- case e.message
- when /certificate verify failed/
- raise CertificateFailureError.new(display_uri)
- when /401/
- raise BadAuthenticationError, remote_uri if remote_uri.userinfo
- raise AuthenticationRequiredError, remote_uri
- when /403/
- raise BadAuthenticationError, remote_uri if remote_uri.userinfo
- raise AuthenticationRequiredError, remote_uri
- else
- Bundler.ui.trace e
- raise HTTPError, "Could not fetch specs from #{display_uri}"
- end
- end
-
- def fetch_spec(spec)
- spec -= [nil, "ruby", ""]
- spec_file_name = "#{spec.join "-"}.gemspec"
-
- uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
- if uri.scheme == "file"
- path = Bundler.rubygems.correct_for_windows_path(uri.path)
- Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
- elsif cached_spec_path = gemspec_cached_path(spec_file_name)
- Bundler.load_gemspec(cached_spec_path)
- else
- Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
- end
- rescue MarshalError
- raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
- "Your network or your gem server is probably having issues right now."
- end
-
- private
-
- # cached gem specification path, if one exists
- def gemspec_cached_path(spec_file_name)
- paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
- paths.find {|path| File.file? path }
- end
- end
- end
-end
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
deleted file mode 100644
index 080697b02c..0000000000
--- a/lib/bundler/friendly_errors.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "vendored_thor"
-
-module Bundler
- module FriendlyErrors
- module_function
-
- def log_error(error)
- case error
- when YamlSyntaxError
- Bundler.ui.error error.message
- Bundler.ui.trace error.orig_exception
- when Dsl::DSLError, GemspecError
- Bundler.ui.error error.message
- when GemRequireError
- Bundler.ui.error error.message
- Bundler.ui.trace error.orig_exception
- when BundlerError
- Bundler.ui.error error.message, :wrap => true
- Bundler.ui.trace error
- when Thor::Error
- Bundler.ui.error error.message
- when LoadError
- raise error unless error.message =~ /cannot load such file -- openssl|openssl.so|libcrypto.so/
- Bundler.ui.error "\nCould not load OpenSSL."
- Bundler.ui.warn <<-WARN, :wrap => true
- You must recompile Ruby with OpenSSL support or change the sources in your \
- Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL \
- using RVM are available at https://rvm.io/packages/openssl.
- WARN
- Bundler.ui.trace error
- when Interrupt
- Bundler.ui.error "\nQuitting..."
- Bundler.ui.trace error
- when Gem::InvalidSpecificationException
- Bundler.ui.error error.message, :wrap => true
- when SystemExit
- when *[defined?(Java::JavaLang::OutOfMemoryError) && Java::JavaLang::OutOfMemoryError].compact
- Bundler.ui.error "\nYour JVM has run out of memory, and Bundler cannot continue. " \
- "You can decrease the amount of memory Bundler needs by removing gems from your Gemfile, " \
- "especially large gems. (Gems can be as large as hundreds of megabytes, and Bundler has to read those files!). " \
- "Alternatively, you can increase the amount of memory the JVM is able to use by running Bundler with jruby -J-Xmx1024m -S bundle (JRuby defaults to 500MB)."
- else request_issue_report_for(error)
- end
- rescue StandardError
- raise error
- end
-
- def exit_status(error)
- case error
- when BundlerError then error.status_code
- when Thor::Error then 15
- when SystemExit then error.status
- else 1
- end
- end
-
- def request_issue_report_for(e)
- Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
- --- ERROR REPORT TEMPLATE -------------------------------------------------------
- # Error Report
-
- ## Questions
-
- Please fill out answers to these questions, it'll help us figure out
- why things are going wrong.
-
- - **What did you do?**
-
- I ran the command `#{$PROGRAM_NAME} #{ARGV.join(" ")}`
-
- - **What did you expect to happen?**
-
- I expected Bundler to...
-
- - **What happened instead?**
-
- Instead, what happened was...
-
- - **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
-
- I tried...
-
- - **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
-
- ...
-
- ## Backtrace
-
- ```
- #{e.class}: #{e.message}
- #{e.backtrace && e.backtrace.join("\n ").chomp}
- ```
-
- #{Bundler::Env.report}
- --- TEMPLATE END ----------------------------------------------------------------
-
- EOS
-
- Bundler.ui.error "Unfortunately, an unexpected error occurred, and Bundler cannot continue."
-
- Bundler.ui.warn <<-EOS.gsub(/^ {8}/, "")
-
- First, try this link to see if there are any existing issue reports for this error:
- #{issues_url(e)}
-
- If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
- https://github.com/bundler/bundler/issues/new
- EOS
- end
-
- def issues_url(exception)
- message = exception.message.lines.first.tr(":", " ").chomp
- message = message.split("-").first if exception.is_a?(Errno)
- require "cgi"
- "https://github.com/bundler/bundler/search?q=" \
- "#{CGI.escape(message)}&type=Issues"
- end
- end
-
- def self.with_friendly_errors
- yield
- rescue SignalException
- raise
- rescue Exception => e # rubocop:disable Lint/RescueException
- FriendlyErrors.log_error(e)
- exit FriendlyErrors.exit_status(e)
- end
-end
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
deleted file mode 100644
index 7d4e382be8..0000000000
--- a/lib/bundler/gem_helper.rb
+++ /dev/null
@@ -1,217 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../bundler"
-require "shellwords"
-
-module Bundler
- class GemHelper
- include Rake::DSL if defined? Rake::DSL
-
- class << self
- # set when install'd.
- attr_accessor :instance
-
- def install_tasks(opts = {})
- new(opts[:dir], opts[:name]).install
- end
-
- def gemspec(&block)
- gemspec = instance.gemspec
- block.call(gemspec) if block
- gemspec
- end
- end
-
- attr_reader :spec_path, :base, :gemspec
-
- def initialize(base = nil, name = nil)
- @base = (base ||= SharedHelpers.pwd)
- gemspecs = name ? [File.join(base, "#{name}.gemspec")] : Dir[File.join(base, "{,*}.gemspec")]
- raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
- @spec_path = gemspecs.first
- @gemspec = Bundler.load_gemspec(@spec_path)
- end
-
- def install
- built_gem_path = nil
-
- desc "Build #{name}-#{version}.gem into the pkg directory."
- task "build" do
- built_gem_path = build_gem
- end
-
- desc "Build and install #{name}-#{version}.gem into system gems."
- task "install" => "build" do
- install_gem(built_gem_path)
- end
-
- desc "Build and install #{name}-#{version}.gem into system gems without network access."
- task "install:local" => "build" do
- install_gem(built_gem_path, :local)
- end
-
- desc "Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{gem_push_host}\n" \
- "To prevent publishing in RubyGems use `gem_push=no rake release`"
- task "release", [:remote] => ["build", "release:guard_clean",
- "release:source_control_push", "release:rubygem_push"] do
- end
-
- task "release:guard_clean" do
- guard_clean
- end
-
- task "release:source_control_push", [:remote] do |_, args|
- tag_version { git_push(args[:remote]) } unless already_tagged?
- end
-
- task "release:rubygem_push" do
- rubygem_push(built_gem_path) if gem_push?
- end
-
- GemHelper.instance = self
- end
-
- def build_gem
- file_name = nil
- sh("#{gem_command} build -V #{spec_path}".shellsplit) do
- file_name = File.basename(built_gem_path)
- SharedHelpers.filesystem_access(File.join(base, "pkg")) {|p| FileUtils.mkdir_p(p) }
- FileUtils.mv(built_gem_path, "pkg")
- Bundler.ui.confirm "#{name} #{version} built to pkg/#{file_name}."
- end
- File.join(base, "pkg", file_name)
- end
-
- def install_gem(built_gem_path = nil, local = false)
- built_gem_path ||= build_gem
- cmd = "#{gem_command} install #{built_gem_path}"
- cmd += " --local" if local
- _, status = sh_with_status(cmd.shellsplit)
- unless status.success?
- raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output"
- end
- Bundler.ui.confirm "#{name} (#{version}) installed."
- end
-
- protected
-
- def rubygem_push(path)
- cmd = %W[#{gem_command} push #{path}]
- cmd << "--key" << gem_key if gem_key
- cmd << "--host" << allowed_push_host if allowed_push_host
- unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file?
- raise "Your rubygems.org credentials aren't set. Run `gem push` to set them."
- end
- sh_with_input(cmd)
- Bundler.ui.confirm "Pushed #{name} #{version} to #{gem_push_host}"
- end
-
- def built_gem_path
- Dir[File.join(base, "#{name}-*.gem")].sort_by {|f| File.mtime(f) }.last
- end
-
- def git_push(remote = "")
- perform_git_push remote
- perform_git_push "#{remote} --tags"
- Bundler.ui.confirm "Pushed git commits and tags."
- end
-
- def allowed_push_host
- @gemspec.metadata["allowed_push_host"] if @gemspec.respond_to?(:metadata)
- end
-
- def gem_push_host
- env_rubygems_host = ENV["RUBYGEMS_HOST"]
- env_rubygems_host = nil if
- env_rubygems_host && env_rubygems_host.empty?
-
- allowed_push_host || env_rubygems_host || "rubygems.org"
- end
-
- def perform_git_push(options = "")
- cmd = "git push #{options}"
- out, status = sh_with_status(cmd)
- return if status.success?
- cmd = cmd.shelljoin if cmd.respond_to?(:shelljoin)
- raise "Couldn't git push. `#{cmd}' failed with the following output:\n\n#{out}\n"
- end
-
- def already_tagged?
- return false unless sh(%w[git tag]).split(/\n/).include?(version_tag)
- Bundler.ui.confirm "Tag #{version_tag} has already been created."
- true
- end
-
- def guard_clean
- clean? && committed? || raise("There are files that need to be committed first.")
- end
-
- def clean?
- sh_with_status(%w[git diff --exit-code])[1].success?
- end
-
- def committed?
- sh_with_status(%w[git diff-index --quiet --cached HEAD])[1].success?
- end
-
- def tag_version
- sh %W[git tag -m Version\ #{version} #{version_tag}]
- Bundler.ui.confirm "Tagged #{version_tag}."
- yield if block_given?
- rescue RuntimeError
- Bundler.ui.error "Untagging #{version_tag} due to error."
- sh_with_status %W[git tag -d #{version_tag}]
- raise
- end
-
- def version
- gemspec.version
- end
-
- def version_tag
- "v#{version}"
- end
-
- def name
- gemspec.name
- end
-
- def sh_with_input(cmd)
- Bundler.ui.debug(cmd)
- SharedHelpers.chdir(base) do
- abort unless Kernel.system(*cmd)
- end
- end
-
- def sh(cmd, &block)
- out, status = sh_with_status(cmd, &block)
- unless status.success?
- cmd = cmd.shelljoin if cmd.respond_to?(:shelljoin)
- raise(out.empty? ? "Running `#{cmd}` failed. Run this command directly for more detailed output." : out)
- end
- out
- end
-
- def sh_with_status(cmd, &block)
- Bundler.ui.debug(cmd)
- SharedHelpers.chdir(base) do
- outbuf = IO.popen(cmd, :err => [:child, :out], &:read)
- status = $?
- block.call(outbuf) if status.success? && block
- [outbuf, status]
- end
- end
-
- def gem_key
- Bundler.settings["gem.push_key"].to_s.downcase if Bundler.settings["gem.push_key"]
- end
-
- def gem_push?
- !%w[n no nil false off 0].include?(ENV["gem_push"].to_s.downcase)
- end
-
- def gem_command
- ENV["GEM_COMMAND"] ? ENV["GEM_COMMAND"] : "gem"
- end
- end
-end
diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb
deleted file mode 100644
index be047f4397..0000000000
--- a/lib/bundler/gem_helpers.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module GemHelpers
- GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant
- GENERICS = [
- [Gem::Platform.new("java"), Gem::Platform.new("java")],
- [Gem::Platform.new("mswin32"), Gem::Platform.new("mswin32")],
- [Gem::Platform.new("mswin64"), Gem::Platform.new("mswin64")],
- [Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")],
- [Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")],
- [Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")],
- [Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")],
- ].freeze
-
- def generic(p)
- GENERIC_CACHE[p] ||= begin
- _, found = GENERICS.find do |match, _generic|
- p.os == match.os && (!match.cpu || p.cpu == match.cpu)
- end
- found || Gem::Platform::RUBY
- end
- end
- module_function :generic
-
- def generic_local_platform
- generic(Bundler.local_platform)
- end
- module_function :generic_local_platform
-
- def platform_specificity_match(spec_platform, user_platform)
- spec_platform = Gem::Platform.new(spec_platform)
- return PlatformMatch::EXACT_MATCH if spec_platform == user_platform
- return PlatformMatch::WORST_MATCH if spec_platform.nil? || spec_platform == Gem::Platform::RUBY || user_platform == Gem::Platform::RUBY
-
- PlatformMatch.new(
- PlatformMatch.os_match(spec_platform, user_platform),
- PlatformMatch.cpu_match(spec_platform, user_platform),
- PlatformMatch.platform_version_match(spec_platform, user_platform)
- )
- end
- module_function :platform_specificity_match
-
- def select_best_platform_match(specs, platform)
- specs.select {|spec| spec.match_platform(platform) }.
- min_by {|spec| platform_specificity_match(spec.platform, platform) }
- end
- module_function :select_best_platform_match
-
- PlatformMatch = Struct.new(:os_match, :cpu_match, :platform_version_match)
- class PlatformMatch
- def <=>(other)
- return nil unless other.is_a?(PlatformMatch)
-
- m = os_match <=> other.os_match
- return m unless m.zero?
-
- m = cpu_match <=> other.cpu_match
- return m unless m.zero?
-
- m = platform_version_match <=> other.platform_version_match
- m
- end
-
- EXACT_MATCH = new(-1, -1, -1).freeze
- WORST_MATCH = new(1_000_000, 1_000_000, 1_000_000).freeze
-
- def self.os_match(spec_platform, user_platform)
- if spec_platform.os == user_platform.os
- 0
- else
- 1
- end
- end
-
- def self.cpu_match(spec_platform, user_platform)
- if spec_platform.cpu == user_platform.cpu
- 0
- elsif spec_platform.cpu == "arm" && user_platform.cpu.to_s.start_with?("arm")
- 0
- elsif spec_platform.cpu.nil? || spec_platform.cpu == "universal"
- 1
- else
- 2
- end
- end
-
- def self.platform_version_match(spec_platform, user_platform)
- if spec_platform.version == user_platform.version
- 0
- elsif spec_platform.version.nil?
- 1
- else
- 2
- end
- end
- end
- end
-end
diff --git a/lib/bundler/gem_remote_fetcher.rb b/lib/bundler/gem_remote_fetcher.rb
deleted file mode 100644
index 9577535d63..0000000000
--- a/lib/bundler/gem_remote_fetcher.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-require "rubygems/remote_fetcher"
-
-module Bundler
- # Adds support for setting custom HTTP headers when fetching gems from the
- # server.
- #
- # TODO: Get rid of this when and if gemstash only supports RubyGems versions
- # that contain https://github.com/rubygems/rubygems/commit/3db265cc20b2f813.
- class GemRemoteFetcher < Gem::RemoteFetcher
- attr_accessor :headers
-
- # Extracted from RubyGems 2.4.
- def fetch_http(uri, last_modified = nil, head = false, depth = 0)
- fetch_type = head ? Net::HTTP::Head : Net::HTTP::Get
- # beginning of change
- response = request uri, fetch_type, last_modified do |req|
- headers.each {|k, v| req.add_field(k, v) } if headers
- end
- # end of change
-
- case response
- when Net::HTTPOK, Net::HTTPNotModified then
- response.uri = uri if response.respond_to? :uri
- head ? response : response.body
- when Net::HTTPMovedPermanently, Net::HTTPFound, Net::HTTPSeeOther,
- Net::HTTPTemporaryRedirect then
- raise FetchError.new("too many redirects", uri) if depth > 10
-
- location = URI.parse response["Location"]
-
- if https?(uri) && !https?(location)
- raise FetchError.new("redirecting to non-https resource: #{location}", uri)
- end
-
- fetch_http(location, last_modified, head, depth + 1)
- else
- raise FetchError.new("bad response #{response.message} #{response.code}", uri)
- end
- end
- end
-end
diff --git a/lib/bundler/gem_tasks.rb b/lib/bundler/gem_tasks.rb
deleted file mode 100644
index bc725d3602..0000000000
--- a/lib/bundler/gem_tasks.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require "rake/clean"
-CLOBBER.include "pkg"
-
-require_relative "gem_helper"
-Bundler::GemHelper.install_tasks
diff --git a/lib/bundler/gem_version_promoter.rb b/lib/bundler/gem_version_promoter.rb
deleted file mode 100644
index 311b0cbbf3..0000000000
--- a/lib/bundler/gem_version_promoter.rb
+++ /dev/null
@@ -1,190 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # This class contains all of the logic for determining the next version of a
- # Gem to update to based on the requested level (patch, minor, major).
- # Primarily designed to work with Resolver which will provide it the list of
- # available dependency versions as found in its index, before returning it to
- # to the resolution engine to select the best version.
- class GemVersionPromoter
- DEBUG = ENV["DEBUG_RESOLVER"]
-
- attr_reader :level, :locked_specs, :unlock_gems
-
- # By default, strict is false, meaning every available version of a gem
- # is returned from sort_versions. The order gives preference to the
- # requested level (:patch, :minor, :major) but in complicated requirement
- # cases some gems will by necessity by promoted past the requested level,
- # or even reverted to older versions.
- #
- # If strict is set to true, the results from sort_versions will be
- # truncated, eliminating any version outside the current level scope.
- # This can lead to unexpected outcomes or even VersionConflict exceptions
- # that report a version of a gem not existing for versions that indeed do
- # existing in the referenced source.
- attr_accessor :strict
-
- attr_accessor :prerelease_specified
-
- # Given a list of locked_specs and a list of gems to unlock creates a
- # GemVersionPromoter instance.
- #
- # @param locked_specs [SpecSet] All current locked specs. Unlike Definition
- # where this list is empty if all gems are being updated, this should
- # always be populated for all gems so this class can properly function.
- # @param unlock_gems [String] List of gem names being unlocked. If empty,
- # all gems will be considered unlocked.
- # @return [GemVersionPromoter]
- def initialize(locked_specs = SpecSet.new([]), unlock_gems = [])
- @level = :major
- @strict = false
- @locked_specs = locked_specs
- @unlock_gems = unlock_gems
- @sort_versions = {}
- @prerelease_specified = {}
- end
-
- # @param value [Symbol] One of three Symbols: :major, :minor or :patch.
- def level=(value)
- v = case value
- when String, Symbol
- value.to_sym
- end
-
- raise ArgumentError, "Unexpected level #{v}. Must be :major, :minor or :patch" unless [:major, :minor, :patch].include?(v)
- @level = v
- end
-
- # Given a Dependency and an Array of SpecGroups of available versions for a
- # gem, this method will return the Array of SpecGroups sorted (and possibly
- # truncated if strict is true) in an order to give preference to the current
- # level (:major, :minor or :patch) when resolution is deciding what versions
- # best resolve all dependencies in the bundle.
- # @param dep [Dependency] The Dependency of the gem.
- # @param spec_groups [SpecGroup] An array of SpecGroups for the same gem
- # named in the @dep param.
- # @return [SpecGroup] A new instance of the SpecGroup Array sorted and
- # possibly filtered.
- def sort_versions(dep, spec_groups)
- before_result = "before sort_versions: #{debug_format_result(dep, spec_groups).inspect}" if DEBUG
-
- @sort_versions[dep] ||= begin
- gem_name = dep.name
-
- # An Array per version returned, different entries for different platforms.
- # We only need the version here so it's ok to hard code this to the first instance.
- locked_spec = locked_specs[gem_name].first
-
- if strict
- filter_dep_specs(spec_groups, locked_spec)
- else
- sort_dep_specs(spec_groups, locked_spec)
- end.tap do |specs|
- if DEBUG
- warn before_result
- warn " after sort_versions: #{debug_format_result(dep, specs).inspect}"
- end
- end
- end
- end
-
- # @return [bool] Convenience method for testing value of level variable.
- def major?
- level == :major
- end
-
- # @return [bool] Convenience method for testing value of level variable.
- def minor?
- level == :minor
- end
-
- private
-
- def filter_dep_specs(spec_groups, locked_spec)
- res = spec_groups.select do |spec_group|
- if locked_spec && !major?
- gsv = spec_group.version
- lsv = locked_spec.version
-
- must_match = minor? ? [0] : [0, 1]
-
- matches = must_match.map {|idx| gsv.segments[idx] == lsv.segments[idx] }
- matches.uniq == [true] ? (gsv >= lsv) : false
- else
- true
- end
- end
-
- sort_dep_specs(res, locked_spec)
- end
-
- def sort_dep_specs(spec_groups, locked_spec)
- return spec_groups unless locked_spec
- @gem_name = locked_spec.name
- @locked_version = locked_spec.version
-
- result = spec_groups.sort do |a, b|
- @a_ver = a.version
- @b_ver = b.version
-
- unless @prerelease_specified[@gem_name]
- a_pre = @a_ver.prerelease?
- b_pre = @b_ver.prerelease?
-
- next -1 if a_pre && !b_pre
- next 1 if b_pre && !a_pre
- end
-
- if major?
- @a_ver <=> @b_ver
- elsif either_version_older_than_locked
- @a_ver <=> @b_ver
- elsif segments_do_not_match(:major)
- @b_ver <=> @a_ver
- elsif !minor? && segments_do_not_match(:minor)
- @b_ver <=> @a_ver
- else
- @a_ver <=> @b_ver
- end
- end
- post_sort(result)
- end
-
- def either_version_older_than_locked
- @a_ver < @locked_version || @b_ver < @locked_version
- end
-
- def segments_do_not_match(level)
- index = [:major, :minor].index(level)
- @a_ver.segments[index] != @b_ver.segments[index]
- end
-
- def unlocking_gem?
- unlock_gems.empty? || unlock_gems.include?(@gem_name)
- end
-
- # Specific version moves can't always reliably be done during sorting
- # as not all elements are compared against each other.
- def post_sort(result)
- # default :major behavior in Bundler does not do this
- return result if major?
- if unlocking_gem?
- result
- else
- move_version_to_end(result, @locked_version)
- end
- end
-
- def move_version_to_end(result, version)
- move, keep = result.partition {|s| s.version.to_s == version.to_s }
- keep.concat(move)
- end
-
- def debug_format_result(dep, spec_groups)
- a = [dep.to_s,
- spec_groups.map {|sg| [sg.version, sg.dependencies_for_activated_platforms.map {|dp| [dp.name, dp.requirement.to_s] }] }]
- last_map = a.last.map {|sg_data| [sg_data.first.version, sg_data.last.map {|aa| aa.join(" ") }] }
- [a.first, last_map, level, strict ? :strict : :not_strict]
- end
- end
-end
diff --git a/lib/bundler/gemdeps.rb b/lib/bundler/gemdeps.rb
deleted file mode 100644
index cd4b25d0e6..0000000000
--- a/lib/bundler/gemdeps.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Gemdeps
- def initialize(runtime)
- @runtime = runtime
- end
-
- def requested_specs
- @runtime.requested_specs
- end
-
- def specs
- @runtime.specs
- end
-
- def dependencies
- @runtime.dependencies
- end
-
- def current_dependencies
- @runtime.current_dependencies
- end
-
- def requires
- @runtime.requires
- end
- end
-end
diff --git a/lib/bundler/graph.rb b/lib/bundler/graph.rb
deleted file mode 100644
index 5644e41079..0000000000
--- a/lib/bundler/graph.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-# frozen_string_literal: true
-
-require "set"
-module Bundler
- class Graph
- GRAPH_NAME = :Gemfile
-
- def initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png", without = [])
- @env = env
- @output_file = output_file
- @show_version = show_version
- @show_requirements = show_requirements
- @output_format = output_format
- @without_groups = without.map(&:to_sym)
-
- @groups = []
- @relations = Hash.new {|h, k| h[k] = Set.new }
- @node_options = {}
- @edge_options = {}
-
- _populate_relations
- end
-
- attr_reader :groups, :relations, :node_options, :edge_options, :output_file, :output_format
-
- def viz
- GraphVizClient.new(self).run
- end
-
- private
-
- def _populate_relations
- parent_dependencies = _groups.values.to_set.flatten
- loop do
- break if parent_dependencies.empty?
-
- tmp = Set.new
- parent_dependencies.each do |dependency|
- child_dependencies = spec_for_dependency(dependency).runtime_dependencies.to_set
- @relations[dependency.name] += child_dependencies.map(&:name).to_set
- tmp += child_dependencies
-
- @node_options[dependency.name] = _make_label(dependency, :node)
- child_dependencies.each do |c_dependency|
- @edge_options["#{dependency.name}_#{c_dependency.name}"] = _make_label(c_dependency, :edge)
- end
- end
- parent_dependencies = tmp
- end
- end
-
- def _groups
- relations = Hash.new {|h, k| h[k] = Set.new }
- @env.current_dependencies.each do |dependency|
- dependency.groups.each do |group|
- next if @without_groups.include?(group)
-
- relations[group.to_s].add(dependency)
- @relations[group.to_s].add(dependency.name)
-
- @node_options[group.to_s] ||= _make_label(group, :node)
- @edge_options["#{group}_#{dependency.name}"] = _make_label(dependency, :edge)
- end
- end
- @groups = relations.keys
- relations
- end
-
- def _make_label(symbol_or_string_or_dependency, element_type)
- case element_type.to_sym
- when :node
- if symbol_or_string_or_dependency.is_a?(Gem::Dependency)
- label = symbol_or_string_or_dependency.name.dup
- label << "\n#{spec_for_dependency(symbol_or_string_or_dependency).version}" if @show_version
- else
- label = symbol_or_string_or_dependency.to_s
- end
- when :edge
- label = nil
- if symbol_or_string_or_dependency.respond_to?(:requirements_list) && @show_requirements
- tmp = symbol_or_string_or_dependency.requirements_list.join(", ")
- label = tmp if tmp != ">= 0"
- end
- else
- raise ArgumentError, "2nd argument is invalid"
- end
- label.nil? ? {} : { :label => label }
- end
-
- def spec_for_dependency(dependency)
- @env.requested_specs.find {|s| s.name == dependency.name }
- end
-
- class GraphVizClient
- def initialize(graph_instance)
- @graph_name = graph_instance.class::GRAPH_NAME
- @groups = graph_instance.groups
- @relations = graph_instance.relations
- @node_options = graph_instance.node_options
- @edge_options = graph_instance.edge_options
- @output_file = graph_instance.output_file
- @output_format = graph_instance.output_format
- end
-
- def g
- @g ||= ::GraphViz.digraph(@graph_name, :concentrate => true, :normalize => true, :nodesep => 0.55) do |g|
- g.edge[:weight] = 2
- g.edge[:fontname] = g.node[:fontname] = "Arial, Helvetica, SansSerif"
- g.edge[:fontsize] = 12
- end
- end
-
- def run
- @groups.each do |group|
- g.add_nodes(
- group, {
- :style => "filled",
- :fillcolor => "#B9B9D5",
- :shape => "box3d",
- :fontsize => 16,
- }.merge(@node_options[group])
- )
- end
-
- @relations.each do |parent, children|
- children.each do |child|
- if @groups.include?(parent)
- g.add_nodes(child, { :style => "filled", :fillcolor => "#B9B9D5" }.merge(@node_options[child]))
- g.add_edges(parent, child, { :constraint => false }.merge(@edge_options["#{parent}_#{child}"]))
- else
- g.add_nodes(child, @node_options[child])
- g.add_edges(parent, child, @edge_options["#{parent}_#{child}"])
- end
- end
- end
-
- if @output_format.to_s == "debug"
- $stdout.puts g.output :none => String
- Bundler.ui.info "debugging bundle viz..."
- else
- begin
- g.output @output_format.to_sym => "#{@output_file}.#{@output_format}"
- Bundler.ui.info "#{@output_file}.#{@output_format}"
- rescue ArgumentError => e
- warn "Unsupported output format. See Ruby-Graphviz/lib/graphviz/constants.rb"
- raise e
- end
- end
- end
- end
- end
-end
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
deleted file mode 100644
index 9166a92738..0000000000
--- a/lib/bundler/index.rb
+++ /dev/null
@@ -1,213 +0,0 @@
-# frozen_string_literal: true
-
-require "set"
-
-module Bundler
- class Index
- include Enumerable
-
- def self.build
- i = new
- yield i
- i
- end
-
- attr_reader :specs, :all_specs, :sources
- protected :specs, :all_specs
-
- RUBY = "ruby".freeze
- NULL = "\0".freeze
-
- def initialize
- @sources = []
- @cache = {}
- @specs = Hash.new {|h, k| h[k] = {} }
- @all_specs = Hash.new {|h, k| h[k] = EMPTY_SEARCH }
- end
-
- def initialize_copy(o)
- @sources = o.sources.dup
- @cache = {}
- @specs = Hash.new {|h, k| h[k] = {} }
- @all_specs = Hash.new {|h, k| h[k] = EMPTY_SEARCH }
-
- o.specs.each do |name, hash|
- @specs[name] = hash.dup
- end
- o.all_specs.each do |name, array|
- @all_specs[name] = array.dup
- end
- end
-
- def inspect
- "#<#{self.class}:0x#{object_id} sources=#{sources.map(&:inspect)} specs.size=#{specs.size}>"
- end
-
- def empty?
- each { return false }
- true
- end
-
- def search_all(name)
- all_matches = local_search(name) + @all_specs[name]
- @sources.each do |source|
- all_matches.concat(source.search_all(name))
- end
- all_matches
- end
-
- # Search this index's specs, and any source indexes that this index knows
- # about, returning all of the results.
- def search(query, base = nil)
- sort_specs(unsorted_search(query, base))
- end
-
- def unsorted_search(query, base)
- results = local_search(query, base)
-
- seen = results.map(&:full_name).to_set unless @sources.empty?
-
- @sources.each do |source|
- source.unsorted_search(query, base).each do |spec|
- results << spec if seen.add?(spec.full_name)
- end
- end
-
- results
- end
- protected :unsorted_search
-
- def self.sort_specs(specs)
- specs.sort_by do |s|
- platform_string = s.platform.to_s
- [s.version, platform_string == RUBY ? NULL : platform_string]
- end
- end
-
- def sort_specs(specs)
- self.class.sort_specs(specs)
- end
-
- def local_search(query, base = nil)
- case query
- when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
- when String then specs_by_name(query)
- when Gem::Dependency then search_by_dependency(query, base)
- when DepProxy then search_by_dependency(query.dep, base)
- else
- raise "You can't search for a #{query.inspect}."
- end
- end
-
- alias_method :[], :search
-
- def <<(spec)
- @specs[spec.name][spec.full_name] = spec
- spec
- end
-
- def each(&blk)
- return enum_for(:each) unless blk
- specs.values.each do |spec_sets|
- spec_sets.values.each(&blk)
- end
- sources.each {|s| s.each(&blk) }
- self
- end
-
- def spec_names
- names = specs.keys + sources.map(&:spec_names)
- names.uniq!
- names
- end
-
- # returns a list of the dependencies
- def unmet_dependency_names
- dependency_names.select do |name|
- name != "bundler" && search(name).empty?
- end
- end
-
- def dependency_names
- names = []
- each do |spec|
- spec.dependencies.each do |dep|
- next if dep.type == :development
- names << dep.name
- end
- end
- names.uniq
- end
-
- def use(other, override_dupes = false)
- return unless other
- other.each do |s|
- if (dupes = search_by_spec(s)) && !dupes.empty?
- # safe to << since it's a new array when it has contents
- @all_specs[s.name] = dupes << s
- next unless override_dupes
- end
- self << s
- end
- self
- end
-
- def size
- @sources.inject(@specs.size) do |size, source|
- size += source.size
- end
- end
-
- # Whether all the specs in self are in other
- # TODO: rename to #include?
- def ==(other)
- all? do |spec|
- other_spec = other[spec].first
- other_spec && dependencies_eql?(spec, other_spec) && spec.source == other_spec.source
- end
- end
-
- def dependencies_eql?(spec, other_spec)
- deps = spec.dependencies.select {|d| d.type != :development }
- other_deps = other_spec.dependencies.select {|d| d.type != :development }
- Set.new(deps) == Set.new(other_deps)
- end
-
- def add_source(index)
- raise ArgumentError, "Source must be an index, not #{index.class}" unless index.is_a?(Index)
- @sources << index
- @sources.uniq! # need to use uniq! here instead of checking for the item before adding
- end
-
- private
-
- def specs_by_name(name)
- @specs[name].values
- end
-
- def search_by_dependency(dependency, base = nil)
- @cache[base || false] ||= {}
- @cache[base || false][dependency] ||= begin
- specs = specs_by_name(dependency.name)
- specs += base if base
- found = specs.select do |spec|
- next true if spec.source.is_a?(Source::Gemspec)
- if base # allow all platforms when searching from a lockfile
- dependency.matches_spec?(spec)
- else
- dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform)
- end
- end
-
- found
- end
- end
-
- EMPTY_SEARCH = [].freeze
-
- def search_by_spec(spec)
- spec = @specs[spec.name][spec.full_name]
- spec ? [spec] : EMPTY_SEARCH
- end
- end
-end
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb
deleted file mode 100644
index 2cdda578e2..0000000000
--- a/lib/bundler/injector.rb
+++ /dev/null
@@ -1,255 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Injector
- INJECTED_GEMS = "injected gems".freeze
-
- def self.inject(new_deps, options = {})
- injector = new(new_deps, options)
- injector.inject(Bundler.default_gemfile, Bundler.default_lockfile)
- end
-
- def self.remove(gems, options = {})
- injector = new(gems, options)
- injector.remove(Bundler.default_gemfile, Bundler.default_lockfile)
- end
-
- def initialize(deps, options = {})
- @deps = deps
- @options = options
- end
-
- # @param [Pathname] gemfile_path The Gemfile in which to inject the new dependency.
- # @param [Pathname] lockfile_path The lockfile in which to inject the new dependency.
- # @return [Array]
- def inject(gemfile_path, lockfile_path)
- if Bundler.frozen_bundle?
- # ensure the lock and Gemfile are synced
- Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
- end
-
- # temporarily unfreeze
- Bundler.settings.temporary(:deployment => false, :frozen => false) do
- # evaluate the Gemfile we have now
- builder = Dsl.new
- builder.eval_gemfile(gemfile_path)
-
- # don't inject any gems that are already in the Gemfile
- @deps -= builder.dependencies
-
- # add new deps to the end of the in-memory Gemfile
- # Set conservative versioning to false because
- # we want to let the resolver resolve the version first
- builder.eval_gemfile(INJECTED_GEMS, build_gem_lines(false)) if @deps.any?
-
- # resolve to see if the new deps broke anything
- @definition = builder.to_definition(lockfile_path, {})
- @definition.resolve_remotely!
-
- # since nothing broke, we can add those gems to the gemfile
- append_to(gemfile_path, build_gem_lines(@options[:conservative_versioning])) if @deps.any?
-
- # since we resolved successfully, write out the lockfile
- @definition.lock(Bundler.default_lockfile)
-
- # invalidate the cached Bundler.definition
- Bundler.reset_paths!
-
- # return an array of the deps that we added
- @deps
- end
- end
-
- # @param [Pathname] gemfile_path The Gemfile from which to remove dependencies.
- # @param [Pathname] lockfile_path The lockfile from which to remove dependencies.
- # @return [Array]
- def remove(gemfile_path, lockfile_path)
- # remove gems from each gemfiles we have
- Bundler.definition.gemfiles.each do |path|
- deps = remove_deps(path)
-
- show_warning("No gems were removed from the gemfile.") if deps.empty?
-
- deps.each {|dep| Bundler.ui.confirm "#{SharedHelpers.pretty_dependency(dep, false)} was removed." }
- end
- end
-
- private
-
- def conservative_version(spec)
- version = spec.version
- return ">= 0" if version.nil?
- segments = version.segments
- seg_end_index = version >= Gem::Version.new("1.0") ? 1 : 2
-
- prerelease_suffix = version.to_s.gsub(version.release.to_s, "") if version.prerelease?
- "#{version_prefix}#{segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
- end
-
- def version_prefix
- if @options[:strict]
- "= "
- elsif @options[:optimistic]
- ">= "
- else
- "~> "
- end
- end
-
- def build_gem_lines(conservative_versioning)
- @deps.map do |d|
- name = d.name.dump
-
- requirement = if conservative_versioning
- ", \"#{conservative_version(@definition.specs[d.name][0])}\""
- else
- ", #{d.requirement.as_list.map(&:dump).join(", ")}"
- end
-
- if d.groups != Array(:default)
- group = d.groups.size == 1 ? ", :group => #{d.groups.first.inspect}" : ", :groups => #{d.groups.inspect}"
- end
-
- source = ", :source => \"#{d.source}\"" unless d.source.nil?
- git = ", :git => \"#{d.git}\"" unless d.git.nil?
- branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
-
- %(gem #{name}#{requirement}#{group}#{source}#{git}#{branch})
- end.join("\n")
- end
-
- def append_to(gemfile_path, new_gem_lines)
- gemfile_path.open("a") do |f|
- f.puts
- f.puts new_gem_lines
- end
- end
-
- # evaluates a gemfile to remove the specified gem
- # from it.
- def remove_deps(gemfile_path)
- initial_gemfile = IO.readlines(gemfile_path)
-
- Bundler.ui.info "Removing gems from #{gemfile_path}"
-
- # evaluate the Gemfile we have
- builder = Dsl.new
- builder.eval_gemfile(gemfile_path)
-
- removed_deps = remove_gems_from_dependencies(builder, @deps, gemfile_path)
-
- # abort the operation if no gems were removed
- # no need to operate on gemfile further
- return [] if removed_deps.empty?
-
- cleaned_gemfile = remove_gems_from_gemfile(@deps, gemfile_path)
-
- SharedHelpers.write_to_gemfile(gemfile_path, cleaned_gemfile)
-
- # check for errors
- # including extra gems being removed
- # or some gems not being removed
- # and return the actual removed deps
- cross_check_for_errors(gemfile_path, builder.dependencies, removed_deps, initial_gemfile)
- end
-
- # @param [Dsl] builder Dsl object of current Gemfile.
- # @param [Array] gems Array of names of gems to be removed.
- # @param [Pathname] gemfile_path Path of the Gemfile.
- # @return [Array] Array of removed dependencies.
- def remove_gems_from_dependencies(builder, gems, gemfile_path)
- removed_deps = []
-
- gems.each do |gem_name|
- deleted_dep = builder.dependencies.find {|d| d.name == gem_name }
-
- if deleted_dep.nil?
- raise GemfileError, "`#{gem_name}` is not specified in #{gemfile_path} so it could not be removed."
- end
-
- builder.dependencies.delete(deleted_dep)
-
- removed_deps << deleted_dep
- end
-
- removed_deps
- end
-
- # @param [Array] gems Array of names of gems to be removed.
- # @param [Pathname] gemfile_path The Gemfile from which to remove dependencies.
- def remove_gems_from_gemfile(gems, gemfile_path)
- patterns = /gem\s+(['"])#{Regexp.union(gems)}\1|gem\s*\((['"])#{Regexp.union(gems)}\2\)/
-
- # remove lines which match the regex
- new_gemfile = IO.readlines(gemfile_path).reject {|line| line.match(patterns) }
-
- # remove lone \n and append them with other strings
- new_gemfile.each_with_index do |_line, index|
- if new_gemfile[index + 1] == "\n"
- new_gemfile[index] += new_gemfile[index + 1]
- new_gemfile.delete_at(index + 1)
- end
- end
-
- %w[group source env install_if].each {|block| remove_nested_blocks(new_gemfile, block) }
-
- new_gemfile.join.chomp
- end
-
- # @param [Array] gemfile Array of gemfile contents.
- # @param [String] block_name Name of block name to look for.
- def remove_nested_blocks(gemfile, block_name)
- nested_blocks = 0
-
- # count number of nested blocks
- gemfile.each_with_index {|line, index| nested_blocks += 1 if !gemfile[index + 1].nil? && gemfile[index + 1].include?(block_name) && line.include?(block_name) }
-
- while nested_blocks >= 0
- nested_blocks -= 1
-
- gemfile.each_with_index do |line, index|
- next unless !line.nil? && line.strip.start_with?(block_name)
- if gemfile[index + 1] =~ /^\s*end\s*$/
- gemfile[index] = nil
- gemfile[index + 1] = nil
- end
- end
-
- gemfile.compact!
- end
- end
-
- # @param [Pathname] gemfile_path The Gemfile from which to remove dependencies.
- # @param [Array] original_deps Array of original dependencies.
- # @param [Array] removed_deps Array of removed dependencies.
- # @param [Array] initial_gemfile Contents of original Gemfile before any operation.
- def cross_check_for_errors(gemfile_path, original_deps, removed_deps, initial_gemfile)
- # evaluate the new gemfile to look for any failure cases
- builder = Dsl.new
- builder.eval_gemfile(gemfile_path)
-
- # record gems which were removed but not requested
- extra_removed_gems = original_deps - builder.dependencies
-
- # if some extra gems were removed then raise error
- # and revert Gemfile to original
- unless extra_removed_gems.empty?
- SharedHelpers.write_to_gemfile(gemfile_path, initial_gemfile.join)
-
- raise InvalidOption, "Gems could not be removed. #{extra_removed_gems.join(", ")} would also have been removed. Bundler cannot continue."
- end
-
- # record gems which could not be removed due to some reasons
- errored_deps = builder.dependencies.select {|d| d.gemfile == gemfile_path } & removed_deps.select {|d| d.gemfile == gemfile_path }
-
- show_warning "#{errored_deps.map(&:name).join(", ")} could not be removed." unless errored_deps.empty?
-
- # return actual removed dependencies
- removed_deps - errored_deps
- end
-
- def show_warning(message)
- Bundler.ui.info Bundler.ui.add_color(message, :yellow)
- end
- end
-end
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
deleted file mode 100644
index 5b2ddb7db6..0000000000
--- a/lib/bundler/inline.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-# Allows for declaring a Gemfile inline in a ruby script, optionally installing
-# any gems that aren't already installed on the user's system.
-#
-# @note Every gem that is specified in this 'Gemfile' will be `require`d, as if
-# the user had manually called `Bundler.require`. To avoid a requested gem
-# being automatically required, add the `:require => false` option to the
-# `gem` dependency declaration.
-#
-# @param install [Boolean] whether gems that aren't already installed on the
-# user's system should be installed.
-# Defaults to `false`.
-#
-# @param gemfile [Proc] a block that is evaluated as a `Gemfile`.
-#
-# @example Using an inline Gemfile
-#
-# #!/usr/bin/env ruby
-#
-# require 'bundler/inline'
-#
-# gemfile do
-# source 'https://rubygems.org'
-# gem 'json', require: false
-# gem 'nap', require: 'rest'
-# gem 'cocoapods', '~> 0.34.1'
-# end
-#
-# puts Pod::VERSION # => "0.34.4"
-#
-def gemfile(install = false, options = {}, &gemfile)
- require_relative "../bundler"
-
- opts = options.dup
- ui = opts.delete(:ui) { Bundler::UI::Shell.new }
- ui.level = "silent" if opts.delete(:quiet)
- raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
-
- begin
- old_root = Bundler.method(:root)
- bundler_module = class << Bundler; self; end
- bundler_module.send(:remove_method, :root)
- def Bundler.root
- Bundler::SharedHelpers.pwd.expand_path
- end
- old_gemfile = ENV["BUNDLE_GEMFILE"]
- Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
-
- Bundler::Plugin.gemfile_install(&gemfile) if Bundler.feature_flag.plugins?
- builder = Bundler::Dsl.new
- builder.instance_eval(&gemfile)
-
- Bundler.settings.temporary(:frozen => false) do
- definition = builder.to_definition(nil, true)
- def definition.lock(*); end
- definition.validate_runtime!
-
- Bundler.ui = install ? ui : Bundler::UI::Silent.new
- if install || definition.missing_specs?
- Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do
- installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
- installer.post_install_messages.each do |name, message|
- Bundler.ui.info "Post-install message from #{name}:\n#{message}"
- end
- end
- end
-
- runtime = Bundler::Runtime.new(nil, definition)
- runtime.setup.require
- end
- ensure
- if bundler_module
- bundler_module.send(:remove_method, :root)
- bundler_module.send(:define_method, :root, old_root)
- end
-
- if old_gemfile
- ENV["BUNDLE_GEMFILE"] = old_gemfile
- else
- ENV.delete("BUNDLE_GEMFILE")
- end
- end
-end
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
deleted file mode 100644
index 700f0a4737..0000000000
--- a/lib/bundler/installer.rb
+++ /dev/null
@@ -1,311 +0,0 @@
-# frozen_string_literal: true
-
-require "erb"
-require "rubygems/dependency_installer"
-require_relative "worker"
-require_relative "installer/parallel_installer"
-require_relative "installer/standalone"
-require_relative "installer/gem_installer"
-
-module Bundler
- class Installer
- class << self
- attr_accessor :ambiguous_gems
-
- Installer.ambiguous_gems = []
- end
-
- attr_reader :post_install_messages
-
- # Begins the installation process for Bundler.
- # For more information see the #run method on this class.
- def self.install(root, definition, options = {})
- installer = new(root, definition)
- Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL_ALL, definition.dependencies)
- installer.run(options)
- Plugin.hook(Plugin::Events::GEM_AFTER_INSTALL_ALL, definition.dependencies)
- installer
- end
-
- def initialize(root, definition)
- @root = root
- @definition = definition
- @post_install_messages = {}
- end
-
- # Runs the install procedures for a specific Gemfile.
- #
- # Firstly, this method will check to see if `Bundler.bundle_path` exists
- # and if not then Bundler will create the directory. This is usually the same
- # location as RubyGems which typically is the `~/.gem` directory
- # unless other specified.
- #
- # Secondly, it checks if Bundler has been configured to be "frozen".
- # Frozen ensures that the Gemfile and the Gemfile.lock file are matching.
- # This stops a situation where a developer may update the Gemfile but may not run
- # `bundle install`, which leads to the Gemfile.lock file not being correctly updated.
- # If this file is not correctly updated then any other developer running
- # `bundle install` will potentially not install the correct gems.
- #
- # Thirdly, Bundler checks if there are any dependencies specified in the Gemfile.
- # If there are no dependencies specified then Bundler returns a warning message stating
- # so and this method returns.
- #
- # Fourthly, Bundler checks if the Gemfile.lock exists, and if so
- # then proceeds to set up a definition based on the Gemfile and the Gemfile.lock.
- # During this step Bundler will also download information about any new gems
- # that are not in the Gemfile.lock and resolve any dependencies if needed.
- #
- # Fifthly, Bundler resolves the dependencies either through a cache of gems or by remote.
- # This then leads into the gems being installed, along with stubs for their executables,
- # but only if the --binstubs option has been passed or Bundler.options[:bin] has been set
- # earlier.
- #
- # Sixthly, a new Gemfile.lock is created from the installed gems to ensure that the next time
- # that a user runs `bundle install` they will receive any updates from this process.
- #
- # Finally, if the user has specified the standalone flag, Bundler will generate the needed
- # require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
- # information.
- def run(options)
- create_bundle_path
-
- ProcessLock.lock do
- if Bundler.frozen_bundle?
- @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
- end
-
- if @definition.dependencies.empty?
- Bundler.ui.warn "The Gemfile specifies no dependencies"
- lock
- return
- end
-
- if resolve_if_needed(options)
- ensure_specs_are_compatible!
- warn_on_incompatible_bundler_deps
- load_plugins
- options.delete(:jobs)
- else
- options[:jobs] = 1 # to avoid the overhead of Bundler::Worker
- end
- install(options)
-
- lock unless Bundler.frozen_bundle?
- Standalone.new(options[:standalone], @definition).generate if options[:standalone]
- end
- end
-
- def generate_bundler_executable_stubs(spec, options = {})
- if options[:binstubs_cmd] && spec.executables.empty?
- options = {}
- spec.runtime_dependencies.each do |dep|
- bins = @definition.specs[dep].first.executables
- options[dep.name] = bins unless bins.empty?
- end
- if options.any?
- Bundler.ui.warn "#{spec.name} has no executables, but you may want " \
- "one from a gem it depends on."
- options.each {|name, bins| Bundler.ui.warn " #{name} has: #{bins.join(", ")}" }
- else
- Bundler.ui.warn "There are no executables for the gem #{spec.name}."
- end
- return
- end
-
- # double-assignment to avoid warnings about variables that will be used by ERB
- bin_path = Bundler.bin_path
- bin_path = bin_path
- relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
- relative_gemfile_path = relative_gemfile_path
- ruby_command = Thor::Util.ruby_command
- ruby_command = ruby_command
- template_path = File.expand_path("../templates/Executable", __FILE__)
- if spec.name == "bundler"
- template_path += ".bundler"
- spec.executables = %(bundle)
- end
- template = File.read(template_path)
-
- exists = []
- spec.executables.each do |executable|
- binstub_path = "#{bin_path}/#{executable}"
- if File.exist?(binstub_path) && !options[:force]
- exists << executable
- next
- end
-
- File.open(binstub_path, "w", 0o777 & ~File.umask) do |f|
- if RUBY_VERSION >= "2.6"
- f.puts ERB.new(template, :trim_mode => "-").result(binding)
- else
- f.puts ERB.new(template, nil, "-").result(binding)
- end
- end
- end
-
- if options[:binstubs_cmd] && exists.any?
- case exists.size
- when 1
- Bundler.ui.warn "Skipped #{exists[0]} since it already exists."
- when 2
- Bundler.ui.warn "Skipped #{exists.join(" and ")} since they already exist."
- else
- items = exists[0...-1].empty? ? nil : exists[0...-1].join(", ")
- skipped = [items, exists[-1]].compact.join(" and ")
- Bundler.ui.warn "Skipped #{skipped} since they already exist."
- end
- Bundler.ui.warn "If you want to overwrite skipped stubs, use --force."
- end
- end
-
- def generate_standalone_bundler_executable_stubs(spec)
- # double-assignment to avoid warnings about variables that will be used by ERB
- bin_path = Bundler.bin_path
- unless path = Bundler.settings[:path]
- raise "Can't standalone without an explicit path set"
- end
- standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
- standalone_path = standalone_path
- template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__))
- ruby_command = Thor::Util.ruby_command
- ruby_command = ruby_command
-
- spec.executables.each do |executable|
- next if executable == "bundle"
- executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
- executable_path = executable_path
- File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
- if RUBY_VERSION >= "2.6"
- f.puts ERB.new(template, :trim_mode => "-").result(binding)
- else
- f.puts ERB.new(template, nil, "-").result(binding)
- end
- end
- end
- end
-
- private
-
- # the order that the resolver provides is significant, since
- # dependencies might affect the installation of a gem.
- # that said, it's a rare situation (other than rake), and parallel
- # installation is SO MUCH FASTER. so we let people opt in.
- def install(options)
- force = options["force"]
- jobs = installation_parallelization(options)
- install_in_parallel jobs, options[:standalone], force
- end
-
- def installation_parallelization(options)
- if jobs = options.delete(:jobs)
- return jobs
- end
-
- return 1 unless can_install_in_parallel?
-
- auto_config_jobs = Bundler.feature_flag.auto_config_jobs?
- if jobs = Bundler.settings[:jobs]
- if auto_config_jobs
- jobs
- else
- [jobs.pred, 1].max
- end
- elsif auto_config_jobs
- processor_count
- else
- 1
- end
- end
-
- def processor_count
- require "etc"
- Etc.nprocessors
- rescue StandardError
- 1
- end
-
- def load_plugins
- Bundler.rubygems.load_plugins
-
- requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
- path_plugin_files = requested_path_gems.map do |spec|
- begin
- Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
- rescue TypeError
- error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
- raise Gem::InvalidSpecificationException, error_message
- end
- end.flatten
- Bundler.rubygems.load_plugin_files(path_plugin_files)
- end
-
- def ensure_specs_are_compatible!
- system_ruby = Bundler::RubyVersion.system
- rubygems_version = Gem::Version.create(Gem::VERSION)
- @definition.specs.each do |spec|
- if required_ruby_version = spec.required_ruby_version
- unless required_ruby_version.satisfied_by?(system_ruby.gem_version)
- raise InstallError, "#{spec.full_name} requires ruby version #{required_ruby_version}, " \
- "which is incompatible with the current version, #{system_ruby}"
- end
- end
- next unless required_rubygems_version = spec.required_rubygems_version
- unless required_rubygems_version.satisfied_by?(rubygems_version)
- raise InstallError, "#{spec.full_name} requires rubygems version #{required_rubygems_version}, " \
- "which is incompatible with the current version, #{rubygems_version}"
- end
- end
- end
-
- def warn_on_incompatible_bundler_deps
- bundler_version = Gem::Version.create(Bundler::VERSION)
- @definition.specs.each do |spec|
- spec.dependencies.each do |dep|
- next if dep.type == :development
- next unless dep.name == "bundler".freeze
- next if dep.requirement.satisfied_by?(bundler_version)
-
- Bundler.ui.warn "#{spec.name} (#{spec.version}) has dependency" \
- " #{SharedHelpers.pretty_dependency(dep)}" \
- ", which is unsatisfied by the current bundler version #{VERSION}" \
- ", so the dependency is being ignored"
- end
- end
- end
-
- def can_install_in_parallel?
- true
- end
-
- def install_in_parallel(size, standalone, force = false)
- spec_installations = ParallelInstaller.call(self, @definition.specs, size, standalone, force)
- spec_installations.each do |installation|
- post_install_messages[installation.name] = installation.post_install_message if installation.has_post_install_message?
- end
- end
-
- def create_bundle_path
- SharedHelpers.filesystem_access(Bundler.bundle_path.to_s) do |p|
- Bundler.mkdir_p(p)
- end unless Bundler.bundle_path.exist?
- rescue Errno::EEXIST
- raise PathError, "Could not install to path `#{Bundler.bundle_path}` " \
- "because a file already exists at that path. Either remove or rename the file so the directory can be created."
- end
-
- # returns whether or not a re-resolve was needed
- def resolve_if_needed(options)
- if !@definition.unlocking? && !options["force"] && !options["all-platforms"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
- return false if @definition.nothing_changed? && !@definition.missing_specs?
- end
-
- options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely!
- true
- end
-
- def lock(opts = {})
- @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
- end
- end
-end
diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb
deleted file mode 100644
index 9689911d6c..0000000000
--- a/lib/bundler/installer/gem_installer.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-# frozen_string_literal: true
-
-require "shellwords"
-
-module Bundler
- class GemInstaller
- attr_reader :spec, :standalone, :worker, :force, :installer
-
- def initialize(spec, installer, standalone = false, worker = 0, force = false)
- @spec = spec
- @installer = installer
- @standalone = standalone
- @worker = worker
- @force = force
- end
-
- def install_from_spec
- post_install_message = spec_settings ? install_with_settings : install
- Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
- generate_executable_stubs
- return true, post_install_message
- rescue Bundler::InstallHookError, Bundler::SecurityError, APIResponseMismatchError
- raise
- rescue Errno::ENOSPC
- return false, out_of_space_message
- rescue StandardError => e
- return false, specific_failure_message(e)
- end
-
- private
-
- def specific_failure_message(e)
- message = "#{e.class}: #{e.message}\n"
- message += " " + e.backtrace.join("\n ") + "\n\n" if Bundler.ui.debug?
- message = message.lines.first + Bundler.ui.add_color(message.lines.drop(1).join, :clear)
- message + Bundler.ui.add_color(failure_message, :red)
- end
-
- def failure_message
- return install_error_message if spec.source.options["git"]
- "#{install_error_message}\n#{gem_install_message}"
- end
-
- def install_error_message
- "An error occurred while installing #{spec.name} (#{spec.version}), and Bundler cannot continue."
- end
-
- def gem_install_message
- source = spec.source
- return unless source.respond_to?(:remotes)
-
- if source.remotes.size == 1
- "Make sure that `gem install #{spec.name} -v '#{spec.version}' --source '#{source.remotes.first}'` succeeds before bundling."
- else
- "Make sure that `gem install #{spec.name} -v '#{spec.version}'` succeeds before bundling."
- end
- end
-
- def spec_settings
- # Fetch the build settings, if there are any
- if settings = Bundler.settings["build.#{spec.name}"]
- Shellwords.shellsplit(settings)
- end
- end
-
- def install
- spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => Array(spec_settings))
- end
-
- def install_with_settings
- # Build arguments are global, so this is mutexed
- Bundler.rubygems.install_with_build_args([spec_settings]) { install }
- end
-
- def out_of_space_message
- "#{install_error_message}\nYour disk is out of space. Free some space to be able to install your bundle."
- end
-
- def generate_executable_stubs
- return if Bundler.feature_flag.forget_cli_options?
- return if Bundler.settings[:inline]
- if Bundler.settings[:bin] && standalone
- installer.generate_standalone_bundler_executable_stubs(spec)
- elsif Bundler.settings[:bin]
- installer.generate_bundler_executable_stubs(spec, :force => true)
- end
- end
- end
-end
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb
deleted file mode 100644
index 391540af0b..0000000000
--- a/lib/bundler/installer/parallel_installer.rb
+++ /dev/null
@@ -1,229 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../worker"
-require_relative "gem_installer"
-
-module Bundler
- class ParallelInstaller
- class SpecInstallation
- attr_accessor :spec, :name, :post_install_message, :state, :error
- def initialize(spec)
- @spec = spec
- @name = spec.name
- @state = :none
- @post_install_message = ""
- @error = nil
- end
-
- def installed?
- state == :installed
- end
-
- def enqueued?
- state == :enqueued
- end
-
- def failed?
- state == :failed
- end
-
- def installation_attempted?
- installed? || failed?
- end
-
- # Only true when spec in neither installed nor already enqueued
- def ready_to_enqueue?
- !enqueued? && !installation_attempted?
- end
-
- def has_post_install_message?
- !post_install_message.empty?
- end
-
- def ignorable_dependency?(dep)
- dep.type == :development || dep.name == @name
- end
-
- # Checks installed dependencies against spec's dependencies to make
- # sure needed dependencies have been installed.
- def dependencies_installed?(all_specs)
- installed_specs = all_specs.select(&:installed?).map(&:name)
- dependencies.all? {|d| installed_specs.include? d.name }
- end
-
- # Represents only the non-development dependencies, the ones that are
- # itself and are in the total list.
- def dependencies
- @dependencies ||= begin
- all_dependencies.reject {|dep| ignorable_dependency? dep }
- end
- end
-
- def missing_lockfile_dependencies(all_spec_names)
- deps = all_dependencies.reject {|dep| ignorable_dependency? dep }
- deps.reject {|dep| all_spec_names.include? dep.name }
- end
-
- # Represents all dependencies
- def all_dependencies
- @spec.dependencies
- end
-
- def to_s
- "#<#{self.class} #{@spec.full_name} (#{state})>"
- end
- end
-
- def self.call(*args)
- new(*args).call
- end
-
- attr_reader :size
-
- def initialize(installer, all_specs, size, standalone, force)
- @installer = installer
- @size = size
- @standalone = standalone
- @force = force
- @specs = all_specs.map {|s| SpecInstallation.new(s) }
- @spec_set = all_specs
- @rake = @specs.find {|s| s.name == "rake" }
- end
-
- def call
- check_for_corrupt_lockfile
-
- if @size > 1
- install_with_worker
- else
- install_serially
- end
-
- handle_error if @specs.any?(&:failed?)
- @specs
- ensure
- worker_pool && worker_pool.stop
- end
-
- def check_for_corrupt_lockfile
- missing_dependencies = @specs.map do |s|
- [
- s,
- s.missing_lockfile_dependencies(@specs.map(&:name)),
- ]
- end.reject {|a| a.last.empty? }
- return if missing_dependencies.empty?
-
- warning = []
- warning << "Your lockfile was created by an old Bundler that left some things out."
- if @size != 1
- warning << "Because of the missing DEPENDENCIES, we can only install gems one at a time, instead of installing #{@size} at a time."
- @size = 1
- end
- warning << "You can fix this by adding the missing gems to your Gemfile, running bundle install, and then removing the gems from your Gemfile."
- warning << "The missing gems are:"
-
- missing_dependencies.each do |spec, missing|
- warning << "* #{missing.map(&:name).join(", ")} depended upon by #{spec.name}"
- end
-
- Bundler.ui.warn(warning.join("\n"))
- end
-
- private
-
- def install_with_worker
- enqueue_specs
- process_specs until finished_installing?
- end
-
- def install_serially
- until finished_installing?
- raise "failed to find a spec to enqueue while installing serially" unless spec_install = @specs.find(&:ready_to_enqueue?)
- spec_install.state = :enqueued
- do_install(spec_install, 0)
- end
- end
-
- def worker_pool
- @worker_pool ||= Bundler::Worker.new @size, "Parallel Installer", lambda {|spec_install, worker_num|
- do_install(spec_install, worker_num)
- }
- end
-
- def do_install(spec_install, worker_num)
- Plugin.hook(Plugin::Events::GEM_BEFORE_INSTALL, spec_install)
- gem_installer = Bundler::GemInstaller.new(
- spec_install.spec, @installer, @standalone, worker_num, @force
- )
- success, message = begin
- gem_installer.install_from_spec
- rescue RuntimeError => e
- raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}"
- end
- if success
- spec_install.state = :installed
- spec_install.post_install_message = message unless message.nil?
- else
- spec_install.state = :failed
- spec_install.error = "#{message}\n\n#{require_tree_for_spec(spec_install.spec)}"
- end
- Plugin.hook(Plugin::Events::GEM_AFTER_INSTALL, spec_install)
- spec_install
- end
-
- # Dequeue a spec and save its post-install message and then enqueue the
- # remaining specs.
- # Some specs might've had to wait til this spec was installed to be
- # processed so the call to `enqueue_specs` is important after every
- # dequeue.
- def process_specs
- worker_pool.deq
- enqueue_specs
- end
-
- def finished_installing?
- @specs.all? do |spec|
- return true if spec.failed?
- spec.installed?
- end
- end
-
- def handle_error
- errors = @specs.select(&:failed?).map(&:error)
- if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) }
- raise exception
- end
- raise Bundler::InstallError, errors.map(&:to_s).join("\n\n")
- end
-
- def require_tree_for_spec(spec)
- tree = @spec_set.what_required(spec)
- t = String.new("In #{File.basename(SharedHelpers.default_gemfile)}:\n")
- tree.each_with_index do |s, depth|
- t << " " * depth.succ << s.name
- unless tree.last == s
- t << %( was resolved to #{s.version}, which depends on)
- end
- t << %(\n)
- end
- t
- end
-
- # Keys in the remains hash represent uninstalled gems specs.
- # We enqueue all gem specs that do not have any dependencies.
- # Later we call this lambda again to install specs that depended on
- # previously installed specifications. We continue until all specs
- # are installed.
- def enqueue_specs
- @specs.select(&:ready_to_enqueue?).each do |spec|
- next if @rake && !@rake.installed? && spec.name != @rake.name
-
- if spec.dependencies_installed? @specs
- spec.state = :enqueued
- worker_pool.enq spec
- end
- end
- end
- end
-end
diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb
deleted file mode 100644
index e1beb25ad1..0000000000
--- a/lib/bundler/installer/standalone.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Standalone
- def initialize(groups, definition)
- @specs = groups.empty? ? definition.requested_specs : definition.specs_for(groups.map(&:to_sym))
- end
-
- def generate
- SharedHelpers.filesystem_access(bundler_path) do |p|
- FileUtils.mkdir_p(p)
- end
- File.open File.join(bundler_path, "setup.rb"), "w" do |file|
- file.puts "require 'rbconfig'"
- file.puts "ruby_engine = RUBY_ENGINE"
- file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
- file.puts "path = File.expand_path('..', __FILE__)"
- paths.each do |path|
- file.puts %($:.unshift "\#{path}/#{path}")
- end
- end
- end
-
- private
-
- def paths
- @specs.map do |spec|
- next if spec.name == "bundler"
- Array(spec.require_paths).map do |path|
- gem_path(path, spec).sub(version_dir, '#{ruby_engine}/#{ruby_version}')
- # This is a static string intentionally. It's interpolated at a later time.
- end
- end.flatten
- end
-
- def version_dir
- "#{Bundler::RubyVersion.system.engine}/#{RbConfig::CONFIG["ruby_version"]}"
- end
-
- def bundler_path
- Bundler.root.join(Bundler.settings[:path], "bundler")
- end
-
- def gem_path(path, spec)
- full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
- Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
- rescue TypeError
- error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
- raise Gem::InvalidSpecificationException.new(error_message)
- end
- end
-end
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
deleted file mode 100644
index 32c8bb9557..0000000000
--- a/lib/bundler/lazy_specification.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "match_platform"
-
-module Bundler
- class LazySpecification
- Identifier = Struct.new(:name, :version, :source, :platform, :dependencies)
- class Identifier
- include Comparable
- def <=>(other)
- return unless other.is_a?(Identifier)
- [name, version, platform_string] <=> [other.name, other.version, other.platform_string]
- end
-
- protected
-
- def platform_string
- platform_string = platform.to_s
- platform_string == Index::RUBY ? Index::NULL : platform_string
- end
- end
-
- include MatchPlatform
-
- attr_reader :name, :version, :dependencies, :platform
- attr_accessor :source, :remote
-
- def initialize(name, version, platform, source = nil)
- @name = name
- @version = version
- @dependencies = []
- @platform = platform || Gem::Platform::RUBY
- @source = source
- @specification = nil
- end
-
- def full_name
- if platform == Gem::Platform::RUBY || platform.nil?
- "#{@name}-#{@version}"
- else
- "#{@name}-#{@version}-#{platform}"
- end
- end
-
- def ==(other)
- identifier == other.identifier
- end
-
- def satisfies?(dependency)
- @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
- end
-
- def to_lock
- out = String.new
-
- if platform == Gem::Platform::RUBY || platform.nil?
- out << " #{name} (#{version})\n"
- else
- out << " #{name} (#{version}-#{platform})\n"
- end
-
- dependencies.sort_by(&:to_s).uniq.each do |dep|
- next if dep.type == :development
- out << " #{dep.to_lock}\n"
- end
-
- out
- end
-
- def __materialize__
- search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
- @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
- source.gemspec.tap {|s| s.source = source }
- else
- search = source.specs.search(search_object).last
- if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
- Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
- "because it has different dependencies from the #{platform} version. " \
- "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
- search = source.specs.search(self).last
- end
- search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
- search
- end
- end
-
- def respond_to?(*args)
- super || @specification ? @specification.respond_to?(*args) : nil
- end
-
- def to_s
- @__to_s ||= if platform == Gem::Platform::RUBY || platform.nil?
- "#{name} (#{version})"
- else
- "#{name} (#{version}-#{platform})"
- end
- end
-
- def identifier
- @__identifier ||= Identifier.new(name, version, source, platform, dependencies)
- end
-
- def git_version
- return unless source.is_a?(Bundler::Source::Git)
- " #{source.revision[0..6]}"
- end
-
- private
-
- def to_ary
- nil
- end
-
- def method_missing(method, *args, &blk)
- raise "LazySpecification has not been materialized yet (calling :#{method} #{args.inspect})" unless @specification
-
- return super unless respond_to?(method)
-
- @specification.send(method, *args, &blk)
- end
- end
-end
diff --git a/lib/bundler/lockfile_generator.rb b/lib/bundler/lockfile_generator.rb
deleted file mode 100644
index 585077d18d..0000000000
--- a/lib/bundler/lockfile_generator.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class LockfileGenerator
- attr_reader :definition
- attr_reader :out
-
- # @private
- def initialize(definition)
- @definition = definition
- @out = String.new
- end
-
- def self.generate(definition)
- new(definition).generate!
- end
-
- def generate!
- add_sources
- add_platforms
- add_dependencies
- add_locked_ruby_version
- add_bundled_with
-
- out
- end
-
- private
-
- def add_sources
- definition.send(:sources).lock_sources.each_with_index do |source, idx|
- out << "\n" unless idx.zero?
-
- # Add the source header
- out << source.to_lock
-
- # Find all specs for this source
- specs = definition.resolve.select {|s| source.can_lock?(s) }
- add_specs(specs)
- end
- end
-
- def add_specs(specs)
- # This needs to be sorted by full name so that
- # gems with the same name, but different platform
- # are ordered consistently
- specs.sort_by(&:full_name).each do |spec|
- next if spec.name == "bundler".freeze
- out << spec.to_lock
- end
- end
-
- def add_platforms
- add_section("PLATFORMS", definition.platforms)
- end
-
- def add_dependencies
- out << "\nDEPENDENCIES\n"
-
- handled = []
- definition.dependencies.sort_by(&:to_s).each do |dep|
- next if handled.include?(dep.name)
- out << dep.to_lock
- handled << dep.name
- end
- end
-
- def add_locked_ruby_version
- return unless locked_ruby_version = definition.locked_ruby_version
- add_section("RUBY VERSION", locked_ruby_version.to_s)
- end
-
- def add_bundled_with
- add_section("BUNDLED WITH", definition.locked_bundler_version.to_s)
- end
-
- def add_section(name, value)
- out << "\n#{name}\n"
- case value
- when Array
- value.map(&:to_s).sort.each do |val|
- out << " #{val}\n"
- end
- when Hash
- value.to_a.sort_by {|k, _| k.to_s }.each do |key, val|
- out << " #{key}: #{val}\n"
- end
- when String
- out << " #{value}\n"
- else
- raise ArgumentError, "#{value.inspect} can't be serialized in a lockfile"
- end
- end
- end
-end
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
deleted file mode 100644
index caabd524d4..0000000000
--- a/lib/bundler/lockfile_parser.rb
+++ /dev/null
@@ -1,249 +0,0 @@
-# frozen_string_literal: true
-
-#--
-# Some versions of the Bundler 1.1 RC series introduced corrupted
-# lockfiles. There were two major problems:
-#
-# * multiple copies of the same GIT section appeared in the lockfile
-# * when this happened, those sections got multiple copies of gems
-# in those sections.
-#
-# As a result, Bundler 1.1 contains code that fixes the earlier
-# corruption. We will remove this fix-up code in Bundler 1.2.
-
-module Bundler
- class LockfileParser
- attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version
-
- BUNDLED = "BUNDLED WITH".freeze
- DEPENDENCIES = "DEPENDENCIES".freeze
- PLATFORMS = "PLATFORMS".freeze
- RUBY = "RUBY VERSION".freeze
- GIT = "GIT".freeze
- GEM = "GEM".freeze
- PATH = "PATH".freeze
- PLUGIN = "PLUGIN SOURCE".freeze
- SPECS = " specs:".freeze
- OPTIONS = /^ ([a-z]+): (.*)$/i.freeze
- SOURCE = [GIT, GEM, PATH, PLUGIN].freeze
-
- SECTIONS_BY_VERSION_INTRODUCED = {
- Gem::Version.create("1.0") => [DEPENDENCIES, PLATFORMS, GIT, GEM, PATH].freeze,
- Gem::Version.create("1.10") => [BUNDLED].freeze,
- Gem::Version.create("1.12") => [RUBY].freeze,
- Gem::Version.create("1.13") => [PLUGIN].freeze,
- }.freeze
-
- KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
-
- ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
-
- def self.sections_in_lockfile(lockfile_contents)
- lockfile_contents.scan(/^\w[\w ]*$/).uniq
- end
-
- def self.unknown_sections_in_lockfile(lockfile_contents)
- sections_in_lockfile(lockfile_contents) - KNOWN_SECTIONS
- end
-
- def self.sections_to_ignore(base_version = nil)
- base_version &&= base_version.release
- base_version ||= Gem::Version.create("1.0".dup)
- attributes = []
- SECTIONS_BY_VERSION_INTRODUCED.each do |version, introduced|
- next if version <= base_version
- attributes += introduced
- end
- attributes
- end
-
- def initialize(lockfile)
- @platforms = []
- @sources = []
- @dependencies = {}
- @state = nil
- @specs = {}
-
- @rubygems_aggregate = Source::Rubygems.new
-
- if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
- raise LockfileError, "Your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} contains merge conflicts.\n" \
- "Run `git checkout HEAD -- #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` first to get a clean lock."
- end
-
- lockfile.split(/(?:\r?\n)+/).each do |line|
- if SOURCE.include?(line)
- @state = :source
- parse_source(line)
- elsif line == DEPENDENCIES
- @state = :dependency
- elsif line == PLATFORMS
- @state = :platform
- elsif line == RUBY
- @state = :ruby
- elsif line == BUNDLED
- @state = :bundled_with
- elsif line =~ /^[^\s]/
- @state = nil
- elsif @state
- send("parse_#{@state}", line)
- end
- end
- @sources << @rubygems_aggregate unless Bundler.feature_flag.disable_multisource?
- @specs = @specs.values.sort_by(&:identifier)
- warn_for_outdated_bundler_version
- rescue ArgumentError => e
- Bundler.ui.debug(e)
- raise LockfileError, "Your lockfile is unreadable. Run `rm #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` " \
- "and then `bundle install` to generate a new lockfile."
- end
-
- def warn_for_outdated_bundler_version
- return unless bundler_version
- prerelease_text = bundler_version.prerelease? ? " --pre" : ""
- current_version = Gem::Version.create(Bundler::VERSION)
- return unless current_version < bundler_version
- Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
- "than the version that created the lockfile (#{bundler_version}). We suggest you to " \
- "upgrade to the version that created the lockfile by running `gem install " \
- "bundler:#{bundler_version}#{prerelease_text}`.\n"
- end
-
- private
-
- TYPES = {
- GIT => Bundler::Source::Git,
- GEM => Bundler::Source::Rubygems,
- PATH => Bundler::Source::Path,
- PLUGIN => Bundler::Plugin,
- }.freeze
-
- def parse_source(line)
- case line
- when SPECS
- case @type
- when PATH
- @current_source = TYPES[@type].from_lock(@opts)
- @sources << @current_source
- when GIT
- @current_source = TYPES[@type].from_lock(@opts)
- # Strip out duplicate GIT sections
- if @sources.include?(@current_source)
- @current_source = @sources.find {|s| s == @current_source }
- else
- @sources << @current_source
- end
- when GEM
- if Bundler.feature_flag.disable_multisource?
- @opts["remotes"] = @opts.delete("remote")
- @current_source = TYPES[@type].from_lock(@opts)
- @sources << @current_source
- else
- Array(@opts["remote"]).each do |url|
- @rubygems_aggregate.add_remote(url)
- end
- @current_source = @rubygems_aggregate
- end
- when PLUGIN
- @current_source = Plugin.source_from_lock(@opts)
- @sources << @current_source
- end
- when OPTIONS
- value = $2
- value = true if value == "true"
- value = false if value == "false"
-
- key = $1
-
- if @opts[key]
- @opts[key] = Array(@opts[key])
- @opts[key] << value
- else
- @opts[key] = value
- end
- when *SOURCE
- @current_source = nil
- @opts = {}
- @type = line
- else
- parse_spec(line)
- end
- end
-
- space = / /
- NAME_VERSION = /
- ^(#{space}{2}|#{space}{4}|#{space}{6})(?!#{space}) # Exactly 2, 4, or 6 spaces at the start of the line
- (.*?) # Name
- (?:#{space}\(([^-]*) # Space, followed by version
- (?:-(.*))?\))? # Optional platform
- (!)? # Optional pinned marker
- $ # Line end
- /xo.freeze
-
- def parse_dependency(line)
- return unless line =~ NAME_VERSION
- spaces = $1
- return unless spaces.size == 2
- name = $2
- version = $3
- pinned = $5
-
- version = version.split(",").map(&:strip) if version
-
- dep = Bundler::Dependency.new(name, version)
-
- if pinned && dep.name != "bundler"
- spec = @specs.find {|_, v| v.name == dep.name }
- dep.source = spec.last.source if spec
-
- # Path sources need to know what the default name / version
- # to use in the case that there are no gemspecs present. A fake
- # gemspec is created based on the version set on the dependency
- # TODO: Use the version from the spec instead of from the dependency
- if version && version.size == 1 && version.first =~ /^\s*= (.+)\s*$/ && dep.source.is_a?(Bundler::Source::Path)
- dep.source.name = name
- dep.source.version = $1
- end
- end
-
- @dependencies[dep.name] = dep
- end
-
- def parse_spec(line)
- return unless line =~ NAME_VERSION
- spaces = $1
- name = $2
- version = $3
- platform = $4
-
- if spaces.size == 4
- version = Gem::Version.new(version)
- platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
- @current_spec = LazySpecification.new(name, version, platform)
- @current_spec.source = @current_source
-
- # Avoid introducing multiple copies of the same spec (caused by
- # duplicate GIT sections)
- @specs[@current_spec.identifier] ||= @current_spec
- elsif spaces.size == 6
- version = version.split(",").map(&:strip) if version
- dep = Gem::Dependency.new(name, version)
- @current_spec.dependencies << dep
- end
- end
-
- def parse_platform(line)
- @platforms << Gem::Platform.new($1) if line =~ /^ (.*)$/
- end
-
- def parse_bundled_with(line)
- line = line.strip
- return unless Gem::Version.correct?(line)
- @bundler_version = Gem::Version.create(line)
- end
-
- def parse_ruby(line)
- @ruby_version = line.strip
- end
- end
-end
diff --git a/lib/bundler/match_platform.rb b/lib/bundler/match_platform.rb
deleted file mode 100644
index 69074925a6..0000000000
--- a/lib/bundler/match_platform.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "gem_helpers"
-
-module Bundler
- module MatchPlatform
- include GemHelpers
-
- def match_platform(p)
- MatchPlatform.platforms_match?(platform, p)
- end
-
- def self.platforms_match?(gemspec_platform, local_platform)
- return true if gemspec_platform.nil?
- return true if Gem::Platform::RUBY == gemspec_platform
- return true if local_platform == gemspec_platform
- gemspec_platform = Gem::Platform.new(gemspec_platform)
- return true if GemHelpers.generic(gemspec_platform) === local_platform
- return true if gemspec_platform === local_platform
-
- false
- end
- end
-end
diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb
deleted file mode 100644
index 0e554bcc3f..0000000000
--- a/lib/bundler/mirror.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-# frozen_string_literal: true
-
-require "socket"
-
-module Bundler
- class Settings
- # Class used to build the mirror set and then find a mirror for a given URI
- #
- # @param prober [Prober object, nil] by default a TCPSocketProbe, this object
- # will be used to probe the mirror address to validate that the mirror replies.
- class Mirrors
- def initialize(prober = nil)
- @all = Mirror.new
- @prober = prober || TCPSocketProbe.new
- @mirrors = {}
- end
-
- # Returns a mirror for the given uri.
- #
- # Depending on the uri having a valid mirror or not, it may be a
- # mirror that points to the provided uri
- def for(uri)
- if @all.validate!(@prober).valid?
- @all
- else
- fetch_valid_mirror_for(Settings.normalize_uri(uri))
- end
- end
-
- def each
- @mirrors.each do |k, v|
- yield k, v.uri.to_s
- end
- end
-
- def parse(key, value)
- config = MirrorConfig.new(key, value)
- mirror = if config.all?
- @all
- else
- @mirrors[config.uri] ||= Mirror.new
- end
- config.update_mirror(mirror)
- end
-
- private
-
- def fetch_valid_mirror_for(uri)
- downcased = uri.to_s.downcase
- mirror = @mirrors[downcased] || @mirrors[Bundler::URI(downcased).host] || Mirror.new(uri)
- mirror.validate!(@prober)
- mirror = Mirror.new(uri) unless mirror.valid?
- mirror
- end
- end
-
- # A mirror
- #
- # Contains both the uri that should be used as a mirror and the
- # fallback timeout which will be used for probing if the mirror
- # replies on time or not.
- class Mirror
- DEFAULT_FALLBACK_TIMEOUT = 0.1
-
- attr_reader :uri, :fallback_timeout
-
- def initialize(uri = nil, fallback_timeout = 0)
- self.uri = uri
- self.fallback_timeout = fallback_timeout
- @valid = nil
- end
-
- def uri=(uri)
- @uri = if uri.nil?
- nil
- else
- Bundler::URI(uri.to_s)
- end
- @valid = nil
- end
-
- def fallback_timeout=(timeout)
- case timeout
- when true, "true"
- @fallback_timeout = DEFAULT_FALLBACK_TIMEOUT
- when false, "false"
- @fallback_timeout = 0
- else
- @fallback_timeout = timeout.to_i
- end
- @valid = nil
- end
-
- def ==(other)
- !other.nil? && uri == other.uri && fallback_timeout == other.fallback_timeout
- end
-
- def valid?
- return false if @uri.nil?
- return @valid unless @valid.nil?
- false
- end
-
- def validate!(probe = nil)
- @valid = false if uri.nil?
- if @valid.nil?
- @valid = fallback_timeout == 0 || (probe || TCPSocketProbe.new).replies?(self)
- end
- self
- end
- end
-
- # Class used to parse one configuration line
- #
- # Gets the configuration line and the value.
- # This object provides a `update_mirror` method
- # used to setup the given mirror value.
- class MirrorConfig
- attr_accessor :uri, :value
-
- def initialize(config_line, value)
- uri, fallback =
- config_line.match(%r{\Amirror\.(all|.+?)(\.fallback_timeout)?\/?\z}).captures
- @fallback = !fallback.nil?
- @all = false
- if uri == "all"
- @all = true
- else
- @uri = Bundler::URI(uri).absolute? ? Settings.normalize_uri(uri) : uri
- end
- @value = value
- end
-
- def all?
- @all
- end
-
- def update_mirror(mirror)
- if @fallback
- mirror.fallback_timeout = @value
- else
- mirror.uri = Settings.normalize_uri(@value)
- end
- end
- end
-
- # Class used for probing TCP availability for a given mirror.
- class TCPSocketProbe
- def replies?(mirror)
- MirrorSockets.new(mirror).any? do |socket, address, timeout|
- begin
- socket.connect_nonblock(address)
- rescue Errno::EINPROGRESS
- wait_for_writtable_socket(socket, address, timeout)
- rescue RuntimeError # Connection failed somehow, again
- false
- end
- end
- end
-
- private
-
- def wait_for_writtable_socket(socket, address, timeout)
- if IO.select(nil, [socket], nil, timeout)
- probe_writtable_socket(socket, address)
- else # TCP Handshake timed out, or there is something dropping packets
- false
- end
- end
-
- def probe_writtable_socket(socket, address)
- socket.connect_nonblock(address)
- rescue Errno::EISCONN
- true
- rescue StandardError # Connection failed
- false
- end
- end
- end
-
- # Class used to build the list of sockets that correspond to
- # a given mirror.
- #
- # One mirror may correspond to many different addresses, both
- # because of it having many dns entries or because
- # the network interface is both ipv4 and ipv5
- class MirrorSockets
- def initialize(mirror)
- @timeout = mirror.fallback_timeout
- @addresses = Socket.getaddrinfo(mirror.uri.host, mirror.uri.port).map do |address|
- SocketAddress.new(address[0], address[3], address[1])
- end
- end
-
- def any?
- @addresses.any? do |address|
- socket = Socket.new(Socket.const_get(address.type), Socket::SOCK_STREAM, 0)
- socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
- value = yield socket, address.to_socket_address, @timeout
- socket.close unless socket.closed?
- value
- end
- end
- end
-
- # Socket address builder.
- #
- # Given a socket type, a host and a port,
- # provides a method to build sockaddr string
- class SocketAddress
- attr_reader :type, :host, :port
-
- def initialize(type, host, port)
- @type = type
- @host = host
- @port = port
- end
-
- def to_socket_address
- Socket.pack_sockaddr_in(@port, @host)
- end
- end
-end
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
deleted file mode 100644
index f4dd435df4..0000000000
--- a/lib/bundler/plugin.rb
+++ /dev/null
@@ -1,305 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "plugin/api"
-
-module Bundler
- module Plugin
- autoload :DSL, File.expand_path("plugin/dsl", __dir__)
- autoload :Events, File.expand_path("plugin/events", __dir__)
- autoload :Index, File.expand_path("plugin/index", __dir__)
- autoload :Installer, File.expand_path("plugin/installer", __dir__)
- autoload :SourceList, File.expand_path("plugin/source_list", __dir__)
-
- class MalformattedPlugin < PluginError; end
- class UndefinedCommandError < PluginError; end
- class UnknownSourceError < PluginError; end
-
- PLUGIN_FILE_NAME = "plugins.rb".freeze
-
- module_function
-
- def reset!
- instance_variables.each {|i| remove_instance_variable(i) }
-
- @sources = {}
- @commands = {}
- @hooks_by_event = Hash.new {|h, k| h[k] = [] }
- @loaded_plugin_names = []
- end
-
- reset!
-
- # Installs a new plugin by the given name
- #
- # @param [Array<String>] names the name of plugin to be installed
- # @param [Hash] options various parameters as described in description.
- # Refer to cli/plugin for available options
- def install(names, options)
- specs = Installer.new.install(names, options)
-
- save_plugins names, specs
- rescue PluginError => e
- if specs
- specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
- specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
- end
-
- Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
- end
-
- # List installed plugins and commands
- #
- def list
- installed_plugins = index.installed_plugins
- if installed_plugins.any?
- output = String.new
- installed_plugins.each do |plugin|
- output << "#{plugin}\n"
- output << "-----\n"
- index.plugin_commands(plugin).each do |command|
- output << " #{command}\n"
- end
- output << "\n"
- end
- else
- output = "No plugins installed"
- end
- Bundler.ui.info output
- end
-
- # Evaluates the Gemfile with a limited DSL and installs the plugins
- # specified by plugin method
- #
- # @param [Pathname] gemfile path
- # @param [Proc] block that can be evaluated for (inline) Gemfile
- def gemfile_install(gemfile = nil, &inline)
- Bundler.settings.temporary(:frozen => false, :deployment => false) do
- builder = DSL.new
- if block_given?
- builder.instance_eval(&inline)
- else
- builder.eval_gemfile(gemfile)
- end
- definition = builder.to_definition(nil, true)
-
- return if definition.dependencies.empty?
-
- plugins = definition.dependencies.map(&:name).reject {|p| index.installed? p }
- installed_specs = Installer.new.install_definition(definition)
-
- save_plugins plugins, installed_specs, builder.inferred_plugins
- end
- rescue RuntimeError => e
- unless e.is_a?(GemfileError)
- Bundler.ui.error "Failed to install plugin: #{e.message}\n #{e.backtrace[0]}"
- end
- raise
- end
-
- # The index object used to store the details about the plugin
- def index
- @index ||= Index.new
- end
-
- # The directory root for all plugin related data
- #
- # If run in an app, points to local root, in app_config_path
- # Otherwise, points to global root, in Bundler.user_bundle_path("plugin")
- def root
- @root ||= if SharedHelpers.in_bundle?
- local_root
- else
- global_root
- end
- end
-
- def local_root
- Bundler.app_config_path.join("plugin")
- end
-
- # The global directory root for all plugin related data
- def global_root
- Bundler.user_bundle_path("plugin")
- end
-
- # The cache directory for plugin stuffs
- def cache
- @cache ||= root.join("cache")
- end
-
- # To be called via the API to register to handle a command
- def add_command(command, cls)
- @commands[command] = cls
- end
-
- # Checks if any plugin handles the command
- def command?(command)
- !index.command_plugin(command).nil?
- end
-
- # To be called from Cli class to pass the command and argument to
- # approriate plugin class
- def exec_command(command, args)
- raise UndefinedCommandError, "Command `#{command}` not found" unless command? command
-
- load_plugin index.command_plugin(command) unless @commands.key? command
-
- @commands[command].new.exec(command, args)
- end
-
- # To be called via the API to register to handle a source plugin
- def add_source(source, cls)
- @sources[source] = cls
- end
-
- # Checks if any plugin declares the source
- def source?(name)
- !index.source_plugin(name.to_s).nil?
- end
-
- # @return [Class] that handles the source. The calss includes API::Source
- def source(name)
- raise UnknownSourceError, "Source #{name} not found" unless source? name
-
- load_plugin(index.source_plugin(name)) unless @sources.key? name
-
- @sources[name]
- end
-
- # @param [Hash] The options that are present in the lock file
- # @return [API::Source] the instance of the class that handles the source
- # type passed in locked_opts
- def source_from_lock(locked_opts)
- src = source(locked_opts["type"])
-
- src.new(locked_opts.merge("uri" => locked_opts["remote"]))
- end
-
- # To be called via the API to register a hooks and corresponding block that
- # will be called to handle the hook
- def add_hook(event, &block)
- unless Events.defined_event?(event)
- raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
- end
- @hooks_by_event[event.to_s] << block
- end
-
- # Runs all the hooks that are registered for the passed event
- #
- # It passes the passed arguments and block to the block registered with
- # the api.
- #
- # @param [String] event
- def hook(event, *args, &arg_blk)
- return unless Bundler.feature_flag.plugins?
- unless Events.defined_event?(event)
- raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
- end
-
- plugins = index.hook_plugins(event)
- return unless plugins.any?
-
- (plugins - @loaded_plugin_names).each {|name| load_plugin(name) }
-
- @hooks_by_event[event].each {|blk| blk.call(*args, &arg_blk) }
- end
-
- # currently only intended for specs
- #
- # @return [String, nil] installed path
- def installed?(plugin)
- Index.new.installed?(plugin)
- end
-
- # Post installation processing and registering with index
- #
- # @param [Array<String>] plugins list to be installed
- # @param [Hash] specs of plugins mapped to installation path (currently they
- # contain all the installed specs, including plugins)
- # @param [Array<String>] names of inferred source plugins that can be ignored
- def save_plugins(plugins, specs, optional_plugins = [])
- plugins.each do |name|
- spec = specs[name]
- validate_plugin! Pathname.new(spec.full_gem_path)
- installed = register_plugin(name, spec, optional_plugins.include?(name))
- Bundler.ui.info "Installed plugin #{name}" if installed
- end
- end
-
- # Checks if the gem is good to be a plugin
- #
- # At present it only checks whether it contains plugins.rb file
- #
- # @param [Pathname] plugin_path the path plugin is installed at
- # @raise [MalformattedPlugin] if plugins.rb file is not found
- def validate_plugin!(plugin_path)
- plugin_file = plugin_path.join(PLUGIN_FILE_NAME)
- raise MalformattedPlugin, "#{PLUGIN_FILE_NAME} was not found in the plugin." unless plugin_file.file?
- end
-
- # Runs the plugins.rb file in an isolated namespace, records the plugin
- # actions it registers for and then passes the data to index to be stored.
- #
- # @param [String] name the name of the plugin
- # @param [Specification] spec of installed plugin
- # @param [Boolean] optional_plugin, removed if there is conflict with any
- # other plugin (used for default source plugins)
- #
- # @raise [MalformattedPlugin] if plugins.rb raises any error
- def register_plugin(name, spec, optional_plugin = false)
- commands = @commands
- sources = @sources
- hooks = @hooks_by_event
-
- @commands = {}
- @sources = {}
- @hooks_by_event = Hash.new {|h, k| h[k] = [] }
-
- load_paths = spec.load_paths
- Bundler.rubygems.add_to_load_path(load_paths)
- path = Pathname.new spec.full_gem_path
-
- begin
- load path.join(PLUGIN_FILE_NAME), true
- rescue StandardError => e
- raise MalformattedPlugin, "#{e.class}: #{e.message}"
- end
-
- if optional_plugin && @sources.keys.any? {|s| source? s }
- Bundler.rm_rf(path)
- false
- else
- index.register_plugin(name, path.to_s, load_paths, @commands.keys,
- @sources.keys, @hooks_by_event.keys)
- true
- end
- ensure
- @commands = commands
- @sources = sources
- @hooks_by_event = hooks
- end
-
- # Executes the plugins.rb file
- #
- # @param [String] name of the plugin
- def load_plugin(name)
- # Need to ensure before this that plugin root where the rest of gems
- # are installed to be on load path to support plugin deps. Currently not
- # done to avoid conflicts
- path = index.plugin_path(name)
-
- Bundler.rubygems.add_to_load_path(index.load_paths(name))
-
- load path.join(PLUGIN_FILE_NAME)
-
- @loaded_plugin_names << name
- rescue RuntimeError => e
- Bundler.ui.error "Failed loading plugin #{name}: #{e.message}"
- raise
- end
-
- class << self
- private :load_plugin, :register_plugin, :save_plugins, :validate_plugin!
- end
- end
-end
diff --git a/lib/bundler/plugin/api.rb b/lib/bundler/plugin/api.rb
deleted file mode 100644
index ee2bffe3ab..0000000000
--- a/lib/bundler/plugin/api.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # This is the interfacing class represents the API that we intend to provide
- # the plugins to use.
- #
- # For plugins to be independent of the Bundler internals they shall limit their
- # interactions to methods of this class only. This will save them from breaking
- # when some internal change.
- #
- # Currently we are delegating the methods defined in Bundler class to
- # itself. So, this class acts as a buffer.
- #
- # If there is some change in the Bundler class that is incompatible to its
- # previous behavior or if otherwise desired, we can reimplement(or implement)
- # the method to preserve compatibility.
- #
- # To use this, either the class can inherit this class or use it directly.
- # For example of both types of use, refer the file `spec/plugins/command.rb`
- #
- # To use it without inheriting, you will have to create an object of this
- # to use the functions (except for declaration functions like command, source,
- # and hooks).
- module Plugin
- class API
- autoload :Source, File.expand_path("api/source", __dir__)
-
- # The plugins should declare that they handle a command through this helper.
- #
- # @param [String] command being handled by them
- # @param [Class] (optional) class that handles the command. If not
- # provided, the `self` class will be used.
- def self.command(command, cls = self)
- Plugin.add_command command, cls
- end
-
- # The plugins should declare that they provide a installation source
- # through this helper.
- #
- # @param [String] the source type they provide
- # @param [Class] (optional) class that handles the source. If not
- # provided, the `self` class will be used.
- def self.source(source, cls = self)
- cls.send :include, Bundler::Plugin::API::Source
- Plugin.add_source source, cls
- end
-
- def self.hook(event, &block)
- Plugin.add_hook(event, &block)
- end
-
- # The cache dir to be used by the plugins for storage
- #
- # @return [Pathname] path of the cache dir
- def cache_dir
- Plugin.cache.join("plugins")
- end
-
- # A tmp dir to be used by plugins
- # Accepts names that get concatenated as suffix
- #
- # @return [Pathname] object for the new directory created
- def tmp(*names)
- Bundler.tmp(["plugin", *names].join("-"))
- end
-
- def method_missing(name, *args, &blk)
- return Bundler.send(name, *args, &blk) if Bundler.respond_to?(name)
-
- return SharedHelpers.send(name, *args, &blk) if SharedHelpers.respond_to?(name)
-
- super
- end
-
- def respond_to_missing?(name, include_private = false)
- SharedHelpers.respond_to?(name, include_private) ||
- Bundler.respond_to?(name, include_private) || super
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb
deleted file mode 100644
index 56e97f4aa4..0000000000
--- a/lib/bundler/plugin/api/source.rb
+++ /dev/null
@@ -1,304 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module Plugin
- class API
- # This class provides the base to build source plugins
- # All the method here are required to build a source plugin (except
- # `uri_hash`, `gem_install_dir`; they are helpers).
- #
- # Defaults for methods, where ever possible are provided which is
- # expected to work. But, all source plugins have to override
- # `fetch_gemspec_files` and `install`. Defaults are also not provided for
- # `remote!`, `cache!` and `unlock!`.
- #
- # The defaults shall work for most situations but nevertheless they can
- # be (preferably should be) overridden as per the plugins' needs safely
- # (as long as they behave as expected).
- # On overriding `initialize` you should call super first.
- #
- # If required plugin should override `hash`, `==` and `eql?` methods to be
- # able to match objects representing same sources, but may be created in
- # different situation (like form gemfile and lockfile). The default ones
- # checks only for class and uri, but elaborate source plugins may need
- # more comparisons (e.g. git checking on branch or tag).
- #
- # @!attribute [r] uri
- # @return [String] the remote specified with `source` block in Gemfile
- #
- # @!attribute [r] options
- # @return [String] options passed during initialization (either from
- # lockfile or Gemfile)
- #
- # @!attribute [r] name
- # @return [String] name that can be used to uniquely identify a source
- #
- # @!attribute [rw] dependency_names
- # @return [Array<String>] Names of dependencies that the source should
- # try to resolve. It is not necessary to use this list internally. This
- # is present to be compatible with `Definition` and is used by
- # rubygems source.
- module Source
- attr_reader :uri, :options, :name
- attr_accessor :dependency_names
-
- def initialize(opts)
- @options = opts
- @dependency_names = []
- @uri = opts["uri"]
- @type = opts["type"]
- @name = opts["name"] || "#{@type} at #{@uri}"
- end
-
- # This is used by the default `spec` method to constructs the
- # Specification objects for the gems and versions that can be installed
- # by this source plugin.
- #
- # Note: If the spec method is overridden, this function is not necessary
- #
- # @return [Array<String>] paths of the gemspec files for gems that can
- # be installed
- def fetch_gemspec_files
- []
- end
-
- # Options to be saved in the lockfile so that the source plugin is able
- # to check out same version of gem later.
- #
- # There options are passed when the source plugin is created from the
- # lock file.
- #
- # @return [Hash]
- def options_to_lock
- {}
- end
-
- # Install the gem specified by the spec at appropriate path.
- # `install_path` provides a sufficient default, if the source can only
- # satisfy one gem, but is not binding.
- #
- # @return [String] post installation message (if any)
- def install(spec, opts)
- raise MalformattedPlugin, "Source plugins need to override the install method."
- end
-
- # It builds extensions, generates bins and installs them for the spec
- # provided.
- #
- # It depends on `spec.loaded_from` to get full_gem_path. The source
- # plugins should set that.
- #
- # It should be called in `install` after the plugin is done placing the
- # gem at correct install location.
- #
- # It also runs Gem hooks `pre_install`, `post_build` and `post_install`
- #
- # Note: Do not override if you don't know what you are doing.
- def post_install(spec, disable_exts = false)
- opts = { :env_shebang => false, :disable_extensions => disable_exts }
- installer = Bundler::Source::Path::Installer.new(spec, opts)
- installer.post_install
- end
-
- # A default installation path to install a single gem. If the source
- # servers multiple gems, it's not of much use and the source should one
- # of its own.
- def install_path
- @install_path ||=
- begin
- base_name = File.basename(Bundler::URI.parse(uri).normalize.path)
-
- gem_install_dir.join("#{base_name}-#{uri_hash[0..11]}")
- end
- end
-
- # Parses the gemspec files to find the specs for the gems that can be
- # satisfied by the source.
- #
- # Few important points to keep in mind:
- # - If the gems are not installed then it shall return specs for all
- # the gems it can satisfy
- # - If gem is installed (that is to be detected by the plugin itself)
- # then it shall return at least the specs that are installed.
- # - The `loaded_from` for each of the specs shall be correct (it is
- # used to find the load path)
- #
- # @return [Bundler::Index] index containing the specs
- def specs
- files = fetch_gemspec_files
-
- Bundler::Index.build do |index|
- files.each do |file|
- next unless spec = Bundler.load_gemspec(file)
- Bundler.rubygems.set_installed_by_version(spec)
-
- spec.source = self
- Bundler.rubygems.validate(spec)
-
- index << spec
- end
- end
- end
-
- # Set internal representation to fetch the gems/specs from remote.
- #
- # When this is called, the source should try to fetch the specs and
- # install from remote path.
- def remote!
- end
-
- # Set internal representation to fetch the gems/specs from app cache.
- #
- # When this is called, the source should try to fetch the specs and
- # install from the path provided by `app_cache_path`.
- def cached!
- end
-
- # This is called to update the spec and installation.
- #
- # If the source plugin is loaded from lockfile or otherwise, it shall
- # refresh the cache/specs (e.g. git sources can make a fresh clone).
- def unlock!
- end
-
- # Name of directory where plugin the is expected to cache the gems when
- # #cache is called.
- #
- # Also this name is matched against the directories in cache for pruning
- #
- # This is used by `app_cache_path`
- def app_cache_dirname
- base_name = File.basename(Bundler::URI.parse(uri).normalize.path)
- "#{base_name}-#{uri_hash}"
- end
-
- # This method is called while caching to save copy of the gems that the
- # source can resolve to path provided by `app_cache_app`so that they can
- # be reinstalled from the cache without querying the remote (i.e. an
- # alternative to remote)
- #
- # This is stored with the app and source plugins should try to provide
- # specs and install only from this cache when `cached!` is called.
- #
- # This cache is different from the internal caching that can be done
- # at sub paths of `cache_path` (from API). This can be though as caching
- # by bundler.
- def cache(spec, custom_path = nil)
- new_cache_path = app_cache_path(custom_path)
-
- FileUtils.rm_rf(new_cache_path)
- FileUtils.cp_r(install_path, new_cache_path)
- FileUtils.touch(app_cache_path.join(".bundlecache"))
- end
-
- # This shall check if two source object represent the same source.
- #
- # The comparison shall take place only on the attribute that can be
- # inferred from the options passed from Gemfile and not on attributes
- # that are used to pin down the gem to specific version (e.g. Git
- # sources should compare on branch and tag but not on commit hash)
- #
- # The sources objects are constructed from Gemfile as well as from
- # lockfile. To converge the sources, it is necessary that they match.
- #
- # The same applies for `eql?` and `hash`
- def ==(other)
- other.is_a?(self.class) && uri == other.uri
- end
-
- # When overriding `eql?` please preserve the behaviour as mentioned in
- # docstring for `==` method.
- alias_method :eql?, :==
-
- # When overriding `hash` please preserve the behaviour as mentioned in
- # docstring for `==` method, i.e. two methods equal by above comparison
- # should have same hash.
- def hash
- [self.class, uri].hash
- end
-
- # A helper method, not necessary if not used internally.
- def installed?
- File.directory?(install_path)
- end
-
- # The full path where the plugin should cache the gem so that it can be
- # installed latter.
- #
- # Note: Do not override if you don't know what you are doing.
- def app_cache_path(custom_path = nil)
- @app_cache_path ||= Bundler.app_cache(custom_path).join(app_cache_dirname)
- end
-
- # Used by definition.
- #
- # Note: Do not override if you don't know what you are doing.
- def unmet_deps
- specs.unmet_dependency_names
- end
-
- # Note: Do not override if you don't know what you are doing.
- def can_lock?(spec)
- spec.source == self
- end
-
- # Generates the content to be entered into the lockfile.
- # Saves type and remote and also calls to `options_to_lock`.
- #
- # Plugin should use `options_to_lock` to save information in lockfile
- # and not override this.
- #
- # Note: Do not override if you don't know what you are doing.
- def to_lock
- out = String.new("#{LockfileParser::PLUGIN}\n")
- out << " remote: #{@uri}\n"
- out << " type: #{@type}\n"
- options_to_lock.each do |opt, value|
- out << " #{opt}: #{value}\n"
- end
- out << " specs:\n"
- end
-
- def to_s
- "plugin source for #{options[:type]} with uri #{uri}"
- end
-
- # Note: Do not override if you don't know what you are doing.
- def include?(other)
- other == self
- end
-
- def uri_hash
- SharedHelpers.digest(:SHA1).hexdigest(uri)
- end
-
- # Note: Do not override if you don't know what you are doing.
- def gem_install_dir
- Bundler.install_path
- end
-
- # It is used to obtain the full_gem_path.
- #
- # spec's loaded_from path is expanded against this to get full_gem_path
- #
- # Note: Do not override if you don't know what you are doing.
- def root
- Bundler.root
- end
-
- # @private
- # Returns true
- def bundler_plugin_api_source?
- true
- end
-
- # @private
- # This API on source might not be stable, and for now we expect plugins
- # to download all specs in `#specs`, so we implement the method for
- # compatibility purposes and leave it undocumented (and don't support)
- # overriding it)
- def double_check_for(*); end
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/dsl.rb b/lib/bundler/plugin/dsl.rb
deleted file mode 100644
index 4bfc8437e0..0000000000
--- a/lib/bundler/plugin/dsl.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module Plugin
- # Dsl to parse the Gemfile looking for plugins to install
- class DSL < Bundler::Dsl
- class PluginGemfileError < PluginError; end
- alias_method :_gem, :gem # To use for plugin installation as gem
-
- # So that we don't have to override all there methods to dummy ones
- # explicitly.
- # They will be handled by method_missing
- [:gemspec, :gem, :path, :install_if, :platforms, :env].each {|m| undef_method m }
-
- # This lists the plugins that was added automatically and not specified by
- # the user.
- #
- # When we encounter :type attribute with a source block, we add a plugin
- # by name bundler-source-<type> to list of plugins to be installed.
- #
- # These plugins are optional and are not installed when there is conflict
- # with any other plugin.
- attr_reader :inferred_plugins
-
- def initialize
- super
- @sources = Plugin::SourceList.new
- @inferred_plugins = [] # The source plugins inferred from :type
- end
-
- def plugin(name, *args)
- _gem(name, *args)
- end
-
- def method_missing(name, *args)
- raise PluginGemfileError, "Undefined local variable or method `#{name}' for Gemfile" unless Bundler::Dsl.method_defined? name
- end
-
- def source(source, *args, &blk)
- options = args.last.is_a?(Hash) ? args.pop.dup : {}
- options = normalize_hash(options)
- return super unless options.key?("type")
-
- plugin_name = "bundler-source-#{options["type"]}"
-
- return if @dependencies.any? {|d| d.name == plugin_name }
-
- plugin(plugin_name)
- @inferred_plugins << plugin_name
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/events.rb b/lib/bundler/plugin/events.rb
deleted file mode 100644
index bc037d1af5..0000000000
--- a/lib/bundler/plugin/events.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module Plugin
- module Events
- def self.define(const, event)
- const = const.to_sym.freeze
- if const_defined?(const) && const_get(const) != event
- raise ArgumentError, "Attempting to reassign #{const} to a different value"
- end
- const_set(const, event) unless const_defined?(const)
- @events ||= {}
- @events[event] = const
- end
- private_class_method :define
-
- def self.reset
- @events.each_value do |const|
- remove_const(const)
- end
- @events = nil
- end
- private_class_method :reset
-
- # Check if an event has been defined
- # @param event [String] An event to check
- # @return [Boolean] A boolean indicating if the event has been defined
- def self.defined_event?(event)
- @events ||= {}
- @events.key?(event)
- end
-
- # @!parse
- # A hook called before each individual gem is installed
- # Includes a Bundler::ParallelInstaller::SpecInstallation.
- # No state, error, post_install_message will be present as nothing has installed yet
- # GEM_BEFORE_INSTALL = "before-install"
- define :GEM_BEFORE_INSTALL, "before-install"
-
- # @!parse
- # A hook called after each individual gem is installed
- # Includes a Bundler::ParallelInstaller::SpecInstallation.
- # - If state is failed, an error will be present.
- # - If state is success, a post_install_message may be present.
- # GEM_AFTER_INSTALL = "after-install"
- define :GEM_AFTER_INSTALL, "after-install"
-
- # @!parse
- # A hook called before any gems install
- # Includes an Array of Bundler::Dependency objects
- # GEM_BEFORE_INSTALL_ALL = "before-install-all"
- define :GEM_BEFORE_INSTALL_ALL, "before-install-all"
-
- # @!parse
- # A hook called after any gems install
- # Includes an Array of Bundler::Dependency objects
- # GEM_AFTER_INSTALL_ALL = "after-install-all"
- define :GEM_AFTER_INSTALL_ALL, "after-install-all"
- end
- end
-end
diff --git a/lib/bundler/plugin/index.rb b/lib/bundler/plugin/index.rb
deleted file mode 100644
index 2d70a046bb..0000000000
--- a/lib/bundler/plugin/index.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # Manages which plugins are installed and their sources. This also is supposed to map
- # which plugin does what (currently the features are not implemented so this class is
- # now a stub class).
- module Plugin
- class Index
- class CommandConflict < PluginError
- def initialize(plugin, commands)
- msg = "Command(s) `#{commands.join("`, `")}` declared by #{plugin} are already registered."
- super msg
- end
- end
-
- class SourceConflict < PluginError
- def initialize(plugin, sources)
- msg = "Source(s) `#{sources.join("`, `")}` declared by #{plugin} are already registered."
- super msg
- end
- end
-
- attr_reader :commands
-
- def initialize
- @plugin_paths = {}
- @commands = {}
- @sources = {}
- @hooks = {}
- @load_paths = {}
-
- begin
- load_index(global_index_file, true)
- rescue GenericSystemCallError
- # no need to fail when on a read-only FS, for example
- nil
- end
- load_index(local_index_file) if SharedHelpers.in_bundle?
- end
-
- # This function is to be called when a new plugin is installed. This
- # function shall add the functions of the plugin to existing maps and also
- # the name to source location.
- #
- # @param [String] name of the plugin to be registered
- # @param [String] path where the plugin is installed
- # @param [Array<String>] load_paths for the plugin
- # @param [Array<String>] commands that are handled by the plugin
- # @param [Array<String>] sources that are handled by the plugin
- def register_plugin(name, path, load_paths, commands, sources, hooks)
- old_commands = @commands.dup
-
- common = commands & @commands.keys
- raise CommandConflict.new(name, common) unless common.empty?
- commands.each {|c| @commands[c] = name }
-
- common = sources & @sources.keys
- raise SourceConflict.new(name, common) unless common.empty?
- sources.each {|k| @sources[k] = name }
-
- hooks.each do |event|
- event_hooks = (@hooks[event] ||= []) << name
- event_hooks.uniq!
- end
-
- @plugin_paths[name] = path
- @load_paths[name] = load_paths
- save_index
- rescue StandardError
- @commands = old_commands
- raise
- end
-
- # Path of default index file
- def index_file
- Plugin.root.join("index")
- end
-
- # Path where the global index file is stored
- def global_index_file
- Plugin.global_root.join("index")
- end
-
- # Path where the local index file is stored
- def local_index_file
- Plugin.local_root.join("index")
- end
-
- def plugin_path(name)
- Pathname.new @plugin_paths[name]
- end
-
- def load_paths(name)
- @load_paths[name]
- end
-
- # Fetch the name of plugin handling the command
- def command_plugin(command)
- @commands[command]
- end
-
- def installed?(name)
- @plugin_paths[name]
- end
-
- def installed_plugins
- @plugin_paths.keys
- end
-
- def plugin_commands(plugin)
- @commands.find_all {|_, n| n == plugin }.map(&:first)
- end
-
- def source?(source)
- @sources.key? source
- end
-
- def source_plugin(name)
- @sources[name]
- end
-
- # Returns the list of plugin names handling the passed event
- def hook_plugins(event)
- @hooks[event] || []
- end
-
- private
-
- # Reads the index file from the directory and initializes the instance
- # variables.
- #
- # It skips the sources if the second param is true
- # @param [Pathname] index file path
- # @param [Boolean] is the index file global index
- def load_index(index_file, global = false)
- SharedHelpers.filesystem_access(index_file, :read) do |index_f|
- valid_file = index_f && index_f.exist? && !index_f.size.zero?
- break unless valid_file
-
- data = index_f.read
-
- require_relative "../yaml_serializer"
- index = YAMLSerializer.load(data)
-
- @commands.merge!(index["commands"])
- @hooks.merge!(index["hooks"])
- @load_paths.merge!(index["load_paths"])
- @plugin_paths.merge!(index["plugin_paths"])
- @sources.merge!(index["sources"]) unless global
- end
- end
-
- # Should be called when any of the instance variables change. Stores the
- # instance variables in YAML format. (The instance variables are supposed
- # to be only String key value pairs)
- def save_index
- index = {
- "commands" => @commands,
- "hooks" => @hooks,
- "load_paths" => @load_paths,
- "plugin_paths" => @plugin_paths,
- "sources" => @sources,
- }
-
- require_relative "../yaml_serializer"
- SharedHelpers.filesystem_access(index_file) do |index_f|
- FileUtils.mkdir_p(index_f.dirname)
- File.open(index_f, "w") {|f| f.puts YAMLSerializer.dump(index) }
- end
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb
deleted file mode 100644
index bcea3f0e45..0000000000
--- a/lib/bundler/plugin/installer.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # Handles the installation of plugin in appropriate directories.
- #
- # This class is supposed to be wrapper over the existing gem installation infra
- # but currently it itself handles everything as the Source's subclasses (e.g. Source::RubyGems)
- # are heavily dependent on the Gemfile.
- module Plugin
- class Installer
- autoload :Rubygems, File.expand_path("installer/rubygems", __dir__)
- autoload :Git, File.expand_path("installer/git", __dir__)
-
- def install(names, options)
- check_sources_consistency!(options)
-
- version = options[:version] || [">= 0"]
-
- Bundler.settings.temporary(:disable_multisource => false) do
- if options[:git]
- install_git(names, version, options)
- elsif options[:local_git]
- install_local_git(names, version, options)
- else
- sources = options[:source] || Bundler.rubygems.sources
- install_rubygems(names, version, sources)
- end
- end
- end
-
- # Installs the plugin from Definition object created by limited parsing of
- # Gemfile searching for plugins to be installed
- #
- # @param [Definition] definition object
- # @return [Hash] map of names to their specs they are installed with
- def install_definition(definition)
- def definition.lock(*); end
- definition.resolve_remotely!
- specs = definition.specs
-
- install_from_specs specs
- end
-
- private
-
- def check_sources_consistency!(options)
- if options.key?(:git) && options.key?(:local_git)
- raise InvalidOption, "Remote and local plugin git sources can't be both specified"
- end
- end
-
- def install_git(names, version, options)
- uri = options.delete(:git)
- options["uri"] = uri
-
- install_all_sources(names, version, options, options[:source])
- end
-
- def install_local_git(names, version, options)
- uri = options.delete(:local_git)
- options["uri"] = uri
-
- install_all_sources(names, version, options, options[:source])
- end
-
- # Installs the plugin from rubygems source and returns the path where the
- # plugin was installed
- #
- # @param [String] name of the plugin gem to search in the source
- # @param [Array] version of the gem to install
- # @param [String, Array<String>] source(s) to resolve the gem
- #
- # @return [Hash] map of names to the specs of plugins installed
- def install_rubygems(names, version, sources)
- install_all_sources(names, version, nil, sources)
- end
-
- def install_all_sources(names, version, git_source_options, rubygems_source)
- source_list = SourceList.new
-
- source_list.add_git_source(git_source_options) if git_source_options
- source_list.add_rubygems_source("remotes" => rubygems_source) if rubygems_source
-
- deps = names.map {|name| Dependency.new name, version }
-
- definition = Definition.new(nil, deps, source_list, true)
- install_definition(definition)
- end
-
- # Installs the plugins and deps from the provided specs and returns map of
- # gems to their paths
- #
- # @param specs to install
- #
- # @return [Hash] map of names to the specs
- def install_from_specs(specs)
- paths = {}
-
- specs.each do |spec|
- spec.source.install spec
-
- paths[spec.name] = spec
- end
-
- paths
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/installer/git.rb b/lib/bundler/plugin/installer/git.rb
deleted file mode 100644
index fbb6c5e40e..0000000000
--- a/lib/bundler/plugin/installer/git.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module Plugin
- class Installer
- class Git < Bundler::Source::Git
- def cache_path
- @cache_path ||= begin
- git_scope = "#{base_name}-#{uri_hash}"
-
- Plugin.cache.join("bundler", "git", git_scope)
- end
- end
-
- def install_path
- @install_path ||= begin
- git_scope = "#{base_name}-#{shortref_for_path(revision)}"
-
- Plugin.root.join("bundler", "gems", git_scope)
- end
- end
-
- def version_message(spec)
- "#{spec.name} #{spec.version}"
- end
-
- def root
- Plugin.root
- end
-
- def generate_bin(spec, disable_extensions = false)
- # Need to find a way without code duplication
- # For now, we can ignore this
- end
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/installer/rubygems.rb b/lib/bundler/plugin/installer/rubygems.rb
deleted file mode 100644
index 7ae74fa93b..0000000000
--- a/lib/bundler/plugin/installer/rubygems.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module Plugin
- class Installer
- class Rubygems < Bundler::Source::Rubygems
- def version_message(spec)
- "#{spec.name} #{spec.version}"
- end
-
- private
-
- def requires_sudo?
- false # Will change on implementation of project level plugins
- end
-
- def rubygems_dir
- Plugin.root
- end
-
- def cache_path
- Plugin.cache
- end
- end
- end
- end
-end
diff --git a/lib/bundler/plugin/source_list.rb b/lib/bundler/plugin/source_list.rb
deleted file mode 100644
index f0e212205f..0000000000
--- a/lib/bundler/plugin/source_list.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # SourceList object to be used while parsing the Gemfile, setting the
- # approptiate options to be used with Source classes for plugin installation
- module Plugin
- class SourceList < Bundler::SourceList
- def add_git_source(options = {})
- add_source_to_list Plugin::Installer::Git.new(options), git_sources
- end
-
- def add_rubygems_source(options = {})
- add_source_to_list Plugin::Installer::Rubygems.new(options), @rubygems_sources
- end
-
- def all_sources
- path_sources + git_sources + rubygems_sources + [metadata_source]
- end
-
- private
-
- def rubygems_aggregate_class
- Plugin::Installer::Rubygems
- end
- end
- end
-end
diff --git a/lib/bundler/process_lock.rb b/lib/bundler/process_lock.rb
deleted file mode 100644
index cba4fcdba5..0000000000
--- a/lib/bundler/process_lock.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class ProcessLock
- def self.lock(bundle_path = Bundler.bundle_path)
- lock_file_path = File.join(bundle_path, "bundler.lock")
- has_lock = false
-
- File.open(lock_file_path, "w") do |f|
- f.flock(File::LOCK_EX)
- has_lock = true
- yield
- f.flock(File::LOCK_UN)
- end
- rescue Errno::EACCES, Errno::ENOLCK, *[SharedHelpers.const_get_safely(:ENOTSUP, Errno)].compact
- # In the case the user does not have access to
- # create the lock file or is using NFS where
- # locks are not available we skip locking.
- yield
- ensure
- FileUtils.rm_f(lock_file_path) if has_lock
- end
- end
-end
diff --git a/lib/bundler/psyched_yaml.rb b/lib/bundler/psyched_yaml.rb
deleted file mode 100644
index c086b7651c..0000000000
--- a/lib/bundler/psyched_yaml.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-# Psych could be a gem, so try to ask for it
-begin
- gem "psych"
-rescue LoadError
-end if defined?(gem)
-
-# Psych could be in the stdlib
-# but it's too late if Syck is already loaded
-begin
- require "psych" unless defined?(Syck)
-rescue LoadError
- # Apparently Psych wasn't available. Oh well.
-end
-
-# At least load the YAML stdlib, whatever that may be
-require "yaml" unless defined?(YAML.dump)
-
-module Bundler
- # On encountering invalid YAML,
- # Psych raises Psych::SyntaxError
- if defined?(::Psych::SyntaxError)
- YamlLibrarySyntaxError = ::Psych::SyntaxError
- else # Syck raises ArgumentError
- YamlLibrarySyntaxError = ::ArgumentError
- end
-end
-
-require_relative "deprecate"
-begin
- Bundler::Deprecate.skip_during do
- require "rubygems/safe_yaml"
- end
-rescue LoadError
- # it's OK if the file isn't there
-end
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
deleted file mode 100644
index f87a09b9a6..0000000000
--- a/lib/bundler/remote_specification.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # Represents a lazily loaded gem specification, where the full specification
- # is on the source server in rubygems' "quick" index. The proxy object is to
- # be seeded with what we're given from the source's abbreviated index - the
- # full specification will only be fetched when necessary.
- class RemoteSpecification
- include MatchPlatform
- include Comparable
-
- attr_reader :name, :version, :platform
- attr_writer :dependencies
- attr_accessor :source, :remote
-
- def initialize(name, version, platform, spec_fetcher)
- @name = name
- @version = Gem::Version.create version
- @platform = platform
- @spec_fetcher = spec_fetcher
- @dependencies = nil
- end
-
- # Needed before installs, since the arch matters then and quick
- # specs don't bother to include the arch in the platform string
- def fetch_platform
- @platform = _remote_specification.platform
- end
-
- def full_name
- if platform == Gem::Platform::RUBY || platform.nil?
- "#{@name}-#{@version}"
- else
- "#{@name}-#{@version}-#{platform}"
- end
- end
-
- # Compare this specification against another object. Using sort_obj
- # is compatible with Gem::Specification and other Bundler or RubyGems
- # objects. Otherwise, use the default Object comparison.
- def <=>(other)
- if other.respond_to?(:sort_obj)
- sort_obj <=> other.sort_obj
- else
- super
- end
- end
-
- # Because Rubyforge cannot be trusted to provide valid specifications
- # once the remote gem is downloaded, the backend specification will
- # be swapped out.
- def __swap__(spec)
- SharedHelpers.ensure_same_dependencies(self, dependencies, spec.dependencies)
- @_remote_specification = spec
- end
-
- # Create a delegate used for sorting. This strategy is copied from
- # RubyGems 2.23 and ensures that Bundler's specifications can be
- # compared and sorted with RubyGems' own specifications.
- #
- # @see #<=>
- # @see Gem::Specification#sort_obj
- #
- # @return [Array] an object you can use to compare and sort this
- # specification against other specifications
- def sort_obj
- [@name, @version, @platform == Gem::Platform::RUBY ? -1 : 1]
- end
-
- def to_s
- "#<#{self.class} name=#{name} version=#{version} platform=#{platform}>"
- end
-
- def dependencies
- @dependencies ||= begin
- deps = method_missing(:dependencies)
-
- # allow us to handle when the specs dependencies are an array of array of string
- # see https://github.com/bundler/bundler/issues/5797
- deps = deps.map {|d| d.is_a?(Gem::Dependency) ? d : Gem::Dependency.new(*d) }
-
- deps
- end
- end
-
- def git_version
- return unless loaded_from && source.is_a?(Bundler::Source::Git)
- " #{source.revision[0..6]}"
- end
-
- private
-
- def to_ary
- nil
- end
-
- def _remote_specification
- @_remote_specification ||= @spec_fetcher.fetch_spec([@name, @version, @platform])
- @_remote_specification || raise(GemspecError, "Gemspec data for #{full_name} was" \
- " missing from the server! Try installing with `--full-index` as a workaround.")
- end
-
- def method_missing(method, *args, &blk)
- _remote_specification.send(method, *args, &blk)
- end
-
- def respond_to?(method, include_all = false)
- super || _remote_specification.respond_to?(method, include_all)
- end
- public :respond_to?
- end
-end
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
deleted file mode 100644
index c7caf01c7d..0000000000
--- a/lib/bundler/resolver.rb
+++ /dev/null
@@ -1,421 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Resolver
- require_relative "vendored_molinillo"
- require_relative "resolver/spec_group"
-
- # Figures out the best possible configuration of gems that satisfies
- # the list of passed dependencies and any child dependencies without
- # causing any gem activation errors.
- #
- # ==== Parameters
- # *dependencies<Gem::Dependency>:: The list of dependencies to resolve
- #
- # ==== Returns
- # <GemBundle>,nil:: If the list of dependencies can be resolved, a
- # collection of gemspecs is returned. Otherwise, nil is returned.
- def self.resolve(requirements, index, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
- platforms = Set.new(platforms) if platforms
- base = SpecSet.new(base) unless base.is_a?(SpecSet)
- resolver = new(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
- result = resolver.start(requirements)
- SpecSet.new(result)
- end
-
- def initialize(index, source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
- @index = index
- @source_requirements = source_requirements
- @base = base
- @resolver = Molinillo::Resolver.new(self, self)
- @search_for = {}
- @base_dg = Molinillo::DependencyGraph.new
- @base.each do |ls|
- dep = Dependency.new(ls.name, ls.version)
- @base_dg.add_vertex(ls.name, DepProxy.new(dep, ls.platform), true)
- end
- additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
- @platforms = platforms
- @gem_version_promoter = gem_version_promoter
- @allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
- @use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
- @lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.disable_multisource?
- end
-
- def start(requirements)
- @gem_version_promoter.prerelease_specified = @prerelease_specified = {}
- requirements.each {|dep| @prerelease_specified[dep.name] ||= dep.prerelease? }
-
- verify_gemfile_dependencies_are_found!(requirements)
- dg = @resolver.resolve(requirements, @base_dg)
- dg.
- tap {|resolved| validate_resolved_specs!(resolved) }.
- map(&:payload).
- reject {|sg| sg.name.end_with?("\0") }.
- map(&:to_specs).
- flatten
- rescue Molinillo::VersionConflict => e
- message = version_conflict_message(e)
- raise VersionConflict.new(e.conflicts.keys.uniq, message)
- rescue Molinillo::CircularDependencyError => e
- names = e.dependencies.sort_by(&:name).map {|d| "gem '#{d.name}'" }
- raise CyclicDependencyError, "Your bundle requires gems that depend" \
- " on each other, creating an infinite loop. Please remove" \
- " #{names.count > 1 ? "either " : ""}#{names.join(" or ")}" \
- " and try again."
- end
-
- include Molinillo::UI
-
- # Conveys debug information to the user.
- #
- # @param [Integer] depth the current depth of the resolution process.
- # @return [void]
- def debug(depth = 0)
- return unless debug?
- debug_info = yield
- debug_info = debug_info.inspect unless debug_info.is_a?(String)
- warn debug_info.split("\n").map {|s| " " * depth + s }
- end
-
- def debug?
- return @debug_mode if defined?(@debug_mode)
- @debug_mode = ENV["DEBUG_RESOLVER"] || ENV["DEBUG_RESOLVER_TREE"] || false
- end
-
- def before_resolution
- Bundler.ui.info "Resolving dependencies...", debug?
- end
-
- def after_resolution
- Bundler.ui.info ""
- end
-
- def indicate_progress
- Bundler.ui.info ".", false unless debug?
- end
-
- include Molinillo::SpecificationProvider
-
- def dependencies_for(specification)
- specification.dependencies_for_activated_platforms
- end
-
- def search_for(dependency)
- platform = dependency.__platform
- dependency = dependency.dep unless dependency.is_a? Gem::Dependency
- search = @search_for[dependency] ||= begin
- index = index_for(dependency)
- results = index.search(dependency, @base[dependency.name])
-
- if vertex = @base_dg.vertex_named(dependency.name)
- locked_requirement = vertex.payload.requirement
- end
-
- if !@prerelease_specified[dependency.name] && (!@use_gvp || locked_requirement.nil?)
- # Move prereleases to the beginning of the list, so they're considered
- # last during resolution.
- pre, results = results.partition {|spec| spec.version.prerelease? }
- results = pre + results
- end
-
- spec_groups = if results.any?
- nested = []
- results.each do |spec|
- version, specs = nested.last
- if version == spec.version
- specs << spec
- else
- nested << [spec.version, [spec]]
- end
- end
- nested.reduce([]) do |groups, (version, specs)|
- next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
- spec_group = SpecGroup.new(specs)
- spec_group.ignores_bundler_dependencies = @allow_bundler_dependency_conflicts
- groups << spec_group
- end
- else
- []
- end
- # GVP handles major itself, but it's still a bit risky to trust it with it
- # until we get it settled with new behavior. For 2.x it can take over all cases.
- if !@use_gvp
- spec_groups
- else
- @gem_version_promoter.sort_versions(dependency, spec_groups)
- end
- end
- search.select {|sg| sg.for?(platform) }.each {|sg| sg.activate_platform!(platform) }
- end
-
- def index_for(dependency)
- source = @source_requirements[dependency.name]
- if source
- source.specs
- elsif @lockfile_uses_separate_rubygems_sources
- Index.build do |idx|
- if dependency.all_sources
- dependency.all_sources.each {|s| idx.add_source(s.specs) if s }
- else
- idx.add_source @source_requirements[:default].specs
- end
- end
- else
- @index
- end
- end
-
- def name_for(dependency)
- dependency.name
- end
-
- def name_for_explicit_dependency_source
- Bundler.default_gemfile.basename.to_s
- rescue StandardError
- "Gemfile"
- end
-
- def name_for_locking_dependency_source
- Bundler.default_lockfile.basename.to_s
- rescue StandardError
- "Gemfile.lock"
- end
-
- def requirement_satisfied_by?(requirement, activated, spec)
- return false unless requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
- spec.activate_platform!(requirement.__platform) if !@platforms || @platforms.include?(requirement.__platform)
- true
- end
-
- def relevant_sources_for_vertex(vertex)
- if vertex.root?
- [@source_requirements[vertex.name]]
- elsif @lockfile_uses_separate_rubygems_sources
- vertex.recursive_predecessors.map do |v|
- @source_requirements[v.name]
- end << @source_requirements[:default]
- end
- end
-
- def sort_dependencies(dependencies, activated, conflicts)
- dependencies.sort_by do |dependency|
- dependency.all_sources = relevant_sources_for_vertex(activated.vertex_named(dependency.name))
- name = name_for(dependency)
- vertex = activated.vertex_named(name)
- [
- @base_dg.vertex_named(name) ? 0 : 1,
- vertex.payload ? 0 : 1,
- vertex.root? ? 0 : 1,
- amount_constrained(dependency),
- conflicts[name] ? 0 : 1,
- vertex.payload ? 0 : search_for(dependency).count,
- self.class.platform_sort_key(dependency.__platform),
- ]
- end
- end
-
- # Sort platforms from most general to most specific
- def self.sort_platforms(platforms)
- platforms.sort_by do |platform|
- platform_sort_key(platform)
- end
- end
-
- def self.platform_sort_key(platform)
- return ["", "", ""] if Gem::Platform::RUBY == platform
- platform.to_a.map {|part| part || "" }
- end
-
- private
-
- # 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
- if (base = @base[dependency.name]) && !base.empty?
- dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
- else
- all = index_for(dependency).search(dependency.name).size
-
- if all <= 1
- all - 1_000_000
- else
- search = search_for(dependency)
- search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
- search - all
- end
- end
- end
- end
-
- def verify_gemfile_dependencies_are_found!(requirements)
- requirements.each do |requirement|
- name = requirement.name
- next if name == "bundler"
- next unless search_for(requirement).empty?
-
- cache_message = begin
- " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
- rescue GemfileNotFound
- nil
- end
-
- if (base = @base[name]) && !base.empty?
- version = base.first.version
- message = "You have requested:\n" \
- " #{name} #{requirement.requirement}\n\n" \
- "The bundle currently has #{name} locked at #{version}.\n" \
- "Try running `bundle update #{name}`\n\n" \
- "If you are updating multiple gems in your Gemfile at once,\n" \
- "try passing them all to `bundle update`"
- elsif source = @source_requirements[name]
- specs = source.specs[name]
- versions_with_platforms = specs.map {|s| [s.version, s.platform] }
- message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
- message << if versions_with_platforms.any?
- "The source contains '#{name}' at: #{formatted_versions_with_platforms(versions_with_platforms)}"
- else
- "The source does not contain any versions of '#{name}'"
- end
- else
- message = "Could not find gem '#{requirement}' in any of the gem sources " \
- "listed in your Gemfile#{cache_message}."
- end
- raise GemNotFound, message
- end
- end
-
- def formatted_versions_with_platforms(versions_with_platforms)
- version_platform_strs = versions_with_platforms.map do |vwp|
- version = vwp.first
- platform = vwp.last
- version_platform_str = String.new(version.to_s)
- version_platform_str << " #{platform}" unless platform.nil? || platform == Gem::Platform::RUBY
- version_platform_str
- end
- version_platform_strs.join(", ")
- end
-
- def version_conflict_message(e)
- # only show essential conflicts, if possible
- conflicts = e.conflicts.dup
- conflicts.delete_if do |_name, conflict|
- deps = conflict.requirement_trees.map(&:last).flatten(1)
- !Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
- end
- e = Molinillo::VersionConflict.new(conflicts, e.specification_provider) unless conflicts.empty?
-
- solver_name = "Bundler"
- possibility_type = "gem"
- e.message_with_trees(
- :solver_name => solver_name,
- :possibility_type => possibility_type,
- :reduce_trees => lambda do |trees|
- # called first, because we want to reduce the amount of work required to find maximal empty sets
- trees = trees.uniq {|t| t.flatten.map {|dep| [dep.name, dep.requirement] } }
-
- # bail out if tree size is too big for Array#combination to make any sense
- return trees if trees.size > 15
- maximal = 1.upto(trees.size).map do |size|
- trees.map(&:last).flatten(1).combination(size).to_a
- end.flatten(1).select do |deps|
- Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
- end.min_by(&:size)
-
- trees.reject! {|t| !maximal.include?(t.last) } if maximal
-
- trees.sort_by {|t| t.reverse.map(&:name) }
- end,
- :printable_requirement => lambda {|req| SharedHelpers.pretty_dependency(req) },
- :additional_message_for_conflict => lambda do |o, name, conflict|
- if name == "bundler"
- o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
- other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
- end
-
- if name == "bundler" && other_bundler_required
- o << "\n"
- o << "This Gemfile requires a different version of Bundler.\n"
- o << "Perhaps you need to update Bundler by running `gem install bundler`?\n"
- end
- if conflict.locked_requirement
- o << "\n"
- o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
- o << %(the gems in your Gemfile, which may resolve the conflict.\n)
- elsif !conflict.existing
- o << "\n"
-
- relevant_sources = if conflict.requirement.source
- [conflict.requirement.source]
- elsif conflict.requirement.all_sources
- conflict.requirement.all_sources
- elsif @lockfile_uses_separate_rubygems_sources
- # every conflict should have an explicit group of sources when we
- # enforce strict pinning
- raise "no source set for #{conflict}"
- else
- []
- end.compact.map(&:to_s).uniq.sort
-
- metadata_requirement = name.end_with?("\0")
-
- o << "Could not find gem '" unless metadata_requirement
- o << SharedHelpers.pretty_dependency(conflict.requirement)
- o << "'" unless metadata_requirement
- if conflict.requirement_trees.first.size > 1
- o << ", which is required by "
- o << "gem '#{SharedHelpers.pretty_dependency(conflict.requirement_trees.first[-2])}',"
- end
- o << " "
-
- o << if relevant_sources.empty?
- "in any of the sources.\n"
- elsif metadata_requirement
- "is not available in #{relevant_sources.join(" or ")}"
- else
- "in any of the relevant sources:\n #{relevant_sources * "\n "}\n"
- end
- end
- end,
- :version_for_spec => lambda {|spec| spec.version },
- :incompatible_version_message_for_conflict => lambda do |name, _conflict|
- if name.end_with?("\0")
- %(#{solver_name} found conflicting requirements for the #{name} version:)
- else
- %(#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":)
- end
- end
- )
- end
-
- def validate_resolved_specs!(resolved_specs)
- resolved_specs.each do |v|
- name = v.name
- next unless sources = relevant_sources_for_vertex(v)
- sources.compact!
- if default_index = sources.index(@source_requirements[:default])
- sources.delete_at(default_index)
- end
- sources.reject! {|s| s.specs[name].empty? }
- sources.uniq!
- next if sources.size <= 1
-
- multisource_disabled = Bundler.feature_flag.disable_multisource?
-
- msg = ["The gem '#{name}' was found in multiple relevant sources."]
- msg.concat sources.map {|s| " * #{s}" }.sort
- msg << "You #{multisource_disabled ? :must : :should} add this gem to the source block for the source you wish it to be installed from."
- msg = msg.join("\n")
-
- raise SecurityError, msg if multisource_disabled
- Bundler.ui.warn "Warning: #{msg}"
- end
- end
- end
-end
diff --git a/lib/bundler/resolver/spec_group.rb b/lib/bundler/resolver/spec_group.rb
deleted file mode 100644
index e5772eed81..0000000000
--- a/lib/bundler/resolver/spec_group.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Resolver
- class SpecGroup
- include GemHelpers
-
- attr_accessor :name, :version, :source
- attr_accessor :ignores_bundler_dependencies
-
- def initialize(all_specs)
- raise ArgumentError, "cannot initialize with an empty value" unless exemplary_spec = all_specs.first
- @name = exemplary_spec.name
- @version = exemplary_spec.version
- @source = exemplary_spec.source
-
- @activated_platforms = []
- @dependencies = nil
- @specs = Hash.new do |specs, platform|
- specs[platform] = select_best_platform_match(all_specs, platform)
- end
- @ignores_bundler_dependencies = true
- end
-
- def to_specs
- @activated_platforms.map do |p|
- next unless s = @specs[p]
- lazy_spec = LazySpecification.new(name, version, s.platform, source)
- lazy_spec.dependencies.replace s.dependencies
- lazy_spec
- end.compact
- end
-
- def activate_platform!(platform)
- return unless for?(platform)
- return if @activated_platforms.include?(platform)
- @activated_platforms << platform
- end
-
- def for?(platform)
- spec = @specs[platform]
- !spec.nil?
- end
-
- def to_s
- @to_s ||= "#{name} (#{version})"
- end
-
- def dependencies_for_activated_platforms
- dependencies = @activated_platforms.map {|p| __dependencies[p] }
- metadata_dependencies = @activated_platforms.map do |platform|
- metadata_dependencies(@specs[platform], platform)
- end
- dependencies.concat(metadata_dependencies).flatten
- end
-
- def ==(other)
- return unless other.is_a?(SpecGroup)
- name == other.name &&
- version == other.version &&
- source == other.source
- end
-
- def eql?(other)
- return unless other.is_a?(SpecGroup)
- name.eql?(other.name) &&
- version.eql?(other.version) &&
- source.eql?(other.source)
- end
-
- def hash
- to_s.hash ^ source.hash
- end
-
- private
-
- def __dependencies
- @dependencies = Hash.new do |dependencies, platform|
- dependencies[platform] = []
- if spec = @specs[platform]
- spec.dependencies.each do |dep|
- next if dep.type == :development
- next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
- dependencies[platform] << DepProxy.new(dep, platform)
- end
- end
- dependencies[platform]
- end
- end
-
- def metadata_dependencies(spec, platform)
- return [] unless spec
- # Only allow endpoint specifications since they won't hit the network to
- # fetch the full gemspec when calling required_ruby_version
- return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
- dependencies = []
- if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
- dependencies << DepProxy.new(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
- end
- if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
- dependencies << DepProxy.new(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
- end
- dependencies
- end
- end
- end
-end
diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb
deleted file mode 100644
index d64958ba70..0000000000
--- a/lib/bundler/retry.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # General purpose class for retrying code that may fail
- class Retry
- attr_accessor :name, :total_runs, :current_run
-
- class << self
- def default_attempts
- default_retries + 1
- end
- alias_method :attempts, :default_attempts
-
- def default_retries
- Bundler.settings[:retry]
- end
- end
-
- def initialize(name, exceptions = nil, retries = self.class.default_retries)
- @name = name
- @retries = retries
- @exceptions = Array(exceptions) || []
- @total_runs = @retries + 1 # will run once, then upto attempts.times
- end
-
- def attempt(&block)
- @current_run = 0
- @failed = false
- @error = nil
- run(&block) while keep_trying?
- @result
- end
- alias_method :attempts, :attempt
-
- private
-
- def run(&block)
- @failed = false
- @current_run += 1
- @result = block.call
- rescue StandardError => e
- fail_attempt(e)
- end
-
- def fail_attempt(e)
- @failed = true
- if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
- Bundler.ui.info "" unless Bundler.ui.debug?
- raise e
- end
- return true unless name
- Bundler.ui.info "" unless Bundler.ui.debug? # Add new line incase dots preceded this
- Bundler.ui.warn "Retrying #{name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}", Bundler.ui.debug?
- end
-
- def keep_trying?
- return true if current_run.zero?
- return false if last_attempt?
- return true if @failed
- end
-
- def last_attempt?
- current_run >= total_runs
- end
- end
-end
diff --git a/lib/bundler/ruby_dsl.rb b/lib/bundler/ruby_dsl.rb
deleted file mode 100644
index f6ba220cd5..0000000000
--- a/lib/bundler/ruby_dsl.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module RubyDsl
- def ruby(*ruby_version)
- options = ruby_version.last.is_a?(Hash) ? ruby_version.pop : {}
- ruby_version.flatten!
- raise GemfileError, "Please define :engine_version" if options[:engine] && options[:engine_version].nil?
- raise GemfileError, "Please define :engine" if options[:engine_version] && options[:engine].nil?
-
- if options[:engine] == "ruby" && options[:engine_version] &&
- ruby_version != Array(options[:engine_version])
- raise GemfileEvalError, "ruby_version must match the :engine_version for MRI"
- end
- @ruby_version = RubyVersion.new(ruby_version, options[:patchlevel], options[:engine], options[:engine_version])
- end
- end
-end
diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb
deleted file mode 100644
index 7e403ce6fc..0000000000
--- a/lib/bundler/ruby_version.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class RubyVersion
- attr_reader :versions,
- :patchlevel,
- :engine,
- :engine_versions,
- :gem_version,
- :engine_gem_version
-
- def initialize(versions, patchlevel, engine, engine_version)
- # The parameters to this method must satisfy the
- # following constraints, which are verified in
- # the DSL:
- #
- # * If an engine is specified, an engine version
- # must also be specified
- # * If an engine version is specified, an engine
- # must also be specified
- # * If the engine is "ruby", the engine version
- # must not be specified, or the engine version
- # specified must match the version.
-
- @versions = Array(versions).map do |v|
- op, v = Gem::Requirement.parse(v)
- op == "=" ? v.to_s : "#{op} #{v}"
- end
-
- @gem_version = Gem::Requirement.create(@versions.first).requirements.first.last
- @input_engine = engine && engine.to_s
- @engine = engine && engine.to_s || "ruby"
- @engine_versions = (engine_version && Array(engine_version)) || @versions
- @engine_gem_version = Gem::Requirement.create(@engine_versions.first).requirements.first.last
- @patchlevel = patchlevel
- end
-
- def to_s(versions = self.versions)
- output = String.new("ruby #{versions_string(versions)}")
- output << "p#{patchlevel}" if patchlevel
- output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby"
-
- output
- end
-
- # @private
- PATTERN = /
- ruby\s
- ([\d.]+) # ruby version
- (?:p(-?\d+))? # optional patchlevel
- (?:\s\((\S+)\s(.+)\))? # optional engine info
- /xo.freeze
-
- # Returns a RubyVersion from the given string.
- # @param [String] the version string to match.
- # @return [RubyVersion,Nil] The version if the string is a valid RubyVersion
- # description, and nil otherwise.
- def self.from_string(string)
- new($1, $2, $3, $4) if string =~ PATTERN
- end
-
- def single_version_string
- to_s(gem_version)
- end
-
- def ==(other)
- versions == other.versions &&
- engine == other.engine &&
- engine_versions == other.engine_versions &&
- patchlevel == other.patchlevel
- end
-
- def host
- @host ||= [
- RbConfig::CONFIG["host_cpu"],
- RbConfig::CONFIG["host_vendor"],
- RbConfig::CONFIG["host_os"],
- ].join("-")
- end
-
- # Returns a tuple of these things:
- # [diff, this, other]
- # The priority of attributes are
- # 1. engine
- # 2. ruby_version
- # 3. engine_version
- def diff(other)
- raise ArgumentError, "Can only diff with a RubyVersion, not a #{other.class}" unless other.is_a?(RubyVersion)
- if engine != other.engine && @input_engine
- [:engine, engine, other.engine]
- elsif versions.empty? || !matches?(versions, other.gem_version)
- [:version, versions_string(versions), versions_string(other.versions)]
- elsif @input_engine && !matches?(engine_versions, other.engine_gem_version)
- [:engine_version, versions_string(engine_versions), versions_string(other.engine_versions)]
- elsif patchlevel && (!patchlevel.is_a?(String) || !other.patchlevel.is_a?(String) || !matches?(patchlevel, other.patchlevel))
- [:patchlevel, patchlevel, other.patchlevel]
- end
- end
-
- def versions_string(versions)
- Array(versions).join(", ")
- end
-
- def self.system
- ruby_engine = RUBY_ENGINE.dup
- ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
- ruby_engine_version = RUBY_ENGINE_VERSION.dup
- patchlevel = RUBY_PATCHLEVEL.to_s
-
- @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
- end
-
- def to_gem_version_with_patchlevel
- @gem_version_with_patch ||= begin
- Gem::Version.create("#{@gem_version}.#{@patchlevel}")
- rescue ArgumentError
- @gem_version
- end
- end
-
- def exact?
- return @exact if defined?(@exact)
- @exact = versions.all? {|v| Gem::Requirement.create(v).exact? }
- end
-
- private
-
- def matches?(requirements, version)
- # Handles RUBY_PATCHLEVEL of -1 for instances like ruby-head
- return requirements == version if requirements.to_s == "-1" || version.to_s == "-1"
-
- Array(requirements).all? do |requirement|
- Gem::Requirement.create(requirement).satisfied_by?(Gem::Version.create(version))
- end
- end
- end
-end
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
deleted file mode 100644
index eda826422f..0000000000
--- a/lib/bundler/rubygems_ext.rb
+++ /dev/null
@@ -1,154 +0,0 @@
-# frozen_string_literal: true
-
-require "pathname"
-
-require "rubygems/specification"
-
-# Possible use in Gem::Specification#source below and require
-# shouldn't be deferred.
-require "rubygems/source"
-
-require_relative "match_platform"
-
-module Gem
- class Specification
- attr_accessor :remote, :location, :relative_loaded_from
-
- remove_method :source
- attr_writer :source
- def source
- (defined?(@source) && @source) || Gem::Source::Installed.new
- end
-
- alias_method :rg_full_gem_path, :full_gem_path
- alias_method :rg_loaded_from, :loaded_from
-
- def full_gem_path
- # this cannot check source.is_a?(Bundler::Plugin::API::Source)
- # because that _could_ trip the autoload, and if there are unresolved
- # gems at that time, this method could be called inside another require,
- # thus raising with that constant being undefined. Better to check a method
- if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
- Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
- else
- rg_full_gem_path
- end
- end
-
- def loaded_from
- if relative_loaded_from
- source.path.join(relative_loaded_from).to_s
- else
- rg_loaded_from
- end
- end
-
- def load_paths
- full_require_paths
- end
-
- if method_defined?(:extension_dir)
- alias_method :rg_extension_dir, :extension_dir
- def extension_dir
- @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
- File.expand_path(File.join(extensions_dir, source.extension_dir_name))
- else
- rg_extension_dir
- end
- end
- end
-
- remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
- def gem_dir
- full_gem_path
- end
-
- def groups
- @groups ||= []
- end
-
- def git_version
- return unless loaded_from && source.is_a?(Bundler::Source::Git)
- " #{source.revision[0..6]}"
- end
-
- def to_gemfile(path = nil)
- gemfile = String.new("source 'https://rubygems.org'\n")
- gemfile << dependencies_to_gemfile(nondevelopment_dependencies)
- unless development_dependencies.empty?
- gemfile << "\n"
- gemfile << dependencies_to_gemfile(development_dependencies, :development)
- end
- gemfile
- end
-
- def nondevelopment_dependencies
- dependencies - development_dependencies
- end
-
- private
-
- def dependencies_to_gemfile(dependencies, group = nil)
- gemfile = String.new
- if dependencies.any?
- gemfile << "group :#{group} do\n" if group
- dependencies.each do |dependency|
- gemfile << " " if group
- gemfile << %(gem "#{dependency.name}")
- req = dependency.requirements_list.first
- gemfile << %(, "#{req}") if req
- gemfile << "\n"
- end
- gemfile << "end\n" if group
- end
- gemfile
- end
- end
-
- class Dependency
- attr_accessor :source, :groups, :all_sources
-
- alias_method :eql?, :==
-
- def encode_with(coder)
- to_yaml_properties.each do |ivar|
- coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
- end
- end
-
- def to_yaml_properties
- instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
- end
-
- def to_lock
- out = String.new(" #{name}")
- unless requirement.none?
- reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
- out << " (#{reqs.join(", ")})"
- end
- out
- end
- end
-
- class Platform
- JAVA = Gem::Platform.new("java") unless defined?(JAVA)
- MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
- MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
- MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
- X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
-
- undef_method :hash if method_defined? :hash
- def hash
- @cpu.hash ^ @os.hash ^ @version.hash
- end
-
- undef_method :eql? if method_defined? :eql?
- alias_method :eql?, :==
- end
-end
-
-module Gem
- class Specification
- include ::Bundler::MatchPlatform
- end
-end
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
deleted file mode 100644
index b1076b4554..0000000000
--- a/lib/bundler/rubygems_gem_installer.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-# frozen_string_literal: true
-
-require "rubygems/installer"
-
-module Bundler
- class RubyGemsGemInstaller < Gem::Installer
- unless respond_to?(:at)
- def self.at(*args)
- new(*args)
- end
- end
-
- def check_executable_overwrite(filename)
- # Bundler needs to install gems regardless of binstub overwriting
- end
-
- def pre_install_checks
- super && validate_bundler_checksum(options[:bundler_expected_checksum])
- end
-
- def build_extensions
- extension_cache_path = options[:bundler_extension_cache_path]
- return super unless extension_cache_path && extension_dir = Bundler.rubygems.spec_extension_dir(spec)
-
- extension_dir = Pathname.new(extension_dir)
- build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
- if build_complete && !options[:force]
- SharedHelpers.filesystem_access(extension_dir.parent, &:mkpath)
- SharedHelpers.filesystem_access(extension_cache_path) do
- FileUtils.cp_r extension_cache_path, spec.extension_dir
- end
- else
- super
- if extension_dir.directory? # not made for gems without extensions
- SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
- SharedHelpers.filesystem_access(extension_cache_path) do
- FileUtils.cp_r extension_dir, extension_cache_path
- end
- end
- end
- end
-
- private
-
- def validate_bundler_checksum(checksum)
- return true if Bundler.settings[:disable_checksum_validation]
- return true unless checksum
- return true unless source = @package.instance_variable_get(:@gem)
- return true unless source.respond_to?(:with_read_io)
- digest = source.with_read_io do |io|
- digest = SharedHelpers.digest(:SHA256).new
- digest << io.read(16_384) until io.eof?
- io.rewind
- send(checksum_type(checksum), digest)
- end
- unless digest == checksum
- raise SecurityError, <<-MESSAGE
- Bundler cannot continue installing #{spec.name} (#{spec.version}).
- The checksum for the downloaded `#{spec.full_name}.gem` does not match \
- the checksum given by the server. This means the contents of the downloaded \
- gem is different from what was uploaded to the server, and could be a potential security issue.
-
- To resolve this issue:
- 1. delete the downloaded gem located at: `#{spec.gem_dir}/#{spec.full_name}.gem`
- 2. run `bundle install`
-
- If you wish to continue installing the downloaded gem, and are certain it does not pose a \
- security issue despite the mismatching checksum, do the following:
- 1. run `bundle config set disable_checksum_validation true` to turn off checksum verification
- 2. run `bundle install`
-
- (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
- checksum for the downloaded gem was #{digest.inspect}.)
- MESSAGE
- end
- true
- end
-
- def checksum_type(checksum)
- case checksum.length
- when 64 then :hexdigest!
- when 44 then :base64digest!
- else raise InstallError, "The given checksum for #{spec.full_name} (#{checksum.inspect}) is not a valid SHA256 hexdigest nor base64digest"
- end
- end
-
- def hexdigest!(digest)
- digest.hexdigest!
- end
-
- def base64digest!(digest)
- if digest.respond_to?(:base64digest!)
- digest.base64digest!
- else
- [digest.digest!].pack("m0")
- end
- end
- end
-end
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
deleted file mode 100644
index d97621cd92..0000000000
--- a/lib/bundler/rubygems_integration.rb
+++ /dev/null
@@ -1,648 +0,0 @@
-# frozen_string_literal: true
-
-require "rubygems" unless defined?(Gem)
-
-module Bundler
- class RubygemsIntegration
- if defined?(Gem::Ext::Builder::CHDIR_MONITOR)
- EXT_LOCK = Gem::Ext::Builder::CHDIR_MONITOR
- else
- require "monitor"
-
- EXT_LOCK = Monitor.new
- end
-
- def self.version
- @version ||= Gem::Version.new(Gem::VERSION)
- end
-
- def self.provides?(req_str)
- Gem::Requirement.new(req_str).satisfied_by?(version)
- end
-
- def initialize
- @replaced_methods = {}
- backport_ext_builder_monitor
- end
-
- def version
- self.class.version
- end
-
- def provides?(req_str)
- self.class.provides?(req_str)
- end
-
- def build_args
- Gem::Command.build_args
- end
-
- def build_args=(args)
- Gem::Command.build_args = args
- end
-
- def loaded_specs(name)
- Gem.loaded_specs[name]
- end
-
- def add_to_load_path(paths)
- return Gem.add_to_load_path(*paths) if Gem.respond_to?(:add_to_load_path)
-
- if insert_index = Gem.load_path_insert_index
- # Gem directories must come after -I and ENV['RUBYLIB']
- $LOAD_PATH.insert(insert_index, *paths)
- else
- # We are probably testing in core, -I and RUBYLIB don't apply
- $LOAD_PATH.unshift(*paths)
- end
- end
-
- def mark_loaded(spec)
- if spec.respond_to?(:activated=)
- current = Gem.loaded_specs[spec.name]
- current.activated = false if current
- spec.activated = true
- end
- Gem.loaded_specs[spec.name] = spec
- end
-
- def validate(spec)
- Bundler.ui.silence { spec.validate(false) }
- rescue Gem::InvalidSpecificationException => e
- error_message = "The gemspec at #{spec.loaded_from} is not valid. Please fix this gemspec.\n" \
- "The validation error was '#{e.message}'\n"
- raise Gem::InvalidSpecificationException.new(error_message)
- rescue Errno::ENOENT
- nil
- end
-
- def set_installed_by_version(spec, installed_by_version = Gem::VERSION)
- return unless spec.respond_to?(:installed_by_version=)
- spec.installed_by_version = Gem::Version.create(installed_by_version)
- end
-
- def spec_missing_extensions?(spec, default = true)
- return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
-
- return false if spec_default_gem?(spec)
- return false if spec.extensions.empty?
-
- default
- end
-
- def spec_default_gem?(spec)
- spec.respond_to?(:default_gem?) && spec.default_gem?
- end
-
- def spec_matches_for_glob(spec, glob)
- return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
-
- spec.load_paths.map do |lp|
- Dir["#{lp}/#{glob}#{suffix_pattern}"]
- end.flatten(1)
- end
-
- def spec_extension_dir(spec)
- return unless spec.respond_to?(:extension_dir)
- spec.extension_dir
- end
-
- def stub_set_spec(stub, spec)
- stub.instance_variable_set(:@spec, spec)
- end
-
- def path(obj)
- obj.to_s
- end
-
- def platforms
- return [Gem::Platform::RUBY] if Bundler.settings[:force_ruby_platform]
- Gem.platforms
- end
-
- def configuration
- require_relative "psyched_yaml"
- Gem.configuration
- rescue Gem::SystemExitException, LoadError => e
- Bundler.ui.error "#{e.class}: #{e.message}"
- Bundler.ui.trace e
- raise
- rescue YamlLibrarySyntaxError => e
- raise YamlSyntaxError.new(e, "Your RubyGems configuration, which is " \
- "usually located in ~/.gemrc, contains invalid YAML syntax.")
- end
-
- def ruby_engine
- Gem.ruby_engine
- end
-
- def read_binary(path)
- Gem.read_binary(path)
- end
-
- def inflate(obj)
- require "rubygems/util"
-
- Gem::Util.inflate(obj)
- end
-
- def correct_for_windows_path(path)
- require "rubygems/util"
-
- if Gem::Util.respond_to?(:correct_for_windows_path)
- Gem::Util.correct_for_windows_path(path)
- elsif path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":"
- path[1..-1]
- else
- path
- end
- end
-
- def sources=(val)
- # Gem.configuration creates a new Gem::ConfigFile, which by default will read ~/.gemrc
- # If that file exists, its settings (including sources) will overwrite the values we
- # are about to set here. In order to avoid that, we force memoizing the config file now.
- configuration
-
- Gem.sources = val
- end
-
- def sources
- Gem.sources
- end
-
- def gem_dir
- Gem.dir
- end
-
- def gem_bindir
- Gem.bindir
- end
-
- def user_home
- Gem.user_home
- end
-
- def gem_path
- Gem.path
- end
-
- def reset
- Gem::Specification.reset
- end
-
- def post_reset_hooks
- Gem.post_reset_hooks
- end
-
- def suffix_pattern
- Gem.suffix_pattern
- end
-
- def gem_cache
- gem_path.map {|p| File.expand_path("cache", p) }
- end
-
- def spec_cache_dirs
- @spec_cache_dirs ||= begin
- dirs = gem_path.map {|dir| File.join(dir, "specifications") }
- dirs << Gem.spec_cache_dir if Gem.respond_to?(:spec_cache_dir) # Not in RubyGems 2.0.3 or earlier
- dirs.uniq.select {|dir| File.directory? dir }
- end
- end
-
- def marshal_spec_dir
- Gem::MARSHAL_SPEC_DIR
- end
-
- def clear_paths
- Gem.clear_paths
- end
-
- def bin_path(gem, bin, ver)
- Gem.bin_path(gem, bin, ver)
- end
-
- def preserve_paths
- # this is a no-op outside of RubyGems 1.8
- yield
- end
-
- def loaded_gem_paths
- loaded_gem_paths = Gem.loaded_specs.map {|_, s| s.full_require_paths }
- loaded_gem_paths.flatten
- end
-
- def load_plugins
- Gem.load_plugins if Gem.respond_to?(:load_plugins)
- end
-
- def load_plugin_files(files)
- Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files)
- end
-
- def ui=(obj)
- Gem::DefaultUserInteraction.ui = obj
- end
-
- def ext_lock
- EXT_LOCK
- end
-
- def with_build_args(args)
- ext_lock.synchronize do
- old_args = build_args
- begin
- self.build_args = args
- yield
- ensure
- self.build_args = old_args
- end
- end
- end
-
- def spec_from_gem(path, policy = nil)
- require "rubygems/security"
- require_relative "psyched_yaml"
- gem_from_path(path, security_policies[policy]).spec
- rescue Gem::Package::FormatError
- raise GemspecError, "Could not read gem at #{path}. It may be corrupted."
- rescue Exception, Gem::Exception, Gem::Security::Exception => e # rubocop:disable Lint/RescueException
- if e.is_a?(Gem::Security::Exception) ||
- e.message =~ /unknown trust policy|unsigned gem/i ||
- e.message =~ /couldn't verify (meta)?data signature/i
- raise SecurityError,
- "The gem #{File.basename(path, ".gem")} can't be installed because " \
- "the security policy didn't allow it, with the message: #{e.message}"
- else
- raise e
- end
- end
-
- def build_gem(gem_dir, spec)
- build(spec)
- end
-
- def security_policy_keys
- %w[High Medium Low AlmostNo No].map {|level| "#{level}Security" }
- end
-
- def security_policies
- @security_policies ||= begin
- require "rubygems/security"
- Gem::Security::Policies
- rescue LoadError, NameError
- {}
- end
- end
-
- def reverse_rubygems_kernel_mixin
- # Disable rubygems' gem activation system
- kernel = (class << ::Kernel; self; end)
- [kernel, ::Kernel].each do |k|
- if k.private_method_defined?(:gem_original_require)
- redefine_method(k, :require, k.instance_method(:gem_original_require))
- end
- end
- end
-
- def replace_gem(specs, specs_by_name)
- reverse_rubygems_kernel_mixin
-
- executables = nil
-
- kernel = (class << ::Kernel; self; end)
- [kernel, ::Kernel].each do |kernel_class|
- redefine_method(kernel_class, :gem) do |dep, *reqs|
- if executables && executables.include?(File.basename(caller.first.split(":").first))
- break
- end
-
- reqs.pop if reqs.last.is_a?(Hash)
-
- unless dep.respond_to?(:name) && dep.respond_to?(:requirement)
- dep = Gem::Dependency.new(dep, reqs)
- end
-
- if spec = specs_by_name[dep.name]
- return true if dep.matches_spec?(spec)
- end
-
- message = if spec.nil?
- "#{dep.name} is not part of the bundle." \
- " Add it to your #{Bundler.default_gemfile.basename}."
- else
- "can't activate #{dep}, already activated #{spec.full_name}. " \
- "Make sure all dependencies are added to Gemfile."
- end
-
- e = Gem::LoadError.new(message)
- e.name = dep.name
- if e.respond_to?(:requirement=)
- e.requirement = dep.requirement
- elsif e.respond_to?(:version_requirement=)
- e.version_requirement = dep.requirement
- end
- raise e
- end
-
- # backwards compatibility shim, see https://github.com/bundler/bundler/issues/5102
- kernel_class.send(:public, :gem) if Bundler.feature_flag.setup_makes_kernel_gem_public?
- end
- end
-
- # Used to make bin stubs that are not created by bundler work
- # under bundler. The new Gem.bin_path only considers gems in
- # +specs+
- def replace_bin_path(specs_by_name)
- gem_class = (class << Gem; self; end)
-
- redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
- exec_name = args.first
- raise ArgumentError, "you must supply exec_name" unless exec_name
-
- spec_with_name = specs_by_name[gem_name]
- matching_specs_by_exec_name = specs_by_name.values.select {|s| s.executables.include?(exec_name) }
- spec = matching_specs_by_exec_name.delete(spec_with_name)
-
- unless spec || !matching_specs_by_exec_name.empty?
- message = "can't find executable #{exec_name} for gem #{gem_name}"
- if spec_with_name.nil?
- message += ". #{gem_name} is not currently included in the bundle, " \
- "perhaps you meant to add it to your #{Bundler.default_gemfile.basename}?"
- end
- raise Gem::Exception, message
- end
-
- unless spec
- spec = matching_specs_by_exec_name.shift
- warn \
- "Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \
- "You should run `bundle binstub #{gem_name}` " \
- "to work around a system/bundle conflict."
- end
-
- unless matching_specs_by_exec_name.empty?
- conflicting_names = matching_specs_by_exec_name.map(&:name).join(", ")
- warn \
- "The `#{exec_name}` executable in the `#{spec.name}` gem is being loaded, but it's also present in other gems (#{conflicting_names}).\n" \
- "If you meant to run the executable for another gem, make sure you use a project specific binstub (`bundle binstub <gem_name>`).\n" \
- "If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names."
- end
-
- spec
- end
-
- redefine_method(gem_class, :activate_bin_path) do |name, *args|
- exec_name = args.first
- return ENV["BUNDLE_BIN_PATH"] if exec_name == "bundle"
-
- # Copy of Rubygems activate_bin_path impl
- requirement = args.last
- spec = find_spec_for_exe name, exec_name, [requirement]
-
- gem_bin = File.join(spec.full_gem_path, spec.bindir, exec_name)
- gem_from_path_bin = File.join(File.dirname(spec.loaded_from), spec.bindir, exec_name)
- File.exist?(gem_bin) ? gem_bin : gem_from_path_bin
- end
-
- redefine_method(gem_class, :bin_path) do |name, *args|
- exec_name = args.first
- return ENV["BUNDLE_BIN_PATH"] if exec_name == "bundle"
-
- spec = find_spec_for_exe(name, *args)
- exec_name ||= spec.default_executable
-
- gem_bin = File.join(spec.full_gem_path, spec.bindir, exec_name)
- gem_from_path_bin = File.join(File.dirname(spec.loaded_from), spec.bindir, exec_name)
- File.exist?(gem_bin) ? gem_bin : gem_from_path_bin
- end
- end
-
- # Replace or hook into RubyGems to provide a bundlerized view
- # of the world.
- def replace_entrypoints(specs)
- specs_by_name = specs.reduce({}) do |h, s|
- h[s.name] = s
- h
- end
-
- Bundler.rubygems.default_stubs.each do |stub|
- default_spec = stub.to_spec
- default_spec_name = default_spec.name
- next if specs_by_name.key?(default_spec_name)
-
- specs << default_spec
- specs_by_name[default_spec_name] = default_spec
- end
-
- replace_gem(specs, specs_by_name)
- stub_rubygems(specs)
- replace_bin_path(specs_by_name)
-
- Gem.clear_paths
- end
-
- # This backports base_dir which replaces installation path
- # RubyGems 1.8+
- def backport_base_dir
- redefine_method(Gem::Specification, :base_dir) do
- return Gem.dir unless loaded_from
- File.dirname File.dirname loaded_from
- end
- end
-
- def backport_cache_file
- redefine_method(Gem::Specification, :cache_dir) do
- @cache_dir ||= File.join base_dir, "cache"
- end
-
- redefine_method(Gem::Specification, :cache_file) do
- @cache_file ||= File.join cache_dir, "#{full_name}.gem"
- end
- end
-
- def backport_spec_file
- redefine_method(Gem::Specification, :spec_dir) do
- @spec_dir ||= File.join base_dir, "specifications"
- end
-
- redefine_method(Gem::Specification, :spec_file) do
- @spec_file ||= File.join spec_dir, "#{full_name}.gemspec"
- end
- end
-
- def undo_replacements
- @replaced_methods.each do |(sym, klass), method|
- redefine_method(klass, sym, method)
- end
- if Binding.public_method_defined?(:source_location)
- post_reset_hooks.reject! {|proc| proc.binding.source_location[0] == __FILE__ }
- else
- post_reset_hooks.reject! {|proc| proc.binding.eval("__FILE__") == __FILE__ }
- end
- @replaced_methods.clear
- end
-
- def redefine_method(klass, method, unbound_method = nil, &block)
- visibility = method_visibility(klass, method)
- begin
- if (instance_method = klass.instance_method(method)) && method != :initialize
- # doing this to ensure we also get private methods
- klass.send(:remove_method, method)
- end
- rescue NameError
- # method isn't defined
- nil
- end
- @replaced_methods[[method, klass]] = instance_method
- if unbound_method
- klass.send(:define_method, method, unbound_method)
- klass.send(visibility, method)
- elsif block
- klass.send(:define_method, method, &block)
- klass.send(visibility, method)
- end
- end
-
- def method_visibility(klass, method)
- if klass.private_method_defined?(method)
- :private
- elsif klass.protected_method_defined?(method)
- :protected
- else
- :public
- end
- end
-
- def stub_rubygems(specs)
- Gem::Specification.all = specs
-
- Gem.post_reset do
- Gem::Specification.all = specs
- end
-
- redefine_method((class << Gem; self; end), :finish_resolve) do |*|
- []
- end
- end
-
- def plain_specs
- Gem::Specification._all
- end
-
- def plain_specs=(specs)
- Gem::Specification.all = specs
- end
-
- def fetch_specs(remote, name)
- path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
- fetcher = gem_remote_fetcher
- fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
- string = fetcher.fetch_path(path)
- Bundler.load_marshal(string)
- rescue Gem::RemoteFetcher::FetchError => e
- # it's okay for prerelease to fail
- raise e unless name == "prerelease_specs"
- end
-
- def fetch_all_remote_specs(remote)
- specs = fetch_specs(remote, "specs")
- pres = fetch_specs(remote, "prerelease_specs") || []
-
- specs.concat(pres)
- end
-
- def download_gem(spec, uri, path)
- uri = Bundler.settings.mirror_for(uri)
- fetcher = gem_remote_fetcher
- fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri
- Bundler::Retry.new("download gem from #{uri}").attempts do
- fetcher.download(spec, uri, path)
- end
- end
-
- def gem_remote_fetcher
- require "resolv"
- proxy = configuration[:http_proxy]
- dns = Resolv::DNS.new
- Gem::RemoteFetcher.new(proxy, dns)
- end
-
- def gem_from_path(path, policy = nil)
- require "rubygems/package"
- p = Gem::Package.new(path)
- p.security_policy = policy if policy
- p
- end
-
- def build(spec, skip_validation = false)
- require "rubygems/package"
- Gem::Package.build(spec, skip_validation)
- end
-
- def repository_subdirectories
- Gem::REPOSITORY_SUBDIRECTORIES
- end
-
- def install_with_build_args(args)
- yield
- end
-
- def path_separator
- Gem.path_separator
- end
-
- def all_specs
- require_relative "remote_specification"
- Gem::Specification.stubs.map do |stub|
- StubSpecification.from_stub(stub)
- end
- end
-
- def backport_ext_builder_monitor
- # So we can avoid requiring "rubygems/ext" in its entirety
- Gem.module_eval <<-RB, __FILE__, __LINE__ + 1
- module Ext
- end
- RB
-
- require "rubygems/ext/builder"
-
- Gem::Ext::Builder.class_eval do
- unless const_defined?(:CHDIR_MONITOR)
- const_set(:CHDIR_MONITOR, EXT_LOCK)
- end
-
- remove_const(:CHDIR_MUTEX) if const_defined?(:CHDIR_MUTEX)
- const_set(:CHDIR_MUTEX, const_get(:CHDIR_MONITOR))
- end
- end
-
- def find_name(name)
- Gem::Specification.stubs_for(name).map(&:to_spec)
- end
-
- if Gem::Specification.respond_to?(:default_stubs)
- def default_stubs
- Gem::Specification.default_stubs("*.gemspec")
- end
- else
- def default_stubs
- Gem::Specification.send(:default_stubs, "*.gemspec")
- end
- end
-
- def use_gemdeps(gemfile)
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile)
- require_relative "gemdeps"
- runtime = Bundler.setup
- activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name)
- [Gemdeps.new(runtime), activated_spec_names]
- end
- end
-
- def self.rubygems
- @rubygems ||= RubygemsIntegration.new
- end
-end
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
deleted file mode 100644
index 93a801eb6c..0000000000
--- a/lib/bundler/runtime.rb
+++ /dev/null
@@ -1,315 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Runtime
- include SharedHelpers
-
- def initialize(root, definition)
- @root = root
- @definition = definition
- end
-
- def setup(*groups)
- @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle?
-
- groups.map!(&:to_sym)
-
- # Has to happen first
- clean_load_path
-
- specs = groups.any? ? @definition.specs_for(groups) : requested_specs
-
- SharedHelpers.set_bundle_environment
- Bundler.rubygems.replace_entrypoints(specs)
-
- # Activate the specs
- load_paths = specs.map do |spec|
- unless spec.loaded_from
- raise GemNotFound, "#{spec.full_name} is missing. Run `bundle install` to get it."
- end
-
- check_for_activated_spec!(spec)
-
- Bundler.rubygems.mark_loaded(spec)
- spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
- end.reverse.flatten
-
- Bundler.rubygems.add_to_load_path(load_paths)
-
- setup_manpath
-
- lock(:preserve_unknown_sections => true)
-
- self
- end
-
- REQUIRE_ERRORS = [
- /^no such file to load -- (.+)$/i,
- /^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
- /^Missing API definition file in (.+)$/i,
- /^cannot load such file -- (.+)$/i,
- /^dlopen\([^)]*\): Library not loaded: (.+)$/i,
- ].freeze
-
- def require(*groups)
- groups.map!(&:to_sym)
- groups = [:default] if groups.empty?
-
- @definition.dependencies.each do |dep|
- # Skip the dependency if it is not in any of the requested groups, or
- # not for the current platform, or doesn't match the gem constraints.
- next unless (dep.groups & groups).any? && dep.should_include?
-
- required_file = nil
-
- begin
- # Loop through all the specified autorequires for the
- # dependency. If there are none, use the dependency's name
- # as the autorequire.
- Array(dep.autorequire || dep.name).each do |file|
- # Allow `require: true` as an alias for `require: <name>`
- file = dep.name if file == true
- required_file = file
- begin
- Kernel.require file
- rescue RuntimeError => e
- raise e if e.is_a?(LoadError) # we handle this a little later
- raise Bundler::GemRequireError.new e,
- "There was an error while trying to load the gem '#{file}'."
- end
- end
- rescue LoadError => e
- REQUIRE_ERRORS.find {|r| r =~ e.message }
- raise if dep.autorequire || $1 != required_file
-
- if dep.autorequire.nil? && dep.name.include?("-")
- begin
- namespaced_file = dep.name.tr("-", "/")
- Kernel.require namespaced_file
- rescue LoadError => e
- REQUIRE_ERRORS.find {|r| r =~ e.message }
- raise if $1 != namespaced_file
- end
- end
- end
- end
- end
-
- def self.definition_method(meth)
- define_method(meth) do
- raise ArgumentError, "no definition when calling Runtime##{meth}" unless @definition
- @definition.send(meth)
- end
- end
- private_class_method :definition_method
-
- definition_method :requested_specs
- definition_method :specs
- definition_method :dependencies
- definition_method :current_dependencies
- definition_method :requires
-
- def lock(opts = {})
- return if @definition.nothing_changed? && !@definition.unlocking?
- @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
- end
-
- alias_method :gems, :specs
-
- def cache(custom_path = nil)
- cache_path = Bundler.app_cache(custom_path)
- SharedHelpers.filesystem_access(cache_path) do |p|
- FileUtils.mkdir_p(p)
- end unless File.exist?(cache_path)
-
- Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
-
- specs_to_cache = Bundler.settings[:cache_all_platforms] ? @definition.resolve.materialized_for_all_platforms : specs
- specs_to_cache.each do |spec|
- next if spec.name == "bundler"
- next if spec.source.is_a?(Source::Gemspec)
- spec.source.send(:fetch_gem, spec) if Bundler.settings[:cache_all_platforms] && spec.source.respond_to?(:fetch_gem, true)
- spec.source.cache(spec, custom_path) if spec.source.respond_to?(:cache)
- end
-
- Dir[cache_path.join("*/.git")].each do |git_dir|
- FileUtils.rm_rf(git_dir)
- FileUtils.touch(File.expand_path("../.bundlecache", git_dir))
- end
-
- prune_cache(cache_path) unless Bundler.settings[:no_prune]
- end
-
- def prune_cache(cache_path)
- SharedHelpers.filesystem_access(cache_path) do |p|
- FileUtils.mkdir_p(p)
- end unless File.exist?(cache_path)
- resolve = @definition.resolve
- prune_gem_cache(resolve, cache_path)
- prune_git_and_path_cache(resolve, cache_path)
- end
-
- def clean(dry_run = false)
- gem_bins = Dir["#{Gem.dir}/bin/*"]
- git_dirs = Dir["#{Gem.dir}/bundler/gems/*"]
- git_cache_dirs = Dir["#{Gem.dir}/cache/bundler/git/*"]
- gem_dirs = Dir["#{Gem.dir}/gems/*"]
- gem_files = Dir["#{Gem.dir}/cache/*.gem"]
- gemspec_files = Dir["#{Gem.dir}/specifications/*.gemspec"]
- extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"] + Dir["#{Gem.dir}/bundler/gems/extensions/*/*/*"]
- spec_gem_paths = []
- # need to keep git sources around
- spec_git_paths = @definition.spec_git_paths
- spec_git_cache_dirs = []
- spec_gem_executables = []
- spec_cache_paths = []
- spec_gemspec_paths = []
- spec_extension_paths = []
- specs.each do |spec|
- spec_gem_paths << spec.full_gem_path
- # need to check here in case gems are nested like for the rails git repo
- md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
- spec_git_paths << md[1] if md
- spec_gem_executables << spec.executables.collect do |executable|
- e = "#{Bundler.rubygems.gem_bindir}/#{executable}"
- [e, "#{e}.bat"]
- end
- spec_cache_paths << spec.cache_file
- spec_gemspec_paths << spec.spec_file
- spec_extension_paths << spec.extension_dir if spec.respond_to?(:extension_dir)
- spec_git_cache_dirs << spec.source.cache_path.to_s if spec.source.is_a?(Bundler::Source::Git)
- end
- spec_gem_paths.uniq!
- spec_gem_executables.flatten!
-
- stale_gem_bins = gem_bins - spec_gem_executables
- stale_git_dirs = git_dirs - spec_git_paths - ["#{Gem.dir}/bundler/gems/extensions"]
- stale_git_cache_dirs = git_cache_dirs - spec_git_cache_dirs
- stale_gem_dirs = gem_dirs - spec_gem_paths
- stale_gem_files = gem_files - spec_cache_paths
- stale_gemspec_files = gemspec_files - spec_gemspec_paths
- stale_extension_dirs = extension_dirs - spec_extension_paths
-
- removed_stale_gem_dirs = stale_gem_dirs.collect {|dir| remove_dir(dir, dry_run) }
- removed_stale_git_dirs = stale_git_dirs.collect {|dir| remove_dir(dir, dry_run) }
- output = removed_stale_gem_dirs + removed_stale_git_dirs
-
- unless dry_run
- stale_files = stale_gem_bins + stale_gem_files + stale_gemspec_files
- stale_files.each do |file|
- SharedHelpers.filesystem_access(File.dirname(file)) do |_p|
- FileUtils.rm(file) if File.exist?(file)
- end
- end
-
- stale_dirs = stale_git_cache_dirs + stale_extension_dirs
- stale_dirs.each do |stale_dir|
- SharedHelpers.filesystem_access(stale_dir) do |dir|
- FileUtils.rm_rf(dir) if File.exist?(dir)
- end
- end
- end
-
- output
- end
-
- private
-
- def prune_gem_cache(resolve, cache_path)
- cached = Dir["#{cache_path}/*.gem"]
-
- cached = cached.delete_if do |path|
- spec = Bundler.rubygems.spec_from_gem path
-
- resolve.any? do |s|
- s.name == spec.name && s.version == spec.version && !s.source.is_a?(Bundler::Source::Git)
- end
- end
-
- if cached.any?
- Bundler.ui.info "Removing outdated .gem files from #{Bundler.settings.app_cache_path}"
-
- cached.each do |path|
- Bundler.ui.info " * #{File.basename(path)}"
- File.delete(path)
- end
- end
- end
-
- def prune_git_and_path_cache(resolve, cache_path)
- cached = Dir["#{cache_path}/*/.bundlecache"]
-
- cached = cached.delete_if do |path|
- name = File.basename(File.dirname(path))
-
- resolve.any? do |s|
- source = s.source
- source.respond_to?(:app_cache_dirname) && source.app_cache_dirname == name
- end
- end
-
- if cached.any?
- Bundler.ui.info "Removing outdated git and path gems from #{Bundler.settings.app_cache_path}"
-
- cached.each do |path|
- path = File.dirname(path)
- Bundler.ui.info " * #{File.basename(path)}"
- FileUtils.rm_rf(path)
- end
- end
- end
-
- def setup_manpath
- # Add man/ subdirectories from activated bundles to MANPATH for man(1)
- manuals = $LOAD_PATH.map do |path|
- man_subdir = path.sub(/lib$/, "man")
- man_subdir unless Dir[man_subdir + "/man?/"].empty?
- end.compact
-
- return if manuals.empty?
- Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
- ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR)
- ).uniq.join(File::PATH_SEPARATOR)
- end
-
- def remove_dir(dir, dry_run)
- full_name = Pathname.new(dir).basename.to_s
-
- parts = full_name.split("-")
- name = parts[0..-2].join("-")
- version = parts.last
- output = "#{name} (#{version})"
-
- if dry_run
- Bundler.ui.info "Would have removed #{output}"
- else
- Bundler.ui.info "Removing #{output}"
- FileUtils.rm_rf(dir)
- end
-
- output
- end
-
- def check_for_activated_spec!(spec)
- return unless activated_spec = Bundler.rubygems.loaded_specs(spec.name)
- return if activated_spec.version == spec.version
-
- suggestion = if Bundler.rubygems.spec_default_gem?(activated_spec)
- "Since #{spec.name} is a default gem, you can either remove your dependency on it" \
- " or try updating to a newer version of bundler that supports #{spec.name} as a default gem."
- else
- "Prepending `bundle exec` to your command may solve this."
- end
-
- e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \
- "but your Gemfile requires #{spec.name} #{spec.version}. #{suggestion}"
- e.name = spec.name
- if e.respond_to?(:requirement=)
- e.requirement = Gem::Requirement.new(spec.version.to_s)
- else
- e.version_requirement = Gem::Requirement.new(spec.version.to_s)
- end
- raise e
- end
- end
-end
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
deleted file mode 100644
index afbb02397c..0000000000
--- a/lib/bundler/settings.rb
+++ /dev/null
@@ -1,434 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Settings
- autoload :Mirror, File.expand_path("mirror", __dir__)
- autoload :Mirrors, File.expand_path("mirror", __dir__)
- autoload :Validator, File.expand_path("settings/validator", __dir__)
-
- BOOL_KEYS = %w[
- allow_bundler_dependency_conflicts
- allow_deployment_source_credential_changes
- allow_offline_install
- auto_clean_without_path
- auto_install
- auto_config_jobs
- cache_all
- cache_all_platforms
- default_install_uses_path
- deployment
- deployment_means_frozen
- disable_checksum_validation
- disable_exec_load
- disable_local_branch_check
- disable_multisource
- disable_platform_warnings
- disable_shared_gems
- disable_version_check
- force_ruby_platform
- forget_cli_options
- frozen
- gem.coc
- gem.mit
- global_gem_cache
- ignore_messages
- init_gems_rb
- no_install
- no_prune
- only_update_to_newer_versions
- path_relative_to_cwd
- path.system
- plugins
- prefer_patch
- print_only_version_number
- setup_makes_kernel_gem_public
- silence_deprecations
- silence_root_warning
- skip_default_git_sources
- specific_platform
- suppress_install_using_messages
- unlock_source_unlocks_spec
- update_requires_all_flag
- use_gem_version_promoter_for_major_updates
- ].freeze
-
- NUMBER_KEYS = %w[
- jobs
- redirect
- retry
- ssl_verify_mode
- timeout
- ].freeze
-
- ARRAY_KEYS = %w[
- with
- without
- ].freeze
-
- DEFAULT_CONFIG = {
- :silence_deprecations => false,
- :disable_version_check => true,
- :prefer_patch => false,
- :redirect => 5,
- :retry => 3,
- :timeout => 10,
- }.freeze
-
- def initialize(root = nil)
- @root = root
- @local_config = load_config(local_config_file)
- @global_config = load_config(global_config_file)
- @temporary = {}
- end
-
- def [](name)
- key = key_for(name)
- value = @temporary.fetch(key) do
- @local_config.fetch(key) do
- ENV.fetch(key) do
- @global_config.fetch(key) do
- DEFAULT_CONFIG.fetch(name) do
- nil
- end end end end end
-
- converted_value(value, name)
- end
-
- def set_command_option(key, value)
- if Bundler.feature_flag.forget_cli_options?
- temporary(key => value)
- value
- else
- set_local(key, value)
- end
- end
-
- def set_command_option_if_given(key, value)
- return if value.nil?
- set_command_option(key, value)
- end
-
- def set_local(key, value)
- local_config_file || raise(GemfileNotFound, "Could not locate Gemfile")
-
- set_key(key, value, @local_config, local_config_file)
- end
-
- def temporary(update)
- existing = Hash[update.map {|k, _| [k, @temporary[key_for(k)]] }]
- update.each do |k, v|
- set_key(k, v, @temporary, nil)
- end
- return unless block_given?
- begin
- yield
- ensure
- existing.each {|k, v| set_key(k, v, @temporary, nil) }
- end
- end
-
- def set_global(key, value)
- set_key(key, value, @global_config, global_config_file)
- end
-
- def all
- env_keys = ENV.keys.grep(/\ABUNDLE_.+/)
-
- keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
-
- keys.map do |key|
- key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
- end
- end
-
- def local_overrides
- repos = {}
- all.each do |k|
- repos[$'] = self[k] if k =~ /^local\./
- end
- repos
- end
-
- def mirror_for(uri)
- if uri.is_a?(String)
- require_relative "vendored_uri"
- uri = Bundler::URI(uri)
- end
-
- gem_mirrors.for(uri.to_s).uri
- end
-
- def credentials_for(uri)
- self[uri.to_s] || self[uri.host]
- end
-
- def gem_mirrors
- all.inject(Mirrors.new) do |mirrors, k|
- mirrors.parse(k, self[k]) if k.start_with?("mirror.")
- mirrors
- end
- end
-
- def locations(key)
- key = key_for(key)
- locations = {}
- locations[:temporary] = @temporary[key] if @temporary.key?(key)
- locations[:local] = @local_config[key] if @local_config.key?(key)
- locations[:env] = ENV[key] if ENV[key]
- locations[:global] = @global_config[key] if @global_config.key?(key)
- locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
- locations
- end
-
- def pretty_values_for(exposed_key)
- key = key_for(exposed_key)
-
- locations = []
-
- if @temporary.key?(key)
- locations << "Set for the current command: #{converted_value(@temporary[key], exposed_key).inspect}"
- end
-
- if @local_config.key?(key)
- locations << "Set for your local app (#{local_config_file}): #{converted_value(@local_config[key], exposed_key).inspect}"
- end
-
- if value = ENV[key]
- locations << "Set via #{key}: #{converted_value(value, exposed_key).inspect}"
- end
-
- if @global_config.key?(key)
- locations << "Set for the current user (#{global_config_file}): #{converted_value(@global_config[key], exposed_key).inspect}"
- end
-
- return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
- locations
- end
-
- # for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
- def path
- key = key_for(:path)
- path = ENV[key] || @global_config[key]
- if path && !@temporary.key?(key) && !@local_config.key?(key)
- return Path.new(path, false, false)
- end
-
- system_path = self["path.system"] || (self[:disable_shared_gems] == false)
- Path.new(self[:path], system_path, Bundler.feature_flag.default_install_uses_path?)
- end
-
- Path = Struct.new(:explicit_path, :system_path, :default_install_uses_path) do
- def path
- path = base_path
- path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
- path
- end
-
- def use_system_gems?
- return true if system_path
- return false if explicit_path
- !default_install_uses_path
- end
-
- def base_path
- path = explicit_path
- path ||= ".bundle" unless use_system_gems?
- path ||= Bundler.rubygems.gem_dir
- path
- end
-
- def base_path_relative_to_pwd
- base_path = Pathname.new(self.base_path)
- expanded_base_path = base_path.expand_path(Bundler.root)
- relative_path = expanded_base_path.relative_path_from(Pathname.pwd)
- if relative_path.to_s.start_with?("..")
- relative_path = base_path if base_path.absolute?
- else
- relative_path = Pathname.new(File.join(".", relative_path))
- end
- relative_path
- rescue ArgumentError
- expanded_base_path
- end
-
- def validate!
- return unless explicit_path && system_path
- path = Bundler.settings.pretty_values_for(:path)
- path.unshift(nil, "path:") unless path.empty?
- system_path = Bundler.settings.pretty_values_for("path.system")
- system_path.unshift(nil, "path.system:") unless system_path.empty?
- disable_shared_gems = Bundler.settings.pretty_values_for(:disable_shared_gems)
- disable_shared_gems.unshift(nil, "disable_shared_gems:") unless disable_shared_gems.empty?
- raise InvalidOption,
- "Using a custom path while using system gems is unsupported.\n#{path.join("\n")}\n#{system_path.join("\n")}\n#{disable_shared_gems.join("\n")}"
- end
- end
-
- def allow_sudo?
- key = key_for(:path)
- path_configured = @temporary.key?(key) || @local_config.key?(key)
- !path_configured
- end
-
- def ignore_config?
- ENV["BUNDLE_IGNORE_CONFIG"]
- end
-
- def app_cache_path
- @app_cache_path ||= self[:cache_path] || "vendor/cache"
- end
-
- def validate!
- all.each do |raw_key|
- [@local_config, ENV, @global_config].each do |settings|
- value = converted_value(settings[key_for(raw_key)], raw_key)
- Validator.validate!(raw_key, value, settings.to_hash.dup)
- end
- end
- end
-
- def key_for(key)
- key = Settings.normalize_uri(key).to_s if key.is_a?(String) && /https?:/ =~ key
- key = key.to_s.gsub(".", "__").upcase
- "BUNDLE_#{key}"
- end
-
- private
-
- def parent_setting_for(name)
- split_specific_setting_for(name)[0]
- end
-
- def specific_gem_for(name)
- split_specific_setting_for(name)[1]
- end
-
- def split_specific_setting_for(name)
- name.split(".")
- end
-
- def is_bool(name)
- BOOL_KEYS.include?(name.to_s) || BOOL_KEYS.include?(parent_setting_for(name.to_s))
- end
-
- def to_bool(value)
- case value
- when nil, /\A(false|f|no|n|0|)\z/i, false
- false
- else
- true
- end
- end
-
- def is_num(key)
- NUMBER_KEYS.include?(key.to_s)
- end
-
- def is_array(key)
- ARRAY_KEYS.include?(key.to_s)
- end
-
- def to_array(value)
- return [] unless value
- value.split(":").map(&:to_sym)
- end
-
- def array_to_s(array)
- array = Array(array)
- return nil if array.empty?
- array.join(":").tr(" ", ":")
- end
-
- def set_key(raw_key, value, hash, file)
- raw_key = raw_key.to_s
- value = array_to_s(value) if is_array(raw_key)
-
- key = key_for(raw_key)
-
- return if hash[key] == value
-
- hash[key] = value
- hash.delete(key) if value.nil?
-
- Validator.validate!(raw_key, converted_value(value, raw_key), hash)
-
- return unless file
- SharedHelpers.filesystem_access(file) do |p|
- FileUtils.mkdir_p(p.dirname)
- require_relative "yaml_serializer"
- p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
- end
- end
-
- def converted_value(value, key)
- if is_array(key)
- to_array(value)
- elsif value.nil?
- nil
- elsif is_bool(key) || value == "false"
- to_bool(value)
- elsif is_num(key)
- value.to_i
- else
- value.to_s
- end
- end
-
- def global_config_file
- if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
- Pathname.new(ENV["BUNDLE_CONFIG"])
- else
- begin
- Bundler.user_bundle_path("config")
- rescue PermissionError, GenericSystemCallError
- nil
- end
- end
- end
-
- def local_config_file
- Pathname.new(@root).join("config") if @root
- end
-
- def load_config(config_file)
- return {} if !config_file || ignore_config?
- SharedHelpers.filesystem_access(config_file, :read) do |file|
- valid_file = file.exist? && !file.size.zero?
- return {} unless valid_file
- require_relative "yaml_serializer"
- YAMLSerializer.load file.read
- end
- end
-
- PER_URI_OPTIONS = %w[
- fallback_timeout
- ].freeze
-
- NORMALIZE_URI_OPTIONS_PATTERN =
- /
- \A
- (\w+\.)? # optional prefix key
- (https?.*?) # URI
- (\.#{Regexp.union(PER_URI_OPTIONS)})? # optional suffix key
- \z
- /ix.freeze
-
- # TODO: duplicates Rubygems#normalize_uri
- # TODO: is this the correct place to validate mirror URIs?
- def self.normalize_uri(uri)
- uri = uri.to_s
- if uri =~ NORMALIZE_URI_OPTIONS_PATTERN
- prefix = $1
- uri = $2
- suffix = $3
- end
- uri = "#{uri}/" unless uri.end_with?("/")
- require_relative "vendored_uri"
- uri = Bundler::URI(uri)
- unless uri.absolute?
- raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri)
- end
- "#{prefix}#{uri}#{suffix}"
- end
- end
-end
diff --git a/lib/bundler/settings/validator.rb b/lib/bundler/settings/validator.rb
deleted file mode 100644
index 0a57ea7f03..0000000000
--- a/lib/bundler/settings/validator.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Settings
- class Validator
- class Rule
- attr_reader :description
-
- def initialize(keys, description, &validate)
- @keys = keys
- @description = description
- @validate = validate
- end
-
- def validate!(key, value, settings)
- instance_exec(key, value, settings, &@validate)
- end
-
- def fail!(key, value, *reasons)
- reasons.unshift @description
- raise InvalidOption, "Setting `#{key}` to #{value.inspect} failed:\n#{reasons.map {|r| " - #{r}" }.join("\n")}"
- end
-
- def set(settings, key, value, *reasons)
- hash_key = k(key)
- return if settings[hash_key] == value
- reasons.unshift @description
- Bundler.ui.info "Setting `#{key}` to #{value.inspect}, since #{reasons.join(", ")}"
- if value.nil?
- settings.delete(hash_key)
- else
- settings[hash_key] = value
- end
- end
-
- def k(key)
- Bundler.settings.key_for(key)
- end
- end
-
- def self.rules
- @rules ||= Hash.new {|h, k| h[k] = [] }
- end
- private_class_method :rules
-
- def self.rule(keys, description, &blk)
- rule = Rule.new(keys, description, &blk)
- keys.each {|k| rules[k] << rule }
- end
- private_class_method :rule
-
- def self.validate!(key, value, settings)
- rules_to_validate = rules[key]
- rules_to_validate.each {|rule| rule.validate!(key, value, settings) }
- end
-
- rule %w[path path.system], "path and path.system are mutually exclusive" do |key, value, settings|
- if key == "path" && value
- set(settings, "path.system", nil)
- elsif key == "path.system" && value
- set(settings, :path, nil)
- end
- end
-
- rule %w[with without], "a group cannot be in both `with` & `without` simultaneously" do |key, value, settings|
- with = settings.fetch(k(:with), "").split(":").map(&:to_sym)
- without = settings.fetch(k(:without), "").split(":").map(&:to_sym)
-
- other_key = key == "with" ? :without : :with
- other_setting = key == "with" ? without : with
-
- conflicting = with & without
- if conflicting.any?
- fail!(key, value, "`#{other_key}` is current set to #{other_setting.inspect}", "the `#{conflicting.join("`, `")}` groups conflict")
- end
- end
-
- rule %w[path], "relative paths are expanded relative to the current working directory" do |key, value, settings|
- next if value.nil?
-
- path = Pathname.new(value)
- next if !path.relative? || !Bundler.feature_flag.path_relative_to_cwd?
-
- path = path.expand_path
-
- root = begin
- Bundler.root
- rescue GemfileNotFound
- Pathname.pwd.expand_path
- end
-
- path = begin
- path.relative_path_from(root)
- rescue ArgumentError
- path
- end
-
- set(settings, key, path.to_s)
- end
- end
- end
-end
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb
deleted file mode 100644
index 27911dc1ad..0000000000
--- a/lib/bundler/setup.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "shared_helpers"
-
-if Bundler::SharedHelpers.in_bundle?
- require_relative "../bundler"
-
- if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
- begin
- Bundler.ui.silence { Bundler.setup }
- rescue Bundler::BundlerError => e
- Bundler.ui.warn "\e[31m#{e.message}\e[0m"
- Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
- if e.is_a?(Bundler::GemNotFound)
- Bundler.ui.warn "\e[33mRun `bundle install` to install missing gems.\e[0m"
- end
- exit e.status_code
- end
- else
- Bundler.ui.silence { Bundler.setup }
- end
-
- # We might be in the middle of shelling out to rubygems
- # (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
- # not being silent.
- Gem::DefaultUserInteraction.ui = nil
-end
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
deleted file mode 100644
index 6e83bc5ff4..0000000000
--- a/lib/bundler/shared_helpers.rb
+++ /dev/null
@@ -1,358 +0,0 @@
-# frozen_string_literal: true
-
-require "pathname"
-require "rbconfig"
-
-require_relative "version"
-require_relative "constants"
-require_relative "rubygems_integration"
-require_relative "current_ruby"
-
-module Bundler
- module SharedHelpers
- def root
- gemfile = find_gemfile
- raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
- Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path.parent
- end
-
- def default_gemfile
- gemfile = find_gemfile
- raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
- Pathname.new(gemfile).tap{|x| x.untaint if RUBY_VERSION < "2.7" }.expand_path
- end
-
- def default_lockfile
- gemfile = default_gemfile
-
- case gemfile.basename.to_s
- when "gems.rb" then Pathname.new(gemfile.sub(/.rb$/, ".locked"))
- else Pathname.new("#{gemfile}.lock")
- end.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
- end
-
- def default_bundle_dir
- bundle_dir = find_directory(".bundle")
- return nil unless bundle_dir
-
- bundle_dir = Pathname.new(bundle_dir)
-
- global_bundle_dir = Bundler.user_home.join(".bundle")
- return nil if bundle_dir == global_bundle_dir
-
- bundle_dir
- end
-
- def in_bundle?
- find_gemfile
- end
-
- def chdir(dir, &blk)
- Bundler.rubygems.ext_lock.synchronize do
- Dir.chdir dir, &blk
- end
- end
-
- def pwd
- Bundler.rubygems.ext_lock.synchronize do
- Pathname.pwd
- end
- end
-
- def with_clean_git_env(&block)
- keys = %w[GIT_DIR GIT_WORK_TREE]
- old_env = keys.inject({}) do |h, k|
- h.update(k => ENV[k])
- end
-
- keys.each {|key| ENV.delete(key) }
-
- block.call
- ensure
- keys.each {|key| ENV[key] = old_env[key] }
- end
-
- def set_bundle_environment
- set_bundle_variables
- set_path
- set_rubyopt
- set_rubylib
- end
-
- # Rescues permissions errors raised by file system operations
- # (ie. Errno:EACCESS, Errno::EAGAIN) and raises more friendly errors instead.
- #
- # @param path [String] the path that the action will be attempted to
- # @param action [Symbol, #to_s] the type of operation that will be
- # performed. For example: :write, :read, :exec
- #
- # @yield path
- #
- # @raise [Bundler::PermissionError] if Errno:EACCES is raised in the
- # given block
- # @raise [Bundler::TemporaryResourceError] if Errno:EAGAIN is raised in the
- # given block
- #
- # @example
- # filesystem_access("vendor/cache", :write) do
- # FileUtils.mkdir_p("vendor/cache")
- # end
- #
- # @see {Bundler::PermissionError}
- def filesystem_access(path, action = :write, &block)
- yield(path.dup.tap{|x| x.untaint if RUBY_VERSION < "2.7" })
- rescue Errno::EACCES
- raise PermissionError.new(path, action)
- rescue Errno::EAGAIN
- raise TemporaryResourceError.new(path, action)
- rescue Errno::EPROTO
- raise VirtualProtocolError.new
- rescue Errno::ENOSPC
- raise NoSpaceOnDeviceError.new(path, action)
- rescue *[const_get_safely(:ENOTSUP, Errno)].compact
- raise OperationNotSupportedError.new(path, action)
- rescue Errno::EEXIST, Errno::ENOENT
- raise
- rescue SystemCallError => e
- raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
- end
-
- def const_get_safely(constant_name, namespace)
- const_in_namespace = namespace.constants.include?(constant_name.to_s) ||
- namespace.constants.include?(constant_name.to_sym)
- return nil unless const_in_namespace
- namespace.const_get(constant_name)
- end
-
- def major_deprecation(major_version, message, print_caller_location: false)
- if print_caller_location
- caller_location = caller_locations(2, 2).first
- message = "#{message} (called at #{caller_location.path}:#{caller_location.lineno})"
- end
-
- bundler_major_version = Bundler.bundler_major_version
- if bundler_major_version > major_version
- require_relative "errors"
- raise DeprecatedError, "[REMOVED] #{message}"
- end
-
- return unless bundler_major_version >= major_version && prints_major_deprecations?
- Bundler.ui.warn("[DEPRECATED] #{message}")
- end
-
- def print_major_deprecations!
- multiple_gemfiles = search_up(".") do |dir|
- gemfiles = gemfile_names.select {|gf| File.file? File.expand_path(gf, dir) }
- next if gemfiles.empty?
- break gemfiles.size != 1
- end
- return unless multiple_gemfiles
- message = "Multiple gemfiles (gems.rb and Gemfile) detected. " \
- "Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.rb.locked."
- Bundler.ui.warn message
- end
-
- def trap(signal, override = false, &block)
- prior = Signal.trap(signal) do
- block.call
- prior.call unless override
- end
- end
-
- def ensure_same_dependencies(spec, old_deps, new_deps)
- new_deps = new_deps.reject {|d| d.type == :development }
- old_deps = old_deps.reject {|d| d.type == :development }
-
- without_type = proc {|d| Gem::Dependency.new(d.name, d.requirements_list.sort) }
- new_deps.map!(&without_type)
- old_deps.map!(&without_type)
-
- extra_deps = new_deps - old_deps
- return if extra_deps.empty?
-
- Bundler.ui.debug "#{spec.full_name} from #{spec.remote} has either corrupted API or lockfile dependencies" \
- " (was expecting #{old_deps.map(&:to_s)}, but the real spec has #{new_deps.map(&:to_s)})"
- raise APIResponseMismatchError,
- "Downloading #{spec.full_name} revealed dependencies not in the API or the lockfile (#{extra_deps.join(", ")})." \
- "\nEither installing with `--full-index` or running `bundle update #{spec.name}` should fix the problem."
- end
-
- def pretty_dependency(dep, print_source = false)
- msg = String.new(dep.name)
- msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
-
- if dep.is_a?(Bundler::Dependency)
- platform_string = dep.platforms.join(", ")
- msg << " " << platform_string if !platform_string.empty? && platform_string != Gem::Platform::RUBY
- end
-
- msg << " from the `#{dep.source}` source" if print_source && dep.source
- msg
- end
-
- def md5_available?
- return @md5_available if defined?(@md5_available)
- @md5_available = begin
- require "openssl"
- OpenSSL::Digest::MD5.digest("")
- true
- rescue LoadError
- true
- rescue OpenSSL::Digest::DigestError
- false
- end
- end
-
- def digest(name)
- require "digest"
- Digest(name)
- end
-
- def write_to_gemfile(gemfile_path, contents)
- filesystem_access(gemfile_path) {|g| File.open(g, "w") {|file| file.puts contents } }
- end
-
- private
-
- def validate_bundle_path
- path_separator = Bundler.rubygems.path_separator
- return unless Bundler.bundle_path.to_s.split(path_separator).size > 1
- message = "Your bundle path contains text matching #{path_separator.inspect}, " \
- "which is the path separator for your system. Bundler cannot " \
- "function correctly when the Bundle path contains the " \
- "system's PATH separator. Please change your " \
- "bundle path to not match #{path_separator.inspect}." \
- "\nYour current bundle path is '#{Bundler.bundle_path}'."
- raise Bundler::PathError, message
- end
-
- def find_gemfile
- given = ENV["BUNDLE_GEMFILE"]
- return given if given && !given.empty?
- find_file(*gemfile_names)
- end
-
- def gemfile_names
- ["gems.rb", "Gemfile"]
- end
-
- def find_file(*names)
- search_up(*names) do |filename|
- return filename if File.file?(filename)
- end
- end
-
- def find_directory(*names)
- search_up(*names) do |dirname|
- return dirname if File.directory?(dirname)
- end
- end
-
- def search_up(*names)
- previous = nil
- current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
-
- until !File.directory?(current) || current == previous
- if ENV["BUNDLE_SPEC_RUN"]
- # avoid stepping above the tmp directory when testing
- gemspec = if ENV["GEM_COMMAND"]
- # for Ruby Core
- "lib/bundler/bundler.gemspec"
- else
- "bundler.gemspec"
- end
-
- # avoid stepping above the tmp directory when testing
- return nil if File.file?(File.join(current, gemspec))
- end
-
- names.each do |name|
- filename = File.join(current, name)
- yield filename
- end
- previous = current
- current = File.expand_path("..", current)
- end
- end
-
- def set_env(key, value)
- raise ArgumentError, "new key #{key}" unless EnvironmentPreserver::BUNDLER_KEYS.include?(key)
- orig_key = "#{EnvironmentPreserver::BUNDLER_PREFIX}#{key}"
- orig = ENV[key]
- orig ||= EnvironmentPreserver::INTENTIONALLY_NIL
- ENV[orig_key] ||= orig
-
- ENV[key] = value
- end
- public :set_env
-
- def set_bundle_variables
- # bundler exe & lib folders have same root folder, typical gem installation
- exe_file = File.expand_path("../../../exe/bundle", __FILE__)
-
- # for Ruby core repository testing
- exe_file = File.expand_path("../../../libexec/bundle", __FILE__) unless File.exist?(exe_file)
-
- # bundler is a default gem, exe path is separate
- exe_file = Bundler.rubygems.bin_path("bundler", "bundle", VERSION) unless File.exist?(exe_file)
-
- Bundler::SharedHelpers.set_env "BUNDLE_BIN_PATH", exe_file
- Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", find_gemfile.to_s
- Bundler::SharedHelpers.set_env "BUNDLER_VERSION", Bundler::VERSION
- end
-
- def set_path
- validate_bundle_path
- paths = (ENV["PATH"] || "").split(File::PATH_SEPARATOR)
- paths.unshift "#{Bundler.bundle_path}/bin"
- Bundler::SharedHelpers.set_env "PATH", paths.uniq.join(File::PATH_SEPARATOR)
- end
-
- def set_rubyopt
- rubyopt = [ENV["RUBYOPT"]].compact
- setup_require = "-r#{File.expand_path("setup", __dir__)}"
- return if !rubyopt.empty? && rubyopt.first =~ /#{setup_require}/
- rubyopt.unshift setup_require
- Bundler::SharedHelpers.set_env "RUBYOPT", rubyopt.join(" ")
- end
-
- def set_rubylib
- rubylib = (ENV["RUBYLIB"] || "").split(File::PATH_SEPARATOR)
- rubylib.unshift bundler_ruby_lib unless RbConfig::CONFIG["rubylibdir"] == bundler_ruby_lib
- Bundler::SharedHelpers.set_env "RUBYLIB", rubylib.uniq.join(File::PATH_SEPARATOR)
- end
-
- def bundler_ruby_lib
- resolve_path File.expand_path("../..", __FILE__)
- end
-
- def clean_load_path
- bundler_lib = bundler_ruby_lib
-
- loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
-
- $LOAD_PATH.reject! do |p|
- next if resolve_path(p).start_with?(bundler_lib)
- loaded_gem_paths.delete(p)
- end
- $LOAD_PATH.uniq!
- end
-
- def resolve_path(path)
- expanded = File.expand_path(path)
- return expanded unless File.respond_to?(:realpath) && File.exist?(expanded)
-
- File.realpath(expanded)
- end
-
- def prints_major_deprecations?
- require_relative "../bundler"
- return false if Bundler.settings[:silence_deprecations]
- require_relative "deprecate"
- return false if Bundler::Deprecate.skip
- true
- end
-
- extend self
- end
-end
diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb
deleted file mode 100644
index bd9971f884..0000000000
--- a/lib/bundler/similarity_detector.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class SimilarityDetector
- SimilarityScore = Struct.new(:string, :distance)
-
- # initialize with an array of words to be matched against
- def initialize(corpus)
- @corpus = corpus
- end
-
- # return an array of words similar to 'word' from the corpus
- def similar_words(word, limit = 3)
- words_by_similarity = @corpus.map {|w| SimilarityScore.new(w, levenshtein_distance(word, w)) }
- words_by_similarity.select {|s| s.distance <= limit }.sort_by(&:distance).map(&:string)
- end
-
- # return the result of 'similar_words', concatenated into a list
- # (eg "a, b, or c")
- def similar_word_list(word, limit = 3)
- words = similar_words(word, limit)
- if words.length == 1
- words[0]
- elsif words.length > 1
- [words[0..-2].join(", "), words[-1]].join(" or ")
- end
- end
-
- protected
-
- # https://www.informit.com/articles/article.aspx?p=683059&seqNum=36
- def levenshtein_distance(this, that, ins = 2, del = 2, sub = 1)
- # ins, del, sub are weighted costs
- return nil if this.nil?
- return nil if that.nil?
- dm = [] # distance matrix
-
- # Initialize first row values
- dm[0] = (0..this.length).collect {|i| i * ins }
- fill = [0] * (this.length - 1)
-
- # Initialize first column values
- (1..that.length).each do |i|
- dm[i] = [i * del, fill.flatten]
- end
-
- # populate matrix
- (1..that.length).each do |i|
- (1..this.length).each do |j|
- # critical comparison
- dm[i][j] = [
- dm[i - 1][j - 1] + (this[j - 1] == that[i - 1] ? 0 : sub),
- dm[i][j - 1] + ins,
- dm[i - 1][j] + del,
- ].min
- end
- end
-
- # The last value in matrix is the Levenshtein distance between the strings
- dm[that.length][this.length]
- end
- end
-end
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
deleted file mode 100644
index 4b2e305bda..0000000000
--- a/lib/bundler/source.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- autoload :Gemspec, File.expand_path("source/gemspec", __dir__)
- autoload :Git, File.expand_path("source/git", __dir__)
- autoload :Metadata, File.expand_path("source/metadata", __dir__)
- autoload :Path, File.expand_path("source/path", __dir__)
- autoload :Rubygems, File.expand_path("source/rubygems", __dir__)
-
- attr_accessor :dependency_names
-
- def unmet_deps
- specs.unmet_dependency_names
- end
-
- def version_message(spec)
- message = "#{spec.name} #{spec.version}"
- message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
-
- if Bundler.locked_gems
- locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name }
- locked_spec_version = locked_spec.version if locked_spec
- if locked_spec_version && spec.version != locked_spec_version
- message += Bundler.ui.add_color(" (was #{locked_spec_version})", version_color(spec.version, locked_spec_version))
- end
- end
-
- message
- end
-
- def can_lock?(spec)
- spec.source == self
- end
-
- # it's possible that gems from one source depend on gems from some
- # other source, so now we download gemspecs and iterate over those
- # dependencies, looking for gems we don't have info on yet.
- def double_check_for(*); end
-
- def dependency_names_to_double_check
- specs.dependency_names
- end
-
- def include?(other)
- other == self
- end
-
- def inspect
- "#<#{self.class}:0x#{object_id} #{self}>"
- end
-
- def path?
- instance_of?(Bundler::Source::Path)
- end
-
- def extension_cache_path(spec)
- return unless Bundler.feature_flag.global_gem_cache?
- return unless source_slug = extension_cache_slug(spec)
- Bundler.user_cache.join(
- "extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,
- source_slug, spec.full_name
- )
- end
-
- private
-
- def version_color(spec_version, locked_spec_version)
- if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)
- # display yellow if there appears to be a regression
- earlier_version?(spec_version, locked_spec_version) ? :yellow : :green
- else
- # default to green if the versions cannot be directly compared
- :green
- end
- end
-
- def earlier_version?(spec_version, locked_spec_version)
- Gem::Version.new(spec_version) < Gem::Version.new(locked_spec_version)
- end
-
- def print_using_message(message)
- if !message.include?("(was ") && Bundler.feature_flag.suppress_install_using_messages?
- Bundler.ui.debug message
- else
- Bundler.ui.info message
- end
- end
-
- def extension_cache_slug(_)
- nil
- end
- end
-end
diff --git a/lib/bundler/source/gemspec.rb b/lib/bundler/source/gemspec.rb
deleted file mode 100644
index 7e3447e776..0000000000
--- a/lib/bundler/source/gemspec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- class Gemspec < Path
- attr_reader :gemspec
-
- def initialize(options)
- super
- @gemspec = options["gemspec"]
- end
-
- def as_path_source
- Path.new(options)
- end
- end
- end
-end
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
deleted file mode 100644
index 7c1533ad90..0000000000
--- a/lib/bundler/source/git.rb
+++ /dev/null
@@ -1,336 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../vendored_fileutils"
-
-module Bundler
- class Source
- class Git < Path
- autoload :GitProxy, File.expand_path("git/git_proxy", __dir__)
-
- attr_reader :uri, :ref, :branch, :options, :glob, :submodules
-
- def initialize(options)
- @options = options
- @glob = options["glob"] || DEFAULT_GLOB
-
- @allow_cached = false
- @allow_remote = false
-
- # Stringify options that could be set as symbols
- %w[ref branch tag revision].each {|k| options[k] = options[k].to_s if options[k] }
-
- @uri = options["uri"] || ""
- @safe_uri = URICredentialsFilter.credential_filtered_uri(@uri)
- @branch = options["branch"]
- @ref = options["ref"] || options["branch"] || options["tag"] || "master"
- @submodules = options["submodules"]
- @name = options["name"]
- @version = options["version"].to_s.strip.gsub("-", ".pre.")
-
- @copied = false
- @local = false
- end
-
- def self.from_lock(options)
- new(options.merge("uri" => options.delete("remote")))
- end
-
- def to_lock
- out = String.new("GIT\n")
- out << " remote: #{@uri}\n"
- out << " revision: #{revision}\n"
- %w[ref branch tag submodules].each do |opt|
- out << " #{opt}: #{options[opt]}\n" if options[opt]
- end
- out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
- out << " specs:\n"
- end
-
- def hash
- [self.class, uri, ref, branch, name, version, glob, submodules].hash
- end
-
- def eql?(other)
- other.is_a?(Git) && uri == other.uri && ref == other.ref &&
- branch == other.branch && name == other.name &&
- version == other.version && glob == other.glob &&
- submodules == other.submodules
- end
-
- alias_method :==, :eql?
-
- def to_s
- at = if local?
- path
- elsif user_ref = options["ref"]
- if ref =~ /\A[a-z0-9]{4,}\z/i
- shortref_for_display(user_ref)
- else
- user_ref
- end
- else
- ref
- end
-
- rev = begin
- "@#{shortref_for_display(revision)}"
- rescue GitError
- nil
- end
-
- "#{@safe_uri} (at #{at}#{rev})"
- end
-
- def name
- File.basename(@uri, ".git")
- end
-
- # This is the path which is going to contain a specific
- # checkout of the git repository. When using local git
- # repos, this is set to the local repo.
- def install_path
- @install_path ||= begin
- git_scope = "#{base_name}-#{shortref_for_path(revision)}"
-
- path = Bundler.install_path.join(git_scope)
-
- if !path.exist? && Bundler.requires_sudo?
- Bundler.user_bundle_path.join(Bundler.ruby_scope).join(git_scope)
- else
- path
- end
- end
- end
-
- alias_method :path, :install_path
-
- def extension_dir_name
- "#{base_name}-#{shortref_for_path(revision)}"
- end
-
- def unlock!
- git_proxy.revision = nil
- options["revision"] = nil
-
- @unlocked = true
- end
-
- def local_override!(path)
- return false if local?
-
- original_path = path
- path = Pathname.new(path)
- path = path.expand_path(Bundler.root) unless path.relative?
-
- unless options["branch"] || Bundler.settings[:disable_local_branch_check]
- raise GitError, "Cannot use local override for #{name} at #{path} because " \
- ":branch is not specified in Gemfile. Specify a branch or run " \
- "`bundle config unset local.#{override_for(original_path)}` to remove the local override"
- end
-
- unless path.exist?
- raise GitError, "Cannot use local override for #{name} because #{path} " \
- "does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override"
- end
-
- set_local!(path)
-
- # Create a new git proxy without the cached revision
- # so the Gemfile.lock always picks up the new revision.
- @git_proxy = GitProxy.new(path, uri, ref)
-
- if git_proxy.branch != options["branch"] && !Bundler.settings[:disable_local_branch_check]
- raise GitError, "Local override for #{name} at #{path} is using branch " \
- "#{git_proxy.branch} but Gemfile specifies #{options["branch"]}"
- end
-
- changed = cached_revision && cached_revision != git_proxy.revision
-
- if changed && !@unlocked && !git_proxy.contains?(cached_revision)
- raise GitError, "The Gemfile lock is pointing to revision #{shortref_for_display(cached_revision)} " \
- "but the current branch in your local override for #{name} does not contain such commit. " \
- "Please make sure your branch is up to date."
- end
-
- changed
- end
-
- def specs(*)
- set_local!(app_cache_path) if has_app_cache? && !local?
-
- if requires_checkout? && !@copied
- fetch
- git_proxy.copy_to(install_path, submodules)
- serialize_gemspecs_in(install_path)
- @copied = true
- end
-
- local_specs
- end
-
- def install(spec, options = {})
- force = options[:force]
-
- print_using_message "Using #{version_message(spec)} from #{self}"
-
- if (requires_checkout? && !@copied) || force
- Bundler.ui.debug " * Checking out revision: #{ref}"
- git_proxy.copy_to(install_path, submodules)
- serialize_gemspecs_in(install_path)
- @copied = true
- end
-
- generate_bin_options = { :disable_extensions => !Bundler.rubygems.spec_missing_extensions?(spec), :build_args => options[:build_args] }
- generate_bin(spec, generate_bin_options)
-
- requires_checkout? ? spec.post_install_message : nil
- end
-
- def cache(spec, custom_path = nil)
- app_cache_path = app_cache_path(custom_path)
- return unless Bundler.feature_flag.cache_all?
- return if path == app_cache_path
- cached!
- FileUtils.rm_rf(app_cache_path)
- git_proxy.checkout if requires_checkout?
- git_proxy.copy_to(app_cache_path, @submodules)
- serialize_gemspecs_in(app_cache_path)
- end
-
- def load_spec_files
- super
- rescue PathError => e
- Bundler.ui.trace e
- raise GitError, "#{self} is not yet checked out. Run `bundle install` first."
- end
-
- # This is the path which is going to contain a cache
- # of the git repository. When using the same git repository
- # across different projects, this cache will be shared.
- # When using local git repos, this is set to the local repo.
- def cache_path
- @cache_path ||= begin
- if Bundler.requires_sudo? || Bundler.feature_flag.global_gem_cache?
- Bundler.user_cache
- else
- Bundler.bundle_path.join("cache", "bundler")
- end.join("git", git_scope)
- end
- end
-
- def app_cache_dirname
- "#{base_name}-#{shortref_for_path(cached_revision || revision)}"
- end
-
- def revision
- git_proxy.revision
- end
-
- def allow_git_ops?
- @allow_remote || @allow_cached
- end
-
- private
-
- def serialize_gemspecs_in(destination)
- destination = destination.expand_path(Bundler.root) if destination.relative?
- Dir["#{destination}/#{@glob}"].each do |spec_path|
- # Evaluate gemspecs and cache the result. Gemspecs
- # in git might require git or other dependencies.
- # The gemspecs we cache should already be evaluated.
- spec = Bundler.load_gemspec(spec_path)
- next unless spec
- Bundler.rubygems.set_installed_by_version(spec)
- Bundler.rubygems.validate(spec)
- File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) }
- end
- end
-
- def set_local!(path)
- @local = true
- @local_specs = @git_proxy = nil
- @cache_path = @install_path = path
- end
-
- def has_app_cache?
- cached_revision && super
- end
-
- def local?
- @local
- end
-
- def requires_checkout?
- allow_git_ops? && !local? && !cached_revision_checked_out?
- end
-
- def cached_revision_checked_out?
- cached_revision && cached_revision == revision && install_path.exist?
- end
-
- def base_name
- File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)?(//\w*/)?(\w*/)*}, ""), ".git")
- end
-
- def shortref_for_display(ref)
- ref[0..6]
- end
-
- def shortref_for_path(ref)
- ref[0..11]
- end
-
- def uri_hash
- if uri =~ %r{^\w+://(\w+@)?}
- # Downcase the domain component of the URI
- # and strip off a trailing slash, if one is present
- input = Bundler::URI.parse(uri).normalize.to_s.sub(%r{/$}, "")
- else
- # If there is no URI scheme, assume it is an ssh/git URI
- input = uri
- end
- SharedHelpers.digest(:SHA1).hexdigest(input)
- end
-
- def cached_revision
- options["revision"]
- end
-
- def cached?
- cache_path.exist?
- end
-
- def git_proxy
- @git_proxy ||= GitProxy.new(cache_path, uri, ref, cached_revision, self)
- end
-
- def fetch
- git_proxy.checkout
- rescue GitError => e
- raise unless Bundler.feature_flag.allow_offline_install?
- Bundler.ui.warn "Using cached git data because of network errors:\n#{e}"
- end
-
- # no-op, since we validate when re-serializing the gemspec
- def validate_spec(_spec); end
-
- def load_gemspec(file)
- stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent)
- stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
- StubSpecification.from_stub(stub)
- end
-
- def git_scope
- "#{base_name}-#{uri_hash}"
- end
-
- def extension_cache_slug(_)
- extension_dir_name
- end
-
- def override_for(path)
- Bundler.settings.local_overrides.key(path)
- end
- end
- end
-end
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
deleted file mode 100644
index 7612eb16c6..0000000000
--- a/lib/bundler/source/git/git_proxy.rb
+++ /dev/null
@@ -1,259 +0,0 @@
-# frozen_string_literal: true
-
-require "shellwords"
-
-module Bundler
- class Source
- class Git
- class GitNotInstalledError < GitError
- def initialize
- msg = String.new
- msg << "You need to install git to be able to use gems from git repositories. "
- msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
- super msg
- end
- end
-
- class GitNotAllowedError < GitError
- def initialize(command)
- msg = String.new
- msg << "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, "
- msg << "this error message could probably be more useful. Please submit a ticket at https://github.com/bundler/bundler/issues "
- msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
- super msg
- end
- end
-
- class GitCommandError < GitError
- attr_reader :command
-
- def initialize(command, path = nil, extra_info = nil)
- @command = command
-
- msg = String.new
- msg << "Git error: command `git #{command}` in directory #{SharedHelpers.pwd} has failed."
- msg << "\n#{extra_info}" if extra_info
- msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path && path.exist?
- super msg
- end
- end
-
- class MissingGitRevisionError < GitCommandError
- def initialize(command, path, ref, repo)
- msg = "Revision #{ref} does not exist in the repository #{repo}. Maybe you misspelled it?"
- super command, path, msg
- end
- end
-
- # The GitProxy is responsible to interact with git repositories.
- # All actions required by the Git source is encapsulated in this
- # object.
- class GitProxy
- attr_accessor :path, :uri, :ref
- attr_writer :revision
-
- def initialize(path, uri, ref, revision = nil, git = nil)
- @path = path
- @uri = uri
- @ref = ref
- @revision = revision
- @git = git
- raise GitNotInstalledError.new if allow? && !Bundler.git_present?
- end
-
- def revision
- return @revision if @revision
-
- begin
- @revision ||= find_local_revision
- rescue GitCommandError => e
- raise MissingGitRevisionError.new(e.command, path, ref, URICredentialsFilter.credential_filtered_uri(uri))
- end
-
- @revision
- end
-
- def branch
- @branch ||= allowed_in_path do
- git("rev-parse --abbrev-ref HEAD").strip
- end
- end
-
- def contains?(commit)
- allowed_in_path do
- result, status = git_null("branch --contains #{commit}")
- status.success? && result =~ /^\* (.*)$/
- end
- end
-
- def version
- git("--version").match(/(git version\s*)?((\.?\d+)+).*/)[2]
- end
-
- def full_version
- git("--version").sub("git version", "").strip
- end
-
- def checkout
- return if path.exist? && has_revision_cached?
- extra_ref = "#{Shellwords.shellescape(ref)}:#{Shellwords.shellescape(ref)}" if ref && ref.start_with?("refs/")
-
- Bundler.ui.info "Fetching #{URICredentialsFilter.credential_filtered_uri(uri)}"
-
- unless path.exist?
- SharedHelpers.filesystem_access(path.dirname) do |p|
- FileUtils.mkdir_p(p)
- end
- git_retry %(clone #{uri_escaped_with_configured_credentials} "#{path}" --bare --no-hardlinks --quiet)
- return unless extra_ref
- end
-
- in_path do
- git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref})
- end
- end
-
- def copy_to(destination, submodules = false)
- # method 1
- unless File.exist?(destination.join(".git"))
- begin
- SharedHelpers.filesystem_access(destination.dirname) do |p|
- FileUtils.mkdir_p(p)
- end
- SharedHelpers.filesystem_access(destination) do |p|
- FileUtils.rm_rf(p)
- end
- git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}")
- File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
- rescue Errno::EEXIST => e
- file_path = e.message[%r{.*?(/.*)}, 1]
- raise GitError, "Bundler could not install a gem because it needs to " \
- "create a directory, but a file exists - #{file_path}. Please delete " \
- "this file and try again."
- end
- end
- # method 2
- SharedHelpers.chdir(destination) do
- git_retry %(fetch --force --quiet --tags "#{path}")
-
- begin
- git "reset --hard #{@revision}"
- rescue GitCommandError => e
- raise MissingGitRevisionError.new(e.command, path, @revision, URICredentialsFilter.credential_filtered_uri(uri))
- end
-
- if submodules
- git_retry "submodule update --init --recursive"
- elsif Gem::Version.create(version) >= Gem::Version.create("2.9.0")
- git_retry "submodule deinit --all --force"
- end
- end
- end
-
- private
-
- def git_null(command)
- command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri)
- raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
-
- out, status = SharedHelpers.with_clean_git_env do
- capture_and_ignore_stderr("git #{command}")
- end
-
- [URICredentialsFilter.credential_filtered_string(out, uri), status]
- end
-
- def git_retry(command)
- Bundler::Retry.new("`git #{URICredentialsFilter.credential_filtered_string(command, uri)}`", GitNotAllowedError).attempts do
- git(command)
- end
- end
-
- def git(command, check_errors = true, error_msg = nil)
- command_with_no_credentials = URICredentialsFilter.credential_filtered_string(command, uri)
- raise GitNotAllowedError.new(command_with_no_credentials) unless allow?
-
- out, status = SharedHelpers.with_clean_git_env do
- capture_and_filter_stderr(uri, "git #{command}")
- end
-
- stdout_with_no_credentials = URICredentialsFilter.credential_filtered_string(out, uri)
- raise GitCommandError.new(command_with_no_credentials, path, error_msg) if check_errors && !status.success?
- stdout_with_no_credentials
- end
-
- def has_revision_cached?
- return unless @revision
- in_path { git("cat-file -e #{@revision}") }
- true
- rescue GitError
- false
- end
-
- def remove_cache
- FileUtils.rm_rf(path)
- end
-
- def find_local_revision
- allowed_in_path do
- git("rev-parse --verify #{Shellwords.shellescape(ref)}", true).strip
- end
- end
-
- # Escape the URI for git commands
- def uri_escaped_with_configured_credentials
- remote = configured_uri_for(uri)
- if Bundler::WINDOWS
- # Windows quoting requires double quotes only, with double quotes
- # inside the string escaped by being doubled.
- '"' + remote.gsub('"') { '""' } + '"'
- else
- # Bash requires single quoted strings, with the single quotes escaped
- # by ending the string, escaping the quote, and restarting the string.
- "'" + remote.gsub("'") { "'\\''" } + "'"
- end
- end
-
- # Adds credentials to the URI as Fetcher#configured_uri_for does
- def configured_uri_for(uri)
- if /https?:/ =~ uri
- remote = Bundler::URI(uri)
- config_auth = Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
- remote.userinfo ||= config_auth
- remote.to_s
- else
- uri
- end
- end
-
- def allow?
- @git ? @git.allow_git_ops? : true
- end
-
- def in_path(&blk)
- checkout unless path.exist?
- _ = URICredentialsFilter # load it before we chdir
- SharedHelpers.chdir(path, &blk)
- end
-
- def allowed_in_path
- return in_path { yield } if allow?
- raise GitError, "The git source #{uri} is not yet checked out. Please run `bundle install` before trying to start your application"
- end
-
- def capture_and_filter_stderr(uri, cmd)
- require "open3"
- return_value, captured_err, status = Open3.capture3(cmd)
- Bundler.ui.warn URICredentialsFilter.credential_filtered_string(captured_err, uri) if uri && !captured_err.empty?
- [return_value, status]
- end
-
- def capture_and_ignore_stderr(cmd)
- require "open3"
- return_value, _, status = Open3.capture3(cmd)
- [return_value, status]
- end
- end
- end
- end
-end
diff --git a/lib/bundler/source/metadata.rb b/lib/bundler/source/metadata.rb
deleted file mode 100644
index 0867879861..0000000000
--- a/lib/bundler/source/metadata.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- class Metadata < Source
- def specs
- @specs ||= Index.build do |idx|
- idx << Gem::Specification.new("Ruby\0", RubyVersion.system.to_gem_version_with_patchlevel)
- idx << Gem::Specification.new("RubyGems\0", Gem::VERSION) do |s|
- s.required_rubygems_version = Gem::Requirement.default
- end
-
- idx << Gem::Specification.new do |s|
- s.name = "bundler"
- s.version = VERSION
- s.license = "MIT"
- s.platform = Gem::Platform::RUBY
- s.source = self
- s.authors = ["bundler team"]
- s.bindir = "exe"
- s.homepage = "https://bundler.io"
- s.summary = "The best way to manage your application's dependencies"
- s.executables = %w[bundle]
- # can't point to the actual gemspec or else the require paths will be wrong
- s.loaded_from = File.expand_path("..", __FILE__)
- end
-
- if local_spec = Bundler.rubygems.find_name("bundler").find {|s| s.version.to_s == VERSION }
- idx << local_spec
- end
-
- idx.each {|s| s.source = self }
- end
- end
-
- def cached!; end
-
- def remote!; end
-
- def options
- {}
- end
-
- def install(spec, _opts = {})
- print_using_message "Using #{version_message(spec)}"
- nil
- end
-
- def to_s
- "the local ruby installation"
- end
-
- def ==(other)
- self.class == other.class
- end
- alias_method :eql?, :==
-
- def hash
- self.class.hash
- end
-
- def version_message(spec)
- "#{spec.name} #{spec.version}"
- end
- end
- end
-end
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
deleted file mode 100644
index f98f5155fb..0000000000
--- a/lib/bundler/source/path.rb
+++ /dev/null
@@ -1,254 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- class Path < Source
- autoload :Installer, File.expand_path("path/installer", __dir__)
-
- attr_reader :path, :options, :root_path, :original_path
- attr_writer :name
- attr_accessor :version
-
- protected :original_path
-
- DEFAULT_GLOB = "{,*,*/*}.gemspec".freeze
-
- def initialize(options)
- @options = options.dup
- @glob = options["glob"] || DEFAULT_GLOB
-
- @allow_cached = false
- @allow_remote = false
-
- @root_path = options["root_path"] || root
-
- if options["path"]
- @path = Pathname.new(options["path"])
- expanded_path = expand(@path)
- @path = if @path.relative?
- expanded_path.relative_path_from(root_path.expand_path)
- else
- expanded_path
- end
- end
-
- @name = options["name"]
- @version = options["version"]
-
- # Stores the original path. If at any point we move to the
- # cached directory, we still have the original path to copy from.
- @original_path = @path
- end
-
- def remote!
- @local_specs = nil
- @allow_remote = true
- end
-
- def cached!
- @local_specs = nil
- @allow_cached = true
- end
-
- def self.from_lock(options)
- new(options.merge("path" => options.delete("remote")))
- end
-
- def to_lock
- out = String.new("PATH\n")
- out << " remote: #{lockfile_path}\n"
- out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
- out << " specs:\n"
- end
-
- def to_s
- "source at `#{@path}`"
- end
-
- def hash
- [self.class, expanded_path, version].hash
- end
-
- def eql?(other)
- return unless other.class == self.class
- expanded_original_path == other.expanded_original_path &&
- version == other.version
- end
-
- alias_method :==, :eql?
-
- def name
- File.basename(expanded_path.to_s)
- end
-
- def install(spec, options = {})
- print_using_message "Using #{version_message(spec)} from #{self}"
- generate_bin(spec, :disable_extensions => true)
- nil # no post-install message
- end
-
- def cache(spec, custom_path = nil)
- app_cache_path = app_cache_path(custom_path)
- return unless Bundler.feature_flag.cache_all?
- return if expand(@original_path).to_s.index(root_path.to_s + "/") == 0
-
- unless @original_path.exist?
- raise GemNotFound, "Can't cache gem #{version_message(spec)} because #{self} is missing!"
- end
-
- FileUtils.rm_rf(app_cache_path)
- FileUtils.cp_r("#{@original_path}/.", app_cache_path)
- FileUtils.touch(app_cache_path.join(".bundlecache"))
- end
-
- def local_specs(*)
- @local_specs ||= load_spec_files
- end
-
- def specs
- if has_app_cache?
- @path = app_cache_path
- @expanded_path = nil # Invalidate
- end
- local_specs
- end
-
- def app_cache_dirname
- name
- end
-
- def root
- Bundler.root
- end
-
- def expanded_original_path
- @expanded_original_path ||= expand(original_path)
- end
-
- private
-
- def expanded_path
- @expanded_path ||= expand(path)
- end
-
- def expand(somepath)
- somepath.expand_path(root_path)
- rescue ArgumentError => e
- Bundler.ui.debug(e)
- raise PathError, "There was an error while trying to use the path " \
- "`#{somepath}`.\nThe error message was: #{e.message}."
- end
-
- def lockfile_path
- return relative_path(original_path) if original_path.absolute?
- expand(original_path).relative_path_from(root)
- end
-
- def app_cache_path(custom_path = nil)
- @app_cache_path ||= Bundler.app_cache(custom_path).join(app_cache_dirname)
- end
-
- def has_app_cache?
- SharedHelpers.in_bundle? && app_cache_path.exist?
- end
-
- def load_gemspec(file)
- return unless spec = Bundler.load_gemspec(file)
- Bundler.rubygems.set_installed_by_version(spec)
- spec
- end
-
- def validate_spec(spec)
- Bundler.rubygems.validate(spec)
- end
-
- def load_spec_files
- index = Index.new
-
- if File.directory?(expanded_path)
- # We sort depth-first since `<<` will override the earlier-found specs
- Dir["#{expanded_path}/#{@glob}"].sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
- next unless spec = load_gemspec(file)
- spec.source = self
-
- # Validation causes extension_dir to be calculated, which depends
- # on #source, so we validate here instead of load_gemspec
- validate_spec(spec)
- index << spec
- end
-
- if index.empty? && @name && @version
- index << Gem::Specification.new do |s|
- s.name = @name
- s.source = self
- s.version = Gem::Version.new(@version)
- s.platform = Gem::Platform::RUBY
- s.summary = "Fake gemspec for #{@name}"
- s.relative_loaded_from = "#{@name}.gemspec"
- s.authors = ["no one"]
- if expanded_path.join("bin").exist?
- executables = expanded_path.join("bin").children
- executables.reject! {|p| File.directory?(p) }
- s.executables = executables.map {|c| c.basename.to_s }
- end
- end
- end
- else
- message = String.new("The path `#{expanded_path}` ")
- message << if File.exist?(expanded_path)
- "is not a directory."
- else
- "does not exist."
- end
- raise PathError, message
- end
-
- index
- end
-
- def relative_path(path = self.path)
- if path.to_s.start_with?(root_path.to_s)
- return path.relative_path_from(root_path)
- end
- path
- end
-
- def generate_bin(spec, options = {})
- gem_dir = Pathname.new(spec.full_gem_path)
-
- # Some gem authors put absolute paths in their gemspec
- # and we have to save them from themselves
- spec.files = spec.files.map do |p|
- next p unless p =~ /\A#{Pathname::SEPARATOR_PAT}/
- next if File.directory?(p)
- begin
- Pathname.new(p).relative_path_from(gem_dir).to_s
- rescue ArgumentError
- p
- end
- end.compact
-
- installer = Path::Installer.new(
- spec,
- :env_shebang => false,
- :disable_extensions => options[:disable_extensions],
- :build_args => options[:build_args],
- :bundler_extension_cache_path => extension_cache_path(spec)
- )
- installer.post_install
- rescue Gem::InvalidSpecificationException => e
- Bundler.ui.warn "\n#{spec.name} at #{spec.full_gem_path} did not have a valid gemspec.\n" \
- "This prevents bundler from installing bins or native extensions, but " \
- "that may not affect its functionality."
-
- if !spec.extensions.empty? && !spec.email.empty?
- Bundler.ui.warn "If you need to use this package without installing it from a gem " \
- "repository, please contact #{spec.email} and ask them " \
- "to modify their .gemspec so it can work with `gem build`."
- end
-
- Bundler.ui.warn "The validation message from RubyGems was:\n #{e.message}"
- end
- end
- end
-end
diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb
deleted file mode 100644
index a0357ffa39..0000000000
--- a/lib/bundler/source/path/installer.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- class Path
- class Installer < Bundler::RubyGemsGemInstaller
- attr_reader :spec
-
- def initialize(spec, options = {})
- @options = options
- @spec = spec
- @gem_dir = Bundler.rubygems.path(spec.full_gem_path)
- @wrappers = true
- @env_shebang = true
- @format_executable = options[:format_executable] || false
- @build_args = options[:build_args] || Bundler.rubygems.build_args
- @gem_bin_dir = "#{Bundler.rubygems.gem_dir}/bin"
- @disable_extensions = options[:disable_extensions]
-
- if Bundler.requires_sudo?
- @tmp_dir = Bundler.tmp(spec.full_name).to_s
- @bin_dir = "#{@tmp_dir}/bin"
- else
- @bin_dir = @gem_bin_dir
- end
- end
-
- def post_install
- SharedHelpers.chdir(@gem_dir) do
- run_hooks(:pre_install)
-
- unless @disable_extensions
- build_extensions
- run_hooks(:post_build)
- end
-
- generate_bin unless spec.executables.nil? || spec.executables.empty?
-
- run_hooks(:post_install)
- end
- ensure
- Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
- end
-
- private
-
- def generate_bin
- super
-
- if Bundler.requires_sudo?
- SharedHelpers.filesystem_access(@gem_bin_dir) do |p|
- Bundler.mkdir_p(p)
- end
- spec.executables.each do |exe|
- Bundler.sudo "cp -R #{@bin_dir}/#{exe} #{@gem_bin_dir}"
- end
- end
- end
-
- def run_hooks(type)
- hooks_meth = "#{type}_hooks"
- return unless Gem.respond_to?(hooks_meth)
- Gem.send(hooks_meth).each do |hook|
- result = hook.call(self)
- next unless result == false
- location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/
- message = "#{type} hook#{location} failed for #{spec.full_name}"
- raise InstallHookError, message
- end
- end
- end
- end
- end
-end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
deleted file mode 100644
index 6c0de204e7..0000000000
--- a/lib/bundler/source/rubygems.rb
+++ /dev/null
@@ -1,545 +0,0 @@
-# frozen_string_literal: true
-
-require "rubygems/user_interaction"
-
-module Bundler
- class Source
- class Rubygems < Source
- autoload :Remote, File.expand_path("rubygems/remote", __dir__)
-
- # Use the API when installing less than X gems
- API_REQUEST_LIMIT = 500
- # Ask for X gems per API request
- API_REQUEST_SIZE = 50
-
- attr_reader :remotes, :caches
-
- def initialize(options = {})
- @options = options
- @remotes = []
- @dependency_names = []
- @allow_remote = false
- @allow_cached = false
- @caches = [cache_path, *Bundler.rubygems.gem_cache]
-
- Array(options["remotes"] || []).reverse_each {|r| add_remote(r) }
- end
-
- def remote!
- @specs = nil
- @allow_remote = true
- end
-
- def cached!
- @specs = nil
- @allow_cached = true
- end
-
- def hash
- @remotes.hash
- end
-
- def eql?(other)
- other.is_a?(Rubygems) && other.credless_remotes == credless_remotes
- end
-
- alias_method :==, :eql?
-
- def include?(o)
- o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
- end
-
- def can_lock?(spec)
- return super if Bundler.feature_flag.disable_multisource?
- spec.source.is_a?(Rubygems)
- end
-
- def options
- { "remotes" => @remotes.map(&:to_s) }
- end
-
- def self.from_lock(options)
- new(options)
- end
-
- def to_lock
- out = String.new("GEM\n")
- remotes.reverse_each do |remote|
- out << " remote: #{suppress_configured_credentials remote}\n"
- end
- out << " specs:\n"
- end
-
- def to_s
- if remotes.empty?
- "locally installed gems"
- else
- remote_names = remotes.map(&:to_s).join(", ")
- "rubygems repository #{remote_names} or installed locally"
- end
- end
- alias_method :name, :to_s
-
- def specs
- @specs ||= begin
- # remote_specs usually generates a way larger Index than the other
- # sources, and large_idx.use small_idx is way faster than
- # small_idx.use large_idx.
- idx = @allow_remote ? remote_specs.dup : Index.new
- idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
- idx.use(installed_specs, :override_dupes)
- idx
- end
- end
-
- def install(spec, opts = {})
- force = opts[:force]
- ensure_builtin_gems_cached = opts[:ensure_builtin_gems_cached]
-
- if ensure_builtin_gems_cached && builtin_gem?(spec)
- if !cached_path(spec)
- cached_built_in_gem(spec) unless spec.remote
- force = true
- else
- spec.loaded_from = loaded_from(spec)
- end
- end
-
- if (installed?(spec) || Plugin.installed?(spec.name)) && !force
- print_using_message "Using #{version_message(spec)}"
- return nil # no post-install message
- end
-
- # Download the gem to get the spec, because some specs that are returned
- # by rubygems.org are broken and wrong.
- if spec.remote
- # Check for this spec from other sources
- uris = [spec.remote.anonymized_uri]
- uris += remotes_for_spec(spec).map(&:anonymized_uri)
- uris.uniq!
- Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
-
- path = fetch_gem(spec)
- begin
- s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
- spec.__swap__(s)
- rescue StandardError
- Bundler.rm_rf(path)
- raise
- end
- end
-
- unless Bundler.settings[:no_install]
- message = "Installing #{version_message(spec)}"
- message += " with native extensions" if spec.extensions.any?
- Bundler.ui.confirm message
-
- path = cached_gem(spec)
- if requires_sudo?
- install_path = Bundler.tmp(spec.full_name)
- bin_path = install_path.join("bin")
- else
- install_path = rubygems_dir
- bin_path = Bundler.system_bindir
- end
-
- Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
-
- installed_spec = nil
- Bundler.rubygems.preserve_paths do
- installed_spec = Bundler::RubyGemsGemInstaller.at(
- path,
- :install_dir => install_path.to_s,
- :bin_dir => bin_path.to_s,
- :ignore_dependencies => true,
- :wrappers => true,
- :env_shebang => true,
- :build_args => opts[:build_args],
- :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
- :bundler_extension_cache_path => extension_cache_path(spec)
- ).install
- end
- spec.full_gem_path = installed_spec.full_gem_path
-
- # SUDO HAX
- if requires_sudo?
- Bundler.rubygems.repository_subdirectories.each do |name|
- src = File.join(install_path, name, "*")
- dst = File.join(rubygems_dir, name)
- if name == "extensions" && Dir.glob(src).any?
- src = File.join(src, "*/*")
- ext_src = Dir.glob(src).first
- ext_src.gsub!(src[0..-6], "")
- dst = File.dirname(File.join(dst, ext_src))
- end
- SharedHelpers.filesystem_access(dst) do |p|
- Bundler.mkdir_p(p)
- end
- Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any?
- end
-
- spec.executables.each do |exe|
- SharedHelpers.filesystem_access(Bundler.system_bindir) do |p|
- Bundler.mkdir_p(p)
- end
- Bundler.sudo "cp -R #{install_path}/bin/#{exe} #{Bundler.system_bindir}/"
- end
- end
- installed_spec.loaded_from = loaded_from(spec)
- end
- spec.loaded_from = loaded_from(spec)
-
- spec.post_install_message
- ensure
- Bundler.rm_rf(install_path) if requires_sudo?
- end
-
- def cache(spec, custom_path = nil)
- if builtin_gem?(spec)
- cached_path = cached_built_in_gem(spec)
- else
- cached_path = cached_gem(spec)
- end
- raise GemNotFound, "Missing gem file '#{spec.full_name}.gem'." unless cached_path
- return if File.dirname(cached_path) == Bundler.app_cache.to_s
- Bundler.ui.info " * #{File.basename(cached_path)}"
- FileUtils.cp(cached_path, Bundler.app_cache(custom_path))
- rescue Errno::EACCES => e
- Bundler.ui.debug(e)
- raise InstallError, e.message
- end
-
- def cached_built_in_gem(spec)
- cached_path = cached_path(spec)
- if cached_path.nil?
- remote_spec = remote_specs.search(spec).first
- if remote_spec
- cached_path = fetch_gem(remote_spec)
- else
- Bundler.ui.warn "#{spec.full_name} is built in to Ruby, and can't be cached because your Gemfile doesn't have any sources that contain it."
- end
- end
- cached_path
- end
-
- def add_remote(source)
- uri = normalize_uri(source)
- @remotes.unshift(uri) unless @remotes.include?(uri)
- end
-
- def equivalent_remotes?(other_remotes)
- other_remotes.map(&method(:remove_auth)) == @remotes.map(&method(:remove_auth))
- end
-
- def replace_remotes(other_remotes, allow_equivalent = false)
- return false if other_remotes == @remotes
-
- equivalent = allow_equivalent && equivalent_remotes?(other_remotes)
-
- @remotes = []
- other_remotes.reverse_each do |r|
- add_remote r.to_s
- end
-
- !equivalent
- end
-
- def unmet_deps
- if @allow_remote && api_fetchers.any?
- remote_specs.unmet_dependency_names
- else
- []
- end
- end
-
- def fetchers
- @fetchers ||= remotes.map do |uri|
- remote = Source::Rubygems::Remote.new(uri)
- Bundler::Fetcher.new(remote)
- end
- end
-
- def double_check_for(unmet_dependency_names)
- return unless @allow_remote
- return unless api_fetchers.any?
-
- unmet_dependency_names = unmet_dependency_names.call
- unless unmet_dependency_names.nil?
- if api_fetchers.size <= 1
- # can't do this when there are multiple fetchers because then we might not fetch from _all_
- # of them
- unmet_dependency_names -= remote_specs.spec_names # avoid re-fetching things we've already gotten
- end
- return if unmet_dependency_names.empty?
- end
-
- Bundler.ui.debug "Double checking for #{unmet_dependency_names || "all specs (due to the size of the request)"} in #{self}"
-
- fetch_names(api_fetchers, unmet_dependency_names, specs, false)
- end
-
- def dependency_names_to_double_check
- names = []
- remote_specs.each do |spec|
- case spec
- when EndpointSpecification, Gem::Specification, StubSpecification, LazySpecification
- names.concat(spec.runtime_dependencies)
- when RemoteSpecification # from the full index
- return nil
- else
- raise "unhandled spec type (#{spec.inspect})"
- end
- end
- names.map!(&:name) if names
- names
- end
-
- protected
-
- def credless_remotes
- remotes.map(&method(:suppress_configured_credentials))
- end
-
- def remotes_for_spec(spec)
- specs.search_all(spec.name).inject([]) do |uris, s|
- uris << s.remote if s.remote
- uris
- end
- end
-
- def loaded_from(spec)
- "#{rubygems_dir}/specifications/#{spec.full_name}.gemspec"
- end
-
- def cached_gem(spec)
- cached_gem = cached_path(spec)
- unless cached_gem
- raise Bundler::GemNotFound, "Could not find #{spec.file_name} for installation"
- end
- cached_gem
- end
-
- def cached_path(spec)
- possibilities = @caches.map {|p| "#{p}/#{spec.file_name}" }
- possibilities.find {|p| File.exist?(p) }
- end
-
- def normalize_uri(uri)
- uri = uri.to_s
- uri = "#{uri}/" unless uri =~ %r{/$}
- require_relative "../vendored_uri"
- uri = Bundler::URI(uri)
- raise ArgumentError, "The source must be an absolute URI. For example:\n" \
- "source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(Bundler::URI::HTTP) && uri.host.nil?)
- uri
- end
-
- def suppress_configured_credentials(remote)
- remote_nouser = remove_auth(remote)
- if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
- remote_nouser
- else
- remote
- end
- end
-
- def remove_auth(remote)
- if remote.user || remote.password
- remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
- else
- remote.to_s
- end
- end
-
- def installed_specs
- @installed_specs ||= Index.build do |idx|
- Bundler.rubygems.all_specs.reverse_each do |spec|
- next if spec.name == "bundler"
- spec.source = self
- if Bundler.rubygems.spec_missing_extensions?(spec, false)
- Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
- next
- end
- idx << spec
- end
- end
- end
-
- def cached_specs
- @cached_specs ||= begin
- idx = installed_specs.dup
-
- Dir["#{cache_path}/*.gem"].each do |gemfile|
- next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
- s ||= Bundler.rubygems.spec_from_gem(gemfile)
- s.source = self
- if Bundler.rubygems.spec_missing_extensions?(s, false)
- Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
- next
- end
- idx << s
- end
-
- idx
- end
- end
-
- def api_fetchers
- fetchers.select {|f| f.use_api && f.fetchers.first.api_fetcher? }
- end
-
- def remote_specs
- @remote_specs ||= Index.build do |idx|
- index_fetchers = fetchers - api_fetchers
-
- # gather lists from non-api sites
- fetch_names(index_fetchers, nil, idx, false)
-
- # because ensuring we have all the gems we need involves downloading
- # the gemspecs of those gems, if the non-api sites contain more than
- # about 500 gems, we treat all sites as non-api for speed.
- allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT
- Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \
- " Downloading full index instead..." unless allow_api
-
- fetch_names(api_fetchers, allow_api && dependency_names, idx, false)
- end
- end
-
- def fetch_names(fetchers, dependency_names, index, override_dupes)
- fetchers.each do |f|
- if dependency_names
- Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
- index.use f.specs_with_retry(dependency_names, self), override_dupes
- Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
- else
- Bundler.ui.info "Fetching source index from #{f.uri}"
- index.use f.specs_with_retry(nil, self), override_dupes
- end
- end
- end
-
- def fetch_gem(spec)
- return false unless spec.remote
-
- spec.fetch_platform
-
- download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
- gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
-
- SharedHelpers.filesystem_access("#{download_path}/cache") do |p|
- FileUtils.mkdir_p(p)
- end
- download_gem(spec, download_path)
-
- if requires_sudo?
- SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
- Bundler.mkdir_p(p)
- end
- Bundler.sudo "mv #{download_path}/cache/#{spec.full_name}.gem #{gem_path}"
- end
-
- gem_path
- ensure
- Bundler.rm_rf(download_path) if requires_sudo?
- end
-
- def builtin_gem?(spec)
- # Ruby 2.1, where all included gems have this summary
- return true if spec.summary =~ /is bundled with Ruby/
-
- # Ruby 2.0, where gemspecs are stored in specifications/default/
- spec.loaded_from && spec.loaded_from.include?("specifications/default/")
- end
-
- def installed?(spec)
- installed_specs[spec].any?
- end
-
- def requires_sudo?
- Bundler.requires_sudo?
- end
-
- def rubygems_dir
- Bundler.rubygems.gem_dir
- end
-
- def cache_path
- Bundler.app_cache
- end
-
- private
-
- # Checks if the requested spec exists in the global cache. If it does,
- # we copy it to the download path, and if it does not, we download it.
- #
- # @param [Specification] spec
- # the spec we want to download or retrieve from the cache.
- #
- # @param [String] download_path
- # the local directory the .gem will end up in.
- #
- def download_gem(spec, download_path)
- local_path = File.join(download_path, "cache/#{spec.full_name}.gem")
-
- if (cache_path = download_cache_path(spec)) && cache_path.file?
- SharedHelpers.filesystem_access(local_path) do
- FileUtils.cp(cache_path, local_path)
- end
- else
- uri = spec.remote.uri
- Bundler.ui.confirm("Fetching #{version_message(spec)}")
- rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
- if rubygems_local_path != local_path
- FileUtils.mv(rubygems_local_path, local_path)
- end
- cache_globally(spec, local_path)
- end
- end
-
- # Checks if the requested spec exists in the global cache. If it does
- # not, we create the relevant global cache subdirectory if it does not
- # exist and copy the spec from the local cache to the global cache.
- #
- # @param [Specification] spec
- # the spec we want to copy to the global cache.
- #
- # @param [String] local_cache_path
- # the local directory from which we want to copy the .gem.
- #
- def cache_globally(spec, local_cache_path)
- return unless cache_path = download_cache_path(spec)
- return if cache_path.exist?
-
- SharedHelpers.filesystem_access(cache_path.dirname, &:mkpath)
- SharedHelpers.filesystem_access(cache_path) do
- FileUtils.cp(local_cache_path, cache_path)
- end
- end
-
- # Returns the global cache path of the calling Rubygems::Source object.
- #
- # Note that the Source determines the path's subdirectory. We use this
- # subdirectory in the global cache path so that gems with the same name
- # -- and possibly different versions -- from different sources are saved
- # to their respective subdirectories and do not override one another.
- #
- # @param [Gem::Specification] specification
- #
- # @return [Pathname] The global cache path.
- #
- def download_cache_path(spec)
- return unless Bundler.feature_flag.global_gem_cache?
- return unless remote = spec.remote
- return unless cache_slug = remote.cache_slug
-
- Bundler.user_cache.join("gems", cache_slug, spec.file_name)
- end
-
- def extension_cache_slug(spec)
- return unless remote = spec.remote
- remote.cache_slug
- end
- end
- end
-end
diff --git a/lib/bundler/source/rubygems/remote.rb b/lib/bundler/source/rubygems/remote.rb
deleted file mode 100644
index 45ea61acb2..0000000000
--- a/lib/bundler/source/rubygems/remote.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- class Rubygems
- class Remote
- attr_reader :uri, :anonymized_uri, :original_uri
-
- def initialize(uri)
- orig_uri = uri
- uri = Bundler.settings.mirror_for(uri)
- @original_uri = orig_uri if orig_uri != uri
- fallback_auth = Bundler.settings.credentials_for(uri)
-
- @uri = apply_auth(uri, fallback_auth).freeze
- @anonymized_uri = remove_auth(@uri).freeze
- end
-
- # @return [String] A slug suitable for use as a cache key for this
- # remote.
- #
- def cache_slug
- @cache_slug ||= begin
- return nil unless SharedHelpers.md5_available?
-
- cache_uri = original_uri || uri
-
- host = cache_uri.to_s.start_with?("file://") ? nil : cache_uri.host
-
- uri_parts = [host, cache_uri.user, cache_uri.port, cache_uri.path]
- uri_digest = SharedHelpers.digest(:MD5).hexdigest(uri_parts.compact.join("."))
-
- uri_parts[-1] = uri_digest
- uri_parts.compact.join(".")
- end
- end
-
- def to_s
- "rubygems remote at #{anonymized_uri}"
- end
-
- private
-
- def apply_auth(uri, auth)
- if auth && uri.userinfo.nil?
- uri = uri.dup
- uri.userinfo = auth
- end
-
- uri
- rescue Bundler::URI::InvalidComponentError
- error_message = "Please CGI escape your usernames and passwords before " \
- "setting them for authentication."
- raise HTTPError.new(error_message)
- end
-
- def remove_auth(uri)
- if uri.userinfo
- uri = uri.dup
- uri.user = uri.password = nil
- end
-
- uri
- end
- end
- end
- end
-end
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
deleted file mode 100644
index d3f649a12c..0000000000
--- a/lib/bundler/source_list.rb
+++ /dev/null
@@ -1,183 +0,0 @@
-# frozen_string_literal: true
-
-require "set"
-
-module Bundler
- class SourceList
- attr_reader :path_sources,
- :git_sources,
- :plugin_sources,
- :global_rubygems_source,
- :metadata_source
-
- def initialize
- @path_sources = []
- @git_sources = []
- @plugin_sources = []
- @global_rubygems_source = nil
- @rubygems_aggregate = rubygems_aggregate_class.new
- @rubygems_sources = []
- @metadata_source = Source::Metadata.new
- end
-
- def add_path_source(options = {})
- if options["gemspec"]
- add_source_to_list Source::Gemspec.new(options), path_sources
- else
- add_source_to_list Source::Path.new(options), path_sources
- end
- end
-
- def add_git_source(options = {})
- add_source_to_list(Source::Git.new(options), git_sources).tap do |source|
- warn_on_git_protocol(source)
- end
- end
-
- def add_rubygems_source(options = {})
- add_source_to_list Source::Rubygems.new(options), @rubygems_sources
- end
-
- def add_plugin_source(source, options = {})
- add_source_to_list Plugin.source(source).new(options), @plugin_sources
- end
-
- def global_rubygems_source=(uri)
- if Bundler.feature_flag.disable_multisource?
- @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri)
- end
- add_rubygems_remote(uri)
- end
-
- def add_rubygems_remote(uri)
- return if Bundler.feature_flag.disable_multisource?
- @rubygems_aggregate.add_remote(uri)
- @rubygems_aggregate
- end
-
- def default_source
- global_rubygems_source || @rubygems_aggregate
- end
-
- def rubygems_sources
- @rubygems_sources + [default_source]
- end
-
- def rubygems_remotes
- rubygems_sources.map(&:remotes).flatten.uniq
- end
-
- def all_sources
- path_sources + git_sources + plugin_sources + rubygems_sources + [metadata_source]
- end
-
- def get(source)
- source_list_for(source).find {|s| equal_source?(source, s) || equivalent_source?(source, s) }
- end
-
- def lock_sources
- lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
- if Bundler.feature_flag.disable_multisource?
- lock_sources + rubygems_sources.sort_by(&:to_s)
- else
- lock_sources << combine_rubygems_sources
- end
- end
-
- # Returns true if there are changes
- def replace_sources!(replacement_sources)
- return true if replacement_sources.empty?
-
- [path_sources, git_sources, plugin_sources].each do |source_list|
- source_list.map! do |source|
- replacement_sources.find {|s| s == source } || source
- end
- end
-
- replacement_rubygems = !Bundler.feature_flag.disable_multisource? &&
- replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
- @rubygems_aggregate = replacement_rubygems if replacement_rubygems
-
- return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
- return true if replacement_rubygems && rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
-
- false
- end
-
- def cached!
- all_sources.each(&:cached!)
- end
-
- def remote!
- all_sources.each(&:remote!)
- end
-
- def rubygems_primary_remotes
- @rubygems_aggregate.remotes
- end
-
- private
-
- def rubygems_aggregate_class
- Source::Rubygems
- end
-
- def add_source_to_list(source, list)
- list.unshift(source).uniq!
- source
- end
-
- def source_list_for(source)
- case source
- when Source::Git then git_sources
- when Source::Path then path_sources
- when Source::Rubygems then rubygems_sources
- when Plugin::API::Source then plugin_sources
- else raise ArgumentError, "Invalid source: #{source.inspect}"
- end
- end
-
- def combine_rubygems_sources
- Source::Rubygems.new("remotes" => rubygems_remotes)
- end
-
- def warn_on_git_protocol(source)
- return if Bundler.settings["git.allow_insecure"]
-
- if source.uri =~ /^git\:/
- Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
- "which transmits data without encryption. Disable this warning with " \
- "`bundle config set git.allow_insecure true`, or switch to the `https` " \
- "protocol to keep your data secure."
- end
- end
-
- def equal_sources?(lock_sources, replacement_sources)
- lock_sources.to_set == replacement_sources.to_set
- end
-
- def equal_source?(source, other_source)
- source == other_source
- end
-
- def equivalent_source?(source, other_source)
- return false unless Bundler.settings[:allow_deployment_source_credential_changes] && source.is_a?(Source::Rubygems)
-
- equivalent_rubygems_sources?([source], [other_source])
- end
-
- def equivalent_sources?(lock_sources, replacement_sources)
- return false unless Bundler.settings[:allow_deployment_source_credential_changes]
-
- lock_rubygems_sources, lock_other_sources = lock_sources.partition {|s| s.is_a?(Source::Rubygems) }
- replacement_rubygems_sources, replacement_other_sources = replacement_sources.partition {|s| s.is_a?(Source::Rubygems) }
-
- equivalent_rubygems_sources?(lock_rubygems_sources, replacement_rubygems_sources) && equal_sources?(lock_other_sources, replacement_other_sources)
- end
-
- def equivalent_rubygems_sources?(lock_sources, replacement_sources)
- actual_remotes = replacement_sources.map(&:remotes).flatten.uniq
- lock_sources.all? {|s| s.equivalent_remotes?(actual_remotes) }
- end
- end
-end
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
deleted file mode 100644
index 463113ef8e..0000000000
--- a/lib/bundler/spec_set.rb
+++ /dev/null
@@ -1,203 +0,0 @@
-# frozen_string_literal: true
-
-require "tsort"
-require "set"
-
-module Bundler
- class SpecSet
- include Enumerable
- include TSort
-
- def initialize(specs)
- @specs = specs
- end
-
- def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
- handled = Set.new
- deps = dependencies.dup
- specs = []
- skip += ["bundler"]
-
- loop do
- break unless dep = deps.shift
- next if !handled.add?(dep) || skip.include?(dep.name)
-
- if spec = spec_for_dependency(dep, match_current_platform)
- specs << spec
-
- spec.dependencies.each do |d|
- next if d.type == :development
- d = DepProxy.new(d, dep.__platform) unless match_current_platform
- deps << d
- end
- elsif check
- return false
- elsif raise_on_missing
- others = lookup[dep.name] if match_current_platform
- message = "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?"
- message += " Found #{others.join(", ")} that did not match the current platform." if others && !others.empty?
- raise GemNotFound, message
- end
- end
-
- if spec = lookup["bundler"].first
- specs << spec
- end
-
- check ? true : SpecSet.new(specs)
- end
-
- def valid_for?(deps)
- self.for(deps, [], true)
- end
-
- def [](key)
- key = key.name if key.respond_to?(:name)
- lookup[key].reverse
- end
-
- def []=(key, value)
- @specs << value
- @lookup = nil
- @sorted = nil
- end
-
- def sort!
- self
- end
-
- def to_a
- sorted.dup
- end
-
- def to_hash
- lookup.dup
- end
-
- def materialize(deps, missing_specs = nil)
- materialized = self.for(deps, [], false, true, !missing_specs).to_a
- deps = materialized.map(&:name).uniq
- materialized.map! do |s|
- next s unless s.is_a?(LazySpecification)
- s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
- spec = s.__materialize__
- unless spec
- unless missing_specs
- raise GemNotFound, "Could not find #{s.full_name} in any of the sources"
- end
- missing_specs << s
- end
- spec
- end
- SpecSet.new(missing_specs ? materialized.compact : materialized)
- end
-
- # Materialize for all the specs in the spec set, regardless of what platform they're for
- # This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
- # @return [Array<Gem::Specification>]
- def materialized_for_all_platforms
- names = @specs.map(&:name).uniq
- @specs.map do |s|
- next s unless s.is_a?(LazySpecification)
- s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
- spec = s.__materialize__
- raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
- spec
- end
- end
-
- def merge(set)
- arr = sorted.dup
- set.each do |set_spec|
- full_name = set_spec.full_name
- next if arr.any? {|spec| spec.full_name == full_name }
- arr << set_spec
- end
- SpecSet.new(arr)
- end
-
- def find_by_name_and_platform(name, platform)
- @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
- end
-
- def what_required(spec)
- unless req = find {|s| s.dependencies.any? {|d| d.type == :runtime && d.name == spec.name } }
- return [spec]
- end
- what_required(req) << spec
- end
-
- def <<(spec)
- @specs << spec
- end
-
- def length
- @specs.length
- end
-
- def size
- @specs.size
- end
-
- def empty?
- @specs.empty?
- end
-
- def each(&b)
- sorted.each(&b)
- end
-
- private
-
- def sorted
- rake = @specs.find {|s| s.name == "rake" }
- begin
- @sorted ||= ([rake] + tsort).compact.uniq
- rescue TSort::Cyclic => error
- cgems = extract_circular_gems(error)
- raise CyclicDependencyError, "Your bundle requires gems that depend" \
- " on each other, creating an infinite loop. Please remove either" \
- " gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
- end
- end
-
- def extract_circular_gems(error)
- error.message.scan(/@name="(.*?)"/).flatten
- end
-
- def lookup
- @lookup ||= begin
- lookup = Hash.new {|h, k| h[k] = [] }
- Index.sort_specs(@specs).reverse_each do |s|
- lookup[s.name] << s
- end
- lookup
- end
- end
-
- def tsort_each_node
- # MUST sort by name for backwards compatibility
- @specs.sort_by(&:name).each {|s| yield s }
- end
-
- def spec_for_dependency(dep, match_current_platform)
- specs_for_platforms = lookup[dep.name]
- if match_current_platform
- Bundler.rubygems.platforms.reverse_each do |pl|
- match = GemHelpers.select_best_platform_match(specs_for_platforms, pl)
- return match if match
- end
- nil
- else
- GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
- end
- end
-
- def tsort_each_child(s)
- s.dependencies.sort_by(&:name).each do |d|
- next if d.type == :development
- lookup[d.name].each {|s2| yield s2 }
- end
- end
- end
-end
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb
deleted file mode 100644
index d45f80a80a..0000000000
--- a/lib/bundler/stub_specification.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "remote_specification"
-
-module Bundler
- class StubSpecification < RemoteSpecification
- def self.from_stub(stub)
- return stub if stub.is_a?(Bundler::StubSpecification)
- spec = new(stub.name, stub.version, stub.platform, nil)
- spec.stub = stub
- spec
- end
-
- attr_accessor :stub, :ignored
-
- def source=(source)
- super
- # Stub has no concept of source, which means that extension_dir may be wrong
- # This is the case for git-based gems. So, instead manually assign the extension dir
- return unless source.respond_to?(:extension_dir_name)
- path = File.join(stub.extensions_dir, source.extension_dir_name)
- stub.extension_dir = File.expand_path(path)
- end
-
- def to_yaml
- _remote_specification.to_yaml
- end
-
- # @!group Stub Delegates
-
- # This is defined directly to avoid having to load every installed spec
- def missing_extensions?
- stub.missing_extensions?
- end
-
- def activated
- stub.activated
- end
-
- def activated=(activated)
- stub.instance_variable_set(:@activated, activated)
- end
-
- def default_gem
- stub.default_gem
- end
-
- def full_gem_path
- # deleted gems can have their stubs return nil, so in that case grab the
- # expired path from the full spec
- stub.full_gem_path || method_missing(:full_gem_path)
- end
-
- def full_require_paths
- stub.full_require_paths
- end
-
- def load_paths
- full_require_paths
- end
-
- def loaded_from
- stub.loaded_from
- end
-
- def matches_for_glob(glob)
- stub.matches_for_glob(glob)
- end
-
- def raw_require_paths
- stub.raw_require_paths
- end
-
- private
-
- def _remote_specification
- @_remote_specification ||= begin
- rs = stub.to_spec
- if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs
- rs = Gem::Specification.load(loaded_from)
- Bundler.rubygems.stub_set_spec(stub, rs)
- end
-
- unless rs
- raise GemspecError, "The gemspec for #{full_name} at #{loaded_from}" \
- " was missing or broken. Try running `gem pristine #{name} -v #{version}`" \
- " to fix the cached spec."
- end
-
- rs.source = source
-
- rs
- end
- end
- end
-end
diff --git a/lib/bundler/templates/.document b/lib/bundler/templates/.document
deleted file mode 100644
index fb66f13c33..0000000000
--- a/lib/bundler/templates/.document
+++ /dev/null
@@ -1 +0,0 @@
-# Ignore all files in this directory
diff --git a/lib/bundler/templates/Executable b/lib/bundler/templates/Executable
deleted file mode 100644
index 3e8d5b317a..0000000000
--- a/lib/bundler/templates/Executable
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application '<%= executable %>' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
- Pathname.new(__FILE__).realpath)
-
-bundle_binstub = File.expand_path("../bundle", __FILE__)
-
-if File.file?(bundle_binstub)
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
- load(bundle_binstub)
- else
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
-Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
- end
-end
-
-require "rubygems"
-require "bundler/setup"
-
-load Gem.bin_path("<%= spec.name %>", "<%= executable %>")
diff --git a/lib/bundler/templates/Executable.bundler b/lib/bundler/templates/Executable.bundler
deleted file mode 100644
index 69f26bb9c0..0000000000
--- a/lib/bundler/templates/Executable.bundler
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
-# frozen_string_literal: true
-
-#
-# This file was generated by Bundler.
-#
-# The application '<%= executable %>' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "rubygems"
-
-m = Module.new do
- module_function
-
- def invoked_as_script?
- File.expand_path($0) == File.expand_path(__FILE__)
- end
-
- def env_var_version
- ENV["BUNDLER_VERSION"]
- end
-
- def cli_arg_version
- return unless invoked_as_script? # don't want to hijack other binstubs
- return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
- 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
- update_index = i
- end
- bundler_version
- end
-
- def gemfile
- gemfile = ENV["BUNDLE_GEMFILE"]
- return gemfile if gemfile && !gemfile.empty?
-
- File.expand_path("../<%= relative_gemfile_path %>", __FILE__)
- end
-
- def lockfile
- lockfile =
- case File.basename(gemfile)
- when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
- else "#{gemfile}.lock"
- end
- File.expand_path(lockfile)
- end
-
- def lockfile_version
- return unless File.file?(lockfile)
- lockfile_contents = File.read(lockfile)
- return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
- Regexp.last_match(1)
- end
-
- def bundler_version
- @bundler_version ||=
- env_var_version || cli_arg_version ||
- lockfile_version
- end
-
- def bundler_requirement
- return "#{Gem::Requirement.default}.a" unless bundler_version
-
- bundler_gem_version = Gem::Version.new(bundler_version)
-
- requirement = bundler_gem_version.approximate_recommendation
-
- return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
-
- requirement += ".a" if bundler_gem_version.prerelease?
-
- requirement
- end
-
- def load_bundler!
- ENV["BUNDLE_GEMFILE"] ||= gemfile
-
- activate_bundler
- end
-
- def activate_bundler
- gem_error = activation_error_handling do
- gem "bundler", bundler_requirement
- end
- return if gem_error.nil?
- require_error = activation_error_handling do
- require "bundler/version"
- end
- return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
- warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
- exit 42
- end
-
- def activation_error_handling
- yield
- nil
- rescue StandardError, LoadError => e
- e
- end
-end
-
-m.load_bundler!
-
-if m.invoked_as_script?
- load Gem.bin_path("<%= spec.name %>", "<%= executable %>")
-end
diff --git a/lib/bundler/templates/Executable.standalone b/lib/bundler/templates/Executable.standalone
deleted file mode 100644
index 4bf0753f44..0000000000
--- a/lib/bundler/templates/Executable.standalone
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG["ruby_install_name"] %>
-#
-# This file was generated by Bundler.
-#
-# The application '<%= executable %>' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require "pathname"
-path = Pathname.new(__FILE__)
-$:.unshift File.expand_path "../<%= standalone_path %>", path.realpath
-
-require "bundler/setup"
-load File.expand_path "../<%= executable_path %>", path.realpath
diff --git a/lib/bundler/templates/Gemfile b/lib/bundler/templates/Gemfile
deleted file mode 100644
index 1afd2cce67..0000000000
--- a/lib/bundler/templates/Gemfile
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# gem "rails"
diff --git a/lib/bundler/templates/gems.rb b/lib/bundler/templates/gems.rb
deleted file mode 100644
index 547cd6e8d9..0000000000
--- a/lib/bundler/templates/gems.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-# A sample gems.rb
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# gem "rails"
diff --git a/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt b/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt
deleted file mode 100644
index 7dfd14aab9..0000000000
--- a/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt
+++ /dev/null
@@ -1,74 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as
-contributors and maintainers pledge to making participation in our project and
-our community a harassment-free experience for everyone, regardless of age, body
-size, disability, ethnicity, gender identity and expression, level of experience,
-nationality, personal appearance, race, religion, or sexual identity and
-orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment
-include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or
-advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
- address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
- professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable
-behavior and are expected to take appropriate and fair corrective action in
-response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or
-reject comments, commits, code, wiki edits, issues, and other contributions
-that are not aligned to this Code of Conduct, or to ban temporarily or
-permanently any contributor for other behaviors that they deem inappropriate,
-threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces
-when an individual is representing the project or its community. Examples of
-representing a project or community include using an official project e-mail
-address, posting via an official social media account, or acting as an appointed
-representative at an online or offline event. Representation of a project may be
-further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at <%= config[:email] %>. All
-complaints will be reviewed and investigated and will result in a response that
-is deemed necessary and appropriate to the circumstances. The project team is
-obligated to maintain confidentiality with regard to the reporter of an incident.
-Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good
-faith may face temporary or permanent repercussions as determined by other
-members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
-available at [https://contributor-covenant.org/version/1/4][version]
-
-[homepage]: https://contributor-covenant.org
-[version]: https://contributor-covenant.org/version/1/4/
diff --git a/lib/bundler/templates/newgem/Gemfile.tt b/lib/bundler/templates/newgem/Gemfile.tt
deleted file mode 100644
index 83878ec7f8..0000000000
--- a/lib/bundler/templates/newgem/Gemfile.tt
+++ /dev/null
@@ -1,12 +0,0 @@
-source "https://rubygems.org"
-
-# Specify your gem's dependencies in <%= config[:name] %>.gemspec
-gemspec
-
-gem "rake", "~> 12.0"
-<%- if config[:ext] -%>
-gem "rake-compiler"
-<%- end -%>
-<%- if config[:test] -%>
-gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
-<%- end -%>
diff --git a/lib/bundler/templates/newgem/LICENSE.txt.tt b/lib/bundler/templates/newgem/LICENSE.txt.tt
deleted file mode 100644
index 76ef4b0191..0000000000
--- a/lib/bundler/templates/newgem/LICENSE.txt.tt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) <%= Time.now.year %> <%= config[:author] %>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/lib/bundler/templates/newgem/README.md.tt b/lib/bundler/templates/newgem/README.md.tt
deleted file mode 100644
index c2f5f9dca7..0000000000
--- a/lib/bundler/templates/newgem/README.md.tt
+++ /dev/null
@@ -1,48 +0,0 @@
-# <%= config[:constant_name] %>
-
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%= config[:namespaced_path] %>`. To experiment with that code, run `bin/console` for an interactive prompt.
-
-TODO: Delete this and the text above, and describe your gem
-
-## Installation
-
-Add this line to your application's Gemfile:
-
-```ruby
-gem '<%= config[:name] %>'
-```
-
-And then execute:
-
- $ bundle install
-
-Or install it yourself as:
-
- $ gem install <%= config[:name] %>
-
-## Usage
-
-TODO: Write usage instructions here
-
-## Development
-
-After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test].sub('mini', '').sub('rspec', 'spec') %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
-
-To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
-
-## Contributing
-
-Bug reports and pull requests are welcome on GitHub at https://github.com/<%= config[:github_username] %>/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).<% end %>
-
-<% if config[:mit] -%>
-
-## License
-
-The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
-<% end -%>
-<% if config[:coc] -%>
-
-## Code of Conduct
-
-Everyone interacting in the <%= config[:constant_name] %> project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/<%= config[:github_username] %>/<%= config[:name] %>/blob/master/CODE_OF_CONDUCT.md).
-<% end -%>
diff --git a/lib/bundler/templates/newgem/Rakefile.tt b/lib/bundler/templates/newgem/Rakefile.tt
deleted file mode 100644
index 099da6f3ec..0000000000
--- a/lib/bundler/templates/newgem/Rakefile.tt
+++ /dev/null
@@ -1,29 +0,0 @@
-require "bundler/gem_tasks"
-<% if config[:test] == "minitest" -%>
-require "rake/testtask"
-
-Rake::TestTask.new(:test) do |t|
- t.libs << "test"
- t.libs << "lib"
- t.test_files = FileList["test/**/*_test.rb"]
-end
-
-<% elsif config[:test] == "rspec" -%>
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-<% end -%>
-<% if config[:ext] -%>
-require "rake/extensiontask"
-
-task :build => :compile
-
-Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext|
- ext.lib_dir = "lib/<%= config[:namespaced_path] %>"
-end
-
-task :default => [:clobber, :compile, :<%= config[:test_task] %>]
-<% else -%>
-task :default => :<%= config[:test_task] %>
-<% end -%>
diff --git a/lib/bundler/templates/newgem/bin/console.tt b/lib/bundler/templates/newgem/bin/console.tt
deleted file mode 100644
index a27f82430f..0000000000
--- a/lib/bundler/templates/newgem/bin/console.tt
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "<%= config[:namespaced_path] %>"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/lib/bundler/templates/newgem/bin/setup.tt b/lib/bundler/templates/newgem/bin/setup.tt
deleted file mode 100644
index dce67d860a..0000000000
--- a/lib/bundler/templates/newgem/bin/setup.tt
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle install
-
-# Do any other automated setup that you need to do here
diff --git a/lib/bundler/templates/newgem/exe/newgem.tt b/lib/bundler/templates/newgem/exe/newgem.tt
deleted file mode 100644
index a8339bb79f..0000000000
--- a/lib/bundler/templates/newgem/exe/newgem.tt
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-
-require "<%= config[:namespaced_path] %>"
diff --git a/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt b/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt
deleted file mode 100644
index 8cfc828f94..0000000000
--- a/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt
+++ /dev/null
@@ -1,3 +0,0 @@
-require "mkmf"
-
-create_makefile(<%= config[:makefile_path].inspect %>)
diff --git a/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt b/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
deleted file mode 100644
index 8177c4d202..0000000000
--- a/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "<%= config[:underscored_name] %>.h"
-
-VALUE rb_m<%= config[:constant_array].join %>;
-
-void
-Init_<%= config[:underscored_name] %>(void)
-{
- rb_m<%= config[:constant_array].join %> = rb_define_module(<%= config[:constant_name].inspect %>);
-}
diff --git a/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt b/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
deleted file mode 100644
index c6e420b66e..0000000000
--- a/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef <%= config[:underscored_name].upcase %>_H
-#define <%= config[:underscored_name].upcase %>_H 1
-
-#include "ruby.h"
-
-#endif /* <%= config[:underscored_name].upcase %>_H */
diff --git a/lib/bundler/templates/newgem/gitignore.tt b/lib/bundler/templates/newgem/gitignore.tt
deleted file mode 100644
index b1c9f9986c..0000000000
--- a/lib/bundler/templates/newgem/gitignore.tt
+++ /dev/null
@@ -1,20 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-<%- if config[:ext] -%>
-*.bundle
-*.so
-*.o
-*.a
-mkmf.log
-<%- end -%>
-<%- if config[:test] == "rspec" -%>
-
-# rspec failure tracking
-.rspec_status
-<%- end -%>
diff --git a/lib/bundler/templates/newgem/lib/newgem.rb.tt b/lib/bundler/templates/newgem/lib/newgem.rb.tt
deleted file mode 100644
index fae6337c3e..0000000000
--- a/lib/bundler/templates/newgem/lib/newgem.rb.tt
+++ /dev/null
@@ -1,13 +0,0 @@
-require "<%= config[:namespaced_path] %>/version"
-<%- if config[:ext] -%>
-require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>"
-<%- end -%>
-
-<%- config[:constant_array].each_with_index do |c, i| -%>
-<%= " " * i %>module <%= c %>
-<%- end -%>
-<%= " " * config[:constant_array].size %>class Error < StandardError; end
-<%= " " * config[:constant_array].size %># Your code goes here...
-<%- (config[:constant_array].size-1).downto(0) do |i| -%>
-<%= " " * i %>end
-<%- end -%>
diff --git a/lib/bundler/templates/newgem/lib/newgem/version.rb.tt b/lib/bundler/templates/newgem/lib/newgem/version.rb.tt
deleted file mode 100644
index 389daf5048..0000000000
--- a/lib/bundler/templates/newgem/lib/newgem/version.rb.tt
+++ /dev/null
@@ -1,7 +0,0 @@
-<%- config[:constant_array].each_with_index do |c, i| -%>
-<%= " " * i %>module <%= c %>
-<%- end -%>
-<%= " " * config[:constant_array].size %>VERSION = "0.1.0"
-<%- (config[:constant_array].size-1).downto(0) do |i| -%>
-<%= " " * i %>end
-<%- end -%>
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
deleted file mode 100644
index 9bb3d0ff50..0000000000
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ /dev/null
@@ -1,34 +0,0 @@
-require_relative 'lib/<%=config[:namespaced_path]%>/version'
-
-Gem::Specification.new do |spec|
- spec.name = <%= config[:name].inspect %>
- spec.version = <%= config[:constant_name] %>::VERSION
- spec.authors = [<%= config[:author].inspect %>]
- spec.email = [<%= config[:email].inspect %>]
-
- spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.}
- spec.description = %q{TODO: Write a longer description or delete this line.}
- spec.homepage = "TODO: Put your gem's website or public repo URL here."
-<%- if config[:mit] -%>
- spec.license = "MIT"
-<%- end -%>
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
-
- spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
- spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
-
- # Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-<%- if config[:ext] -%>
- spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
-<%- end -%>
-end
diff --git a/lib/bundler/templates/newgem/rspec.tt b/lib/bundler/templates/newgem/rspec.tt
deleted file mode 100644
index 34c5164d9b..0000000000
--- a/lib/bundler/templates/newgem/rspec.tt
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt b/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
deleted file mode 100644
index c63b487830..0000000000
--- a/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
+++ /dev/null
@@ -1,9 +0,0 @@
-RSpec.describe <%= config[:constant_name] %> do
- it "has a version number" do
- expect(<%= config[:constant_name] %>::VERSION).not_to be nil
- end
-
- it "does something useful" do
- expect(false).to eq(true)
- end
-end
diff --git a/lib/bundler/templates/newgem/spec/spec_helper.rb.tt b/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
deleted file mode 100644
index 805cf57e01..0000000000
--- a/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "<%= config[:namespaced_path] %>"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/lib/bundler/templates/newgem/test/newgem_test.rb.tt b/lib/bundler/templates/newgem/test/newgem_test.rb.tt
deleted file mode 100644
index f2af9f90e0..0000000000
--- a/lib/bundler/templates/newgem/test/newgem_test.rb.tt
+++ /dev/null
@@ -1,11 +0,0 @@
-require "test_helper"
-
-class <%= config[:constant_name] %>Test < Minitest::Test
- def test_that_it_has_a_version_number
- refute_nil ::<%= config[:constant_name] %>::VERSION
- end
-
- def test_it_does_something_useful
- assert false
- end
-end
diff --git a/lib/bundler/templates/newgem/test/test_helper.rb.tt b/lib/bundler/templates/newgem/test/test_helper.rb.tt
deleted file mode 100644
index 7d7db165ec..0000000000
--- a/lib/bundler/templates/newgem/test/test_helper.rb.tt
+++ /dev/null
@@ -1,4 +0,0 @@
-$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
-require "<%= config[:namespaced_path] %>"
-
-require "minitest/autorun"
diff --git a/lib/bundler/templates/newgem/travis.yml.tt b/lib/bundler/templates/newgem/travis.yml.tt
deleted file mode 100644
index eab16addca..0000000000
--- a/lib/bundler/templates/newgem/travis.yml.tt
+++ /dev/null
@@ -1,6 +0,0 @@
----
-language: ruby
-cache: bundler
-rvm:
- - <%= RUBY_VERSION %>
-before_install: gem install bundler -v <%= Bundler::VERSION %>
diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb
deleted file mode 100644
index 7a4fa03669..0000000000
--- a/lib/bundler/ui.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module UI
- autoload :RGProxy, File.expand_path("ui/rg_proxy", __dir__)
- autoload :Shell, File.expand_path("ui/shell", __dir__)
- autoload :Silent, File.expand_path("ui/silent", __dir__)
- end
-end
diff --git a/lib/bundler/ui/rg_proxy.rb b/lib/bundler/ui/rg_proxy.rb
deleted file mode 100644
index ef6def225b..0000000000
--- a/lib/bundler/ui/rg_proxy.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../ui"
-require "rubygems/user_interaction"
-
-module Bundler
- module UI
- class RGProxy < ::Gem::SilentUI
- def initialize(ui)
- @ui = ui
- super()
- end
-
- def say(message)
- @ui && @ui.debug(message)
- end
- end
- end
-end
diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
deleted file mode 100644
index 92476be7d2..0000000000
--- a/lib/bundler/ui/shell.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "../vendored_thor"
-
-module Bundler
- module UI
- class Shell
- LEVELS = %w[silent error warn confirm info debug].freeze
-
- attr_writer :shell
-
- def initialize(options = {})
- Thor::Base.shell = options["no-color"] ? Thor::Shell::Basic : nil
- @shell = Thor::Base.shell.new
- @level = ENV["DEBUG"] ? "debug" : "info"
- @warning_history = []
- end
-
- def add_color(string, *color)
- @shell.set_color(string, *color)
- end
-
- def info(msg, newline = nil)
- tell_me(msg, nil, newline) if level("info")
- end
-
- def confirm(msg, newline = nil)
- tell_me(msg, :green, newline) if level("confirm")
- end
-
- def warn(msg, newline = nil)
- return unless level("warn")
- return if @warning_history.include? msg
- @warning_history << msg
-
- tell_err(msg, :yellow, newline)
- end
-
- def error(msg, newline = nil)
- return unless level("error")
- tell_err(msg, :red, newline)
- end
-
- def debug(msg, newline = nil)
- tell_me(msg, nil, newline) if debug?
- end
-
- def debug?
- level("debug")
- end
-
- def quiet?
- level("quiet")
- end
-
- def ask(msg)
- @shell.ask(msg)
- end
-
- def yes?(msg)
- @shell.yes?(msg)
- end
-
- def no?
- @shell.no?(msg)
- end
-
- def level=(level)
- raise ArgumentError unless LEVELS.include?(level.to_s)
- @level = level.to_s
- end
-
- def level(name = nil)
- return @level unless name
- unless index = LEVELS.index(name)
- raise "#{name.inspect} is not a valid level"
- end
- index <= LEVELS.index(@level)
- end
-
- def trace(e, newline = nil, force = false)
- return unless debug? || force
- msg = "#{e.class}: #{e.message}\n#{e.backtrace.join("\n ")}"
- tell_me(msg, nil, newline)
- end
-
- def silence(&blk)
- with_level("silent", &blk)
- end
-
- def unprinted_warnings
- []
- end
-
- private
-
- # valimism
- def tell_me(msg, color = nil, newline = nil)
- msg = word_wrap(msg) if newline.is_a?(Hash) && newline[:wrap]
- if newline.nil?
- @shell.say(msg, color)
- else
- @shell.say(msg, color, newline)
- end
- end
-
- def tell_err(message, color = nil, newline = nil)
- return if @shell.send(:stderr).closed?
-
- newline ||= message.to_s !~ /( |\t)\Z/
- message = word_wrap(message) if newline.is_a?(Hash) && newline[:wrap]
-
- color = nil if color && !$stderr.tty?
-
- buffer = @shell.send(:prepare_message, message, *color)
- buffer << "\n" if newline && !message.to_s.end_with?("\n")
-
- @shell.send(:stderr).print(buffer)
- @shell.send(:stderr).flush
- end
-
- def strip_leading_spaces(text)
- spaces = text[/\A\s+/, 0]
- spaces ? text.gsub(/#{spaces}/, "") : text
- end
-
- def word_wrap(text, line_width = @shell.terminal_width)
- strip_leading_spaces(text).split("\n").collect do |line|
- line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line
- end * "\n"
- end
-
- def with_level(level)
- original = @level
- @level = level
- yield
- ensure
- @level = original
- end
- end
- end
-end
diff --git a/lib/bundler/ui/silent.rb b/lib/bundler/ui/silent.rb
deleted file mode 100644
index dca1b2ac86..0000000000
--- a/lib/bundler/ui/silent.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module UI
- class Silent
- attr_writer :shell
-
- def initialize
- @warnings = []
- end
-
- def add_color(string, color)
- string
- end
-
- def info(message, newline = nil)
- end
-
- def confirm(message, newline = nil)
- end
-
- def warn(message, newline = nil)
- @warnings |= [message]
- end
-
- def error(message, newline = nil)
- end
-
- def debug(message, newline = nil)
- end
-
- def debug?
- false
- end
-
- def quiet?
- false
- end
-
- def ask(message)
- end
-
- def yes?(msg)
- raise "Cannot ask yes? with a silent shell"
- end
-
- def no?
- raise "Cannot ask no? with a silent shell"
- end
-
- def level=(name)
- end
-
- def level(name = nil)
- end
-
- def trace(message, newline = nil, force = false)
- end
-
- def silence
- yield
- end
-
- def unprinted_warnings
- @warnings
- end
- end
- end
-end
diff --git a/lib/bundler/uri_credentials_filter.rb b/lib/bundler/uri_credentials_filter.rb
deleted file mode 100644
index 9b9e9c2799..0000000000
--- a/lib/bundler/uri_credentials_filter.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module URICredentialsFilter
- module_function
-
- def credential_filtered_uri(uri_to_anonymize)
- return uri_to_anonymize if uri_to_anonymize.nil?
- uri = uri_to_anonymize.dup
- if uri.is_a?(String)
- require_relative "vendored_uri"
- uri = Bundler::URI(uri)
- end
-
- if uri.userinfo
- # oauth authentication
- if uri.password == "x-oauth-basic" || uri.password == "x"
- # URI as string does not display with password if no user is set
- oauth_designation = uri.password
- uri.user = oauth_designation
- end
- uri.password = nil
- end
- return uri.to_s if uri_to_anonymize.is_a?(String)
- uri
- rescue Bundler::URI::InvalidURIError # uri is not canonical uri scheme
- uri
- end
-
- def credential_filtered_string(str_to_filter, uri)
- return str_to_filter if uri.nil? || str_to_filter.nil?
- str_with_no_credentials = str_to_filter.dup
- anonymous_uri_str = credential_filtered_uri(uri).to_s
- uri_str = uri.to_s
- if anonymous_uri_str != uri_str
- str_with_no_credentials = str_with_no_credentials.gsub(uri_str, anonymous_uri_str)
- end
- str_with_no_credentials
- end
- end
-end
diff --git a/lib/bundler/vendor/connection_pool/lib/connection_pool.rb b/lib/bundler/vendor/connection_pool/lib/connection_pool.rb
deleted file mode 100644
index fbcd26c765..0000000000
--- a/lib/bundler/vendor/connection_pool/lib/connection_pool.rb
+++ /dev/null
@@ -1,161 +0,0 @@
-require_relative 'connection_pool/version'
-require_relative 'connection_pool/timed_stack'
-
-
-# Generic connection pool class for e.g. sharing a limited number of network connections
-# among many threads. Note: Connections are lazily created.
-#
-# Example usage with block (faster):
-#
-# @pool = Bundler::ConnectionPool.new { Redis.new }
-#
-# @pool.with do |redis|
-# redis.lpop('my-list') if redis.llen('my-list') > 0
-# end
-#
-# Using optional timeout override (for that single invocation)
-#
-# @pool.with(timeout: 2.0) do |redis|
-# redis.lpop('my-list') if redis.llen('my-list') > 0
-# end
-#
-# Example usage replacing an existing connection (slower):
-#
-# $redis = Bundler::ConnectionPool.wrap { Redis.new }
-#
-# def do_work
-# $redis.lpop('my-list') if $redis.llen('my-list') > 0
-# end
-#
-# Accepts the following options:
-# - :size - number of connections to pool, defaults to 5
-# - :timeout - amount of time to wait for a connection if none currently available, defaults to 5 seconds
-#
-class Bundler::ConnectionPool
- DEFAULTS = {size: 5, timeout: 5}
-
- class Error < RuntimeError
- end
-
- def self.wrap(options, &block)
- Wrapper.new(options, &block)
- end
-
- def initialize(options = {}, &block)
- raise ArgumentError, 'Connection pool requires a block' unless block
-
- options = DEFAULTS.merge(options)
-
- @size = options.fetch(:size)
- @timeout = options.fetch(:timeout)
-
- @available = TimedStack.new(@size, &block)
- @key = :"current-#{@available.object_id}"
- @key_count = :"current-#{@available.object_id}-count"
- end
-
-if Thread.respond_to?(:handle_interrupt)
-
- # MRI
- def with(options = {})
- Thread.handle_interrupt(Exception => :never) do
- conn = checkout(options)
- begin
- Thread.handle_interrupt(Exception => :immediate) do
- yield conn
- end
- ensure
- checkin
- end
- end
- end
-
-else
-
- # jruby 1.7.x
- def with(options = {})
- conn = checkout(options)
- begin
- yield conn
- ensure
- checkin
- end
- end
-
-end
-
- def checkout(options = {})
- if ::Thread.current[@key]
- ::Thread.current[@key_count]+= 1
- ::Thread.current[@key]
- else
- ::Thread.current[@key_count]= 1
- ::Thread.current[@key]= @available.pop(options[:timeout] || @timeout)
- end
- end
-
- def checkin
- if ::Thread.current[@key]
- if ::Thread.current[@key_count] == 1
- @available.push(::Thread.current[@key])
- ::Thread.current[@key]= nil
- else
- ::Thread.current[@key_count]-= 1
- end
- else
- raise Bundler::ConnectionPool::Error, 'no connections are checked out'
- end
-
- nil
- end
-
- def shutdown(&block)
- @available.shutdown(&block)
- end
-
- # Size of this connection pool
- def size
- @size
- end
-
- # Number of pool entries available for checkout at this instant.
- def available
- @available.length
- end
-
- private
-
- class Wrapper < ::BasicObject
- METHODS = [:with, :pool_shutdown]
-
- def initialize(options = {}, &block)
- @pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
- end
-
- def with(&block)
- @pool.with(&block)
- end
-
- def pool_shutdown(&block)
- @pool.shutdown(&block)
- end
-
- def pool_size
- @pool.size
- end
-
- def pool_available
- @pool.available
- end
-
- def respond_to?(id, *args)
- METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
- end
-
- def method_missing(name, *args, &block)
- with do |connection|
- connection.send(name, *args, &block)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb b/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb
deleted file mode 100644
index 5a9c4a27bb..0000000000
--- a/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# Global monotonic clock from Concurrent Ruby 1.0.
-# Copyright (c) Jerry D'Antonio -- released under the MIT license.
-# Slightly modified; used with permission.
-# https://github.com/ruby-concurrency/concurrent-ruby
-
-require 'thread'
-
-class Bundler::ConnectionPool
-
- class_definition = Class.new do
-
- if defined?(Process::CLOCK_MONOTONIC)
-
- # @!visibility private
- def get_time
- Process.clock_gettime(Process::CLOCK_MONOTONIC)
- end
-
- elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
-
- # @!visibility private
- def get_time
- java.lang.System.nanoTime() / 1_000_000_000.0
- end
-
- else
-
- # @!visibility private
- def initialize
- @mutex = Mutex.new
- @last_time = Time.now.to_f
- end
-
- # @!visibility private
- def get_time
- @mutex.synchronize do
- now = Time.now.to_f
- if @last_time < now
- @last_time = now
- else # clock has moved back in time
- @last_time += 0.000_001
- end
- end
- end
- end
- end
-
- ##
- # Clock that cannot be set and represents monotonic time since
- # some unspecified starting point.
- #
- # @!visibility private
- GLOBAL_MONOTONIC_CLOCK = class_definition.new
- private_constant :GLOBAL_MONOTONIC_CLOCK
-
- class << self
- ##
- # Returns the current time a tracked by the application monotonic clock.
- #
- # @return [Float] The current monotonic time when `since` not given else
- # the elapsed monotonic time between `since` and the current time
- def monotonic_time
- GLOBAL_MONOTONIC_CLOCK.get_time
- end
- end
-end
diff --git a/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb b/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
deleted file mode 100644
index f3fe1e04ad..0000000000
--- a/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
+++ /dev/null
@@ -1,176 +0,0 @@
-require 'thread'
-require 'timeout'
-require_relative 'monotonic_time'
-
-##
-# Raised when you attempt to retrieve a connection from a pool that has been
-# shut down.
-
-class Bundler::ConnectionPool::PoolShuttingDownError < RuntimeError; end
-
-##
-# The TimedStack manages a pool of homogeneous connections (or any resource
-# you wish to manage). Connections are created lazily up to a given maximum
-# number.
-
-# Examples:
-#
-# ts = TimedStack.new(1) { MyConnection.new }
-#
-# # fetch a connection
-# conn = ts.pop
-#
-# # return a connection
-# ts.push conn
-#
-# conn = ts.pop
-# ts.pop timeout: 5
-# #=> raises Timeout::Error after 5 seconds
-
-class Bundler::ConnectionPool::TimedStack
- attr_reader :max
-
- ##
- # Creates a new pool with +size+ connections that are created from the given
- # +block+.
-
- def initialize(size = 0, &block)
- @create_block = block
- @created = 0
- @que = []
- @max = size
- @mutex = Mutex.new
- @resource = ConditionVariable.new
- @shutdown_block = nil
- end
-
- ##
- # Returns +obj+ to the stack. +options+ is ignored in TimedStack but may be
- # used by subclasses that extend TimedStack.
-
- def push(obj, options = {})
- @mutex.synchronize do
- if @shutdown_block
- @shutdown_block.call(obj)
- else
- store_connection obj, options
- end
-
- @resource.broadcast
- end
- end
- alias_method :<<, :push
-
- ##
- # Retrieves a connection from the stack. If a connection is available it is
- # immediately returned. If no connection is available within the given
- # timeout a Timeout::Error is raised.
- #
- # +:timeout+ is the only checked entry in +options+ and is preferred over
- # the +timeout+ argument (which will be removed in a future release). Other
- # options may be used by subclasses that extend TimedStack.
-
- def pop(timeout = 0.5, options = {})
- options, timeout = timeout, 0.5 if Hash === timeout
- timeout = options.fetch :timeout, timeout
-
- deadline = Bundler::ConnectionPool.monotonic_time + timeout
- @mutex.synchronize do
- loop do
- raise Bundler::ConnectionPool::PoolShuttingDownError if @shutdown_block
- return fetch_connection(options) if connection_stored?(options)
-
- connection = try_create(options)
- return connection if connection
-
- to_wait = deadline - Bundler::ConnectionPool.monotonic_time
- raise Timeout::Error, "Waited #{timeout} sec" if to_wait <= 0
- @resource.wait(@mutex, to_wait)
- end
- end
- end
-
- ##
- # Shuts down the TimedStack which prevents connections from being checked
- # out. The +block+ is called once for each connection on the stack.
-
- def shutdown(&block)
- raise ArgumentError, "shutdown must receive a block" unless block_given?
-
- @mutex.synchronize do
- @shutdown_block = block
- @resource.broadcast
-
- shutdown_connections
- end
- end
-
- ##
- # Returns +true+ if there are no available connections.
-
- def empty?
- (@created - @que.length) >= @max
- end
-
- ##
- # The number of connections available on the stack.
-
- def length
- @max - @created + @que.length
- end
-
- private
-
- ##
- # This is an extension point for TimedStack and is called with a mutex.
- #
- # This method must returns true if a connection is available on the stack.
-
- def connection_stored?(options = nil)
- !@que.empty?
- end
-
- ##
- # This is an extension point for TimedStack and is called with a mutex.
- #
- # This method must return a connection from the stack.
-
- def fetch_connection(options = nil)
- @que.pop
- end
-
- ##
- # This is an extension point for TimedStack and is called with a mutex.
- #
- # This method must shut down all connections on the stack.
-
- def shutdown_connections(options = nil)
- while connection_stored?(options)
- conn = fetch_connection(options)
- @shutdown_block.call(conn)
- end
- end
-
- ##
- # This is an extension point for TimedStack and is called with a mutex.
- #
- # This method must return +obj+ to the stack.
-
- def store_connection(obj, options = nil)
- @que.push obj
- end
-
- ##
- # This is an extension point for TimedStack and is called with a mutex.
- #
- # This method must create a connection if and only if the total number of
- # connections allowed has not been met.
-
- def try_create(options = nil)
- unless @created == @max
- object = @create_block.call
- @created += 1
- object
- end
- end
-end
diff --git a/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb b/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb
deleted file mode 100644
index b149c0e242..0000000000
--- a/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class Bundler::ConnectionPool
- VERSION = "2.2.2"
-end
diff --git a/lib/bundler/vendor/fileutils/lib/fileutils.rb b/lib/bundler/vendor/fileutils/lib/fileutils.rb
deleted file mode 100644
index 8f8faf30c8..0000000000
--- a/lib/bundler/vendor/fileutils/lib/fileutils.rb
+++ /dev/null
@@ -1,1764 +0,0 @@
-# frozen_string_literal: true
-
-begin
- require 'rbconfig'
-rescue LoadError
- # for make mjit-headers
-end
-
-#
-# = fileutils.rb
-#
-# Copyright (c) 2000-2007 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-#
-# == module Bundler::FileUtils
-#
-# Namespace for several file utility methods for copying, moving, removing, etc.
-#
-# === Module Functions
-#
-# require 'bundler/vendor/fileutils/lib/fileutils'
-#
-# Bundler::FileUtils.cd(dir, **options)
-# Bundler::FileUtils.cd(dir, **options) {|dir| block }
-# Bundler::FileUtils.pwd()
-# Bundler::FileUtils.mkdir(dir, **options)
-# Bundler::FileUtils.mkdir(list, **options)
-# Bundler::FileUtils.mkdir_p(dir, **options)
-# Bundler::FileUtils.mkdir_p(list, **options)
-# Bundler::FileUtils.rmdir(dir, **options)
-# Bundler::FileUtils.rmdir(list, **options)
-# Bundler::FileUtils.ln(target, link, **options)
-# Bundler::FileUtils.ln(targets, dir, **options)
-# Bundler::FileUtils.ln_s(target, link, **options)
-# Bundler::FileUtils.ln_s(targets, dir, **options)
-# Bundler::FileUtils.ln_sf(target, link, **options)
-# Bundler::FileUtils.cp(src, dest, **options)
-# Bundler::FileUtils.cp(list, dir, **options)
-# Bundler::FileUtils.cp_r(src, dest, **options)
-# Bundler::FileUtils.cp_r(list, dir, **options)
-# Bundler::FileUtils.mv(src, dest, **options)
-# Bundler::FileUtils.mv(list, dir, **options)
-# Bundler::FileUtils.rm(list, **options)
-# Bundler::FileUtils.rm_r(list, **options)
-# Bundler::FileUtils.rm_rf(list, **options)
-# Bundler::FileUtils.install(src, dest, **options)
-# Bundler::FileUtils.chmod(mode, list, **options)
-# Bundler::FileUtils.chmod_R(mode, list, **options)
-# Bundler::FileUtils.chown(user, group, list, **options)
-# Bundler::FileUtils.chown_R(user, group, list, **options)
-# Bundler::FileUtils.touch(list, **options)
-#
-# Possible <tt>options</tt> are:
-#
-# <tt>:force</tt> :: forced operation (rewrite files if exist, remove
-# directories if not empty, etc.);
-# <tt>:verbose</tt> :: print command to be run, in bash syntax, before
-# performing it;
-# <tt>:preserve</tt> :: preserve object's group, user and modification
-# time on copying;
-# <tt>:noop</tt> :: no changes are made (usable in combination with
-# <tt>:verbose</tt> which will print the command to run)
-#
-# Each method documents the options that it honours. See also ::commands,
-# ::options and ::options_of methods to introspect which command have which
-# options.
-#
-# All methods that have the concept of a "source" file or directory can take
-# either one file or a list of files in that argument. See the method
-# documentation for examples.
-#
-# There are some `low level' methods, which do not accept keyword arguments:
-#
-# Bundler::FileUtils.copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
-# Bundler::FileUtils.copy_file(src, dest, preserve = false, dereference = true)
-# Bundler::FileUtils.copy_stream(srcstream, deststream)
-# Bundler::FileUtils.remove_entry(path, force = false)
-# Bundler::FileUtils.remove_entry_secure(path, force = false)
-# Bundler::FileUtils.remove_file(path, force = false)
-# Bundler::FileUtils.compare_file(path_a, path_b)
-# Bundler::FileUtils.compare_stream(stream_a, stream_b)
-# Bundler::FileUtils.uptodate?(file, cmp_list)
-#
-# == module Bundler::FileUtils::Verbose
-#
-# This module has all methods of Bundler::FileUtils module, but it outputs messages
-# before acting. This equates to passing the <tt>:verbose</tt> flag to methods
-# in Bundler::FileUtils.
-#
-# == module Bundler::FileUtils::NoWrite
-#
-# This module has all methods of Bundler::FileUtils module, but never changes
-# files/directories. This equates to passing the <tt>:noop</tt> flag to methods
-# in Bundler::FileUtils.
-#
-# == module Bundler::FileUtils::DryRun
-#
-# This module has all methods of Bundler::FileUtils module, but never changes
-# files/directories. This equates to passing the <tt>:noop</tt> and
-# <tt>:verbose</tt> flags to methods in Bundler::FileUtils.
-#
-module Bundler::FileUtils
- VERSION = "1.4.1"
-
- def self.private_module_function(name) #:nodoc:
- module_function name
- private_class_method name
- end
-
- #
- # Returns the name of the current directory.
- #
- def pwd
- Dir.pwd
- end
- module_function :pwd
-
- alias getwd pwd
- module_function :getwd
-
- #
- # Changes the current directory to the directory +dir+.
- #
- # If this method is called with block, resumes to the previous
- # working directory after the block execution has finished.
- #
- # Bundler::FileUtils.cd('/') # change directory
- #
- # Bundler::FileUtils.cd('/', verbose: true) # change directory and report it
- #
- # Bundler::FileUtils.cd('/') do # change directory
- # # ... # do something
- # end # return to original directory
- #
- def cd(dir, verbose: nil, &block) # :yield: dir
- fu_output_message "cd #{dir}" if verbose
- result = Dir.chdir(dir, &block)
- fu_output_message 'cd -' if verbose and block
- result
- end
- module_function :cd
-
- alias chdir cd
- module_function :chdir
-
- #
- # Returns true if +new+ is newer than all +old_list+.
- # Non-existent files are older than any file.
- #
- # Bundler::FileUtils.uptodate?('hello.o', %w(hello.c hello.h)) or \
- # system 'make hello.o'
- #
- def uptodate?(new, old_list)
- return false unless File.exist?(new)
- new_time = File.mtime(new)
- old_list.each do |old|
- if File.exist?(old)
- return false unless new_time > File.mtime(old)
- end
- end
- true
- end
- module_function :uptodate?
-
- def remove_trailing_slash(dir) #:nodoc:
- dir == '/' ? dir : dir.chomp(?/)
- end
- private_module_function :remove_trailing_slash
-
- #
- # Creates one or more directories.
- #
- # Bundler::FileUtils.mkdir 'test'
- # Bundler::FileUtils.mkdir %w(tmp data)
- # Bundler::FileUtils.mkdir 'notexist', noop: true # Does not really create.
- # Bundler::FileUtils.mkdir 'tmp', mode: 0700
- #
- def mkdir(list, mode: nil, noop: nil, verbose: nil)
- list = fu_list(list)
- fu_output_message "mkdir #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
- return if noop
-
- list.each do |dir|
- fu_mkdir dir, mode
- end
- end
- module_function :mkdir
-
- #
- # Creates a directory and all its parent directories.
- # For example,
- #
- # Bundler::FileUtils.mkdir_p '/usr/local/lib/ruby'
- #
- # causes to make following directories, if they do not exist.
- #
- # * /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)
- list = fu_list(list)
- fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
- return *list if noop
-
- list.map {|path| remove_trailing_slash(path)}.each do |path|
- # optimize for the most common case
- begin
- fu_mkdir path, mode
- next
- rescue SystemCallError
- next if File.directory?(path)
- end
-
- stack = []
- until path == stack.last # dirname("/")=="/", dirname("C:/")=="C:/"
- stack.push path
- path = File.dirname(path)
- end
- stack.pop # root directory should exist
- stack.reverse_each do |dir|
- begin
- fu_mkdir dir, mode
- rescue SystemCallError
- raise unless File.directory?(dir)
- end
- end
- end
-
- return *list
- end
- module_function :mkdir_p
-
- alias mkpath mkdir_p
- alias makedirs mkdir_p
- module_function :mkpath
- module_function :makedirs
-
- def fu_mkdir(path, mode) #:nodoc:
- path = remove_trailing_slash(path)
- if mode
- Dir.mkdir path, mode
- File.chmod mode, path
- else
- Dir.mkdir path
- end
- end
- private_module_function :fu_mkdir
-
- #
- # Removes one or more directories.
- #
- # Bundler::FileUtils.rmdir 'somedir'
- # Bundler::FileUtils.rmdir %w(somedir anydir otherdir)
- # # Does not really remove directory; outputs message.
- # Bundler::FileUtils.rmdir 'somedir', verbose: true, noop: true
- #
- def rmdir(list, parents: nil, noop: nil, verbose: nil)
- list = fu_list(list)
- fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if verbose
- return if noop
- list.each do |dir|
- Dir.rmdir(dir = remove_trailing_slash(dir))
- if parents
- begin
- until (parent = File.dirname(dir)) == '.' or parent == dir
- dir = parent
- Dir.rmdir(dir)
- end
- rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
- end
- end
- end
- end
- module_function :rmdir
-
- #
- # :call-seq:
- # Bundler::FileUtils.ln(target, link, force: nil, noop: nil, verbose: nil)
- # Bundler::FileUtils.ln(target, dir, force: nil, noop: nil, verbose: nil)
- # Bundler::FileUtils.ln(targets, dir, force: nil, noop: nil, verbose: nil)
- #
- # 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+.
- #
- # Bundler::FileUtils.ln 'gcc', 'cc', verbose: true
- # Bundler::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.
- #
- # Bundler::FileUtils.cd '/sbin'
- # Bundler::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
- fu_each_src_dest0(src, dest) do |s,d|
- remove_file d, true if force
- File.link s, d
- end
- end
- module_function :ln
-
- alias link ln
- module_function :link
-
- #
- # Hard link +src+ to +dest+. If +src+ is a directory, this method links
- # all its contents recursively. If +dest+ is a directory, links
- # +src+ to +dest/src+.
- #
- # +src+ can be a list of files.
- #
- # If +dereference_root+ is true, this method dereference tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
- # Bundler::FileUtils.rm_r site_ruby + '/mylib', force: true
- # Bundler::FileUtils.cp_lr 'lib/', site_ruby + '/mylib'
- #
- # # Examples of linking several files to target directory.
- # Bundler::FileUtils.cp_lr %w(mail.rb field.rb debug/), site_ruby + '/tmail'
- # Bundler::FileUtils.cp_lr Dir.glob('*.rb'), '/home/aamine/lib/ruby', noop: true, verbose: true
- #
- # # If you want to link all contents of a directory instead of the
- # # directory itself, c.f. src/x -> dest/x, src/y -> dest/y,
- # # use the following code.
- # Bundler::FileUtils.cp_lr 'src/.', 'dest' # cp_lr('src', 'dest') makes dest/src, but this doesn't.
- #
- def cp_lr(src, dest, noop: nil, verbose: nil,
- dereference_root: true, remove_destination: false)
- fu_output_message "cp -lr#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
- fu_each_src_dest(src, dest) do |s, d|
- link_entry s, d, dereference_root, remove_destination
- end
- end
- module_function :cp_lr
-
- #
- # :call-seq:
- # Bundler::FileUtils.ln_s(target, link, force: nil, noop: nil, verbose: nil)
- # Bundler::FileUtils.ln_s(target, dir, force: nil, noop: nil, verbose: nil)
- # Bundler::FileUtils.ln_s(targets, dir, force: nil, noop: nil, verbose: nil)
- #
- # In the first form, creates a symbolic link +link+ which points to +target+.
- # If +link+ already exists, raises Errno::EEXIST.
- # But if the <tt>force</tt> option is set, overwrites +link+.
- #
- # Bundler::FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby'
- # Bundler::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.
- #
- # Bundler::FileUtils.ln_s Dir.glob('/bin/*.rb'), '/home/foo/bin'
- #
- 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
- fu_each_src_dest0(src, dest) do |s,d|
- remove_file d, true if force
- File.symlink s, d
- end
- end
- module_function :ln_s
-
- alias symlink ln_s
- module_function :symlink
-
- #
- # :call-seq:
- # Bundler::FileUtils.ln_sf(*args)
- #
- # Same as
- #
- # Bundler::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
- end
- module_function :ln_sf
-
- #
- # Hard links a file system entry +src+ to +dest+.
- # If +src+ is a directory, this method links its contents recursively.
- #
- # Both of +src+ and +dest+ must be a path name.
- # +src+ must exist, +dest+ must not exist.
- #
- # If +dereference_root+ is true, this method dereferences the tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
- def link_entry(src, dest, dereference_root = false, remove_destination = false)
- Entry_.new(src, nil, dereference_root).traverse do |ent|
- destent = Entry_.new(dest, ent.rel, false)
- File.unlink destent.path if remove_destination && File.file?(destent.path)
- ent.link destent.path
- end
- end
- module_function :link_entry
-
- #
- # Copies a file content +src+ to +dest+. If +dest+ is a directory,
- # copies +src+ to +dest/src+.
- #
- # If +src+ is a list of files, then +dest+ must be a directory.
- #
- # Bundler::FileUtils.cp 'eval.c', 'eval.c.org'
- # Bundler::FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6'
- # Bundler::FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6', verbose: true
- # Bundler::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
- fu_each_src_dest(src, dest) do |s, d|
- copy_file s, d, preserve
- end
- end
- module_function :cp
-
- alias copy cp
- module_function :copy
-
- #
- # Copies +src+ to +dest+. If +src+ is a directory, this method copies
- # all its contents recursively. If +dest+ is a directory, copies
- # +src+ to +dest/src+.
- #
- # +src+ can be a list of files.
- #
- # If +dereference_root+ is true, this method dereference tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
- # # Installing Ruby library "mylib" under the site_ruby
- # Bundler::FileUtils.rm_r site_ruby + '/mylib', force: true
- # Bundler::FileUtils.cp_r 'lib/', site_ruby + '/mylib'
- #
- # # Examples of copying several files to target directory.
- # Bundler::FileUtils.cp_r %w(mail.rb field.rb debug/), site_ruby + '/tmail'
- # Bundler::FileUtils.cp_r Dir.glob('*.rb'), '/home/foo/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,
- # # use following code.
- # Bundler::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
- fu_each_src_dest(src, dest) do |s, d|
- copy_entry s, d, preserve, dereference_root, remove_destination
- end
- end
- module_function :cp_r
-
- #
- # Copies a file system entry +src+ to +dest+.
- # If +src+ is a directory, this method copies its contents recursively.
- # This method preserves file types, c.f. symlink, directory...
- # (FIFO, device files and etc. are not supported yet)
- #
- # Both of +src+ and +dest+ must be a path name.
- # +src+ must exist, +dest+ must not exist.
- #
- # If +preserve+ is true, this method preserves owner, group, and
- # modified time. Permissions are copied regardless +preserve+.
- #
- # If +dereference_root+ is true, this method dereference tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
- def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
- if dereference_root
- src = File.realpath(src)
- end
-
- Entry_.new(src, nil, false).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))
- ent.copy destent.path
- end, proc do |ent|
- destent = Entry_.new(dest, ent.rel, false)
- ent.copy_metadata destent.path if preserve
- end)
- end
- module_function :copy_entry
-
- #
- # Copies file contents of +src+ to +dest+.
- # Both of +src+ and +dest+ must be a path name.
- #
- def copy_file(src, dest, preserve = false, dereference = true)
- ent = Entry_.new(src, nil, dereference)
- ent.copy_file dest
- ent.copy_metadata dest if preserve
- end
- module_function :copy_file
-
- #
- # Copies stream +src+ to +dest+.
- # +src+ must respond to #read(n) and
- # +dest+ must respond to #write(str).
- #
- def copy_stream(src, dest)
- IO.copy_stream(src, dest)
- end
- module_function :copy_stream
-
- #
- # 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.
- #
- # Bundler::FileUtils.mv 'badname.rb', 'goodname.rb'
- # Bundler::FileUtils.mv 'stuff.rb', '/notexist/lib/ruby', force: true # no error
- #
- # Bundler::FileUtils.mv %w(junk.txt dust.txt), '/home/foo/.trash/'
- # Bundler::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
- 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
- end
- end
- begin
- File.rename s, d
- rescue Errno::EXDEV,
- Errno::EPERM # move from unencrypted to encrypted dir (ext4)
- copy_entry s, d, true
- if secure
- remove_entry_secure s, force
- else
- remove_entry s, force
- end
- end
- rescue SystemCallError
- raise unless force
- end
- end
- end
- module_function :mv
-
- alias move mv
- module_function :move
-
- #
- # Remove file(s) specified in +list+. This method cannot remove directories.
- # All StandardErrors are ignored when the :force option is set.
- #
- # Bundler::FileUtils.rm %w( junk.txt dust.txt )
- # Bundler::FileUtils.rm Dir.glob('*.so')
- # Bundler::FileUtils.rm 'NotExistFile', force: true # never raises exception
- #
- def rm(list, force: nil, noop: nil, verbose: nil)
- list = fu_list(list)
- fu_output_message "rm#{force ? ' -f' : ''} #{list.join ' '}" if verbose
- return if noop
-
- list.each do |path|
- remove_file path, force
- end
- end
- module_function :rm
-
- alias remove rm
- module_function :remove
-
- #
- # Equivalent to
- #
- # Bundler::FileUtils.rm(list, force: true)
- #
- def rm_f(list, noop: nil, verbose: nil)
- rm list, force: true, noop: noop, verbose: verbose
- end
- module_function :rm_f
-
- alias safe_unlink rm_f
- module_function :safe_unlink
-
- #
- # 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.
- #
- # Bundler::FileUtils.rm_r Dir.glob('/tmp/*')
- # Bundler::FileUtils.rm_r 'some_dir', force: true
- #
- # WARNING: This method causes local vulnerability
- # if one of parent directories or removing directory tree are world
- # writable (including /tmp, whose permission is 1777), and the current
- # process has strong privilege such as Unix super user (root), and the
- # system has symbolic link. For secure removing, read the documentation
- # of remove_entry_secure carefully, and set :secure option to true.
- # Default is <tt>secure: false</tt>.
- #
- # 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)
- list = fu_list(list)
- fu_output_message "rm -r#{force ? 'f' : ''} #{list.join ' '}" if verbose
- return if noop
- list.each do |path|
- if secure
- remove_entry_secure path, force
- else
- remove_entry path, force
- end
- end
- end
- module_function :rm_r
-
- #
- # Equivalent to
- #
- # Bundler::FileUtils.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
- end
- module_function :rm_rf
-
- alias rmtree rm_rf
- module_function :rmtree
-
- #
- # This method removes a file system entry +path+. +path+ shall be a
- # regular file, a directory, or something. If +path+ is a directory,
- # remove it recursively. This method is required to avoid TOCTTOU
- # (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.
- #
- # To avoid this security hole, this method applies special preprocess.
- # If +path+ is a directory, this method chown(2) and chmod(2) all
- # removing directories. This requires the current process is the
- # owner of the removing whole directory tree, or is the super user (root).
- #
- # WARNING: You must ensure that *ALL* parent directories cannot be
- # moved by other untrusted users. For example, parent directories
- # should not be owned by untrusted users, and should not be world
- # writable except when the sticky bit set.
- #
- # WARNING: Only the owner of the removing directory tree, or Unix super
- # user (root) should invoke this method. Otherwise this method does not
- # work.
- #
- # For details of this security vulnerability, see Perl's case:
- #
- # * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448
- # * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452
- #
- # For fileutils.rb, this vulnerability is reported in [ruby-dev:26100].
- #
- def remove_entry_secure(path, force = false)
- unless fu_have_symlink?
- remove_entry path, force
- return
- end
- fullpath = File.expand_path(path)
- st = File.lstat(fullpath)
- unless st.directory?
- File.unlink fullpath
- return
- end
- # is a directory.
- parent_st = File.stat(File.dirname(fullpath))
- unless parent_st.world_writable?
- remove_entry path, force
- return
- end
- unless parent_st.sticky?
- raise ArgumentError, "parent directory is world writable, Bundler::FileUtils#remove_entry_secure does not work; abort: #{path.inspect} (parent directory mode #{'%o' % parent_st.mode})"
- end
-
- # freeze tree root
- euid = Process.euid
- dot_file = fullpath + "/."
- begin
- File.open(dot_file) {|f|
- unless fu_stat_identical_entry?(st, f.stat)
- # symlink (TOC-to-TOU attack?)
- File.unlink fullpath
- return
- end
- f.chown euid, -1
- f.chmod 0700
- }
- rescue Errno::EISDIR # JRuby in non-native mode can't open files as dirs
- File.lstat(dot_file).tap {|fstat|
- unless fu_stat_identical_entry?(st, fstat)
- # symlink (TOC-to-TOU attack?)
- File.unlink fullpath
- return
- end
- File.chown euid, -1, dot_file
- File.chmod 0700, dot_file
- }
- end
-
- unless fu_stat_identical_entry?(st, File.lstat(fullpath))
- # TOC-to-TOU attack?
- File.unlink fullpath
- return
- end
-
- # ---- tree root is frozen ----
- root = Entry_.new(path)
- root.preorder_traverse do |ent|
- if ent.directory?
- ent.chown euid, -1
- ent.chmod 0700
- end
- end
- root.postorder_traverse do |ent|
- begin
- ent.remove
- rescue
- raise unless force
- end
- end
- rescue
- raise unless force
- end
- module_function :remove_entry_secure
-
- def fu_have_symlink? #:nodoc:
- File.symlink nil, nil
- rescue NotImplementedError
- return false
- rescue TypeError
- return true
- end
- private_module_function :fu_have_symlink?
-
- def fu_stat_identical_entry?(a, b) #:nodoc:
- a.dev == b.dev and a.ino == b.ino
- end
- private_module_function :fu_stat_identical_entry?
-
- #
- # This method removes a file system entry +path+.
- # +path+ might be a regular file, a directory, or something.
- # If +path+ is a directory, remove it recursively.
- #
- # See also remove_entry_secure.
- #
- def remove_entry(path, force = false)
- Entry_.new(path).postorder_traverse do |ent|
- begin
- ent.remove
- rescue
- raise unless force
- end
- end
- rescue
- raise unless force
- end
- module_function :remove_entry
-
- #
- # Removes a file +path+.
- # This method ignores StandardError if +force+ is true.
- #
- def remove_file(path, force = false)
- Entry_.new(path).remove_file
- rescue
- raise unless force
- end
- module_function :remove_file
-
- #
- # Removes a directory +dir+ and its contents recursively.
- # This method ignores StandardError if +force+ is true.
- #
- def remove_dir(path, force = false)
- remove_entry path, force # FIXME?? check if it is a directory
- end
- module_function :remove_dir
-
- #
- # Returns true if the contents of a file +a+ and a file +b+ are identical.
- #
- # Bundler::FileUtils.compare_file('somefile', 'somefile') #=> true
- # Bundler::FileUtils.compare_file('/dev/null', '/dev/urandom') #=> false
- #
- def compare_file(a, b)
- return false unless File.size(a) == File.size(b)
- File.open(a, 'rb') {|fa|
- File.open(b, 'rb') {|fb|
- return compare_stream(fa, fb)
- }
- }
- end
- module_function :compare_file
-
- alias identical? compare_file
- alias cmp compare_file
- module_function :identical?
- module_function :cmp
-
- #
- # Returns true if the contents of a stream +a+ and +b+ are identical.
- #
- def compare_stream(a, b)
- bsize = fu_stream_blksize(a, b)
-
- if RUBY_VERSION > "2.4"
- sa = String.new(capacity: bsize)
- sb = String.new(capacity: bsize)
- else
- sa = String.new
- sb = String.new
- end
-
- begin
- a.read(bsize, sa)
- b.read(bsize, sb)
- return true if sa.empty? && sb.empty?
- end while sa == sb
- false
- end
- module_function :compare_stream
-
- #
- # 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.
- #
- # Bundler::FileUtils.install 'ruby', '/usr/local/bin/ruby', mode: 0755, verbose: true
- # Bundler::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)
- 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
- end
- end
- end
- module_function :install
-
- def user_mask(target) #:nodoc:
- target.each_char.inject(0) do |mask, chr|
- case chr
- when "u"
- mask | 04700
- when "g"
- mask | 02070
- when "o"
- mask | 01007
- when "a"
- mask | 07777
- else
- raise ArgumentError, "invalid `who' symbol in file mode: #{chr}"
- end
- end
- end
- private_module_function :user_mask
-
- def apply_mask(mode, user_mask, op, mode_mask) #:nodoc:
- case op
- when '='
- (mode & ~user_mask) | (user_mask & mode_mask)
- when '+'
- mode | (user_mask & mode_mask)
- when '-'
- mode & ~(user_mask & mode_mask)
- end
- end
- 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|
- target, *actions = clause.split(/([=+-])/)
- raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
- target = 'a' if target.empty?
- user_mask = user_mask(target)
- actions.each_slice(2) do |op, perm|
- need_apply = op == '='
- mode_mask = (perm || '').each_char.inject(0) do |mask, chr|
- case chr
- when "r"
- mask | 0444
- when "w"
- mask | 0222
- when "x"
- mask | 0111
- when "X"
- if FileTest.directory? path
- mask | 0111
- else
- mask
- end
- when "s"
- mask | 06000
- when "t"
- mask | 01000
- when "u", "g", "o"
- if mask.nonzero?
- current_mode = apply_mask(current_mode, user_mask, op, mask)
- end
- need_apply = false
- copy_mask = user_mask(chr)
- (current_mode & copy_mask) / (copy_mask & 0111) * (user_mask & 0111)
- else
- raise ArgumentError, "invalid `perm' symbol in file mode: #{chr}"
- end
- end
-
- if mode_mask.nonzero? || need_apply
- current_mode = apply_mask(current_mode, user_mask, op, mode_mask)
- end
- end
- current_mode
- end
- end
- private_module_function :symbolic_modes_to_i
-
- def fu_mode(mode, path) #:nodoc:
- mode.is_a?(String) ? symbolic_modes_to_i(mode, path) : mode
- end
- private_module_function :fu_mode
-
- def mode_to_s(mode) #:nodoc:
- mode.is_a?(String) ? mode : "%o" % mode
- end
- private_module_function :mode_to_s
-
- #
- # Changes permission bits on the named files (in +list+) to the bit pattern
- # represented by +mode+.
- #
- # +mode+ is the symbolic and absolute mode can be used.
- #
- # Absolute mode is
- # Bundler::FileUtils.chmod 0755, 'somecommand'
- # Bundler::FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb)
- # Bundler::FileUtils.chmod 0755, '/usr/bin/ruby', verbose: true
- #
- # Symbolic mode is
- # Bundler::FileUtils.chmod "u=wrx,go=rx", 'somecommand'
- # Bundler::FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb)
- # Bundler::FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', verbose: true
- #
- # "a" :: is user, group, other mask.
- # "u" :: is user's mask.
- # "g" :: is group's mask.
- # "o" :: is other's mask.
- # "w" :: is write permission.
- # "r" :: is read permission.
- # "x" :: is execute permission.
- # "X" ::
- # is execute permission for directories only, must be used in conjunction with "+"
- # "s" :: is uid, gid.
- # "t" :: is sticky bit.
- # "+" :: is added to a class given the specified mode.
- # "-" :: Is removed from a given class given mode.
- # "=" :: Is the exact nature of the class will be given a specified mode.
-
- def chmod(mode, list, noop: nil, verbose: nil)
- list = fu_list(list)
- fu_output_message sprintf('chmod %s %s', mode_to_s(mode), list.join(' ')) if verbose
- return if noop
- list.each do |path|
- Entry_.new(path).chmod(fu_mode(mode, path))
- end
- end
- module_function :chmod
-
- #
- # Changes permission bits on the named files (in +list+)
- # to the bit pattern represented by +mode+.
- #
- # Bundler::FileUtils.chmod_R 0700, "/tmp/app.#{$$}"
- # Bundler::FileUtils.chmod_R "u=wrx", "/tmp/app.#{$$}"
- #
- def chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
- 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
- list.each do |root|
- Entry_.new(root).traverse do |ent|
- begin
- ent.chmod(fu_mode(mode, ent.path))
- rescue
- raise unless force
- end
- end
- end
- end
- module_function :chmod_R
-
- #
- # Changes owner and group on the named files (in +list+)
- # to the user +user+ and the group +group+. +user+ and +group+
- # may be an ID (Integer/String) or a name (String).
- # If +user+ or +group+ is nil, this method does not change
- # the attribute.
- #
- # Bundler::FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
- # Bundler::FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
- #
- def chown(user, group, list, noop: nil, verbose: nil)
- list = fu_list(list)
- fu_output_message sprintf('chown %s %s',
- (group ? "#{user}:#{group}" : user || ':'),
- list.join(' ')) if verbose
- return if noop
- uid = fu_get_uid(user)
- gid = fu_get_gid(group)
- list.each do |path|
- Entry_.new(path).chown uid, gid
- end
- end
- module_function :chown
-
- #
- # Changes owner and group on the named files (in +list+)
- # to the user +user+ and the group +group+ recursively.
- # +user+ and +group+ may be an ID (Integer/String) or
- # a name (String). If +user+ or +group+ is nil, this
- # method does not change the attribute.
- #
- # Bundler::FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
- # Bundler::FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', verbose: true
- #
- def chown_R(user, group, list, noop: nil, verbose: nil, force: nil)
- list = fu_list(list)
- fu_output_message sprintf('chown -R%s %s %s',
- (force ? 'f' : ''),
- (group ? "#{user}:#{group}" : user || ':'),
- list.join(' ')) if verbose
- return if noop
- uid = fu_get_uid(user)
- gid = fu_get_gid(group)
- list.each do |root|
- Entry_.new(root).traverse do |ent|
- begin
- ent.chown uid, gid
- rescue
- raise unless force
- end
- end
- end
- end
- module_function :chown_R
-
- def fu_get_uid(user) #:nodoc:
- return nil unless user
- case user
- when Integer
- user
- when /\A\d+\z/
- user.to_i
- else
- require 'etc'
- Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil
- end
- end
- private_module_function :fu_get_uid
-
- def fu_get_gid(group) #:nodoc:
- return nil unless group
- case group
- when Integer
- group
- when /\A\d+\z/
- group.to_i
- else
- require 'etc'
- Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil
- end
- end
- private_module_function :fu_get_gid
-
- #
- # Updates modification time (mtime) and access time (atime) of file(s) in
- # +list+. Files are created if they don't exist.
- #
- # Bundler::FileUtils.touch 'timestamp'
- # Bundler::FileUtils.touch Dir.glob('*.c'); system 'make'
- #
- def touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)
- list = fu_list(list)
- t = mtime
- if verbose
- fu_output_message "touch #{nocreate ? '-c ' : ''}#{t ? t.strftime('-t %Y%m%d%H%M.%S ') : ''}#{list.join ' '}"
- end
- return if noop
- list.each do |path|
- created = nocreate
- begin
- File.utime(t, t, path)
- rescue Errno::ENOENT
- raise if created
- File.open(path, 'a') {
- ;
- }
- created = true
- retry if t
- end
- end
- end
- module_function :touch
-
- private
-
- module StreamUtils_
- private
-
- case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
- when /mswin|mingw/
- def fu_windows?; true end
- else
- def fu_windows?; false end
- end
-
- def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
- IO.copy_stream(src, dest)
- end
-
- def fu_stream_blksize(*streams)
- streams.each do |s|
- next unless s.respond_to?(:stat)
- size = fu_blksize(s.stat)
- return size if size
- end
- fu_default_blksize()
- end
-
- def fu_blksize(st)
- s = st.blksize
- return nil unless s
- return nil if s == 0
- s
- end
-
- def fu_default_blksize
- 1024
- end
- end
-
- include StreamUtils_
- extend StreamUtils_
-
- class Entry_ #:nodoc: internal use only
- include StreamUtils_
-
- def initialize(a, b = nil, deref = false)
- @prefix = @rel = @path = nil
- if b
- @prefix = a
- @rel = b
- else
- @path = a
- end
- @deref = deref
- @stat = nil
- @lstat = nil
- end
-
- def inspect
- "\#<#{self.class} #{path()}>"
- end
-
- def path
- if @path
- File.path(@path)
- else
- join(@prefix, @rel)
- end
- end
-
- def prefix
- @prefix || @path
- end
-
- def rel
- @rel
- end
-
- def dereference?
- @deref
- end
-
- def exist?
- begin
- lstat
- true
- rescue Errno::ENOENT
- false
- end
- end
-
- def file?
- s = lstat!
- s and s.file?
- end
-
- def directory?
- s = lstat!
- s and s.directory?
- end
-
- def symlink?
- s = lstat!
- s and s.symlink?
- end
-
- def chardev?
- s = lstat!
- s and s.chardev?
- end
-
- def blockdev?
- s = lstat!
- s and s.blockdev?
- end
-
- def socket?
- s = lstat!
- s and s.socket?
- end
-
- def pipe?
- s = lstat!
- s and s.pipe?
- end
-
- S_IF_DOOR = 0xD000
-
- def door?
- s = lstat!
- s and (s.mode & 0xF000 == S_IF_DOOR)
- end
-
- def entries
- opts = {}
- opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
-
- files = if Dir.respond_to?(:children)
- Dir.children(path, **opts)
- else
- Dir.entries(path(), **opts)
- .reject {|n| n == '.' or n == '..' }
- end
-
- untaint = RUBY_VERSION < '2.7'
- files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
- end
-
- def stat
- return @stat if @stat
- if lstat() and lstat().symlink?
- @stat = File.stat(path())
- else
- @stat = lstat()
- end
- @stat
- end
-
- def stat!
- return @stat if @stat
- if lstat! and lstat!.symlink?
- @stat = File.stat(path())
- else
- @stat = lstat!
- end
- @stat
- rescue SystemCallError
- nil
- end
-
- def lstat
- if dereference?
- @lstat ||= File.stat(path())
- else
- @lstat ||= File.lstat(path())
- end
- end
-
- def lstat!
- lstat()
- rescue SystemCallError
- nil
- end
-
- def chmod(mode)
- if symlink?
- File.lchmod mode, path() if have_lchmod?
- else
- File.chmod mode, path()
- end
- end
-
- def chown(uid, gid)
- if symlink?
- File.lchown uid, gid, path() if have_lchown?
- else
- File.chown uid, gid, path()
- end
- end
-
- def link(dest)
- case
- when directory?
- if !File.exist?(dest) and descendant_directory?(dest, path)
- raise ArgumentError, "cannot link directory %s to itself %s" % [path, dest]
- end
- begin
- Dir.mkdir dest
- rescue
- raise unless File.directory?(dest)
- end
- else
- File.link path(), dest
- end
- end
-
- def copy(dest)
- lstat
- case
- when file?
- copy_file dest
- when directory?
- if !File.exist?(dest) and descendant_directory?(dest, path)
- raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
- end
- begin
- Dir.mkdir dest
- rescue
- raise unless File.directory?(dest)
- end
- when symlink?
- File.symlink File.readlink(path()), dest
- when chardev?, blockdev?
- raise "cannot handle device file"
- when socket?
- begin
- require 'socket'
- rescue LoadError
- raise "cannot handle socket"
- else
- raise "cannot handle socket" unless defined?(UNIXServer)
- end
- UNIXServer.new(dest).close
- File.chmod lstat().mode, dest
- when pipe?
- raise "cannot handle FIFO" unless File.respond_to?(:mkfifo)
- File.mkfifo dest, lstat().mode
- when door?
- raise "cannot handle door: #{path()}"
- else
- raise "unknown file type: #{path()}"
- end
- end
-
- def copy_file(dest)
- File.open(path()) do |s|
- File.open(dest, 'wb', s.stat.mode) do |f|
- IO.copy_stream(s, f)
- end
- end
- end
-
- def copy_metadata(path)
- st = lstat()
- if !st.symlink?
- File.utime st.atime, st.mtime, path
- end
- mode = st.mode
- begin
- if st.symlink?
- begin
- File.lchown st.uid, st.gid, path
- rescue NotImplementedError
- end
- else
- File.chown st.uid, st.gid, path
- end
- rescue Errno::EPERM, Errno::EACCES
- # clear setuid/setgid
- mode &= 01777
- end
- if st.symlink?
- begin
- File.lchmod mode, path
- rescue NotImplementedError
- end
- else
- File.chmod mode, path
- end
- end
-
- def remove
- if directory?
- remove_dir1
- else
- remove_file
- end
- end
-
- def remove_dir1
- platform_support {
- Dir.rmdir path().chomp(?/)
- }
- end
-
- def remove_file
- platform_support {
- File.unlink path
- }
- end
-
- def platform_support
- return yield unless fu_windows?
- first_time_p = true
- begin
- yield
- rescue Errno::ENOENT
- raise
- rescue => err
- if first_time_p
- first_time_p = false
- begin
- File.chmod 0700, path() # Windows does not have symlink
- retry
- rescue SystemCallError
- end
- end
- raise err
- end
- end
-
- def preorder_traverse
- stack = [self]
- while ent = stack.pop
- yield ent
- stack.concat ent.entries.reverse if ent.directory?
- end
- end
-
- alias traverse preorder_traverse
-
- def postorder_traverse
- if directory?
- entries().each do |ent|
- ent.postorder_traverse do |e|
- yield e
- end
- end
- end
- ensure
- yield self
- end
-
- def wrap_traverse(pre, post)
- pre.call self
- if directory?
- entries.each do |ent|
- ent.wrap_traverse pre, post
- end
- end
- post.call self
- end
-
- private
-
- @@fileutils_rb_have_lchmod = nil
-
- def have_lchmod?
- # This is not MT-safe, but it does not matter.
- if @@fileutils_rb_have_lchmod == nil
- @@fileutils_rb_have_lchmod = check_have_lchmod?
- end
- @@fileutils_rb_have_lchmod
- end
-
- def check_have_lchmod?
- return false unless File.respond_to?(:lchmod)
- File.lchmod 0
- return true
- rescue NotImplementedError
- return false
- end
-
- @@fileutils_rb_have_lchown = nil
-
- def have_lchown?
- # This is not MT-safe, but it does not matter.
- if @@fileutils_rb_have_lchown == nil
- @@fileutils_rb_have_lchown = check_have_lchown?
- end
- @@fileutils_rb_have_lchown
- end
-
- def check_have_lchown?
- return false unless File.respond_to?(:lchown)
- File.lchown nil, nil
- return true
- rescue NotImplementedError
- return false
- end
-
- def join(dir, base)
- return File.path(dir) if not base or base == '.'
- return File.path(base) if not dir or dir == '.'
- File.join(dir, base)
- end
-
- if File::ALT_SEPARATOR
- DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)"
- else
- DIRECTORY_TERM = "(?=/|\\z)"
- end
-
- def descendant_directory?(descendant, ascendant)
- if File::FNM_SYSCASE.nonzero?
- File.expand_path(File.dirname(descendant)).casecmp(File.expand_path(ascendant)) == 0
- else
- File.expand_path(File.dirname(descendant)) == File.expand_path(ascendant)
- end
- end
- end # class Entry_
-
- def fu_list(arg) #:nodoc:
- [arg].flatten.map {|path| File.path(path) }
- end
- private_module_function :fu_list
-
- def fu_each_src_dest(src, dest) #:nodoc:
- fu_each_src_dest0(src, dest) do |s, d|
- raise ArgumentError, "same file: #{s} and #{d}" if fu_same?(s, d)
- yield s, d
- end
- end
- private_module_function :fu_each_src_dest
-
- def fu_each_src_dest0(src, dest) #:nodoc:
- if tmp = Array.try_convert(src)
- tmp.each do |s|
- s = File.path(s)
- yield s, File.join(dest, File.basename(s))
- end
- else
- src = File.path(src)
- if File.directory?(dest)
- yield src, File.join(dest, File.basename(src))
- else
- yield src, File.path(dest)
- end
- end
- end
- private_module_function :fu_each_src_dest0
-
- def fu_same?(a, b) #:nodoc:
- File.identical?(a, b)
- end
- private_module_function :fu_same?
-
- def fu_output_message(msg) #:nodoc:
- output = @fileutils_output if defined?(@fileutils_output)
- output ||= $stderr
- if defined?(@fileutils_label)
- msg = @fileutils_label + msg
- end
- output.puts msg
- 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
- }
-
- public
-
- #
- # Returns an Array of names of high-level methods that accept any keyword
- # arguments.
- #
- # p Bundler::FileUtils.commands #=> ["chmod", "cp", "cp_r", "install", ...]
- #
- def self.commands
- OPT_TABLE.keys
- end
-
- #
- # Returns an Array of option names.
- #
- # p Bundler::FileUtils.options #=> ["noop", "force", "verbose", "preserve", "mode"]
- #
- def self.options
- OPT_TABLE.values.flatten.uniq.map {|sym| sym.to_s }
- end
-
- #
- # Returns true if the method +mid+ have an option +opt+.
- #
- # p Bundler::FileUtils.have_option?(:cp, :noop) #=> true
- # p Bundler::FileUtils.have_option?(:rm, :force) #=> true
- # p Bundler::FileUtils.have_option?(:rm, :preserve) #=> false
- #
- def self.have_option?(mid, opt)
- li = OPT_TABLE[mid.to_s] or raise ArgumentError, "no such method: #{mid}"
- li.include?(opt)
- end
-
- #
- # Returns an Array of option names of the method +mid+.
- #
- # p Bundler::FileUtils.options_of(:rm) #=> ["noop", "verbose", "force"]
- #
- def self.options_of(mid)
- OPT_TABLE[mid.to_s].map {|sym| sym.to_s }
- end
-
- #
- # Returns an Array of methods names which have the option +opt+.
- #
- # p Bundler::FileUtils.collect_method(:preserve) #=> ["cp", "cp_r", "copy", "install"]
- #
- def self.collect_method(opt)
- OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
- end
-
- private
-
- LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern) # :nodoc:
- module LowMethods # :nodoc: internal use only
- private
- def _do_nothing(*)end
- ::Bundler::FileUtils::LOW_METHODS.map {|name| alias_method name, :_do_nothing}
- end
-
- METHODS = singleton_methods() - [:private_module_function, # :nodoc:
- :commands, :options, :have_option?, :options_of, :collect_method]
-
- #
- # This module has all methods of Bundler::FileUtils module, but it outputs messages
- # before acting. This equates to passing the <tt>:verbose</tt> flag to
- # methods in Bundler::FileUtils.
- #
- module Verbose
- include Bundler::FileUtils
- names = ::Bundler::FileUtils.collect_method(:verbose)
- names.each do |name|
- module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args, **options)
- super(*args, **options, verbose: true)
- end
- EOS
- end
- private(*names)
- extend self
- class << self
- public(*::Bundler::FileUtils::METHODS)
- end
- end
-
- #
- # This module has all methods of Bundler::FileUtils module, but never changes
- # files/directories. This equates to passing the <tt>:noop</tt> flag
- # to methods in Bundler::FileUtils.
- #
- module NoWrite
- include Bundler::FileUtils
- include LowMethods
- names = ::Bundler::FileUtils.collect_method(:noop)
- names.each do |name|
- module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args, **options)
- super(*args, **options, noop: true)
- end
- EOS
- end
- private(*names)
- extend self
- class << self
- public(*::Bundler::FileUtils::METHODS)
- end
- end
-
- #
- # This module has all methods of Bundler::FileUtils module, but never changes
- # files/directories, with printing message before acting.
- # This equates to passing the <tt>:noop</tt> and <tt>:verbose</tt> flag
- # to methods in Bundler::FileUtils.
- #
- module DryRun
- include Bundler::FileUtils
- include LowMethods
- names = ::Bundler::FileUtils.collect_method(:noop)
- names.each do |name|
- module_eval(<<-EOS, __FILE__, __LINE__ + 1)
- def #{name}(*args, **options)
- super(*args, **options, noop: true, verbose: true)
- end
- EOS
- end
- private(*names)
- extend self
- class << self
- public(*::Bundler::FileUtils::METHODS)
- end
- end
-
-end
diff --git a/lib/bundler/vendor/fileutils/lib/fileutils/version.rb b/lib/bundler/vendor/fileutils/lib/fileutils/version.rb
deleted file mode 100644
index b8f616e4fb..0000000000
--- a/lib/bundler/vendor/fileutils/lib/fileutils/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::FileUtils
- VERSION = "1.3.0"
-end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo.rb b/lib/bundler/vendor/molinillo/lib/molinillo.rb
deleted file mode 100644
index baedefe98b..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'molinillo/compatibility'
-require_relative 'molinillo/gem_metadata'
-require_relative 'molinillo/errors'
-require_relative 'molinillo/resolver'
-require_relative 'molinillo/modules/ui'
-require_relative 'molinillo/modules/specification_provider'
-
-# Bundler::Molinillo is a generic dependency resolution algorithm.
-module Bundler::Molinillo
-end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb b/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb
deleted file mode 100644
index 3eba8e4083..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::Molinillo
- # Hacks needed for old Ruby versions.
- module Compatibility
- module_function
-
- if [].respond_to?(:flat_map)
- # Flat map
- # @param [Enumerable] enum an enumerable object
- # @block the block to flat-map with
- # @return The enum, flat-mapped
- def flat_map(enum, &blk)
- enum.flat_map(&blk)
- end
- else
- # Flat map
- # @param [Enumerable] enum an enumerable object
- # @block the block to flat-map with
- # @return The enum, flat-mapped
- def flat_map(enum, &blk)
- enum.map(&blk).flatten(1)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb b/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
deleted file mode 100644
index bcacf35243..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::Molinillo
- # @!visibility private
- module Delegates
- # Delegates all {Bundler::Molinillo::ResolutionState} methods to a `#state` property.
- module ResolutionState
- # (see Bundler::Molinillo::ResolutionState#name)
- def name
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.name
- end
-
- # (see Bundler::Molinillo::ResolutionState#requirements)
- def requirements
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.requirements
- end
-
- # (see Bundler::Molinillo::ResolutionState#activated)
- def activated
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.activated
- end
-
- # (see Bundler::Molinillo::ResolutionState#requirement)
- def requirement
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.requirement
- end
-
- # (see Bundler::Molinillo::ResolutionState#possibilities)
- def possibilities
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.possibilities
- end
-
- # (see Bundler::Molinillo::ResolutionState#depth)
- def depth
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.depth
- end
-
- # (see Bundler::Molinillo::ResolutionState#conflicts)
- def conflicts
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.conflicts
- end
-
- # (see Bundler::Molinillo::ResolutionState#unused_unwind_options)
- def unused_unwind_options
- current_state = state || Bundler::Molinillo::ResolutionState.empty
- current_state.unused_unwind_options
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb b/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb
deleted file mode 100644
index ec9c770a28..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::Molinillo
- module Delegates
- # Delegates all {Bundler::Molinillo::SpecificationProvider} methods to a
- # `#specification_provider` property.
- module SpecificationProvider
- # (see Bundler::Molinillo::SpecificationProvider#search_for)
- def search_for(dependency)
- with_no_such_dependency_error_handling do
- specification_provider.search_for(dependency)
- end
- end
-
- # (see Bundler::Molinillo::SpecificationProvider#dependencies_for)
- def dependencies_for(specification)
- with_no_such_dependency_error_handling do
- specification_provider.dependencies_for(specification)
- end
- end
-
- # (see Bundler::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 Bundler::Molinillo::SpecificationProvider#name_for)
- def name_for(dependency)
- with_no_such_dependency_error_handling do
- specification_provider.name_for(dependency)
- end
- end
-
- # (see Bundler::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 Bundler::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 Bundler::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 Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
deleted file mode 100644
index 31578bb5bf..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-# frozen_string_literal: true
-
-require 'set'
-require 'tsort'
-
-require_relative 'dependency_graph/log'
-require_relative 'dependency_graph/vertex'
-
-module Bundler::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_vertex = vertex_named(parent_name)
- add_edge(parent_vertex, 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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
deleted file mode 100644
index c04c7eec9c..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
deleted file mode 100644
index 946a08236e..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'action'
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
deleted file mode 100644
index 483527daf8..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'action'
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
deleted file mode 100644
index d81940585a..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'action'
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
deleted file mode 100644
index 36fce7c526..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'action'
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
deleted file mode 100644
index 6f0de19886..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'add_edge_no_circular'
-require_relative 'add_vertex'
-require_relative 'delete_edge'
-require_relative 'detach_vertex_named'
-require_relative 'set_payload'
-require_relative 'tag'
-
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
deleted file mode 100644
index 2e9b90e6cd..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'action'
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
deleted file mode 100644
index fccfc78cc7..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'action'
-module Bundler::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/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb b/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
deleted file mode 100644
index 41bc013143..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
+++ /dev/null
@@ -1,158 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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).uniq
- 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 [Set<Vertex>] the vertices of {#graph} where `self` is a
- # {#descendent?}
- def recursive_predecessors
- _recursive_predecessors
- end
-
- # @param [Set<Vertex>] vertices the set to add the predecessors to
- # @return [Set<Vertex>] the vertices of {#graph} where `self` is a
- # {#descendent?}
- def _recursive_predecessors(vertices = Set.new)
- incoming_edges.each do |edge|
- vertex = edge.origin
- next unless vertices.add?(vertex)
- vertex._recursive_predecessors(vertices)
- end
-
- vertices
- end
- protected :_recursive_predecessors
-
- # @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 [Set<Vertex>] the vertices of {#graph} where `self` is an
- # {#ancestor?}
- def recursive_successors
- _recursive_successors
- end
-
- # @param [Set<Vertex>] vertices the set to add the successors to
- # @return [Set<Vertex>] the vertices of {#graph} where `self` is an
- # {#ancestor?}
- def _recursive_successors(vertices = Set.new)
- outgoing_edges.each do |edge|
- vertex = edge.destination
- next unless vertices.add?(vertex)
- vertex._recursive_successors(vertices)
- end
-
- vertices
- end
- protected :_recursive_successors
-
- # @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)
- _path_to?(other)
- end
-
- alias descendent? path_to?
-
- # @param [Vertex] other the vertex to check if there's a path to
- # @param [Set<Vertex>] visited the vertices of {#graph} that have been visited
- # @return [Boolean] whether there is a path to `other` from `self`
- def _path_to?(other, visited = Set.new)
- return false unless visited.add?(self)
- return true if equal?(other)
- successors.any? { |v| v._path_to?(other, visited) }
- end
- protected :_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/bundler/vendor/molinillo/lib/molinillo/errors.rb b/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb
deleted file mode 100644
index 89c7c324d5..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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.uniq
- 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>] vertices the vertices in the dependency
- # that caused the error
- def initialize(vertices)
- super "There is a circular dependency between #{vertices.map(&:name).join(' and ')}"
- @dependencies = vertices.map { |vertex| vertex.payload.possibilities.last }.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
-
- # @return [SpecificationProvider] the specification provider used during
- # resolution
- attr_reader :specification_provider
-
- # Initializes a new error with the given version conflicts.
- # @param [{String => Resolution::Conflict}] conflicts see {#conflicts}
- # @param [SpecificationProvider] specification_provider see {#specification_provider}
- def initialize(conflicts, specification_provider)
- pairs = []
- Compatibility.flat_map(conflicts.values.flatten, &:requirements).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
- @specification_provider = specification_provider
- end
-
- require_relative 'delegates/specification_provider'
- include Delegates::SpecificationProvider
-
- # @return [String] An error message that includes requirement trees,
- # which is much more detailed & customizable than the default message
- # @param [Hash] opts the options to create a message with.
- # @option opts [String] :solver_name The user-facing name of the solver
- # @option opts [String] :possibility_type The generic name of a possibility
- # @option opts [Proc] :reduce_trees A proc that reduced the list of requirement trees
- # @option opts [Proc] :printable_requirement A proc that pretty-prints requirements
- # @option opts [Proc] :additional_message_for_conflict A proc that appends additional
- # messages for each conflict
- # @option opts [Proc] :version_for_spec A proc that returns the version number for a
- # possibility
- def message_with_trees(opts = {})
- solver_name = opts.delete(:solver_name) { self.class.name.split('::').first }
- possibility_type = opts.delete(:possibility_type) { 'possibility named' }
- reduce_trees = opts.delete(:reduce_trees) { proc { |trees| trees.uniq.sort_by(&:to_s) } }
- printable_requirement = opts.delete(:printable_requirement) { proc { |req| req.to_s } }
- additional_message_for_conflict = opts.delete(:additional_message_for_conflict) { proc {} }
- version_for_spec = opts.delete(:version_for_spec) { proc(&:to_s) }
- incompatible_version_message_for_conflict = opts.delete(:incompatible_version_message_for_conflict) do
- proc do |name, _conflict|
- %(#{solver_name} could not find compatible versions for #{possibility_type} "#{name}":)
- end
- end
-
- conflicts.sort.reduce(''.dup) do |o, (name, conflict)|
- o << "\n" << incompatible_version_message_for_conflict.call(name, conflict) << "\n"
- if conflict.locked_requirement
- o << %( In snapshot (#{name_for_locking_dependency_source}):\n)
- o << %( #{printable_requirement.call(conflict.locked_requirement)}\n)
- o << %(\n)
- end
- o << %( In #{name_for_explicit_dependency_source}:\n)
- trees = reduce_trees.call(conflict.requirement_trees)
-
- o << trees.map do |tree|
- t = ''.dup
- depth = 2
- tree.each do |req|
- t << ' ' * depth << req.to_s
- unless tree.last == req
- if spec = conflict.activated_by_name[name_for(req)]
- t << %( was resolved to #{version_for_spec.call(spec)}, which)
- end
- t << %( depends on)
- end
- t << %(\n)
- depth += 1
- end
- t
- end.join("\n")
-
- additional_message_for_conflict.call(o, name, conflict)
-
- o
- end.strip
- end
- end
-end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb b/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
deleted file mode 100644
index 73f8fbf2ac..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::Molinillo
- # The version of Bundler::Molinillo.
- VERSION = '0.6.6'.freeze
-end
diff --git a/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb b/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb
deleted file mode 100644
index fa094c1981..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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 Bundler::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/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb b/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb
deleted file mode 100644
index a166bc6991..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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)
- debug_info = debug_info.split("\n").map { |s| ":#{depth.to_s.rjust 4}: #{s}" }
- output.puts debug_info
- 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/bundler/vendor/molinillo/lib/molinillo/resolution.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
deleted file mode 100644
index acf7777414..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
+++ /dev/null
@@ -1,837 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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_set the set of specs 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.
- # @attr [Object] underlying_error an error that has occurred during resolution, and
- # will be raised at the end of it if no resolution is found.
- Conflict = Struct.new(
- :requirement,
- :requirements,
- :existing,
- :possibility_set,
- :locked_requirement,
- :requirement_trees,
- :activated_by_name,
- :underlying_error
- )
-
- class Conflict
- # @return [Object] a spec that was unable to be activated due to a conflict
- def possibility
- possibility_set && possibility_set.latest_version
- end
- end
-
- # A collection of possibility states that share the same dependencies
- # @attr [Array] dependencies the dependencies for this set of possibilities
- # @attr [Array] possibilities the possibilities
- PossibilitySet = Struct.new(:dependencies, :possibilities)
-
- class PossibilitySet
- # String representation of the possibility set, for debugging
- def to_s
- "[#{possibilities.join(', ')}]"
- end
-
- # @return [Object] most up-to-date dependency in the possibility set
- def latest_version
- possibilities.last
- end
- end
-
- # Details of the state to unwind to when a conflict occurs, and the cause of the unwind
- # @attr [Integer] state_index the index of the state to unwind to
- # @attr [Object] state_requirement the requirement of the state we're unwinding to
- # @attr [Array] requirement_tree for the requirement we're relaxing
- # @attr [Array] conflicting_requirements the requirements that combined to cause the conflict
- # @attr [Array] requirement_trees for the conflict
- # @attr [Array] requirements_unwound_to_instead array of unwind requirements that were chosen over this unwind
- UnwindDetails = Struct.new(
- :state_index,
- :state_requirement,
- :requirement_tree,
- :conflicting_requirements,
- :requirement_trees,
- :requirements_unwound_to_instead
- )
-
- class UnwindDetails
- include Comparable
-
- # We compare UnwindDetails when choosing which state to unwind to. If
- # two options have the same state_index we prefer the one most
- # removed from a requirement that caused the conflict. Both options
- # would unwind to the same state, but a `grandparent` option will
- # filter out fewer of its possibilities after doing so - where a state
- # is both a `parent` and a `grandparent` to requirements that have
- # caused a conflict this is the correct behaviour.
- # @param [UnwindDetail] other UnwindDetail to be compared
- # @return [Integer] integer specifying ordering
- def <=>(other)
- if state_index > other.state_index
- 1
- elsif state_index == other.state_index
- reversed_requirement_tree_index <=> other.reversed_requirement_tree_index
- else
- -1
- end
- end
-
- # @return [Integer] index of state requirement in reversed requirement tree
- # (the conflicting requirement itself will be at position 0)
- def reversed_requirement_tree_index
- @reversed_requirement_tree_index ||=
- if state_requirement
- requirement_tree.reverse.index(state_requirement)
- else
- 999_999
- end
- end
-
- # @return [Boolean] where the requirement of the state we're unwinding
- # to directly caused the conflict. Note: in this case, it is
- # impossible for the state we're unwinding to to be a parent of
- # any of the other conflicting requirements (or we would have
- # circularity)
- def unwinding_to_primary_requirement?
- requirement_tree.last == state_requirement
- end
-
- # @return [Array] array of sub-dependencies to avoid when choosing a
- # new possibility for the state we've unwound to. Only relevant for
- # non-primary unwinds
- def sub_dependencies_to_avoid
- @requirements_to_avoid ||=
- requirement_trees.map do |tree|
- index = tree.index(state_requirement)
- tree[index + 1] if index
- end.compact
- end
-
- # @return [Array] array of all the requirements that led to the need for
- # this unwind
- def all_requirements
- @all_requirements ||= requirement_trees.flatten(1)
- end
- end
-
- # @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 if !state.requirement && state.requirements.empty?
- 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
-
- resolve_activated_specs
- 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
-
- def resolve_activated_specs
- activated.vertices.each do |_, vertex|
- next unless vertex.payload
-
- latest_version = vertex.payload.possibilities.reverse_each.find do |possibility|
- vertex.requirements.all? { |req| requirement_satisfied_by?(req, activated, possibility) }
- end
-
- activated.set_payload(vertex.name, latest_version)
- end
- activated.freeze
- 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_relative 'state'
- require_relative 'modules/specification_provider'
-
- require_relative 'delegates/resolution_state'
- require_relative 'delegates/specification_provider'
-
- include Bundler::Molinillo::Delegates::ResolutionState
- include Bundler::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
- unwind_for_conflict
- end
- rescue CircularDependencyError => underlying_error
- create_conflict(underlying_error)
- unwind_for_conflict
- 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 do |requested|
- vertex = dg.add_vertex(name_for(requested), nil, true)
- vertex.explicit_requirements << requested
- end
- 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,
- possibilities_for_requirement(initial_requirement, graph),
- 0,
- {},
- []
- )
- end
-
- # Unwinds the states stack because a conflict has been encountered
- # @return [void]
- def unwind_for_conflict
- details_for_unwind = build_details_for_unwind
- unwind_options = unused_unwind_options
- debug(depth) { "Unwinding for conflict: #{requirement} to #{details_for_unwind.state_index / 2}" }
- conflicts.tap do |c|
- sliced_states = states.slice!((details_for_unwind.state_index + 1)..-1)
- raise_error_unless_state(c)
- activated.rewind_to(sliced_states.first || :initial_state) if sliced_states
- state.conflicts = c
- state.unused_unwind_options = unwind_options
- filter_possibilities_after_unwind(details_for_unwind)
- index = states.size - 1
- @parents_of.each { |_, a| a.reject! { |i| i >= index } }
- state.unused_unwind_options.reject! { |uw| uw.state_index >= index }
- end
- end
-
- # Raises a VersionConflict error, or any underlying error, if there is no
- # current state
- # @return [void]
- def raise_error_unless_state(conflicts)
- return if state
-
- error = conflicts.values.map(&:underlying_error).compact.first
- raise error || VersionConflict.new(conflicts, specification_provider)
- end
-
- # @return [UnwindDetails] Details of the nearest index to which we could unwind
- def build_details_for_unwind
- # Get the possible unwinds for the current conflict
- current_conflict = conflicts[name]
- binding_requirements = binding_requirements_for_conflict(current_conflict)
- unwind_details = unwind_options_for_requirements(binding_requirements)
-
- last_detail_for_current_unwind = unwind_details.sort.last
- current_detail = last_detail_for_current_unwind
-
- # Look for past conflicts that could be unwound to affect the
- # requirement tree for the current conflict
- relevant_unused_unwinds = unused_unwind_options.select do |alternative|
- intersecting_requirements =
- last_detail_for_current_unwind.all_requirements &
- alternative.requirements_unwound_to_instead
- next if intersecting_requirements.empty?
- # Find the highest index unwind whilst looping through
- current_detail = alternative if alternative > current_detail
- alternative
- end
-
- # Add the current unwind options to the `unused_unwind_options` array.
- # The "used" option will be filtered out during `unwind_for_conflict`.
- state.unused_unwind_options += unwind_details.reject { |detail| detail.state_index == -1 }
-
- # Update the requirements_unwound_to_instead on any relevant unused unwinds
- relevant_unused_unwinds.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
- unwind_details.each { |d| d.requirements_unwound_to_instead << current_detail.state_requirement }
-
- current_detail
- end
-
- # @param [Array<Object>] array of requirements that combine to create a conflict
- # @return [Array<UnwindDetails>] array of UnwindDetails that have a chance
- # of resolving the passed requirements
- def unwind_options_for_requirements(binding_requirements)
- unwind_details = []
-
- trees = []
- binding_requirements.reverse_each do |r|
- partial_tree = [r]
- trees << partial_tree
- unwind_details << UnwindDetails.new(-1, nil, partial_tree, binding_requirements, trees, [])
-
- # If this requirement has alternative possibilities, check if any would
- # satisfy the other requirements that created this conflict
- requirement_state = find_state_for(r)
- if conflict_fixing_possibilities?(requirement_state, binding_requirements)
- unwind_details << UnwindDetails.new(
- states.index(requirement_state),
- r,
- partial_tree,
- binding_requirements,
- trees,
- []
- )
- end
-
- # Next, look at the parent of this requirement, and check if the requirement
- # could have been avoided if an alternative PossibilitySet had been chosen
- parent_r = parent_of(r)
- next if parent_r.nil?
- partial_tree.unshift(parent_r)
- requirement_state = find_state_for(parent_r)
- if requirement_state.possibilities.any? { |set| !set.dependencies.include?(r) }
- unwind_details << UnwindDetails.new(
- states.index(requirement_state),
- parent_r,
- partial_tree,
- binding_requirements,
- trees,
- []
- )
- end
-
- # Finally, look at the grandparent and up of this requirement, looking
- # for any possibilities that wouldn't create their parent requirement
- grandparent_r = parent_of(parent_r)
- until grandparent_r.nil?
- partial_tree.unshift(grandparent_r)
- requirement_state = find_state_for(grandparent_r)
- if requirement_state.possibilities.any? { |set| !set.dependencies.include?(parent_r) }
- unwind_details << UnwindDetails.new(
- states.index(requirement_state),
- grandparent_r,
- partial_tree,
- binding_requirements,
- trees,
- []
- )
- end
- parent_r = grandparent_r
- grandparent_r = parent_of(parent_r)
- end
- end
-
- unwind_details
- end
-
- # @param [DependencyState] state
- # @param [Array] array of requirements
- # @return [Boolean] whether or not the given state has any possibilities
- # that could satisfy the given requirements
- def conflict_fixing_possibilities?(state, binding_requirements)
- return false unless state
-
- state.possibilities.any? do |possibility_set|
- possibility_set.possibilities.any? do |poss|
- possibility_satisfies_requirements?(poss, binding_requirements)
- end
- end
- end
-
- # Filter's a state's possibilities to remove any that would not fix the
- # conflict we've just rewound from
- # @param [UnwindDetails] details of the conflict just unwound from
- # @return [void]
- def filter_possibilities_after_unwind(unwind_details)
- return unless state && !state.possibilities.empty?
-
- if unwind_details.unwinding_to_primary_requirement?
- filter_possibilities_for_primary_unwind(unwind_details)
- else
- filter_possibilities_for_parent_unwind(unwind_details)
- end
- end
-
- # Filter's a state's possibilities to remove any that would not satisfy
- # the requirements in the conflict we've just rewound from
- # @param [UnwindDetails] details of the conflict just unwound from
- # @return [void]
- def filter_possibilities_for_primary_unwind(unwind_details)
- unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
- unwinds_to_state << unwind_details
- unwind_requirement_sets = unwinds_to_state.map(&:conflicting_requirements)
-
- state.possibilities.reject! do |possibility_set|
- possibility_set.possibilities.none? do |poss|
- unwind_requirement_sets.any? do |requirements|
- possibility_satisfies_requirements?(poss, requirements)
- end
- end
- end
- end
-
- # @param [Object] possibility a single possibility
- # @param [Array] requirements an array of requirements
- # @return [Boolean] whether the possibility satisfies all of the
- # given requirements
- def possibility_satisfies_requirements?(possibility, requirements)
- name = name_for(possibility)
-
- activated.tag(:swap)
- activated.set_payload(name, possibility) if activated.vertex_named(name)
- satisfied = requirements.all? { |r| requirement_satisfied_by?(r, activated, possibility) }
- activated.rewind_to(:swap)
-
- satisfied
- end
-
- # Filter's a state's possibilities to remove any that would (eventually)
- # create a requirement in the conflict we've just rewound from
- # @param [UnwindDetails] details of the conflict just unwound from
- # @return [void]
- def filter_possibilities_for_parent_unwind(unwind_details)
- unwinds_to_state = unused_unwind_options.select { |uw| uw.state_index == unwind_details.state_index }
- unwinds_to_state << unwind_details
-
- primary_unwinds = unwinds_to_state.select(&:unwinding_to_primary_requirement?).uniq
- parent_unwinds = unwinds_to_state.uniq - primary_unwinds
-
- allowed_possibility_sets = Compatibility.flat_map(primary_unwinds) do |unwind|
- states[unwind.state_index].possibilities.select do |possibility_set|
- possibility_set.possibilities.any? do |poss|
- possibility_satisfies_requirements?(poss, unwind.conflicting_requirements)
- end
- end
- end
-
- requirements_to_avoid = Compatibility.flat_map(parent_unwinds, &:sub_dependencies_to_avoid)
-
- state.possibilities.reject! do |possibility_set|
- !allowed_possibility_sets.include?(possibility_set) &&
- (requirements_to_avoid - possibility_set.dependencies).empty?
- end
- end
-
- # @param [Conflict] conflict
- # @return [Array] minimal array of requirements that would cause the passed
- # conflict to occur.
- def binding_requirements_for_conflict(conflict)
- return [conflict.requirement] if conflict.possibility.nil?
-
- possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
-
- # When there’s a `CircularDependency` error the conflicting requirement
- # (the one causing the circular) won’t be `conflict.requirement`
- # (which won’t be for the right state, because we won’t have created it,
- # because it’s circular).
- # We need to make sure we have that requirement in the conflict’s list,
- # otherwise we won’t be able to unwind properly, so we just return all
- # the requirements for the conflict.
- return possible_binding_requirements if conflict.underlying_error
-
- possibilities = search_for(conflict.requirement)
-
- # If all the requirements together don't filter out all possibilities,
- # then the only two requirements we need to consider are the initial one
- # (where the dependency's version was first chosen) and the last
- if binding_requirement_in_set?(nil, possible_binding_requirements, possibilities)
- return [conflict.requirement, requirement_for_existing_name(name_for(conflict.requirement))].compact
- end
-
- # Loop through the possible binding requirements, removing each one
- # that doesn't bind. Use a `reverse_each` as we want the earliest set of
- # binding requirements, and don't use `reject!` as we wish to refine the
- # array *on each iteration*.
- binding_requirements = possible_binding_requirements.dup
- possible_binding_requirements.reverse_each do |req|
- next if req == conflict.requirement
- unless binding_requirement_in_set?(req, binding_requirements, possibilities)
- binding_requirements -= [req]
- end
- end
-
- binding_requirements
- end
-
- # @param [Object] requirement we wish to check
- # @param [Array] array of requirements
- # @param [Array] array of possibilities the requirements will be used to filter
- # @return [Boolean] whether or not the given requirement is required to filter
- # out all elements of the array of possibilities.
- def binding_requirement_in_set?(requirement, possible_binding_requirements, possibilities)
- possibilities.any? do |poss|
- possibility_satisfies_requirements?(poss, possible_binding_requirements - [requirement])
- end
- 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 vertex = activated.vertex_named(name)
- return nil unless vertex.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.find { |i| requirement == i.requirement }
- end
-
- # @return [Conflict] a {Conflict} that reflects the failure to activate
- # the {#possibility} in conjunction with the current {#state}
- def create_conflict(underlying_error = nil)
- 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 do |edge|
- (requirements[edge.origin.payload.latest_version] ||= []).unshift(edge.requirement)
- end
-
- activated_by_name = {}
- activated.each { |v| activated_by_name[v.name] = v.payload.latest_version if v.payload }
- conflicts[name] = Conflict.new(
- requirement,
- requirements,
- vertex.payload && vertex.payload.latest_version,
- possibility,
- locked_requirement,
- requirement_trees,
- activated_by_name,
- underlying_error
- )
- 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_vertex = activated.vertex_named(name)
- if existing_vertex.payload
- debug(depth) { "Found existing spec (#{existing_vertex.payload})" }
- attempt_to_filter_existing_spec(existing_vertex)
- else
- latest = possibility.latest_version
- # use reject!(!satisfied) for 1.8.7 compatibility
- possibility.possibilities.reject! do |possibility|
- !requirement_satisfied_by?(requirement, activated, possibility)
- end
- if possibility.latest_version.nil?
- # ensure there's a possibility for better error messages
- possibility.possibilities << latest if latest
- create_conflict
- unwind_for_conflict
- else
- activate_new_spec
- end
- end
- end
-
- # Attempts to update the existing vertex's `PossibilitySet` with a filtered version
- # @return [void]
- def attempt_to_filter_existing_spec(vertex)
- filtered_set = filtered_possibility_set(vertex)
- if !filtered_set.possibilities.empty?
- activated.set_payload(name, filtered_set)
- new_requirements = requirements.dup
- push_state_for_requirements(new_requirements, false)
- else
- create_conflict
- debug(depth) { "Unsatisfied by existing spec (#{vertex.payload})" }
- unwind_for_conflict
- end
- end
-
- # Generates a filtered version of the existing vertex's `PossibilitySet` using the
- # current state's `requirement`
- # @param [Object] existing vertex
- # @return [PossibilitySet] filtered possibility set
- def filtered_possibility_set(vertex)
- PossibilitySet.new(vertex.payload.dependencies, vertex.payload.possibilities & possibility.possibilities)
- 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_new_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_possibility the PossibilitySet that has just been
- # activated
- # @return [void]
- def require_nested_dependencies_for(possibility_set)
- nested_dependencies = dependencies_for(possibility_set.latest_version)
- debug(depth) { "Requiring nested dependencies (#{nested_dependencies.join(', ')})" }
- nested_dependencies.each do |d|
- activated.add_child_vertex(name_for(d), nil, [name_for(possibility_set.latest_version)], 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 = nil
- loop do
- new_requirement = new_requirements.shift
- break if new_requirement.nil? || states.none? { |s| s.requirement == new_requirement }
- end
- new_name = new_requirement ? name_for(new_requirement) : ''.freeze
- possibilities = possibilities_for_requirement(new_requirement)
- handle_missing_or_push_dependency_state DependencyState.new(
- new_name, new_requirements, new_activated,
- new_requirement, possibilities, depth, conflicts.dup, unused_unwind_options.dup
- )
- end
-
- # Checks a proposed requirement with any existing locked requirement
- # before generating an array of possibilities for it.
- # @param [Object] the proposed requirement
- # @return [Array] possibilities
- def possibilities_for_requirement(requirement, activated = self.activated)
- return [] unless requirement
- if locked_requirement_named(name_for(requirement))
- return locked_requirement_possibility_set(requirement, activated)
- end
-
- group_possibilities(search_for(requirement))
- end
-
- # @param [Object] the proposed requirement
- # @return [Array] possibility set containing only the locked requirement, if any
- def locked_requirement_possibility_set(requirement, activated = self.activated)
- all_possibilities = search_for(requirement)
- locked_requirement = locked_requirement_named(name_for(requirement))
-
- # Longwinded way to build a possibilities array with either the locked
- # requirement or nothing in it. Required, since the API for
- # locked_requirement isn't guaranteed.
- locked_possibilities = all_possibilities.select do |possibility|
- requirement_satisfied_by?(locked_requirement, activated, possibility)
- end
-
- group_possibilities(locked_possibilities)
- end
-
- # Build an array of PossibilitySets, with each element representing a group of
- # dependency versions that all have the same sub-dependency version constraints
- # and are contiguous.
- # @param [Array] an array of possibilities
- # @return [Array] an array of possibility sets
- def group_possibilities(possibilities)
- possibility_sets = []
- current_possibility_set = nil
-
- possibilities.reverse_each do |possibility|
- dependencies = dependencies_for(possibility)
- if current_possibility_set && current_possibility_set.dependencies == dependencies
- current_possibility_set.possibilities.unshift(possibility)
- else
- possibility_sets.unshift(PossibilitySet.new(dependencies, [possibility]))
- current_possibility_set = possibility_sets.first
- end
- end
-
- possibility_sets
- 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 vertex 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/bundler/vendor/molinillo/lib/molinillo/resolver.rb b/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
deleted file mode 100644
index 95eaab5991..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'dependency_graph'
-
-module Bundler::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_relative '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/bundler/vendor/molinillo/lib/molinillo/state.rb b/lib/bundler/vendor/molinillo/lib/molinillo/state.rb
deleted file mode 100644
index 68fa1f54e3..0000000000
--- a/lib/bundler/vendor/molinillo/lib/molinillo/state.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler::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 [Hash] conflicts unresolved conflicts, indexed by dependency name
- # @attr [Array<UnwindDetails>] unused_unwind_options unwinds for previous conflicts that weren't explored
- ResolutionState = Struct.new(
- :name,
- :requirements,
- :activated,
- :requirement,
- :possibilities,
- :depth,
- :conflicts,
- :unused_unwind_options
- )
-
- class ResolutionState
- # Returns an empty resolution state
- # @return [ResolutionState] an empty state
- def self.empty
- new(nil, [], DependencyGraph.new, nil, nil, 0, {}, [])
- 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,
- unused_unwind_options.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/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
deleted file mode 100644
index e9c4c3e89e..0000000000
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
+++ /dev/null
@@ -1,1202 +0,0 @@
-require 'net/http'
-require_relative '../../../../uri/lib/uri'
-require 'cgi' # for escaping
-require_relative '../../../../connection_pool/lib/connection_pool'
-
-begin
- require 'net/http/pipeline'
-rescue LoadError
-end
-
-autoload :OpenSSL, 'openssl'
-
-##
-# Persistent connections for Net::HTTP
-#
-# Bundler::Persistent::Net::HTTP::Persistent maintains persistent connections across all the
-# servers you wish to talk to. For each host:port you communicate with a
-# single persistent connection is created.
-#
-# Multiple Bundler::Persistent::Net::HTTP::Persistent objects will share the same set of
-# connections.
-#
-# For each thread you start a new connection will be created. A
-# Bundler::Persistent::Net::HTTP::Persistent connection will not be shared across threads.
-#
-# You can shut down the HTTP connections when done by calling #shutdown. You
-# should name your Bundler::Persistent::Net::HTTP::Persistent object if you intend to call this
-# method.
-#
-# Example:
-#
-# require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
-#
-# uri = Bundler::URI 'http://example.com/awesome/web/service'
-#
-# http = Bundler::Persistent::Net::HTTP::Persistent.new name: 'my_app_name'
-#
-# # perform a GET
-# response = http.request uri
-#
-# # or
-#
-# get = Net::HTTP::Get.new uri.request_uri
-# response = http.request get
-#
-# # create a POST
-# post_uri = uri + 'create'
-# post = Net::HTTP::Post.new post_uri.path
-# post.set_form_data 'some' => 'cool data'
-#
-# # perform the POST, the Bundler::URI is always required
-# response http.request post_uri, post
-#
-# Note that for GET, HEAD and other requests that do not have a body you want
-# to use Bundler::URI#request_uri not Bundler::URI#path. The request_uri contains the query
-# params which are sent in the body for other requests.
-#
-# == SSL
-#
-# SSL connections are automatically created depending upon the scheme of the
-# Bundler::URI. SSL connections are automatically verified against the default
-# certificate store for your computer. You can override this by changing
-# verify_mode or by specifying an alternate cert_store.
-#
-# Here are the SSL settings, see the individual methods for documentation:
-#
-# #certificate :: This client's certificate
-# #ca_file :: The certificate-authorities
-# #ca_path :: Directory with certificate-authorities
-# #cert_store :: An SSL certificate store
-# #ciphers :: List of SSl ciphers allowed
-# #private_key :: The client's SSL private key
-# #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new
-# connection
-# #ssl_timeout :: SSL session lifetime
-# #ssl_version :: Which specific SSL version to use
-# #verify_callback :: For server certificate verification
-# #verify_depth :: Depth of certificate verification
-# #verify_mode :: How connections should be verified
-#
-# == Proxies
-#
-# A proxy can be set through #proxy= or at initialization time by providing a
-# second argument to ::new. The proxy may be the Bundler::URI of the proxy server or
-# <code>:ENV</code> which will consult environment variables.
-#
-# See #proxy= and #proxy_from_env for details.
-#
-# == Headers
-#
-# Headers may be specified for use in every request. #headers are appended to
-# any headers on the request. #override_headers replace existing headers on
-# the request.
-#
-# The difference between the two can be seen in setting the User-Agent. Using
-# <code>http.headers['User-Agent'] = 'MyUserAgent'</code> will send "Ruby,
-# MyUserAgent" while <code>http.override_headers['User-Agent'] =
-# 'MyUserAgent'</code> will send "MyUserAgent".
-#
-# == Tuning
-#
-# === Segregation
-#
-# By providing an application name to ::new you can separate your connections
-# from the connections of other applications.
-#
-# === Idle Timeout
-#
-# If a connection hasn't been used for this number of seconds it will automatically be
-# reset upon the next use to avoid attempting to send to a closed connection.
-# The default value is 5 seconds. nil means no timeout. Set through #idle_timeout.
-#
-# Reducing this value may help avoid the "too many connection resets" error
-# when sending non-idempotent requests while increasing this value will cause
-# fewer round-trips.
-#
-# === Read Timeout
-#
-# The amount of time allowed between reading two chunks from the socket. Set
-# through #read_timeout
-#
-# === Max Requests
-#
-# The number of requests that should be made before opening a new connection.
-# Typically many keep-alive capable servers tune this to 100 or less, so the
-# 101st request will fail with ECONNRESET. If unset (default), this value has no
-# effect, if set, connections will be reset on the request after max_requests.
-#
-# === Open Timeout
-#
-# The amount of time to wait for a connection to be opened. Set through
-# #open_timeout.
-#
-# === Socket Options
-#
-# Socket options may be set on newly-created connections. See #socket_options
-# for details.
-#
-# === Non-Idempotent Requests
-#
-# By default non-idempotent requests will not be retried per RFC 2616. By
-# setting retry_change_requests to true requests will automatically be retried
-# once.
-#
-# Only do this when you know that retrying a POST or other non-idempotent
-# request is safe for your application and will not create duplicate
-# resources.
-#
-# The recommended way to handle non-idempotent requests is the following:
-#
-# require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
-#
-# uri = Bundler::URI 'http://example.com/awesome/web/service'
-# post_uri = uri + 'create'
-#
-# http = Bundler::Persistent::Net::HTTP::Persistent.new name: 'my_app_name'
-#
-# post = Net::HTTP::Post.new post_uri.path
-# # ... fill in POST request
-#
-# begin
-# response = http.request post_uri, post
-# rescue Bundler::Persistent::Net::HTTP::Persistent::Error
-#
-# # POST failed, make a new request to verify the server did not process
-# # the request
-# exists_uri = uri + '...'
-# response = http.get exists_uri
-#
-# # Retry if it failed
-# retry if response.code == '404'
-# end
-#
-# The method of determining if the resource was created or not is unique to
-# the particular service you are using. Of course, you will want to add
-# protection from infinite looping.
-#
-# === Connection Termination
-#
-# If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down
-# all the connections in the current thread with #shutdown. This is not
-# recommended for normal use, it should only be used when it will be several
-# minutes before you make another HTTP request.
-#
-# If you are using multiple threads, call #shutdown in each thread when the
-# thread is done making requests. If you don't call shutdown, that's OK.
-# Ruby will automatically garbage collect and shutdown your HTTP connections
-# when the thread terminates.
-
-class Bundler::Persistent::Net::HTTP::Persistent
-
- ##
- # The beginning of Time
-
- EPOCH = Time.at 0 # :nodoc:
-
- ##
- # Is OpenSSL available? This test works with autoload
-
- HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
-
- ##
- # The default connection pool size is 1/4 the allowed open files.
-
- if Gem.win_platform? then
- DEFAULT_POOL_SIZE = 256
- else
- DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4
- end
-
- ##
- # The version of Bundler::Persistent::Net::HTTP::Persistent you are using
-
- VERSION = '3.1.0'
-
- ##
- # Exceptions rescued for automatic retry on ruby 2.0.0. This overlaps with
- # the exception list for ruby 1.x.
-
- RETRIED_EXCEPTIONS = [ # :nodoc:
- (Net::ReadTimeout if Net.const_defined? :ReadTimeout),
- IOError,
- EOFError,
- Errno::ECONNRESET,
- Errno::ECONNABORTED,
- Errno::EPIPE,
- (OpenSSL::SSL::SSLError if HAVE_OPENSSL),
- Timeout::Error,
- ].compact
-
- ##
- # Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent. Various
- # SystemCallErrors are re-raised with a human-readable message under this
- # class.
-
- class Error < StandardError; end
-
- ##
- # Use this method to detect the idle timeout of the host at +uri+. The
- # value returned can be used to configure #idle_timeout. +max+ controls the
- # maximum idle timeout to detect.
- #
- # After
- #
- # Idle timeout detection is performed by creating a connection then
- # performing a HEAD request in a loop until the connection terminates
- # waiting one additional second per loop.
- #
- # NOTE: This may not work on ruby > 1.9.
-
- def self.detect_idle_timeout uri, max = 10
- uri = Bundler::URI uri unless Bundler::URI::Generic === uri
- uri += '/'
-
- req = Net::HTTP::Head.new uri.request_uri
-
- http = new 'net-http-persistent detect_idle_timeout'
-
- http.connection_for uri do |connection|
- sleep_time = 0
-
- http = connection.http
-
- loop do
- response = http.request req
-
- $stderr.puts "HEAD #{uri} => #{response.code}" if $DEBUG
-
- unless Net::HTTPOK === response then
- raise Error, "bad response code #{response.code} detecting idle timeout"
- end
-
- break if sleep_time >= max
-
- sleep_time += 1
-
- $stderr.puts "sleeping #{sleep_time}" if $DEBUG
- sleep sleep_time
- end
- end
- rescue
- # ignore StandardErrors, we've probably found the idle timeout.
- ensure
- return sleep_time unless $!
- end
-
- ##
- # This client's OpenSSL::X509::Certificate
-
- attr_reader :certificate
-
- ##
- # For Net::HTTP parity
-
- alias cert certificate
-
- ##
- # An SSL certificate authority. Setting this will set verify_mode to
- # VERIFY_PEER.
-
- attr_reader :ca_file
-
- ##
- # A directory of SSL certificates to be used as certificate authorities.
- # Setting this will set verify_mode to VERIFY_PEER.
-
- attr_reader :ca_path
-
- ##
- # An SSL certificate store. Setting this will override the default
- # certificate store. See verify_mode for more information.
-
- attr_reader :cert_store
-
- ##
- # The ciphers allowed for SSL connections
-
- attr_reader :ciphers
-
- ##
- # Sends debug_output to this IO via Net::HTTP#set_debug_output.
- #
- # Never use this method in production code, it causes a serious security
- # hole.
-
- attr_accessor :debug_output
-
- ##
- # Current connection generation
-
- attr_reader :generation # :nodoc:
-
- ##
- # Headers that are added to every request using Net::HTTP#add_field
-
- attr_reader :headers
-
- ##
- # Maps host:port to an HTTP version. This allows us to enable version
- # specific features.
-
- attr_reader :http_versions
-
- ##
- # Maximum time an unused connection can remain idle before being
- # automatically closed.
-
- attr_accessor :idle_timeout
-
- ##
- # Maximum number of requests on a connection before it is considered expired
- # and automatically closed.
-
- attr_accessor :max_requests
-
- ##
- # The value sent in the Keep-Alive header. Defaults to 30. Not needed for
- # HTTP/1.1 servers.
- #
- # This may not work correctly for HTTP/1.0 servers
- #
- # This method may be removed in a future version as RFC 2616 does not
- # require this header.
-
- attr_accessor :keep_alive
-
- ##
- # A name for this connection. Allows you to keep your connections apart
- # from everybody else's.
-
- attr_reader :name
-
- ##
- # Seconds to wait until a connection is opened. See Net::HTTP#open_timeout
-
- attr_accessor :open_timeout
-
- ##
- # Headers that are added to every request using Net::HTTP#[]=
-
- attr_reader :override_headers
-
- ##
- # This client's SSL private key
-
- attr_reader :private_key
-
- ##
- # For Net::HTTP parity
-
- alias key private_key
-
- ##
- # The URL through which requests will be proxied
-
- attr_reader :proxy_uri
-
- ##
- # List of host suffixes which will not be proxied
-
- attr_reader :no_proxy
-
- ##
- # Test-only accessor for the connection pool
-
- attr_reader :pool # :nodoc:
-
- ##
- # Seconds to wait until reading one block. See Net::HTTP#read_timeout
-
- attr_accessor :read_timeout
-
- ##
- # Seconds to wait until writing one block. See Net::HTTP#write_timeout
-
- attr_accessor :write_timeout
-
- ##
- # By default SSL sessions are reused to avoid extra SSL handshakes. Set
- # this to false if you have problems communicating with an HTTPS server
- # like:
- #
- # SSL_connect [...] read finished A: unexpected message (OpenSSL::SSL::SSLError)
-
- attr_accessor :reuse_ssl_sessions
-
- ##
- # An array of options for Socket#setsockopt.
- #
- # By default the TCP_NODELAY option is set on sockets.
- #
- # To set additional options append them to this array:
- #
- # http.socket_options << [Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, 1]
-
- attr_reader :socket_options
-
- ##
- # Current SSL connection generation
-
- attr_reader :ssl_generation # :nodoc:
-
- ##
- # SSL session lifetime
-
- attr_reader :ssl_timeout
-
- ##
- # SSL version to use.
- #
- # By default, the version will be negotiated automatically between client
- # and server. Ruby 1.9 and newer only. Deprecated since Ruby 2.5.
-
- attr_reader :ssl_version
-
- ##
- # Minimum SSL version to use, e.g. :TLS1_1
- #
- # By default, the version will be negotiated automatically between client
- # and server. Ruby 2.5 and newer only.
-
- attr_reader :min_version
-
- ##
- # Maximum SSL version to use, e.g. :TLS1_2
- #
- # By default, the version will be negotiated automatically between client
- # and server. Ruby 2.5 and newer only.
-
- attr_reader :max_version
-
- ##
- # Where this instance's last-use times live in the thread local variables
-
- attr_reader :timeout_key # :nodoc:
-
- ##
- # SSL verification callback. Used when ca_file or ca_path is set.
-
- attr_reader :verify_callback
-
- ##
- # Sets the depth of SSL certificate verification
-
- attr_reader :verify_depth
-
- ##
- # HTTPS verify mode. Defaults to OpenSSL::SSL::VERIFY_PEER which verifies
- # the server certificate.
- #
- # If no ca_file, ca_path or cert_store is set the default system certificate
- # store is used.
- #
- # You can use +verify_mode+ to override any default values.
-
- attr_reader :verify_mode
-
- ##
- # Enable retries of non-idempotent requests that change data (e.g. POST
- # requests) when the server has disconnected.
- #
- # This will in the worst case lead to multiple requests with the same data,
- # but it may be useful for some applications. Take care when enabling
- # this option to ensure it is safe to POST or perform other non-idempotent
- # requests to the server.
-
- attr_accessor :retry_change_requests
-
- ##
- # Creates a new Bundler::Persistent::Net::HTTP::Persistent.
- #
- # Set +name+ to keep your connections apart from everybody else's. Not
- # required currently, but highly recommended. Your library name should be
- # good enough. This parameter will be required in a future version.
- #
- # +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from
- # the environment. See proxy_from_env for details.
- #
- # In order to use a Bundler::URI for the proxy you may need to do some extra work
- # beyond Bundler::URI parsing if the proxy requires a password:
- #
- # proxy = Bundler::URI 'http://proxy.example'
- # proxy.user = 'AzureDiamond'
- # proxy.password = 'hunter2'
- #
- # Set +pool_size+ to limit the maximum number of connections allowed.
- # Defaults to 1/4 the number of allowed file handles. You can have no more
- # than this many threads with active HTTP transactions.
-
- def initialize name: nil, proxy: nil, pool_size: DEFAULT_POOL_SIZE
- @name = name
-
- @debug_output = nil
- @proxy_uri = nil
- @no_proxy = []
- @headers = {}
- @override_headers = {}
- @http_versions = {}
- @keep_alive = 30
- @open_timeout = nil
- @read_timeout = nil
- @write_timeout = nil
- @idle_timeout = 5
- @max_requests = nil
- @socket_options = []
- @ssl_generation = 0 # incremented when SSL session variables change
-
- @socket_options << [Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1] if
- Socket.const_defined? :TCP_NODELAY
-
- @pool = Bundler::Persistent::Net::HTTP::Persistent::Pool.new size: pool_size do |http_args|
- Bundler::Persistent::Net::HTTP::Persistent::Connection.new Net::HTTP, http_args, @ssl_generation
- end
-
- @certificate = nil
- @ca_file = nil
- @ca_path = nil
- @ciphers = nil
- @private_key = nil
- @ssl_timeout = nil
- @ssl_version = nil
- @min_version = nil
- @max_version = nil
- @verify_callback = nil
- @verify_depth = nil
- @verify_mode = nil
- @cert_store = nil
-
- @generation = 0 # incremented when proxy Bundler::URI changes
-
- if HAVE_OPENSSL then
- @verify_mode = OpenSSL::SSL::VERIFY_PEER
- @reuse_ssl_sessions = OpenSSL::SSL.const_defined? :Session
- end
-
- @retry_change_requests = false
-
- self.proxy = proxy if proxy
- end
-
- ##
- # Sets this client's OpenSSL::X509::Certificate
-
- def certificate= certificate
- @certificate = certificate
-
- reconnect_ssl
- end
-
- # For Net::HTTP parity
- alias cert= certificate=
-
- ##
- # Sets the SSL certificate authority file.
-
- def ca_file= file
- @ca_file = file
-
- reconnect_ssl
- end
-
- ##
- # Sets the SSL certificate authority path.
-
- def ca_path= path
- @ca_path = path
-
- reconnect_ssl
- end
-
- ##
- # Overrides the default SSL certificate store used for verifying
- # connections.
-
- def cert_store= store
- @cert_store = store
-
- reconnect_ssl
- end
-
- ##
- # The ciphers allowed for SSL connections
-
- def ciphers= ciphers
- @ciphers = ciphers
-
- reconnect_ssl
- end
-
- ##
- # Creates a new connection for +uri+
-
- def connection_for uri
- use_ssl = uri.scheme.downcase == 'https'
-
- net_http_args = [uri.hostname, uri.port]
-
- if @proxy_uri and not proxy_bypass? uri.hostname, uri.port then
- net_http_args.concat @proxy_args
- else
- net_http_args.concat [nil, nil, nil, nil]
- end
-
- connection = @pool.checkout net_http_args
-
- http = connection.http
-
- connection.ressl @ssl_generation if
- connection.ssl_generation != @ssl_generation
-
- if not http.started? then
- ssl http if use_ssl
- start http
- elsif expired? connection then
- reset connection
- end
-
- http.read_timeout = @read_timeout if @read_timeout
- http.write_timeout = @write_timeout if @write_timeout && http.respond_to?(:write_timeout=)
- http.keep_alive_timeout = @idle_timeout if @idle_timeout
-
- return yield connection
- rescue Errno::ECONNREFUSED
- address = http.proxy_address || http.address
- port = http.proxy_port || http.port
-
- raise Error, "connection refused: #{address}:#{port}"
- rescue Errno::EHOSTDOWN
- address = http.proxy_address || http.address
- port = http.proxy_port || http.port
-
- raise Error, "host down: #{address}:#{port}"
- ensure
- @pool.checkin net_http_args
- end
-
- ##
- # Returns an error message containing the number of requests performed on
- # this connection
-
- def error_message connection
- connection.requests -= 1 # fixup
-
- age = Time.now - connection.last_use
-
- "after #{connection.requests} requests on #{connection.http.object_id}, " \
- "last used #{age} seconds ago"
- end
-
- ##
- # Bundler::URI::escape wrapper
-
- def escape str
- CGI.escape str if str
- end
-
- ##
- # Bundler::URI::unescape wrapper
-
- def unescape str
- CGI.unescape str if str
- end
-
-
- ##
- # Returns true if the connection should be reset due to an idle timeout, or
- # maximum request count, false otherwise.
-
- def expired? connection
- return true if @max_requests && connection.requests >= @max_requests
- return false unless @idle_timeout
- return true if @idle_timeout.zero?
-
- Time.now - connection.last_use > @idle_timeout
- end
-
- ##
- # Starts the Net::HTTP +connection+
-
- def start http
- http.set_debug_output @debug_output if @debug_output
- http.open_timeout = @open_timeout if @open_timeout
-
- http.start
-
- socket = http.instance_variable_get :@socket
-
- if socket then # for fakeweb
- @socket_options.each do |option|
- socket.io.setsockopt(*option)
- end
- end
- end
-
- ##
- # Finishes the Net::HTTP +connection+
-
- def finish connection
- connection.finish
-
- connection.http.instance_variable_set :@ssl_session, nil unless
- @reuse_ssl_sessions
- end
-
- ##
- # Returns the HTTP protocol version for +uri+
-
- def http_version uri
- @http_versions["#{uri.host}:#{uri.port}"]
- end
-
- ##
- # Is +req+ idempotent according to RFC 2616?
-
- def idempotent? req
- case req.method
- when 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE' then
- true
- end
- end
-
- ##
- # Is the request +req+ idempotent or is retry_change_requests allowed.
-
- def can_retry? req
- @retry_change_requests && !idempotent?(req)
- end
-
- ##
- # Adds "http://" to the String +uri+ if it is missing.
-
- def normalize_uri uri
- (uri =~ /^https?:/) ? uri : "http://#{uri}"
- end
-
- ##
- # Pipelines +requests+ to the HTTP server at +uri+ yielding responses if a
- # block is given. Returns all responses received.
- #
- # See
- # Net::HTTP::Pipeline[http://docs.seattlerb.org/net-http-pipeline/Net/HTTP/Pipeline.html]
- # for further details.
- #
- # Only if <tt>net-http-pipeline</tt> was required before
- # <tt>net-http-persistent</tt> #pipeline will be present.
-
- def pipeline uri, requests, &block # :yields: responses
- connection_for uri do |connection|
- connection.http.pipeline requests, &block
- end
- end
-
- ##
- # Sets this client's SSL private key
-
- def private_key= key
- @private_key = key
-
- reconnect_ssl
- end
-
- # For Net::HTTP parity
- alias key= private_key=
-
- ##
- # Sets the proxy server. The +proxy+ may be the Bundler::URI of the proxy server,
- # the symbol +:ENV+ which will read the proxy from the environment or nil to
- # disable use of a proxy. See #proxy_from_env for details on setting the
- # proxy from the environment.
- #
- # If the proxy Bundler::URI is set after requests have been made, the next request
- # will shut-down and re-open all connections.
- #
- # The +no_proxy+ query parameter can be used to specify hosts which shouldn't
- # be reached via proxy; if set it should be a comma separated list of
- # hostname suffixes, optionally with +:port+ appended, for example
- # <tt>example.com,some.host:8080</tt>.
-
- def proxy= proxy
- @proxy_uri = case proxy
- when :ENV then proxy_from_env
- when Bundler::URI::HTTP then proxy
- when nil then # ignore
- else raise ArgumentError, 'proxy must be :ENV or a Bundler::URI::HTTP'
- end
-
- @no_proxy.clear
-
- if @proxy_uri then
- @proxy_args = [
- @proxy_uri.host,
- @proxy_uri.port,
- unescape(@proxy_uri.user),
- unescape(@proxy_uri.password),
- ]
-
- @proxy_connection_id = [nil, *@proxy_args].join ':'
-
- if @proxy_uri.query then
- @no_proxy = CGI.parse(@proxy_uri.query)['no_proxy'].join(',').downcase.split(',').map { |x| x.strip }.reject { |x| x.empty? }
- end
- end
-
- reconnect
- reconnect_ssl
- end
-
- ##
- # Creates a Bundler::URI for an HTTP proxy server from ENV variables.
- #
- # If +HTTP_PROXY+ is set a proxy will be returned.
- #
- # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Bundler::URI is given the
- # indicated user and password unless HTTP_PROXY contains either of these in
- # the Bundler::URI.
- #
- # The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
- # be reached via proxy; if set it should be a comma separated list of
- # hostname suffixes, optionally with +:port+ appended, for example
- # <tt>example.com,some.host:8080</tt>. When set to <tt>*</tt> no proxy will
- # be returned.
- #
- # For Windows users, lowercase ENV variables are preferred over uppercase ENV
- # variables.
-
- def proxy_from_env
- env_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']
-
- return nil if env_proxy.nil? or env_proxy.empty?
-
- uri = Bundler::URI normalize_uri env_proxy
-
- env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
-
- # '*' is special case for always bypass
- return nil if env_no_proxy == '*'
-
- if env_no_proxy then
- uri.query = "no_proxy=#{escape(env_no_proxy)}"
- end
-
- unless uri.user or uri.password then
- uri.user = escape ENV['http_proxy_user'] || ENV['HTTP_PROXY_USER']
- uri.password = escape ENV['http_proxy_pass'] || ENV['HTTP_PROXY_PASS']
- end
-
- uri
- end
-
- ##
- # Returns true when proxy should by bypassed for host.
-
- def proxy_bypass? host, port
- host = host.downcase
- host_port = [host, port].join ':'
-
- @no_proxy.each do |name|
- return true if host[-name.length, name.length] == name or
- host_port[-name.length, name.length] == name
- end
-
- false
- end
-
- ##
- # Forces reconnection of HTTP connections.
-
- def reconnect
- @generation += 1
- end
-
- ##
- # Forces reconnection of SSL connections.
-
- def reconnect_ssl
- @ssl_generation += 1
- end
-
- ##
- # Finishes then restarts the Net::HTTP +connection+
-
- def reset connection
- http = connection.http
-
- finish connection
-
- start http
- rescue Errno::ECONNREFUSED
- e = Error.new "connection refused: #{http.address}:#{http.port}"
- e.set_backtrace $@
- raise e
- rescue Errno::EHOSTDOWN
- e = Error.new "host down: #{http.address}:#{http.port}"
- e.set_backtrace $@
- raise e
- end
-
- ##
- # Makes a request on +uri+. If +req+ is nil a Net::HTTP::Get is performed
- # against +uri+.
- #
- # If a block is passed #request behaves like Net::HTTP#request (the body of
- # the response will not have been read).
- #
- # +req+ must be a Net::HTTPGenericRequest subclass (see Net::HTTP for a list).
- #
- # If there is an error and the request is idempotent according to RFC 2616
- # it will be retried automatically.
-
- def request uri, req = nil, &block
- retried = false
- bad_response = false
-
- uri = Bundler::URI uri
- req = request_setup req || uri
- response = nil
-
- connection_for uri do |connection|
- http = connection.http
-
- begin
- connection.requests += 1
-
- response = http.request req, &block
-
- if req.connection_close? or
- (response.http_version <= '1.0' and
- not response.connection_keep_alive?) or
- response.connection_close? then
- finish connection
- end
- rescue Net::HTTPBadResponse => e
- message = error_message connection
-
- finish connection
-
- raise Error, "too many bad responses #{message}" if
- bad_response or not can_retry? req
-
- bad_response = true
- retry
- rescue *RETRIED_EXCEPTIONS => e
- request_failed e, req, connection if
- retried or not can_retry? req
-
- reset connection
-
- retried = true
- retry
- rescue Errno::EINVAL, Errno::ETIMEDOUT => e # not retried on ruby 2
- request_failed e, req, connection if retried or not can_retry? req
-
- reset connection
-
- retried = true
- retry
- rescue Exception => e
- finish connection
-
- raise
- ensure
- connection.last_use = Time.now
- end
- end
-
- @http_versions["#{uri.host}:#{uri.port}"] ||= response.http_version
-
- response
- end
-
- ##
- # Raises an Error for +exception+ which resulted from attempting the request
- # +req+ on the +connection+.
- #
- # Finishes the +connection+.
-
- def request_failed exception, req, connection # :nodoc:
- due_to = "(due to #{exception.message} - #{exception.class})"
- message = "too many connection resets #{due_to} #{error_message connection}"
-
- finish connection
-
- raise Error, message, exception.backtrace
- end
-
- ##
- # Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the
- # request.
- #
- # Returns the request.
-
- def request_setup req_or_uri # :nodoc:
- req = if Bundler::URI === req_or_uri then
- Net::HTTP::Get.new req_or_uri.request_uri
- else
- req_or_uri
- end
-
- @headers.each do |pair|
- req.add_field(*pair)
- end
-
- @override_headers.each do |name, value|
- req[name] = value
- end
-
- unless req['Connection'] then
- req.add_field 'Connection', 'keep-alive'
- req.add_field 'Keep-Alive', @keep_alive
- end
-
- req
- end
-
- ##
- # Shuts down all connections
- #
- # *NOTE*: Calling shutdown for can be dangerous!
- #
- # If any thread is still using a connection it may cause an error! Call
- # #shutdown when you are completely done making requests!
-
- def shutdown
- @pool.shutdown { |http| http.finish }
- end
-
- ##
- # Enables SSL on +connection+
-
- def ssl connection
- connection.use_ssl = true
-
- connection.ciphers = @ciphers if @ciphers
- connection.ssl_timeout = @ssl_timeout if @ssl_timeout
- connection.ssl_version = @ssl_version if @ssl_version
- connection.min_version = @min_version if @min_version
- connection.max_version = @max_version if @max_version
-
- connection.verify_depth = @verify_depth
- connection.verify_mode = @verify_mode
-
- if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
- not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
- warn <<-WARNING
- !!!SECURITY WARNING!!!
-
-The SSL HTTP connection to:
-
- #{connection.address}:#{connection.port}
-
- !!!MAY NOT BE VERIFIED!!!
-
-On your platform your OpenSSL implementation is broken.
-
-There is no difference between the values of VERIFY_NONE and VERIFY_PEER.
-
-This means that attempting to verify the security of SSL connections may not
-work. This exposes you to man-in-the-middle exploits, snooping on the
-contents of your connection and other dangers to the security of your data.
-
-To disable this warning define the following constant at top-level in your
-application:
-
- I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil
-
- WARNING
- end
-
- connection.ca_file = @ca_file if @ca_file
- connection.ca_path = @ca_path if @ca_path
-
- if @ca_file or @ca_path then
- connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
- connection.verify_callback = @verify_callback if @verify_callback
- end
-
- if @certificate and @private_key then
- connection.cert = @certificate
- connection.key = @private_key
- end
-
- connection.cert_store = if @cert_store then
- @cert_store
- else
- store = OpenSSL::X509::Store.new
- store.set_default_paths
- store
- end
- end
-
- ##
- # SSL session lifetime
-
- def ssl_timeout= ssl_timeout
- @ssl_timeout = ssl_timeout
-
- reconnect_ssl
- end
-
- ##
- # SSL version to use
-
- def ssl_version= ssl_version
- @ssl_version = ssl_version
-
- reconnect_ssl
- end
-
- ##
- # Minimum SSL version to use
-
- def min_version= min_version
- @min_version = min_version
-
- reconnect_ssl
- end
-
- ##
- # maximum SSL version to use
-
- def max_version= max_version
- @max_version = max_version
-
- reconnect_ssl
- end
-
- ##
- # Sets the depth of SSL certificate verification
-
- def verify_depth= verify_depth
- @verify_depth = verify_depth
-
- reconnect_ssl
- end
-
- ##
- # Sets the HTTPS verify mode. Defaults to OpenSSL::SSL::VERIFY_PEER.
- #
- # Setting this to VERIFY_NONE is a VERY BAD IDEA and should NEVER be used.
- # Securely transfer the correct certificate and update the default
- # certificate store or set the ca file instead.
-
- def verify_mode= verify_mode
- @verify_mode = verify_mode
-
- reconnect_ssl
- end
-
- ##
- # SSL verification callback.
-
- def verify_callback= callback
- @verify_callback = callback
-
- reconnect_ssl
- end
-
-end
-
-require_relative 'persistent/connection'
-require_relative 'persistent/pool'
-
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
deleted file mode 100644
index a57a5d1352..0000000000
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-##
-# A Net::HTTP connection wrapper that holds extra information for managing the
-# connection's lifetime.
-
-class Bundler::Persistent::Net::HTTP::Persistent::Connection # :nodoc:
-
- attr_accessor :http
-
- attr_accessor :last_use
-
- attr_accessor :requests
-
- attr_accessor :ssl_generation
-
- def initialize http_class, http_args, ssl_generation
- @http = http_class.new(*http_args)
- @ssl_generation = ssl_generation
-
- reset
- end
-
- def finish
- @http.finish
- rescue IOError
- ensure
- reset
- end
-
- def reset
- @last_use = Bundler::Persistent::Net::HTTP::Persistent::EPOCH
- @requests = 0
- end
-
- def ressl ssl_generation
- @ssl_generation = ssl_generation
-
- finish
- end
-
-end
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb
deleted file mode 100644
index 9dfa6ffdb1..0000000000
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-class Bundler::Persistent::Net::HTTP::Persistent::Pool < Bundler::ConnectionPool # :nodoc:
-
- attr_reader :available # :nodoc:
- attr_reader :key # :nodoc:
-
- def initialize(options = {}, &block)
- super
-
- @available = Bundler::Persistent::Net::HTTP::Persistent::TimedStackMulti.new(@size, &block)
- @key = "current-#{@available.object_id}"
- end
-
- def checkin net_http_args
- stack = Thread.current[@key][net_http_args] ||= []
-
- raise Bundler::ConnectionPool::Error, 'no connections are checked out' if
- stack.empty?
-
- conn = stack.pop
-
- if stack.empty?
- @available.push conn, connection_args: net_http_args
-
- Thread.current[@key].delete(net_http_args)
- Thread.current[@key] = nil if Thread.current[@key].empty?
- end
-
- nil
- end
-
- def checkout net_http_args
- stacks = Thread.current[@key] ||= {}
- stack = stacks[net_http_args] ||= []
-
- if stack.empty? then
- conn = @available.pop connection_args: net_http_args
- else
- conn = stack.last
- end
-
- stack.push conn
-
- conn
- end
-
- def shutdown
- Thread.current[@key] = nil
- super
- end
-end
-
-require_relative 'timed_stack_multi'
-
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb
deleted file mode 100644
index 2da881c554..0000000000
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-class Bundler::Persistent::Net::HTTP::Persistent::TimedStackMulti < Bundler::ConnectionPool::TimedStack # :nodoc:
-
- ##
- # Returns a new hash that has arrays for keys
- #
- # Using a class method to limit the bindings referenced by the hash's
- # default_proc
-
- def self.hash_of_arrays # :nodoc:
- Hash.new { |h,k| h[k] = [] }
- end
-
- def initialize(size = 0, &block)
- super
-
- @enqueued = 0
- @ques = self.class.hash_of_arrays
- @lru = {}
- @key = :"connection_args-#{object_id}"
- end
-
- def empty?
- (@created - @enqueued) >= @max
- end
-
- def length
- @max - @created + @enqueued
- end
-
- private
-
- def connection_stored? options = {} # :nodoc:
- !@ques[options[:connection_args]].empty?
- end
-
- def fetch_connection options = {} # :nodoc:
- connection_args = options[:connection_args]
-
- @enqueued -= 1
- lru_update connection_args
- @ques[connection_args].pop
- end
-
- def lru_update connection_args # :nodoc:
- @lru.delete connection_args
- @lru[connection_args] = true
- end
-
- def shutdown_connections # :nodoc:
- @ques.each_key do |key|
- super connection_args: key
- end
- end
-
- def store_connection obj, options = {} # :nodoc:
- @ques[options[:connection_args]].push obj
- @enqueued += 1
- end
-
- def try_create options = {} # :nodoc:
- connection_args = options[:connection_args]
-
- if @created >= @max && @enqueued >= 1
- oldest, = @lru.first
- @lru.delete oldest
- @ques[oldest].pop
-
- @created -= 1
- end
-
- if @created < @max
- @created += 1
- lru_update connection_args
- return @create_block.call(connection_args)
- end
- end
-
-end
-
diff --git a/lib/bundler/vendor/thor/lib/thor.rb b/lib/bundler/vendor/thor/lib/thor.rb
deleted file mode 100644
index 01c0b2f83c..0000000000
--- a/lib/bundler/vendor/thor/lib/thor.rb
+++ /dev/null
@@ -1,524 +0,0 @@
-require "set"
-require_relative "thor/base"
-
-class Bundler::Thor
- class << self
- # Allows for custom "Command" package naming.
- #
- # === Parameters
- # name<String>
- # options<Hash>
- #
- def package_name(name, _ = {})
- @package_name = name.nil? || name == "" ? nil : name
- end
-
- # Sets the default command when thor is executed without an explicit command to be called.
- #
- # ==== Parameters
- # meth<Symbol>:: name of the default command
- #
- def default_command(meth = nil)
- if meth
- @default_command = meth == :none ? "help" : meth.to_s
- else
- @default_command ||= from_superclass(:default_command, "help")
- end
- end
- alias_method :default_task, :default_command
-
- # Registers another Bundler::Thor subclass as a command.
- #
- # ==== Parameters
- # klass<Class>:: Bundler::Thor subclass to register
- # command<String>:: Subcommand name to use
- # usage<String>:: Short usage for the subcommand
- # description<String>:: Description for the subcommand
- def register(klass, subcommand_name, usage, description, options = {})
- if klass <= Bundler::Thor::Group
- desc usage, description, options
- define_method(subcommand_name) { |*args| invoke(klass, args) }
- else
- desc usage, description, options
- subcommand subcommand_name, klass
- end
- end
-
- # Defines the usage and the description of the next command.
- #
- # ==== Parameters
- # usage<String>
- # description<String>
- # options<String>
- #
- def desc(usage, description, options = {})
- if options[:for]
- command = find_and_refresh_command(options[:for])
- command.usage = usage if usage
- command.description = description if description
- else
- @usage = usage
- @desc = description
- @hide = options[:hide] || false
- end
- end
-
- # Defines the long description of the next command.
- #
- # ==== Parameters
- # long description<String>
- #
- def long_desc(long_description, options = {})
- if options[:for]
- command = find_and_refresh_command(options[:for])
- command.long_description = long_description if long_description
- else
- @long_desc = long_description
- end
- end
-
- # Maps an input to a command. If you define:
- #
- # map "-T" => "list"
- #
- # Running:
- #
- # thor -T
- #
- # Will invoke the list command.
- #
- # ==== Parameters
- # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command.
- #
- def map(mappings = nil, **kw)
- @map ||= from_superclass(:map, {})
-
- if mappings && !kw.empty?
- mappings = kw.merge!(mappings)
- else
- mappings ||= kw
- end
- if mappings
- mappings.each do |key, value|
- if key.respond_to?(:each)
- key.each { |subkey| @map[subkey] = value }
- else
- @map[key] = value
- end
- end
- end
-
- @map
- end
-
- # Declares the options for the next command to be declared.
- #
- # ==== Parameters
- # Hash[Symbol => Object]:: The hash key is the name of the option and the value
- # is the type of the option. Can be :string, :array, :hash, :boolean, :numeric
- # or :required (string). If you give a value, the type of the value is used.
- #
- def method_options(options = nil)
- @method_options ||= {}
- build_options(options, @method_options) if options
- @method_options
- end
-
- alias_method :options, :method_options
-
- # Adds an option to the set of method options. If :for is given as option,
- # it allows you to change the options from a previous defined command.
- #
- # def previous_command
- # # magic
- # end
- #
- # method_option :foo => :bar, :for => :previous_command
- #
- # def next_command
- # # magic
- # end
- #
- # ==== Parameters
- # name<Symbol>:: The name of the argument.
- # options<Hash>:: Described below.
- #
- # ==== Options
- # :desc - Description for the argument.
- # :required - If the argument is required or not.
- # :default - Default value for this argument. It cannot be required and have default values.
- # :aliases - Aliases for this option.
- # :type - The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
- # :banner - String to show on usage notes.
- # :hide - If you want to hide this option from the help.
- #
- def method_option(name, options = {})
- scope = if options[:for]
- find_and_refresh_command(options[:for]).options
- else
- method_options
- end
-
- build_option(name, options, scope)
- end
- alias_method :option, :method_option
-
- # Prints help information for the given command.
- #
- # ==== Parameters
- # shell<Bundler::Thor::Shell>
- # command_name<String>
- #
- def command_help(shell, command_name)
- meth = normalize_command_name(command_name)
- command = all_commands[meth]
- handle_no_command_error(meth) unless command
-
- shell.say "Usage:"
- shell.say " #{banner(command).split("\n").join("\n ")}"
- shell.say
- class_options_help(shell, nil => command.options.values)
- if command.long_description
- shell.say "Description:"
- shell.print_wrapped(command.long_description, :indent => 2)
- else
- shell.say command.description
- end
- end
- alias_method :task_help, :command_help
-
- # Prints help information for this class.
- #
- # ==== Parameters
- # shell<Bundler::Thor::Shell>
- #
- def help(shell, subcommand = false)
- list = printable_commands(true, subcommand)
- Bundler::Thor::Util.thor_classes_in(self).each do |klass|
- list += klass.printable_commands(false)
- end
- list.sort! { |a, b| a[0] <=> b[0] }
-
- if defined?(@package_name) && @package_name
- shell.say "#{@package_name} commands:"
- else
- shell.say "Commands:"
- end
-
- shell.print_table(list, :indent => 2, :truncate => true)
- shell.say
- class_options_help(shell)
- end
-
- # Returns commands ready to be printed.
- def printable_commands(all = true, subcommand = false)
- (all ? all_commands : commands).map do |_, command|
- next if command.hidden?
- item = []
- item << banner(command, false, subcommand)
- item << (command.description ? "# #{command.description.gsub(/\s+/m, ' ')}" : "")
- item
- end.compact
- end
- alias_method :printable_tasks, :printable_commands
-
- def subcommands
- @subcommands ||= from_superclass(:subcommands, [])
- end
- alias_method :subtasks, :subcommands
-
- def subcommand_classes
- @subcommand_classes ||= {}
- end
-
- def subcommand(subcommand, subcommand_class)
- subcommands << subcommand.to_s
- subcommand_class.subcommand_help subcommand
- subcommand_classes[subcommand.to_s] = subcommand_class
-
- define_method(subcommand) do |*args|
- args, opts = Bundler::Thor::Arguments.split(args)
- invoke_args = [args, opts, {:invoked_via_subcommand => true, :class_options => options}]
- invoke_args.unshift "help" if opts.delete("--help") || opts.delete("-h")
- invoke subcommand_class, *invoke_args
- end
- subcommand_class.commands.each do |_meth, command|
- command.ancestor_name = subcommand
- end
- end
- alias_method :subtask, :subcommand
-
- # Extend check unknown options to accept a hash of conditions.
- #
- # === Parameters
- # options<Hash>: A hash containing :only and/or :except keys
- def check_unknown_options!(options = {})
- @check_unknown_options ||= {}
- options.each do |key, value|
- if value
- @check_unknown_options[key] = Array(value)
- else
- @check_unknown_options.delete(key)
- end
- end
- @check_unknown_options
- end
-
- # Overwrite check_unknown_options? to take subcommands and options into account.
- def check_unknown_options?(config) #:nodoc:
- options = check_unknown_options
- return false unless options
-
- command = config[:current_command]
- return true unless command
-
- name = command.name
-
- if subcommands.include?(name)
- false
- elsif options[:except]
- !options[:except].include?(name.to_sym)
- elsif options[:only]
- options[:only].include?(name.to_sym)
- else
- true
- end
- end
-
- # Stop parsing of options as soon as an unknown option or a regular
- # argument is encountered. All remaining arguments are passed to the command.
- # This is useful if you have a command that can receive arbitrary additional
- # options, and where those additional options should not be handled by
- # Bundler::Thor.
- #
- # ==== Example
- #
- # To better understand how this is useful, let's consider a command that calls
- # an external command. A user may want to pass arbitrary options and
- # arguments to that command. The command itself also accepts some options,
- # which should be handled by Bundler::Thor.
- #
- # class_option "verbose", :type => :boolean
- # stop_on_unknown_option! :exec
- # check_unknown_options! :except => :exec
- #
- # desc "exec", "Run a shell command"
- # def exec(*args)
- # puts "diagnostic output" if options[:verbose]
- # Kernel.exec(*args)
- # end
- #
- # Here +exec+ can be called with +--verbose+ to get diagnostic output,
- # e.g.:
- #
- # $ thor exec --verbose echo foo
- # diagnostic output
- # foo
- #
- # But if +--verbose+ is given after +echo+, it is passed to +echo+ instead:
- #
- # $ thor exec echo --verbose foo
- # --verbose foo
- #
- # ==== Parameters
- # Symbol ...:: A list of commands that should be affected.
- def stop_on_unknown_option!(*command_names)
- stop_on_unknown_option.merge(command_names)
- end
-
- def stop_on_unknown_option?(command) #:nodoc:
- command && stop_on_unknown_option.include?(command.name.to_sym)
- end
-
- # Disable the check for required options for the given commands.
- # This is useful if you have a command that does not need the required options
- # to work, like help.
- #
- # ==== Parameters
- # Symbol ...:: A list of commands that should be affected.
- def disable_required_check!(*command_names)
- disable_required_check.merge(command_names)
- end
-
- def disable_required_check?(command) #:nodoc:
- command && disable_required_check.include?(command.name.to_sym)
- end
-
- def deprecation_warning(message) #:nodoc:
- unless ENV['THOR_SILENCE_DEPRECATION']
- warn "Deprecation warning: #{message}\n" +
- 'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
- end
- end
-
- protected
-
- def stop_on_unknown_option #:nodoc:
- @stop_on_unknown_option ||= Set.new
- end
-
- # help command has the required check disabled by default.
- def disable_required_check #:nodoc:
- @disable_required_check ||= Set.new([:help])
- end
-
- # The method responsible for dispatching given the args.
- def dispatch(meth, given_args, given_opts, config) #:nodoc: # rubocop:disable MethodLength
- meth ||= retrieve_command_name(given_args)
- command = all_commands[normalize_command_name(meth)]
-
- if !command && config[:invoked_via_subcommand]
- # We're a subcommand and our first argument didn't match any of our
- # commands. So we put it back and call our default command.
- given_args.unshift(meth)
- command = all_commands[normalize_command_name(default_command)]
- end
-
- if command
- args, opts = Bundler::Thor::Options.split(given_args)
- if stop_on_unknown_option?(command) && !args.empty?
- # given_args starts with a non-option, so we treat everything as
- # ordinary arguments
- args.concat opts
- opts.clear
- end
- else
- args = given_args
- opts = nil
- command = dynamic_command_class.new(meth)
- end
-
- opts = given_opts || opts || []
- config[:current_command] = command
- config[:command_options] = command.options
-
- instance = new(args, opts, config)
- yield instance if block_given?
- args = instance.args
- trailing = args[Range.new(arguments.size, -1)]
- instance.invoke_command(command, trailing || [])
- end
-
- # The banner for this class. You can customize it if you are invoking the
- # thor class by another ways which is not the Bundler::Thor::Runner. It receives
- # the command that is going to be invoked and a boolean which indicates if
- # the namespace should be displayed as arguments.
- #
- def banner(command, namespace = nil, subcommand = false)
- $thor_runner ||= false
- command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |formatted_usage|
- "#{basename} #{formatted_usage}"
- end.join("\n")
- end
-
- def baseclass #:nodoc:
- Bundler::Thor
- end
-
- def dynamic_command_class #:nodoc:
- Bundler::Thor::DynamicCommand
- end
-
- def create_command(meth) #:nodoc:
- @usage ||= nil
- @desc ||= nil
- @long_desc ||= nil
- @hide ||= nil
-
- if @usage && @desc
- base_class = @hide ? Bundler::Thor::HiddenCommand : Bundler::Thor::Command
- commands[meth] = base_class.new(meth, @desc, @long_desc, @usage, method_options)
- @usage, @desc, @long_desc, @method_options, @hide = nil
- true
- elsif all_commands[meth] || meth == "method_missing"
- true
- else
- puts "[WARNING] Attempted to create command #{meth.inspect} without usage or description. " \
- "Call desc if you want this method to be available as command or declare it inside a " \
- "no_commands{} block. Invoked from #{caller[1].inspect}."
- false
- end
- end
- alias_method :create_task, :create_command
-
- def initialize_added #:nodoc:
- class_options.merge!(method_options)
- @method_options = nil
- end
-
- # Retrieve the command name from given args.
- def retrieve_command_name(args) #:nodoc:
- meth = args.first.to_s unless args.empty?
- args.shift if meth && (map[meth] || meth !~ /^\-/)
- end
- alias_method :retrieve_task_name, :retrieve_command_name
-
- # receives a (possibly nil) command name and returns a name that is in
- # the commands hash. In addition to normalizing aliases, this logic
- # will determine if a shortened command is an unambiguous substring of
- # a command or alias.
- #
- # +normalize_command_name+ also converts names like +animal-prison+
- # into +animal_prison+.
- def normalize_command_name(meth) #:nodoc:
- return default_command.to_s.tr("-", "_") unless meth
-
- possibilities = find_command_possibilities(meth)
- raise AmbiguousTaskError, "Ambiguous command #{meth} matches [#{possibilities.join(', ')}]" if possibilities.size > 1
-
- if possibilities.empty?
- meth ||= default_command
- elsif map[meth]
- meth = map[meth]
- else
- meth = possibilities.first
- end
-
- meth.to_s.tr("-", "_") # treat foo-bar as foo_bar
- end
- alias_method :normalize_task_name, :normalize_command_name
-
- # this is the logic that takes the command name passed in by the user
- # and determines whether it is an unambiguous substrings of a command or
- # alias name.
- def find_command_possibilities(meth)
- len = meth.to_s.length
- possibilities = all_commands.merge(map).keys.select { |n| meth == n[0, len] }.sort
- unique_possibilities = possibilities.map { |k| map[k] || k }.uniq
-
- if possibilities.include?(meth)
- [meth]
- elsif unique_possibilities.size == 1
- unique_possibilities
- else
- possibilities
- end
- end
- alias_method :find_task_possibilities, :find_command_possibilities
-
- def subcommand_help(cmd)
- desc "help [COMMAND]", "Describe subcommands or one specific subcommand"
- class_eval "
- def help(command = nil, subcommand = true); super; end
-"
- end
- alias_method :subtask_help, :subcommand_help
- end
-
- include Bundler::Thor::Base
-
- map HELP_MAPPINGS => :help
-
- desc "help [COMMAND]", "Describe available commands or one specific command"
- def help(command = nil, subcommand = false)
- if command
- if self.class.subcommands.include? command
- self.class.subcommand_classes[command].help(shell, true)
- else
- self.class.command_help(shell, command)
- end
- else
- self.class.help(shell, subcommand)
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions.rb b/lib/bundler/vendor/thor/lib/thor/actions.rb
deleted file mode 100644
index a5368d07f3..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions.rb
+++ /dev/null
@@ -1,336 +0,0 @@
-require_relative "actions/create_file"
-require_relative "actions/create_link"
-require_relative "actions/directory"
-require_relative "actions/empty_directory"
-require_relative "actions/file_manipulation"
-require_relative "actions/inject_into_file"
-
-class Bundler::Thor
- module Actions
- attr_accessor :behavior
-
- def self.included(base) #:nodoc:
- super(base)
- base.extend ClassMethods
- end
-
- module ClassMethods
- # Hold source paths for one Bundler::Thor instance. source_paths_for_search is the
- # method responsible to gather source_paths from this current class,
- # inherited paths and the source root.
- #
- def source_paths
- @_source_paths ||= []
- end
-
- # Stores and return the source root for this class
- def source_root(path = nil)
- @_source_root = path if path
- @_source_root ||= nil
- end
-
- # Returns the source paths in the following order:
- #
- # 1) This class source paths
- # 2) Source root
- # 3) Parents source paths
- #
- def source_paths_for_search
- paths = []
- paths += source_paths
- paths << source_root if source_root
- paths += from_superclass(:source_paths, [])
- paths
- end
-
- # Add runtime options that help actions execution.
- #
- def add_runtime_options!
- class_option :force, :type => :boolean, :aliases => "-f", :group => :runtime,
- :desc => "Overwrite files that already exist"
-
- class_option :pretend, :type => :boolean, :aliases => "-p", :group => :runtime,
- :desc => "Run but do not make any changes"
-
- class_option :quiet, :type => :boolean, :aliases => "-q", :group => :runtime,
- :desc => "Suppress status output"
-
- class_option :skip, :type => :boolean, :aliases => "-s", :group => :runtime,
- :desc => "Skip files that already exist"
- end
- end
-
- # Extends initializer to add more configuration options.
- #
- # ==== Configuration
- # behavior<Symbol>:: The actions default behavior. Can be :invoke or :revoke.
- # It also accepts :force, :skip and :pretend to set the behavior
- # and the respective option.
- #
- # destination_root<String>:: The root directory needed for some actions.
- #
- def initialize(args = [], options = {}, config = {})
- self.behavior = case config[:behavior].to_s
- when "force", "skip"
- _cleanup_options_and_set(options, config[:behavior])
- :invoke
- when "revoke"
- :revoke
- else
- :invoke
- end
-
- super
- self.destination_root = config[:destination_root]
- end
-
- # Wraps an action object and call it accordingly to the thor class behavior.
- #
- def action(instance) #:nodoc:
- if behavior == :revoke
- instance.revoke!
- else
- instance.invoke!
- end
- end
-
- # Returns the root for this thor class (also aliased as destination root).
- #
- def destination_root
- @destination_stack.last
- end
-
- # Sets the root for this thor class. Relatives path are added to the
- # directory where the script was invoked and expanded.
- #
- def destination_root=(root)
- @destination_stack ||= []
- @destination_stack[0] = File.expand_path(root || "")
- end
-
- # Returns the given path relative to the absolute root (ie, root where
- # the script started).
- #
- def relative_to_original_destination_root(path, remove_dot = true)
- root = @destination_stack[0]
- if path.start_with?(root) && [File::SEPARATOR, File::ALT_SEPARATOR, nil, ''].include?(path[root.size..root.size])
- path = path.dup
- path[0...root.size] = '.'
- remove_dot ? (path[2..-1] || "") : path
- else
- path
- end
- end
-
- # Holds source paths in instance so they can be manipulated.
- #
- def source_paths
- @source_paths ||= self.class.source_paths_for_search
- end
-
- # Receives a file or directory and search for it in the source paths.
- #
- def find_in_source_paths(file)
- possible_files = [file, file + TEMPLATE_EXTNAME]
- relative_root = relative_to_original_destination_root(destination_root, false)
-
- source_paths.each do |source|
- possible_files.each do |f|
- source_file = File.expand_path(f, File.join(source, relative_root))
- return source_file if File.exist?(source_file)
- end
- end
-
- message = "Could not find #{file.inspect} in any of your source paths. ".dup
-
- unless self.class.source_root
- message << "Please invoke #{self.class.name}.source_root(PATH) with the PATH containing your templates. "
- end
-
- message << if source_paths.empty?
- "Currently you have no source paths."
- else
- "Your current source paths are: \n#{source_paths.join("\n")}"
- end
-
- raise Error, message
- end
-
- # Do something in the root or on a provided subfolder. If a relative path
- # is given it's referenced from the current root. The full path is yielded
- # to the block you provide. The path is set back to the previous path when
- # the method exits.
- #
- # ==== Parameters
- # dir<String>:: the directory to move to.
- # config<Hash>:: give :verbose => true to log and use padding.
- #
- def inside(dir = "", config = {}, &block)
- verbose = config.fetch(:verbose, false)
- pretend = options[:pretend]
-
- say_status :inside, dir, verbose
- shell.padding += 1 if verbose
- @destination_stack.push File.expand_path(dir, destination_root)
-
- # If the directory doesnt exist and we're not pretending
- if !File.exist?(destination_root) && !pretend
- require "fileutils"
- FileUtils.mkdir_p(destination_root)
- end
-
- if pretend
- # In pretend mode, just yield down to the block
- block.arity == 1 ? yield(destination_root) : yield
- else
- require "fileutils"
- FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield }
- end
-
- @destination_stack.pop
- shell.padding -= 1 if verbose
- end
-
- # Goes to the root and execute the given block.
- #
- def in_root
- inside(@destination_stack.first) { yield }
- end
-
- # Loads an external file and execute it in the instance binding.
- #
- # ==== Parameters
- # path<String>:: The path to the file to execute. Can be a web address or
- # a relative path from the source root.
- #
- # ==== Examples
- #
- # apply "http://gist.github.com/103208"
- #
- # apply "recipes/jquery.rb"
- #
- def apply(path, config = {})
- verbose = config.fetch(:verbose, true)
- is_uri = path =~ %r{^https?\://}
- path = find_in_source_paths(path) unless is_uri
-
- say_status :apply, path, verbose
- shell.padding += 1 if verbose
-
- contents = if is_uri
- require "open-uri"
- open(path, "Accept" => "application/x-thor-template", &:read)
- else
- open(path, &:read)
- end
-
- instance_eval(contents, path)
- shell.padding -= 1 if verbose
- end
-
- # Executes a command returning the contents of the command.
- #
- # ==== Parameters
- # command<String>:: the command to be executed.
- # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output. Specify :with
- # to append an executable to command execution.
- #
- # ==== Example
- #
- # inside('vendor') do
- # run('ln -s ~/edge rails')
- # end
- #
- def run(command, config = {})
- return unless behavior == :invoke
-
- destination = relative_to_original_destination_root(destination_root, false)
- desc = "#{command} from #{destination.inspect}"
-
- if config[:with]
- desc = "#{File.basename(config[:with].to_s)} #{desc}"
- command = "#{config[:with]} #{command}"
- end
-
- say_status :run, desc, config.fetch(:verbose, true)
-
- return if options[:pretend]
-
- env_splat = [config[:env]] if config[:env]
-
- if config[:capture]
- require "open3"
- result, status = Open3.capture2e(*env_splat, command.to_s)
- success = status.success?
- else
- result = system(*env_splat, command.to_s)
- success = result
- end
-
- abort if !success && config.fetch(:abort_on_failure, self.class.exit_on_failure?)
-
- result
- end
-
- # Executes a ruby script (taking into account WIN32 platform quirks).
- #
- # ==== Parameters
- # command<String>:: the command to be executed.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- def run_ruby_script(command, config = {})
- return unless behavior == :invoke
- run command, config.merge(:with => Bundler::Thor::Util.ruby_command)
- end
-
- # Run a thor command. A hash of options can be given and it's converted to
- # switches.
- #
- # ==== Parameters
- # command<String>:: the command to be invoked
- # args<Array>:: arguments to the command
- # config<Hash>:: give :verbose => false to not log the status, :capture => true to hide to output.
- # Other options are given as parameter to Bundler::Thor.
- #
- #
- # ==== Examples
- #
- # thor :install, "http://gist.github.com/103208"
- # #=> thor install http://gist.github.com/103208
- #
- # thor :list, :all => true, :substring => 'rails'
- # #=> thor list --all --substring=rails
- #
- def thor(command, *args)
- config = args.last.is_a?(Hash) ? args.pop : {}
- verbose = config.key?(:verbose) ? config.delete(:verbose) : true
- pretend = config.key?(:pretend) ? config.delete(:pretend) : false
- capture = config.key?(:capture) ? config.delete(:capture) : false
-
- args.unshift(command)
- args.push Bundler::Thor::Options.to_switches(config)
- command = args.join(" ").strip
-
- run command, :with => :thor, :verbose => verbose, :pretend => pretend, :capture => capture
- end
-
- protected
-
- # Allow current root to be shared between invocations.
- #
- def _shared_configuration #:nodoc:
- super.merge!(:destination_root => destination_root)
- end
-
- def _cleanup_options_and_set(options, key) #:nodoc:
- case options
- when Array
- %w(--force -f --skip -s).each { |i| options.delete(i) }
- options << "--#{key}"
- when Hash
- [:force, :skip, "force", "skip"].each { |i| options.delete(i) }
- options.merge!(key => true)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb b/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb
deleted file mode 100644
index 330fc08cae..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-require_relative "empty_directory"
-
-class Bundler::Thor
- module Actions
- # Create a new file relative to the destination root with the given data,
- # which is the return value of a block or a data string.
- #
- # ==== Parameters
- # destination<String>:: the relative path to the destination root.
- # data<String|NilClass>:: the data to append to the file.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # create_file "lib/fun_party.rb" do
- # hostname = ask("What is the virtual hostname I should use?")
- # "vhost.name = #{hostname}"
- # end
- #
- # create_file "config/apache.conf", "your apache config"
- #
- def create_file(destination, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- data = args.first
- action CreateFile.new(self, destination, block || data.to_s, config)
- end
- alias_method :add_file, :create_file
-
- # CreateFile is a subset of Template, which instead of rendering a file with
- # ERB, it gets the content from the user.
- #
- class CreateFile < EmptyDirectory #:nodoc:
- attr_reader :data
-
- def initialize(base, destination, data, config = {})
- @data = data
- super(base, destination, config)
- end
-
- # Checks if the content of the file at the destination is identical to the rendered result.
- #
- # ==== Returns
- # Boolean:: true if it is identical, false otherwise.
- #
- def identical?
- exists? && File.binread(destination) == render
- end
-
- # Holds the content to be added to the file.
- #
- def render
- @render ||= if data.is_a?(Proc)
- data.call
- else
- data
- end
- end
-
- def invoke!
- invoke_with_conflict_check do
- require "fileutils"
- FileUtils.mkdir_p(File.dirname(destination))
- File.open(destination, "wb") { |f| f.write render }
- end
- given_destination
- end
-
- protected
-
- # Now on conflict we check if the file is identical or not.
- #
- def on_conflict_behavior(&block)
- if identical?
- say_status :identical, :blue
- else
- options = base.options.merge(config)
- force_or_skip_or_conflict(options[:force], options[:skip], &block)
- end
- end
-
- # If force is true, run the action, otherwise check if it's not being
- # skipped. If both are false, show the file_collision menu, if the menu
- # returns true, force it, otherwise skip.
- #
- def force_or_skip_or_conflict(force, skip, &block)
- if force
- say_status :force, :yellow
- yield unless pretend?
- elsif skip
- say_status :skip, :yellow
- else
- say_status :conflict, :red
- force_or_skip_or_conflict(force_on_collision?, true, &block)
- end
- end
-
- # Shows the file collision menu to the user and gets the result.
- #
- def force_on_collision?
- base.shell.file_collision(destination) { render }
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb b/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb
deleted file mode 100644
index 70504a2c1f..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require_relative "create_file"
-
-class Bundler::Thor
- module Actions
- # Create a new file relative to the destination root from the given source.
- #
- # ==== Parameters
- # destination<String>:: the relative path to the destination root.
- # source<String|NilClass>:: the relative path to the source root.
- # config<Hash>:: give :verbose => false to not log the status.
- # :: give :symbolic => false for hard link.
- #
- # ==== Examples
- #
- # create_link "config/apache.conf", "/etc/apache.conf"
- #
- def create_link(destination, *args)
- config = args.last.is_a?(Hash) ? args.pop : {}
- source = args.first
- action CreateLink.new(self, destination, source, config)
- end
- alias_method :add_link, :create_link
-
- # CreateLink is a subset of CreateFile, which instead of taking a block of
- # data, just takes a source string from the user.
- #
- class CreateLink < CreateFile #:nodoc:
- attr_reader :data
-
- # Checks if the content of the file at the destination is identical to the rendered result.
- #
- # ==== Returns
- # Boolean:: true if it is identical, false otherwise.
- #
- def identical?
- exists? && File.identical?(render, destination)
- end
-
- def invoke!
- invoke_with_conflict_check do
- require "fileutils"
- FileUtils.mkdir_p(File.dirname(destination))
- # Create a symlink by default
- config[:symbolic] = true if config[:symbolic].nil?
- File.unlink(destination) if exists?
- if config[:symbolic]
- File.symlink(render, destination)
- else
- File.link(render, destination)
- end
- end
- given_destination
- end
-
- def exists?
- super || File.symlink?(destination)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/directory.rb b/lib/bundler/vendor/thor/lib/thor/actions/directory.rb
deleted file mode 100644
index d37327a139..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions/directory.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-require_relative "empty_directory"
-
-class Bundler::Thor
- module Actions
- # Copies recursively the files from source directory to root directory.
- # If any of the files finishes with .tt, it's considered to be a template
- # and is placed in the destination without the extension .tt. If any
- # empty directory is found, it's copied and all .empty_directory files are
- # ignored. If any file name is wrapped within % signs, the text within
- # the % signs will be executed as a method and replaced with the returned
- # value. Let's suppose a doc directory with the following files:
- #
- # doc/
- # components/.empty_directory
- # README
- # rdoc.rb.tt
- # %app_name%.rb
- #
- # When invoked as:
- #
- # directory "doc"
- #
- # It will create a doc directory in the destination with the following
- # files (assuming that the `app_name` method returns the value "blog"):
- #
- # doc/
- # components/
- # README
- # rdoc.rb
- # blog.rb
- #
- # <b>Encoded path note:</b> Since Bundler::Thor internals use Object#respond_to? to check if it can
- # expand %something%, this `something` should be a public method in the class calling
- # #directory. If a method is private, Bundler::Thor stack raises PrivateMethodEncodedError.
- #
- # ==== Parameters
- # source<String>:: the relative path to the source root.
- # destination<String>:: the relative path to the destination root.
- # config<Hash>:: give :verbose => false to not log the status.
- # If :recursive => false, does not look for paths recursively.
- # If :mode => :preserve, preserve the file mode from the source.
- # If :exclude_pattern => /regexp/, prevents copying files that match that regexp.
- #
- # ==== Examples
- #
- # directory "doc"
- # directory "doc", "docs", :recursive => false
- #
- def directory(source, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- destination = args.first || source
- action Directory.new(self, source, destination || source, config, &block)
- end
-
- class Directory < EmptyDirectory #:nodoc:
- attr_reader :source
-
- def initialize(base, source, destination = nil, config = {}, &block)
- @source = File.expand_path(Dir[Util.escape_globs(base.find_in_source_paths(source.to_s))].first)
- @block = block
- super(base, destination, {:recursive => true}.merge(config))
- end
-
- def invoke!
- base.empty_directory given_destination, config
- execute!
- end
-
- def revoke!
- execute!
- end
-
- protected
-
- def execute!
- lookup = Util.escape_globs(source)
- lookup = config[:recursive] ? File.join(lookup, "**") : lookup
- lookup = file_level_lookup(lookup)
-
- files(lookup).sort.each do |file_source|
- next if File.directory?(file_source)
- next if config[:exclude_pattern] && file_source.match(config[:exclude_pattern])
- file_destination = File.join(given_destination, file_source.gsub(source, "."))
- file_destination.gsub!("/./", "/")
-
- case file_source
- when /\.empty_directory$/
- dirname = File.dirname(file_destination).gsub(%r{/\.$}, "")
- next if dirname == given_destination
- base.empty_directory(dirname, config)
- when /#{TEMPLATE_EXTNAME}$/
- base.template(file_source, file_destination[0..-4], config, &@block)
- else
- base.copy_file(file_source, file_destination, config, &@block)
- end
- end
- end
-
- def file_level_lookup(previous_lookup)
- File.join(previous_lookup, "*")
- end
-
- def files(lookup)
- Dir.glob(lookup, File::FNM_DOTMATCH)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb b/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb
deleted file mode 100644
index 284d92c19a..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-class Bundler::Thor
- module Actions
- # Creates an empty directory.
- #
- # ==== Parameters
- # destination<String>:: the relative path to the destination root.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # empty_directory "doc"
- #
- def empty_directory(destination, config = {})
- action EmptyDirectory.new(self, destination, config)
- end
-
- # Class which holds create directory logic. This is the base class for
- # other actions like create_file and directory.
- #
- # This implementation is based in Templater actions, created by Jonas Nicklas
- # and Michael S. Klishin under MIT LICENSE.
- #
- class EmptyDirectory #:nodoc:
- attr_reader :base, :destination, :given_destination, :relative_destination, :config
-
- # Initializes given the source and destination.
- #
- # ==== Parameters
- # base<Bundler::Thor::Base>:: A Bundler::Thor::Base instance
- # source<String>:: Relative path to the source of this file
- # destination<String>:: Relative path to the destination of this file
- # config<Hash>:: give :verbose => false to not log the status.
- #
- def initialize(base, destination, config = {})
- @base = base
- @config = {:verbose => true}.merge(config)
- self.destination = destination
- end
-
- # Checks if the destination file already exists.
- #
- # ==== Returns
- # Boolean:: true if the file exists, false otherwise.
- #
- def exists?
- ::File.exist?(destination)
- end
-
- def invoke!
- invoke_with_conflict_check do
- require "fileutils"
- ::FileUtils.mkdir_p(destination)
- end
- end
-
- def revoke!
- say_status :remove, :red
- require "fileutils"
- ::FileUtils.rm_rf(destination) if !pretend? && exists?
- given_destination
- end
-
- protected
-
- # Shortcut for pretend.
- #
- def pretend?
- base.options[:pretend]
- end
-
- # Sets the absolute destination value from a relative destination value.
- # It also stores the given and relative destination. Let's suppose our
- # script is being executed on "dest", it sets the destination root to
- # "dest". The destination, given_destination and relative_destination
- # are related in the following way:
- #
- # inside "bar" do
- # empty_directory "baz"
- # end
- #
- # destination #=> dest/bar/baz
- # relative_destination #=> bar/baz
- # given_destination #=> baz
- #
- def destination=(destination)
- return unless destination
- @given_destination = convert_encoded_instructions(destination.to_s)
- @destination = ::File.expand_path(@given_destination, base.destination_root)
- @relative_destination = base.relative_to_original_destination_root(@destination)
- end
-
- # Filenames in the encoded form are converted. If you have a file:
- #
- # %file_name%.rb
- #
- # It calls #file_name from the base and replaces %-string with the
- # return value (should be String) of #file_name:
- #
- # user.rb
- #
- # The method referenced can be either public or private.
- #
- def convert_encoded_instructions(filename)
- filename.gsub(/%(.*?)%/) do |initial_string|
- method = $1.strip
- base.respond_to?(method, true) ? base.send(method) : initial_string
- end
- end
-
- # Receives a hash of options and just execute the block if some
- # conditions are met.
- #
- def invoke_with_conflict_check(&block)
- if exists?
- on_conflict_behavior(&block)
- else
- yield unless pretend?
- say_status :create, :green
- end
-
- destination
- rescue Errno::EISDIR, Errno::EEXIST
- on_file_clash_behavior
- end
-
- def on_file_clash_behavior
- say_status :file_clash, :red
- end
-
- # What to do when the destination file already exists.
- #
- def on_conflict_behavior
- say_status :exist, :blue
- end
-
- # Shortcut to say_status shell method.
- #
- def say_status(status, color)
- base.shell.say_status status, relative_destination, color if config[:verbose]
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb b/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb
deleted file mode 100644
index afdbd53dd0..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb
+++ /dev/null
@@ -1,373 +0,0 @@
-require "erb"
-
-class Bundler::Thor
- module Actions
- # Copies the file from the relative source to the relative destination. If
- # the destination is not given it's assumed to be equal to the source.
- #
- # ==== Parameters
- # source<String>:: the relative path to the source root.
- # destination<String>:: the relative path to the destination root.
- # config<Hash>:: give :verbose => false to not log the status, and
- # :mode => :preserve, to preserve the file mode from the source.
-
- #
- # ==== Examples
- #
- # copy_file "README", "doc/README"
- #
- # copy_file "doc/README"
- #
- def copy_file(source, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- destination = args.first || source
- source = File.expand_path(find_in_source_paths(source.to_s))
-
- resulting_destination = create_file destination, nil, config do
- content = File.binread(source)
- content = yield(content) if block
- content
- end
- if config[:mode] == :preserve
- mode = File.stat(source).mode
- chmod(resulting_destination, mode, config)
- end
- end
-
- # Links the file from the relative source to the relative destination. If
- # the destination is not given it's assumed to be equal to the source.
- #
- # ==== Parameters
- # source<String>:: the relative path to the source root.
- # destination<String>:: the relative path to the destination root.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # link_file "README", "doc/README"
- #
- # link_file "doc/README"
- #
- def link_file(source, *args)
- config = args.last.is_a?(Hash) ? args.pop : {}
- destination = args.first || source
- source = File.expand_path(find_in_source_paths(source.to_s))
-
- create_link destination, source, config
- end
-
- # Gets the content at the given address and places it at the given relative
- # destination. If a block is given instead of destination, the content of
- # the url is yielded and used as location.
- #
- # +get+ relies on open-uri, so passing application user input would provide
- # a command injection attack vector.
- #
- # ==== Parameters
- # source<String>:: the address of the given content.
- # destination<String>:: the relative path to the destination root.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # get "http://gist.github.com/103208", "doc/README"
- #
- # get "http://gist.github.com/103208" do |content|
- # content.split("\n").first
- # end
- #
- def get(source, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- destination = args.first
-
- render = if source =~ %r{^https?\://}
- require "open-uri"
- URI.send(:open, source) { |input| input.binmode.read }
- else
- source = File.expand_path(find_in_source_paths(source.to_s))
- open(source) { |input| input.binmode.read }
- end
-
- destination ||= if block_given?
- block.arity == 1 ? yield(render) : yield
- else
- File.basename(source)
- end
-
- create_file destination, render, config
- end
-
- # Gets an ERB template at the relative source, executes it and makes a copy
- # at the relative destination. If the destination is not given it's assumed
- # to be equal to the source removing .tt from the filename.
- #
- # ==== Parameters
- # source<String>:: the relative path to the source root.
- # destination<String>:: the relative path to the destination root.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # template "README", "doc/README"
- #
- # template "doc/README"
- #
- def template(source, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- destination = args.first || source.sub(/#{TEMPLATE_EXTNAME}$/, "")
-
- source = File.expand_path(find_in_source_paths(source.to_s))
- context = config.delete(:context) || instance_eval("binding")
-
- create_file destination, nil, config do
- match = ERB.version.match(/(\d+\.\d+\.\d+)/)
- capturable_erb = if match && match[1] >= "2.2.0" # Ruby 2.6+
- CapturableERB.new(::File.binread(source), :trim_mode => "-", :eoutvar => "@output_buffer")
- else
- CapturableERB.new(::File.binread(source), nil, "-", "@output_buffer")
- end
- content = capturable_erb.tap do |erb|
- erb.filename = source
- end.result(context)
- content = yield(content) if block
- content
- end
- end
-
- # Changes the mode of the given file or directory.
- #
- # ==== Parameters
- # mode<Integer>:: the file mode
- # path<String>:: the name of the file to change mode
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # chmod "script/server", 0755
- #
- def chmod(path, mode, config = {})
- return unless behavior == :invoke
- path = File.expand_path(path, destination_root)
- say_status :chmod, relative_to_original_destination_root(path), config.fetch(:verbose, true)
- unless options[:pretend]
- require "fileutils"
- FileUtils.chmod_R(mode, path)
- end
- end
-
- # Prepend text to a file. Since it depends on insert_into_file, it's reversible.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # data<String>:: the data to prepend to the file, can be also given as a block.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # prepend_to_file 'config/environments/test.rb', 'config.gem "rspec"'
- #
- # prepend_to_file 'config/environments/test.rb' do
- # 'config.gem "rspec"'
- # end
- #
- def prepend_to_file(path, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- config[:after] = /\A/
- insert_into_file(path, *(args << config), &block)
- end
- alias_method :prepend_file, :prepend_to_file
-
- # Append text to a file. Since it depends on insert_into_file, it's reversible.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # data<String>:: the data to append to the file, can be also given as a block.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # append_to_file 'config/environments/test.rb', 'config.gem "rspec"'
- #
- # append_to_file 'config/environments/test.rb' do
- # 'config.gem "rspec"'
- # end
- #
- def append_to_file(path, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- config[:before] = /\z/
- insert_into_file(path, *(args << config), &block)
- end
- alias_method :append_file, :append_to_file
-
- # Injects text right after the class definition. Since it depends on
- # insert_into_file, it's reversible.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # klass<String|Class>:: the class to be manipulated
- # data<String>:: the data to append to the class, can be also given as a block.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # inject_into_class "app/controllers/application_controller.rb", ApplicationController, " filter_parameter :password\n"
- #
- # inject_into_class "app/controllers/application_controller.rb", ApplicationController do
- # " filter_parameter :password\n"
- # end
- #
- def inject_into_class(path, klass, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- config[:after] = /class #{klass}\n|class #{klass} .*\n/
- insert_into_file(path, *(args << config), &block)
- end
-
- # Injects text right after the module definition. Since it depends on
- # insert_into_file, it's reversible.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # module_name<String|Class>:: the module to be manipulated
- # data<String>:: the data to append to the class, can be also given as a block.
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Examples
- #
- # inject_into_module "app/helpers/application_helper.rb", ApplicationHelper, " def help; 'help'; end\n"
- #
- # inject_into_module "app/helpers/application_helper.rb", ApplicationHelper do
- # " def help; 'help'; end\n"
- # end
- #
- def inject_into_module(path, module_name, *args, &block)
- config = args.last.is_a?(Hash) ? args.pop : {}
- config[:after] = /module #{module_name}\n|module #{module_name} .*\n/
- insert_into_file(path, *(args << config), &block)
- end
-
- # Run a regular expression replacement on a file.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # flag<Regexp|String>:: the regexp or string to be replaced
- # replacement<String>:: the replacement, can be also given as a block
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # gsub_file 'app/controllers/application_controller.rb', /#\s*(filter_parameter_logging :password)/, '\1'
- #
- # gsub_file 'README', /rake/, :green do |match|
- # match << " no more. Use thor!"
- # end
- #
- def gsub_file(path, flag, *args, &block)
- return unless behavior == :invoke
- config = args.last.is_a?(Hash) ? args.pop : {}
-
- path = File.expand_path(path, destination_root)
- say_status :gsub, relative_to_original_destination_root(path), config.fetch(:verbose, true)
-
- unless options[:pretend]
- content = File.binread(path)
- content.gsub!(flag, *args, &block)
- File.open(path, "wb") { |file| file.write(content) }
- end
- end
-
- # Uncomment all lines matching a given regex. It will leave the space
- # which existed before the comment hash in tact but will remove any spacing
- # between the comment hash and the beginning of the line.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # flag<Regexp|String>:: the regexp or string used to decide which lines to uncomment
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # uncomment_lines 'config/initializers/session_store.rb', /active_record/
- #
- def uncomment_lines(path, flag, *args)
- flag = flag.respond_to?(:source) ? flag.source : flag
-
- gsub_file(path, /^(\s*)#[[:blank:]]*(.*#{flag})/, '\1\2', *args)
- end
-
- # Comment all lines matching a given regex. It will leave the space
- # which existed before the beginning of the line in tact and will insert
- # a single space after the comment hash.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # flag<Regexp|String>:: the regexp or string used to decide which lines to comment
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # comment_lines 'config/initializers/session_store.rb', /cookie_store/
- #
- def comment_lines(path, flag, *args)
- flag = flag.respond_to?(:source) ? flag.source : flag
-
- gsub_file(path, /^(\s*)([^#\n]*#{flag})/, '\1# \2', *args)
- end
-
- # Removes a file at the given location.
- #
- # ==== Parameters
- # path<String>:: path of the file to be changed
- # config<Hash>:: give :verbose => false to not log the status.
- #
- # ==== Example
- #
- # remove_file 'README'
- # remove_file 'app/controllers/application_controller.rb'
- #
- def remove_file(path, config = {})
- return unless behavior == :invoke
- path = File.expand_path(path, destination_root)
-
- say_status :remove, relative_to_original_destination_root(path), config.fetch(:verbose, true)
- if !options[:pretend] && File.exist?(path)
- require "fileutils"
- ::FileUtils.rm_rf(path)
- end
- end
- alias_method :remove_dir, :remove_file
-
- attr_accessor :output_buffer
- private :output_buffer, :output_buffer=
-
- private
-
- def concat(string)
- @output_buffer.concat(string)
- end
-
- def capture(*args)
- with_output_buffer { yield(*args) }
- end
-
- def with_output_buffer(buf = "".dup) #:nodoc:
- raise ArgumentError, "Buffer can not be a frozen object" if buf.frozen?
- old_buffer = output_buffer
- self.output_buffer = buf
- yield
- output_buffer
- ensure
- self.output_buffer = old_buffer
- end
-
- # Bundler::Thor::Actions#capture depends on what kind of buffer is used in ERB.
- # Thus CapturableERB fixes ERB to use String buffer.
- class CapturableERB < ERB
- def set_eoutvar(compiler, eoutvar = "_erbout")
- compiler.put_cmd = "#{eoutvar}.concat"
- compiler.insert_cmd = "#{eoutvar}.concat"
- compiler.pre_cmd = ["#{eoutvar} = ''.dup"]
- compiler.post_cmd = [eoutvar]
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb b/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
deleted file mode 100644
index 09ce0864f0..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-require_relative "empty_directory"
-
-class Bundler::Thor
- module Actions
- # Injects the given content into a file. Different from gsub_file, this
- # method is reversible.
- #
- # ==== Parameters
- # destination<String>:: Relative path to the destination root
- # data<String>:: Data to add to the file. Can be given as a block.
- # config<Hash>:: give :verbose => false to not log the status and the flag
- # for injection (:after or :before) or :force => true for
- # insert two or more times the same content.
- #
- # ==== Examples
- #
- # insert_into_file "config/environment.rb", "config.gem :thor", :after => "Rails::Initializer.run do |config|\n"
- #
- # insert_into_file "config/environment.rb", :after => "Rails::Initializer.run do |config|\n" do
- # gems = ask "Which gems would you like to add?"
- # gems.split(" ").map{ |gem| " config.gem :#{gem}" }.join("\n")
- # end
- #
- WARNINGS = { unchanged_no_flag: 'File unchanged! The supplied flag value not found!' }
-
- def insert_into_file(destination, *args, &block)
- data = block_given? ? block : args.shift
-
- config = args.shift || {}
- config[:after] = /\z/ unless config.key?(:before) || config.key?(:after)
-
- action InjectIntoFile.new(self, destination, data, config)
- end
- alias_method :inject_into_file, :insert_into_file
-
- class InjectIntoFile < EmptyDirectory #:nodoc:
- attr_reader :replacement, :flag, :behavior
-
- def initialize(base, destination, data, config)
- super(base, destination, {:verbose => true}.merge(config))
-
- @behavior, @flag = if @config.key?(:after)
- [:after, @config.delete(:after)]
- else
- [:before, @config.delete(:before)]
- end
-
- @replacement = data.is_a?(Proc) ? data.call : data
- @flag = Regexp.escape(@flag) unless @flag.is_a?(Regexp)
- end
-
- def invoke!
- content = if @behavior == :after
- '\0' + replacement
- else
- replacement + '\0'
- end
-
- if exists?
- if replace!(/#{flag}/, content, config[:force])
- say_status(:invoke)
- else
- say_status(:unchanged, warning: WARNINGS[:unchanged_no_flag], color: :red)
- end
- else
- unless pretend?
- raise Bundler::Thor::Error, "The file #{ destination } does not appear to exist"
- end
- end
- end
-
- def revoke!
- say_status :revoke
-
- regexp = if @behavior == :after
- content = '\1\2'
- /(#{flag})(.*)(#{Regexp.escape(replacement)})/m
- else
- content = '\2\3'
- /(#{Regexp.escape(replacement)})(.*)(#{flag})/m
- end
-
- replace!(regexp, content, true)
- end
-
- protected
-
- def say_status(behavior, warning: nil, color: nil)
- status = if behavior == :invoke
- if flag == /\A/
- :prepend
- elsif flag == /\z/
- :append
- else
- :insert
- end
- elsif warning
- warning
- else
- :subtract
- end
-
- super(status, (color || config[:verbose]))
- end
-
- # Adds the content to the file.
- #
- def replace!(regexp, string, force)
- return if pretend?
- content = File.read(destination)
- if force || !content.include?(replacement)
- success = content.gsub!(regexp, string)
-
- File.open(destination, "wb") { |file| file.write(content) }
- success
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/base.rb b/lib/bundler/vendor/thor/lib/thor/base.rb
deleted file mode 100644
index 9ba5243378..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/base.rb
+++ /dev/null
@@ -1,690 +0,0 @@
-require_relative "command"
-require_relative "core_ext/hash_with_indifferent_access"
-require_relative "error"
-require_relative "invocation"
-require_relative "nested_context"
-require_relative "parser"
-require_relative "shell"
-require_relative "line_editor"
-require_relative "util"
-
-class Bundler::Thor
- autoload :Actions, File.expand_path("actions", __dir__)
- autoload :RakeCompat, File.expand_path("rake_compat", __dir__)
- autoload :Group, File.expand_path("group", __dir__)
-
- # Shortcuts for help.
- HELP_MAPPINGS = %w(-h -? --help -D)
-
- # Bundler::Thor methods that should not be overwritten by the user.
- THOR_RESERVED_WORDS = %w(invoke shell options behavior root destination_root relative_root
- action add_file create_file in_root inside run run_ruby_script)
-
- TEMPLATE_EXTNAME = ".tt"
-
- module Base
- attr_accessor :options, :parent_options, :args
-
- # It receives arguments in an Array and two hashes, one for options and
- # other for configuration.
- #
- # Notice that it does not check if all required arguments were supplied.
- # It should be done by the parser.
- #
- # ==== Parameters
- # args<Array[Object]>:: An array of objects. The objects are applied to their
- # respective accessors declared with <tt>argument</tt>.
- #
- # options<Hash>:: An options hash that will be available as self.options.
- # The hash given is converted to a hash with indifferent
- # access, magic predicates (options.skip?) and then frozen.
- #
- # config<Hash>:: Configuration for this Bundler::Thor class.
- #
- def initialize(args = [], local_options = {}, config = {})
- parse_options = self.class.class_options
-
- # The start method splits inbound arguments at the first argument
- # that looks like an option (starts with - or --). It then calls
- # new, passing in the two halves of the arguments Array as the
- # first two parameters.
-
- command_options = config.delete(:command_options) # hook for start
- parse_options = parse_options.merge(command_options) if command_options
- if local_options.is_a?(Array)
- array_options = local_options
- hash_options = {}
- else
- # Handle the case where the class was explicitly instantiated
- # with pre-parsed options.
- array_options = []
- hash_options = local_options
- end
-
- # Let Bundler::Thor::Options parse the options first, so it can remove
- # declared options from the array. This will leave us with
- # a list of arguments that weren't declared.
- stop_on_unknown = self.class.stop_on_unknown_option? config[:current_command]
- disable_required_check = self.class.disable_required_check? config[:current_command]
- opts = Bundler::Thor::Options.new(parse_options, hash_options, stop_on_unknown, disable_required_check)
- self.options = opts.parse(array_options)
- self.options = config[:class_options].merge(options) if config[:class_options]
-
- # If unknown options are disallowed, make sure that none of the
- # remaining arguments looks like an option.
- opts.check_unknown! if self.class.check_unknown_options?(config)
-
- # Add the remaining arguments from the options parser to the
- # arguments passed in to initialize. Then remove any positional
- # arguments declared using #argument (this is primarily used
- # by Bundler::Thor::Group). Tis will leave us with the remaining
- # positional arguments.
- to_parse = args
- to_parse += opts.remaining unless self.class.strict_args_position?(config)
-
- thor_args = Bundler::Thor::Arguments.new(self.class.arguments)
- thor_args.parse(to_parse).each { |k, v| __send__("#{k}=", v) }
- @args = thor_args.remaining
- end
-
- class << self
- def included(base) #:nodoc:
- super(base)
- base.extend ClassMethods
- base.send :include, Invocation
- base.send :include, Shell
- end
-
- # Returns the classes that inherits from Bundler::Thor or Bundler::Thor::Group.
- #
- # ==== Returns
- # Array[Class]
- #
- def subclasses
- @subclasses ||= []
- end
-
- # Returns the files where the subclasses are kept.
- #
- # ==== Returns
- # Hash[path<String> => Class]
- #
- def subclass_files
- @subclass_files ||= Hash.new { |h, k| h[k] = [] }
- end
-
- # Whenever a class inherits from Bundler::Thor or Bundler::Thor::Group, we should track the
- # class and the file on Bundler::Thor::Base. This is the method responsible for it.
- #
- def register_klass_file(klass) #:nodoc:
- file = caller[1].match(/(.*):\d+/)[1]
- Bundler::Thor::Base.subclasses << klass unless Bundler::Thor::Base.subclasses.include?(klass)
-
- file_subclasses = Bundler::Thor::Base.subclass_files[File.expand_path(file)]
- file_subclasses << klass unless file_subclasses.include?(klass)
- end
- end
-
- module ClassMethods
- def attr_reader(*) #:nodoc:
- no_commands { super }
- end
-
- def attr_writer(*) #:nodoc:
- no_commands { super }
- end
-
- def attr_accessor(*) #:nodoc:
- no_commands { super }
- end
-
- # If you want to raise an error for unknown options, call check_unknown_options!
- # This is disabled by default to allow dynamic invocations.
- def check_unknown_options!
- @check_unknown_options = true
- end
-
- def check_unknown_options #:nodoc:
- @check_unknown_options ||= from_superclass(:check_unknown_options, false)
- end
-
- def check_unknown_options?(config) #:nodoc:
- !!check_unknown_options
- end
-
- # If you want to raise an error when the default value of an option does not match
- # the type call check_default_type!
- # This will be the default; for compatibility a deprecation warning is issued if necessary.
- def check_default_type!
- @check_default_type = true
- end
-
- # If you want to use defaults that don't match the type of an option,
- # either specify `check_default_type: false` or call `allow_incompatible_default_type!`
- def allow_incompatible_default_type!
- @check_default_type = false
- end
-
- def check_default_type #:nodoc:
- @check_default_type = from_superclass(:check_default_type, nil) unless defined?(@check_default_type)
- @check_default_type
- end
-
- # If true, option parsing is suspended as soon as an unknown option or a
- # regular argument is encountered. All remaining arguments are passed to
- # the command as regular arguments.
- def stop_on_unknown_option?(command_name) #:nodoc:
- false
- end
-
- # If true, option set will not suspend the execution of the command when
- # a required option is not provided.
- def disable_required_check?(command_name) #:nodoc:
- false
- end
-
- # If you want only strict string args (useful when cascading thor classes),
- # call strict_args_position! This is disabled by default to allow dynamic
- # invocations.
- def strict_args_position!
- @strict_args_position = true
- end
-
- def strict_args_position #:nodoc:
- @strict_args_position ||= from_superclass(:strict_args_position, false)
- end
-
- def strict_args_position?(config) #:nodoc:
- !!strict_args_position
- end
-
- # Adds an argument to the class and creates an attr_accessor for it.
- #
- # Arguments are different from options in several aspects. The first one
- # is how they are parsed from the command line, arguments are retrieved
- # from position:
- #
- # thor command NAME
- #
- # Instead of:
- #
- # thor command --name=NAME
- #
- # Besides, arguments are used inside your code as an accessor (self.argument),
- # while options are all kept in a hash (self.options).
- #
- # Finally, arguments cannot have type :default or :boolean but can be
- # optional (supplying :optional => :true or :required => false), although
- # you cannot have a required argument after a non-required argument. If you
- # try it, an error is raised.
- #
- # ==== Parameters
- # name<Symbol>:: The name of the argument.
- # options<Hash>:: Described below.
- #
- # ==== Options
- # :desc - Description for the argument.
- # :required - If the argument is required or not.
- # :optional - If the argument is optional or not.
- # :type - The type of the argument, can be :string, :hash, :array, :numeric.
- # :default - Default value for this argument. It cannot be required and have default values.
- # :banner - String to show on usage notes.
- #
- # ==== Errors
- # ArgumentError:: Raised if you supply a required argument after a non required one.
- #
- def argument(name, options = {})
- is_thor_reserved_word?(name, :argument)
- no_commands { attr_accessor name }
-
- required = if options.key?(:optional)
- !options[:optional]
- elsif options.key?(:required)
- options[:required]
- else
- options[:default].nil?
- end
-
- remove_argument name
-
- if required
- arguments.each do |argument|
- next if argument.required?
- raise ArgumentError, "You cannot have #{name.to_s.inspect} as required argument after " \
- "the non-required argument #{argument.human_name.inspect}."
- end
- end
-
- options[:required] = required
-
- arguments << Bundler::Thor::Argument.new(name, options)
- end
-
- # Returns this class arguments, looking up in the ancestors chain.
- #
- # ==== Returns
- # Array[Bundler::Thor::Argument]
- #
- def arguments
- @arguments ||= from_superclass(:arguments, [])
- end
-
- # Adds a bunch of options to the set of class options.
- #
- # class_options :foo => false, :bar => :required, :baz => :string
- #
- # If you prefer more detailed declaration, check class_option.
- #
- # ==== Parameters
- # Hash[Symbol => Object]
- #
- def class_options(options = nil)
- @class_options ||= from_superclass(:class_options, {})
- build_options(options, @class_options) if options
- @class_options
- end
-
- # Adds an option to the set of class options
- #
- # ==== Parameters
- # name<Symbol>:: The name of the argument.
- # options<Hash>:: Described below.
- #
- # ==== Options
- # :desc:: -- Description for the argument.
- # :required:: -- If the argument is required or not.
- # :default:: -- Default value for this argument.
- # :group:: -- The group for this options. Use by class options to output options in different levels.
- # :aliases:: -- Aliases for this option. <b>Note:</b> Bundler::Thor follows a convention of one-dash-one-letter options. Thus aliases like "-something" wouldn't be parsed; use either "\--something" or "-s" instead.
- # :type:: -- The type of the argument, can be :string, :hash, :array, :numeric or :boolean.
- # :banner:: -- String to show on usage notes.
- # :hide:: -- If you want to hide this option from the help.
- #
- def class_option(name, options = {})
- build_option(name, options, class_options)
- end
-
- # Removes a previous defined argument. If :undefine is given, undefine
- # accessors as well.
- #
- # ==== Parameters
- # names<Array>:: Arguments to be removed
- #
- # ==== Examples
- #
- # remove_argument :foo
- # remove_argument :foo, :bar, :baz, :undefine => true
- #
- def remove_argument(*names)
- options = names.last.is_a?(Hash) ? names.pop : {}
-
- names.each do |name|
- arguments.delete_if { |a| a.name == name.to_s }
- undef_method name, "#{name}=" if options[:undefine]
- end
- end
-
- # Removes a previous defined class option.
- #
- # ==== Parameters
- # names<Array>:: Class options to be removed
- #
- # ==== Examples
- #
- # remove_class_option :foo
- # remove_class_option :foo, :bar, :baz
- #
- def remove_class_option(*names)
- names.each do |name|
- class_options.delete(name)
- end
- end
-
- # Defines the group. This is used when thor list is invoked so you can specify
- # that only commands from a pre-defined group will be shown. Defaults to standard.
- #
- # ==== Parameters
- # name<String|Symbol>
- #
- def group(name = nil)
- if name
- @group = name.to_s
- else
- @group ||= from_superclass(:group, "standard")
- end
- end
-
- # Returns the commands for this Bundler::Thor class.
- #
- # ==== Returns
- # Hash:: An ordered hash with commands names as keys and Bundler::Thor::Command
- # objects as values.
- #
- def commands
- @commands ||= Hash.new
- end
- alias_method :tasks, :commands
-
- # Returns the commands for this Bundler::Thor class and all subclasses.
- #
- # ==== Returns
- # Hash:: An ordered hash with commands names as keys and Bundler::Thor::Command
- # objects as values.
- #
- def all_commands
- @all_commands ||= from_superclass(:all_commands, Hash.new)
- @all_commands.merge!(commands)
- end
- alias_method :all_tasks, :all_commands
-
- # Removes a given command from this Bundler::Thor class. This is usually done if you
- # are inheriting from another class and don't want it to be available
- # anymore.
- #
- # By default it only remove the mapping to the command. But you can supply
- # :undefine => true to undefine the method from the class as well.
- #
- # ==== Parameters
- # name<Symbol|String>:: The name of the command to be removed
- # options<Hash>:: You can give :undefine => true if you want commands the method
- # to be undefined from the class as well.
- #
- def remove_command(*names)
- options = names.last.is_a?(Hash) ? names.pop : {}
-
- names.each do |name|
- commands.delete(name.to_s)
- all_commands.delete(name.to_s)
- undef_method name if options[:undefine]
- end
- end
- alias_method :remove_task, :remove_command
-
- # All methods defined inside the given block are not added as commands.
- #
- # So you can do:
- #
- # class MyScript < Bundler::Thor
- # no_commands do
- # def this_is_not_a_command
- # end
- # end
- # end
- #
- # You can also add the method and remove it from the command list:
- #
- # class MyScript < Bundler::Thor
- # def this_is_not_a_command
- # end
- # remove_command :this_is_not_a_command
- # end
- #
- def no_commands(&block)
- no_commands_context.enter(&block)
- end
-
- alias_method :no_tasks, :no_commands
-
- def no_commands_context
- @no_commands_context ||= NestedContext.new
- end
-
- def no_commands?
- no_commands_context.entered?
- end
-
- # Sets the namespace for the Bundler::Thor or Bundler::Thor::Group class. By default the
- # namespace is retrieved from the class name. If your Bundler::Thor class is named
- # Scripts::MyScript, the help method, for example, will be called as:
- #
- # thor scripts:my_script -h
- #
- # If you change the namespace:
- #
- # namespace :my_scripts
- #
- # You change how your commands are invoked:
- #
- # thor my_scripts -h
- #
- # Finally, if you change your namespace to default:
- #
- # namespace :default
- #
- # Your commands can be invoked with a shortcut. Instead of:
- #
- # thor :my_command
- #
- def namespace(name = nil)
- if name
- @namespace = name.to_s
- else
- @namespace ||= Bundler::Thor::Util.namespace_from_thor_class(self)
- end
- end
-
- # Parses the command and options from the given args, instantiate the class
- # and invoke the command. This method is used when the arguments must be parsed
- # from an array. If you are inside Ruby and want to use a Bundler::Thor class, you
- # can simply initialize it:
- #
- # script = MyScript.new(args, options, config)
- # script.invoke(:command, first_arg, second_arg, third_arg)
- #
- def start(given_args = ARGV, config = {})
- config[:shell] ||= Bundler::Thor::Base.shell.new
- dispatch(nil, given_args.dup, nil, config)
- rescue Bundler::Thor::Error => e
- config[:debug] || ENV["THOR_DEBUG"] == "1" ? (raise e) : config[:shell].error(e.message)
- exit(false) if exit_on_failure?
- rescue Errno::EPIPE
- # This happens if a thor command is piped to something like `head`,
- # which closes the pipe when it's done reading. This will also
- # mean that if the pipe is closed, further unnecessary
- # computation will not occur.
- exit(true)
- end
-
- # Allows to use private methods from parent in child classes as commands.
- #
- # ==== Parameters
- # names<Array>:: Method names to be used as commands
- #
- # ==== Examples
- #
- # public_command :foo
- # public_command :foo, :bar, :baz
- #
- def public_command(*names)
- names.each do |name|
- class_eval "def #{name}(*); super end"
- end
- end
- alias_method :public_task, :public_command
-
- def handle_no_command_error(command, has_namespace = $thor_runner) #:nodoc:
- raise UndefinedCommandError.new(command, all_commands.keys, (namespace if has_namespace))
- end
- alias_method :handle_no_task_error, :handle_no_command_error
-
- def handle_argument_error(command, error, args, arity) #:nodoc:
- name = [command.ancestor_name, command.name].compact.join(" ")
- msg = "ERROR: \"#{basename} #{name}\" was called with ".dup
- msg << "no arguments" if args.empty?
- msg << "arguments " << args.inspect unless args.empty?
- msg << "\nUsage: \"#{banner(command).split("\n").join("\"\n \"")}\""
- raise InvocationError, msg
- end
-
- # A flag that makes the process exit with status 1 if any error happens.
- def exit_on_failure?
- Bundler::Thor.deprecation_warning "Bundler::Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `#{self.name}`"
- false
- end
-
- protected
-
- # Prints the class options per group. If an option does not belong to
- # any group, it's printed as Class option.
- #
- def class_options_help(shell, groups = {}) #:nodoc:
- # Group options by group
- class_options.each do |_, value|
- groups[value.group] ||= []
- groups[value.group] << value
- end
-
- # Deal with default group
- global_options = groups.delete(nil) || []
- print_options(shell, global_options)
-
- # Print all others
- groups.each do |group_name, options|
- print_options(shell, options, group_name)
- end
- end
-
- # Receives a set of options and print them.
- def print_options(shell, options, group_name = nil)
- return if options.empty?
-
- list = []
- padding = options.map { |o| o.aliases.size }.max.to_i * 4
-
- options.each do |option|
- next if option.hide
- item = [option.usage(padding)]
- item.push(option.description ? "# #{option.description}" : "")
-
- list << item
- list << ["", "# Default: #{option.default}"] if option.show_default?
- list << ["", "# Possible values: #{option.enum.join(', ')}"] if option.enum
- end
-
- shell.say(group_name ? "#{group_name} options:" : "Options:")
- shell.print_table(list, :indent => 2)
- shell.say ""
- end
-
- # Raises an error if the word given is a Bundler::Thor reserved word.
- def is_thor_reserved_word?(word, type) #:nodoc:
- return false unless THOR_RESERVED_WORDS.include?(word.to_s)
- raise "#{word.inspect} is a Bundler::Thor reserved word and cannot be defined as #{type}"
- end
-
- # Build an option and adds it to the given scope.
- #
- # ==== Parameters
- # name<Symbol>:: The name of the argument.
- # options<Hash>:: Described in both class_option and method_option.
- # scope<Hash>:: Options hash that is being built up
- def build_option(name, options, scope) #:nodoc:
- scope[name] = Bundler::Thor::Option.new(name, {:check_default_type => check_default_type}.merge!(options))
- end
-
- # Receives a hash of options, parse them and add to the scope. This is a
- # fast way to set a bunch of options:
- #
- # build_options :foo => true, :bar => :required, :baz => :string
- #
- # ==== Parameters
- # Hash[Symbol => Object]
- def build_options(options, scope) #:nodoc:
- options.each do |key, value|
- scope[key] = Bundler::Thor::Option.parse(key, value)
- end
- end
-
- # Finds a command with the given name. If the command belongs to the current
- # class, just return it, otherwise dup it and add the fresh copy to the
- # current command hash.
- def find_and_refresh_command(name) #:nodoc:
- if commands[name.to_s]
- commands[name.to_s]
- elsif command = all_commands[name.to_s] # rubocop:disable AssignmentInCondition
- commands[name.to_s] = command.clone
- else
- raise ArgumentError, "You supplied :for => #{name.inspect}, but the command #{name.inspect} could not be found."
- end
- end
- alias_method :find_and_refresh_task, :find_and_refresh_command
-
- # Everytime someone inherits from a Bundler::Thor class, register the klass
- # and file into baseclass.
- def inherited(klass)
- super(klass)
- Bundler::Thor::Base.register_klass_file(klass)
- klass.instance_variable_set(:@no_commands, 0)
- end
-
- # Fire this callback whenever a method is added. Added methods are
- # tracked as commands by invoking the create_command method.
- def method_added(meth)
- super(meth)
- meth = meth.to_s
-
- if meth == "initialize"
- initialize_added
- return
- end
-
- # Return if it's not a public instance method
- return unless public_method_defined?(meth.to_sym)
-
- return if no_commands? || !create_command(meth)
-
- is_thor_reserved_word?(meth, :command)
- Bundler::Thor::Base.register_klass_file(self)
- end
-
- # Retrieves a value from superclass. If it reaches the baseclass,
- # returns default.
- def from_superclass(method, default = nil)
- if self == baseclass || !superclass.respond_to?(method, true)
- default
- else
- value = superclass.send(method)
-
- # Ruby implements `dup` on Object, but raises a `TypeError`
- # if the method is called on immediates. As a result, we
- # don't have a good way to check whether dup will succeed
- # without calling it and rescuing the TypeError.
- begin
- value.dup
- rescue TypeError
- value
- end
-
- end
- end
-
- #
- # The basename of the program invoking the thor class.
- #
- def basename
- File.basename($PROGRAM_NAME).split(" ").first
- end
-
- # SIGNATURE: Sets the baseclass. This is where the superclass lookup
- # finishes.
- def baseclass #:nodoc:
- end
-
- # SIGNATURE: Creates a new command if valid_command? is true. This method is
- # called when a new method is added to the class.
- def create_command(meth) #:nodoc:
- end
- alias_method :create_task, :create_command
-
- # SIGNATURE: Defines behavior when the initialize method is added to the
- # class.
- def initialize_added #:nodoc:
- end
-
- # SIGNATURE: The hook invoked by start.
- def dispatch(command, given_args, given_opts, config) #:nodoc:
- raise NotImplementedError
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/command.rb b/lib/bundler/vendor/thor/lib/thor/command.rb
deleted file mode 100644
index 040c971c0c..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/command.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-class Bundler::Thor
- class Command < Struct.new(:name, :description, :long_description, :usage, :options, :ancestor_name)
- FILE_REGEXP = /^#{Regexp.escape(File.dirname(__FILE__))}/
-
- def initialize(name, description, long_description, usage, options = nil)
- super(name.to_s, description, long_description, usage, options || {})
- end
-
- def initialize_copy(other) #:nodoc:
- super(other)
- self.options = other.options.dup if other.options
- end
-
- def hidden?
- false
- end
-
- # By default, a command invokes a method in the thor class. You can change this
- # implementation to create custom commands.
- def run(instance, args = [])
- arity = nil
-
- if private_method?(instance)
- instance.class.handle_no_command_error(name)
- elsif public_method?(instance)
- arity = instance.method(name).arity
- instance.__send__(name, *args)
- elsif local_method?(instance, :method_missing)
- instance.__send__(:method_missing, name.to_sym, *args)
- else
- instance.class.handle_no_command_error(name)
- end
- rescue ArgumentError => e
- handle_argument_error?(instance, e, caller) ? instance.class.handle_argument_error(self, e, args, arity) : (raise e)
- rescue NoMethodError => e
- handle_no_method_error?(instance, e, caller) ? instance.class.handle_no_command_error(name) : (raise e)
- end
-
- # Returns the formatted usage by injecting given required arguments
- # and required options into the given usage.
- def formatted_usage(klass, namespace = true, subcommand = false)
- if ancestor_name
- formatted = "#{ancestor_name} ".dup # add space
- elsif namespace
- namespace = klass.namespace
- formatted = "#{namespace.gsub(/^(default)/, '')}:".dup
- end
- formatted ||= "#{klass.namespace.split(':').last} ".dup if subcommand
-
- formatted ||= "".dup
-
- Array(usage).map do |specific_usage|
- formatted_specific_usage = formatted
-
- formatted_specific_usage += required_arguments_for(klass, specific_usage)
-
- # Add required options
- formatted_specific_usage += " #{required_options}"
-
- # Strip and go!
- formatted_specific_usage.strip
- end.join("\n")
- end
-
- protected
-
- # Add usage with required arguments
- def required_arguments_for(klass, usage)
- if klass && !klass.arguments.empty?
- usage.to_s.gsub(/^#{name}/) do |match|
- match << " " << klass.arguments.map(&:usage).compact.join(" ")
- end
- else
- usage.to_s
- end
- end
-
- def not_debugging?(instance)
- !(instance.class.respond_to?(:debugging) && instance.class.debugging)
- end
-
- def required_options
- @required_options ||= options.map { |_, o| o.usage if o.required? }.compact.sort.join(" ")
- end
-
- # Given a target, checks if this class name is a public method.
- def public_method?(instance) #:nodoc:
- !(instance.public_methods & [name.to_s, name.to_sym]).empty?
- end
-
- def private_method?(instance)
- !(instance.private_methods & [name.to_s, name.to_sym]).empty?
- end
-
- def local_method?(instance, name)
- methods = instance.public_methods(false) + instance.private_methods(false) + instance.protected_methods(false)
- !(methods & [name.to_s, name.to_sym]).empty?
- end
-
- def sans_backtrace(backtrace, caller) #:nodoc:
- saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) || (frame =~ %r{^kernel/} && RUBY_ENGINE =~ /rbx/) }
- saned - caller
- end
-
- def handle_argument_error?(instance, error, caller)
- not_debugging?(instance) && (error.message =~ /wrong number of arguments/ || error.message =~ /given \d*, expected \d*/) && begin
- saned = sans_backtrace(error.backtrace, caller)
- saned.empty? || saned.size == 1
- end
- end
-
- def handle_no_method_error?(instance, error, caller)
- not_debugging?(instance) &&
- error.message =~ /^undefined method `#{name}' for #{Regexp.escape(instance.to_s)}$/
- end
- end
- Task = Command
-
- # A command that is hidden in help messages but still invocable.
- class HiddenCommand < Command
- def hidden?
- true
- end
- end
- HiddenTask = HiddenCommand
-
- # A dynamic command that handles method missing scenarios.
- class DynamicCommand < Command
- def initialize(name, options = nil)
- super(name.to_s, "A dynamically-generated command", name.to_s, name.to_s, options)
- end
-
- def run(instance, args = [])
- if (instance.methods & [name.to_s, name.to_sym]).empty?
- super
- else
- instance.class.handle_no_command_error(name)
- end
- end
- end
- DynamicTask = DynamicCommand
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb b/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb
deleted file mode 100644
index c167aa33b8..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-class Bundler::Thor
- module CoreExt #:nodoc:
- # A hash with indifferent access and magic predicates.
- #
- # hash = Bundler::Thor::CoreExt::HashWithIndifferentAccess.new 'foo' => 'bar', 'baz' => 'bee', 'force' => true
- #
- # hash[:foo] #=> 'bar'
- # hash['foo'] #=> 'bar'
- # hash.foo? #=> true
- #
- class HashWithIndifferentAccess < ::Hash #:nodoc:
- def initialize(hash = {})
- super()
- hash.each do |key, value|
- self[convert_key(key)] = value
- end
- end
-
- def [](key)
- super(convert_key(key))
- end
-
- def []=(key, value)
- super(convert_key(key), value)
- end
-
- def delete(key)
- super(convert_key(key))
- end
-
- def fetch(key, *args)
- super(convert_key(key), *args)
- end
-
- def key?(key)
- super(convert_key(key))
- end
-
- def values_at(*indices)
- indices.map { |key| self[convert_key(key)] }
- end
-
- def merge(other)
- dup.merge!(other)
- end
-
- def merge!(other)
- other.each do |key, value|
- self[convert_key(key)] = value
- end
- self
- end
-
- def reverse_merge(other)
- self.class.new(other).merge(self)
- end
-
- def reverse_merge!(other_hash)
- replace(reverse_merge(other_hash))
- end
-
- def replace(other_hash)
- super(other_hash)
- end
-
- # Convert to a Hash with String keys.
- def to_hash
- Hash.new(default).merge!(self)
- end
-
- protected
-
- def convert_key(key)
- key.is_a?(Symbol) ? key.to_s : key
- end
-
- # Magic predicates. For instance:
- #
- # options.force? # => !!options['force']
- # options.shebang # => "/usr/lib/local/ruby"
- # options.test_framework?(:rspec) # => options[:test_framework] == :rspec
- #
- def method_missing(method, *args)
- method = method.to_s
- if method =~ /^(\w+)\?$/
- if args.empty?
- !!self[$1]
- else
- self[$1] == args.first
- end
- else
- self[method]
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb b/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb
deleted file mode 100644
index 0f6e2e0af2..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-class IO #:nodoc:
- class << self
- unless method_defined? :binread
- def binread(file, *args)
- raise ArgumentError, "wrong number of arguments (#{1 + args.size} for 1..3)" unless args.size < 3
- File.open(file, "rb") do |f|
- f.read(*args)
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb b/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb
deleted file mode 100644
index 76f1e43c65..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-class Bundler::Thor
- module CoreExt
- class OrderedHash < ::Hash
- if RUBY_VERSION < "1.9"
- def initialize(*args, &block)
- super
- @keys = []
- end
-
- def initialize_copy(other)
- super
- # make a deep copy of keys
- @keys = other.keys
- end
-
- def []=(key, value)
- @keys << key unless key?(key)
- super
- end
-
- def delete(key)
- if key? key
- index = @keys.index(key)
- @keys.delete_at index
- end
- super
- end
-
- def delete_if
- super
- sync_keys!
- self
- end
-
- alias_method :reject!, :delete_if
-
- def reject(&block)
- dup.reject!(&block)
- end
-
- def keys
- @keys.dup
- end
-
- def values
- @keys.map { |key| self[key] }
- end
-
- def to_hash
- self
- end
-
- def to_a
- @keys.map { |key| [key, self[key]] }
- end
-
- def each_key
- return to_enum(:each_key) unless block_given?
- @keys.each { |key| yield(key) }
- self
- end
-
- def each_value
- return to_enum(:each_value) unless block_given?
- @keys.each { |key| yield(self[key]) }
- self
- end
-
- def each
- return to_enum(:each) unless block_given?
- @keys.each { |key| yield([key, self[key]]) }
- self
- end
-
- def each_pair
- return to_enum(:each_pair) unless block_given?
- @keys.each { |key| yield(key, self[key]) }
- self
- end
-
- alias_method :select, :find_all
-
- def clear
- super
- @keys.clear
- self
- end
-
- def shift
- k = @keys.first
- v = delete(k)
- [k, v]
- end
-
- def merge!(other_hash)
- if block_given?
- other_hash.each { |k, v| self[k] = key?(k) ? yield(k, self[k], v) : v }
- else
- other_hash.each { |k, v| self[k] = v }
- end
- self
- end
-
- alias_method :update, :merge!
-
- def merge(other_hash, &block)
- dup.merge!(other_hash, &block)
- end
-
- # When replacing with another hash, the initial order of our keys must come from the other hash -ordered or not.
- def replace(other)
- super
- @keys = other.keys
- self
- end
-
- def inspect
- "#<#{self.class} #{super}>"
- end
-
- private
-
- def sync_keys!
- @keys.delete_if { |k| !key?(k) }
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/error.rb b/lib/bundler/vendor/thor/lib/thor/error.rb
deleted file mode 100644
index 1553afd201..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/error.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-class Bundler::Thor
- Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable)
- # In order to support versions of Ruby that don't have keyword
- # arguments, we need our own spell checker class that doesn't take key
- # words. Even though this code wouldn't be hit because of the check
- # above, it's still necessary because the interpreter would otherwise be
- # unable to parse the file.
- class NoKwargSpellChecker < DidYouMean::SpellChecker # :nodoc:
- def initialize(dictionary)
- @dictionary = dictionary
- end
- end
-
- DidYouMean::Correctable
- end
-
- # Bundler::Thor::Error is raised when it's caused by wrong usage of thor classes. Those
- # errors have their backtrace suppressed and are nicely shown to the user.
- #
- # Errors that are caused by the developer, like declaring a method which
- # overwrites a thor keyword, SHOULD NOT raise a Bundler::Thor::Error. This way, we
- # ensure that developer errors are shown with full backtrace.
- class Error < StandardError
- end
-
- # Raised when a command was not found.
- class UndefinedCommandError < Error
- class SpellChecker
- attr_reader :error
-
- def initialize(error)
- @error = error
- end
-
- def corrections
- @corrections ||= spell_checker.correct(error.command).map(&:inspect)
- end
-
- def spell_checker
- NoKwargSpellChecker.new(error.all_commands)
- end
- end
-
- attr_reader :command, :all_commands
-
- def initialize(command, all_commands, namespace)
- @command = command
- @all_commands = all_commands
-
- message = "Could not find command #{command.inspect}"
- message = namespace ? "#{message} in #{namespace.inspect} namespace." : "#{message}."
-
- super(message)
- end
-
- prepend Correctable if Correctable
- end
- UndefinedTaskError = UndefinedCommandError
-
- class AmbiguousCommandError < Error
- end
- AmbiguousTaskError = AmbiguousCommandError
-
- # Raised when a command was found, but not invoked properly.
- class InvocationError < Error
- end
-
- class UnknownArgumentError < Error
- class SpellChecker
- attr_reader :error
-
- def initialize(error)
- @error = error
- end
-
- def corrections
- @corrections ||=
- error.unknown.flat_map { |unknown| spell_checker.correct(unknown) }.uniq.map(&:inspect)
- end
-
- def spell_checker
- @spell_checker ||= NoKwargSpellChecker.new(error.switches)
- end
- end
-
- attr_reader :switches, :unknown
-
- def initialize(switches, unknown)
- @switches = switches
- @unknown = unknown
-
- super("Unknown switches #{unknown.map(&:inspect).join(', ')}")
- end
-
- prepend Correctable if Correctable
- end
-
- class RequiredArgumentMissingError < InvocationError
- end
-
- class MalformattedArgumentError < InvocationError
- end
-
- if Correctable
- DidYouMean::SPELL_CHECKERS.merge!(
- 'Bundler::Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker,
- 'Bundler::Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker
- )
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/group.rb b/lib/bundler/vendor/thor/lib/thor/group.rb
deleted file mode 100644
index 7861d05345..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/group.rb
+++ /dev/null
@@ -1,281 +0,0 @@
-require_relative "base"
-
-# Bundler::Thor has a special class called Bundler::Thor::Group. The main difference to Bundler::Thor class
-# is that it invokes all commands at once. It also include some methods that allows
-# invocations to be done at the class method, which are not available to Bundler::Thor
-# commands.
-class Bundler::Thor::Group
- class << self
- # The description for this Bundler::Thor::Group. If none is provided, but a source root
- # exists, tries to find the USAGE one folder above it, otherwise searches
- # in the superclass.
- #
- # ==== Parameters
- # description<String>:: The description for this Bundler::Thor::Group.
- #
- def desc(description = nil)
- if description
- @desc = description
- else
- @desc ||= from_superclass(:desc, nil)
- end
- end
-
- # Prints help information.
- #
- # ==== Options
- # short:: When true, shows only usage.
- #
- def help(shell)
- shell.say "Usage:"
- shell.say " #{banner}\n"
- shell.say
- class_options_help(shell)
- shell.say desc if desc
- end
-
- # Stores invocations for this class merging with superclass values.
- #
- def invocations #:nodoc:
- @invocations ||= from_superclass(:invocations, {})
- end
-
- # Stores invocation blocks used on invoke_from_option.
- #
- def invocation_blocks #:nodoc:
- @invocation_blocks ||= from_superclass(:invocation_blocks, {})
- end
-
- # Invoke the given namespace or class given. It adds an instance
- # method that will invoke the klass and command. You can give a block to
- # configure how it will be invoked.
- #
- # The namespace/class given will have its options showed on the help
- # usage. Check invoke_from_option for more information.
- #
- def invoke(*names, &block)
- options = names.last.is_a?(Hash) ? names.pop : {}
- verbose = options.fetch(:verbose, true)
-
- names.each do |name|
- invocations[name] = false
- invocation_blocks[name] = block if block_given?
-
- class_eval <<-METHOD, __FILE__, __LINE__ + 1
- def _invoke_#{name.to_s.gsub(/\W/, '_')}
- klass, command = self.class.prepare_for_invocation(nil, #{name.inspect})
-
- if klass
- say_status :invoke, #{name.inspect}, #{verbose.inspect}
- block = self.class.invocation_blocks[#{name.inspect}]
- _invoke_for_class_method klass, command, &block
- else
- say_status :error, %(#{name.inspect} [not found]), :red
- end
- end
- METHOD
- end
- end
-
- # Invoke a thor class based on the value supplied by the user to the
- # given option named "name". A class option must be created before this
- # method is invoked for each name given.
- #
- # ==== Examples
- #
- # class GemGenerator < Bundler::Thor::Group
- # class_option :test_framework, :type => :string
- # invoke_from_option :test_framework
- # end
- #
- # ==== Boolean options
- #
- # In some cases, you want to invoke a thor class if some option is true or
- # false. This is automatically handled by invoke_from_option. Then the
- # option name is used to invoke the generator.
- #
- # ==== Preparing for invocation
- #
- # In some cases you want to customize how a specified hook is going to be
- # invoked. You can do that by overwriting the class method
- # prepare_for_invocation. The class method must necessarily return a klass
- # and an optional command.
- #
- # ==== Custom invocations
- #
- # You can also supply a block to customize how the option is going to be
- # invoked. The block receives two parameters, an instance of the current
- # class and the klass to be invoked.
- #
- def invoke_from_option(*names, &block)
- options = names.last.is_a?(Hash) ? names.pop : {}
- verbose = options.fetch(:verbose, :white)
-
- names.each do |name|
- unless class_options.key?(name)
- raise ArgumentError, "You have to define the option #{name.inspect} " \
- "before setting invoke_from_option."
- end
-
- invocations[name] = true
- invocation_blocks[name] = block if block_given?
-
- class_eval <<-METHOD, __FILE__, __LINE__ + 1
- def _invoke_from_option_#{name.to_s.gsub(/\W/, '_')}
- return unless options[#{name.inspect}]
-
- value = options[#{name.inspect}]
- value = #{name.inspect} if TrueClass === value
- klass, command = self.class.prepare_for_invocation(#{name.inspect}, value)
-
- if klass
- say_status :invoke, value, #{verbose.inspect}
- block = self.class.invocation_blocks[#{name.inspect}]
- _invoke_for_class_method klass, command, &block
- else
- say_status :error, %(\#{value} [not found]), :red
- end
- end
- METHOD
- end
- end
-
- # Remove a previously added invocation.
- #
- # ==== Examples
- #
- # remove_invocation :test_framework
- #
- def remove_invocation(*names)
- names.each do |name|
- remove_command(name)
- remove_class_option(name)
- invocations.delete(name)
- invocation_blocks.delete(name)
- end
- end
-
- # Overwrite class options help to allow invoked generators options to be
- # shown recursively when invoking a generator.
- #
- def class_options_help(shell, groups = {}) #:nodoc:
- get_options_from_invocations(groups, class_options) do |klass|
- klass.send(:get_options_from_invocations, groups, class_options)
- end
- super(shell, groups)
- end
-
- # Get invocations array and merge options from invocations. Those
- # options are added to group_options hash. Options that already exists
- # in base_options are not added twice.
- #
- def get_options_from_invocations(group_options, base_options) #:nodoc: # rubocop:disable MethodLength
- invocations.each do |name, from_option|
- value = if from_option
- option = class_options[name]
- option.type == :boolean ? name : option.default
- else
- name
- end
- next unless value
-
- klass, _ = prepare_for_invocation(name, value)
- next unless klass && klass.respond_to?(:class_options)
-
- value = value.to_s
- human_name = value.respond_to?(:classify) ? value.classify : value
-
- group_options[human_name] ||= []
- group_options[human_name] += klass.class_options.values.select do |class_option|
- base_options[class_option.name.to_sym].nil? && class_option.group.nil? &&
- !group_options.values.flatten.any? { |i| i.name == class_option.name }
- end
-
- yield klass if block_given?
- end
- end
-
- # Returns commands ready to be printed.
- def printable_commands(*)
- item = []
- item << banner
- item << (desc ? "# #{desc.gsub(/\s+/m, ' ')}" : "")
- [item]
- end
- alias_method :printable_tasks, :printable_commands
-
- def handle_argument_error(command, error, _args, arity) #:nodoc:
- msg = "#{basename} #{command.name} takes #{arity} argument".dup
- msg << "s" if arity > 1
- msg << ", but it should not."
- raise error, msg
- end
-
- protected
-
- # The method responsible for dispatching given the args.
- def dispatch(command, given_args, given_opts, config) #:nodoc:
- if Bundler::Thor::HELP_MAPPINGS.include?(given_args.first)
- help(config[:shell])
- return
- end
-
- args, opts = Bundler::Thor::Options.split(given_args)
- opts = given_opts || opts
-
- instance = new(args, opts, config)
- yield instance if block_given?
-
- if command
- instance.invoke_command(all_commands[command])
- else
- instance.invoke_all
- end
- end
-
- # The banner for this class. You can customize it if you are invoking the
- # thor class by another ways which is not the Bundler::Thor::Runner.
- def banner
- "#{basename} #{self_command.formatted_usage(self, false)}"
- end
-
- # Represents the whole class as a command.
- def self_command #:nodoc:
- Bundler::Thor::DynamicCommand.new(namespace, class_options)
- end
- alias_method :self_task, :self_command
-
- def baseclass #:nodoc:
- Bundler::Thor::Group
- end
-
- def create_command(meth) #:nodoc:
- commands[meth.to_s] = Bundler::Thor::Command.new(meth, nil, nil, nil, nil)
- true
- end
- alias_method :create_task, :create_command
- end
-
- include Bundler::Thor::Base
-
-protected
-
- # Shortcut to invoke with padding and block handling. Use internally by
- # invoke and invoke_from_option class methods.
- def _invoke_for_class_method(klass, command = nil, *args, &block) #:nodoc:
- with_padding do
- if block
- case block.arity
- when 3
- yield(self, klass, command)
- when 2
- yield(self, klass)
- when 1
- instance_exec(klass, &block)
- end
- else
- invoke klass, command, *args
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/invocation.rb b/lib/bundler/vendor/thor/lib/thor/invocation.rb
deleted file mode 100644
index 248a466f8e..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/invocation.rb
+++ /dev/null
@@ -1,178 +0,0 @@
-class Bundler::Thor
- module Invocation
- def self.included(base) #:nodoc:
- super(base)
- base.extend ClassMethods
- end
-
- module ClassMethods
- # This method is responsible for receiving a name and find the proper
- # class and command for it. The key is an optional parameter which is
- # available only in class methods invocations (i.e. in Bundler::Thor::Group).
- def prepare_for_invocation(key, name) #:nodoc:
- case name
- when Symbol, String
- Bundler::Thor::Util.find_class_and_command_by_namespace(name.to_s, !key)
- else
- name
- end
- end
- end
-
- # Make initializer aware of invocations and the initialization args.
- def initialize(args = [], options = {}, config = {}, &block) #:nodoc:
- @_invocations = config[:invocations] || Hash.new { |h, k| h[k] = [] }
- @_initializer = [args, options, config]
- super
- end
-
- # Make the current command chain accessible with in a Bundler::Thor-(sub)command
- def current_command_chain
- @_invocations.values.flatten.map(&:to_sym)
- end
-
- # Receives a name and invokes it. The name can be a string (either "command" or
- # "namespace:command"), a Bundler::Thor::Command, a Class or a Bundler::Thor instance. If the
- # command cannot be guessed by name, it can also be supplied as second argument.
- #
- # You can also supply the arguments, options and configuration values for
- # the command to be invoked, if none is given, the same values used to
- # initialize the invoker are used to initialize the invoked.
- #
- # When no name is given, it will invoke the default command of the current class.
- #
- # ==== Examples
- #
- # class A < Bundler::Thor
- # def foo
- # invoke :bar
- # invoke "b:hello", ["Erik"]
- # end
- #
- # def bar
- # invoke "b:hello", ["Erik"]
- # end
- # end
- #
- # class B < Bundler::Thor
- # def hello(name)
- # puts "hello #{name}"
- # end
- # end
- #
- # You can notice that the method "foo" above invokes two commands: "bar",
- # which belongs to the same class and "hello" which belongs to the class B.
- #
- # By using an invocation system you ensure that a command is invoked only once.
- # In the example above, invoking "foo" will invoke "b:hello" just once, even
- # if it's invoked later by "bar" method.
- #
- # When class A invokes class B, all arguments used on A initialization are
- # supplied to B. This allows lazy parse of options. Let's suppose you have
- # some rspec commands:
- #
- # class Rspec < Bundler::Thor::Group
- # class_option :mock_framework, :type => :string, :default => :rr
- #
- # def invoke_mock_framework
- # invoke "rspec:#{options[:mock_framework]}"
- # end
- # end
- #
- # As you noticed, it invokes the given mock framework, which might have its
- # own options:
- #
- # class Rspec::RR < Bundler::Thor::Group
- # class_option :style, :type => :string, :default => :mock
- # end
- #
- # Since it's not rspec concern to parse mock framework options, when RR
- # is invoked all options are parsed again, so RR can extract only the options
- # that it's going to use.
- #
- # If you want Rspec::RR to be initialized with its own set of options, you
- # have to do that explicitly:
- #
- # invoke "rspec:rr", [], :style => :foo
- #
- # Besides giving an instance, you can also give a class to invoke:
- #
- # invoke Rspec::RR, [], :style => :foo
- #
- def invoke(name = nil, *args)
- if name.nil?
- warn "[Bundler::Thor] Calling invoke() without argument is deprecated. Please use invoke_all instead.\n#{caller.join("\n")}"
- return invoke_all
- end
-
- args.unshift(nil) if args.first.is_a?(Array) || args.first.nil?
- command, args, opts, config = args
-
- klass, command = _retrieve_class_and_command(name, command)
- raise "Missing Bundler::Thor class for invoke #{name}" unless klass
- raise "Expected Bundler::Thor class, got #{klass}" unless klass <= Bundler::Thor::Base
-
- args, opts, config = _parse_initialization_options(args, opts, config)
- klass.send(:dispatch, command, args, opts, config) do |instance|
- instance.parent_options = options
- end
- end
-
- # Invoke the given command if the given args.
- def invoke_command(command, *args) #:nodoc:
- current = @_invocations[self.class]
-
- unless current.include?(command.name)
- current << command.name
- command.run(self, *args)
- end
- end
- alias_method :invoke_task, :invoke_command
-
- # Invoke all commands for the current instance.
- def invoke_all #:nodoc:
- self.class.all_commands.map { |_, command| invoke_command(command) }
- end
-
- # Invokes using shell padding.
- def invoke_with_padding(*args)
- with_padding { invoke(*args) }
- end
-
- protected
-
- # Configuration values that are shared between invocations.
- def _shared_configuration #:nodoc:
- {:invocations => @_invocations}
- end
-
- # This method simply retrieves the class and command to be invoked.
- # If the name is nil or the given name is a command in the current class,
- # use the given name and return self as class. Otherwise, call
- # prepare_for_invocation in the current class.
- def _retrieve_class_and_command(name, sent_command = nil) #:nodoc:
- if name.nil?
- [self.class, nil]
- elsif self.class.all_commands[name.to_s]
- [self.class, name.to_s]
- else
- klass, command = self.class.prepare_for_invocation(nil, name)
- [klass, command || sent_command]
- end
- end
- alias_method :_retrieve_class_and_task, :_retrieve_class_and_command
-
- # Initialize klass using values stored in the @_initializer.
- def _parse_initialization_options(args, opts, config) #:nodoc:
- stored_args, stored_opts, stored_config = @_initializer
-
- args ||= stored_args.dup
- opts ||= stored_opts.dup
-
- config ||= {}
- config = stored_config.merge(_shared_configuration).merge!(config)
-
- [args, opts, config]
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/line_editor.rb b/lib/bundler/vendor/thor/lib/thor/line_editor.rb
deleted file mode 100644
index 5c0c336e7a..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/line_editor.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require_relative "line_editor/basic"
-require_relative "line_editor/readline"
-
-class Bundler::Thor
- module LineEditor
- def self.readline(prompt, options = {})
- best_available.new(prompt, options).readline
- end
-
- def self.best_available
- [
- Bundler::Thor::LineEditor::Readline,
- Bundler::Thor::LineEditor::Basic
- ].detect(&:available?)
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb b/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
deleted file mode 100644
index fe3d7c998f..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class Bundler::Thor
- module LineEditor
- class Basic
- attr_reader :prompt, :options
-
- def self.available?
- true
- end
-
- def initialize(prompt, options)
- @prompt = prompt
- @options = options
- end
-
- def readline
- $stdout.print(prompt)
- get_input
- end
-
- private
-
- def get_input
- if echo?
- $stdin.gets
- else
- # Lazy-load io/console since it is gem-ified as of 2.3
- require "io/console"
- $stdin.noecho(&:gets)
- end
- end
-
- def echo?
- options.fetch(:echo, true)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb b/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb
deleted file mode 100644
index 120eadd06a..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-class Bundler::Thor
- module LineEditor
- class Readline < Basic
- def self.available?
- begin
- require "readline"
- rescue LoadError
- end
-
- Object.const_defined?(:Readline)
- end
-
- def readline
- if echo?
- ::Readline.completion_append_character = nil
- # rb-readline does not allow Readline.completion_proc= to receive nil.
- if complete = completion_proc
- ::Readline.completion_proc = complete
- end
- ::Readline.readline(prompt, add_to_history?)
- else
- super
- end
- end
-
- private
-
- def add_to_history?
- options.fetch(:add_to_history, true)
- end
-
- def completion_proc
- if use_path_completion?
- proc { |text| PathCompletion.new(text).matches }
- elsif completion_options.any?
- proc do |text|
- completion_options.select { |option| option.start_with?(text) }
- end
- end
- end
-
- def completion_options
- options.fetch(:limited_to, [])
- end
-
- def use_path_completion?
- options.fetch(:path, false)
- end
-
- class PathCompletion
- attr_reader :text
- private :text
-
- def initialize(text)
- @text = text
- end
-
- def matches
- relative_matches
- end
-
- private
-
- def relative_matches
- absolute_matches.map { |path| path.sub(base_path, "") }
- end
-
- def absolute_matches
- Dir[glob_pattern].map do |path|
- if File.directory?(path)
- "#{path}/"
- else
- path
- end
- end
- end
-
- def glob_pattern
- "#{base_path}#{text}*"
- end
-
- def base_path
- "#{Dir.pwd}/"
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/nested_context.rb b/lib/bundler/vendor/thor/lib/thor/nested_context.rb
deleted file mode 100644
index fd36b9d43f..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/nested_context.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-class Bundler::Thor
- class NestedContext
- def initialize
- @depth = 0
- end
-
- def enter
- push
-
- yield
- ensure
- pop
- end
-
- def entered?
- @depth > 0
- end
-
- private
-
- def push
- @depth += 1
- end
-
- def pop
- @depth -= 1
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/parser.rb b/lib/bundler/vendor/thor/lib/thor/parser.rb
deleted file mode 100644
index 45394732ca..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/parser.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require_relative "parser/argument"
-require_relative "parser/arguments"
-require_relative "parser/option"
-require_relative "parser/options"
diff --git a/lib/bundler/vendor/thor/lib/thor/parser/argument.rb b/lib/bundler/vendor/thor/lib/thor/parser/argument.rb
deleted file mode 100644
index dfe7398583..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/parser/argument.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-class Bundler::Thor
- class Argument #:nodoc:
- VALID_TYPES = [:numeric, :hash, :array, :string]
-
- attr_reader :name, :description, :enum, :required, :type, :default, :banner
- alias_method :human_name, :name
-
- def initialize(name, options = {})
- class_name = self.class.name.split("::").last
-
- type = options[:type]
-
- raise ArgumentError, "#{class_name} name can't be nil." if name.nil?
- raise ArgumentError, "Type :#{type} is not valid for #{class_name.downcase}s." if type && !valid_type?(type)
-
- @name = name.to_s
- @description = options[:desc]
- @required = options.key?(:required) ? options[:required] : true
- @type = (type || :string).to_sym
- @default = options[:default]
- @banner = options[:banner] || default_banner
- @enum = options[:enum]
-
- validate! # Trigger specific validations
- end
-
- def usage
- required? ? banner : "[#{banner}]"
- end
-
- def required?
- required
- end
-
- def show_default?
- case default
- when Array, String, Hash
- !default.empty?
- else
- default
- end
- end
-
- protected
-
- def validate!
- raise ArgumentError, "An argument cannot be required and have default value." if required? && !default.nil?
- raise ArgumentError, "An argument cannot have an enum other than an array." if @enum && !@enum.is_a?(Array)
- end
-
- def valid_type?(type)
- self.class::VALID_TYPES.include?(type.to_sym)
- end
-
- def default_banner
- case type
- when :boolean
- nil
- when :string, :default
- human_name.upcase
- when :numeric
- "N"
- when :hash
- "key:value"
- when :array
- "one two three"
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb b/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb
deleted file mode 100644
index d0f43e2d97..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb
+++ /dev/null
@@ -1,175 +0,0 @@
-class Bundler::Thor
- class Arguments #:nodoc: # rubocop:disable ClassLength
- NUMERIC = /[-+]?(\d*\.\d+|\d+)/
-
- # Receives an array of args and returns two arrays, one with arguments
- # and one with switches.
- #
- def self.split(args)
- arguments = []
-
- args.each do |item|
- break if item.is_a?(String) && item =~ /^-/
- arguments << item
- end
-
- [arguments, args[Range.new(arguments.size, -1)]]
- end
-
- def self.parse(*args)
- to_parse = args.pop
- new(*args).parse(to_parse)
- end
-
- # Takes an array of Bundler::Thor::Argument objects.
- #
- def initialize(arguments = [])
- @assigns = {}
- @non_assigned_required = []
- @switches = arguments
-
- arguments.each do |argument|
- if !argument.default.nil?
- @assigns[argument.human_name] = argument.default
- elsif argument.required?
- @non_assigned_required << argument
- end
- end
- end
-
- def parse(args)
- @pile = args.dup
-
- @switches.each do |argument|
- break unless peek
- @non_assigned_required.delete(argument)
- @assigns[argument.human_name] = send(:"parse_#{argument.type}", argument.human_name)
- end
-
- check_requirement!
- @assigns
- end
-
- def remaining
- @pile
- end
-
- private
-
- def no_or_skip?(arg)
- arg =~ /^--(no|skip)-([-\w]+)$/
- $2
- end
-
- def last?
- @pile.empty?
- end
-
- def peek
- @pile.first
- end
-
- def shift
- @pile.shift
- end
-
- def unshift(arg)
- if arg.is_a?(Array)
- @pile = arg + @pile
- else
- @pile.unshift(arg)
- end
- end
-
- def current_is_value?
- peek && peek.to_s !~ /^-{1,2}\S+/
- end
-
- # Runs through the argument array getting strings that contains ":" and
- # mark it as a hash:
- #
- # [ "name:string", "age:integer" ]
- #
- # Becomes:
- #
- # { "name" => "string", "age" => "integer" }
- #
- def parse_hash(name)
- return shift if peek.is_a?(Hash)
- hash = {}
-
- while current_is_value? && peek.include?(":")
- key, value = shift.split(":", 2)
- raise MalformattedArgumentError, "You can't specify '#{key}' more than once in option '#{name}'; got #{key}:#{hash[key]} and #{key}:#{value}" if hash.include? key
- hash[key] = value
- end
- hash
- end
-
- # Runs through the argument array getting all strings until no string is
- # found or a switch is found.
- #
- # ["a", "b", "c"]
- #
- # And returns it as an array:
- #
- # ["a", "b", "c"]
- #
- def parse_array(name)
- return shift if peek.is_a?(Array)
- array = []
- array << shift while current_is_value?
- array
- end
-
- # Check if the peek is numeric format and return a Float or Integer.
- # Check if the peek is included in enum if enum is provided.
- # Otherwise raises an error.
- #
- def parse_numeric(name)
- return shift if peek.is_a?(Numeric)
-
- unless peek =~ NUMERIC && $& == peek
- raise MalformattedArgumentError, "Expected numeric value for '#{name}'; got #{peek.inspect}"
- end
-
- value = $&.index(".") ? shift.to_f : shift.to_i
- if @switches.is_a?(Hash) && switch = @switches[name]
- if switch.enum && !switch.enum.include?(value)
- raise MalformattedArgumentError, "Expected '#{name}' to be one of #{switch.enum.join(', ')}; got #{value}"
- end
- end
- value
- end
-
- # Parse string:
- # for --string-arg, just return the current value in the pile
- # for --no-string-arg, nil
- # Check if the peek is included in enum if enum is provided. Otherwise raises an error.
- #
- def parse_string(name)
- if no_or_skip?(name)
- nil
- else
- value = shift
- if @switches.is_a?(Hash) && switch = @switches[name]
- if switch.enum && !switch.enum.include?(value)
- raise MalformattedArgumentError, "Expected '#{name}' to be one of #{switch.enum.join(', ')}; got #{value}"
- end
- end
- value
- end
- end
-
- # Raises an error if @non_assigned_required array is not empty.
- #
- def check_requirement!
- return if @non_assigned_required.empty?
- names = @non_assigned_required.map do |o|
- o.respond_to?(:switch_name) ? o.switch_name : o.human_name
- end.join("', '")
- class_name = self.class.name.split("::").last.downcase
- raise RequiredArgumentMissingError, "No value provided for required #{class_name} '#{names}'"
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/parser/option.rb b/lib/bundler/vendor/thor/lib/thor/parser/option.rb
deleted file mode 100644
index 5a5af6f888..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/parser/option.rb
+++ /dev/null
@@ -1,159 +0,0 @@
-class Bundler::Thor
- class Option < Argument #:nodoc:
- attr_reader :aliases, :group, :lazy_default, :hide, :repeatable
-
- VALID_TYPES = [:boolean, :numeric, :hash, :array, :string]
-
- def initialize(name, options = {})
- @check_default_type = options[:check_default_type]
- options[:required] = false unless options.key?(:required)
- @repeatable = options.fetch(:repeatable, false)
- super
- @lazy_default = options[:lazy_default]
- @group = options[:group].to_s.capitalize if options[:group]
- @aliases = Array(options[:aliases])
- @hide = options[:hide]
- end
-
- # This parse quick options given as method_options. It makes several
- # assumptions, but you can be more specific using the option method.
- #
- # parse :foo => "bar"
- # #=> Option foo with default value bar
- #
- # parse [:foo, :baz] => "bar"
- # #=> Option foo with default value bar and alias :baz
- #
- # parse :foo => :required
- # #=> Required option foo without default value
- #
- # parse :foo => 2
- # #=> Option foo with default value 2 and type numeric
- #
- # parse :foo => :numeric
- # #=> Option foo without default value and type numeric
- #
- # parse :foo => true
- # #=> Option foo with default value true and type boolean
- #
- # The valid types are :boolean, :numeric, :hash, :array and :string. If none
- # is given a default type is assumed. This default type accepts arguments as
- # string (--foo=value) or booleans (just --foo).
- #
- # By default all options are optional, unless :required is given.
- #
- def self.parse(key, value)
- if key.is_a?(Array)
- name, *aliases = key
- else
- name = key
- aliases = []
- end
-
- name = name.to_s
- default = value
-
- type = case value
- when Symbol
- default = nil
- if VALID_TYPES.include?(value)
- value
- elsif required = (value == :required) # rubocop:disable AssignmentInCondition
- :string
- end
- when TrueClass, FalseClass
- :boolean
- when Numeric
- :numeric
- when Hash, Array, String
- value.class.name.downcase.to_sym
- end
-
- new(name.to_s, :required => required, :type => type, :default => default, :aliases => aliases)
- end
-
- def switch_name
- @switch_name ||= dasherized? ? name : dasherize(name)
- end
-
- def human_name
- @human_name ||= dasherized? ? undasherize(name) : name
- end
-
- def usage(padding = 0)
- sample = if banner && !banner.to_s.empty?
- "#{switch_name}=#{banner}".dup
- else
- switch_name
- end
-
- sample = "[#{sample}]".dup unless required?
-
- if boolean?
- sample << ", [#{dasherize('no-' + human_name)}]" unless (name == "force") || name.start_with?("no-")
- end
-
- if aliases.empty?
- (" " * padding) << sample
- else
- "#{aliases.join(', ')}, #{sample}"
- end
- end
-
- VALID_TYPES.each do |type|
- class_eval <<-RUBY, __FILE__, __LINE__ + 1
- def #{type}?
- self.type == #{type.inspect}
- end
- RUBY
- end
-
- protected
-
- def validate!
- raise ArgumentError, "An option cannot be boolean and required." if boolean? && required?
- validate_default_type!
- end
-
- def validate_default_type!
- default_type = case @default
- when nil
- return
- when TrueClass, FalseClass
- required? ? :string : :boolean
- when Numeric
- :numeric
- when Symbol
- :string
- when Hash, Array, String
- @default.class.name.downcase.to_sym
- end
-
- expected_type = (@repeatable && @type != :hash) ? :array : @type
-
- if default_type != expected_type
- err = "Expected #{expected_type} default value for '#{switch_name}'; got #{@default.inspect} (#{default_type})"
-
- if @check_default_type
- raise ArgumentError, err
- elsif @check_default_type == nil
- Bundler::Thor.deprecation_warning "#{err}.\n" +
- 'This will be rejected in the future unless you explicitly pass the options `check_default_type: false`' +
- ' or call `allow_incompatible_default_type!` in your code'
- end
- end
- end
-
- def dasherized?
- name.index("-") == 0
- end
-
- def undasherize(str)
- str.sub(/^-{1,2}/, "")
- end
-
- def dasherize(str)
- (str.length > 1 ? "--" : "-") + str.tr("_", "-")
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/parser/options.rb b/lib/bundler/vendor/thor/lib/thor/parser/options.rb
deleted file mode 100644
index 6d1342ee3c..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/parser/options.rb
+++ /dev/null
@@ -1,236 +0,0 @@
-class Bundler::Thor
- class Options < Arguments #:nodoc: # rubocop:disable ClassLength
- LONG_RE = /^(--\w+(?:-\w+)*)$/
- SHORT_RE = /^(-[a-z])$/i
- EQ_RE = /^(--\w+(?:-\w+)*|-[a-z])=(.*)$/i
- SHORT_SQ_RE = /^-([a-z]{2,})$/i # Allow either -x -v or -xv style for single char args
- SHORT_NUM = /^(-[a-z])#{NUMERIC}$/i
- OPTS_END = "--".freeze
-
- # Receives a hash and makes it switches.
- def self.to_switches(options)
- options.map do |key, value|
- case value
- when true
- "--#{key}"
- when Array
- "--#{key} #{value.map(&:inspect).join(' ')}"
- when Hash
- "--#{key} #{value.map { |k, v| "#{k}:#{v}" }.join(' ')}"
- when nil, false
- nil
- else
- "--#{key} #{value.inspect}"
- end
- end.compact.join(" ")
- end
-
- # Takes a hash of Bundler::Thor::Option and a hash with defaults.
- #
- # If +stop_on_unknown+ is true, #parse will stop as soon as it encounters
- # an unknown option or a regular argument.
- def initialize(hash_options = {}, defaults = {}, stop_on_unknown = false, disable_required_check = false)
- @stop_on_unknown = stop_on_unknown
- @disable_required_check = disable_required_check
- options = hash_options.values
- super(options)
-
- # Add defaults
- defaults.each do |key, value|
- @assigns[key.to_s] = value
- @non_assigned_required.delete(hash_options[key])
- end
-
- @shorts = {}
- @switches = {}
- @extra = []
- @stopped_parsing_after_extra_index = nil
-
- options.each do |option|
- @switches[option.switch_name] = option
-
- option.aliases.each do |short|
- name = short.to_s.sub(/^(?!\-)/, "-")
- @shorts[name] ||= option.switch_name
- end
- end
- end
-
- def remaining
- @extra
- end
-
- def peek
- return super unless @parsing_options
-
- result = super
- if result == OPTS_END
- shift
- @parsing_options = false
- @stopped_parsing_after_extra_index ||= @extra.size
- super
- else
- result
- end
- end
-
- def parse(args) # rubocop:disable MethodLength
- @pile = args.dup
- @parsing_options = true
-
- while peek
- if parsing_options?
- match, is_switch = current_is_switch?
- shifted = shift
-
- if is_switch
- case shifted
- when SHORT_SQ_RE
- unshift($1.split("").map { |f| "-#{f}" })
- next
- when EQ_RE, SHORT_NUM
- unshift($2)
- switch = $1
- when LONG_RE, SHORT_RE
- switch = $1
- end
-
- switch = normalize_switch(switch)
- option = switch_option(switch)
- result = parse_peek(switch, option)
- assign_result!(option, result)
- elsif @stop_on_unknown
- @parsing_options = false
- @extra << shifted
- @stopped_parsing_after_extra_index ||= @extra.size
- @extra << shift while peek
- break
- elsif match
- @extra << shifted
- @extra << shift while peek && peek !~ /^-/
- else
- @extra << shifted
- end
- else
- @extra << shift
- end
- end
-
- check_requirement! unless @disable_required_check
-
- assigns = Bundler::Thor::CoreExt::HashWithIndifferentAccess.new(@assigns)
- assigns.freeze
- assigns
- end
-
- def check_unknown!
- to_check = @stopped_parsing_after_extra_index ? @extra[0...@stopped_parsing_after_extra_index] : @extra
-
- # an unknown option starts with - or -- and has no more --'s afterward.
- unknown = to_check.select { |str| str =~ /^--?(?:(?!--).)*$/ }
- raise UnknownArgumentError.new(@switches.keys, unknown) unless unknown.empty?
- end
-
- protected
-
- def assign_result!(option, result)
- if option.repeatable && option.type == :hash
- (@assigns[option.human_name] ||= {}).merge!(result)
- elsif option.repeatable
- (@assigns[option.human_name] ||= []) << result
- else
- @assigns[option.human_name] = result
- end
- end
- # Check if the current value in peek is a registered switch.
- #
- # Two booleans are returned. The first is true if the current value
- # starts with a hyphen; the second is true if it is a registered switch.
- def current_is_switch?
- case peek
- when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
- [true, switch?($1)]
- when SHORT_SQ_RE
- [true, $1.split("").any? { |f| switch?("-#{f}") }]
- else
- [false, false]
- end
- end
-
- def current_is_switch_formatted?
- case peek
- when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM, SHORT_SQ_RE
- true
- else
- false
- end
- end
-
- def current_is_value?
- peek && (!parsing_options? || super)
- end
-
- def switch?(arg)
- !switch_option(normalize_switch(arg)).nil?
- end
-
- def switch_option(arg)
- if match = no_or_skip?(arg) # rubocop:disable AssignmentInCondition
- @switches[arg] || @switches["--#{match}"]
- else
- @switches[arg]
- end
- end
-
- # Check if the given argument is actually a shortcut.
- #
- def normalize_switch(arg)
- (@shorts[arg] || arg).tr("_", "-")
- end
-
- def parsing_options?
- peek
- @parsing_options
- end
-
- # Parse boolean values which can be given as --foo=true, --foo or --no-foo.
- #
- def parse_boolean(switch)
- if current_is_value?
- if ["true", "TRUE", "t", "T", true].include?(peek)
- shift
- true
- elsif ["false", "FALSE", "f", "F", false].include?(peek)
- shift
- false
- else
- @switches.key?(switch) || !no_or_skip?(switch)
- end
- else
- @switches.key?(switch) || !no_or_skip?(switch)
- end
- end
-
- # Parse the value at the peek analyzing if it requires an input or not.
- #
- def parse_peek(switch, option)
- if parsing_options? && (current_is_switch_formatted? || last?)
- if option.boolean?
- # No problem for boolean types
- elsif no_or_skip?(switch)
- return nil # User set value to nil
- elsif option.string? && !option.required?
- # Return the default if there is one, else the human name
- return option.lazy_default || option.default || option.human_name
- elsif option.lazy_default
- return option.lazy_default
- else
- raise MalformattedArgumentError, "No value provided for option '#{switch}'"
- end
- end
-
- @non_assigned_required.delete(option)
- send(:"parse_#{option.type}", switch)
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/rake_compat.rb b/lib/bundler/vendor/thor/lib/thor/rake_compat.rb
deleted file mode 100644
index f8f86372cc..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/rake_compat.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-require "rake"
-require "rake/dsl_definition"
-
-class Bundler::Thor
- # Adds a compatibility layer to your Bundler::Thor classes which allows you to use
- # rake package tasks. For example, to use rspec rake tasks, one can do:
- #
- # require 'bundler/vendor/thor/lib/thor/rake_compat'
- # require 'rspec/core/rake_task'
- #
- # class Default < Bundler::Thor
- # include Bundler::Thor::RakeCompat
- #
- # RSpec::Core::RakeTask.new(:spec) do |t|
- # t.spec_opts = ['--options', './.rspec']
- # t.spec_files = FileList['spec/**/*_spec.rb']
- # end
- # end
- #
- module RakeCompat
- include Rake::DSL if defined?(Rake::DSL)
-
- def self.rake_classes
- @rake_classes ||= []
- end
-
- def self.included(base)
- super(base)
- # Hack. Make rakefile point to invoker, so rdoc task is generated properly.
- rakefile = File.basename(caller[0].match(/(.*):\d+/)[1])
- Rake.application.instance_variable_set(:@rakefile, rakefile)
- rake_classes << base
- end
- end
-end
-
-# override task on (main), for compatibility with Rake 0.9
-instance_eval do
- alias rake_namespace namespace
-
- def task(*)
- task = super
-
- if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
- non_namespaced_name = task.name.split(":").last
-
- description = non_namespaced_name
- description << task.arg_names.map { |n| n.to_s.upcase }.join(" ")
- description.strip!
-
- klass.desc description, Rake.application.last_description || non_namespaced_name
- Rake.application.last_description = nil
- klass.send :define_method, non_namespaced_name do |*args|
- Rake::Task[task.name.to_sym].invoke(*args)
- end
- end
-
- task
- end
-
- def namespace(name)
- if klass = Bundler::Thor::RakeCompat.rake_classes.last # rubocop:disable AssignmentInCondition
- const_name = Bundler::Thor::Util.camel_case(name.to_s).to_sym
- klass.const_set(const_name, Class.new(Bundler::Thor))
- new_klass = klass.const_get(const_name)
- Bundler::Thor::RakeCompat.rake_classes << new_klass
- end
-
- super
- Bundler::Thor::RakeCompat.rake_classes.pop
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/runner.rb b/lib/bundler/vendor/thor/lib/thor/runner.rb
deleted file mode 100644
index 54c5525093..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/runner.rb
+++ /dev/null
@@ -1,325 +0,0 @@
-require_relative "../thor"
-require_relative "group"
-
-require "yaml"
-require "digest/md5"
-require "pathname"
-
-class Bundler::Thor::Runner < Bundler::Thor #:nodoc: # rubocop:disable ClassLength
- autoload :OpenURI, "open-uri"
-
- map "-T" => :list, "-i" => :install, "-u" => :update, "-v" => :version
-
- def self.banner(command, all = false, subcommand = false)
- "thor " + command.formatted_usage(self, all, subcommand)
- end
-
- def self.exit_on_failure?
- true
- end
-
- # Override Bundler::Thor#help so it can give information about any class and any method.
- #
- def help(meth = nil)
- if meth && !respond_to?(meth)
- initialize_thorfiles(meth)
- klass, command = Bundler::Thor::Util.find_class_and_command_by_namespace(meth)
- self.class.handle_no_command_error(command, false) if klass.nil?
- klass.start(["-h", command].compact, :shell => shell)
- else
- super
- end
- end
-
- # If a command is not found on Bundler::Thor::Runner, method missing is invoked and
- # Bundler::Thor::Runner is then responsible for finding the command in all classes.
- #
- def method_missing(meth, *args)
- meth = meth.to_s
- initialize_thorfiles(meth)
- klass, command = Bundler::Thor::Util.find_class_and_command_by_namespace(meth)
- self.class.handle_no_command_error(command, false) if klass.nil?
- args.unshift(command) if command
- klass.start(args, :shell => shell)
- end
-
- desc "install NAME", "Install an optionally named Bundler::Thor file into your system commands"
- method_options :as => :string, :relative => :boolean, :force => :boolean
- def install(name) # rubocop:disable MethodLength
- initialize_thorfiles
-
- # If a directory name is provided as the argument, look for a 'main.thor'
- # command in said directory.
- begin
- if File.directory?(File.expand_path(name))
- base = File.join(name, "main.thor")
- package = :directory
- contents = open(base, &:read)
- else
- base = name
- package = :file
- contents = open(name, &:read)
- end
- rescue OpenURI::HTTPError
- raise Error, "Error opening URI '#{name}'"
- rescue Errno::ENOENT
- raise Error, "Error opening file '#{name}'"
- end
-
- say "Your Thorfile contains:"
- say contents
-
- unless options["force"]
- return false if no?("Do you wish to continue [y/N]?")
- end
-
- as = options["as"] || begin
- first_line = contents.split("\n")[0]
- (match = first_line.match(/\s*#\s*module:\s*([^\n]*)/)) ? match[1].strip : nil
- end
-
- unless as
- basename = File.basename(name)
- as = ask("Please specify a name for #{name} in the system repository [#{basename}]:")
- as = basename if as.empty?
- end
-
- location = if options[:relative] || name =~ %r{^https?://}
- name
- else
- File.expand_path(name)
- end
-
- thor_yaml[as] = {
- :filename => Digest::MD5.hexdigest(name + as),
- :location => location,
- :namespaces => Bundler::Thor::Util.namespaces_in_content(contents, base)
- }
-
- save_yaml(thor_yaml)
- say "Storing thor file in your system repository"
- destination = File.join(thor_root, thor_yaml[as][:filename])
-
- if package == :file
- File.open(destination, "w") { |f| f.puts contents }
- else
- require "fileutils"
- FileUtils.cp_r(name, destination)
- end
-
- thor_yaml[as][:filename] # Indicate success
- end
-
- desc "version", "Show Bundler::Thor version"
- def version
- require_relative "version"
- say "Bundler::Thor #{Bundler::Thor::VERSION}"
- end
-
- desc "uninstall NAME", "Uninstall a named Bundler::Thor module"
- def uninstall(name)
- raise Error, "Can't find module '#{name}'" unless thor_yaml[name]
- say "Uninstalling #{name}."
- require "fileutils"
- FileUtils.rm_rf(File.join(thor_root, (thor_yaml[name][:filename]).to_s))
-
- thor_yaml.delete(name)
- save_yaml(thor_yaml)
-
- puts "Done."
- end
-
- desc "update NAME", "Update a Bundler::Thor file from its original location"
- def update(name)
- raise Error, "Can't find module '#{name}'" if !thor_yaml[name] || !thor_yaml[name][:location]
-
- say "Updating '#{name}' from #{thor_yaml[name][:location]}"
-
- old_filename = thor_yaml[name][:filename]
- self.options = options.merge("as" => name)
-
- if File.directory? File.expand_path(name)
- require "fileutils"
- FileUtils.rm_rf(File.join(thor_root, old_filename))
-
- thor_yaml.delete(old_filename)
- save_yaml(thor_yaml)
-
- filename = install(name)
- else
- filename = install(thor_yaml[name][:location])
- end
-
- File.delete(File.join(thor_root, old_filename)) unless filename == old_filename
- end
-
- desc "installed", "List the installed Bundler::Thor modules and commands"
- method_options :internal => :boolean
- def installed
- initialize_thorfiles(nil, true)
- display_klasses(true, options["internal"])
- end
-
- desc "list [SEARCH]", "List the available thor commands (--substring means .*SEARCH)"
- method_options :substring => :boolean, :group => :string, :all => :boolean, :debug => :boolean
- def list(search = "")
- initialize_thorfiles
-
- search = ".*#{search}" if options["substring"]
- search = /^#{search}.*/i
- group = options[:group] || "standard"
-
- klasses = Bundler::Thor::Base.subclasses.select do |k|
- (options[:all] || k.group == group) && k.namespace =~ search
- end
-
- display_klasses(false, false, klasses)
- end
-
-private
-
- def thor_root
- Bundler::Thor::Util.thor_root
- end
-
- def thor_yaml
- @thor_yaml ||= begin
- yaml_file = File.join(thor_root, "thor.yml")
- yaml = YAML.load_file(yaml_file) if File.exist?(yaml_file)
- yaml || {}
- end
- end
-
- # Save the yaml file. If none exists in thor root, creates one.
- #
- def save_yaml(yaml)
- yaml_file = File.join(thor_root, "thor.yml")
-
- unless File.exist?(yaml_file)
- require "fileutils"
- FileUtils.mkdir_p(thor_root)
- yaml_file = File.join(thor_root, "thor.yml")
- FileUtils.touch(yaml_file)
- end
-
- File.open(yaml_file, "w") { |f| f.puts yaml.to_yaml }
- end
-
- # Load the Thorfiles. If relevant_to is supplied, looks for specific files
- # in the thor_root instead of loading them all.
- #
- # By default, it also traverses the current path until find Bundler::Thor files, as
- # described in thorfiles. This look up can be skipped by supplying
- # skip_lookup true.
- #
- def initialize_thorfiles(relevant_to = nil, skip_lookup = false)
- thorfiles(relevant_to, skip_lookup).each do |f|
- Bundler::Thor::Util.load_thorfile(f, nil, options[:debug]) unless Bundler::Thor::Base.subclass_files.keys.include?(File.expand_path(f))
- end
- end
-
- # Finds Thorfiles by traversing from your current directory down to the root
- # directory of your system. If at any time we find a Bundler::Thor file, we stop.
- #
- # We also ensure that system-wide Thorfiles are loaded first, so local
- # Thorfiles can override them.
- #
- # ==== Example
- #
- # If we start at /Users/wycats/dev/thor ...
- #
- # 1. /Users/wycats/dev/thor
- # 2. /Users/wycats/dev
- # 3. /Users/wycats <-- we find a Thorfile here, so we stop
- #
- # Suppose we start at c:\Documents and Settings\james\dev\thor ...
- #
- # 1. c:\Documents and Settings\james\dev\thor
- # 2. c:\Documents and Settings\james\dev
- # 3. c:\Documents and Settings\james
- # 4. c:\Documents and Settings
- # 5. c:\ <-- no Thorfiles found!
- #
- def thorfiles(relevant_to = nil, skip_lookup = false)
- thorfiles = []
-
- unless skip_lookup
- Pathname.pwd.ascend do |path|
- thorfiles = Bundler::Thor::Util.globs_for(path).map { |g| Dir[g] }.flatten
- break unless thorfiles.empty?
- end
- end
-
- files = (relevant_to ? thorfiles_relevant_to(relevant_to) : Bundler::Thor::Util.thor_root_glob)
- files += thorfiles
- files -= ["#{thor_root}/thor.yml"]
-
- files.map! do |file|
- File.directory?(file) ? File.join(file, "main.thor") : file
- end
- end
-
- # Load Thorfiles relevant to the given method. If you provide "foo:bar" it
- # will load all thor files in the thor.yaml that has "foo" e "foo:bar"
- # namespaces registered.
- #
- def thorfiles_relevant_to(meth)
- lookup = [meth, meth.split(":")[0...-1].join(":")]
-
- files = thor_yaml.select do |_, v|
- v[:namespaces] && !(v[:namespaces] & lookup).empty?
- end
-
- files.map { |_, v| File.join(thor_root, (v[:filename]).to_s) }
- end
-
- # Display information about the given klasses. If with_module is given,
- # it shows a table with information extracted from the yaml file.
- #
- def display_klasses(with_modules = false, show_internal = false, klasses = Bundler::Thor::Base.subclasses)
- klasses -= [Bundler::Thor, Bundler::Thor::Runner, Bundler::Thor::Group] unless show_internal
-
- raise Error, "No Bundler::Thor commands available" if klasses.empty?
- show_modules if with_modules && !thor_yaml.empty?
-
- list = Hash.new { |h, k| h[k] = [] }
- groups = klasses.select { |k| k.ancestors.include?(Bundler::Thor::Group) }
-
- # Get classes which inherit from Bundler::Thor
- (klasses - groups).each { |k| list[k.namespace.split(":").first] += k.printable_commands(false) }
-
- # Get classes which inherit from Bundler::Thor::Base
- groups.map! { |k| k.printable_commands(false).first }
- list["root"] = groups
-
- # Order namespaces with default coming first
- list = list.sort { |a, b| a[0].sub(/^default/, "") <=> b[0].sub(/^default/, "") }
- list.each { |n, commands| display_commands(n, commands) unless commands.empty? }
- end
-
- def display_commands(namespace, list) #:nodoc:
- list.sort! { |a, b| a[0] <=> b[0] }
-
- say shell.set_color(namespace, :blue, true)
- say "-" * namespace.size
-
- print_table(list, :truncate => true)
- say
- end
- alias_method :display_tasks, :display_commands
-
- def show_modules #:nodoc:
- info = []
- labels = %w(Modules Namespaces)
-
- info << labels
- info << ["-" * labels[0].size, "-" * labels[1].size]
-
- thor_yaml.each do |name, hash|
- info << [name, hash[:namespaces].join(", ")]
- end
-
- print_table info
- say ""
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/shell.rb b/lib/bundler/vendor/thor/lib/thor/shell.rb
deleted file mode 100644
index e36fa472d6..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/shell.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require "rbconfig"
-
-class Bundler::Thor
- module Base
- class << self
- attr_writer :shell
-
- # Returns the shell used in all Bundler::Thor classes. If you are in a Unix platform
- # it will use a colored log, otherwise it will use a basic one without color.
- #
- def shell
- @shell ||= if ENV["THOR_SHELL"] && !ENV["THOR_SHELL"].empty?
- Bundler::Thor::Shell.const_get(ENV["THOR_SHELL"])
- elsif RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ && !ENV["ANSICON"]
- Bundler::Thor::Shell::Basic
- else
- Bundler::Thor::Shell::Color
- end
- end
- end
- end
-
- module Shell
- SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
- attr_writer :shell
-
- autoload :Basic, File.expand_path("shell/basic", __dir__)
- autoload :Color, File.expand_path("shell/color", __dir__)
- autoload :HTML, File.expand_path("shell/html", __dir__)
-
- # Add shell to initialize config values.
- #
- # ==== Configuration
- # shell<Object>:: An instance of the shell to be used.
- #
- # ==== Examples
- #
- # class MyScript < Bundler::Thor
- # argument :first, :type => :numeric
- # end
- #
- # MyScript.new [1.0], { :foo => :bar }, :shell => Bundler::Thor::Shell::Basic.new
- #
- def initialize(args = [], options = {}, config = {})
- super
- self.shell = config[:shell]
- shell.base ||= self if shell.respond_to?(:base)
- end
-
- # Holds the shell for the given Bundler::Thor instance. If no shell is given,
- # it gets a default shell from Bundler::Thor::Base.shell.
- def shell
- @shell ||= Bundler::Thor::Base.shell.new
- end
-
- # Common methods that are delegated to the shell.
- SHELL_DELEGATED_METHODS.each do |method|
- module_eval <<-METHOD, __FILE__, __LINE__ + 1
- def #{method}(*args,&block)
- shell.#{method}(*args,&block)
- end
- METHOD
- end
-
- # Yields the given block with padding.
- def with_padding
- shell.padding += 1
- yield
- ensure
- shell.padding -= 1
- end
-
- protected
-
- # Allow shell to be shared between invocations.
- #
- def _shared_configuration #:nodoc:
- super.merge!(:shell => shell)
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/shell/basic.rb b/lib/bundler/vendor/thor/lib/thor/shell/basic.rb
deleted file mode 100644
index be48358cb1..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/shell/basic.rb
+++ /dev/null
@@ -1,491 +0,0 @@
-class Bundler::Thor
- module Shell
- class Basic
- DEFAULT_TERMINAL_WIDTH = 80
-
- attr_accessor :base
- attr_reader :padding
-
- # Initialize base, mute and padding to nil.
- #
- def initialize #:nodoc:
- @base = nil
- @mute = false
- @padding = 0
- @always_force = false
- end
-
- # Mute everything that's inside given block
- #
- def mute
- @mute = true
- yield
- ensure
- @mute = false
- end
-
- # Check if base is muted
- #
- def mute?
- @mute
- end
-
- # Sets the output padding, not allowing less than zero values.
- #
- def padding=(value)
- @padding = [0, value].max
- end
-
- # Sets the output padding while executing a block and resets it.
- #
- def indent(count = 1)
- orig_padding = padding
- self.padding = padding + count
- yield
- self.padding = orig_padding
- end
-
- # Asks something to the user and receives a response.
- #
- # If a default value is specified it will be presented to the user
- # and allows them to select that value with an empty response. This
- # option is ignored when limited answers are supplied.
- #
- # If asked to limit the correct responses, you can pass in an
- # array of acceptable answers. If one of those is not supplied,
- # they will be shown a message stating that one of those answers
- # must be given and re-asked the question.
- #
- # If asking for sensitive information, the :echo option can be set
- # to false to mask user input from $stdin.
- #
- # If the required input is a path, then set the path option to
- # true. This will enable tab completion for file paths relative
- # to the current working directory on systems that support
- # Readline.
- #
- # ==== Example
- # ask("What is your name?")
- #
- # ask("What is the planet furthest from the sun?", :default => "Pluto")
- #
- # ask("What is your favorite Neopolitan flavor?", :limited_to => ["strawberry", "chocolate", "vanilla"])
- #
- # ask("What is your password?", :echo => false)
- #
- # ask("Where should the file be saved?", :path => true)
- #
- def ask(statement, *args)
- options = args.last.is_a?(Hash) ? args.pop : {}
- color = args.first
-
- if options[:limited_to]
- ask_filtered(statement, color, options)
- else
- ask_simply(statement, color, options)
- end
- end
-
- # Say (print) something to the user. If the sentence ends with a whitespace
- # or tab character, a new line is not appended (print + flush). Otherwise
- # are passed straight to puts (behavior got from Highline).
- #
- # ==== Example
- # say("I know you knew that.")
- #
- def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
- buffer = prepare_message(message, *color)
- buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
-
- stdout.print(buffer)
- stdout.flush
- end
-
- # Say a status with the given color and appends the message. Since this
- # method is used frequently by actions, it allows nil or false to be given
- # in log_status, avoiding the message from being shown. If a Symbol is
- # given in log_status, it's used as the color.
- #
- def say_status(status, message, log_status = true)
- return if quiet? || log_status == false
- spaces = " " * (padding + 1)
- color = log_status.is_a?(Symbol) ? log_status : :green
-
- status = status.to_s.rjust(12)
- status = set_color status, color, true if color
-
- buffer = "#{status}#{spaces}#{message}"
- buffer = "#{buffer}\n" unless buffer.end_with?("\n")
-
- stdout.print(buffer)
- stdout.flush
- end
-
- # Make a question the to user and returns true if the user replies "y" or
- # "yes".
- #
- def yes?(statement, color = nil)
- !!(ask(statement, color, :add_to_history => false) =~ is?(:yes))
- end
-
- # Make a question the to user and returns true if the user replies "n" or
- # "no".
- #
- def no?(statement, color = nil)
- !!(ask(statement, color, :add_to_history => false) =~ is?(:no))
- end
-
- # Prints values in columns
- #
- # ==== Parameters
- # Array[String, String, ...]
- #
- def print_in_columns(array)
- return if array.empty?
- colwidth = (array.map { |el| el.to_s.size }.max || 0) + 2
- array.each_with_index do |value, index|
- # Don't output trailing spaces when printing the last column
- if ((((index + 1) % (terminal_width / colwidth))).zero? && !index.zero?) || index + 1 == array.length
- stdout.puts value
- else
- stdout.printf("%-#{colwidth}s", value)
- end
- end
- end
-
- # Prints a table.
- #
- # ==== Parameters
- # Array[Array[String, String, ...]]
- #
- # ==== Options
- # indent<Integer>:: Indent the first column by indent value.
- # colwidth<Integer>:: Force the first column to colwidth spaces wide.
- #
- def print_table(array, options = {}) # rubocop:disable MethodLength
- return if array.empty?
-
- formats = []
- indent = options[:indent].to_i
- colwidth = options[:colwidth]
- options[:truncate] = terminal_width if options[:truncate] == true
-
- formats << "%-#{colwidth + 2}s".dup if colwidth
- start = colwidth ? 1 : 0
-
- colcount = array.max { |a, b| a.size <=> b.size }.size
-
- maximas = []
-
- start.upto(colcount - 1) do |index|
- maxima = array.map { |row| row[index] ? row[index].to_s.size : 0 }.max
- maximas << maxima
- formats << if index == colcount - 1
- # Don't output 2 trailing spaces when printing the last column
- "%-s".dup
- else
- "%-#{maxima + 2}s".dup
- end
- end
-
- formats[0] = formats[0].insert(0, " " * indent)
- formats << "%s"
-
- array.each do |row|
- sentence = "".dup
-
- row.each_with_index do |column, index|
- maxima = maximas[index]
-
- f = if column.is_a?(Numeric)
- if index == row.size - 1
- # Don't output 2 trailing spaces when printing the last column
- "%#{maxima}s"
- else
- "%#{maxima}s "
- end
- else
- formats[index]
- end
- sentence << f % column.to_s
- end
-
- sentence = truncate(sentence, options[:truncate]) if options[:truncate]
- stdout.puts sentence
- end
- end
-
- # Prints a long string, word-wrapping the text to the current width of the
- # terminal display. Ideal for printing heredocs.
- #
- # ==== Parameters
- # String
- #
- # ==== Options
- # indent<Integer>:: Indent each line of the printed paragraph by indent value.
- #
- def print_wrapped(message, options = {})
- indent = options[:indent] || 0
- width = terminal_width - indent
- paras = message.split("\n\n")
-
- paras.map! do |unwrapped|
- counter = 0
- unwrapped.split(" ").inject do |memo, word|
- word = word.gsub(/\n\005/, "\n").gsub(/\005/, "\n")
- counter = 0 if word.include? "\n"
- if (counter + word.length + 1) < width
- memo = "#{memo} #{word}"
- counter += (word.length + 1)
- else
- memo = "#{memo}\n#{word}"
- counter = word.length
- end
- memo
- end
- end.compact!
-
- paras.each do |para|
- para.split("\n").each do |line|
- stdout.puts line.insert(0, " " * indent)
- end
- stdout.puts unless para == paras.last
- end
- end
-
- # Deals with file collision and returns true if the file should be
- # overwritten and false otherwise. If a block is given, it uses the block
- # response as the content for the diff.
- #
- # ==== Parameters
- # destination<String>:: the destination file to solve conflicts
- # block<Proc>:: an optional block that returns the value to be used in diff and merge
- #
- def file_collision(destination)
- return true if @always_force
- options = block_given? ? "[Ynaqdhm]" : "[Ynaqh]"
-
- loop do
- answer = ask(
- %[Overwrite #{destination}? (enter "h" for help) #{options}],
- :add_to_history => false
- )
-
- case answer
- when nil
- say ""
- return true
- when is?(:yes), is?(:force), ""
- return true
- when is?(:no), is?(:skip)
- return false
- when is?(:always)
- return @always_force = true
- when is?(:quit)
- say "Aborting..."
- raise SystemExit
- when is?(:diff)
- show_diff(destination, yield) if block_given?
- say "Retrying..."
- when is?(:merge)
- if block_given? && !merge_tool.empty?
- merge(destination, yield)
- return nil
- end
-
- say "Please specify merge tool to `THOR_MERGE` env."
- else
- say file_collision_help
- end
- end
- end
-
- # This code was copied from Rake, available under MIT-LICENSE
- # Copyright (c) 2003, 2004 Jim Weirich
- def terminal_width
- result = if ENV["THOR_COLUMNS"]
- ENV["THOR_COLUMNS"].to_i
- else
- unix? ? dynamic_width : DEFAULT_TERMINAL_WIDTH
- end
- result < 10 ? DEFAULT_TERMINAL_WIDTH : result
- rescue
- DEFAULT_TERMINAL_WIDTH
- end
-
- # Called if something goes wrong during the execution. This is used by Bundler::Thor
- # internally and should not be used inside your scripts. If something went
- # wrong, you can always raise an exception. If you raise a Bundler::Thor::Error, it
- # will be rescued and wrapped in the method below.
- #
- def error(statement)
- stderr.puts statement
- end
-
- # Apply color to the given string with optional bold. Disabled in the
- # Bundler::Thor::Shell::Basic class.
- #
- def set_color(string, *) #:nodoc:
- string
- end
-
- protected
-
- def prepare_message(message, *color)
- spaces = " " * padding
- spaces + set_color(message.to_s, *color)
- end
-
- def can_display_colors?
- false
- end
-
- def lookup_color(color)
- return color unless color.is_a?(Symbol)
- self.class.const_get(color.to_s.upcase)
- end
-
- def stdout
- $stdout
- end
-
- def stderr
- $stderr
- end
-
- def is?(value) #:nodoc:
- value = value.to_s
-
- if value.size == 1
- /\A#{value}\z/i
- else
- /\A(#{value}|#{value[0, 1]})\z/i
- end
- end
-
- def file_collision_help #:nodoc:
- <<-HELP
- Y - yes, overwrite
- n - no, do not overwrite
- a - all, overwrite this and all others
- q - quit, abort
- d - diff, show the differences between the old and the new
- h - help, show this help
- m - merge, run merge tool
- HELP
- end
-
- def show_diff(destination, content) #:nodoc:
- diff_cmd = ENV["THOR_DIFF"] || ENV["RAILS_DIFF"] || "diff -u"
-
- require "tempfile"
- Tempfile.open(File.basename(destination), File.dirname(destination)) do |temp|
- temp.write content
- temp.rewind
- system %(#{diff_cmd} "#{destination}" "#{temp.path}")
- end
- end
-
- def quiet? #:nodoc:
- mute? || (base && base.options[:quiet])
- end
-
- # Calculate the dynamic width of the terminal
- def dynamic_width
- @dynamic_width ||= (dynamic_width_stty.nonzero? || dynamic_width_tput)
- end
-
- def dynamic_width_stty
- `stty size 2>/dev/null`.split[1].to_i
- end
-
- def dynamic_width_tput
- `tput cols 2>/dev/null`.to_i
- end
-
- def unix?
- RUBY_PLATFORM =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
- end
-
- def truncate(string, width)
- as_unicode do
- chars = string.chars.to_a
- if chars.length <= width
- chars.join
- else
- chars[0, width - 3].join + "..."
- end
- end
- end
-
- if "".respond_to?(:encode)
- def as_unicode
- yield
- end
- else
- def as_unicode
- old = $KCODE
- $KCODE = "U"
- yield
- ensure
- $KCODE = old
- end
- end
-
- def ask_simply(statement, color, options)
- default = options[:default]
- message = [statement, ("(#{default})" if default), nil].uniq.join(" ")
- message = prepare_message(message, *color)
- result = Bundler::Thor::LineEditor.readline(message, options)
-
- return unless result
-
- result = result.strip
-
- if default && result == ""
- default
- else
- result
- end
- end
-
- def ask_filtered(statement, color, options)
- answer_set = options[:limited_to]
- case_insensitive = options.fetch(:case_insensitive, false)
- correct_answer = nil
- until correct_answer
- answers = answer_set.join(", ")
- answer = ask_simply("#{statement} [#{answers}]", color, options)
- correct_answer = answer_match(answer_set, answer, case_insensitive)
- say("Your response must be one of: [#{answers}]. Please try again.") unless correct_answer
- end
- correct_answer
- end
-
- def answer_match(possibilities, answer, case_insensitive)
- if case_insensitive
- possibilities.detect{ |possibility| possibility.downcase == answer.downcase }
- else
- possibilities.detect{ |possibility| possibility == answer }
- end
- end
-
- def merge(destination, content) #:nodoc:
- require "tempfile"
- Tempfile.open([File.basename(destination), File.extname(destination)], File.dirname(destination)) do |temp|
- temp.write content
- temp.rewind
- system %(#{merge_tool} "#{temp.path}" "#{destination}")
- end
- end
-
- def merge_tool #:nodoc:
- @merge_tool ||= ENV["THOR_MERGE"] || git_merge_tool
- end
-
- def git_merge_tool #:nodoc:
- `git config merge.tool`.rstrip rescue ""
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/shell/color.rb b/lib/bundler/vendor/thor/lib/thor/shell/color.rb
deleted file mode 100644
index 29f280202d..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/shell/color.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-require_relative "basic"
-
-class Bundler::Thor
- module Shell
- # Inherit from Bundler::Thor::Shell::Basic and add set_color behavior. Check
- # Bundler::Thor::Shell::Basic to see all available methods.
- #
- class Color < Basic
- # Embed in a String to clear all previous ANSI sequences.
- CLEAR = "\e[0m"
- # The start of an ANSI bold sequence.
- BOLD = "\e[1m"
-
- # Set the terminal's foreground ANSI color to black.
- BLACK = "\e[30m"
- # Set the terminal's foreground ANSI color to red.
- RED = "\e[31m"
- # Set the terminal's foreground ANSI color to green.
- GREEN = "\e[32m"
- # Set the terminal's foreground ANSI color to yellow.
- YELLOW = "\e[33m"
- # Set the terminal's foreground ANSI color to blue.
- BLUE = "\e[34m"
- # Set the terminal's foreground ANSI color to magenta.
- MAGENTA = "\e[35m"
- # Set the terminal's foreground ANSI color to cyan.
- CYAN = "\e[36m"
- # Set the terminal's foreground ANSI color to white.
- WHITE = "\e[37m"
-
- # Set the terminal's background ANSI color to black.
- ON_BLACK = "\e[40m"
- # Set the terminal's background ANSI color to red.
- ON_RED = "\e[41m"
- # Set the terminal's background ANSI color to green.
- ON_GREEN = "\e[42m"
- # Set the terminal's background ANSI color to yellow.
- ON_YELLOW = "\e[43m"
- # Set the terminal's background ANSI color to blue.
- ON_BLUE = "\e[44m"
- # Set the terminal's background ANSI color to magenta.
- ON_MAGENTA = "\e[45m"
- # Set the terminal's background ANSI color to cyan.
- ON_CYAN = "\e[46m"
- # Set the terminal's background ANSI color to white.
- ON_WHITE = "\e[47m"
-
- # Set color by using a string or one of the defined constants. If a third
- # option is set to true, it also adds bold to the string. This is based
- # on Highline implementation and it automatically appends CLEAR to the end
- # of the returned String.
- #
- # Pass foreground, background and bold options to this method as
- # symbols.
- #
- # Example:
- #
- # set_color "Hi!", :red, :on_white, :bold
- #
- # The available colors are:
- #
- # :bold
- # :black
- # :red
- # :green
- # :yellow
- # :blue
- # :magenta
- # :cyan
- # :white
- # :on_black
- # :on_red
- # :on_green
- # :on_yellow
- # :on_blue
- # :on_magenta
- # :on_cyan
- # :on_white
- def set_color(string, *colors)
- if colors.compact.empty? || !can_display_colors?
- string
- elsif colors.all? { |color| color.is_a?(Symbol) || color.is_a?(String) }
- ansi_colors = colors.map { |color| lookup_color(color) }
- "#{ansi_colors.join}#{string}#{CLEAR}"
- else
- # The old API was `set_color(color, bold=boolean)`. We
- # continue to support the old API because you should never
- # break old APIs unnecessarily :P
- foreground, bold = colors
- foreground = self.class.const_get(foreground.to_s.upcase) if foreground.is_a?(Symbol)
-
- bold = bold ? BOLD : ""
- "#{bold}#{foreground}#{string}#{CLEAR}"
- end
- end
-
- protected
-
- def can_display_colors?
- stdout.tty? && !are_colors_disabled?
- end
-
- def are_colors_disabled?
- !ENV['NO_COLOR'].nil?
- end
-
- # Overwrite show_diff to show diff with colors if Diff::LCS is
- # available.
- #
- def show_diff(destination, content) #:nodoc:
- if diff_lcs_loaded? && ENV["THOR_DIFF"].nil? && ENV["RAILS_DIFF"].nil?
- actual = File.binread(destination).to_s.split("\n")
- content = content.to_s.split("\n")
-
- Diff::LCS.sdiff(actual, content).each do |diff|
- output_diff_line(diff)
- end
- else
- super
- end
- end
-
- def output_diff_line(diff) #:nodoc:
- case diff.action
- when "-"
- say "- #{diff.old_element.chomp}", :red, true
- when "+"
- say "+ #{diff.new_element.chomp}", :green, true
- when "!"
- say "- #{diff.old_element.chomp}", :red, true
- say "+ #{diff.new_element.chomp}", :green, true
- else
- say " #{diff.old_element.chomp}", nil, true
- end
- end
-
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
- # for diff.
- #
- def diff_lcs_loaded? #:nodoc:
- return true if defined?(Diff::LCS)
- return @diff_lcs_loaded unless @diff_lcs_loaded.nil?
-
- @diff_lcs_loaded = begin
- require "diff/lcs"
- true
- rescue LoadError
- false
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/shell/html.rb b/lib/bundler/vendor/thor/lib/thor/shell/html.rb
deleted file mode 100644
index 77a6d13a23..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/shell/html.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-require_relative "basic"
-
-class Bundler::Thor
- module Shell
- # Inherit from Bundler::Thor::Shell::Basic and add set_color behavior. Check
- # Bundler::Thor::Shell::Basic to see all available methods.
- #
- class HTML < Basic
- # The start of an HTML bold sequence.
- BOLD = "font-weight: bold"
-
- # Set the terminal's foreground HTML color to black.
- BLACK = "color: black"
- # Set the terminal's foreground HTML color to red.
- RED = "color: red"
- # Set the terminal's foreground HTML color to green.
- GREEN = "color: green"
- # Set the terminal's foreground HTML color to yellow.
- YELLOW = "color: yellow"
- # Set the terminal's foreground HTML color to blue.
- BLUE = "color: blue"
- # Set the terminal's foreground HTML color to magenta.
- MAGENTA = "color: magenta"
- # Set the terminal's foreground HTML color to cyan.
- CYAN = "color: cyan"
- # Set the terminal's foreground HTML color to white.
- WHITE = "color: white"
-
- # Set the terminal's background HTML color to black.
- ON_BLACK = "background-color: black"
- # Set the terminal's background HTML color to red.
- ON_RED = "background-color: red"
- # Set the terminal's background HTML color to green.
- ON_GREEN = "background-color: green"
- # Set the terminal's background HTML color to yellow.
- ON_YELLOW = "background-color: yellow"
- # Set the terminal's background HTML color to blue.
- ON_BLUE = "background-color: blue"
- # Set the terminal's background HTML color to magenta.
- ON_MAGENTA = "background-color: magenta"
- # Set the terminal's background HTML color to cyan.
- ON_CYAN = "background-color: cyan"
- # Set the terminal's background HTML color to white.
- ON_WHITE = "background-color: white"
-
- # Set color by using a string or one of the defined constants. If a third
- # option is set to true, it also adds bold to the string. This is based
- # on Highline implementation and it automatically appends CLEAR to the end
- # of the returned String.
- #
- def set_color(string, *colors)
- if colors.all? { |color| color.is_a?(Symbol) || color.is_a?(String) }
- html_colors = colors.map { |color| lookup_color(color) }
- "<span style=\"#{html_colors.join('; ')};\">#{Bundler::Thor::Util.escape_html(string)}</span>"
- else
- color, bold = colors
- html_color = self.class.const_get(color.to_s.upcase) if color.is_a?(Symbol)
- styles = [html_color]
- styles << BOLD if bold
- "<span style=\"#{styles.join('; ')};\">#{Bundler::Thor::Util.escape_html(string)}</span>"
- end
- end
-
- # Ask something to the user and receives a response.
- #
- # ==== Example
- # ask("What is your name?")
- #
- # TODO: Implement #ask for Bundler::Thor::Shell::HTML
- def ask(statement, color = nil)
- raise NotImplementedError, "Implement #ask for Bundler::Thor::Shell::HTML"
- end
-
- protected
-
- def can_display_colors?
- true
- end
-
- # Overwrite show_diff to show diff with colors if Diff::LCS is
- # available.
- #
- def show_diff(destination, content) #:nodoc:
- if diff_lcs_loaded? && ENV["THOR_DIFF"].nil? && ENV["RAILS_DIFF"].nil?
- actual = File.binread(destination).to_s.split("\n")
- content = content.to_s.split("\n")
-
- Diff::LCS.sdiff(actual, content).each do |diff|
- output_diff_line(diff)
- end
- else
- super
- end
- end
-
- def output_diff_line(diff) #:nodoc:
- case diff.action
- when "-"
- say "- #{diff.old_element.chomp}", :red, true
- when "+"
- say "+ #{diff.new_element.chomp}", :green, true
- when "!"
- say "- #{diff.old_element.chomp}", :red, true
- say "+ #{diff.new_element.chomp}", :green, true
- else
- say " #{diff.old_element.chomp}", nil, true
- end
- end
-
- # Check if Diff::LCS is loaded. If it is, use it to create pretty output
- # for diff.
- #
- def diff_lcs_loaded? #:nodoc:
- return true if defined?(Diff::LCS)
- return @diff_lcs_loaded unless @diff_lcs_loaded.nil?
-
- @diff_lcs_loaded = begin
- require "diff/lcs"
- true
- rescue LoadError
- false
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/util.rb b/lib/bundler/vendor/thor/lib/thor/util.rb
deleted file mode 100644
index ddf4d21b90..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/util.rb
+++ /dev/null
@@ -1,284 +0,0 @@
-require "rbconfig"
-
-class Bundler::Thor
- module Sandbox #:nodoc:
- end
-
- # This module holds several utilities:
- #
- # 1) Methods to convert thor namespaces to constants and vice-versa.
- #
- # Bundler::Thor::Util.namespace_from_thor_class(Foo::Bar::Baz) #=> "foo:bar:baz"
- #
- # 2) Loading thor files and sandboxing:
- #
- # Bundler::Thor::Util.load_thorfile("~/.thor/foo")
- #
- module Util
- class << self
- # Receives a namespace and search for it in the Bundler::Thor::Base subclasses.
- #
- # ==== Parameters
- # namespace<String>:: The namespace to search for.
- #
- def find_by_namespace(namespace)
- namespace = "default#{namespace}" if namespace.empty? || namespace =~ /^:/
- Bundler::Thor::Base.subclasses.detect { |klass| klass.namespace == namespace }
- end
-
- # Receives a constant and converts it to a Bundler::Thor namespace. Since Bundler::Thor
- # commands can be added to a sandbox, this method is also responsible for
- # removing the sandbox namespace.
- #
- # This method should not be used in general because it's used to deal with
- # older versions of Bundler::Thor. On current versions, if you need to get the
- # namespace from a class, just call namespace on it.
- #
- # ==== Parameters
- # constant<Object>:: The constant to be converted to the thor path.
- #
- # ==== Returns
- # String:: If we receive Foo::Bar::Baz it returns "foo:bar:baz"
- #
- def namespace_from_thor_class(constant)
- constant = constant.to_s.gsub(/^Bundler::Thor::Sandbox::/, "")
- constant = snake_case(constant).squeeze(":")
- constant
- end
-
- # Given the contents, evaluate it inside the sandbox and returns the
- # namespaces defined in the sandbox.
- #
- # ==== Parameters
- # contents<String>
- #
- # ==== Returns
- # Array[Object]
- #
- def namespaces_in_content(contents, file = __FILE__)
- old_constants = Bundler::Thor::Base.subclasses.dup
- Bundler::Thor::Base.subclasses.clear
-
- load_thorfile(file, contents)
-
- new_constants = Bundler::Thor::Base.subclasses.dup
- Bundler::Thor::Base.subclasses.replace(old_constants)
-
- new_constants.map!(&:namespace)
- new_constants.compact!
- new_constants
- end
-
- # Returns the thor classes declared inside the given class.
- #
- def thor_classes_in(klass)
- stringfied_constants = klass.constants.map(&:to_s)
- Bundler::Thor::Base.subclasses.select do |subclass|
- next unless subclass.name
- stringfied_constants.include?(subclass.name.gsub("#{klass.name}::", ""))
- end
- end
-
- # Receives a string and convert it to snake case. SnakeCase returns snake_case.
- #
- # ==== Parameters
- # String
- #
- # ==== Returns
- # String
- #
- def snake_case(str)
- return str.downcase if str =~ /^[A-Z_]+$/
- str.gsub(/\B[A-Z]/, '_\&').squeeze("_") =~ /_*(.*)/
- $+.downcase
- end
-
- # Receives a string and convert it to camel case. camel_case returns CamelCase.
- #
- # ==== Parameters
- # String
- #
- # ==== Returns
- # String
- #
- def camel_case(str)
- return str if str !~ /_/ && str =~ /[A-Z]+.*/
- str.split("_").map(&:capitalize).join
- end
-
- # Receives a namespace and tries to retrieve a Bundler::Thor or Bundler::Thor::Group class
- # from it. It first searches for a class using the all the given namespace,
- # if it's not found, removes the highest entry and searches for the class
- # again. If found, returns the highest entry as the class name.
- #
- # ==== Examples
- #
- # class Foo::Bar < Bundler::Thor
- # def baz
- # end
- # end
- #
- # class Baz::Foo < Bundler::Thor::Group
- # end
- #
- # Bundler::Thor::Util.namespace_to_thor_class("foo:bar") #=> Foo::Bar, nil # will invoke default command
- # Bundler::Thor::Util.namespace_to_thor_class("baz:foo") #=> Baz::Foo, nil
- # Bundler::Thor::Util.namespace_to_thor_class("foo:bar:baz") #=> Foo::Bar, "baz"
- #
- # ==== Parameters
- # namespace<String>
- #
- def find_class_and_command_by_namespace(namespace, fallback = true)
- if namespace.include?(":") # look for a namespaced command
- pieces = namespace.split(":")
- command = pieces.pop
- klass = Bundler::Thor::Util.find_by_namespace(pieces.join(":"))
- end
- unless klass # look for a Bundler::Thor::Group with the right name
- klass = Bundler::Thor::Util.find_by_namespace(namespace)
- command = nil
- end
- if !klass && fallback # try a command in the default namespace
- command = namespace
- klass = Bundler::Thor::Util.find_by_namespace("")
- end
- [klass, command]
- end
- alias_method :find_class_and_task_by_namespace, :find_class_and_command_by_namespace
-
- # Receives a path and load the thor file in the path. The file is evaluated
- # inside the sandbox to avoid namespacing conflicts.
- #
- def load_thorfile(path, content = nil, debug = false)
- content ||= File.binread(path)
-
- begin
- Bundler::Thor::Sandbox.class_eval(content, path)
- rescue StandardError => e
- $stderr.puts("WARNING: unable to load thorfile #{path.inspect}: #{e.message}")
- if debug
- $stderr.puts(*e.backtrace)
- else
- $stderr.puts(e.backtrace.first)
- end
- end
- end
-
- def user_home
- @@user_home ||= if ENV["HOME"]
- ENV["HOME"]
- elsif ENV["USERPROFILE"]
- ENV["USERPROFILE"]
- elsif ENV["HOMEDRIVE"] && ENV["HOMEPATH"]
- File.join(ENV["HOMEDRIVE"], ENV["HOMEPATH"])
- elsif ENV["APPDATA"]
- ENV["APPDATA"]
- else
- begin
- File.expand_path("~")
- rescue
- if File::ALT_SEPARATOR
- "C:/"
- else
- "/"
- end
- end
- end
- end
-
- # Returns the root where thor files are located, depending on the OS.
- #
- def thor_root
- File.join(user_home, ".thor").tr('\\', "/")
- end
-
- # Returns the files in the thor root. On Windows thor_root will be something
- # like this:
- #
- # C:\Documents and Settings\james\.thor
- #
- # If we don't #gsub the \ character, Dir.glob will fail.
- #
- def thor_root_glob
- files = Dir["#{escape_globs(thor_root)}/*"]
-
- files.map! do |file|
- File.directory?(file) ? File.join(file, "main.thor") : file
- end
- end
-
- # Where to look for Bundler::Thor files.
- #
- def globs_for(path)
- path = escape_globs(path)
- ["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/*.thor"]
- end
-
- # Return the path to the ruby interpreter taking into account multiple
- # installations and windows extensions.
- #
- def ruby_command
- @ruby_command ||= begin
- ruby_name = RbConfig::CONFIG["ruby_install_name"]
- ruby = File.join(RbConfig::CONFIG["bindir"], ruby_name)
- ruby << RbConfig::CONFIG["EXEEXT"]
-
- # avoid using different name than ruby (on platforms supporting links)
- if ruby_name != "ruby" && File.respond_to?(:readlink)
- begin
- alternate_ruby = File.join(RbConfig::CONFIG["bindir"], "ruby")
- alternate_ruby << RbConfig::CONFIG["EXEEXT"]
-
- # ruby is a symlink
- if File.symlink? alternate_ruby
- linked_ruby = File.readlink alternate_ruby
-
- # symlink points to 'ruby_install_name'
- ruby = alternate_ruby if linked_ruby == ruby_name || linked_ruby == ruby
- end
- rescue NotImplementedError # rubocop:disable HandleExceptions
- # just ignore on windows
- end
- end
-
- # escape string in case path to ruby executable contain spaces.
- ruby.sub!(/.*\s.*/m, '"\&"')
- ruby
- end
- end
-
- # Returns a string that has had any glob characters escaped.
- # The glob characters are `* ? { } [ ]`.
- #
- # ==== Examples
- #
- # Bundler::Thor::Util.escape_globs('[apps]') # => '\[apps\]'
- #
- # ==== Parameters
- # String
- #
- # ==== Returns
- # String
- #
- def escape_globs(path)
- path.to_s.gsub(/[*?{}\[\]]/, '\\\\\\&')
- end
-
- # Returns a string that has had any HTML characters escaped.
- #
- # ==== Examples
- #
- # Bundler::Thor::Util.escape_html('<div>') # => "&lt;div&gt;"
- #
- # ==== Parameters
- # String
- #
- # ==== Returns
- # String
- #
- def escape_html(string)
- CGI.escapeHTML(string)
- end
- end
- end
-end
diff --git a/lib/bundler/vendor/thor/lib/thor/version.rb b/lib/bundler/vendor/thor/lib/thor/version.rb
deleted file mode 100644
index 7750d27637..0000000000
--- a/lib/bundler/vendor/thor/lib/thor/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class Bundler::Thor
- VERSION = "1.0.0"
-end
diff --git a/lib/bundler/vendor/uri/lib/uri.rb b/lib/bundler/vendor/uri/lib/uri.rb
deleted file mode 100644
index 00c01bd07b..0000000000
--- a/lib/bundler/vendor/uri/lib/uri.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-# frozen_string_literal: false
-# Bundler::URI is a module providing classes to handle Uniform Resource Identifiers
-# (RFC2396[http://tools.ietf.org/html/rfc2396]).
-#
-# == Features
-#
-# * Uniform way of handling URIs.
-# * Flexibility to introduce custom Bundler::URI schemes.
-# * Flexibility to have an alternate Bundler::URI::Parser (or just different patterns
-# and regexp's).
-#
-# == Basic example
-#
-# require 'bundler/vendor/uri/lib/uri'
-#
-# uri = Bundler::URI("http://foo.com/posts?id=30&limit=5#time=1305298413")
-# #=> #<Bundler::URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413>
-#
-# uri.scheme #=> "http"
-# uri.host #=> "foo.com"
-# uri.path #=> "/posts"
-# uri.query #=> "id=30&limit=5"
-# uri.fragment #=> "time=1305298413"
-#
-# uri.to_s #=> "http://foo.com/posts?id=30&limit=5#time=1305298413"
-#
-# == Adding custom URIs
-#
-# module Bundler::URI
-# class RSYNC < Generic
-# DEFAULT_PORT = 873
-# end
-# @@schemes['RSYNC'] = RSYNC
-# end
-# #=> Bundler::URI::RSYNC
-#
-# Bundler::URI.scheme_list
-# #=> {"FILE"=>Bundler::URI::File, "FTP"=>Bundler::URI::FTP, "HTTP"=>Bundler::URI::HTTP,
-# # "HTTPS"=>Bundler::URI::HTTPS, "LDAP"=>Bundler::URI::LDAP, "LDAPS"=>Bundler::URI::LDAPS,
-# # "MAILTO"=>Bundler::URI::MailTo, "RSYNC"=>Bundler::URI::RSYNC}
-#
-# uri = Bundler::URI("rsync://rsync.foo.com")
-# #=> #<Bundler::URI::RSYNC rsync://rsync.foo.com>
-#
-# == RFC References
-#
-# A good place to view an RFC spec is http://www.ietf.org/rfc.html.
-#
-# Here is a list of all related RFC's:
-# - RFC822[http://tools.ietf.org/html/rfc822]
-# - RFC1738[http://tools.ietf.org/html/rfc1738]
-# - RFC2255[http://tools.ietf.org/html/rfc2255]
-# - RFC2368[http://tools.ietf.org/html/rfc2368]
-# - RFC2373[http://tools.ietf.org/html/rfc2373]
-# - RFC2396[http://tools.ietf.org/html/rfc2396]
-# - RFC2732[http://tools.ietf.org/html/rfc2732]
-# - RFC3986[http://tools.ietf.org/html/rfc3986]
-#
-# == Class tree
-#
-# - Bundler::URI::Generic (in uri/generic.rb)
-# - Bundler::URI::File - (in uri/file.rb)
-# - Bundler::URI::FTP - (in uri/ftp.rb)
-# - Bundler::URI::HTTP - (in uri/http.rb)
-# - Bundler::URI::HTTPS - (in uri/https.rb)
-# - Bundler::URI::LDAP - (in uri/ldap.rb)
-# - Bundler::URI::LDAPS - (in uri/ldaps.rb)
-# - Bundler::URI::MailTo - (in uri/mailto.rb)
-# - Bundler::URI::Parser - (in uri/common.rb)
-# - Bundler::URI::REGEXP - (in uri/common.rb)
-# - Bundler::URI::REGEXP::PATTERN - (in uri/common.rb)
-# - Bundler::URI::Util - (in uri/common.rb)
-# - Bundler::URI::Escape - (in uri/common.rb)
-# - Bundler::URI::Error - (in uri/common.rb)
-# - Bundler::URI::InvalidURIError - (in uri/common.rb)
-# - Bundler::URI::InvalidComponentError - (in uri/common.rb)
-# - Bundler::URI::BadURIError - (in uri/common.rb)
-#
-# == Copyright Info
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# Documentation::
-# Akira Yamada <akira@ruby-lang.org>
-# Dmitry V. Sabanin <sdmitry@lrn.ru>
-# Vincent Batts <vbatts@hashbangbash.com>
-# License::
-# Copyright (c) 2001 akira yamada <akira@ruby-lang.org>
-# You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-
-module Bundler::URI
-end
-
-require_relative 'uri/version'
-require_relative 'uri/common'
-require_relative 'uri/generic'
-require_relative 'uri/file'
-require_relative 'uri/ftp'
-require_relative 'uri/http'
-require_relative 'uri/https'
-require_relative 'uri/ldap'
-require_relative 'uri/ldaps'
-require_relative 'uri/mailto'
diff --git a/lib/bundler/vendor/uri/lib/uri/common.rb b/lib/bundler/vendor/uri/lib/uri/common.rb
deleted file mode 100644
index cc1ab86c2f..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/common.rb
+++ /dev/null
@@ -1,744 +0,0 @@
-# frozen_string_literal: true
-#--
-# = uri/common.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# Revision:: $Id$
-# License::
-# You can redistribute it and/or modify it under the same term as Ruby.
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative "rfc2396_parser"
-require_relative "rfc3986_parser"
-
-module Bundler::URI
- REGEXP = RFC2396_REGEXP
- Parser = RFC2396_Parser
- RFC3986_PARSER = RFC3986_Parser.new
-
- # Bundler::URI::Parser.new
- DEFAULT_PARSER = Parser.new
- DEFAULT_PARSER.pattern.each_pair do |sym, str|
- unless REGEXP::PATTERN.const_defined?(sym)
- REGEXP::PATTERN.const_set(sym, str)
- end
- end
- DEFAULT_PARSER.regexp.each_pair do |sym, str|
- const_set(sym, str)
- end
-
- module Util # :nodoc:
- def make_components_hash(klass, array_hash)
- tmp = {}
- if array_hash.kind_of?(Array) &&
- array_hash.size == klass.component.size - 1
- klass.component[1..-1].each_index do |i|
- begin
- tmp[klass.component[i + 1]] = array_hash[i].clone
- rescue TypeError
- tmp[klass.component[i + 1]] = array_hash[i]
- end
- end
-
- elsif array_hash.kind_of?(Hash)
- array_hash.each do |key, value|
- begin
- tmp[key] = value.clone
- rescue TypeError
- tmp[key] = value
- end
- end
- else
- raise ArgumentError,
- "expected Array of or Hash of components of #{klass} (#{klass.component[1..-1].join(', ')})"
- end
- tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase
-
- return tmp
- end
- module_function :make_components_hash
- end
-
- # Module for escaping unsafe characters with codes.
- module Escape
- #
- # == Synopsis
- #
- # Bundler::URI.escape(str [, unsafe])
- #
- # == Args
- #
- # +str+::
- # String to replaces in.
- # +unsafe+::
- # Regexp that matches all symbols that must be replaced with codes.
- # By default uses <tt>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, Bundler::URI.encode_www_form or Bundler::URI.encode_www_form_component
- # depending on your specific use case.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # enc_uri = Bundler::URI.escape("http://example.com/?a=\11\15")
- # # => "http://example.com/?a=%09%0D"
- #
- # Bundler::URI.unescape(enc_uri)
- # # => "http://example.com/?a=\t\r"
- #
- # Bundler::URI.escape("@?@!", "!?")
- # # => "@%3F@%21"
- #
- def escape(*arg)
- warn "Bundler::URI.escape is obsolete", uplevel: 1
- DEFAULT_PARSER.escape(*arg)
- end
- alias encode escape
- #
- # == Synopsis
- #
- # Bundler::URI.unescape(str)
- #
- # == Args
- #
- # +str+::
- # String to unescape.
- #
- # == Description
- #
- # This method is obsolete and should not be used. Instead, use
- # CGI.unescape, Bundler::URI.decode_www_form or Bundler::URI.decode_www_form_component
- # depending on your specific use case.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # enc_uri = Bundler::URI.escape("http://example.com/?a=\11\15")
- # # => "http://example.com/?a=%09%0D"
- #
- # Bundler::URI.unescape(enc_uri)
- # # => "http://example.com/?a=\t\r"
- #
- def unescape(*arg)
- warn "Bundler::URI.unescape is obsolete", uplevel: 1
- DEFAULT_PARSER.unescape(*arg)
- end
- alias decode unescape
- end # module Escape
-
- extend Escape
- include REGEXP
-
- @@schemes = {}
- # Returns a Hash of the defined schemes.
- def self.scheme_list
- @@schemes
- end
-
- #
- # Base class for all Bundler::URI exceptions.
- #
- class Error < StandardError; end
- #
- # Not a Bundler::URI.
- #
- class InvalidURIError < Error; end
- #
- # Not a Bundler::URI component.
- #
- class InvalidComponentError < Error; end
- #
- # Bundler::URI is valid, bad usage is not.
- #
- class BadURIError < Error; end
-
- #
- # == Synopsis
- #
- # Bundler::URI::split(uri)
- #
- # == Args
- #
- # +uri+::
- # String with Bundler::URI.
- #
- # == Description
- #
- # Splits the string on following parts and returns array with result:
- #
- # * Scheme
- # * Userinfo
- # * Host
- # * Port
- # * Registry
- # * Path
- # * Opaque
- # * Query
- # * Fragment
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # Bundler::URI.split("http://www.ruby-lang.org/")
- # # => ["http", nil, "www.ruby-lang.org", nil, nil, "/", nil, nil, nil]
- #
- def self.split(uri)
- RFC3986_PARSER.split(uri)
- end
-
- #
- # == Synopsis
- #
- # Bundler::URI::parse(uri_str)
- #
- # == Args
- #
- # +uri_str+::
- # String with Bundler::URI.
- #
- # == Description
- #
- # Creates one of the Bundler::URI's subclasses instance from the string.
- #
- # == Raises
- #
- # Bundler::URI::InvalidURIError::
- # Raised if Bundler::URI given is not a correct one.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://www.ruby-lang.org/")
- # # => #<Bundler::URI::HTTP http://www.ruby-lang.org/>
- # uri.scheme
- # # => "http"
- # uri.host
- # # => "www.ruby-lang.org"
- #
- # It's recommended to first ::escape the provided +uri_str+ if there are any
- # invalid Bundler::URI characters.
- #
- def self.parse(uri)
- RFC3986_PARSER.parse(uri)
- end
-
- #
- # == Synopsis
- #
- # Bundler::URI::join(str[, str, ...])
- #
- # == Args
- #
- # +str+::
- # String(s) to work with, will be converted to RFC3986 URIs before merging.
- #
- # == Description
- #
- # Joins URIs.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # Bundler::URI.join("http://example.com/","main.rbx")
- # # => #<Bundler::URI::HTTP http://example.com/main.rbx>
- #
- # Bundler::URI.join('http://example.com', 'foo')
- # # => #<Bundler::URI::HTTP http://example.com/foo>
- #
- # Bundler::URI.join('http://example.com', '/foo', '/bar')
- # # => #<Bundler::URI::HTTP http://example.com/bar>
- #
- # Bundler::URI.join('http://example.com', '/foo', 'bar')
- # # => #<Bundler::URI::HTTP http://example.com/bar>
- #
- # Bundler::URI.join('http://example.com', '/foo/', 'bar')
- # # => #<Bundler::URI::HTTP http://example.com/foo/bar>
- #
- def self.join(*str)
- RFC3986_PARSER.join(*str)
- end
-
- #
- # == Synopsis
- #
- # Bundler::URI::extract(str[, schemes][,&blk])
- #
- # == Args
- #
- # +str+::
- # String to extract URIs from.
- # +schemes+::
- # Limit Bundler::URI matching to specific schemes.
- #
- # == Description
- #
- # Extracts URIs from a string. If block given, iterates through all matched URIs.
- # Returns nil if block given or array with matches.
- #
- # == Usage
- #
- # require "bundler/vendor/uri/lib/uri"
- #
- # Bundler::URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
- # # => ["http://foo.example.com/bla", "mailto:test@example.com"]
- #
- def self.extract(str, schemes = nil, &block)
- warn "Bundler::URI.extract is obsolete", uplevel: 1 if $VERBOSE
- DEFAULT_PARSER.extract(str, schemes, &block)
- end
-
- #
- # == Synopsis
- #
- # Bundler::URI::regexp([match_schemes])
- #
- # == Args
- #
- # +match_schemes+::
- # Array of schemes. If given, resulting regexp matches to URIs
- # whose scheme is one of the match_schemes.
- #
- # == Description
- #
- # Returns a Regexp object which matches to Bundler::URI-like strings.
- # The Regexp object returned by this method includes arbitrary
- # number of capture group (parentheses). Never rely on it's number.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # # extract first Bundler::URI from html_string
- # html_string.slice(Bundler::URI.regexp)
- #
- # # remove ftp URIs
- # html_string.sub(Bundler::URI.regexp(['ftp']), '')
- #
- # # You should not rely on the number of parentheses
- # html_string.scan(Bundler::URI.regexp) do |*matches|
- # p $&
- # end
- #
- def self.regexp(schemes = nil)
- warn "Bundler::URI.regexp is obsolete", uplevel: 1 if $VERBOSE
- DEFAULT_PARSER.make_regexp(schemes)
- end
-
- TBLENCWWWCOMP_ = {} # :nodoc:
- 256.times do |i|
- TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
- end
- TBLENCWWWCOMP_[' '] = '+'
- TBLENCWWWCOMP_.freeze
- TBLDECWWWCOMP_ = {} # :nodoc:
- 256.times do |i|
- h, l = i>>4, i&15
- TBLDECWWWCOMP_[-('%%%X%X' % [h, l])] = -i.chr
- TBLDECWWWCOMP_[-('%%%x%X' % [h, l])] = -i.chr
- TBLDECWWWCOMP_[-('%%%X%x' % [h, l])] = -i.chr
- TBLDECWWWCOMP_[-('%%%x%x' % [h, l])] = -i.chr
- end
- TBLDECWWWCOMP_['+'] = ' '
- TBLDECWWWCOMP_.freeze
-
- # Encodes given +str+ to URL-encoded form data.
- #
- # This method doesn't convert *, -, ., 0-9, A-Z, _, a-z, but does convert SP
- # (ASCII space) to + and converts others to %XX.
- #
- # If +enc+ is given, convert +str+ to the encoding before percent encoding.
- #
- # This is an implementation of
- # http://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data.
- #
- # See Bundler::URI.decode_www_form_component, Bundler::URI.encode_www_form.
- def self.encode_www_form_component(str, enc=nil)
- str = str.to_s.dup
- if str.encoding != Encoding::ASCII_8BIT
- if enc && enc != Encoding::ASCII_8BIT
- str.encode!(Encoding::UTF_8, invalid: :replace, undef: :replace)
- str.encode!(enc, fallback: ->(x){"&##{x.ord};"})
- end
- str.force_encoding(Encoding::ASCII_8BIT)
- end
- str.gsub!(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP_)
- str.force_encoding(Encoding::US_ASCII)
- end
-
- # Decodes given +str+ of URL-encoded form data.
- #
- # This decodes + to SP.
- #
- # See Bundler::URI.encode_www_form_component, Bundler::URI.decode_www_form.
- def self.decode_www_form_component(str, enc=Encoding::UTF_8)
- raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/ =~ str
- str.b.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
- end
-
- # Generates URL-encoded form data from given +enum+.
- #
- # This generates application/x-www-form-urlencoded data defined in HTML5
- # from given an Enumerable object.
- #
- # This internally uses Bundler::URI.encode_www_form_component(str).
- #
- # This method doesn't convert the encoding of given items, so convert them
- # before calling this method if you want to send data as other than original
- # encoding or mixed encoding data. (Strings which are encoded in an HTML5
- # ASCII incompatible encoding are converted to UTF-8.)
- #
- # This method doesn't handle files. When you send a file, use
- # multipart/form-data.
- #
- # This refers http://url.spec.whatwg.org/#concept-urlencoded-serializer
- #
- # Bundler::URI.encode_www_form([["q", "ruby"], ["lang", "en"]])
- # #=> "q=ruby&lang=en"
- # Bundler::URI.encode_www_form("q" => "ruby", "lang" => "en")
- # #=> "q=ruby&lang=en"
- # Bundler::URI.encode_www_form("q" => ["ruby", "perl"], "lang" => "en")
- # #=> "q=ruby&q=perl&lang=en"
- # Bundler::URI.encode_www_form([["q", "ruby"], ["q", "perl"], ["lang", "en"]])
- # #=> "q=ruby&q=perl&lang=en"
- #
- # See Bundler::URI.encode_www_form_component, Bundler::URI.decode_www_form.
- def self.encode_www_form(enum, enc=nil)
- enum.map do |k,v|
- if v.nil?
- encode_www_form_component(k, enc)
- elsif v.respond_to?(:to_ary)
- v.to_ary.map do |w|
- str = encode_www_form_component(k, enc)
- unless w.nil?
- str << '='
- str << encode_www_form_component(w, enc)
- end
- end.join('&')
- else
- str = encode_www_form_component(k, enc)
- str << '='
- str << encode_www_form_component(v, enc)
- end
- end.join('&')
- end
-
- # Decodes URL-encoded form data from given +str+.
- #
- # This decodes application/x-www-form-urlencoded data
- # and returns an array of key-value arrays.
- #
- # This refers http://url.spec.whatwg.org/#concept-urlencoded-parser,
- # so this supports only &-separator, and doesn't support ;-separator.
- #
- # ary = Bundler::URI.decode_www_form("a=1&a=2&b=3")
- # ary #=> [['a', '1'], ['a', '2'], ['b', '3']]
- # ary.assoc('a').last #=> '1'
- # ary.assoc('b').last #=> '3'
- # ary.rassoc('a').last #=> '2'
- # Hash[ary] #=> {"a"=>"2", "b"=>"3"}
- #
- # See Bundler::URI.decode_www_form_component, Bundler::URI.encode_www_form.
- def self.decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false)
- raise ArgumentError, "the input of #{self.name}.#{__method__} must be ASCII only string" unless str.ascii_only?
- ary = []
- return ary if str.empty?
- enc = Encoding.find(enc)
- str.b.each_line(separator) do |string|
- string.chomp!(separator)
- key, sep, val = string.partition('=')
- if isindex
- if sep.empty?
- val = key
- key = +''
- end
- isindex = false
- end
-
- if use__charset_ and key == '_charset_' and e = get_encoding(val)
- enc = e
- use__charset_ = false
- end
-
- key.gsub!(/\+|%\h\h/, TBLDECWWWCOMP_)
- if val
- val.gsub!(/\+|%\h\h/, TBLDECWWWCOMP_)
- else
- val = +''
- end
-
- ary << [key, val]
- end
- ary.each do |k, v|
- k.force_encoding(enc)
- k.scrub!
- v.force_encoding(enc)
- v.scrub!
- end
- ary
- 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
- WEB_ENCODINGS_ = {
- "unicode-1-1-utf-8"=>"utf-8",
- "utf-8"=>"utf-8",
- "utf8"=>"utf-8",
- "866"=>"ibm866",
- "cp866"=>"ibm866",
- "csibm866"=>"ibm866",
- "ibm866"=>"ibm866",
- "csisolatin2"=>"iso-8859-2",
- "iso-8859-2"=>"iso-8859-2",
- "iso-ir-101"=>"iso-8859-2",
- "iso8859-2"=>"iso-8859-2",
- "iso88592"=>"iso-8859-2",
- "iso_8859-2"=>"iso-8859-2",
- "iso_8859-2:1987"=>"iso-8859-2",
- "l2"=>"iso-8859-2",
- "latin2"=>"iso-8859-2",
- "csisolatin3"=>"iso-8859-3",
- "iso-8859-3"=>"iso-8859-3",
- "iso-ir-109"=>"iso-8859-3",
- "iso8859-3"=>"iso-8859-3",
- "iso88593"=>"iso-8859-3",
- "iso_8859-3"=>"iso-8859-3",
- "iso_8859-3:1988"=>"iso-8859-3",
- "l3"=>"iso-8859-3",
- "latin3"=>"iso-8859-3",
- "csisolatin4"=>"iso-8859-4",
- "iso-8859-4"=>"iso-8859-4",
- "iso-ir-110"=>"iso-8859-4",
- "iso8859-4"=>"iso-8859-4",
- "iso88594"=>"iso-8859-4",
- "iso_8859-4"=>"iso-8859-4",
- "iso_8859-4:1988"=>"iso-8859-4",
- "l4"=>"iso-8859-4",
- "latin4"=>"iso-8859-4",
- "csisolatincyrillic"=>"iso-8859-5",
- "cyrillic"=>"iso-8859-5",
- "iso-8859-5"=>"iso-8859-5",
- "iso-ir-144"=>"iso-8859-5",
- "iso8859-5"=>"iso-8859-5",
- "iso88595"=>"iso-8859-5",
- "iso_8859-5"=>"iso-8859-5",
- "iso_8859-5:1988"=>"iso-8859-5",
- "arabic"=>"iso-8859-6",
- "asmo-708"=>"iso-8859-6",
- "csiso88596e"=>"iso-8859-6",
- "csiso88596i"=>"iso-8859-6",
- "csisolatinarabic"=>"iso-8859-6",
- "ecma-114"=>"iso-8859-6",
- "iso-8859-6"=>"iso-8859-6",
- "iso-8859-6-e"=>"iso-8859-6",
- "iso-8859-6-i"=>"iso-8859-6",
- "iso-ir-127"=>"iso-8859-6",
- "iso8859-6"=>"iso-8859-6",
- "iso88596"=>"iso-8859-6",
- "iso_8859-6"=>"iso-8859-6",
- "iso_8859-6:1987"=>"iso-8859-6",
- "csisolatingreek"=>"iso-8859-7",
- "ecma-118"=>"iso-8859-7",
- "elot_928"=>"iso-8859-7",
- "greek"=>"iso-8859-7",
- "greek8"=>"iso-8859-7",
- "iso-8859-7"=>"iso-8859-7",
- "iso-ir-126"=>"iso-8859-7",
- "iso8859-7"=>"iso-8859-7",
- "iso88597"=>"iso-8859-7",
- "iso_8859-7"=>"iso-8859-7",
- "iso_8859-7:1987"=>"iso-8859-7",
- "sun_eu_greek"=>"iso-8859-7",
- "csiso88598e"=>"iso-8859-8",
- "csisolatinhebrew"=>"iso-8859-8",
- "hebrew"=>"iso-8859-8",
- "iso-8859-8"=>"iso-8859-8",
- "iso-8859-8-e"=>"iso-8859-8",
- "iso-ir-138"=>"iso-8859-8",
- "iso8859-8"=>"iso-8859-8",
- "iso88598"=>"iso-8859-8",
- "iso_8859-8"=>"iso-8859-8",
- "iso_8859-8:1988"=>"iso-8859-8",
- "visual"=>"iso-8859-8",
- "csisolatin6"=>"iso-8859-10",
- "iso-8859-10"=>"iso-8859-10",
- "iso-ir-157"=>"iso-8859-10",
- "iso8859-10"=>"iso-8859-10",
- "iso885910"=>"iso-8859-10",
- "l6"=>"iso-8859-10",
- "latin6"=>"iso-8859-10",
- "iso-8859-13"=>"iso-8859-13",
- "iso8859-13"=>"iso-8859-13",
- "iso885913"=>"iso-8859-13",
- "iso-8859-14"=>"iso-8859-14",
- "iso8859-14"=>"iso-8859-14",
- "iso885914"=>"iso-8859-14",
- "csisolatin9"=>"iso-8859-15",
- "iso-8859-15"=>"iso-8859-15",
- "iso8859-15"=>"iso-8859-15",
- "iso885915"=>"iso-8859-15",
- "iso_8859-15"=>"iso-8859-15",
- "l9"=>"iso-8859-15",
- "iso-8859-16"=>"iso-8859-16",
- "cskoi8r"=>"koi8-r",
- "koi"=>"koi8-r",
- "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",
- "iso8859-11"=>"windows-874",
- "iso885911"=>"windows-874",
- "tis-620"=>"windows-874",
- "windows-874"=>"windows-874",
- "cp1250"=>"windows-1250",
- "windows-1250"=>"windows-1250",
- "x-cp1250"=>"windows-1250",
- "cp1251"=>"windows-1251",
- "windows-1251"=>"windows-1251",
- "x-cp1251"=>"windows-1251",
- "ansi_x3.4-1968"=>"windows-1252",
- "ascii"=>"windows-1252",
- "cp1252"=>"windows-1252",
- "cp819"=>"windows-1252",
- "csisolatin1"=>"windows-1252",
- "ibm819"=>"windows-1252",
- "iso-8859-1"=>"windows-1252",
- "iso-ir-100"=>"windows-1252",
- "iso8859-1"=>"windows-1252",
- "iso88591"=>"windows-1252",
- "iso_8859-1"=>"windows-1252",
- "iso_8859-1:1987"=>"windows-1252",
- "l1"=>"windows-1252",
- "latin1"=>"windows-1252",
- "us-ascii"=>"windows-1252",
- "windows-1252"=>"windows-1252",
- "x-cp1252"=>"windows-1252",
- "cp1253"=>"windows-1253",
- "windows-1253"=>"windows-1253",
- "x-cp1253"=>"windows-1253",
- "cp1254"=>"windows-1254",
- "csisolatin5"=>"windows-1254",
- "iso-8859-9"=>"windows-1254",
- "iso-ir-148"=>"windows-1254",
- "iso8859-9"=>"windows-1254",
- "iso88599"=>"windows-1254",
- "iso_8859-9"=>"windows-1254",
- "iso_8859-9:1989"=>"windows-1254",
- "l5"=>"windows-1254",
- "latin5"=>"windows-1254",
- "windows-1254"=>"windows-1254",
- "x-cp1254"=>"windows-1254",
- "cp1255"=>"windows-1255",
- "windows-1255"=>"windows-1255",
- "x-cp1255"=>"windows-1255",
- "cp1256"=>"windows-1256",
- "windows-1256"=>"windows-1256",
- "x-cp1256"=>"windows-1256",
- "cp1257"=>"windows-1257",
- "windows-1257"=>"windows-1257",
- "x-cp1257"=>"windows-1257",
- "cp1258"=>"windows-1258",
- "windows-1258"=>"windows-1258",
- "x-cp1258"=>"windows-1258",
- "x-mac-cyrillic"=>"macCyrillic",
- "x-mac-ukrainian"=>"macCyrillic",
- "chinese"=>"gbk",
- "csgb2312"=>"gbk",
- "csiso58gb231280"=>"gbk",
- "gb2312"=>"gbk",
- "gb_2312"=>"gbk",
- "gb_2312-80"=>"gbk",
- "gbk"=>"gbk",
- "iso-ir-58"=>"gbk",
- "x-gbk"=>"gbk",
- "gb18030"=>"gb18030",
- "big5"=>"big5",
- "big5-hkscs"=>"big5",
- "cn-big5"=>"big5",
- "csbig5"=>"big5",
- "x-x-big5"=>"big5",
- "cseucpkdfmtjapanese"=>"cp51932",
- "euc-jp"=>"cp51932",
- "x-euc-jp"=>"cp51932",
- "csiso2022jp"=>"cp50221",
- "iso-2022-jp"=>"cp50221",
- "csshiftjis"=>"Windows-31J",
- "ms932"=>"Windows-31J",
- "ms_kanji"=>"Windows-31J",
- "shift-jis"=>"Windows-31J",
- "shift_jis"=>"Windows-31J",
- "sjis"=>"Windows-31J",
- "windows-31j"=>"Windows-31J",
- "x-sjis"=>"Windows-31J",
- "cseuckr"=>"euc-kr",
- "csksc56011987"=>"euc-kr",
- "euc-kr"=>"euc-kr",
- "iso-ir-149"=>"euc-kr",
- "korean"=>"euc-kr",
- "ks_c_5601-1987"=>"euc-kr",
- "ks_c_5601-1989"=>"euc-kr",
- "ksc5601"=>"euc-kr",
- "ksc_5601"=>"euc-kr",
- "windows-949"=>"euc-kr",
- "utf-16be"=>"utf-16be",
- "utf-16"=>"utf-16le",
- "utf-16le"=>"utf-16le",
- } # :nodoc:
-
- # :nodoc:
- # return encoding or nil
- # http://encoding.spec.whatwg.org/#concept-encoding-get
- def self.get_encoding(label)
- Encoding.find(WEB_ENCODINGS_[label.to_str.strip.downcase]) rescue nil
- end
-end # module Bundler::URI
-
-module Bundler
-
- #
- # Returns +uri+ converted to an Bundler::URI object.
- #
- def URI(uri)
- if uri.is_a?(Bundler::URI::Generic)
- uri
- elsif uri = String.try_convert(uri)
- Bundler::URI.parse(uri)
- else
- raise ArgumentError,
- "bad argument (expected Bundler::URI object or Bundler::URI string)"
- end
- end
- module_function :URI
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/file.rb b/lib/bundler/vendor/uri/lib/uri/file.rb
deleted file mode 100644
index df42f8bcdd..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/file.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'generic'
-
-module Bundler::URI
-
- #
- # The "file" Bundler::URI is defined by RFC8089.
- #
- class File < Generic
- # A Default port of nil for Bundler::URI::File.
- DEFAULT_PORT = nil
-
- #
- # An Array of the available components for Bundler::URI::File.
- #
- COMPONENT = [
- :scheme,
- :host,
- :path
- ].freeze
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::File object from components, with syntax checking.
- #
- # The components accepted are +host+ and +path+.
- #
- # The components should be provided either as an Array, or as a Hash
- # with keys formed by preceding the component names with a colon.
- #
- # If an Array is used, the components must be passed in the
- # order <code>[host, path]</code>.
- #
- # Examples:
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri1 = Bundler::URI::File.build(['host.example.com', '/path/file.zip'])
- # uri1.to_s # => "file://host.example.com/path/file.zip"
- #
- # uri2 = Bundler::URI::File.build({:host => 'host.example.com',
- # :path => '/ruby/src'})
- # uri2.to_s # => "file://host.example.com/ruby/src"
- #
- def self.build(args)
- tmp = Util::make_components_hash(self, args)
- super(tmp)
- end
-
- # Protected setter for the host component +v+.
- #
- # See also Bundler::URI::Generic.host=.
- #
- def set_host(v)
- v = "" if v.nil? || v == "localhost"
- @host = v
- end
-
- # do nothing
- def set_port(v)
- end
-
- # raise InvalidURIError
- def check_userinfo(user)
- raise Bundler::URI::InvalidURIError, "can not set userinfo for file Bundler::URI"
- end
-
- # raise InvalidURIError
- def check_user(user)
- raise Bundler::URI::InvalidURIError, "can not set user for file Bundler::URI"
- end
-
- # raise InvalidURIError
- def check_password(user)
- raise Bundler::URI::InvalidURIError, "can not set password for file Bundler::URI"
- end
-
- # do nothing
- def set_userinfo(v)
- end
-
- # do nothing
- def set_user(v)
- end
-
- # do nothing
- def set_password(v)
- end
- end
-
- @@schemes['FILE'] = File
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/ftp.rb b/lib/bundler/vendor/uri/lib/uri/ftp.rb
deleted file mode 100644
index ad39f57d7b..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/ftp.rb
+++ /dev/null
@@ -1,267 +0,0 @@
-# frozen_string_literal: false
-# = uri/ftp.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# License:: You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'generic'
-
-module Bundler::URI
-
- #
- # FTP Bundler::URI syntax is defined by RFC1738 section 3.2.
- #
- # This class will be redesigned because of difference of implementations;
- # the structure of its path. draft-hoffman-ftp-uri-04 is a draft but it
- # is a good summary about the de facto spec.
- # http://tools.ietf.org/html/draft-hoffman-ftp-uri-04
- #
- class FTP < Generic
- # A Default port of 21 for Bundler::URI::FTP.
- DEFAULT_PORT = 21
-
- #
- # An Array of the available components for Bundler::URI::FTP.
- #
- COMPONENT = [
- :scheme,
- :userinfo, :host, :port,
- :path, :typecode
- ].freeze
-
- #
- # Typecode is "a", "i", or "d".
- #
- # * "a" indicates a text file (the FTP command was ASCII)
- # * "i" indicates a binary file (FTP command IMAGE)
- # * "d" indicates the contents of a directory should be displayed
- #
- TYPECODE = ['a', 'i', 'd'].freeze
-
- # Typecode prefix ";type=".
- TYPECODE_PREFIX = ';type='.freeze
-
- def self.new2(user, password, host, port, path,
- typecode = nil, arg_check = true) # :nodoc:
- # Do not use this method! Not tested. [Bug #7301]
- # This methods remains just for compatibility,
- # Keep it undocumented until the active maintainer is assigned.
- typecode = nil if typecode.size == 0
- if typecode && !TYPECODE.include?(typecode)
- raise ArgumentError,
- "bad typecode is specified: #{typecode}"
- end
-
- # do escape
-
- self.new('ftp',
- [user, password],
- host, port, nil,
- typecode ? path + TYPECODE_PREFIX + typecode : path,
- nil, nil, nil, arg_check)
- end
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::FTP object from components, with syntax checking.
- #
- # The components accepted are +userinfo+, +host+, +port+, +path+, and
- # +typecode+.
- #
- # The components should be provided either as an Array, or as a Hash
- # with keys formed by preceding the component names with a colon.
- #
- # If an Array is used, the components must be passed in the
- # order <code>[userinfo, host, port, path, typecode]</code>.
- #
- # If the path supplied is absolute, it will be escaped in order to
- # make it absolute in the Bundler::URI.
- #
- # Examples:
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri1 = Bundler::URI::FTP.build(['user:password', 'ftp.example.com', nil,
- # '/path/file.zip', 'i'])
- # uri1.to_s # => "ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=i"
- #
- # uri2 = Bundler::URI::FTP.build({:host => 'ftp.example.com',
- # :path => 'ruby/src'})
- # uri2.to_s # => "ftp://ftp.example.com/ruby/src"
- #
- def self.build(args)
-
- # Fix the incoming path to be generic URL syntax
- # FTP path -> URL path
- # foo/bar /foo/bar
- # /foo/bar /%2Ffoo/bar
- #
- if args.kind_of?(Array)
- args[3] = '/' + args[3].sub(/^\//, '%2F')
- else
- args[:path] = '/' + args[:path].sub(/^\//, '%2F')
- end
-
- tmp = Util::make_components_hash(self, args)
-
- if tmp[:typecode]
- if tmp[:typecode].size == 1
- tmp[:typecode] = TYPECODE_PREFIX + tmp[:typecode]
- end
- tmp[:path] << tmp[:typecode]
- end
-
- return super(tmp)
- end
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::FTP object from generic URL components with no
- # syntax checking.
- #
- # Unlike build(), this method does not escape the path component as
- # required by RFC1738; instead it is treated as per RFC2396.
- #
- # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
- # +opaque+, +query+, and +fragment+, in that order.
- #
- def initialize(scheme,
- userinfo, host, port, registry,
- path, opaque,
- query,
- fragment,
- parser = nil,
- arg_check = false)
- raise InvalidURIError unless path
- path = path.sub(/^\//,'')
- path.sub!(/^%2F/,'/')
- super(scheme, userinfo, host, port, registry, path, opaque,
- query, fragment, parser, arg_check)
- @typecode = nil
- if tmp = @path.index(TYPECODE_PREFIX)
- typecode = @path[tmp + TYPECODE_PREFIX.size..-1]
- @path = @path[0..tmp - 1]
-
- if arg_check
- self.typecode = typecode
- else
- self.set_typecode(typecode)
- end
- end
- end
-
- # typecode accessor.
- #
- # See Bundler::URI::FTP::COMPONENT.
- attr_reader :typecode
-
- # Validates typecode +v+,
- # returns +true+ or +false+.
- #
- def check_typecode(v)
- if TYPECODE.include?(v)
- return true
- else
- raise InvalidComponentError,
- "bad typecode(expected #{TYPECODE.join(', ')}): #{v}"
- end
- end
- private :check_typecode
-
- # Private setter for the typecode +v+.
- #
- # See also Bundler::URI::FTP.typecode=.
- #
- def set_typecode(v)
- @typecode = v
- end
- protected :set_typecode
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the typecode +v+
- # (with validation).
- #
- # See also Bundler::URI::FTP.check_typecode.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("ftp://john@ftp.example.com/my_file.img")
- # #=> #<Bundler::URI::FTP ftp://john@ftp.example.com/my_file.img>
- # uri.typecode = "i"
- # uri
- # #=> #<Bundler::URI::FTP ftp://john@ftp.example.com/my_file.img;type=i>
- #
- def typecode=(typecode)
- check_typecode(typecode)
- set_typecode(typecode)
- typecode
- end
-
- def merge(oth) # :nodoc:
- tmp = super(oth)
- if self != tmp
- tmp.set_typecode(oth.typecode)
- end
-
- return tmp
- end
-
- # Returns the path from an FTP Bundler::URI.
- #
- # RFC 1738 specifically states that the path for an FTP Bundler::URI does not
- # include the / which separates the Bundler::URI path from the Bundler::URI host. Example:
- #
- # <code>ftp://ftp.example.com/pub/ruby</code>
- #
- # The above Bundler::URI indicates that the client should connect to
- # ftp.example.com then cd to pub/ruby from the initial login directory.
- #
- # If you want to cd to an absolute directory, you must include an
- # escaped / (%2F) in the path. Example:
- #
- # <code>ftp://ftp.example.com/%2Fpub/ruby</code>
- #
- # This method will then return "/pub/ruby".
- #
- def path
- return @path.sub(/^\//,'').sub(/^%2F/,'/')
- end
-
- # Private setter for the path of the Bundler::URI::FTP.
- def set_path(v)
- super("/" + v.sub(/^\//, "%2F"))
- end
- protected :set_path
-
- # Returns a String representation of the Bundler::URI::FTP.
- def to_s
- save_path = nil
- if @typecode
- save_path = @path
- @path = @path + TYPECODE_PREFIX + @typecode
- end
- str = super
- if @typecode
- @path = save_path
- end
-
- return str
- end
- end
- @@schemes['FTP'] = FTP
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/generic.rb b/lib/bundler/vendor/uri/lib/uri/generic.rb
deleted file mode 100644
index 56b09e1d7f..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/generic.rb
+++ /dev/null
@@ -1,1568 +0,0 @@
-# frozen_string_literal: true
-
-# = uri/generic.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# License:: You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'common'
-autoload :IPSocket, 'socket'
-autoload :IPAddr, 'ipaddr'
-
-module Bundler::URI
-
- #
- # Base class for all Bundler::URI classes.
- # Implements generic Bundler::URI syntax as per RFC 2396.
- #
- class Generic
- include Bundler::URI
-
- #
- # A Default port of nil for Bundler::URI::Generic.
- #
- DEFAULT_PORT = nil
-
- #
- # Returns default port.
- #
- def self.default_port
- self::DEFAULT_PORT
- end
-
- #
- # Returns default port.
- #
- def default_port
- self.class.default_port
- end
-
- #
- # An Array of the available components for Bundler::URI::Generic.
- #
- COMPONENT = [
- :scheme,
- :userinfo, :host, :port, :registry,
- :path, :opaque,
- :query,
- :fragment
- ].freeze
-
- #
- # Components of the Bundler::URI in the order.
- #
- def self.component
- self::COMPONENT
- end
-
- USE_REGISTRY = false # :nodoc:
-
- def self.use_registry # :nodoc:
- self::USE_REGISTRY
- end
-
- #
- # == Synopsis
- #
- # See ::new.
- #
- # == Description
- #
- # At first, tries to create a new Bundler::URI::Generic instance using
- # Bundler::URI::Generic::build. But, if exception Bundler::URI::InvalidComponentError is raised,
- # then it does Bundler::URI::Escape.escape all Bundler::URI components and tries again.
- #
- def self.build2(args)
- begin
- return self.build(args)
- rescue InvalidComponentError
- if args.kind_of?(Array)
- return self.build(args.collect{|x|
- if x.is_a?(String)
- DEFAULT_PARSER.escape(x)
- else
- x
- end
- })
- elsif args.kind_of?(Hash)
- tmp = {}
- args.each do |key, value|
- tmp[key] = if value
- DEFAULT_PARSER.escape(value)
- else
- value
- end
- end
- return self.build(tmp)
- end
- end
- end
-
- #
- # == Synopsis
- #
- # See ::new.
- #
- # == Description
- #
- # Creates a new Bundler::URI::Generic instance from components of Bundler::URI::Generic
- # with check. Components are: scheme, userinfo, host, port, registry, path,
- # opaque, query, and fragment. You can provide arguments either by an Array or a Hash.
- # See ::new for hash keys to use or for order of array items.
- #
- def self.build(args)
- if args.kind_of?(Array) &&
- args.size == ::Bundler::URI::Generic::COMPONENT.size
- tmp = args.dup
- elsif args.kind_of?(Hash)
- tmp = ::Bundler::URI::Generic::COMPONENT.collect do |c|
- if args.include?(c)
- args[c]
- else
- nil
- end
- end
- else
- component = self.class.component rescue ::Bundler::URI::Generic::COMPONENT
- raise ArgumentError,
- "expected Array of or Hash of components of #{self.class} (#{component.join(', ')})"
- end
-
- tmp << nil
- tmp << true
- return self.new(*tmp)
- end
-
- #
- # == Args
- #
- # +scheme+::
- # Protocol scheme, i.e. 'http','ftp','mailto' and so on.
- # +userinfo+::
- # User name and password, i.e. 'sdmitry:bla'.
- # +host+::
- # Server host name.
- # +port+::
- # Server port.
- # +registry+::
- # Registry of naming authorities.
- # +path+::
- # Path on server.
- # +opaque+::
- # Opaque part.
- # +query+::
- # Query data.
- # +fragment+::
- # Part of the Bundler::URI after '#' character.
- # +parser+::
- # Parser for internal use [Bundler::URI::DEFAULT_PARSER by default].
- # +arg_check+::
- # Check arguments [false by default].
- #
- # == Description
- #
- # Creates a new Bundler::URI::Generic instance from ``generic'' components without check.
- #
- def initialize(scheme,
- userinfo, host, port, registry,
- path, opaque,
- query,
- fragment,
- parser = DEFAULT_PARSER,
- arg_check = false)
- @scheme = nil
- @user = nil
- @password = nil
- @host = nil
- @port = nil
- @path = nil
- @query = nil
- @opaque = nil
- @fragment = nil
- @parser = parser == DEFAULT_PARSER ? nil : parser
-
- if arg_check
- self.scheme = scheme
- self.userinfo = userinfo
- self.hostname = host
- self.port = port
- self.path = path
- self.query = query
- self.opaque = opaque
- self.fragment = fragment
- else
- self.set_scheme(scheme)
- self.set_userinfo(userinfo)
- self.set_host(host)
- self.set_port(port)
- self.set_path(path)
- self.query = query
- self.set_opaque(opaque)
- self.fragment=(fragment)
- end
- if registry
- raise InvalidURIError,
- "the scheme #{@scheme} does not accept registry part: #{registry} (or bad hostname?)"
- end
-
- @scheme&.freeze
- self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2)
- self.set_port(self.default_port) if self.default_port && !@port
- end
-
- #
- # Returns the scheme component of the Bundler::URI.
- #
- # Bundler::URI("http://foo/bar/baz").scheme #=> "http"
- #
- attr_reader :scheme
-
- # Returns the host component of the Bundler::URI.
- #
- # Bundler::URI("http://foo/bar/baz").host #=> "foo"
- #
- # It returns nil if no host component exists.
- #
- # Bundler::URI("mailto:foo@example.org").host #=> nil
- #
- # The component does not contain the port number.
- #
- # Bundler::URI("http://foo:8080/bar/baz").host #=> "foo"
- #
- # Since IPv6 addresses are wrapped with brackets in URIs,
- # this method returns IPv6 addresses wrapped with brackets.
- # This form is not appropriate to pass to socket methods such as TCPSocket.open.
- # If unwrapped host names are required, use the #hostname method.
- #
- # Bundler::URI("http://[::1]/bar/baz").host #=> "[::1]"
- # Bundler::URI("http://[::1]/bar/baz").hostname #=> "::1"
- #
- attr_reader :host
-
- # Returns the port component of the Bundler::URI.
- #
- # Bundler::URI("http://foo/bar/baz").port #=> 80
- # Bundler::URI("http://foo:8080/bar/baz").port #=> 8080
- #
- attr_reader :port
-
- def registry # :nodoc:
- nil
- end
-
- # Returns the path component of the Bundler::URI.
- #
- # Bundler::URI("http://foo/bar/baz").path #=> "/bar/baz"
- #
- attr_reader :path
-
- # Returns the query component of the Bundler::URI.
- #
- # Bundler::URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar"
- #
- attr_reader :query
-
- # Returns the opaque part of the Bundler::URI.
- #
- # Bundler::URI("mailto:foo@example.org").opaque #=> "foo@example.org"
- # Bundler::URI("http://foo/bar/baz").opaque #=> nil
- #
- # The portion of the path that does not make use of the slash '/'.
- # The path typically refers to an absolute path or an opaque part.
- # (See RFC2396 Section 3 and 5.2.)
- #
- attr_reader :opaque
-
- # Returns the fragment component of the Bundler::URI.
- #
- # Bundler::URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies"
- #
- attr_reader :fragment
-
- # Returns the parser to be used.
- #
- # Unless a Bundler::URI::Parser is defined, DEFAULT_PARSER is used.
- #
- def parser
- if !defined?(@parser) || !@parser
- DEFAULT_PARSER
- else
- @parser || DEFAULT_PARSER
- end
- end
-
- # Replaces self by other Bundler::URI object.
- #
- def replace!(oth)
- if self.class != oth.class
- raise ArgumentError, "expected #{self.class} object"
- end
-
- component.each do |c|
- self.__send__("#{c}=", oth.__send__(c))
- end
- end
- private :replace!
-
- #
- # Components of the Bundler::URI in the order.
- #
- def component
- self.class.component
- end
-
- #
- # Checks the scheme +v+ component against the Bundler::URI::Parser Regexp for :SCHEME.
- #
- def check_scheme(v)
- if v && parser.regexp[:SCHEME] !~ v
- raise InvalidComponentError,
- "bad component(expected scheme component): #{v}"
- end
-
- return true
- end
- private :check_scheme
-
- # Protected setter for the scheme component +v+.
- #
- # See also Bundler::URI::Generic.scheme=.
- #
- def set_scheme(v)
- @scheme = v&.downcase
- end
- protected :set_scheme
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the scheme component +v+
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_scheme.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com")
- # uri.scheme = "https"
- # uri.to_s #=> "https://my.example.com"
- #
- def scheme=(v)
- check_scheme(v)
- set_scheme(v)
- v
- end
-
- #
- # Checks the +user+ and +password+.
- #
- # If +password+ is not provided, then +user+ is
- # split, using Bundler::URI::Generic.split_userinfo, to
- # pull +user+ and +password.
- #
- # See also Bundler::URI::Generic.check_user, Bundler::URI::Generic.check_password.
- #
- def check_userinfo(user, password = nil)
- if !password
- user, password = split_userinfo(user)
- end
- check_user(user)
- check_password(password, user)
-
- return true
- end
- private :check_userinfo
-
- #
- # Checks the user +v+ component for RFC2396 compliance
- # and against the Bundler::URI::Parser Regexp for :USERINFO.
- #
- # Can not have a registry or opaque component defined,
- # with a user component defined.
- #
- def check_user(v)
- if @opaque
- raise InvalidURIError,
- "can not set user with opaque"
- end
-
- return v unless v
-
- if parser.regexp[:USERINFO] !~ v
- raise InvalidComponentError,
- "bad component(expected userinfo component or user component): #{v}"
- end
-
- return true
- end
- private :check_user
-
- #
- # Checks the password +v+ component for RFC2396 compliance
- # and against the Bundler::URI::Parser Regexp for :USERINFO.
- #
- # Can not have a registry or opaque component defined,
- # with a user component defined.
- #
- def check_password(v, user = @user)
- if @opaque
- raise InvalidURIError,
- "can not set password with opaque"
- end
- return v unless v
-
- if !user
- raise InvalidURIError,
- "password component depends user component"
- end
-
- if parser.regexp[:USERINFO] !~ v
- raise InvalidComponentError,
- "bad password component"
- end
-
- return true
- end
- private :check_password
-
- #
- # Sets userinfo, argument is string like 'name:pass'.
- #
- def userinfo=(userinfo)
- if userinfo.nil?
- return nil
- end
- check_userinfo(*userinfo)
- set_userinfo(*userinfo)
- # returns userinfo
- end
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the +user+ component
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_user.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://john:S3nsit1ve@my.example.com")
- # uri.user = "sam"
- # uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com"
- #
- def user=(user)
- check_user(user)
- set_user(user)
- # returns user
- end
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the +password+ component
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_password.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://john:S3nsit1ve@my.example.com")
- # uri.password = "V3ry_S3nsit1ve"
- # uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com"
- #
- def password=(password)
- check_password(password)
- set_password(password)
- # returns password
- end
-
- # Protected setter for the +user+ component, and +password+ if available
- # (with validation).
- #
- # See also Bundler::URI::Generic.userinfo=.
- #
- def set_userinfo(user, password = nil)
- unless password
- user, password = split_userinfo(user)
- end
- @user = user
- @password = password if password
-
- [@user, @password]
- end
- protected :set_userinfo
-
- # Protected setter for the user component +v+.
- #
- # See also Bundler::URI::Generic.user=.
- #
- def set_user(v)
- set_userinfo(v, @password)
- v
- end
- protected :set_user
-
- # Protected setter for the password component +v+.
- #
- # See also Bundler::URI::Generic.password=.
- #
- def set_password(v)
- @password = v
- # returns v
- end
- protected :set_password
-
- # Returns the userinfo +ui+ as <code>[user, password]</code>
- # if properly formatted as 'user:password'.
- def split_userinfo(ui)
- return nil, nil unless ui
- user, password = ui.split(':', 2)
-
- return user, password
- end
- private :split_userinfo
-
- # Escapes 'user:password' +v+ based on RFC 1738 section 3.1.
- def escape_userpass(v)
- parser.escape(v, /[@:\/]/o) # RFC 1738 section 3.1 #/
- end
- private :escape_userpass
-
- # Returns the userinfo, either as 'user' or 'user:password'.
- def userinfo
- if @user.nil?
- nil
- elsif @password.nil?
- @user
- else
- @user + ':' + @password
- end
- end
-
- # Returns the user component.
- def user
- @user
- end
-
- # Returns the password component.
- def password
- @password
- end
-
- #
- # Checks the host +v+ component for RFC2396 compliance
- # and against the Bundler::URI::Parser Regexp for :HOST.
- #
- # Can not have a registry or opaque component defined,
- # with a host component defined.
- #
- def check_host(v)
- return v unless v
-
- if @opaque
- raise InvalidURIError,
- "can not set host with registry or opaque"
- elsif parser.regexp[:HOST] !~ v
- raise InvalidComponentError,
- "bad component(expected host component): #{v}"
- end
-
- return true
- end
- private :check_host
-
- # Protected setter for the host component +v+.
- #
- # See also Bundler::URI::Generic.host=.
- #
- def set_host(v)
- @host = v
- end
- protected :set_host
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the host component +v+
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_host.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com")
- # uri.host = "foo.com"
- # uri.to_s #=> "http://foo.com"
- #
- def host=(v)
- check_host(v)
- set_host(v)
- v
- end
-
- # Extract the host part of the Bundler::URI and unwrap brackets for IPv6 addresses.
- #
- # This method is the same as Bundler::URI::Generic#host except
- # brackets for IPv6 (and future IP) addresses are removed.
- #
- # uri = Bundler::URI("http://[::1]/bar")
- # uri.hostname #=> "::1"
- # uri.host #=> "[::1]"
- #
- def hostname
- v = self.host
- /\A\[(.*)\]\z/ =~ v ? $1 : v
- end
-
- # Sets the host part of the Bundler::URI as the argument with brackets for IPv6 addresses.
- #
- # This method is the same as Bundler::URI::Generic#host= except
- # the argument can be a bare IPv6 address.
- #
- # uri = Bundler::URI("http://foo/bar")
- # uri.hostname = "::1"
- # uri.to_s #=> "http://[::1]/bar"
- #
- # If the argument seems to be an IPv6 address,
- # it is wrapped with brackets.
- #
- def hostname=(v)
- v = "[#{v}]" if /\A\[.*\]\z/ !~ v && /:/ =~ v
- self.host = v
- end
-
- #
- # Checks the port +v+ component for RFC2396 compliance
- # and against the Bundler::URI::Parser Regexp for :PORT.
- #
- # Can not have a registry or opaque component defined,
- # with a port component defined.
- #
- def check_port(v)
- return v unless v
-
- if @opaque
- raise InvalidURIError,
- "can not set port with registry or opaque"
- elsif !v.kind_of?(Integer) && parser.regexp[:PORT] !~ v
- raise InvalidComponentError,
- "bad component(expected port component): #{v.inspect}"
- end
-
- return true
- end
- private :check_port
-
- # Protected setter for the port component +v+.
- #
- # See also Bundler::URI::Generic.port=.
- #
- def set_port(v)
- v = v.empty? ? nil : v.to_i unless !v || v.kind_of?(Integer)
- @port = v
- end
- protected :set_port
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the port component +v+
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_port.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com")
- # uri.port = 8080
- # uri.to_s #=> "http://my.example.com:8080"
- #
- def port=(v)
- check_port(v)
- set_port(v)
- port
- end
-
- def check_registry(v) # :nodoc:
- raise InvalidURIError, "can not set registry"
- end
- private :check_registry
-
- def set_registry(v) #:nodoc:
- raise InvalidURIError, "can not set registry"
- end
- protected :set_registry
-
- def registry=(v)
- raise InvalidURIError, "can not set registry"
- end
-
- #
- # Checks the path +v+ component for RFC2396 compliance
- # and against the Bundler::URI::Parser Regexp
- # for :ABS_PATH and :REL_PATH.
- #
- # Can not have a opaque component defined,
- # with a path component defined.
- #
- def check_path(v)
- # raise if both hier and opaque are not nil, because:
- # absoluteURI = scheme ":" ( hier_part | opaque_part )
- # hier_part = ( net_path | abs_path ) [ "?" query ]
- if v && @opaque
- raise InvalidURIError,
- "path conflicts with opaque"
- end
-
- # If scheme is ftp, path may be relative.
- # See RFC 1738 section 3.2.2, and RFC 2396.
- if @scheme && @scheme != "ftp"
- if v && v != '' && parser.regexp[:ABS_PATH] !~ v
- raise InvalidComponentError,
- "bad component(expected absolute path component): #{v}"
- end
- else
- if v && v != '' && parser.regexp[:ABS_PATH] !~ v &&
- parser.regexp[:REL_PATH] !~ v
- raise InvalidComponentError,
- "bad component(expected relative path component): #{v}"
- end
- end
-
- return true
- end
- private :check_path
-
- # Protected setter for the path component +v+.
- #
- # See also Bundler::URI::Generic.path=.
- #
- def set_path(v)
- @path = v
- end
- protected :set_path
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the path component +v+
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_path.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com/pub/files")
- # uri.path = "/faq/"
- # uri.to_s #=> "http://my.example.com/faq/"
- #
- def path=(v)
- check_path(v)
- set_path(v)
- v
- end
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the query component +v+.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com/?id=25")
- # uri.query = "id=1"
- # uri.to_s #=> "http://my.example.com/?id=1"
- #
- def query=(v)
- return @query = nil unless v
- raise InvalidURIError, "query conflicts with opaque" if @opaque
-
- x = v.to_str
- v = x.dup if x.equal? v
- v.encode!(Encoding::UTF_8) rescue nil
- v.delete!("\t\r\n")
- v.force_encoding(Encoding::ASCII_8BIT)
- raise InvalidURIError, "invalid percent escape: #{$1}" if /(%\H\H)/n.match(v)
- v.gsub!(/(?!%\h\h|[!$-&(-;=?-_a-~])./n.freeze){'%%%02X' % $&.ord}
- v.force_encoding(Encoding::US_ASCII)
- @query = v
- end
-
- #
- # Checks the opaque +v+ component for RFC2396 compliance and
- # against the Bundler::URI::Parser Regexp for :OPAQUE.
- #
- # Can not have a host, port, user, or path component defined,
- # with an opaque component defined.
- #
- def check_opaque(v)
- return v unless v
-
- # raise if both hier and opaque are not nil, because:
- # absoluteURI = scheme ":" ( hier_part | opaque_part )
- # hier_part = ( net_path | abs_path ) [ "?" query ]
- if @host || @port || @user || @path # userinfo = @user + ':' + @password
- raise InvalidURIError,
- "can not set opaque with host, port, userinfo or path"
- elsif v && parser.regexp[:OPAQUE] !~ v
- raise InvalidComponentError,
- "bad component(expected opaque component): #{v}"
- end
-
- return true
- end
- private :check_opaque
-
- # Protected setter for the opaque component +v+.
- #
- # See also Bundler::URI::Generic.opaque=.
- #
- def set_opaque(v)
- @opaque = v
- end
- protected :set_opaque
-
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the opaque component +v+
- # (with validation).
- #
- # See also Bundler::URI::Generic.check_opaque.
- #
- def opaque=(v)
- check_opaque(v)
- set_opaque(v)
- v
- end
-
- #
- # Checks the fragment +v+ component against the Bundler::URI::Parser Regexp for :FRAGMENT.
- #
- #
- # == Args
- #
- # +v+::
- # String
- #
- # == Description
- #
- # Public setter for the fragment component +v+
- # (with validation).
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com/?id=25#time=1305212049")
- # uri.fragment = "time=1305212086"
- # uri.to_s #=> "http://my.example.com/?id=25#time=1305212086"
- #
- def fragment=(v)
- return @fragment = nil unless v
-
- x = v.to_str
- v = x.dup if x.equal? v
- v.encode!(Encoding::UTF_8) rescue nil
- v.delete!("\t\r\n")
- v.force_encoding(Encoding::ASCII_8BIT)
- v.gsub!(/(?!%\h\h|[!-~])./n){'%%%02X' % $&.ord}
- v.force_encoding(Encoding::US_ASCII)
- @fragment = v
- end
-
- #
- # Returns true if Bundler::URI is hierarchical.
- #
- # == Description
- #
- # Bundler::URI has components listed in order of decreasing significance from left to right,
- # see RFC3986 https://tools.ietf.org/html/rfc3986 1.2.3.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com/")
- # uri.hierarchical?
- # #=> true
- # uri = Bundler::URI.parse("mailto:joe@example.com")
- # uri.hierarchical?
- # #=> false
- #
- def hierarchical?
- if @path
- true
- else
- false
- end
- end
-
- #
- # Returns true if Bundler::URI has a scheme (e.g. http:// or https://) specified.
- #
- def absolute?
- if @scheme
- true
- else
- false
- end
- end
- alias absolute absolute?
-
- #
- # Returns true if Bundler::URI does not have a scheme (e.g. http:// or https://) specified.
- #
- def relative?
- !absolute?
- end
-
- #
- # Returns an Array of the path split on '/'.
- #
- def split_path(path)
- path.split("/", -1)
- end
- private :split_path
-
- #
- # Merges a base path +base+, with relative path +rel+,
- # returns a modified base path.
- #
- def merge_path(base, rel)
-
- # RFC2396, Section 5.2, 5)
- # RFC2396, Section 5.2, 6)
- base_path = split_path(base)
- rel_path = split_path(rel)
-
- # RFC2396, Section 5.2, 6), a)
- base_path << '' if base_path.last == '..'
- while i = base_path.index('..')
- base_path.slice!(i - 1, 2)
- end
-
- if (first = rel_path.first) and first.empty?
- base_path.clear
- rel_path.shift
- end
-
- # RFC2396, Section 5.2, 6), c)
- # RFC2396, Section 5.2, 6), d)
- rel_path.push('') if rel_path.last == '.' || rel_path.last == '..'
- rel_path.delete('.')
-
- # RFC2396, Section 5.2, 6), e)
- tmp = []
- rel_path.each do |x|
- if x == '..' &&
- !(tmp.empty? || tmp.last == '..')
- tmp.pop
- else
- tmp << x
- end
- end
-
- add_trailer_slash = !tmp.empty?
- if base_path.empty?
- base_path = [''] # keep '/' for root directory
- elsif add_trailer_slash
- base_path.pop
- end
- while x = tmp.shift
- if x == '..'
- # RFC2396, Section 4
- # a .. or . in an absolute path has no special meaning
- base_path.pop if base_path.size > 1
- else
- # if x == '..'
- # valid absolute (but abnormal) path "/../..."
- # else
- # valid absolute path
- # end
- base_path << x
- tmp.each {|t| base_path << t}
- add_trailer_slash = false
- break
- end
- end
- base_path.push('') if add_trailer_slash
-
- return base_path.join('/')
- end
- private :merge_path
-
- #
- # == Args
- #
- # +oth+::
- # Bundler::URI or String
- #
- # == Description
- #
- # Destructive form of #merge.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com")
- # uri.merge!("/main.rbx?page=1")
- # uri.to_s # => "http://my.example.com/main.rbx?page=1"
- #
- def merge!(oth)
- t = merge(oth)
- if self == t
- nil
- else
- replace!(t)
- self
- end
- end
-
- #
- # == Args
- #
- # +oth+::
- # Bundler::URI or String
- #
- # == Description
- #
- # Merges two URIs.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com")
- # uri.merge("/main.rbx?page=1")
- # # => "http://my.example.com/main.rbx?page=1"
- #
- def merge(oth)
- rel = parser.send(:convert_to_uri, oth)
-
- if rel.absolute?
- #raise BadURIError, "both Bundler::URI are absolute" if absolute?
- # hmm... should return oth for usability?
- return rel
- end
-
- unless self.absolute?
- raise BadURIError, "both Bundler::URI are relative"
- end
-
- base = self.dup
-
- authority = rel.userinfo || rel.host || rel.port
-
- # RFC2396, Section 5.2, 2)
- if (rel.path.nil? || rel.path.empty?) && !authority && !rel.query
- base.fragment=(rel.fragment) if rel.fragment
- return base
- end
-
- base.query = nil
- base.fragment=(nil)
-
- # RFC2396, Section 5.2, 4)
- if !authority
- base.set_path(merge_path(base.path, rel.path)) if base.path && rel.path
- else
- # RFC2396, Section 5.2, 4)
- base.set_path(rel.path) if rel.path
- end
-
- # RFC2396, Section 5.2, 7)
- base.set_userinfo(rel.userinfo) if rel.userinfo
- base.set_host(rel.host) if rel.host
- base.set_port(rel.port) if rel.port
- base.query = rel.query if rel.query
- base.fragment=(rel.fragment) if rel.fragment
-
- return base
- end # merge
- alias + merge
-
- # :stopdoc:
- def route_from_path(src, dst)
- case dst
- when src
- # RFC2396, Section 4.2
- return ''
- when %r{(?:\A|/)\.\.?(?:/|\z)}
- # dst has abnormal absolute path,
- # like "/./", "/../", "/x/../", ...
- return dst.dup
- end
-
- src_path = src.scan(%r{[^/]*/})
- dst_path = dst.scan(%r{[^/]*/?})
-
- # discard same parts
- while !dst_path.empty? && dst_path.first == src_path.first
- src_path.shift
- dst_path.shift
- end
-
- tmp = dst_path.join
-
- # calculate
- if src_path.empty?
- if tmp.empty?
- return './'
- elsif dst_path.first.include?(':') # (see RFC2396 Section 5)
- return './' + tmp
- else
- return tmp
- end
- end
-
- return '../' * src_path.size + tmp
- end
- private :route_from_path
- # :startdoc:
-
- # :stopdoc:
- def route_from0(oth)
- oth = parser.send(:convert_to_uri, oth)
- if self.relative?
- raise BadURIError,
- "relative Bundler::URI: #{self}"
- end
- if oth.relative?
- raise BadURIError,
- "relative Bundler::URI: #{oth}"
- end
-
- if self.scheme != oth.scheme
- return self, self.dup
- end
- rel = Bundler::URI::Generic.new(nil, # it is relative Bundler::URI
- self.userinfo, self.host, self.port,
- nil, self.path, self.opaque,
- self.query, self.fragment, parser)
-
- if rel.userinfo != oth.userinfo ||
- rel.host.to_s.downcase != oth.host.to_s.downcase ||
- rel.port != oth.port
-
- if self.userinfo.nil? && self.host.nil?
- return self, self.dup
- end
-
- rel.set_port(nil) if rel.port == oth.default_port
- return rel, rel
- end
- rel.set_userinfo(nil)
- rel.set_host(nil)
- rel.set_port(nil)
-
- if rel.path && rel.path == oth.path
- rel.set_path('')
- rel.query = nil if rel.query == oth.query
- return rel, rel
- elsif rel.opaque && rel.opaque == oth.opaque
- rel.set_opaque('')
- rel.query = nil if rel.query == oth.query
- return rel, rel
- end
-
- # you can modify `rel', but can not `oth'.
- return oth, rel
- end
- private :route_from0
- # :startdoc:
-
- #
- # == Args
- #
- # +oth+::
- # Bundler::URI or String
- #
- # == Description
- #
- # Calculates relative path from oth to self.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse('http://my.example.com/main.rbx?page=1')
- # uri.route_from('http://my.example.com')
- # #=> #<Bundler::URI::Generic /main.rbx?page=1>
- #
- def route_from(oth)
- # you can modify `rel', but can not `oth'.
- begin
- oth, rel = route_from0(oth)
- rescue
- raise $!.class, $!.message
- end
- if oth == rel
- return rel
- end
-
- rel.set_path(route_from_path(oth.path, self.path))
- if rel.path == './' && self.query
- # "./?foo" -> "?foo"
- rel.set_path('')
- end
-
- return rel
- end
-
- alias - route_from
-
- #
- # == Args
- #
- # +oth+::
- # Bundler::URI or String
- #
- # == Description
- #
- # Calculates relative path to oth from self.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse('http://my.example.com')
- # uri.route_to('http://my.example.com/main.rbx?page=1')
- # #=> #<Bundler::URI::Generic /main.rbx?page=1>
- #
- def route_to(oth)
- parser.send(:convert_to_uri, oth).route_from(self)
- end
-
- #
- # Returns normalized Bundler::URI.
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # Bundler::URI("HTTP://my.EXAMPLE.com").normalize
- # #=> #<Bundler::URI::HTTP http://my.example.com/>
- #
- # Normalization here means:
- #
- # * scheme and host are converted to lowercase,
- # * an empty path component is set to "/".
- #
- def normalize
- uri = dup
- uri.normalize!
- uri
- end
-
- #
- # Destructive version of #normalize.
- #
- def normalize!
- if path&.empty?
- set_path('/')
- end
- if scheme && scheme != scheme.downcase
- set_scheme(self.scheme.downcase)
- end
- if host && host != host.downcase
- set_host(self.host.downcase)
- end
- end
-
- #
- # Constructs String from Bundler::URI.
- #
- def to_s
- str = ''.dup
- if @scheme
- str << @scheme
- str << ':'
- end
-
- if @opaque
- str << @opaque
- else
- if @host || %w[file postgres].include?(@scheme)
- str << '//'
- end
- if self.userinfo
- str << self.userinfo
- str << '@'
- end
- if @host
- str << @host
- end
- if @port && @port != self.default_port
- str << ':'
- str << @port.to_s
- end
- str << @path
- if @query
- str << '?'
- str << @query
- end
- end
- if @fragment
- str << '#'
- str << @fragment
- end
- str
- end
-
- #
- # Compares two URIs.
- #
- def ==(oth)
- if self.class == oth.class
- self.normalize.component_ary == oth.normalize.component_ary
- else
- false
- end
- end
-
- def hash
- self.component_ary.hash
- end
-
- def eql?(oth)
- self.class == oth.class &&
- parser == oth.parser &&
- self.component_ary.eql?(oth.component_ary)
- end
-
-=begin
-
---- Bundler::URI::Generic#===(oth)
-
-=end
-# def ===(oth)
-# raise NotImplementedError
-# end
-
-=begin
-=end
-
-
- # Returns an Array of the components defined from the COMPONENT Array.
- def component_ary
- component.collect do |x|
- self.send(x)
- end
- end
- protected :component_ary
-
- # == Args
- #
- # +components+::
- # Multiple Symbol arguments defined in Bundler::URI::HTTP.
- #
- # == Description
- #
- # Selects specified components from Bundler::URI.
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse('http://myuser:mypass@my.example.com/test.rbx')
- # uri.select(:userinfo, :host, :path)
- # # => ["myuser:mypass", "my.example.com", "/test.rbx"]
- #
- def select(*components)
- components.collect do |c|
- if component.include?(c)
- self.send(c)
- else
- raise ArgumentError,
- "expected of components of #{self.class} (#{self.class.component.join(', ')})"
- end
- end
- end
-
- def inspect
- "#<#{self.class} #{self}>"
- end
-
- #
- # == Args
- #
- # +v+::
- # Bundler::URI or String
- #
- # == Description
- #
- # Attempts to parse other Bundler::URI +oth+,
- # returns [parsed_oth, self].
- #
- # == Usage
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("http://my.example.com")
- # uri.coerce("http://foo.com")
- # #=> [#<Bundler::URI::HTTP http://foo.com>, #<Bundler::URI::HTTP http://my.example.com>]
- #
- def coerce(oth)
- case oth
- when String
- oth = parser.parse(oth)
- else
- super
- end
-
- return oth, self
- end
-
- # Returns a proxy Bundler::URI.
- # The proxy Bundler::URI is obtained from environment variables such as http_proxy,
- # 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.
- #
- # But http_proxy and HTTP_PROXY is treated specially under CGI environment.
- # It's because HTTP_PROXY may be set by Proxy: header.
- # So HTTP_PROXY is not used.
- # http_proxy is not used too if the variable is case insensitive.
- # CGI_HTTP_PROXY can be used instead.
- def find_proxy(env=ENV)
- raise BadURIError, "relative Bundler::URI: #{self}" if self.relative?
- name = self.scheme.downcase + '_proxy'
- proxy_uri = nil
- if name == 'http_proxy' && env.include?('REQUEST_METHOD') # CGI?
- # HTTP_PROXY conflicts with *_proxy for proxy settings and
- # HTTP_* for header information in CGI.
- # So it should be careful to use it.
- pairs = env.reject {|k, v| /\Ahttp_proxy\z/i !~ k }
- case pairs.length
- when 0 # no proxy setting anyway.
- proxy_uri = nil
- when 1
- k, _ = pairs.shift
- if k == 'http_proxy' && env[k.upcase] == nil
- # http_proxy is safe to use because ENV is case sensitive.
- proxy_uri = env[name]
- else
- proxy_uri = nil
- end
- else # http_proxy is safe to use because ENV is case sensitive.
- proxy_uri = env.to_hash[name]
- end
- if !proxy_uri
- # Use CGI_HTTP_PROXY. cf. libwww-perl.
- proxy_uri = env["CGI_#{name.upcase}"]
- end
- elsif name == 'http_proxy'
- unless proxy_uri = env[name]
- if proxy_uri = env[name.upcase]
- warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.', uplevel: 1
- end
- end
- else
- proxy_uri = env[name] || env[name.upcase]
- end
-
- if proxy_uri.nil? || proxy_uri.empty?
- return nil
- end
-
- if self.hostname
- begin
- addr = IPSocket.getaddress(self.hostname)
- return nil if /\A127\.|\A::1\z/ =~ addr
- rescue SocketError
- end
- end
-
- name = 'no_proxy'
- if no_proxy = env[name] || env[name.upcase]
- return nil unless Bundler::URI::Generic.use_proxy?(self.hostname, addr, self.port, no_proxy)
- end
- Bundler::URI.parse(proxy_uri)
- end
-
- def self.use_proxy?(hostname, addr, port, no_proxy) # :nodoc:
- hostname = hostname.downcase
- dothostname = ".#{hostname}"
- no_proxy.scan(/([^:,\s]+)(?::(\d+))?/) {|p_host, p_port|
- if !p_port || port == p_port.to_i
- if p_host.start_with?('.')
- return false if hostname.end_with?(p_host.downcase)
- else
- return false if dothostname.end_with?(".#{p_host.downcase}")
- end
- if 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/bundler/vendor/uri/lib/uri/http.rb b/lib/bundler/vendor/uri/lib/uri/http.rb
deleted file mode 100644
index b6ca1c51de..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/http.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# frozen_string_literal: false
-# = uri/http.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# License:: You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'generic'
-
-module Bundler::URI
-
- #
- # The syntax of HTTP URIs is defined in RFC1738 section 3.3.
- #
- # Note that the Ruby Bundler::URI library allows HTTP URLs containing usernames and
- # passwords. This is not legal as per the RFC, but used to be
- # supported in Internet Explorer 5 and 6, before the MS04-004 security
- # update. See <URL:http://support.microsoft.com/kb/834489>.
- #
- class HTTP < Generic
- # A Default port of 80 for Bundler::URI::HTTP.
- DEFAULT_PORT = 80
-
- # An Array of the available components for Bundler::URI::HTTP.
- COMPONENT = %i[
- scheme
- userinfo host port
- path
- query
- fragment
- ].freeze
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::HTTP object from components, with syntax checking.
- #
- # The components accepted are userinfo, host, port, path, query, and
- # fragment.
- #
- # The components should be provided either as an Array, or as a Hash
- # with keys formed by preceding the component names with a colon.
- #
- # If an Array is used, the components must be passed in the
- # order <code>[userinfo, host, port, path, query, fragment]</code>.
- #
- # Example:
- #
- # uri = Bundler::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar')
- #
- # uri = Bundler::URI::HTTP.build([nil, "www.example.com", nil, "/path",
- # "query", 'fragment'])
- #
- # Currently, if passed userinfo components this method generates
- # invalid HTTP URIs as per RFC 1738.
- #
- def self.build(args)
- tmp = Util.make_components_hash(self, args)
- super(tmp)
- end
-
- #
- # == Description
- #
- # Returns the full path for an HTTP request, as required by Net::HTTP::Get.
- #
- # If the Bundler::URI contains a query, the full path is Bundler::URI#path + '?' + Bundler::URI#query.
- # Otherwise, the path is simply Bundler::URI#path.
- #
- # Example:
- #
- # uri = Bundler::URI::HTTP.build(path: '/foo/bar', query: 'test=true')
- # uri.request_uri # => "/foo/bar?test=true"
- #
- def request_uri
- return unless @path
-
- url = @query ? "#@path?#@query" : @path.dup
- url.start_with?(?/.freeze) ? url : ?/ + url
- end
- end
-
- @@schemes['HTTP'] = HTTP
-
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/https.rb b/lib/bundler/vendor/uri/lib/uri/https.rb
deleted file mode 100644
index 78dc6bf532..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/https.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: false
-# = uri/https.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# License:: You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'http'
-
-module Bundler::URI
-
- # The default port for HTTPS URIs is 443, and the scheme is 'https:' rather
- # than 'http:'. Other than that, HTTPS URIs are identical to HTTP URIs;
- # see Bundler::URI::HTTP.
- class HTTPS < HTTP
- # A Default port of 443 for Bundler::URI::HTTPS
- DEFAULT_PORT = 443
- end
- @@schemes['HTTPS'] = HTTPS
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/ldap.rb b/lib/bundler/vendor/uri/lib/uri/ldap.rb
deleted file mode 100644
index b707bedb97..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/ldap.rb
+++ /dev/null
@@ -1,261 +0,0 @@
-# frozen_string_literal: false
-# = uri/ldap.rb
-#
-# Author::
-# Takaaki Tateishi <ttate@jaist.ac.jp>
-# Akira Yamada <akira@ruby-lang.org>
-# License::
-# Bundler::URI::LDAP is copyrighted free software by Takaaki Tateishi and Akira Yamada.
-# You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'generic'
-
-module Bundler::URI
-
- #
- # LDAP Bundler::URI SCHEMA (described in RFC2255).
- #--
- # ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]]
- #++
- class LDAP < Generic
-
- # A Default port of 389 for Bundler::URI::LDAP.
- DEFAULT_PORT = 389
-
- # An Array of the available components for Bundler::URI::LDAP.
- COMPONENT = [
- :scheme,
- :host, :port,
- :dn,
- :attributes,
- :scope,
- :filter,
- :extensions,
- ].freeze
-
- # Scopes available for the starting point.
- #
- # * SCOPE_BASE - the Base DN
- # * SCOPE_ONE - one level under the Base DN, not including the base DN and
- # not including any entries under this
- # * SCOPE_SUB - subtrees, all entries at all levels
- #
- SCOPE = [
- SCOPE_ONE = 'one',
- SCOPE_SUB = 'sub',
- SCOPE_BASE = 'base',
- ].freeze
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::LDAP object from components, with syntax checking.
- #
- # The components accepted are host, port, dn, attributes,
- # scope, filter, and extensions.
- #
- # The components should be provided either as an Array, or as a Hash
- # with keys formed by preceding the component names with a colon.
- #
- # If an Array is used, the components must be passed in the
- # order <code>[host, port, dn, attributes, scope, filter, extensions]</code>.
- #
- # Example:
- #
- # uri = Bundler::URI::LDAP.build({:host => 'ldap.example.com',
- # :dn => '/dc=example'})
- #
- # uri = Bundler::URI::LDAP.build(["ldap.example.com", nil,
- # "/dc=example;dc=com", "query", nil, nil, nil])
- #
- def self.build(args)
- tmp = Util::make_components_hash(self, args)
-
- if tmp[:dn]
- tmp[:path] = tmp[:dn]
- end
-
- query = []
- [:extensions, :filter, :scope, :attributes].collect do |x|
- next if !tmp[x] && query.size == 0
- query.unshift(tmp[x])
- end
-
- tmp[:query] = query.join('?')
-
- return super(tmp)
- end
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::LDAP object from generic Bundler::URI components as per
- # RFC 2396. No LDAP-specific syntax checking is performed.
- #
- # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
- # +opaque+, +query+, and +fragment+, in that order.
- #
- # Example:
- #
- # uri = Bundler::URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil,
- # "/dc=example;dc=com", nil, "query", nil)
- #
- # See also Bundler::URI::Generic.new.
- #
- def initialize(*arg)
- super(*arg)
-
- if @fragment
- raise InvalidURIError, 'bad LDAP URL'
- end
-
- parse_dn
- parse_query
- end
-
- # Private method to cleanup +dn+ from using the +path+ component attribute.
- def parse_dn
- @dn = @path[1..-1]
- end
- private :parse_dn
-
- # Private method to cleanup +attributes+, +scope+, +filter+, and +extensions+
- # from using the +query+ component attribute.
- def parse_query
- @attributes = nil
- @scope = nil
- @filter = nil
- @extensions = nil
-
- if @query
- attrs, scope, filter, extensions = @query.split('?')
-
- @attributes = attrs if attrs && attrs.size > 0
- @scope = scope if scope && scope.size > 0
- @filter = filter if filter && filter.size > 0
- @extensions = extensions if extensions && extensions.size > 0
- end
- end
- private :parse_query
-
- # Private method to assemble +query+ from +attributes+, +scope+, +filter+, and +extensions+.
- def build_path_query
- @path = '/' + @dn
-
- query = []
- [@extensions, @filter, @scope, @attributes].each do |x|
- next if !x && query.size == 0
- query.unshift(x)
- end
- @query = query.join('?')
- end
- private :build_path_query
-
- # Returns dn.
- def dn
- @dn
- end
-
- # Private setter for dn +val+.
- def set_dn(val)
- @dn = val
- build_path_query
- @dn
- end
- protected :set_dn
-
- # Setter for dn +val+.
- def dn=(val)
- set_dn(val)
- val
- end
-
- # Returns attributes.
- def attributes
- @attributes
- end
-
- # Private setter for attributes +val+.
- def set_attributes(val)
- @attributes = val
- build_path_query
- @attributes
- end
- protected :set_attributes
-
- # Setter for attributes +val+.
- def attributes=(val)
- set_attributes(val)
- val
- end
-
- # Returns scope.
- def scope
- @scope
- end
-
- # Private setter for scope +val+.
- def set_scope(val)
- @scope = val
- build_path_query
- @scope
- end
- protected :set_scope
-
- # Setter for scope +val+.
- def scope=(val)
- set_scope(val)
- val
- end
-
- # Returns filter.
- def filter
- @filter
- end
-
- # Private setter for filter +val+.
- def set_filter(val)
- @filter = val
- build_path_query
- @filter
- end
- protected :set_filter
-
- # Setter for filter +val+.
- def filter=(val)
- set_filter(val)
- val
- end
-
- # Returns extensions.
- def extensions
- @extensions
- end
-
- # Private setter for extensions +val+.
- def set_extensions(val)
- @extensions = val
- build_path_query
- @extensions
- end
- protected :set_extensions
-
- # Setter for extensions +val+.
- def extensions=(val)
- set_extensions(val)
- val
- end
-
- # Checks if Bundler::URI has a path.
- # For Bundler::URI::LDAP this will return +false+.
- def hierarchical?
- false
- end
- end
-
- @@schemes['LDAP'] = LDAP
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/ldaps.rb b/lib/bundler/vendor/uri/lib/uri/ldaps.rb
deleted file mode 100644
index 0af35bb16b..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/ldaps.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: false
-# = uri/ldap.rb
-#
-# License:: You can redistribute it and/or modify it under the same term as Ruby.
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'ldap'
-
-module Bundler::URI
-
- # The default port for LDAPS URIs is 636, and the scheme is 'ldaps:' rather
- # than 'ldap:'. Other than that, LDAPS URIs are identical to LDAP URIs;
- # see Bundler::URI::LDAP.
- class LDAPS < LDAP
- # A Default port of 636 for Bundler::URI::LDAPS
- DEFAULT_PORT = 636
- end
- @@schemes['LDAPS'] = LDAPS
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/mailto.rb b/lib/bundler/vendor/uri/lib/uri/mailto.rb
deleted file mode 100644
index 5b2a4765c8..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/mailto.rb
+++ /dev/null
@@ -1,294 +0,0 @@
-# frozen_string_literal: false
-# = uri/mailto.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# License:: You can redistribute it and/or modify it under the same term as Ruby.
-# Revision:: $Id$
-#
-# See Bundler::URI for general documentation
-#
-
-require_relative 'generic'
-
-module Bundler::URI
-
- #
- # RFC6068, the mailto URL scheme.
- #
- class MailTo < Generic
- include REGEXP
-
- # A Default port of nil for Bundler::URI::MailTo.
- DEFAULT_PORT = nil
-
- # An Array of the available components for Bundler::URI::MailTo.
- COMPONENT = [ :scheme, :to, :headers ].freeze
-
- # :stopdoc:
- # "hname" and "hvalue" are encodings of an RFC 822 header name and
- # value, respectively. As with "to", all URL reserved characters must
- # be encoded.
- #
- # "#mailbox" is as specified in RFC 822 [RFC822]. This means that it
- # consists of zero or more comma-separated mail addresses, possibly
- # including "phrase" and "comment" components. Note that all URL
- # reserved characters in "to" must be encoded: in particular,
- # parentheses, commas, and the percent sign ("%"), which commonly occur
- # in the "mailbox" syntax.
- #
- # Within mailto URLs, the characters "?", "=", "&" are reserved.
-
- # ; RFC 6068
- # hfields = "?" hfield *( "&" hfield )
- # hfield = hfname "=" hfvalue
- # hfname = *qchar
- # hfvalue = *qchar
- # qchar = unreserved / pct-encoded / some-delims
- # some-delims = "!" / "$" / "'" / "(" / ")" / "*"
- # / "+" / "," / ";" / ":" / "@"
- #
- # ; RFC3986
- # unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
- # pct-encoded = "%" HEXDIG HEXDIG
- HEADER_REGEXP = /\A(?<hfield>(?:%\h\h|[!$'-.0-;@-Z_a-z~])*=(?:%\h\h|[!$'-.0-;@-Z_a-z~])*)(?:&\g<hfield>)*\z/
- # practical regexp for email address
- # https://html.spec.whatwg.org/multipage/input.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/
- # :startdoc:
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::MailTo object from components, with syntax checking.
- #
- # Components can be provided as an Array or Hash. If an Array is used,
- # the components must be supplied as <code>[to, headers]</code>.
- #
- # If a Hash is used, the keys are the component names preceded by colons.
- #
- # The headers can be supplied as a pre-encoded string, such as
- # <code>"subject=subscribe&cc=address"</code>, or as an Array of Arrays
- # like <code>[['subject', 'subscribe'], ['cc', 'address']]</code>.
- #
- # Examples:
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # m1 = Bundler::URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
- # m1.to_s # => "mailto:joe@example.com?subject=Ruby"
- #
- # m2 = Bundler::URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
- # m2.to_s # => "mailto:john@example.com?Subject=Ruby&Cc=jack@example.com"
- #
- # m3 = Bundler::URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
- # m3.to_s # => "mailto:listman@example.com?subject=subscribe"
- #
- def self.build(args)
- tmp = Util.make_components_hash(self, args)
-
- case tmp[:to]
- when Array
- tmp[:opaque] = tmp[:to].join(',')
- when String
- tmp[:opaque] = tmp[:to].dup
- else
- tmp[:opaque] = ''
- end
-
- if tmp[:headers]
- query =
- case tmp[:headers]
- when Array
- tmp[:headers].collect { |x|
- if x.kind_of?(Array)
- x[0] + '=' + x[1..-1].join
- else
- x.to_s
- end
- }.join('&')
- when Hash
- tmp[:headers].collect { |h,v|
- h + '=' + v
- }.join('&')
- else
- tmp[:headers].to_s
- end
- unless query.empty?
- tmp[:opaque] << '?' << query
- end
- end
-
- super(tmp)
- end
-
- #
- # == Description
- #
- # Creates a new Bundler::URI::MailTo object from generic URL components with
- # no syntax checking.
- #
- # This method is usually called from Bundler::URI::parse, which checks
- # the validity of each component.
- #
- def initialize(*arg)
- super(*arg)
-
- @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
- unless /\A(?:[^@,;]+@[^@,;]+(?:\z|[,;]))*\z/ =~ to
- raise InvalidComponentError,
- "unrecognised opaque part for mailtoURL: #{@opaque}"
- end
-
- if arg[10] # arg_check
- self.to = to
- self.headers = header
- else
- set_to(to)
- set_headers(header)
- end
- end
-
- # The primary e-mail address of the URL, as a String.
- attr_reader :to
-
- # E-mail headers set by the URL, as an Array of Arrays.
- attr_reader :headers
-
- # Checks the to +v+ component.
- def check_to(v)
- return true unless v
- return true if v.size == 0
-
- v.split(/[,;]/).each do |addr|
- # check url safety as path-rootless
- if /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*\z/ !~ addr
- raise InvalidComponentError,
- "an address in 'to' is invalid as Bundler::URI #{addr.dump}"
- end
-
- # check addr-spec
- # don't s/\+/ /g
- addr.gsub!(/%\h\h/, Bundler::URI::TBLDECWWWCOMP_)
- if EMAIL_REGEXP !~ addr
- raise InvalidComponentError,
- "an address in 'to' is invalid as uri-escaped addr-spec #{addr.dump}"
- end
- end
-
- true
- end
- private :check_to
-
- # Private setter for to +v+.
- def set_to(v)
- @to = v
- end
- protected :set_to
-
- # Setter for to +v+.
- def to=(v)
- check_to(v)
- set_to(v)
- v
- end
-
- # Checks the headers +v+ component against either
- # * HEADER_REGEXP
- def check_headers(v)
- return true unless v
- return true if v.size == 0
- if HEADER_REGEXP !~ v
- raise InvalidComponentError,
- "bad component(expected opaque component): #{v}"
- end
-
- true
- end
- private :check_headers
-
- # Private setter for headers +v+.
- def set_headers(v)
- @headers = []
- if v
- v.split('&').each do |x|
- @headers << x.split(/=/, 2)
- end
- end
- end
- protected :set_headers
-
- # Setter for headers +v+.
- def headers=(v)
- check_headers(v)
- set_headers(v)
- v
- end
-
- # Constructs String from Bundler::URI.
- def to_s
- @scheme + ':' +
- if @to
- @to
- else
- ''
- end +
- if @headers.size > 0
- '?' + @headers.collect{|x| x.join('=')}.join('&')
- else
- ''
- end +
- if @fragment
- '#' + @fragment
- else
- ''
- end
- end
-
- # Returns the RFC822 e-mail text equivalent of the URL, as a String.
- #
- # Example:
- #
- # require 'bundler/vendor/uri/lib/uri'
- #
- # uri = Bundler::URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr")
- # uri.to_mailtext
- # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
- #
- def to_mailtext
- to = Bundler::URI.decode_www_form_component(@to)
- head = ''
- body = ''
- @headers.each do |x|
- case x[0]
- when 'body'
- body = Bundler::URI.decode_www_form_component(x[1])
- when 'to'
- to << ', ' + Bundler::URI.decode_www_form_component(x[1])
- else
- head << Bundler::URI.decode_www_form_component(x[0]).capitalize + ': ' +
- Bundler::URI.decode_www_form_component(x[1]) + "\n"
- end
- end
-
- "To: #{to}
-#{head}
-#{body}
-"
- end
- alias to_rfc822text to_mailtext
- end
-
- @@schemes['MAILTO'] = MailTo
-end
diff --git a/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb b/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb
deleted file mode 100644
index a0d62ede64..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb
+++ /dev/null
@@ -1,546 +0,0 @@
-# frozen_string_literal: false
-#--
-# = uri/common.rb
-#
-# Author:: Akira Yamada <akira@ruby-lang.org>
-# Revision:: $Id$
-# License::
-# You can redistribute it and/or modify it under the same term as Ruby.
-#
-# See Bundler::URI for general documentation
-#
-
-module Bundler::URI
- #
- # Includes Bundler::URI::REGEXP::PATTERN
- #
- module RFC2396_REGEXP
- #
- # Patterns used to parse Bundler::URI's
- #
- module PATTERN
- # :stopdoc:
-
- # RFC 2396 (Bundler::URI Generic Syntax)
- # RFC 2732 (IPv6 Literal Addresses in URL's)
- # RFC 2373 (IPv6 Addressing Architecture)
-
- # alpha = lowalpha | upalpha
- ALPHA = "a-zA-Z"
- # alphanum = alpha | digit
- ALNUM = "#{ALPHA}\\d"
-
- # hex = digit | "A" | "B" | "C" | "D" | "E" | "F" |
- # "a" | "b" | "c" | "d" | "e" | "f"
- HEX = "a-fA-F\\d"
- # escaped = "%" hex hex
- ESCAPED = "%[#{HEX}]{2}"
- # mark = "-" | "_" | "." | "!" | "~" | "*" | "'" |
- # "(" | ")"
- # unreserved = alphanum | mark
- UNRESERVED = "\\-_.!~*'()#{ALNUM}"
- # reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
- # "$" | ","
- # reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
- # "$" | "," | "[" | "]" (RFC 2732)
- RESERVED = ";/?:@&=+$,\\[\\]"
-
- # domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
- DOMLABEL = "(?:[#{ALNUM}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
- # toplabel = alpha | alpha *( alphanum | "-" ) alphanum
- TOPLABEL = "(?:[#{ALPHA}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
- # hostname = *( domainlabel "." ) toplabel [ "." ]
- HOSTNAME = "(?:#{DOMLABEL}\\.)*#{TOPLABEL}\\.?"
-
- # :startdoc:
- end # PATTERN
-
- # :startdoc:
- end # REGEXP
-
- # Class that parses String's into Bundler::URI's.
- #
- # It contains a Hash set of patterns and Regexp's that match and validate.
- #
- class RFC2396_Parser
- include RFC2396_REGEXP
-
- #
- # == Synopsis
- #
- # Bundler::URI::Parser.new([opts])
- #
- # == Args
- #
- # The constructor accepts a hash as options for parser.
- # Keys of options are pattern names of Bundler::URI components
- # and values of options are pattern strings.
- # The constructor generates set of regexps for parsing URIs.
- #
- # You can use the following keys:
- #
- # * :ESCAPED (Bundler::URI::PATTERN::ESCAPED in default)
- # * :UNRESERVED (Bundler::URI::PATTERN::UNRESERVED in default)
- # * :DOMLABEL (Bundler::URI::PATTERN::DOMLABEL in default)
- # * :TOPLABEL (Bundler::URI::PATTERN::TOPLABEL in default)
- # * :HOSTNAME (Bundler::URI::PATTERN::HOSTNAME in default)
- #
- # == Examples
- #
- # p = Bundler::URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
- # u = p.parse("http://example.jp/%uABCD") #=> #<Bundler::URI::HTTP http://example.jp/%uABCD>
- # Bundler::URI.parse(u.to_s) #=> raises Bundler::URI::InvalidURIError
- #
- # s = "http://example.com/ABCD"
- # u1 = p.parse(s) #=> #<Bundler::URI::HTTP http://example.com/ABCD>
- # u2 = Bundler::URI.parse(s) #=> #<Bundler::URI::HTTP http://example.com/ABCD>
- # u1 == u2 #=> true
- # u1.eql?(u2) #=> false
- #
- def initialize(opts = {})
- @pattern = initialize_pattern(opts)
- @pattern.each_value(&:freeze)
- @pattern.freeze
-
- @regexp = initialize_regexp(@pattern)
- @regexp.each_value(&:freeze)
- @regexp.freeze
- end
-
- # The Hash of patterns.
- #
- # See also Bundler::URI::Parser.initialize_pattern.
- attr_reader :pattern
-
- # The Hash of Regexp.
- #
- # See also Bundler::URI::Parser.initialize_regexp.
- attr_reader :regexp
-
- # Returns a split Bundler::URI against regexp[:ABS_URI].
- def split(uri)
- case uri
- when ''
- # null uri
-
- when @regexp[:ABS_URI]
- scheme, opaque, userinfo, host, port,
- registry, path, query, fragment = $~[1..-1]
-
- # Bundler::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
-
- # absoluteURI = scheme ":" ( hier_part | opaque_part )
- # hier_part = ( net_path | abs_path ) [ "?" query ]
- # opaque_part = uric_no_slash *uric
-
- # abs_path = "/" path_segments
- # net_path = "//" authority [ abs_path ]
-
- # authority = server | reg_name
- # server = [ [ userinfo "@" ] hostport ]
-
- if !scheme
- raise InvalidURIError,
- "bad Bundler::URI(absolute but no scheme): #{uri}"
- end
- if !opaque && (!path && (!host && !registry))
- raise InvalidURIError,
- "bad Bundler::URI(absolute but no path): #{uri}"
- end
-
- when @regexp[:REL_URI]
- scheme = nil
- opaque = nil
-
- userinfo, host, port, registry,
- rel_segment, abs_path, query, fragment = $~[1..-1]
- if rel_segment && abs_path
- path = rel_segment + abs_path
- elsif rel_segment
- path = rel_segment
- elsif abs_path
- path = abs_path
- end
-
- # Bundler::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
-
- # relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
-
- # net_path = "//" authority [ abs_path ]
- # abs_path = "/" path_segments
- # rel_path = rel_segment [ abs_path ]
-
- # authority = server | reg_name
- # server = [ [ userinfo "@" ] hostport ]
-
- else
- raise InvalidURIError, "bad Bundler::URI(is not Bundler::URI?): #{uri}"
- end
-
- path = '' if !path && !opaque # (see RFC2396 Section 5.2)
- ret = [
- scheme,
- userinfo, host, port, # X
- registry, # X
- path, # Y
- opaque, # Y
- query,
- fragment
- ]
- return ret
- end
-
- #
- # == Args
- #
- # +uri+::
- # String
- #
- # == Description
- #
- # Parses +uri+ and constructs either matching Bundler::URI scheme object
- # (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or Bundler::URI::Generic.
- #
- # == Usage
- #
- # p = Bundler::URI::Parser.new
- # p.parse("ldap://ldap.example.com/dc=example?user=john")
- # #=> #<Bundler::URI::LDAP ldap://ldap.example.com/dc=example?user=john>
- #
- def parse(uri)
- scheme, userinfo, host, port,
- registry, path, opaque, query, fragment = self.split(uri)
-
- if scheme && Bundler::URI.scheme_list.include?(scheme.upcase)
- Bundler::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,
- fragment, self)
- end
- end
-
-
- #
- # == Args
- #
- # +uris+::
- # an Array of Strings
- #
- # == Description
- #
- # Attempts to parse and merge a set of URIs.
- #
- def join(*uris)
- uris[0] = convert_to_uri(uris[0])
- uris.inject :merge
- end
-
- #
- # :call-seq:
- # extract( str )
- # extract( str, schemes )
- # extract( str, schemes ) {|item| block }
- #
- # == Args
- #
- # +str+::
- # String to search
- # +schemes+::
- # Patterns to apply to +str+
- #
- # == Description
- #
- # Attempts to parse and merge a set of URIs.
- # If no +block+ given, then returns the result,
- # else it calls +block+ for each element in result.
- #
- # See also Bundler::URI::Parser.make_regexp.
- #
- def extract(str, schemes = nil)
- if block_given?
- str.scan(make_regexp(schemes)) { yield $& }
- nil
- else
- result = []
- str.scan(make_regexp(schemes)) { result.push $& }
- result
- end
- end
-
- # Returns Regexp that is default self.regexp[:ABS_URI_REF],
- # unless +schemes+ is provided. Then it is a Regexp.union with self.pattern[:X_ABS_URI].
- def make_regexp(schemes = nil)
- unless schemes
- @regexp[:ABS_URI_REF]
- else
- /(?=#{Regexp.union(*schemes)}:)#{@pattern[:X_ABS_URI]}/x
- end
- end
-
- #
- # :call-seq:
- # escape( str )
- # escape( str, unsafe )
- #
- # == Args
- #
- # +str+::
- # String to make safe
- # +unsafe+::
- # Regexp to apply. Defaults to self.regexp[:UNSAFE]
- #
- # == Description
- #
- # Constructs a safe String from +str+, removing unsafe characters,
- # replacing them with codes.
- #
- def escape(str, unsafe = @regexp[:UNSAFE])
- unless unsafe.kind_of?(Regexp)
- # perhaps unsafe is String object
- unsafe = Regexp.new("[#{Regexp.quote(unsafe)}]", false)
- end
- str.gsub(unsafe) do
- us = $&
- tmp = ''
- us.each_byte do |uc|
- tmp << sprintf('%%%02X', uc)
- end
- tmp
- end.force_encoding(Encoding::US_ASCII)
- end
-
- #
- # :call-seq:
- # unescape( str )
- # unescape( str, escaped )
- #
- # == Args
- #
- # +str+::
- # String to remove escapes from
- # +escaped+::
- # Regexp to apply. Defaults to self.regexp[:ESCAPED]
- #
- # == Description
- #
- # Removes escapes from +str+.
- #
- def unescape(str, escaped = @regexp[:ESCAPED])
- enc = str.encoding
- enc = Encoding::UTF_8 if enc == Encoding::US_ASCII
- str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
- end
-
- @@to_s = Kernel.instance_method(:to_s)
- def inspect
- @@to_s.bind_call(self)
- end
-
- private
-
- # Constructs the default Hash of patterns.
- def initialize_pattern(opts = {})
- ret = {}
- ret[:ESCAPED] = escaped = (opts.delete(:ESCAPED) || PATTERN::ESCAPED)
- ret[:UNRESERVED] = unreserved = opts.delete(:UNRESERVED) || PATTERN::UNRESERVED
- ret[:RESERVED] = reserved = opts.delete(:RESERVED) || PATTERN::RESERVED
- ret[:DOMLABEL] = opts.delete(:DOMLABEL) || PATTERN::DOMLABEL
- ret[:TOPLABEL] = opts.delete(:TOPLABEL) || PATTERN::TOPLABEL
- ret[:HOSTNAME] = hostname = opts.delete(:HOSTNAME)
-
- # RFC 2396 (Bundler::URI Generic Syntax)
- # RFC 2732 (IPv6 Literal Addresses in URL's)
- # RFC 2373 (IPv6 Addressing Architecture)
-
- # uric = reserved | unreserved | escaped
- ret[:URIC] = uric = "(?:[#{unreserved}#{reserved}]|#{escaped})"
- # uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
- # "&" | "=" | "+" | "$" | ","
- ret[:URIC_NO_SLASH] = uric_no_slash = "(?:[#{unreserved};?:@&=+$,]|#{escaped})"
- # query = *uric
- ret[:QUERY] = query = "#{uric}*"
- # fragment = *uric
- ret[:FRAGMENT] = fragment = "#{uric}*"
-
- # hostname = *( domainlabel "." ) toplabel [ "." ]
- # reg-name = *( unreserved / pct-encoded / sub-delims ) # RFC3986
- unless hostname
- ret[:HOSTNAME] = hostname = "(?:[a-zA-Z0-9\\-.]|%\\h\\h)+"
- end
-
- # RFC 2373, APPENDIX B:
- # IPv6address = hexpart [ ":" IPv4address ]
- # IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
- # hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ]
- # hexseq = hex4 *( ":" hex4)
- # hex4 = 1*4HEXDIG
- #
- # XXX: This definition has a flaw. "::" + IPv4address must be
- # allowed too. Here is a replacement.
- #
- # IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
- ret[:IPV4ADDR] = ipv4addr = "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
- # hex4 = 1*4HEXDIG
- hex4 = "[#{PATTERN::HEX}]{1,4}"
- # lastpart = hex4 | IPv4address
- lastpart = "(?:#{hex4}|#{ipv4addr})"
- # hexseq1 = *( hex4 ":" ) hex4
- hexseq1 = "(?:#{hex4}:)*#{hex4}"
- # hexseq2 = *( hex4 ":" ) lastpart
- hexseq2 = "(?:#{hex4}:)*#{lastpart}"
- # IPv6address = hexseq2 | [ hexseq1 ] "::" [ hexseq2 ]
- ret[:IPV6ADDR] = ipv6addr = "(?:#{hexseq2}|(?:#{hexseq1})?::(?:#{hexseq2})?)"
-
- # IPv6prefix = ( hexseq1 | [ hexseq1 ] "::" [ hexseq1 ] ) "/" 1*2DIGIT
- # unused
-
- # ipv6reference = "[" IPv6address "]" (RFC 2732)
- ret[:IPV6REF] = ipv6ref = "\\[#{ipv6addr}\\]"
-
- # host = hostname | IPv4address
- # host = hostname | IPv4address | IPv6reference (RFC 2732)
- ret[:HOST] = host = "(?:#{hostname}|#{ipv4addr}|#{ipv6ref})"
- # port = *digit
- ret[:PORT] = port = '\d*'
- # hostport = host [ ":" port ]
- ret[:HOSTPORT] = hostport = "#{host}(?::#{port})?"
-
- # userinfo = *( unreserved | escaped |
- # ";" | ":" | "&" | "=" | "+" | "$" | "," )
- ret[:USERINFO] = userinfo = "(?:[#{unreserved};:&=+$,]|#{escaped})*"
-
- # pchar = unreserved | escaped |
- # ":" | "@" | "&" | "=" | "+" | "$" | ","
- pchar = "(?:[#{unreserved}:@&=+$,]|#{escaped})"
- # param = *pchar
- param = "#{pchar}*"
- # segment = *pchar *( ";" param )
- segment = "#{pchar}*(?:;#{param})*"
- # path_segments = segment *( "/" segment )
- ret[:PATH_SEGMENTS] = path_segments = "#{segment}(?:/#{segment})*"
-
- # server = [ [ userinfo "@" ] hostport ]
- server = "(?:#{userinfo}@)?#{hostport}"
- # reg_name = 1*( unreserved | escaped | "$" | "," |
- # ";" | ":" | "@" | "&" | "=" | "+" )
- ret[:REG_NAME] = reg_name = "(?:[#{unreserved}$,;:@&=+]|#{escaped})+"
- # authority = server | reg_name
- authority = "(?:#{server}|#{reg_name})"
-
- # rel_segment = 1*( unreserved | escaped |
- # ";" | "@" | "&" | "=" | "+" | "$" | "," )
- ret[:REL_SEGMENT] = rel_segment = "(?:[#{unreserved};@&=+$,]|#{escaped})+"
-
- # scheme = alpha *( alpha | digit | "+" | "-" | "." )
- ret[:SCHEME] = scheme = "[#{PATTERN::ALPHA}][\\-+.#{PATTERN::ALPHA}\\d]*"
-
- # abs_path = "/" path_segments
- ret[:ABS_PATH] = abs_path = "/#{path_segments}"
- # rel_path = rel_segment [ abs_path ]
- ret[:REL_PATH] = rel_path = "#{rel_segment}(?:#{abs_path})?"
- # net_path = "//" authority [ abs_path ]
- ret[:NET_PATH] = net_path = "//#{authority}(?:#{abs_path})?"
-
- # hier_part = ( net_path | abs_path ) [ "?" query ]
- ret[:HIER_PART] = hier_part = "(?:#{net_path}|#{abs_path})(?:\\?(?:#{query}))?"
- # opaque_part = uric_no_slash *uric
- ret[:OPAQUE_PART] = opaque_part = "#{uric_no_slash}#{uric}*"
-
- # absoluteURI = scheme ":" ( hier_part | opaque_part )
- ret[:ABS_URI] = abs_uri = "#{scheme}:(?:#{hier_part}|#{opaque_part})"
- # relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
- ret[:REL_URI] = rel_uri = "(?:#{net_path}|#{abs_path}|#{rel_path})(?:\\?#{query})?"
-
- # Bundler::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
- ret[:URI_REF] = "(?:#{abs_uri}|#{rel_uri})?(?:##{fragment})?"
-
- ret[:X_ABS_URI] = "
- (#{scheme}): (?# 1: scheme)
- (?:
- (#{opaque_part}) (?# 2: opaque)
- |
- (?:(?:
- //(?:
- (?:(?:(#{userinfo})@)? (?# 3: userinfo)
- (?:(#{host})(?::(\\d*))?))? (?# 4: host, 5: port)
- |
- (#{reg_name}) (?# 6: registry)
- )
- |
- (?!//)) (?# XXX: '//' is the mark for hostport)
- (#{abs_path})? (?# 7: path)
- )(?:\\?(#{query}))? (?# 8: query)
- )
- (?:\\#(#{fragment}))? (?# 9: fragment)
- "
-
- ret[:X_REL_URI] = "
- (?:
- (?:
- //
- (?:
- (?:(#{userinfo})@)? (?# 1: userinfo)
- (#{host})?(?::(\\d*))? (?# 2: host, 3: port)
- |
- (#{reg_name}) (?# 4: registry)
- )
- )
- |
- (#{rel_segment}) (?# 5: rel_segment)
- )?
- (#{abs_path})? (?# 6: abs_path)
- (?:\\?(#{query}))? (?# 7: query)
- (?:\\#(#{fragment}))? (?# 8: fragment)
- "
-
- ret
- end
-
- # Constructs the default Hash of Regexp's.
- def initialize_regexp(pattern)
- ret = {}
-
- # for Bundler::URI::split
- ret[:ABS_URI] = Regexp.new('\A\s*' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
- ret[:REL_URI] = Regexp.new('\A\s*' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
-
- # for Bundler::URI::extract
- ret[:URI_REF] = Regexp.new(pattern[:URI_REF])
- ret[:ABS_URI_REF] = Regexp.new(pattern[:X_ABS_URI], Regexp::EXTENDED)
- ret[:REL_URI_REF] = Regexp.new(pattern[:X_REL_URI], Regexp::EXTENDED)
-
- # for Bundler::URI::escape/unescape
- ret[:ESCAPED] = Regexp.new(pattern[:ESCAPED])
- ret[:UNSAFE] = Regexp.new("[^#{pattern[:UNRESERVED]}#{pattern[:RESERVED]}]")
-
- # for Generic#initialize
- ret[:SCHEME] = Regexp.new("\\A#{pattern[:SCHEME]}\\z")
- ret[:USERINFO] = Regexp.new("\\A#{pattern[:USERINFO]}\\z")
- ret[:HOST] = Regexp.new("\\A#{pattern[:HOST]}\\z")
- ret[:PORT] = Regexp.new("\\A#{pattern[:PORT]}\\z")
- ret[:OPAQUE] = Regexp.new("\\A#{pattern[:OPAQUE_PART]}\\z")
- ret[:REGISTRY] = Regexp.new("\\A#{pattern[:REG_NAME]}\\z")
- ret[:ABS_PATH] = Regexp.new("\\A#{pattern[:ABS_PATH]}\\z")
- ret[:REL_PATH] = Regexp.new("\\A#{pattern[:REL_PATH]}\\z")
- ret[:QUERY] = Regexp.new("\\A#{pattern[:QUERY]}\\z")
- ret[:FRAGMENT] = Regexp.new("\\A#{pattern[:FRAGMENT]}\\z")
-
- ret
- end
-
- def convert_to_uri(uri)
- if uri.is_a?(Bundler::URI::Generic)
- uri
- elsif uri = String.try_convert(uri)
- parse(uri)
- else
- raise ArgumentError,
- "bad argument (expected Bundler::URI object or Bundler::URI string)"
- end
- end
-
- end # class Parser
-end # module Bundler::URI
diff --git a/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb b/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb
deleted file mode 100644
index 07ef4391c0..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# frozen_string_literal: false
-module Bundler::URI
- class RFC3986_Parser # :nodoc:
- # Bundler::URI defined in RFC3986
- # this regexp is modified not to host is not empty string
- RFC3986_URI = /\A(?<Bundler::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
-
- def split(uri) #:nodoc:
- begin
- uri = uri.to_str
- rescue NoMethodError
- raise InvalidURIError, "bad Bundler::URI(is not Bundler::URI?): #{uri.inspect}"
- end
- uri.ascii_only? or
- raise InvalidURIError, "Bundler::URI must be ascii only #{uri.dump}"
- 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]
- ]
- 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]
- ]
- 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]
- ]
- else
- raise InvalidURIError, "bad Bundler::URI(is not Bundler::URI?): #{uri.inspect}"
- end
- end
-
- def parse(uri) # :nodoc:
- scheme, userinfo, host, port,
- registry, path, opaque, query, fragment = self.split(uri)
- scheme_list = Bundler::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)
- else
- Generic.new(scheme, userinfo, host, port,
- registry, path, opaque, query,
- fragment, self)
- end
- end
-
-
- def join(*uris) # :nodoc:
- uris[0] = convert_to_uri(uris[0])
- uris.inject :merge
- end
-
- @@to_s = Kernel.instance_method(:to_s)
- def inspect
- @@to_s.bind_call(self)
- end
-
- private
-
- def default_regexp # :nodoc:
- {
- SCHEME: /\A[A-Za-z][A-Za-z0-9+\-.]*\z/,
- USERINFO: /\A(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*\z/,
- HOST: /\A(?:(?<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{,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~])*))\z/,
- ABS_PATH: /\A\/(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*(?:\/(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*)*\z/,
- REL_PATH: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+(?:\/(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*)*\z/,
- QUERY: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*\z/,
- FRAGMENT: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*\z/,
- OPAQUE: /\A(?:[^\/].*)?\z/,
- PORT: /\A[\x09\x0a\x0c\x0d ]*\d*[\x09\x0a\x0c\x0d ]*\z/,
- }
- end
-
- def convert_to_uri(uri)
- if uri.is_a?(Bundler::URI::Generic)
- uri
- elsif uri = String.try_convert(uri)
- parse(uri)
- else
- raise ArgumentError,
- "bad argument (expected Bundler::URI object or Bundler::URI string)"
- end
- end
-
- end # class Parser
-end # module Bundler::URI
diff --git a/lib/bundler/vendor/uri/lib/uri/version.rb b/lib/bundler/vendor/uri/lib/uri/version.rb
deleted file mode 100644
index 56177ef194..0000000000
--- a/lib/bundler/vendor/uri/lib/uri/version.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Bundler::URI
- # :stopdoc:
- VERSION_CODE = '001000'.freeze
- VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
- # :startdoc:
-end
diff --git a/lib/bundler/vendored_fileutils.rb b/lib/bundler/vendored_fileutils.rb
deleted file mode 100644
index 1be1138ce2..0000000000
--- a/lib/bundler/vendored_fileutils.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler; end
-require_relative "vendor/fileutils/lib/fileutils"
diff --git a/lib/bundler/vendored_molinillo.rb b/lib/bundler/vendored_molinillo.rb
deleted file mode 100644
index d1976f5cb4..0000000000
--- a/lib/bundler/vendored_molinillo.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler; end
-require_relative "vendor/molinillo/lib/molinillo"
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb
deleted file mode 100644
index 045a761dac..0000000000
--- a/lib/bundler/vendored_persistent.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-# We forcibly require OpenSSL, because net/http/persistent will only autoload
-# it. On some Rubies, autoload fails but explicit require succeeds.
-begin
- require "openssl"
-rescue LoadError
- # some Ruby builds don't have OpenSSL
-end
-module Bundler
- module Persistent
- module Net
- module HTTP
- end
- end
- end
-end
-require_relative "vendor/net-http-persistent/lib/net/http/persistent"
-
-module Bundler
- class PersistentHTTP < Persistent::Net::HTTP::Persistent
- def connection_for(uri)
- super(uri) do |connection|
- result = yield connection
- warn_old_tls_version_rubygems_connection(uri, connection)
- result
- end
- end
-
- def warn_old_tls_version_rubygems_connection(uri, connection)
- return unless connection.http.use_ssl?
- return unless (uri.host || "").end_with?("rubygems.org")
-
- socket = connection.instance_variable_get(:@socket)
- return unless socket
- socket_io = socket.io
- return unless socket_io.respond_to?(:ssl_version)
- ssl_version = socket_io.ssl_version
-
- case ssl_version
- when /TLSv([\d\.]+)/
- version = Gem::Version.new($1)
- if version < Gem::Version.new("1.2")
- Bundler.ui.warn \
- "Warning: Your Ruby version is compiled against a copy of OpenSSL that is very old. " \
- "Starting in January 2018, RubyGems.org will refuse connection requests from these " \
- "very old versions of OpenSSL. If you will need to continue installing gems after " \
- "January 2018, please follow this guide to upgrade: http://ruby.to/tls-outdated.",
- :wrap => true
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vendored_thor.rb b/lib/bundler/vendored_thor.rb
deleted file mode 100644
index 0666cfc9b9..0000000000
--- a/lib/bundler/vendored_thor.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- def self.require_thor_actions
- require_relative "vendor/thor/lib/thor/actions"
- end
-end
-require_relative "vendor/thor/lib/thor"
diff --git a/lib/bundler/vendored_uri.rb b/lib/bundler/vendored_uri.rb
deleted file mode 100644
index 905e8158e8..0000000000
--- a/lib/bundler/vendored_uri.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler; end
-require_relative "vendor/uri/lib/uri"
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
deleted file mode 100644
index b63e39b8d2..0000000000
--- a/lib/bundler/version.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: false
-
-module Bundler
- VERSION = "2.1.2".freeze
-
- def self.bundler_major_version
- @bundler_major_version ||= VERSION.split(".").first.to_i
- end
-end
diff --git a/lib/bundler/version_ranges.rb b/lib/bundler/version_ranges.rb
deleted file mode 100644
index 12a956d6a0..0000000000
--- a/lib/bundler/version_ranges.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- module VersionRanges
- NEq = Struct.new(:version)
- ReqR = Struct.new(:left, :right)
- class ReqR
- Endpoint = Struct.new(:version, :inclusive) do
- def <=>(other)
- if version.equal?(INFINITY)
- return 0 if other.version.equal?(INFINITY)
- return 1
- elsif other.version.equal?(INFINITY)
- return -1
- end
-
- comp = version <=> other.version
- return comp unless comp.zero?
-
- if inclusive && !other.inclusive
- 1
- elsif !inclusive && other.inclusive
- -1
- else
- 0
- end
- end
- end
-
- def to_s
- "#{left.inclusive ? "[" : "("}#{left.version}, #{right.version}#{right.inclusive ? "]" : ")"}"
- end
- INFINITY = begin
- inf = Object.new
- def inf.to_s
- "∞"
- end
- def inf.<=>(other)
- return 0 if other.equal?(self)
- 1
- end
- inf.freeze
- end
- ZERO = Gem::Version.new("0.a")
-
- def cover?(v)
- return false if left.inclusive && left.version > v
- return false if !left.inclusive && left.version >= v
-
- if right.version != INFINITY
- return false if right.inclusive && right.version < v
- return false if !right.inclusive && right.version <= v
- end
-
- true
- end
-
- def empty?
- left.version == right.version && !(left.inclusive && right.inclusive)
- end
-
- def single?
- left.version == right.version
- end
-
- def <=>(other)
- return -1 if other.equal?(INFINITY)
-
- comp = left <=> other.left
- return comp unless comp.zero?
-
- right <=> other.right
- end
-
- UNIVERSAL = ReqR.new(ReqR::Endpoint.new(Gem::Version.new("0.a"), true), ReqR::Endpoint.new(ReqR::INFINITY, false)).freeze
- end
-
- def self.for_many(requirements)
- requirements = requirements.map(&:requirements).flatten(1).map {|r| r.join(" ") }
- requirements << ">= 0.a" if requirements.empty?
- requirement = Gem::Requirement.new(requirements)
- self.for(requirement)
- end
-
- def self.for(requirement)
- ranges = requirement.requirements.map do |op, v|
- case op
- when "=" then ReqR.new(ReqR::Endpoint.new(v, true), ReqR::Endpoint.new(v, true))
- when "!=" then NEq.new(v)
- when ">=" then ReqR.new(ReqR::Endpoint.new(v, true), ReqR::Endpoint.new(ReqR::INFINITY, false))
- when ">" then ReqR.new(ReqR::Endpoint.new(v, false), ReqR::Endpoint.new(ReqR::INFINITY, false))
- when "<" then ReqR.new(ReqR::Endpoint.new(ReqR::ZERO, true), ReqR::Endpoint.new(v, false))
- when "<=" then ReqR.new(ReqR::Endpoint.new(ReqR::ZERO, true), ReqR::Endpoint.new(v, true))
- when "~>" then ReqR.new(ReqR::Endpoint.new(v, true), ReqR::Endpoint.new(v.bump, false))
- else raise "unknown version op #{op} in requirement #{requirement}"
- end
- end.uniq
- ranges, neqs = ranges.partition {|r| !r.is_a?(NEq) }
-
- [ranges.sort, neqs.map(&:version)]
- end
-
- def self.empty?(ranges, neqs)
- !ranges.reduce(ReqR::UNIVERSAL) do |last_range, curr_range|
- next false unless last_range
- next false if curr_range.single? && neqs.include?(curr_range.left.version)
- next curr_range if last_range.right.version == ReqR::INFINITY
- case last_range.right.version <=> curr_range.left.version
- # higher
- when 1 then next ReqR.new(curr_range.left, last_range.right)
- # equal
- when 0
- if last_range.right.inclusive && curr_range.left.inclusive && !neqs.include?(curr_range.left.version)
- ReqR.new(curr_range.left, [curr_range.right, last_range.right].max)
- end
- # lower
- when -1 then next false
- end
- end
- end
- end
-end
diff --git a/lib/bundler/vlad.rb b/lib/bundler/vlad.rb
deleted file mode 100644
index 538e8c3e74..0000000000
--- a/lib/bundler/vlad.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "shared_helpers"
-Bundler::SharedHelpers.major_deprecation 2,
- "The Bundler task for Vlad"
-
-# Vlad task for Bundler.
-#
-# Add "require 'bundler/vlad'" in your Vlad deploy.rb, and
-# include the vlad:bundle:install task in your vlad:deploy task.
-require_relative "deployment"
-
-include Rake::DSL if defined? Rake::DSL
-
-namespace :vlad do
- Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, :roles => :app)
-end
diff --git a/lib/bundler/worker.rb b/lib/bundler/worker.rb
deleted file mode 100644
index 3471654b43..0000000000
--- a/lib/bundler/worker.rb
+++ /dev/null
@@ -1,104 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Worker
- POISON = Object.new
-
- class WrappedException < StandardError
- attr_reader :exception
- def initialize(exn)
- @exception = exn
- end
- end
-
- # @return [String] the name of the worker
- attr_reader :name
-
- # Creates a worker pool of specified size
- #
- # @param size [Integer] Size of pool
- # @param name [String] name the name of the worker
- # @param func [Proc] job to run in inside the worker pool
- def initialize(size, name, func)
- @name = name
- @request_queue = Queue.new
- @response_queue = Queue.new
- @func = func
- @size = size
- @threads = nil
- SharedHelpers.trap("INT") { abort_threads }
- end
-
- # Enqueue a request to be executed in the worker pool
- #
- # @param obj [String] mostly it is name of spec that should be downloaded
- def enq(obj)
- create_threads unless @threads
- @request_queue.enq obj
- end
-
- # Retrieves results of job function being executed in worker pool
- def deq
- result = @response_queue.deq
- raise result.exception if result.is_a?(WrappedException)
- result
- end
-
- def stop
- stop_threads
- end
-
- private
-
- def process_queue(i)
- loop do
- obj = @request_queue.deq
- break if obj.equal? POISON
- @response_queue.enq apply_func(obj, i)
- end
- end
-
- def apply_func(obj, i)
- @func.call(obj, i)
- rescue Exception => e # rubocop:disable Lint/RescueException
- WrappedException.new(e)
- end
-
- # Stop the worker threads by sending a poison object down the request queue
- # so as worker threads after retrieving it, shut themselves down
- def stop_threads
- return unless @threads
- @threads.each { @request_queue.enq POISON }
- @threads.each(&:join)
- @threads = nil
- end
-
- def abort_threads
- return unless @threads
- Bundler.ui.debug("\n#{caller.join("\n")}")
- @threads.each(&:exit)
- exit 1
- end
-
- def create_threads
- creation_errors = []
-
- @threads = Array.new(@size) do |i|
- begin
- Thread.start { process_queue(i) }.tap do |thread|
- thread.name = "#{name} Worker ##{i}" if thread.respond_to?(:name=)
- end
- rescue ThreadError => e
- creation_errors << e
- nil
- end
- end.compact
-
- return if creation_errors.empty?
-
- message = "Failed to create threads for the #{name} worker: #{creation_errors.map(&:to_s).uniq.join(", ")}"
- raise ThreadCreationError, message if @threads.empty?
- Bundler.ui.info message
- end
- end
-end
diff --git a/lib/bundler/yaml_serializer.rb b/lib/bundler/yaml_serializer.rb
deleted file mode 100644
index 374b3bb5e3..0000000000
--- a/lib/bundler/yaml_serializer.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- # A stub yaml serializer that can handle only hashes and strings (as of now).
- module YAMLSerializer
- module_function
-
- def dump(hash)
- yaml = String.new("---")
- yaml << dump_hash(hash)
- end
-
- def dump_hash(hash)
- yaml = String.new("\n")
- hash.each do |k, v|
- yaml << k << ":"
- if v.is_a?(Hash)
- yaml << dump_hash(v).gsub(/^(?!$)/, " ") # indent all non-empty lines
- elsif v.is_a?(Array) # Expected to be array of strings
- yaml << "\n- " << v.map {|s| s.to_s.gsub(/\s+/, " ").inspect }.join("\n- ") << "\n"
- else
- yaml << " " << v.to_s.gsub(/\s+/, " ").inspect << "\n"
- end
- end
- yaml
- end
-
- ARRAY_REGEX = /
- ^
- (?:[ ]*-[ ]) # '- ' before array items
- (['"]?) # optional opening quote
- (.*) # value
- \1 # matching closing quote
- $
- /xo.freeze
-
- HASH_REGEX = /
- ^
- ([ ]*) # indentations
- (.+) # key
- (?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
- [ ]?
- (['"]?) # optional opening quote
- (.*) # value
- \3 # matching closing quote
- $
- /xo.freeze
-
- def load(str)
- res = {}
- stack = [res]
- last_hash = nil
- last_empty_key = nil
- str.split(/\r?\n/).each do |line|
- if match = HASH_REGEX.match(line)
- indent, key, quote, val = match.captures
- key = convert_to_backward_compatible_key(key)
- depth = indent.scan(/ /).length
- if quote.empty? && val.empty?
- new_hash = {}
- stack[depth][key] = new_hash
- stack[depth + 1] = new_hash
- last_empty_key = key
- last_hash = stack[depth]
- else
- stack[depth][key] = val
- end
- elsif match = ARRAY_REGEX.match(line)
- _, val = match.captures
- last_hash[last_empty_key] = [] unless last_hash[last_empty_key].is_a?(Array)
-
- last_hash[last_empty_key].push(val)
- end
- end
- res
- end
-
- # for settings' keys
- def convert_to_backward_compatible_key(key)
- key = "#{key}/" if key =~ /https?:/i && key !~ %r{/\Z}
- key = key.gsub(".", "__") if key.include?(".")
- key
- end
-
- class << self
- private :dump_hash, :convert_to_backward_compatible_key
- end
- end
-end
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 4f16f309da..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"
@@ -253,7 +252,7 @@
# end
# end +
# cgi.pre do
-# CGI.escapeHTML(
+# CGI::escapeHTML(
# "params: #{cgi.params.inspect}\n" +
# "cookies: #{cgi.cookies.inspect}\n" +
# ENV.collect do |key, value|
diff --git a/lib/cgi/cgi.gemspec b/lib/cgi/cgi.gemspec
deleted file mode 100644
index 403d31c978..0000000000
--- a/lib/cgi/cgi.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-begin
- require_relative "lib/cgi/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "cgi"
- spec.version = CGI::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Support for the Common Gateway Interface protocol.}
- spec.description = %q{Support for the Common Gateway Interface protocol.}
- spec.homepage = "https://github.com/ruby/cgi"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb
index ae9ab58ede..3ec884dffb 100644
--- a/lib/cgi/cookie.rb
+++ b/lib/cgi/cookie.rb
@@ -1,5 +1,4 @@
-# frozen_string_literal: true
-require_relative 'util'
+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)
@@ -57,15 +53,13 @@ class CGI
#
# name:: the name of the cookie. Required.
# value:: the cookie's value or list of values.
- # path:: the path for which this cookie applies. Defaults to
+ # path:: the path for which this cookie applies. Defaults to the
# the value of the +SCRIPT_NAME+ environment variable.
# domain:: the domain for which this cookie applies.
# expires:: the time at which this cookie expires, as a +Time+ object.
# 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)
@@ -73,9 +67,9 @@ class CGI
@expires = nil
if name.kind_of?(String)
@name = name
- @path = (%r|\A(.*/)| =~ ENV["SCRIPT_NAME"] ? $1 : "")
+ %r|^(.*/)|.match(ENV["SCRIPT_NAME"])
+ @path = ($1 or "")
@secure = false
- @httponly = false
return super(value)
end
@@ -87,11 +81,15 @@ class CGI
@name = options["name"]
value = Array(options["value"])
# simple support for IE
- @path = options["path"] || (%r|\A(.*/)| =~ ENV["SCRIPT_NAME"] ? $1 : "")
+ if options["path"]
+ @path = options["path"]
+ else
+ %r|^(.*/)|.match(ENV["SCRIPT_NAME"])
+ @path = ($1 or "")
+ end
@domain = options["domain"]
@expires = options["expires"]
- @secure = options["secure"] == true
- @httponly = options["httponly"] == true
+ @secure = options["secure"] == true ? true : false
super(value)
end
@@ -105,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
@@ -127,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 << "; expires=#{CGI::rfc1123_date(@expires)}" if @expires
+ buf << "; secure" if @secure == true
buf
end
@@ -156,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 bec76e0749..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')
@@ -261,13 +253,13 @@ class CGI
private :_header_for_hash
def nph? #:nodoc:
- return /IIS\/(\d+)/ =~ $CGI_ENV['SERVER_SOFTWARE'] && $1.to_i < 5
+ return /IIS\/(\d+)/.match($CGI_ENV['SERVER_SOFTWARE']) && $1.to_i < 5
end
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)
@@ -375,14 +367,14 @@ class CGI
# Parse an HTTP query string into a hash of key=>value pairs.
#
- # params = CGI.parse("query_string")
+ # params = CGI::parse("query_string")
# # {"name1" => ["value1", "value2", ...],
# # "name2" => ["value1", "value2", ...], ... }
#
- def self.parse(query)
+ def CGI::parse(query)
params = {}
query.split(/[&;]/).each do |pairs|
- key, value = pairs.split('=',2).collect{|v| CGI.unescape(v) }
+ key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) }
next unless key
@@ -421,7 +413,7 @@ class CGI
module QueryExtension
%w[ CONTENT_LENGTH SERVER_PORT ].each do |env|
- define_method(env.delete_prefix('HTTP_').downcase) do
+ define_method(env.sub(/^HTTP_/, '').downcase) do
(val = env_table[env]) && Integer(val)
end
end
@@ -434,7 +426,7 @@ class CGI
HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING
HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM HTTP_HOST
HTTP_NEGOTIATE HTTP_PRAGMA HTTP_REFERER HTTP_USER_AGENT ].each do |env|
- define_method(env.delete_prefix('HTTP_').downcase) do
+ define_method(env.sub(/^HTTP_/, '').downcase) do
env_table[env]
end
end
@@ -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,13 +534,13 @@ 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)
+ body.instance_variable_set(:@original_filename, filename.taint)
## content type
/Content-Type: (.*)/i.match(head)
- (content_type = $1 || ''.dup).chomp!
- body.instance_variable_set(:@content_type, content_type)
+ (content_type = $1 || '').chomp!
+ body.instance_variable_set(:@content_type, content_type.taint)
## query parameter name
/Content-Disposition:.* name=(?:"(.*?)"|([^;\r\n]*))/i.match(head)
name = $1 || $2 || ''
@@ -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)
@@ -607,7 +599,6 @@ class CGI
end
def unescape_filename? #:nodoc:
user_agent = $CGI_ENV['HTTP_USER_AGENT']
- return false unless user_agent
return /Mac/i.match(user_agent) && /Mozilla/i.match(user_agent) && !/MSIE/i.match(user_agent)
end
@@ -649,7 +640,7 @@ class CGI
# Reads query parameters in the @params field, and cookies into @cookies.
def initialize_query()
if ("POST" == env_table['REQUEST_METHOD']) and
- %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?| =~ env_table['CONTENT_TYPE']
+ %r|\Amultipart/form-data.*boundary=\"?([^\";,]+)\"?|.match(env_table['CONTENT_TYPE'])
current_max_multipart_length = @max_multipart_length.respond_to?(:call) ? @max_multipart_length.call : @max_multipart_length
raise StandardError.new("too large multipart data.") if env_table['CONTENT_LENGTH'].to_i > current_max_multipart_length
boundary = $1.dup
@@ -657,7 +648,7 @@ class CGI
@params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
else
@multipart = false
- @params = CGI.parse(
+ @params = CGI::parse(
case env_table['REQUEST_METHOD']
when "GET", "HEAD"
if defined?(MOD_RUBY)
@@ -687,7 +678,7 @@ class CGI
end
end
- @cookies = CGI::Cookie.parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
+ @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
end
private :initialize_query
@@ -708,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
@@ -742,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
@@ -863,24 +854,24 @@ class CGI
case @options[:tag_maker]
when "html3"
- require_relative 'html'
+ require 'cgi/html'
extend Html3
extend HtmlExtension
when "html4"
- require_relative 'html'
+ require 'cgi/html'
extend Html4
extend HtmlExtension
when "html4Tr"
- require_relative 'html'
+ require 'cgi/html'
extend Html4Tr
extend HtmlExtension
when "html4Fr"
- require_relative 'html'
+ require 'cgi/html'
extend Html4Tr
extend Html4Fr
extend HtmlExtension
when "html5"
- require_relative 'html'
+ require 'cgi/html'
extend Html5
extend HtmlExtension
end
diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb
index 1543943320..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,14 +25,14 @@ 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 << " "
- s << CGI.escapeHTML(name.to_s)
+ s << CGI::escapeHTML(name.to_s)
if value != true
s << '="'
- s << CGI.escapeHTML(value.to_s)
+ s << CGI::escapeHTML(value.to_s)
s << '"'
end
end
@@ -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"]
@@ -423,7 +422,7 @@ class CGI
buf << super(attributes)
if pretty
- CGI.pretty(buf, pretty)
+ CGI::pretty(buf, pretty)
else
buf
end
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index 29e7b3ece3..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
@@ -403,11 +400,11 @@ class CGI
for line in f
line.chomp!
k, v = line.split('=',2)
- @hash[CGI.unescape(k)] = Marshal.restore(CGI.unescape(v))
+ @hash[CGI::unescape(k)] = Marshal.restore(CGI::unescape(v))
end
ensure
- f&.close
- lockf&.close
+ f.close unless f.nil?
+ lockf.close if lockf
end
end
@hash
@@ -421,13 +418,13 @@ class CGI
lockf.flock File::LOCK_EX
f = File.open(@path+".new", File::CREAT|File::TRUNC|File::WRONLY, 0600)
for k,v in @hash
- f.printf "%s=%s\n", CGI.escape(k), CGI.escape(String(Marshal.dump(v)))
+ f.printf "%s=%s\n", CGI::escape(k), CGI::escape(String(Marshal.dump(v)))
end
f.close
File.rename @path+".new", @path
ensure
- f&.close
- lockf&.close
+ 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 cc3006400f..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
#
@@ -10,7 +9,7 @@
# persistent of session data on top of the pstore library. See
# cgi/session.rb for more details on session storage managers.
-require_relative '../session'
+require 'cgi/session'
require 'pstore'
class CGI
@@ -50,6 +49,7 @@ class CGI
require 'digest/md5'
md5 = Digest::MD5.hexdigest(id)[0,16]
path = dir+"/"+prefix+md5
+ path.untaint
if File::exist?(path)
@hash = nil
else
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index aab8b000cb..3d7db8f2c8 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -1,23 +1,18 @@
-# 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.
- # url_encoded_string = CGI.escape("'Stop!' said Fred")
+ # url_encoded_string = CGI::escape("'Stop!' said Fred")
# # => "%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
# URL-decode a string with encoding(optional).
- # string = CGI.unescape("%27Stop%21%27+said+Fred")
+ # string = CGI::unescape("%27Stop%21%27+said+Fred")
# # => "'Stop!' said Fred"
def unescape(string,encoding=@@accept_charset)
str=string.tr('+', ' ').b.gsub(/((?:%[0-9a-fA-F]{2})+)/) do |m|
@@ -35,42 +30,21 @@ module CGI::Util
'>' => '&gt;',
}
- # Escape special characters in HTML, namely '&\"<>
- # CGI.escapeHTML('Usage: foo "bar" <baz>')
+ # 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;")
+ # 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};"
@@ -118,10 +89,10 @@ module CGI::Util
end
end
- # Synonym for CGI.escapeHTML(str)
+ # Synonym for CGI::escapeHTML(str)
alias escape_html escapeHTML
- # Synonym for CGI.unescapeHTML(str)
+ # Synonym for CGI::unescapeHTML(str)
alias unescape_html unescapeHTML
# Escape only the tags of certain HTML elements in +string+.
@@ -132,30 +103,30 @@ module CGI::Util
# The attribute list of the open tag will also be escaped (for
# instance, the double-quotes surrounding attribute values).
#
- # print CGI.escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
+ # print CGI::escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
# # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
#
- # print CGI.escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
+ # print CGI::escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
# # "<BR>&lt;A HREF=&quot;url&quot;&gt;&lt;/A&gt"
def escapeElement(string, *elements)
elements = elements[0] if elements[0].kind_of?(Array)
unless elements.empty?
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/i) do
- CGI.escapeHTML($&)
+ CGI::escapeHTML($&)
end
else
string
end
end
- # Undo escaping such as that done by CGI.escapeElement()
+ # Undo escaping such as that done by CGI::escapeElement()
#
- # print CGI.unescapeElement(
- # CGI.escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
+ # print CGI::unescapeElement(
+ # CGI::escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
# # "&lt;BR&gt;<A HREF="url"></A>"
#
- # print CGI.unescapeElement(
- # CGI.escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
+ # print CGI::unescapeElement(
+ # CGI::escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
# # "&lt;BR&gt;<A HREF="url"></A>"
def unescapeElement(string, *elements)
elements = elements[0] if elements[0].kind_of?(Array)
@@ -168,10 +139,10 @@ module CGI::Util
end
end
- # Synonym for CGI.escapeElement(str)
+ # Synonym for CGI::escapeElement(str)
alias escape_element escapeElement
- # Synonym for CGI.unescapeElement(str)
+ # Synonym for CGI::unescapeElement(str)
alias unescape_element unescapeElement
# Abbreviated day-of-week names specified by RFC 822
@@ -182,7 +153,7 @@ module CGI::Util
# Format a +Time+ object as a String using the format specified by RFC 1123.
#
- # CGI.rfc1123_date(Time.now)
+ # CGI::rfc1123_date(Time.now)
# # Sat, 01 Jan 2000 00:00:00 GMT
def rfc1123_date(time)
t = time.clone.gmtime
@@ -196,13 +167,13 @@ module CGI::Util
# +string+ is the HTML string to indent. +shift+ is the indentation
# unit to use; it defaults to two spaces.
#
- # print CGI.pretty("<HTML><BODY></BODY></HTML>")
+ # print CGI::pretty("<HTML><BODY></BODY></HTML>")
# # <HTML>
# # <BODY>
# # </BODY>
# # </HTML>
#
- # print CGI.pretty("<HTML><BODY></BODY></HTML>", "\t")
+ # print CGI::pretty("<HTML><BODY></BODY></HTML>", "\t")
# # <HTML>
# # <BODY>
# # </BODY>
diff --git a/lib/cgi/version.rb b/lib/cgi/version.rb
deleted file mode 100644
index 9d17c91b95..0000000000
--- a/lib/cgi/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class CGI
- VERSION = "0.1.0"
-end
diff --git a/lib/cmath.rb b/lib/cmath.rb
new file mode 100644
index 0000000000..4753c47545
--- /dev/null
+++ b/lib/cmath.rb
@@ -0,0 +1,442 @@
+##
+# = 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.
+#
+# == Usage
+#
+# To start using this library, simply require cmath library:
+#
+# require "cmath"
+#
+# And after call any CMath function. For example:
+#
+# CMath.sqrt(-9) #=> 0+3.0i
+# CMath.exp(0 + 0i) #=> 1.0+0.0i
+# CMath.log10(-5.to_c) #=> (0.6989700043360187+1.3643763538418412i)
+#
+#
+# For more information you can see Complec class.
+
+module CMath
+
+ include Math
+
+ alias exp! exp
+ alias log! log
+ alias log2! log2
+ alias log10! log10
+ alias sqrt! sqrt
+ alias cbrt! cbrt
+
+ alias sin! sin
+ alias cos! cos
+ alias tan! tan
+
+ alias sinh! sinh
+ alias cosh! cosh
+ alias tanh! tanh
+
+ alias asin! asin
+ alias acos! acos
+ alias atan! atan
+ alias atan2! atan2
+
+ alias asinh! asinh
+ alias acosh! acosh
+ alias atanh! atanh
+
+ ##
+ # Math::E raised to the +z+ power
+ #
+ # CMath.exp(2i) #=> (-0.4161468365471424+0.9092974268256817i)
+ def exp(z)
+ begin
+ if z.real?
+ exp!(z)
+ else
+ ere = exp!(z.real)
+ Complex(ere * cos!(z.imag),
+ ere * sin!(z.imag))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # 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(*args)
+ begin
+ z, b = args
+ unless b.nil? || b.kind_of?(Numeric)
+ raise TypeError, "Numeric Number required"
+ end
+ if z.real? and z >= 0 and (b.nil? or b >= 0)
+ log!(*args)
+ else
+ a = Complex(log!(z.abs), z.arg)
+ if b
+ a /= log(b)
+ end
+ a
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the base 2 logarithm of +z+
+ #
+ # CMath.log2(-1) => (0.0+4.532360141827194i)
+ def log2(z)
+ begin
+ if z.real? and z >= 0
+ log2!(z)
+ else
+ log(z) / log!(2)
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the base 10 logarithm of +z+
+ #
+ # CMath.log10(-1) #=> (0.0+1.3643763538418412i)
+ def log10(z)
+ begin
+ if z.real? and z >= 0
+ log10!(z)
+ else
+ log(z) / log!(10)
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # Returns the non-negative square root of Complex.
+ #
+ # CMath.sqrt(-1 + 0i) #=> 0.0+1.0i
+ def sqrt(z)
+ begin
+ if z.real?
+ if z < 0
+ Complex(0, sqrt!(-z))
+ else
+ sqrt!(z)
+ end
+ else
+ if z.imag < 0 ||
+ (z.imag == 0 && z.imag.to_s[0] == '-')
+ sqrt(z.conjugate).conjugate
+ else
+ r = z.abs
+ x = z.real
+ Complex(sqrt!((r + x) / 2.0), sqrt!((r - x) / 2.0))
+ end
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the principal value of the cube root of +z+
+ #
+ # CMath.cbrt(1 + 4i) #=> (1.449461632813119+0.6858152562177092i)
+ def cbrt(z)
+ z ** (1.0/3)
+ end
+
+ ##
+ # returns the sine of +z+, where +z+ is given in radians
+ #
+ # CMath.sin(1 + 1i) #=> (1.2984575814159773+0.6349639147847361i)
+ def sin(z)
+ begin
+ if z.real?
+ sin!(z)
+ else
+ Complex(sin!(z.real) * cosh!(z.imag),
+ cos!(z.real) * sinh!(z.imag))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the cosine of +z+, where +z+ is given in radians
+ #
+ # CMath.cos(1 + 1i) #=> (0.8337300251311491-0.9888977057628651i)
+ def cos(z)
+ begin
+ if z.real?
+ cos!(z)
+ else
+ Complex(cos!(z.real) * cosh!(z.imag),
+ -sin!(z.real) * sinh!(z.imag))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the tangent of +z+, where +z+ is given in radians
+ #
+ # CMath.tan(1 + 1i) #=> (0.27175258531951174+1.0839233273386943i)
+ def tan(z)
+ begin
+ if z.real?
+ tan!(z)
+ else
+ sin(z) / cos(z)
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the hyperbolic sine of +z+, where +z+ is given in radians
+ #
+ # CMath.sinh(1 + 1i) #=> (0.6349639147847361+1.2984575814159773i)
+ def sinh(z)
+ begin
+ if z.real?
+ sinh!(z)
+ else
+ Complex(sinh!(z.real) * cos!(z.imag),
+ cosh!(z.real) * sin!(z.imag))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the hyperbolic cosine of +z+, where +z+ is given in radians
+ #
+ # CMath.cosh(1 + 1i) #=> (0.8337300251311491+0.9888977057628651i)
+ def cosh(z)
+ begin
+ if z.real?
+ cosh!(z)
+ else
+ Complex(cosh!(z.real) * cos!(z.imag),
+ sinh!(z.real) * sin!(z.imag))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the hyperbolic tangent of +z+, where +z+ is given in radians
+ #
+ # CMath.tanh(1 + 1i) #=> (1.0839233273386943+0.27175258531951174i)
+ def tanh(z)
+ begin
+ if z.real?
+ tanh!(z)
+ else
+ sinh(z) / cosh(z)
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the arc sine of +z+
+ #
+ # CMath.asin(1 + 1i) #=> (0.6662394324925153+1.0612750619050355i)
+ def asin(z)
+ begin
+ if z.real? and z >= -1 and z <= 1
+ asin!(z)
+ else
+ (-1.0).i * log(1.0.i * z + sqrt(1.0 - z * z))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the arc cosine of +z+
+ #
+ # CMath.acos(1 + 1i) #=> (0.9045568943023813-1.0612750619050357i)
+ def acos(z)
+ begin
+ if z.real? and z >= -1 and z <= 1
+ acos!(z)
+ else
+ (-1.0).i * log(z + 1.0.i * sqrt(1.0 - z * z))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the arc tangent of +z+
+ #
+ # CMath.atan(1 + 1i) #=> (1.0172219678978514+0.4023594781085251i)
+ def atan(z)
+ begin
+ if z.real?
+ atan!(z)
+ else
+ 1.0.i * log((1.0.i + z) / (1.0.i - z)) / 2.0
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the arc tangent of +y+ divided by +x+ using the signs of +y+ and
+ # +x+ to determine the quadrant
+ #
+ # CMath.atan2(1 + 1i, 0) #=> (1.5707963267948966+0.0i)
+ def atan2(y,x)
+ begin
+ if y.real? and x.real?
+ atan2!(y,x)
+ else
+ (-1.0).i * log((x + 1.0.i * y) / sqrt(x * x + y * y))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the inverse hyperbolic sine of +z+
+ #
+ # CMath.asinh(1 + 1i) #=> (1.0612750619050357+0.6662394324925153i)
+ def asinh(z)
+ begin
+ if z.real?
+ asinh!(z)
+ else
+ log(z + sqrt(1.0 + z * z))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the inverse hyperbolic cosine of +z+
+ #
+ # CMath.acosh(1 + 1i) #=> (1.0612750619050357+0.9045568943023813i)
+ def acosh(z)
+ begin
+ if z.real? and z >= 1
+ acosh!(z)
+ else
+ log(z + sqrt(z * z - 1.0))
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ ##
+ # returns the inverse hyperbolic tangent of +z+
+ #
+ # CMath.atanh(1 + 1i) #=> (0.4023594781085251+1.0172219678978514i)
+ def atanh(z)
+ begin
+ if z.real? and z >= -1 and z <= 1
+ atanh!(z)
+ else
+ log((1.0 + z) / (1.0 - z)) / 2.0
+ end
+ rescue NoMethodError
+ handle_no_method_error
+ end
+ end
+
+ module_function :exp!
+ module_function :exp
+ module_function :log!
+ module_function :log
+ module_function :log2!
+ module_function :log2
+ module_function :log10!
+ module_function :log10
+ module_function :sqrt!
+ module_function :sqrt
+ module_function :cbrt!
+ module_function :cbrt
+
+ module_function :sin!
+ module_function :sin
+ module_function :cos!
+ module_function :cos
+ module_function :tan!
+ module_function :tan
+
+ module_function :sinh!
+ module_function :sinh
+ module_function :cosh!
+ module_function :cosh
+ module_function :tanh!
+ module_function :tanh
+
+ module_function :asin!
+ module_function :asin
+ module_function :acos!
+ module_function :acos
+ module_function :atan!
+ module_function :atan
+ module_function :atan2!
+ module_function :atan2
+
+ module_function :asinh!
+ module_function :asinh
+ module_function :acosh!
+ module_function :acosh
+ module_function :atanh!
+ module_function :atanh
+
+ module_function :frexp
+ module_function :ldexp
+ module_function :hypot
+ module_function :erf
+ module_function :erfc
+ module_function :gamma
+ module_function :lgamma
+
+ private
+ def handle_no_method_error # :nodoc:
+ if $!.name == :real?
+ raise TypeError, "Numeric Number required"
+ else
+ raise
+ end
+ end
+ module_function :handle_no_method_error
+
+end
diff --git a/lib/csv.rb b/lib/csv.rb
index 8aa65868b7..54b820df31 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1,8 +1,9 @@
# encoding: US-ASCII
-# frozen_string_literal: true
# = csv.rb -- CSV Reading and Writing
#
-# Created by James Edward Gray II on 2005-10-31.
+# Created by James Edward Gray II on 2005-10-31.
+# Copyright 2005 James Edward Gray II. You can redistribute or modify this code
+# under the terms of Ruby's license.
#
# See CSV for documentation.
#
@@ -10,18 +11,18 @@
#
# Welcome to the new and improved CSV.
#
-# This version of the CSV library began its life as FasterCSV. FasterCSV was
-# intended as a replacement to Ruby's then standard CSV library. It was
+# This version of the CSV library began its life as FasterCSV. FasterCSV was
+# intended as a replacement to Ruby's then standard CSV library. It was
# designed to address concerns users of that library had and it had three
# primary goals:
#
# 1. Be significantly faster than CSV while remaining a pure Ruby library.
-# 2. Use a smaller and easier to maintain code base. (FasterCSV eventually
-# grew larger, was also but considerably richer in features. The parsing
+# 2. Use a smaller and easier to maintain code base. (FasterCSV eventually
+# grew larger, was also but considerably richer in features. The parsing
# core remains quite small.)
# 3. Improve on the CSV interface.
#
-# Obviously, the last one is subjective. I did try to defer to the original
+# Obviously, the last one is subjective. I did try to defer to the original
# interface whenever I didn't have a compelling reason to change it though, so
# hopefully this won't be too radically different.
#
@@ -29,20 +30,20 @@
# the original library as of Ruby 1.9. If you are migrating code from 1.8 or
# earlier, you may have to change your code to comply with the new interface.
#
-# == What's the Different From the Old CSV?
+# == What's Different From the Old CSV?
#
# I'm sure I'll miss something, but I'll try to mention most of the major
# differences I am aware of, to help others quickly get up to speed:
#
# === CSV Parsing
#
-# * This parser is m17n aware. See CSV for full details.
+# * This parser is m17n aware. See CSV for full details.
# * This library has a stricter parser and will throw MalformedCSVErrors on
# problematic data.
-# * This library has a less liberal idea of a line ending than CSV. What you
-# set as the <tt>:row_sep</tt> is law. It can auto-detect your line endings
+# * This library has a less liberal idea of a line ending than CSV. What you
+# set as the <tt>:row_sep</tt> is law. It can auto-detect your line endings
# though.
-# * The old library returned empty lines as <tt>[nil]</tt>. This library calls
+# * The old library returned empty lines as <tt>[nil]</tt>. This library calls
# them <tt>[]</tt>.
# * This library has a much faster parser.
#
@@ -56,9 +57,9 @@
# * CSV now has a new() method used to wrap objects like String and IO for
# reading and writing.
# * CSV::generate() is different from the old method.
-# * CSV no longer supports partial reads. It works line-by-line.
+# * CSV no longer supports partial reads. It works line-by-line.
# * CSV no longer allows the instance methods to override the separators for
-# performance reasons. They must be set in the constructor.
+# performance reasons. They must be set in the constructor.
#
# If you use this library and find yourself missing any functionality I have
# trimmed, please {let me know}[mailto:james@grayproductions.net].
@@ -70,16 +71,16 @@
# == What is CSV, really?
#
# CSV maintains a pretty strict definition of CSV taken directly from
-# {the RFC}[http://www.ietf.org/rfc/rfc4180.txt]. I relax the rules in only one
-# place and that is to make using this library easier. CSV will parse all valid
+# {the RFC}[http://www.ietf.org/rfc/rfc4180.txt]. I relax the rules in only one
+# place and that is to make using this library easier. CSV will parse all valid
# CSV.
#
-# What you don't want to do is to feed CSV invalid data. Because of the way the
+# What you don't want to do is feed CSV invalid data. Because of the way the
# CSV format works, it's common for a parser to need to read until the end of
-# the file to be sure a field is invalid. This consumes a lot of time and memory.
+# the file to be sure a field is invalid. This eats a lot of time and memory.
#
# Luckily, when working with invalid CSV, Ruby's built-in methods will almost
-# always be superior in every way. For example, parsing non-quoted fields is as
+# always be superior in every way. For example, parsing non-quoted fields is as
# easy as:
#
# data.split(",")
@@ -94,186 +95,808 @@ require "English"
require "date"
require "stringio"
-require_relative "csv/fields_converter"
-require_relative "csv/match_p"
-require_relative "csv/parser"
-require_relative "csv/row"
-require_relative "csv/table"
-require_relative "csv/writer"
-
-using CSV::MatchP if CSV.const_defined?(:MatchP)
-
#
-# This class provides a complete interface to CSV files and data. It offers
+# This class provides a complete interface to CSV files and data. It offers
# tools to enable you to read and write to and from Strings or IO objects, as
# needed.
#
-# The most generic interface of the library is:
-#
-# csv = CSV.new(string_or_io, **options)
+# == Reading
#
-# # Reading: IO object should be open for read
-# csv.read # => array of rows
-# # or
-# csv.each do |row|
-# # ...
-# end
-# # or
-# row = csv.shift
+# === From a File
#
-# # Writing: IO object should be open for write
-# csv << row
+# ==== A Line at a Time
#
-# There are several specialized class methods for one-statement reading or writing,
-# described in the Specialized Methods section.
+# CSV.foreach("path/to/file.csv") do |row|
+# # use row here...
+# end
#
-# If a String is passed into ::new, it is internally wrapped into a StringIO object.
+# ==== All at Once
#
-# +options+ can be used for specifying the particular CSV flavor (column
-# separators, row separators, value quoting and so on), and for data conversion,
-# see Data Conversion section for the description of the latter.
+# arr_of_arrs = CSV.read("path/to/file.csv")
#
-# == Specialized Methods
+# === From a String
#
-# === Reading
+# ==== A Line at a Time
#
-# # From a file: all at once
-# arr_of_rows = CSV.read("path/to/file.csv", **options)
-# # iterator-style:
-# CSV.foreach("path/to/file.csv", **options) do |row|
-# # ...
+# CSV.parse("CSV,data,String") do |row|
+# # use row here...
# end
#
-# # From a string
-# arr_of_rows = CSV.parse("CSV,data,String", **options)
-# # or
-# CSV.parse("CSV,data,String", **options) do |row|
-# # ...
-# end
+# ==== All at Once
+#
+# arr_of_arrs = CSV.parse("CSV,data,String")
#
-# === Writing
+# == Writing
+#
+# === To a File
#
-# # To a file
# CSV.open("path/to/file.csv", "wb") do |csv|
# csv << ["row", "of", "CSV", "data"]
# csv << ["another", "row"]
# # ...
# end
#
-# # To a String
+# === To a String
+#
# csv_string = CSV.generate do |csv|
# csv << ["row", "of", "CSV", "data"]
# csv << ["another", "row"]
# # ...
# end
#
-# === Shortcuts
+# == Convert a Single Line
#
-# # Core extensions for converting one line
# csv_string = ["CSV", "data"].to_csv # to CSV
# csv_array = "CSV,String".parse_csv # from CSV
#
-# # CSV() method
+# == Shortcut Interface
+#
# CSV { |csv_out| csv_out << %w{my data here} } # to $stdout
# CSV(csv = "") { |csv_str| csv_str << %w{my data here} } # to a String
# CSV($stderr) { |csv_err| csv_err << %w{my data here} } # to $stderr
# CSV($stdin) { |csv_in| csv_in.each { |row| p row } } # from $stdin
#
-# == Data Conversion
-#
-# === CSV with headers
-#
-# CSV allows to specify column names of CSV file, whether they are in data, or
-# provided separately. If headers are specified, reading methods return an instance
-# of CSV::Table, consisting of CSV::Row.
-#
-# # Headers are part of data
-# data = CSV.parse(<<~ROWS, headers: true)
-# Name,Department,Salary
-# Bob,Engineering,1000
-# Jane,Sales,2000
-# John,Management,5000
-# ROWS
-#
-# data.class #=> CSV::Table
-# data.first #=> #<CSV::Row "Name":"Bob" "Department":"Engineering" "Salary":"1000">
-# data.first.to_h #=> {"Name"=>"Bob", "Department"=>"Engineering", "Salary"=>"1000"}
-#
-# # Headers provided by developer
-# data = CSV.parse('Bob,Engineering,1000', headers: %i[name department salary])
-# data.first #=> #<CSV::Row name:"Bob" department:"Engineering" salary:"1000">
-#
-# === Typed data reading
-#
-# CSV allows to provide a set of data _converters_ e.g. transformations to try on input
-# data. Converter could be a symbol from CSV::Converters constant's keys, or lambda.
-#
-# # Without any converters:
-# CSV.parse('Bob,2018-03-01,100')
-# #=> [["Bob", "2018-03-01", "100"]]
+# == Advanced Usage
#
-# # With built-in converters:
-# CSV.parse('Bob,2018-03-01,100', converters: %i[numeric date])
-# #=> [["Bob", #<Date: 2018-03-01>, 100]]
+# === Wrap an IO Object
#
-# # With custom converters:
-# CSV.parse('Bob,2018-03-01,100', converters: [->(v) { Time.parse(v) rescue v }])
-# #=> [["Bob", 2018-03-01 00:00:00 +0200, "100"]]
+# csv = CSV.new(io, options)
+# # ... read (with gets() or each()) from and write (with <<) to csv here ...
#
# == CSV and Character Encodings (M17n or Multilingualization)
#
# This new CSV parser is m17n savvy. The parser works in the Encoding of the IO
-# or String object being read from or written to. Your data is never transcoded
+# or String object being read from or written to. Your data is never transcoded
# (unless you ask Ruby to transcode it for you) and will literally be parsed in
-# the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
-# Encoding of your data. This is accomplished by transcoding the parser itself
+# the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
+# Encoding of your data. This is accomplished by transcoding the parser itself
# into your Encoding.
#
# Some transcoding must take place, of course, to accomplish this multiencoding
-# support. For example, <tt>:col_sep</tt>, <tt>:row_sep</tt>, and
+# 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
-# Encoding agnostic, some features are not. For example, the built-in
+# Encoding agnostic, some features are not. For example, the built-in
# converters will try to transcode data to UTF-8 before making conversions.
# Again, you can provide custom converters that are aware of your Encodings to
-# avoid this translation. It's just too hard for me to support native
+# avoid this translation. It's just too hard for me to support native
# conversions in all of Ruby's Encodings.
#
-# Anyway, the practical side of this is simple: make sure IO and String objects
+# Anyway, the practical side of this is simple: make sure IO and String objects
# passed into CSV have the proper Encoding set and everything should just work.
# CSV methods that allow you to open IO objects (CSV::foreach(), CSV::open(),
# CSV::read(), and CSV::readlines()) do allow you to specify the Encoding.
#
# One minor exception comes when generating CSV into a String with an Encoding
-# that is not ASCII compatible. There's no existing data for CSV to use to
+# that is not ASCII compatible. There's no existing data for CSV to use to
# prepare itself and thus you will probably need to manually specify the desired
-# Encoding for most of those cases. It will try to guess using the fields in a
+# Encoding for most of those cases. It will try to guess using the fields in a
# row of output though, when using CSV::generate_line() or Array#to_csv().
#
# I try to point out any other Encoding issues in the documentation of methods
# as they come up.
#
# This has been tested to the best of my ability with all non-"dummy" Encodings
-# Ruby ships with. However, it is brave new code and may have some bugs.
+# Ruby ships with. However, it is brave new code and may have some bugs.
# Please feel free to {report}[mailto:james@grayproductions.net] any issues you
# find with it.
#
class CSV
+ # The version of the installed library.
+ VERSION = "2.4.8".freeze
- # The error thrown when the parser encounters illegal CSV formatting.
- class MalformedCSVError < RuntimeError
- attr_reader :line_number
- alias_method :lineno, :line_number
- def initialize(message, line_number)
- @line_number = line_number
- super("#{message} in line #{line_number}.")
+ #
+ # A CSV::Row is part Array and part Hash. It retains an order for the fields
+ # and allows duplicates just as an Array would, but also allows you to access
+ # fields by name just as you could if they were in a Hash.
+ #
+ # All rows returned by CSV will be constructed from this class, if header row
+ # processing is activated.
+ #
+ class Row
+ #
+ # Construct a new CSV::Row from +headers+ and +fields+, which are expected
+ # to be Arrays. If one Array is shorter than the other, it will be padded
+ # with +nil+ objects.
+ #
+ # The optional +header_row+ parameter can be set to +true+ to indicate, via
+ # CSV::Row.header_row?() and CSV::Row.field_row?(), that this is a header
+ # row. Otherwise, the row is assumes to be a field row.
+ #
+ # A CSV::Row object supports the following Array methods through delegation:
+ #
+ # * empty?()
+ # * length()
+ # * size()
+ #
+ def initialize(headers, fields, header_row = false)
+ @header_row = header_row
+ headers.each { |h| h.freeze if h.is_a? String }
+
+ # handle extra headers or fields
+ @row = if headers.size >= fields.size
+ headers.zip(fields)
+ else
+ fields.zip(headers).map { |pair| pair.reverse! }
+ end
+ end
+
+ # Internal data format used to compare equality.
+ attr_reader :row
+ protected :row
+
+ ### Array Delegation ###
+
+ extend Forwardable
+ def_delegators :@row, :empty?, :length, :size
+
+ # Returns +true+ if this is a header row.
+ def header_row?
+ @header_row
+ end
+
+ # Returns +true+ if this is a field row.
+ def field_row?
+ not header_row?
+ end
+
+ # Returns the headers of this row.
+ def headers
+ @row.map { |pair| pair.first }
+ end
+
+ #
+ # :call-seq:
+ # field( header )
+ # field( header, offset )
+ # field( index )
+ #
+ # This method will return the field value by +header+ or +index+. If a field
+ # is not found, +nil+ is returned.
+ #
+ # When provided, +offset+ ensures that a header match occurs on or later
+ # than the +offset+ index. You can use this to find duplicate headers,
+ # without resorting to hard-coding exact indices.
+ #
+ def field(header_or_index, minimum_index = 0)
+ # locate the pair
+ 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
+ pair.nil? ? nil : pair.last
+ end
+ alias_method :[], :field
+
+ #
+ # :call-seq:
+ # fetch( header )
+ # fetch( header ) { |row| ... }
+ # fetch( header, default )
+ #
+ # This method will fetch the field value by +header+. It has the same
+ # behavior as Hash#fetch: if there is a field with the given +header+, its
+ # value is returned. Otherwise, if a block is given, it is yielded the
+ # +header+ and its result is returned; if a +default+ is given as the
+ # second argument, it is returned; otherwise a KeyError is raised.
+ #
+ def fetch(header, *varargs)
+ raise ArgumentError, "Too many arguments" if varargs.length > 1
+ pair = @row.assoc(header)
+ if pair
+ pair.last
+ else
+ if block_given?
+ yield header
+ elsif varargs.empty?
+ raise KeyError, "key not found: #{header}"
+ else
+ varargs.first
+ end
+ end
+ end
+
+ # Returns +true+ if there is a field with the given +header+.
+ def has_key?(header)
+ !!@row.assoc(header)
+ end
+ alias_method :include?, :has_key?
+ alias_method :key?, :has_key?
+ alias_method :member?, :has_key?
+
+ #
+ # :call-seq:
+ # []=( header, value )
+ # []=( header, offset, value )
+ # []=( index, value )
+ #
+ # Looks up the field by the semantics described in CSV::Row.field() and
+ # assigns the +value+.
+ #
+ # Assigning past the end of the row with an index will set all pairs between
+ # to <tt>[nil, nil]</tt>. Assigning to an unused header appends the new
+ # pair.
+ #
+ def []=(*args)
+ value = args.pop
+
+ if args.first.is_a? Integer
+ if @row[args.first].nil? # extending past the end with index
+ @row[args.first] = [nil, value]
+ @row.map! { |pair| pair.nil? ? [nil, nil] : pair }
+ else # normal index assignment
+ @row[args.first][1] = value
+ end
+ else
+ index = index(*args)
+ if index.nil? # appending a field
+ self << [args.first, value]
+ else # normal header assignment
+ @row[index][1] = value
+ end
+ end
+ end
+
+ #
+ # :call-seq:
+ # <<( field )
+ # <<( header_and_field_array )
+ # <<( header_and_field_hash )
+ #
+ # If a two-element Array is provided, it is assumed to be a header and field
+ # and the pair is appended. A Hash works the same way with the key being
+ # the header and the value being the field. Anything else is assumed to be
+ # a lone field which is appended with a +nil+ header.
+ #
+ # This method returns the row for chaining.
+ #
+ def <<(arg)
+ if arg.is_a?(Array) and arg.size == 2 # appending a header and name
+ @row << arg
+ elsif arg.is_a?(Hash) # append header and name pairs
+ arg.each { |pair| @row << pair }
+ else # append field value
+ @row << [nil, arg]
+ end
+
+ self # for chaining
+ end
+
+ #
+ # A shortcut for appending multiple fields. Equivalent to:
+ #
+ # args.each { |arg| csv_row << arg }
+ #
+ # This method returns the row for chaining.
+ #
+ def push(*args)
+ args.each { |arg| self << arg }
+
+ self # for chaining
+ end
+
+ #
+ # :call-seq:
+ # delete( header )
+ # delete( header, offset )
+ # delete( index )
+ #
+ # Used to remove a pair from the row by +header+ or +index+. The pair is
+ # located as described in CSV::Row.field(). The deleted pair is returned,
+ # or +nil+ if a pair could not be found.
+ #
+ def delete(header_or_index, minimum_index = 0)
+ if header_or_index.is_a? Integer # by index
+ @row.delete_at(header_or_index)
+ elsif i = index(header_or_index, minimum_index) # by header
+ @row.delete_at(i)
+ else
+ [ ]
+ end
+ end
+
+ #
+ # The provided +block+ is passed a header and field for each pair in the row
+ # and expected to return +true+ or +false+, depending on whether the pair
+ # should be deleted.
+ #
+ # This method returns the row for chaining.
+ #
+ def delete_if(&block)
+ @row.delete_if(&block)
+
+ self # for chaining
+ end
+
+ #
+ # This method accepts any number of arguments which can be headers, indices,
+ # Ranges of either, or two-element Arrays containing a header and offset.
+ # Each argument will be replaced with a field lookup as described in
+ # CSV::Row.field().
+ #
+ # If called with no arguments, all fields are returned.
+ #
+ def fields(*headers_and_or_indices)
+ if headers_and_or_indices.empty? # return all fields--no arguments
+ @row.map { |pair| pair.last }
+ else # or work like values_at()
+ 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)
+ fields.values_at(new_range)
+ else
+ [field(*Array(h_or_i))]
+ end
+ end
+ end
+ end
+ alias_method :values_at, :fields
+
+ #
+ # :call-seq:
+ # index( header )
+ # index( header, offset )
+ #
+ # This method will return the index of a field with the provided +header+.
+ # The +offset+ can be used to locate duplicate header names, as described in
+ # CSV::Row.field().
+ #
+ def index(header, minimum_index = 0)
+ # find the pair
+ index = headers[minimum_index..-1].index(header)
+ # return the index at the right offset, if we found one
+ index.nil? ? nil : index + minimum_index
+ end
+
+ # Returns +true+ if +name+ is a header for this row, and +false+ otherwise.
+ def header?(name)
+ headers.include? name
+ end
+ alias_method :include?, :header?
+
+ #
+ # Returns +true+ if +data+ matches a field in this row, and +false+
+ # otherwise.
+ #
+ def field?(data)
+ fields.include? data
+ end
+
+ include Enumerable
+
+ #
+ # Yields each pair of the row as header and field tuples (much like
+ # iterating over a Hash).
+ #
+ # Support for Enumerable.
+ #
+ # This method returns the row for chaining.
+ #
+ def each(&block)
+ @row.each(&block)
+
+ self # for chaining
+ end
+
+ #
+ # Returns +true+ if this row contains the same headers and fields in the
+ # same order as +other+.
+ #
+ def ==(other)
+ return @row == other.row if other.is_a? CSV::Row
+ @row == other
+ end
+
+ #
+ # Collapses the row into a simple Hash. Be warning that this discards field
+ # order and clobbers duplicate fields.
+ #
+ def to_hash
+ # flatten just one level of the internal Array
+ Hash[*@row.inject(Array.new) { |ary, pair| ary.push(*pair) }]
+ end
+
+ #
+ # Returns the row as a CSV String. Headers are not used. Equivalent to:
+ #
+ # csv_row.fields.to_csv( options )
+ #
+ def to_csv(options = Hash.new)
+ fields.to_csv(options)
+ end
+ alias_method :to_s, :to_csv
+
+ # A summary of fields, by header, in an ASCII compatible String.
+ def inspect
+ str = ["#<", self.class.to_s]
+ each do |header, field|
+ str << " " << (header.is_a?(Symbol) ? header.to_s : header.inspect) <<
+ ":" << field.inspect
+ end
+ str << ">"
+ begin
+ str.join('')
+ rescue # any encoding error
+ str.map do |s|
+ e = Encoding::Converter.asciicompat_encoding(s.encoding)
+ e ? s.encode(e) : s.force_encoding("ASCII-8BIT")
+ end.join('')
+ end
+ end
+ end
+
+ #
+ # A CSV::Table is a two-dimensional data structure for representing CSV
+ # documents. Tables allow you to work with the data by row or column,
+ # manipulate the data, and even convert the results back to CSV, if needed.
+ #
+ # All tables returned by CSV will be constructed from this class, if header
+ # row processing is activated.
+ #
+ class Table
+ #
+ # Construct a new CSV::Table from +array_of_rows+, which are expected
+ # to be CSV::Row objects. All rows are assumed to have the same headers.
+ #
+ # A CSV::Table object supports the following Array methods through
+ # delegation:
+ #
+ # * empty?()
+ # * length()
+ # * size()
+ #
+ def initialize(array_of_rows)
+ @table = array_of_rows
+ @mode = :col_or_row
+ end
+
+ # The current access mode for indexing and iteration.
+ attr_reader :mode
+
+ # Internal data format used to compare equality.
+ attr_reader :table
+ protected :table
+
+ ### Array Delegation ###
+
+ extend Forwardable
+ def_delegators :@table, :empty?, :length, :size
+
+ #
+ # Returns a duplicate table object, in column mode. This is handy for
+ # chaining in a single call without changing the table mode, but be aware
+ # that this method can consume a fair amount of memory for bigger data sets.
+ #
+ # This method returns the duplicate table for chaining. Don't chain
+ # destructive methods (like []=()) this way though, since you are working
+ # with a duplicate.
+ #
+ def by_col
+ self.class.new(@table.dup).by_col!
+ end
+
+ #
+ # Switches the mode of this table to column mode. All calls to indexing and
+ # iteration methods will work with columns until the mode is changed again.
+ #
+ # This method returns the table and is safe to chain.
+ #
+ def by_col!
+ @mode = :col
+
+ self
+ end
+
+ #
+ # Returns a duplicate table object, in mixed mode. This is handy for
+ # chaining in a single call without changing the table mode, but be aware
+ # that this method can consume a fair amount of memory for bigger data sets.
+ #
+ # This method returns the duplicate table for chaining. Don't chain
+ # destructive methods (like []=()) this way though, since you are working
+ # with a duplicate.
+ #
+ def by_col_or_row
+ self.class.new(@table.dup).by_col_or_row!
+ end
+
+ #
+ # Switches the mode of this table to mixed mode. All calls to indexing and
+ # iteration methods will use the default intelligent indexing system until
+ # the mode is changed again. In mixed mode an index is assumed to be a row
+ # reference while anything else is assumed to be column access by headers.
+ #
+ # This method returns the table and is safe to chain.
+ #
+ def by_col_or_row!
+ @mode = :col_or_row
+
+ self
+ end
+
+ #
+ # Returns a duplicate table object, in row mode. This is handy for chaining
+ # in a single call without changing the table mode, but be aware that this
+ # method can consume a fair amount of memory for bigger data sets.
+ #
+ # This method returns the duplicate table for chaining. Don't chain
+ # destructive methods (like []=()) this way though, since you are working
+ # with a duplicate.
+ #
+ def by_row
+ self.class.new(@table.dup).by_row!
+ end
+
+ #
+ # Switches the mode of this table to row mode. All calls to indexing and
+ # iteration methods will work with rows until the mode is changed again.
+ #
+ # This method returns the table and is safe to chain.
+ #
+ def by_row!
+ @mode = :row
+
+ self
+ end
+
+ #
+ # Returns the headers for the first row of this table (assumed to match all
+ # other rows). An empty Array is returned for empty tables.
+ #
+ def headers
+ if @table.empty?
+ Array.new
+ else
+ @table.first.headers
+ end
+ end
+
+ #
+ # In the default mixed mode, this method returns rows for index access and
+ # columns for header access. You can force the index association by first
+ # calling by_col!() or by_row!().
+ #
+ # Columns are returned as an Array of values. Altering that Array has no
+ # effect on the table.
+ #
+ def [](index_or_header)
+ if @mode == :row or # by index
+ (@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] }
+ end
+ end
+
+ #
+ # In the default mixed mode, this method assigns rows for index access and
+ # columns for header access. You can force the index association by first
+ # calling by_col!() or by_row!().
+ #
+ # Rows may be set to an Array of values (which will inherit the table's
+ # headers()) or a CSV::Row.
+ #
+ # Columns may be set to a single value, which is copied to each row of the
+ # column, or an Array of values. Arrays of values are assigned to rows top
+ # to bottom in row major order. Excess values are ignored and if the Array
+ # does not have a value for each row the extra rows will receive a +nil+.
+ #
+ # Assigning to an existing column or row clobbers the data. Assigning to
+ # new columns creates them at the right end of the table.
+ #
+ def []=(index_or_header, value)
+ if @mode == :row or # by index
+ (@mode == :col_or_row and index_or_header.is_a? Integer)
+ if value.is_a? Array
+ @table[index_or_header] = Row.new(headers, value)
+ else
+ @table[index_or_header] = value
+ end
+ else # set column
+ if value.is_a? Array # multiple values
+ @table.each_with_index do |row, i|
+ if row.header_row?
+ row[index_or_header] = index_or_header
+ else
+ row[index_or_header] = value[i]
+ end
+ end
+ else # repeated value
+ @table.each do |row|
+ if row.header_row?
+ row[index_or_header] = index_or_header
+ else
+ row[index_or_header] = value
+ end
+ end
+ end
+ end
+ end
+
+ #
+ # The mixed mode default is to treat a list of indices as row access,
+ # returning the rows indicated. Anything else is considered columnar
+ # access. For columnar access, the return set has an Array for each row
+ # with the values indicated by the headers in each Array. You can force
+ # column or row mode using by_col!() or by_row!().
+ #
+ # You cannot mix column and row access.
+ #
+ def values_at(*indices_or_headers)
+ if @mode == :row or # by indices
+ ( @mode == :col_or_row and indices_or_headers.all? do |index|
+ index.is_a?(Integer) or
+ ( index.is_a?(Range) and
+ index.first.is_a?(Integer) and
+ index.last.is_a?(Integer) )
+ end )
+ @table.values_at(*indices_or_headers)
+ else # by headers
+ @table.map { |row| row.values_at(*indices_or_headers) }
+ end
+ end
+
+ #
+ # Adds a new row to the bottom end of this table. You can provide an Array,
+ # which will be converted to a CSV::Row (inheriting the table's headers()),
+ # or a CSV::Row.
+ #
+ # This method returns the table for chaining.
+ #
+ def <<(row_or_array)
+ if row_or_array.is_a? Array # append Array
+ @table << Row.new(headers, row_or_array)
+ else # append Row
+ @table << row_or_array
+ end
+
+ self # for chaining
+ end
+
+ #
+ # A shortcut for appending multiple rows. Equivalent to:
+ #
+ # rows.each { |row| self << row }
+ #
+ # This method returns the table for chaining.
+ #
+ def push(*rows)
+ rows.each { |row| self << row }
+
+ self # for chaining
+ end
+
+ #
+ # Removes and returns the indicated column or row. In the default mixed
+ # mode indices refer to rows and everything else is assumed to be a column
+ # header. Use by_col!() or by_row!() to force the lookup.
+ #
+ def delete(index_or_header)
+ if @mode == :row or # by index
+ (@mode == :col_or_row and index_or_header.is_a? Integer)
+ @table.delete_at(index_or_header)
+ else # by header
+ @table.map { |row| row.delete(index_or_header).last }
+ end
+ end
+
+ #
+ # Removes any column or row for which the block returns +true+. In the
+ # default mixed mode or row mode, iteration is the standard row major
+ # walking of rows. In column mode, iteration will +yield+ two element
+ # tuples containing the column name and an Array of values for that column.
+ #
+ # This method returns the table for chaining.
+ #
+ def delete_if(&block)
+ if @mode == :row or @mode == :col_or_row # by index
+ @table.delete_if(&block)
+ else # by 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
+ end
+
+ include Enumerable
+
+ #
+ # In the default mixed mode or row mode, iteration is the standard row major
+ # walking of rows. In column mode, iteration will +yield+ two element
+ # tuples containing the column name and an Array of values for that column.
+ #
+ # This method returns the table for chaining.
+ #
+ def each(&block)
+ if @mode == :col
+ headers.each { |header| block[[header, self[header]]] }
+ else
+ @table.each(&block)
+ end
+
+ self # for chaining
+ end
+
+ # Returns +true+ if all rows of this table ==() +other+'s rows.
+ def ==(other)
+ @table == other.table
+ end
+
+ #
+ # Returns the table as an Array of Arrays. Headers will be the first row,
+ # then all of the field rows will follow.
+ #
+ def to_a
+ @table.inject([headers]) do |array, row|
+ if row.header_row?
+ array
+ else
+ array + [row.fields]
+ end
+ end
+ end
+
+ #
+ # Returns the table as a complete CSV String. Headers will be listed first,
+ # then all of the field rows.
+ #
+ # This method assumes you want the Table.headers(), unless you explicitly
+ # pass <tt>:write_headers => false</tt>.
+ #
+ 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
+
+ # Shows the mode and size of this table in a US-ASCII String.
+ def inspect
+ "#<#{self.class} mode:#{@mode} row_count:#{to_a.size}>".encode("US-ASCII")
end
end
+ # The error thrown when the parser encounters illegal CSV formatting.
+ class MalformedCSVError < RuntimeError; end
+
#
# A FieldInfo Struct contains details about a field's position in the data
# source it was read from. CSV will pass this Struct to some blocks that make
@@ -292,11 +915,7 @@ class CSV
# A Regexp used to find and convert some common DateTime formats.
DateTimeMatcher =
/ \A(?: (\w+,?\s+)?\w+\s+\d{1,2}\s+\d{1,2}:\d{1,2}:\d{1,2},?\s+\d{2,4} |
- \d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2} |
- # ISO-8601
- \d{4}-\d{2}-\d{2}
- (?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?(?:[+-]\d{2}(?::\d{2})|Z)?)?)?
- )\z /x
+ \d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2} )\z /x
# The encoding used by all converters.
ConverterEncoding = Encoding.find("UTF-8")
@@ -325,64 +944,61 @@ 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.match?(DateMatcher) ? Date.parse(e) : f
- rescue # encoding conversion or date parse errors
- f
- end
- },
- date_time: lambda { |f|
- begin
- e = f.encode(ConverterEncoding)
- e.match?(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
- # by name. You can select HeaderConverters with CSV.header_convert() or
+ # by name. You can select HeaderConverters with CSV.header_convert() or
# 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
+ # attempting a conversion. If your data cannot be transcoded to UTF-8 the
# conversion will fail and the header will remain unchanged.
#
# This Hash is intentionally left unfrozen and users should feel free to add
# values to it that can be accessed by all CSV objects.
#
- # To add a combo field, the value should be an Array of names. Combo fields
+ # To add a combo field, the value should be an Array of names. Combo fields
# can be nested with other combo fields.
#
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
}
}
#
- # The options used when no overrides are given by calling code. They are:
+ # The options used when no overrides are given by calling code. They are:
#
# <b><tt>:col_sep</tt></b>:: <tt>","</tt>
# <b><tt>:row_sep</tt></b>:: <tt>:auto</tt>
@@ -396,80 +1012,74 @@ 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+
- # <b><tt>:quote_empty</tt></b>:: +true+
- #
- 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,
- quote_empty: true,
- }.freeze
-
- class << self
- #
- # This method will return a CSV instance, just like CSV::new(), but the
- # instance will be cached and returned for all future calls to this method for
- # the same +data+ object (tested by Object#object_id()) with the same
- # +options+.
- #
- # If a block is given, the instance is passed to the block and the return
- # value becomes the return value of the block.
- #
- def instance(data = $stdout, **options)
- # 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))
-
- if block_given?
- yield instance # run block, if given, returning result
- else
- instance # or return the instance
- end
+ #
+ 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
+ # instance will be cached and returned for all future calls to this method for
+ # the same +data+ object (tested by Object#object_id()) with the same
+ # +options+.
+ #
+ # 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 = 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))
+
+ if block_given?
+ yield instance # run block, if given, returning result
+ else
+ instance # or return the instance
end
+ end
- #
- # :call-seq:
- # filter( **options ) { |row| ... }
- # filter( input, **options ) { |row| ... }
- # filter( input, output, **options ) { |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.
- # After the block returns, the row is appended to +output+ altered or not.
- #
- # The +input+ and +output+ arguments can be anything CSV::new() accepts
- # (generally String or IO objects). If not given, they default to
- # <tt>ARGF</tt> and <tt>$stdout</tt>.
- #
- # The +options+ parameter is also filtered down to CSV::new() after some
- # clever key parsing. Any key beginning with <tt>:in_</tt> or
- # <tt>:input_</tt> will have that leading identifier stripped and will only
- # be used in the +options+ Hash for the +input+ object. Keys starting with
- # <tt>:out_</tt> or <tt>:output_</tt> affect only +output+. All other keys
- # are assigned to both objects.
- #
- # The <tt>:output_row_sep</tt> +option+ defaults to
- # <tt>$INPUT_RECORD_SEPARATOR</tt> (<tt>$/</tt>).
- #
- def filter(input=nil, output=nil, **options)
- # parse options for input, output, or both
- in_options, out_options = Hash.new, {row_sep: $INPUT_RECORD_SEPARATOR}
- options.each do |key, value|
+ #
+ # :call-seq:
+ # 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.
+ # After the block returns, the row is appended to +output+ altered or not.
+ #
+ # The +input+ and +output+ arguments can be anything CSV::new() accepts
+ # (generally String or IO objects). If not given, they default to
+ # <tt>ARGF</tt> and <tt>$stdout</tt>.
+ #
+ # The +options+ parameter is also filtered down to CSV::new() after some
+ # clever key parsing. Any key beginning with <tt>:in_</tt> or
+ # <tt>:input_</tt> will have that leading identifier stripped and will only
+ # be used in the +options+ Hash for the +input+ object. Keys starting with
+ # <tt>:out_</tt> or <tt>:output_</tt> affect only +output+. All other keys
+ # are assigned to both objects.
+ #
+ # The <tt>:output_row_sep</tt> +option+ defaults to
+ # <tt>$INPUT_RECORD_SEPARATOR</tt> (<tt>$/</tt>).
+ #
+ def self.filter(*args)
+ # parse options for input, output, or both
+ in_options, out_options = Hash.new, {row_sep: $INPUT_RECORD_SEPARATOR}
+ 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
@@ -480,273 +1090,273 @@ class CSV
out_options[key] = value
end
end
- # build input and output wrappers
- input = new(input || ARGF, **in_options)
- output = new(output || $stdout, **out_options)
-
- # read, yield, write
- input.each do |row|
- yield row
- output << row
- end
end
+ # build input and output wrappers
+ input = new(args.shift || ARGF, in_options)
+ output = new(args.shift || $stdout, out_options)
+
+ # read, yield, write
+ input.each do |row|
+ yield row
+ output << row
+ end
+ end
- #
- # This method is intended as the primary interface for reading CSV files. You
- # pass a +path+ and any +options+ you wish to set for the read. Each row of
- # file will be passed to the provided +block+ in turn.
- #
- # The +options+ parameter can be anything CSV::new() understands. This method
- # also understands an additional <tt>:encoding</tt> parameter that you can use
- # to specify the Encoding of the data in the file to be read. You must provide
- # this unless your data is in Encoding::default_external(). CSV will use this
- # to determine how to parse the data. You may provide a second Encoding to
- # have the data transcoded as it is read. For example,
- # <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 foreach(path, mode="r", **options, &block)
- return to_enum(__method__, path, mode, **options) unless block_given?
- open(path, mode, **options) do |csv|
- csv.each(&block)
- end
+ #
+ # This method is intended as the primary interface for reading CSV files. You
+ # pass a +path+ and any +options+ you wish to set for the read. Each row of
+ # file will be passed to the provided +block+ in turn.
+ #
+ # The +options+ parameter can be anything CSV::new() understands. This method
+ # also understands an additional <tt>:encoding</tt> parameter that you can use
+ # to specify the Encoding of the data in the file to be read. You must provide
+ # this unless your data is in Encoding::default_external(). CSV will use this
+ # to determine how to parse the data. You may provide a second Encoding to
+ # have the data transcoded as it is read. For example,
+ # <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 = Hash.new, &block)
+ return to_enum(__method__, path, options) unless block
+ open(path, options) do |csv|
+ csv.each(&block)
end
+ end
- #
- # :call-seq:
- # generate( str, **options ) { |csv| ... }
- # generate( **options ) { |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
- # append CSV rows to the String and when the block exits, the final String
- # will be returned.
- #
- # Note that a passed String *is* modified by this method. Call dup() before
- # passing if you need a new String.
- #
- # The +options+ parameter can be anything CSV::new() understands. This method
- # understands an additional <tt>:encoding</tt> parameter when not passed a
- # String to set the base Encoding for the output. CSV needs this hint if you
- # plan to output non-ASCII compatible data.
- #
- def generate(str=nil, **options)
- # add a default empty String, if none was given
- if str
- str = StringIO.new(str)
- str.seek(0, IO::SEEK_END)
- else
- encoding = options[:encoding]
- str = +""
- str.force_encoding(encoding) if encoding
- end
- csv = new(str, **options) # wrap
- yield csv # yield for appending
- csv.string # return final String
+ #
+ # :call-seq:
+ # 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
+ # append CSV rows to the String and when the block exits, the final String
+ # will be returned.
+ #
+ # Note that a passed String *is* modified by this method. Call dup() before
+ # passing if you need a new String.
+ #
+ # The +options+ parameter can be anything CSV::new() understands. This method
+ # understands an additional <tt>:encoding</tt> parameter when not passed a
+ # 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(*args)
+ # add a default empty String, if none was given
+ if args.first.is_a? String
+ io = StringIO.new(args.shift)
+ io.seek(0, IO::SEEK_END)
+ args.unshift(io)
+ else
+ encoding = args[-1][:encoding] if args.last.is_a?(Hash)
+ str = ""
+ str.force_encoding(encoding) if encoding
+ args.unshift(str)
end
+ csv = new(*args) # wrap
+ yield csv # yield for appending
+ csv.string # return final String
+ end
- #
- # This method is a shortcut for converting a single row (Array) into a CSV
- # String.
- #
- # The +options+ parameter can be anything CSV::new() understands. This method
- # understands an additional <tt>:encoding</tt> parameter to set the base
- # Encoding for the output. This method will try to guess your Encoding from
- # the first non-+nil+ field in +row+, if possible, but you may need to use
- # this parameter as a backup plan.
- #
- # The <tt>:row_sep</tt> +option+ defaults to <tt>$INPUT_RECORD_SEPARATOR</tt>
- # (<tt>$/</tt>) when calling this method.
- #
- def generate_line(row, **options)
- options = {row_sep: $INPUT_RECORD_SEPARATOR}.merge(options)
- str = +""
- if options[:encoding]
- str.force_encoding(options[:encoding])
- elsif field = row.find {|f| f.is_a?(String)}
- str.force_encoding(field.encoding)
- end
- (new(str, **options) << row).string
+ #
+ # This method is a shortcut for converting a single row (Array) into a CSV
+ # String.
+ #
+ # The +options+ parameter can be anything CSV::new() understands. This method
+ # understands an additional <tt>:encoding</tt> parameter to set the base
+ # Encoding for the output. This method will try to guess your Encoding from
+ # the first non-+nil+ field in +row+, if possible, but you may need to use
+ # this parameter as a backup plan.
+ #
+ # 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 = 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
+ (new(str, options) << row).string
+ end
- #
- # :call-seq:
- # open( filename, mode = "rb", **options ) { |faster_csv| ... }
- # open( filename, **options ) { |faster_csv| ... }
- # open( filename, mode = "rb", **options )
- # open( filename, **options )
- #
- # This method opens an IO object, and wraps that with CSV. This is intended
- # as the primary interface for writing a CSV file.
- #
- # You must pass a +filename+ and may optionally add a +mode+ for Ruby's
- # open(). You may also pass an optional Hash containing any +options+
- # CSV::new() understands as the final argument.
- #
- # This method works like Ruby's open() call, in that it will pass a CSV object
- # to a provided block and close it when the block terminates, or it will
- # return the CSV object when no block is provided. (*Note*: This is different
- # from the Ruby 1.8 CSV library which passed rows to the block. Use
- # CSV::foreach() for that behavior.)
- #
- # You must provide a +mode+ with an embedded Encoding designator unless your
- # data is in Encoding::default_external(). CSV will check the Encoding of the
- # underlying IO object (set by the +mode+ you pass) to determine how to parse
- # the data. You may provide a second Encoding to have the data transcoded as
- # it is read just as you can with a normal call to IO::open(). For example,
- # <tt>"rb:UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file but
- # transcode it to UTF-8 before CSV parses it.
- #
- # An opened CSV object will delegate to many IO methods for convenience. You
- # may call:
- #
- # * binmode()
- # * binmode?()
- # * close()
- # * close_read()
- # * close_write()
- # * closed?()
- # * eof()
- # * eof?()
- # * external_encoding()
- # * fcntl()
- # * fileno()
- # * flock()
- # * flush()
- # * fsync()
- # * internal_encoding()
- # * ioctl()
- # * isatty()
- # * path()
- # * pid()
- # * pos()
- # * pos=()
- # * reopen()
- # * seek()
- # * stat()
- # * sync()
- # * sync=()
- # * tell()
- # * to_i()
- # * to_io()
- # * truncate()
- # * tty?()
- #
- def open(filename, mode="r", **options)
- # wrap a File opened with the remaining +args+ with no newline
- # decorator
- file_opts = {universal_newline: false}.merge(options)
+ #
+ # :call-seq:
+ # 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.
+ #
+ # You must pass a +filename+ and may optionally add a +mode+ for Ruby's
+ # open(). You may also pass an optional Hash containing any +options+
+ # CSV::new() understands as the final argument.
+ #
+ # This method works like Ruby's open() call, in that it will pass a CSV object
+ # to a provided block and close it when the block terminates, or it will
+ # return the CSV object when no block is provided. (*Note*: This is different
+ # from the Ruby 1.8 CSV library which passed rows to the block. Use
+ # CSV::foreach() for that behavior.)
+ #
+ # You must provide a +mode+ with an embedded Encoding designator unless your
+ # data is in Encoding::default_external(). CSV will check the Encoding of the
+ # underlying IO object (set by the +mode+ you pass) to determine how to parse
+ # the data. You may provide a second Encoding to have the data transcoded as
+ # it is read just as you can with a normal call to IO::open(). For example,
+ # <tt>"rb:UTF-32BE:UTF-8"</tt> would read UTF-32BE data from the file but
+ # transcode it to UTF-8 before CSV parses it.
+ #
+ # An opened CSV object will delegate to many IO methods for convenience. You
+ # may call:
+ #
+ # * binmode()
+ # * binmode?()
+ # * close()
+ # * close_read()
+ # * close_write()
+ # * closed?()
+ # * eof()
+ # * eof?()
+ # * external_encoding()
+ # * fcntl()
+ # * fileno()
+ # * flock()
+ # * flush()
+ # * fsync()
+ # * internal_encoding()
+ # * ioctl()
+ # * isatty()
+ # * path()
+ # * pid()
+ # * pos()
+ # * pos=()
+ # * reopen()
+ # * seek()
+ # * stat()
+ # * sync()
+ # * sync=()
+ # * tell()
+ # * to_i()
+ # * to_io()
+ # * truncate()
+ # * tty?()
+ #
+ 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(*args, file_opts)
+ rescue ArgumentError => e
+ raise unless /needs binmode/ =~ e.message and args.size == 1
+ args << "rb"
+ file_opts = {encoding: Encoding.default_external}.merge(file_opts)
+ retry
+ end
+ begin
+ csv = new(f, options)
+ rescue Exception
+ f.close
+ raise
+ end
+ # handle blocks like Ruby's open(), not like the CSV library
+ if block_given?
begin
- f = File.open(filename, mode, **file_opts)
- rescue ArgumentError => e
- raise unless /needs binmode/.match?(e.message) and mode == "r"
- mode = "rb"
- file_opts = {encoding: Encoding.default_external}.merge(file_opts)
- retry
- end
- begin
- csv = new(f, **options)
- rescue Exception
- f.close
- raise
- end
-
- # handle blocks like Ruby's open(), not like the CSV library
- if block_given?
- begin
- yield csv
- ensure
- csv.close
- end
- else
- csv
+ yield csv
+ ensure
+ csv.close
end
+ else
+ csv
end
+ end
- #
- # :call-seq:
- # parse( str, **options ) { |row| ... }
- # parse( str, **options )
- #
- # 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
- # anything CSV::new() understands.
- #
- def parse(str, **options, &block)
- csv = new(str, **options)
-
- return csv.each(&block) if block_given?
-
- # slurp contents, if no block is given
+ #
+ # :call-seq:
+ # 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+ Hash containing
+ # anything CSV::new() understands.
+ #
+ def self.parse(*args, &block)
+ csv = new(*args)
+ if block.nil? # slurp contents, if no block is given
begin
csv.read
ensure
csv.close
end
+ else # or pass each row to a provided block
+ csv.each(&block)
end
+ end
- #
- # This method is a shortcut for converting a single line of a CSV String into
- # an Array. Note that if +line+ contains multiple rows, anything beyond the
- # first row is ignored.
- #
- # The +options+ parameter can be anything CSV::new() understands.
- #
- def parse_line(line, **options)
- new(line, **options).shift
- end
+ #
+ # This method is a shortcut for converting a single line of a CSV String into
+ # an Array. Note that if +line+ contains multiple rows, anything beyond the
+ # first row is ignored.
+ #
+ # The +options+ parameter can be anything CSV::new() understands.
+ #
+ def self.parse_line(line, options = Hash.new)
+ new(line, options).shift
+ end
- #
- # Use to slurp a CSV file into an Array of Arrays. Pass the +path+ to the
- # file and any +options+ CSV::new() understands. This method also understands
- # an additional <tt>:encoding</tt> parameter that you can use to specify the
- # Encoding of the data in the file to be read. You must provide this unless
- # your data is in Encoding::default_external(). CSV will use this to determine
- # how to parse the data. You may provide a second Encoding to have the data
- # transcoded as it is read. For example,
- # <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 read(path, **options)
- open(path, **options) { |csv| csv.read }
- end
+ #
+ # Use to slurp a CSV file into an Array of Arrays. Pass the +path+ to the
+ # file and any +options+ CSV::new() understands. This method also understands
+ # an additional <tt>:encoding</tt> parameter that you can use to specify the
+ # Encoding of the data in the file to be read. You must provide this unless
+ # your data is in Encoding::default_external(). CSV will use this to determine
+ # how to parse the data. You may provide a second Encoding to have the data
+ # transcoded as it is read. For example,
+ # <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.read(path, *options)
+ open(path, *options) { |csv| csv.read }
+ end
- # Alias for CSV::read().
- def readlines(path, **options)
- read(path, **options)
- end
+ # Alias for CSV::read().
+ def self.readlines(*args)
+ read(*args)
+ end
- #
- # A shortcut for:
- #
- # CSV.read( path, { headers: true,
- # converters: :numeric,
- # header_converters: :symbol }.merge(options) )
- #
- def table(path, **options)
- default_options = {
- headers: true,
- converters: :numeric,
- header_converters: :symbol,
- }
- options = default_options.merge(options)
- read(path, **options)
- end
+ #
+ # A shortcut for:
+ #
+ # CSV.read( path, { headers: true,
+ # converters: :numeric,
+ # header_converters: :symbol }.merge(options) )
+ #
+ def self.table(path, options = Hash.new)
+ read( path, { headers: true,
+ converters: :numeric,
+ header_converters: :symbol }.merge(options) )
end
#
# This constructor will wrap either a String or IO object passed in +data+ for
- # reading and/or writing. In addition to the CSV instance methods, several IO
- # methods are delegated. (See CSV::open() for a complete list.) If you pass
+ # reading and/or writing. In addition to the CSV instance methods, several IO
+ # methods are delegated. (See CSV::open() for a complete list.) If you pass
# 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
- # reading). If you want it at the end (for writing), use CSV::generate().
+ # 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.
#
# You may set any reading and/or writing preferences in the +options+ Hash.
@@ -756,25 +1366,25 @@ class CSV
# This String will be transcoded into
# the data's Encoding before parsing.
# <b><tt>:row_sep</tt></b>:: The String appended to the end of each
- # row. This can be set to the special
+ # row. This can be set to the special
# <tt>:auto</tt> setting, which requests
# that CSV automatically discover this
- # from the data. Auto-discovery reads
+ # from the data. Auto-discovery reads
# ahead in the data looking for the next
# <tt>"\r\n"</tt>, <tt>"\n"</tt>, or
- # <tt>"\r"</tt> sequence. A sequence
+ # <tt>"\r"</tt> sequence. A sequence
# will be selected even if it occurs in
# a quoted field, assuming that you
# would have the same line endings
- # there. If none of those sequences is
+ # there. If none of those sequences is
# found, +data+ is <tt>ARGF</tt>,
# <tt>STDIN</tt>, <tt>STDOUT</tt>, or
# <tt>STDERR</tt>, or the stream is only
# available for output, the default
# <tt>$INPUT_RECORD_SEPARATOR</tt>
- # (<tt>$/</tt>) is used. Obviously,
- # discovery takes a little time. Set
- # manually if speed is important. Also
+ # (<tt>$/</tt>) is used. Obviously,
+ # discovery takes a little time. Set
+ # manually if speed is important. Also
# note that IO objects should be opened
# in binary mode on Windows if this
# feature will be used as the
@@ -786,7 +1396,7 @@ class CSV
# before parsing.
# <b><tt>:quote_char</tt></b>:: The character used to quote fields.
# This has to be a single character
- # String. This is useful for
+ # String. This is useful for
# application that incorrectly use
# <tt>'</tt> as the quote character
# instead of the correct <tt>"</tt>.
@@ -797,21 +1407,21 @@ class CSV
# before parsing.
# <b><tt>:field_size_limit</tt></b>:: This is a maximum size CSV will read
# ahead looking for the closing quote
- # for a field. (In truth, it reads to
+ # for a field. (In truth, it reads to
# the first line ending beyond this
- # size.) If a quote cannot be found
+ # size.) If a quote cannot be found
# within the limit CSV will raise a
# MalformedCSVError, assuming the data
- # is faulty. You can use this limit to
+ # is faulty. You can use this limit to
# prevent what are effectively DoS
- # attacks on the parser. However, this
+ # attacks on the parser. However, this
# limit can cause a legitimate parse to
# fail and thus is set to +nil+, or off,
# by default.
# <b><tt>:converters</tt></b>:: An Array of names from the Converters
# Hash and/or lambdas that handle custom
- # conversion. A single converter
- # doesn't have to be in an Array. All
+ # conversion. A single converter
+ # doesn't have to be in an Array. All
# built-in converters try to transcode
# fields to UTF-8 before converting.
# The conversion will fail if the data
@@ -821,7 +1431,7 @@ class CSV
# unconverted_fields() method will be
# added to all returned rows (Array or
# CSV::Row) that will return the fields
- # as they were before conversion. Note
+ # as they were before conversion. Note
# that <tt>:headers</tt> supplied by
# Array or String were not fields of the
# document and thus will have an empty
@@ -829,21 +1439,21 @@ class CSV
# <b><tt>:headers</tt></b>:: If set to <tt>:first_row</tt> or
# +true+, the initial row of the CSV
# file will be treated as a row of
- # headers. If set to an Array, the
+ # headers. If set to an Array, the
# contents will be used as the headers.
# If set to a String, the String is run
# through a call of CSV::parse_line()
# with the same <tt>:col_sep</tt>,
# <tt>:row_sep</tt>, and
# <tt>:quote_char</tt> as this instance
- # to produce an Array of headers. This
+ # to produce an Array of headers. This
# setting causes CSV#shift() to return
# rows as CSV::Row objects instead of
# Arrays and CSV#read() to return
# CSV::Table objects instead of an Array
# of Arrays.
# <b><tt>:return_headers</tt></b>:: When +false+, header rows are silently
- # swallowed. If set to +true+, header
+ # swallowed. If set to +true+, header
# rows are returned in a CSV::Row object
# with identical headers and
# fields (save that the fields do not go
@@ -854,12 +1464,12 @@ class CSV
# <b><tt>:header_converters</tt></b>:: Identical in functionality to
# <tt>:converters</tt> save that the
# conversions are only made to header
- # rows. All built-in converters try to
+ # rows. All built-in converters try to
# transcode headers to UTF-8 before
- # converting. The conversion will fail
+ # converting. The conversion will fail
# if the data cannot be transcoded,
# leaving the header unchanged.
- # <b><tt>:skip_blanks</tt></b>:: When setting a +true+ value, CSV will
+ # <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
@@ -869,9 +1479,9 @@ class CSV
# using <tt>:skip_lines</tt>, or
# inspecting fields.compact.empty? on
# each row.
- # <b><tt>:force_quotes</tt></b>:: When setting a +true+ value, CSV will
+ # <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 setting an object responding to
+ # <b><tt>:skip_lines</tt></b>:: When set to an object responding to
# <tt>match</tt>, every line matching
# it is considered a comment and ignored
# during parsing. When set to a String,
@@ -880,248 +1490,129 @@ 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 setting a +true+ value, CSV will
- # attempt to parse input not conformant
- # with RFC 4180, such as double quotes
- # in unquoted fields.
- # <b><tt>:nil_value</tt></b>:: When set an object, any values of an
- # empty field is replaced by the set
- # object, not nil.
- # <b><tt>:empty_value</tt></b>:: When setting an object, any values of a
- # blank string field is replaced by
- # the set object.
- # <b><tt>:quote_empty</tt></b>:: When setting a +true+ value, CSV will
- # quote empty values with double quotes.
- # When +false+, CSV will emit an
- # empty string for an empty field value.
- # <b><tt>:write_converters</tt></b>:: Converts values on each line with the
- # specified <tt>Proc</tt> object(s),
- # which receive a <tt>String</tt> value
- # and return a <tt>String</tt> or +nil+
- # value.
- # When an array is specified, each
- # converter will be applied in order.
- # <b><tt>:write_nil_value</tt></b>:: When a <tt>String</tt> value, +nil+
- # value(s) on each line will be replaced
- # with the specified value.
- # <b><tt>:write_empty_value</tt></b>:: When a <tt>String</tt> or +nil+ value,
- # empty value(s) on each line will be
- # replaced with the specified value.
- # <b><tt>:strip</tt></b>:: When setting a +true+ value, CSV will
- # strip "\t\r\n\f\v" around the values.
- # If you specify a string instead of
- # +true+, CSV will strip string. The
- # length of the string must be 1.
#
# 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,
- nil_value: nil,
- empty_value: "",
- quote_empty: true,
- write_converters: nil,
- write_nil_value: nil,
- write_empty_value: "",
- strip: false)
- raise ArgumentError.new("Cannot parse nil as CSV") if data.nil?
-
- if data.is_a?(String)
- @io = StringIO.new(data)
- @io.set_encoding(encoding || data.encoding)
- else
- @io = data
+ def initialize(data, options = Hash.new)
+ if data.nil?
+ raise ArgumentError.new("Cannot parse nil as CSV")
end
- @encoding = determine_encoding(encoding, internal_encoding)
- @base_fields_converter_options = {
- nil_value: nil_value,
- empty_value: empty_value,
- }
- @write_fields_converter_options = {
- nil_value: write_nil_value,
- empty_value: write_empty_value,
- }
- @initial_converters = converters
- @initial_header_converters = header_converters
- @initial_write_converters = write_converters
-
- @parser_options = {
- column_separator: col_sep,
- row_separator: row_sep,
- quote_character: quote_char,
- field_size_limit: field_size_limit,
- unconverted_fields: unconverted_fields,
- headers: headers,
- return_headers: return_headers,
- skip_blanks: skip_blanks,
- skip_lines: skip_lines,
- liberal_parsing: liberal_parsing,
- encoding: @encoding,
- nil_value: nil_value,
- empty_value: empty_value,
- strip: strip,
- }
- @parser = nil
- @parser_enumerator = nil
- @eof_error = nil
-
- @writer_options = {
- encoding: @encoding,
- force_encoding: (not encoding.nil?),
- force_quotes: force_quotes,
- headers: headers,
- write_headers: write_headers,
- column_separator: col_sep,
- row_separator: row_sep,
- quote_character: quote_char,
- quote_empty: quote_empty,
- }
+ # build the options for this read/write
+ options = DEFAULT_OPTIONS.merge(options)
- @writer = nil
- writer if @writer_options[:write_headers]
- end
+ # create the IO object we will read from
+ @io = data.is_a?(String) ? StringIO.new(data) : data
+ # honor the IO encoding if we can, otherwise default to ASCII-8BIT
+ @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) rescue ""
+ @re_chars = /#{%"[-\\]\\[\\.^$?*+{}()|# \r\n\t\f\v]".encode(@encoding)}/
+
+ init_separators(options)
+ init_parsers(options)
+ init_converters(options)
+ init_headers(options)
+ init_comments(options)
+
+ @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
- #
- # The encoded <tt>:col_sep</tt> used in parsing and writing.
- # See CSV::new for details.
- #
- def col_sep
- parser.column_separator
+ # track our own lineno since IO gets confused about line-ends is CSV fields
+ @lineno = 0
end
#
- # The encoded <tt>:row_sep</tt> used in parsing and writing.
- # See CSV::new for details.
+ # The encoded <tt>:col_sep</tt> used in parsing and writing. See CSV::new
+ # for details.
#
- def row_sep
- parser.row_separator
- end
-
+ attr_reader :col_sep
#
- # The encoded <tt>:quote_char</tt> used in parsing and writing.
- # See CSV::new for details.
+ # The encoded <tt>:row_sep</tt> used in parsing and writing. See CSV::new
+ # for details.
#
- def quote_char
- parser.quote_character
- end
-
+ attr_reader :row_sep
#
- # The limit for field size, if any.
- # See CSV::new for details.
+ # The encoded <tt>:quote_char</tt> used in parsing and writing. See CSV::new
+ # for details.
#
- def field_size_limit
- parser.field_size_limit
- end
+ attr_reader :quote_char
+ # The limit for field size, if any. See CSV::new for details.
+ attr_reader :field_size_limit
- #
- # The regex marking a line as a comment.
- # See CSV::new for details.
- #
- def skip_lines
- parser.skip_lines
- end
+ # The regex marking a line as a comment. See CSV::new for details
+ attr_reader :skip_lines
#
- # Returns the current list of converters in effect. See CSV::new for details.
+ # Returns the current list of converters in effect. See CSV::new for details.
# Built-in converters will be returned by name, while others will be returned
# as is.
#
def converters
- parser_fields_converter.map do |converter|
+ @converters.map do |converter|
name = Converters.rassoc(converter)
name ? name.first : converter
end
end
-
#
- # Returns +true+ if unconverted_fields() to parsed results.
- # See CSV::new for details.
+ # Returns +true+ if unconverted_fields() to parsed results. See CSV::new
+ # for details.
#
- def unconverted_fields?
- parser.unconverted_fields?
- end
-
+ def unconverted_fields?() @unconverted_fields end
#
# Returns +nil+ if headers will not be used, +true+ if they will but have not
- # yet been read, or the actual headers after they have been read.
- # See CSV::new for details.
+ # yet been read, or the actual headers after they have been read. See
+ # CSV::new for details.
#
def headers
- if @writer
- @writer.headers
- else
- parsed_headers = parser.headers
- return parsed_headers if parsed_headers
- raw_headers = @parser_options[:headers]
- raw_headers = nil if raw_headers == false
- raw_headers
- end
+ @headers || true if @use_headers
end
#
# Returns +true+ if headers will be returned as a row of results.
# See CSV::new for details.
#
- def return_headers?
- parser.return_headers?
- end
-
+ def return_headers?() @return_headers end
+ # Returns +true+ if headers are written in output. See CSV::new for details.
+ def write_headers?() @write_headers end
#
- # Returns +true+ if headers are written in output.
- # See CSV::new for details.
- #
- def write_headers?
- @writer_options[:write_headers]
- end
-
- #
- # Returns the current list of converters in effect for headers. See CSV::new
- # for details. Built-in converters will be returned by name, while others
+ # Returns the current list of converters in effect for headers. See CSV::new
+ # for details. Built-in converters will be returned by name, while others
# will be returned as is.
#
def header_converters
- header_fields_converter.map do |converter|
+ @header_converters.map do |converter|
name = HeaderConverters.rassoc(converter)
name ? name.first : converter
end
end
-
#
# Returns +true+ blank lines are skipped by the parser. See CSV::new
# for details.
#
- def skip_blanks?
- parser.skip_blanks?
- end
-
+ def skip_blanks?() @skip_blanks end
# Returns +true+ if all output fields are quoted. See CSV::new for details.
- def force_quotes?
- @writer_options[:force_quotes]
- end
-
- # Returns +true+ if illegal input is handled. See CSV::new for details.
- def liberal_parsing?
- parser.liberal_parsing?
- end
+ def force_quotes?() @force_quotes end
#
# The Encoding CSV is parsing or writing in. This will be the Encoding you
@@ -1130,90 +1621,26 @@ class CSV
attr_reader :encoding
#
- # The line number of the last row read from this file. Fields with nested
+ # The line number of the last row read from this file. Fields with nested
# line-end characters will not affect this count.
#
- def lineno
- if @writer
- @writer.lineno
- else
- parser.lineno
- end
- end
-
- #
- # The last row read from this file.
- #
- def line
- parser.line
- end
+ attr_reader :lineno
### IO and StringIO Delegation ###
extend Forwardable
- def_delegators :@io, :binmode, :close, :close_read, :close_write,
- :closed?, :external_encoding, :fcntl,
- :fileno, :flush, :fsync, :internal_encoding,
- :isatty, :pid, :pos, :pos=, :reopen,
- :seek, :string, :sync, :sync=, :tell,
- :truncate, :tty?
-
- def binmode?
- if @io.respond_to?(:binmode?)
- @io.binmode?
- else
- false
- end
- end
-
- def flock(*args)
- raise NotImplementedError unless @io.respond_to?(:flock)
- @io.flock(*args)
- end
-
- def ioctl(*args)
- raise NotImplementedError unless @io.respond_to?(:ioctl)
- @io.ioctl(*args)
- end
-
- def path
- @io.path if @io.respond_to?(:path)
- end
-
- def stat(*args)
- raise NotImplementedError unless @io.respond_to?(:stat)
- @io.stat(*args)
- end
-
- def to_i
- raise NotImplementedError unless @io.respond_to?(:to_i)
- @io.to_i
- end
-
- def to_io
- @io.respond_to?(:to_io) ? @io.to_io : @io
- end
-
- def eof?
- return false if @eof_error
- begin
- parser_enumerator.peek
- false
- rescue MalformedCSVError => error
- @eof_error = error
- false
- rescue StopIteration
- true
- end
- end
- alias_method :eof, :eof?
+ def_delegators :@io, :binmode, :binmode?, :close, :close_read, :close_write,
+ :closed?, :eof, :eof?, :external_encoding, :fcntl,
+ :fileno, :flock, :flush, :fsync, :internal_encoding,
+ :ioctl, :isatty, :path, :pid, :pos, :pos=, :reopen,
+ :seek, :stat, :string, :sync, :sync=, :tell, :to_i,
+ :to_io, :truncate, :tty?
# Rewinds the underlying IO object and resets CSV's lineno() counter.
def rewind
- @parser = nil
- @parser_enumerator = nil
- @eof_error = nil
- @writer.rewind if @writer
+ @headers = nil
+ @lineno = 0
+
@io.rewind
end
@@ -1221,14 +1648,41 @@ class CSV
#
# The primary write method for wrapped Strings and IOs, +row+ (an Array or
- # CSV::Row) is converted to CSV and appended to the data source. When a
+ # CSV::Row) is converted to CSV and appended to the data source. When a
# CSV::Row is passed, only the row's fields() are appended to the output.
#
# The data source must be open for writing.
#
def <<(row)
- writer << row
- self
+ # make sure headers have been assigned
+ 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
+ row = case row
+ when self.class::Row then row.fields
+ when Hash then @headers.map { |header| row[header] }
+ else row
+ end
+
+ @headers = row if header_row?
+ @lineno += 1
+
+ output = row.map(&@quote).join(@col_sep) + @row_sep # quote and separate
+ if @io.is_a?(StringIO) and
+ output.encoding != (encoding = raw_encoding)
+ if @force_encoding
+ output = output.encode(encoding)
+ elsif (compatible_encoding = Encoding.compatible?(@io.string, output))
+ @io.set_encoding(compatible_encoding)
+ @io.seek(0, IO::SEEK_END)
+ end
+ end
+ @io << output
+
+ self # for chaining
end
alias_method :add_row, :<<
alias_method :puts, :<<
@@ -1243,13 +1697,13 @@ class CSV
# block that handles a custom conversion.
#
# If you provide a block that takes one argument, it will be passed the field
- # and is expected to return the converted value or the field itself. If your
+ # and is expected to return the converted value or the field itself. If your
# block takes two arguments, it will also be passed a CSV::FieldInfo Struct,
- # containing details about the field. Again, the block should return a
+ # containing details about the field. Again, the block should return a
# converted field or the field itself.
#
def convert(name = nil, &converter)
- parser_fields_converter.add_converter(name, &converter)
+ add_converter(:converters, self.class::Converters, name, &converter)
end
#
@@ -1264,7 +1718,10 @@ class CSV
# effect.
#
def header_convert(name = nil, &converter)
- header_fields_converter.add_converter(name, &converter)
+ add_converter( :header_converters,
+ self.class::HeaderConverters,
+ name,
+ &converter )
end
include Enumerable
@@ -1276,8 +1733,14 @@ class CSV
#
# The data source must be open for reading.
#
- def each(&block)
- parser_enumerator.each(&block)
+ def each
+ if block_given?
+ while row = shift
+ yield row
+ end
+ else
+ to_enum
+ end
end
#
@@ -1287,8 +1750,8 @@ class CSV
#
def read
rows = to_a
- if parser.use_headers?
- Table.new(rows, headers: parser.headers)
+ if @use_headers
+ Table.new(rows)
else
rows
end
@@ -1297,7 +1760,7 @@ class CSV
# Returns +true+ if the next row read will be a header row.
def header_row?
- parser.header_row?
+ @use_headers and @headers.nil?
end
#
@@ -1308,14 +1771,146 @@ class CSV
# The data source must be open for reading.
#
def shift
- if @eof_error
- eof_error, @eof_error = @eof_error, nil
- raise eof_error
+ #########################################################################
+ ### This method is purposefully kept a bit long as simple conditional ###
+ ### checks are faster than numerous (expensive) method calls. ###
+ #########################################################################
+
+ # handle headers not based on document content
+ if header_row? and @return_headers and
+ [Array, String].include? @use_headers.class
+ if @unconverted_fields
+ return add_unconverted_fields(parse_headers, Array.new)
+ else
+ return parse_headers
+ end
end
- begin
- parser_enumerator.next
- rescue StopIteration
- nil
+
+ #
+ # it can take multiple calls to <tt>@io.gets()</tt> to get a full line,
+ # because of \r and/or \n characters embedded in quoted fields
+ #
+ in_extended_col = false
+ csv = Array.new
+
+ loop do
+ # add another read to the line
+ unless parse = @io.gets(@row_sep)
+ return nil
+ end
+
+ parse.sub!(@parsers[:line_end], "")
+
+ if csv.empty?
+ #
+ # I believe a blank line should be an <tt>Array.new</tt>, not Ruby 1.8
+ # CSV's <tt>[nil]</tt>
+ #
+ if parse.empty?
+ @lineno += 1
+ if @skip_blanks
+ next
+ elsif @unconverted_fields
+ return add_unconverted_fields(Array.new, Array.new)
+ elsif @use_headers
+ return self.class::Row.new(Array.new, Array.new)
+ else
+ return Array.new
+ end
+ end
+ end
+
+ next if @skip_lines and @skip_lines.match parse
+
+ parts = parse.split(@col_sep, -1)
+ if parts.empty?
+ if in_extended_col
+ csv[-1] << @col_sep # will be replaced with a @row_sep after the parts.each loop
+ else
+ csv << nil
+ end
+ end
+
+ # This loop is the hot path of csv parsing. Some things may be non-dry
+ # for a reason. Make sure to benchmark when refactoring.
+ parts.each do |part|
+ if in_extended_col
+ # If we are continuing a previous column
+ 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!(@quote_char * 2, @quote_char)
+ in_extended_col = false
+ else
+ csv.last << part
+ csv.last << @col_sep
+ end
+ 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]
+ csv.last << @col_sep
+ in_extended_col = true
+ 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!(@quote_char * 2, @quote_char)
+ end
+ elsif part =~ @parsers[:quote_or_nl]
+ # Unquoted field with bad characters.
+ if part =~ @parsers[:nl_or_lf]
+ raise MalformedCSVError, "Unquoted fields do not allow " +
+ "\\r or \\n (line #{lineno + 1})."
+ else
+ raise MalformedCSVError, "Illegal quoting in line #{lineno + 1}."
+ end
+ else
+ # Regular ole unquoted field.
+ csv << (part.empty? ? nil : part)
+ end
+ end
+
+ # Replace tacked on @col_sep with @row_sep if we are still in an extended
+ # column.
+ csv[-1][-1] = @row_sep if in_extended_col
+
+ if in_extended_col
+ # if we're at eof?(), a quoted field wasn't closed...
+ if @io.eof?
+ raise MalformedCSVError,
+ "Unclosed quoted field on line #{lineno + 1}."
+ elsif @field_size_limit and csv.last.size >= @field_size_limit
+ raise MalformedCSVError, "Field size exceeded on line #{lineno + 1}."
+ end
+ # otherwise, we need to loop and pull some more data to complete the row
+ else
+ @lineno += 1
+
+ # save fields unconverted fields, if needed...
+ unconverted = csv.dup if @unconverted_fields
+
+ # convert fields, if needed...
+ csv = convert_fields(csv) unless @use_headers or @converters.empty?
+ # parse out header rows and handle CSV::Row conversions...
+ csv = parse_headers(csv) if @use_headers
+
+ # inject unconverted fields and accessor, if requested...
+ if @unconverted_fields and not csv.respond_to? :unconverted_fields
+ add_unconverted_fields(csv, unconverted)
+ end
+
+ # return the results
+ break csv
+ end
end
end
alias_method :gets, :shift
@@ -1326,7 +1921,7 @@ class CSV
# ASCII compatible String.
#
def inspect
- str = ["#<", self.class.to_s, " io_type:"]
+ str = ["<#", self.class.to_s, " io_type:"]
# show type of wrapped IO
if @io == $stdout then str << "$stdout"
elsif @io == $stdin then str << "$stdin"
@@ -1340,18 +1935,15 @@ class CSV
# show encoding
str << " encoding:" << @encoding.name
# show other attributes
- ["lineno", "col_sep", "row_sep", "quote_char"].each do |attr_name|
- if a = __send__(attr_name)
+ %w[ lineno col_sep row_sep
+ quote_char skip_blanks ].each do |attr_name|
+ if a = instance_variable_get("@#{attr_name}")
str << " " << attr_name << ":" << a.inspect
end
end
- ["skip_blanks", "liberal_parsing"].each do |attr_name|
- if a = __send__("#{attr_name}?")
- str << " " << attr_name << ":" << a.inspect
- end
+ if @use_headers
+ str << " headers:" << headers.inspect
end
- _headers = headers
- str << " headers:" << _headers.inspect if _headers
str << ">"
begin
str.join('')
@@ -1365,126 +1957,346 @@ class CSV
private
- def determine_encoding(encoding, internal_encoding)
- # honor the IO encoding if we can, otherwise default to ASCII-8BIT
- io_encoding = raw_encoding
- return io_encoding if io_encoding
-
- return Encoding.find(internal_encoding) if internal_encoding
+ #
+ # Stores the indicated separators for later use.
+ #
+ # If auto-discovery was requested for <tt>@row_sep</tt>, this method will read
+ # ahead in the <tt>@io</tt> and try to find one. +ARGF+, +STDIN+, +STDOUT+,
+ # +STDERR+ and any stream open for output only with a default
+ # <tt>@row_sep</tt> of <tt>$INPUT_RECORD_SEPARATOR</tt> (<tt>$/</tt>).
+ #
+ # This method also establishes the quoting rules used for CSV output.
+ #
+ def init_separators(options)
+ # store the selected separators
+ @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 encoding
- encoding, = encoding.split(":", 2) if encoding.is_a?(String)
- return Encoding.find(encoding)
+ if @quote_char.length != 1
+ raise ArgumentError, ":quote_char has to be a single character String"
end
- Encoding.default_internal || Encoding.default_external
- end
-
- def normalize_converters(converters)
- converters ||= []
- unless converters.is_a?(Array)
- converters = [converters]
- end
- converters.collect do |converter|
- case converter
- when Proc # custom code block
- [nil, converter]
- else # by name
- [converter, nil]
+ #
+ # automatically discover row separator when requested
+ # (not fully encoding safe)
+ #
+ if @row_sep == :auto
+ if [ARGF, STDIN, STDOUT, STDERR].include?(@io) or
+ (defined?(Zlib) and @io.class == Zlib::GzipWriter)
+ @row_sep = $INPUT_RECORD_SEPARATOR
+ else
+ begin
+ #
+ # remember where we were (pos() will raise an exception if @io is pipe
+ # or not opened for reading)
+ #
+ saved_pos = @io.pos
+ while @row_sep == :auto
+ #
+ # if we run out of data, it's probably a single line
+ # (ensure will set default value)
+ #
+ break unless sample = @io.gets(nil, 1024)
+ # extend sample if we're unsure of the line ending
+ if sample.end_with? encode_str("\r")
+ sample << (@io.gets(nil, 1) || "")
+ end
+
+ # try to find a standard separator
+ if sample =~ encode_re("\r\n?|\n")
+ @row_sep = $&
+ break
+ end
+ end
+
+ # tricky seek() clone to work around GzipReader's lack of seek()
+ @io.rewind
+ # reset back to the remembered position
+ while saved_pos > 1024 # avoid loading a lot of data into memory
+ @io.read(1024)
+ saved_pos -= 1024
+ end
+ @io.read(saved_pos) if saved_pos.nonzero?
+ rescue IOError # not opened for reading
+ # do nothing: ensure will set default
+ rescue NoMethodError # Zlib::GzipWriter doesn't have some IO methods
+ # do nothing: ensure will set default
+ rescue SystemCallError # pipe
+ # do nothing: ensure will set default
+ ensure
+ #
+ # set default if we failed to detect
+ # (stream not opened for reading, a pipe, or a single line of data)
+ #
+ @row_sep = $INPUT_RECORD_SEPARATOR if @row_sep == :auto
+ end
end
end
- end
-
- #
- # Processes +fields+ with <tt>@converters</tt>, or <tt>@header_converters</tt>
- # if +headers+ is passed as +true+, returning the converted field set. Any
- # converter that changes the field into something other than a String halts
- # the pipeline of conversion for that field. This is primarily an efficiency
- # shortcut.
- #
- def convert_fields(fields, headers = false)
- if headers
- header_fields_converter.convert(fields, nil, 0)
+ @row_sep = @row_sep.to_s.encode(@encoding)
+
+ # establish quoting rules
+ @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
+ end
+ quotable_chars = encode_str("\r\n", @col_sep, @quote_char)
+ @quote = if @force_quotes
+ do_quote
else
- parser_fields_converter.convert(fields, @headers, lineno)
+ lambda do |field|
+ if field.nil? # represent +nil+ fields as empty unquoted fields
+ ""
+ else
+ field = String(field) # Stringify fields
+ # represent empty fields as empty quoted fields
+ if field.empty? or
+ field.count(quotable_chars).nonzero?
+ do_quote.call(field)
+ else
+ field # unquoted field
+ end
+ end
+ end
end
end
+ # Pre-compiles parsers and stores them by name for access during reads.
+ def init_parsers(options)
+ # store the parser behaviors
+ @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)
+ esc_quote = escape_re(@quote_char)
+ @parsers = {
+ # for detecting parse errors
+ quote_or_nl: encode_re("[", esc_quote, "\r\n]"),
+ nl_or_lf: encode_re("[\r\n]"),
+ stray_quote: encode_re( "[^", esc_quote, "]", esc_quote,
+ "[^", esc_quote, "]" ),
+ # safer than chomp!()
+ line_end: encode_re(esc_row_sep, "\\z"),
+ # illegal unquoted characters
+ return_newline: encode_str("\r\n")
+ }
+ end
+
#
- # Returns the encoding of the internal IO object.
+ # Loads any converters requested during construction.
#
- def raw_encoding
- if @io.respond_to? :internal_encoding
- @io.internal_encoding || @io.external_encoding
- elsif @io.respond_to? :encoding
- @io.encoding
- else
- nil
+ # If +field_name+ is set <tt>:converters</tt> (the default) field converters
+ # are set. When +field_name+ is <tt>:header_converters</tt> header converters
+ # are added instead.
+ #
+ # The <tt>:unconverted_fields</tt> option is also actived for
+ # <tt>:converters</tt> calls, if requested.
+ #
+ def init_converters(options, field_name = :converters)
+ if field_name == :converters
+ @unconverted_fields = options.delete(:unconverted_fields)
end
- end
- def parser_fields_converter
- @parser_fields_converter ||= build_parser_fields_converter
- end
+ instance_variable_set("@#{field_name}", Array.new)
- def build_parser_fields_converter
- specific_options = {
- builtin_converters: Converters,
- }
- options = @base_fields_converter_options.merge(specific_options)
- build_fields_converter(@initial_converters, options)
- end
+ # find the correct method to add the converters
+ convert = method(field_name.to_s.sub(/ers\Z/, ""))
- def header_fields_converter
- @header_fields_converter ||= build_header_fields_converter
+ # load converters
+ 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
- def build_header_fields_converter
- specific_options = {
- builtin_converters: HeaderConverters,
- accept_nil: true,
- }
- options = @base_fields_converter_options.merge(specific_options)
- build_fields_converter(@initial_header_converters, options)
+ # 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
- def writer_fields_converter
- @writer_fields_converter ||= build_writer_fields_converter
+ # Stores the pattern of comments to skip from the provided options.
+ #
+ # The pattern must respond to +.match+, else ArgumentError is raised.
+ # Strings are converted to a Regexp.
+ #
+ # See also CSV.new
+ 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
+ end
+ #
+ # The actual work method for adding converters, used by both CSV.convert() and
+ # CSV.header_convert().
+ #
+ # This method requires the +var_name+ of the instance variable to place the
+ # converters in, the +const+ Hash to lookup named converters in, and the
+ # normal parameters of the CSV.convert() and CSV.header_convert() methods.
+ #
+ def add_converter(var_name, const, name = nil, &converter)
+ if name.nil? # custom converter
+ instance_variable_get("@#{var_name}") << converter
+ else # named converter
+ combo = const[name]
+ case combo
+ when Array # combo converter
+ combo.each do |converter_name|
+ add_converter(var_name, const, converter_name)
+ end
+ else # individual named converter
+ instance_variable_get("@#{var_name}") << combo
+ end
+ end
end
- def build_writer_fields_converter
- build_fields_converter(@initial_write_converters,
- @write_fields_converter_options)
+ #
+ # Processes +fields+ with <tt>@converters</tt>, or <tt>@header_converters</tt>
+ # if +headers+ is passed as +true+, returning the converted field set. Any
+ # converter that changes the field into something other than a String halts
+ # the pipeline of conversion for that field. This is primarily an efficiency
+ # shortcut.
+ #
+ def convert_fields(fields, headers = false)
+ # see if we are converting headers or fields
+ converters = headers ? @header_converters : @converters
+
+ fields.map.with_index do |field, index|
+ converters.each do |converter|
+ break if field.nil?
+ field = if converter.arity == 1 # straight field converter
+ converter[field]
+ else # FieldInfo converter
+ header = @use_headers && !headers ? @headers[index] : nil
+ converter[field, FieldInfo.new(index, lineno, header)]
+ end
+ break unless field.is_a? String # short-circuit pipeline for speed
+ end
+ field # final state of each field, converted or original
+ end
end
- def build_fields_converter(initial_converters, options)
- fields_converter = FieldsConverter.new(options)
- normalize_converters(initial_converters).each do |name, converter|
- fields_converter.add_converter(name, &converter)
+ #
+ # This method is used to turn a finished +row+ into a CSV::Row. Header rows
+ # are also dealt with here, either by returning a CSV::Row with identical
+ # headers and fields (save that the fields do not go through the converters)
+ # or by reading past them to return a field row. Headers are also saved in
+ # <tt>@headers</tt> for use in future rows.
+ #
+ # When +nil+, +row+ is assumed to be a header row not based on an actual row
+ # of the stream.
+ #
+ def parse_headers(row = nil)
+ if @headers.nil? # header row
+ @headers = case @use_headers # save headers
+ # Array of headers
+ when Array then @use_headers
+ # CSV header String
+ when String
+ self.class.parse_line( @use_headers,
+ col_sep: @col_sep,
+ row_sep: @row_sep,
+ quote_char: @quote_char )
+ # first row is headers
+ else row
+ end
+
+ # prepare converted and unconverted copies
+ row = @headers if row.nil?
+ @headers = convert_fields(@headers, true)
+ @headers.each { |h| h.freeze if h.is_a? String }
+
+ if @return_headers # return headers
+ return self.class::Row.new(@headers, row, true)
+ elsif not [Array, String].include? @use_headers.class # skip to field row
+ return shift
+ end
end
- fields_converter
+
+ self.class::Row.new(@headers, convert_fields(row)) # field row
end
- def parser
- @parser ||= Parser.new(@io, parser_options)
+ #
+ # This method injects an instance variable <tt>unconverted_fields</tt> into
+ # +row+ and an accessor method for +row+ called unconverted_fields(). The
+ # variable is set to the contents of +fields+.
+ #
+ def add_unconverted_fields(row, fields)
+ class << row
+ attr_reader :unconverted_fields
+ end
+ row.instance_eval { @unconverted_fields = fields }
+ row
end
- def parser_options
- @parser_options.merge(header_fields_converter: header_fields_converter,
- fields_converter: parser_fields_converter)
+ #
+ # This method is an encoding safe version of Regexp::escape(). It will escape
+ # any characters that would change the meaning of a regular expression in the
+ # encoding of +str+. Regular expression characters that cannot be transcoded
+ # to the target encoding will be skipped and no escaping will be performed if
+ # a backslash cannot be transcoded.
+ #
+ def escape_re(str)
+ str.gsub(@re_chars) {|c| @re_esc + c}
end
- def parser_enumerator
- @parser_enumerator ||= parser.parse
+ #
+ # Builds a regular expression in <tt>@encoding</tt>. All +chunks+ will be
+ # transcoded to that encoding.
+ #
+ def encode_re(*chunks)
+ Regexp.new(encode_str(*chunks))
end
- def writer
- @writer ||= Writer.new(@io, writer_options)
+ #
+ # Builds a String in <tt>@encoding</tt>. All +chunks+ will be transcoded to
+ # that encoding.
+ #
+ def encode_str(*chunks)
+ chunks.map { |chunk| chunk.encode(@encoding.name) }.join('')
end
- def writer_options
- @writer_options.merge(header_fields_converter: header_fields_converter,
- fields_converter: writer_fields_converter)
+ private
+
+ #
+ # Returns the encoding of the internal IO object or the +default+ if the
+ # encoding cannot be determined.
+ #
+ def raw_encoding(default = Encoding::ASCII_8BIT)
+ if @io.respond_to? :internal_encoding
+ @io.internal_encoding || @io.external_encoding
+ elsif @io.is_a? StringIO
+ @io.string.encoding
+ elsif @io.respond_to? :encoding
+ @io.encoding
+ else
+ default
+ end
end
end
@@ -1508,6 +2320,22 @@ def CSV(*args, &block)
CSV.instance(*args, &block)
end
-require_relative "csv/version"
-require_relative "csv/core_ext/array"
-require_relative "csv/core_ext/string"
+class Array # :nodoc:
+ # Equivalent to CSV::generate_line(self, options)
+ #
+ # ["CSV", "data"].to_csv
+ # #=> "CSV,data\n"
+ def to_csv(options = Hash.new)
+ CSV.generate_line(self, options)
+ end
+end
+
+class String # :nodoc:
+ # Equivalent to CSV::parse_line(self, options)
+ #
+ # "CSV,data".parse_csv
+ # #=> ["CSV", "data"]
+ def parse_csv(options = Hash.new)
+ CSV.parse_line(self, options)
+ end
+end
diff --git a/lib/csv/core_ext/array.rb b/lib/csv/core_ext/array.rb
deleted file mode 100644
index 8beb06b082..0000000000
--- a/lib/csv/core_ext/array.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class Array # :nodoc:
- # Equivalent to CSV::generate_line(self, options)
- #
- # ["CSV", "data"].to_csv
- # #=> "CSV,data\n"
- def to_csv(**options)
- CSV.generate_line(self, **options)
- end
-end
diff --git a/lib/csv/core_ext/string.rb b/lib/csv/core_ext/string.rb
deleted file mode 100644
index 9b1d31c2a4..0000000000
--- a/lib/csv/core_ext/string.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class String # :nodoc:
- # Equivalent to CSV::parse_line(self, options)
- #
- # "CSV,data".parse_csv
- # #=> ["CSV", "data"]
- def parse_csv(**options)
- CSV.parse_line(self, **options)
- end
-end
diff --git a/lib/csv/csv.gemspec b/lib/csv/csv.gemspec
deleted file mode 100644
index 98110bc13c..0000000000
--- a/lib/csv/csv.gemspec
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-begin
- require_relative "lib/csv/version"
-rescue LoadError
- # for Ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "csv"
- spec.version = CSV::VERSION
- spec.authors = ["James Edward Gray II", "Kouhei Sutou"]
- spec.email = [nil, "kou@cozmixng.org"]
-
- spec.summary = "CSV Reading and Writing"
- spec.description = "The CSV library provides a complete interface to CSV files and data. It offers tools to enable you to read and write to and from Strings or IO objects, as needed."
- spec.homepage = "https://github.com/ruby/csv"
- spec.license = "BSD-2-Clause"
-
- spec.files = [
- "LICENSE.txt",
- "NEWS.md",
- "README.md",
- "lib/csv.rb",
- "lib/csv/core_ext/array.rb",
- "lib/csv/core_ext/string.rb",
- "lib/csv/delete_suffix.rb",
- "lib/csv/fields_converter.rb",
- "lib/csv/match_p.rb",
- "lib/csv/parser.rb",
- "lib/csv/row.rb",
- "lib/csv/table.rb",
- "lib/csv/version.rb",
- "lib/csv/writer.rb",
- ]
- 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 "benchmark_driver"
- spec.add_development_dependency "simplecov"
-end
diff --git a/lib/csv/delete_suffix.rb b/lib/csv/delete_suffix.rb
deleted file mode 100644
index d457718997..0000000000
--- a/lib/csv/delete_suffix.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-# This provides String#delete_suffix? for Ruby 2.4.
-unless String.method_defined?(:delete_suffix)
- class CSV
- module DeleteSuffix
- refine String do
- def delete_suffix(suffix)
- if end_with?(suffix)
- self[0...-suffix.size]
- else
- self
- end
- end
- end
- end
- end
-end
diff --git a/lib/csv/fields_converter.rb b/lib/csv/fields_converter.rb
deleted file mode 100644
index a751c9ea1d..0000000000
--- a/lib/csv/fields_converter.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-class CSV
- # Note: Don't use this class directly. This is an internal class.
- class FieldsConverter
- include Enumerable
- #
- # A CSV::FieldsConverter is a data structure for storing the
- # fields converter properties to be passed as a parameter
- # when parsing a new file (e.g. CSV::Parser.new(@io, parser_options))
- #
-
- def initialize(options={})
- @converters = []
- @nil_value = options[:nil_value]
- @empty_value = options[:empty_value]
- @empty_value_is_empty_string = (@empty_value == "")
- @accept_nil = options[:accept_nil]
- @builtin_converters = options[:builtin_converters]
- @need_static_convert = need_static_convert?
- end
-
- def add_converter(name=nil, &converter)
- if name.nil? # custom converter
- @converters << converter
- else # named converter
- combo = @builtin_converters[name]
- case combo
- when Array # combo converter
- combo.each do |sub_name|
- add_converter(sub_name)
- end
- else # individual named converter
- @converters << combo
- end
- end
- end
-
- def each(&block)
- @converters.each(&block)
- end
-
- def empty?
- @converters.empty?
- end
-
- def convert(fields, headers, lineno)
- return fields unless need_convert?
-
- fields.collect.with_index do |field, index|
- if field.nil?
- field = @nil_value
- elsif field.empty?
- field = @empty_value unless @empty_value_is_empty_string
- end
- @converters.each do |converter|
- break if field.nil? and @accept_nil
- if converter.arity == 1 # straight field converter
- field = converter[field]
- else # FieldInfo converter
- if headers
- header = headers[index]
- else
- header = nil
- end
- field = converter[field, FieldInfo.new(index, lineno, header)]
- end
- break unless field.is_a?(String) # short-circuit pipeline for speed
- end
- field # final state of each field, converted or original
- end
- end
-
- private
- def need_static_convert?
- not (@nil_value.nil? and @empty_value_is_empty_string)
- end
-
- def need_convert?
- @need_static_convert or
- (not @converters.empty?)
- end
- end
-end
diff --git a/lib/csv/match_p.rb b/lib/csv/match_p.rb
deleted file mode 100644
index 775559a3eb..0000000000
--- a/lib/csv/match_p.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-# This provides String#match? and Regexp#match? for Ruby 2.3.
-unless String.method_defined?(:match?)
- class CSV
- module MatchP
- refine String do
- def match?(pattern)
- self =~ pattern
- end
- end
-
- refine Regexp do
- def match?(string)
- self =~ string
- end
- end
- end
- end
-end
diff --git a/lib/csv/parser.rb b/lib/csv/parser.rb
deleted file mode 100644
index 42145f8923..0000000000
--- a/lib/csv/parser.rb
+++ /dev/null
@@ -1,1136 +0,0 @@
-# frozen_string_literal: true
-
-require "strscan"
-
-require_relative "delete_suffix"
-require_relative "match_p"
-require_relative "row"
-require_relative "table"
-
-using CSV::DeleteSuffix if CSV.const_defined?(:DeleteSuffix)
-using CSV::MatchP if CSV.const_defined?(:MatchP)
-
-class CSV
- # Note: Don't use this class directly. This is an internal class.
- class Parser
- #
- # A CSV::Parser is m17n aware. The parser works in the Encoding of the IO
- # or String object being read from or written to. Your data is never transcoded
- # (unless you ask Ruby to transcode it for you) and will literally be parsed in
- # the Encoding it is in. Thus CSV will return Arrays or Rows of Strings in the
- # Encoding of your data. This is accomplished by transcoding the parser itself
- # into your Encoding.
- #
-
- # Raised when encoding is invalid.
- class InvalidEncoding < StandardError
- end
-
- #
- # CSV::Scanner receives a CSV output, scans it and return the content.
- # It also controls the life cycle of the object with its methods +keep_start+,
- # +keep_end+, +keep_back+, +keep_drop+.
- #
- # Uses StringScanner (the official strscan gem). Strscan provides lexical
- # scanning operations on a String. We inherit its object and take advantage
- # on the methods. For more information, please visit:
- # https://ruby-doc.org/stdlib-2.6.1/libdoc/strscan/rdoc/StringScanner.html
- #
- class Scanner < StringScanner
- alias_method :scan_all, :scan
-
- def initialize(*args)
- super
- @keeps = []
- end
-
- def each_line(row_separator)
- position = pos
- rest.each_line(row_separator) do |line|
- position += line.bytesize
- self.pos = position
- yield(line)
- end
- end
-
- def keep_start
- @keeps.push(pos)
- end
-
- def keep_end
- start = @keeps.pop
- string.byteslice(start, pos - start)
- end
-
- def keep_back
- self.pos = @keeps.pop
- end
-
- def keep_drop
- @keeps.pop
- end
- end
-
- #
- # CSV::InputsScanner receives IO inputs, encoding and the chunk_size.
- # It also controls the life cycle of the object with its methods +keep_start+,
- # +keep_end+, +keep_back+, +keep_drop+.
- #
- # CSV::InputsScanner.scan() tries to match with pattern at the current position.
- # If there's a match, the scanner advances the “scan pointer†and returns the matched string.
- # Otherwise, the scanner returns nil.
- #
- # CSV::InputsScanner.rest() returns the “rest†of the string (i.e. everything after the scan pointer).
- # If there is no more data (eos? = true), it returns "".
- #
- class InputsScanner
- def initialize(inputs, encoding, chunk_size: 8192)
- @inputs = inputs.dup
- @encoding = encoding
- @chunk_size = chunk_size
- @last_scanner = @inputs.empty?
- @keeps = []
- read_chunk
- end
-
- def each_line(row_separator)
- buffer = nil
- input = @scanner.rest
- position = @scanner.pos
- offset = 0
- n_row_separator_chars = row_separator.size
- while true
- input.each_line(row_separator) do |line|
- @scanner.pos += line.bytesize
- if buffer
- if n_row_separator_chars == 2 and
- buffer.end_with?(row_separator[0]) and
- line.start_with?(row_separator[1])
- buffer << line[0]
- line = line[1..-1]
- position += buffer.bytesize + offset
- @scanner.pos = position
- offset = 0
- yield(buffer)
- buffer = nil
- next if line.empty?
- else
- buffer << line
- line = buffer
- buffer = nil
- end
- end
- if line.end_with?(row_separator)
- position += line.bytesize + offset
- @scanner.pos = position
- offset = 0
- yield(line)
- else
- buffer = line
- end
- end
- break unless read_chunk
- input = @scanner.rest
- position = @scanner.pos
- offset = -buffer.bytesize if buffer
- end
- yield(buffer) if buffer
- end
-
- def scan(pattern)
- value = @scanner.scan(pattern)
- return value if @last_scanner
-
- if value
- read_chunk if @scanner.eos?
- return value
- else
- nil
- end
- end
-
- def scan_all(pattern)
- value = @scanner.scan(pattern)
- return value if @last_scanner
-
- return nil if value.nil?
- while @scanner.eos? and read_chunk and (sub_value = @scanner.scan(pattern))
- value << sub_value
- end
- value
- end
-
- def eos?
- @scanner.eos?
- end
-
- def keep_start
- @keeps.push([@scanner.pos, nil])
- end
-
- def keep_end
- start, buffer = @keeps.pop
- keep = @scanner.string.byteslice(start, @scanner.pos - start)
- if buffer
- buffer << keep
- keep = buffer
- end
- keep
- end
-
- def keep_back
- start, buffer = @keeps.pop
- if buffer
- string = @scanner.string
- keep = string.byteslice(start, string.bytesize - start)
- if keep and not keep.empty?
- @inputs.unshift(StringIO.new(keep))
- @last_scanner = false
- end
- @scanner = StringScanner.new(buffer)
- else
- @scanner.pos = start
- end
- read_chunk if @scanner.eos?
- end
-
- def keep_drop
- @keeps.pop
- end
-
- def rest
- @scanner.rest
- end
-
- private
- def read_chunk
- return false if @last_scanner
-
- unless @keeps.empty?
- keep = @keeps.last
- keep_start = keep[0]
- string = @scanner.string
- keep_data = string.byteslice(keep_start, @scanner.pos - keep_start)
- if keep_data
- keep_buffer = keep[1]
- if keep_buffer
- keep_buffer << keep_data
- else
- keep[1] = keep_data.dup
- end
- end
- keep[0] = 0
- end
-
- input = @inputs.first
- case input
- when StringIO
- string = input.read
- raise InvalidEncoding unless string.valid_encoding?
- @scanner = StringScanner.new(string)
- @inputs.shift
- @last_scanner = @inputs.empty?
- true
- else
- chunk = input.gets(nil, @chunk_size)
- if chunk
- raise InvalidEncoding unless chunk.valid_encoding?
- @scanner = StringScanner.new(chunk)
- if input.respond_to?(:eof?) and input.eof?
- @inputs.shift
- @last_scanner = @inputs.empty?
- end
- true
- else
- @scanner = StringScanner.new("".encode(@encoding))
- @inputs.shift
- @last_scanner = @inputs.empty?
- if @last_scanner
- false
- else
- read_chunk
- end
- end
- end
- end
- end
-
- def initialize(input, options)
- @input = input
- @options = options
- @samples = []
-
- prepare
- end
-
- def column_separator
- @column_separator
- end
-
- def row_separator
- @row_separator
- end
-
- def quote_character
- @quote_character
- end
-
- def field_size_limit
- @field_size_limit
- end
-
- def skip_lines
- @skip_lines
- end
-
- def unconverted_fields?
- @unconverted_fields
- end
-
- def headers
- @headers
- end
-
- def header_row?
- @use_headers and @headers.nil?
- end
-
- def return_headers?
- @return_headers
- end
-
- def skip_blanks?
- @skip_blanks
- end
-
- def liberal_parsing?
- @liberal_parsing
- end
-
- def lineno
- @lineno
- end
-
- def line
- last_line
- end
-
- def parse(&block)
- return to_enum(__method__) unless block_given?
-
- if @return_headers and @headers and @raw_headers
- headers = Row.new(@headers, @raw_headers, true)
- if @unconverted_fields
- headers = add_unconverted_fields(headers, [])
- end
- yield headers
- end
-
- begin
- @scanner ||= build_scanner
- if quote_character.nil?
- parse_no_quote(&block)
- elsif @need_robust_parsing
- parse_quotable_robust(&block)
- else
- parse_quotable_loose(&block)
- end
- rescue InvalidEncoding
- if @scanner
- ignore_broken_line
- lineno = @lineno
- else
- lineno = @lineno + 1
- end
- message = "Invalid byte sequence in #{@encoding}"
- raise MalformedCSVError.new(message, lineno)
- end
- end
-
- def use_headers?
- @use_headers
- end
-
- private
- # A set of tasks to prepare the file in order to parse it
- def prepare
- prepare_variable
- prepare_quote_character
- prepare_backslash
- prepare_skip_lines
- prepare_strip
- prepare_separators
- prepare_quoted
- prepare_unquoted
- prepare_line
- prepare_header
- prepare_parser
- end
-
- def prepare_variable
- @need_robust_parsing = false
- @encoding = @options[:encoding]
- liberal_parsing = @options[:liberal_parsing]
- if liberal_parsing
- @liberal_parsing = true
- if liberal_parsing.is_a?(Hash)
- @double_quote_outside_quote =
- liberal_parsing[:double_quote_outside_quote]
- @backslash_quote = liberal_parsing[:backslash_quote]
- else
- @double_quote_outside_quote = false
- @backslash_quote = false
- end
- @need_robust_parsing = true
- else
- @liberal_parsing = false
- @backslash_quote = false
- end
- @unconverted_fields = @options[:unconverted_fields]
- @field_size_limit = @options[:field_size_limit]
- @skip_blanks = @options[:skip_blanks]
- @fields_converter = @options[:fields_converter]
- @header_fields_converter = @options[:header_fields_converter]
- end
-
- def prepare_quote_character
- @quote_character = @options[:quote_character]
- if @quote_character.nil?
- @escaped_quote_character = nil
- @escaped_quote = nil
- else
- @quote_character = @quote_character.to_s.encode(@encoding)
- if @quote_character.length != 1
- message = ":quote_char has to be nil or a single character String"
- raise ArgumentError, message
- end
- @double_quote_character = @quote_character * 2
- @escaped_quote_character = Regexp.escape(@quote_character)
- @escaped_quote = Regexp.new(@escaped_quote_character)
- end
- end
-
- def prepare_backslash
- return unless @backslash_quote
-
- @backslash_character = "\\".encode(@encoding)
-
- @escaped_backslash_character = Regexp.escape(@backslash_character)
- @escaped_backslash = Regexp.new(@escaped_backslash_character)
- if @quote_character.nil?
- @backslash_quote_character = nil
- else
- @backslash_quote_character =
- @backslash_character + @escaped_quote_character
- end
- end
-
- def prepare_skip_lines
- skip_lines = @options[:skip_lines]
- case skip_lines
- when String
- @skip_lines = skip_lines.encode(@encoding)
- when Regexp, nil
- @skip_lines = skip_lines
- else
- unless skip_lines.respond_to?(:match)
- message =
- ":skip_lines has to respond to \#match: #{skip_lines.inspect}"
- raise ArgumentError, message
- end
- @skip_lines = skip_lines
- end
- end
-
- def prepare_strip
- @strip = @options[:strip]
- @escaped_strip = nil
- @strip_value = nil
- if @strip.is_a?(String)
- case @strip.length
- when 0
- raise ArgumentError, ":strip must not be an empty String"
- when 1
- # ok
- else
- raise ArgumentError, ":strip doesn't support 2 or more characters yet"
- end
- @strip = @strip.encode(@encoding)
- @escaped_strip = Regexp.escape(@strip)
- if @quote_character
- @strip_value = Regexp.new(@escaped_strip +
- "+".encode(@encoding))
- end
- @need_robust_parsing = true
- elsif @strip
- strip_values = " \t\f\v"
- @escaped_strip = strip_values.encode(@encoding)
- if @quote_character
- @strip_value = Regexp.new("[#{strip_values}]+".encode(@encoding))
- end
- @need_robust_parsing = true
- end
- end
-
- begin
- StringScanner.new("x").scan("x")
- rescue TypeError
- @@string_scanner_scan_accept_string = false
- else
- @@string_scanner_scan_accept_string = true
- end
-
- def prepare_separators
- column_separator = @options[:column_separator]
- @column_separator = column_separator.to_s.encode(@encoding)
- if @column_separator.size < 1
- message = ":col_sep must be 1 or more characters: "
- message += column_separator.inspect
- raise ArgumentError, message
- end
- @row_separator =
- resolve_row_separator(@options[:row_separator]).encode(@encoding)
-
- @escaped_column_separator = Regexp.escape(@column_separator)
- @escaped_first_column_separator = Regexp.escape(@column_separator[0])
- if @column_separator.size > 1
- @column_end = Regexp.new(@escaped_column_separator)
- @column_ends = @column_separator.each_char.collect do |char|
- Regexp.new(Regexp.escape(char))
- end
- @first_column_separators = Regexp.new(@escaped_first_column_separator +
- "+".encode(@encoding))
- else
- if @@string_scanner_scan_accept_string
- @column_end = @column_separator
- else
- @column_end = Regexp.new(@escaped_column_separator)
- end
- @column_ends = nil
- @first_column_separators = nil
- end
-
- escaped_row_separator = Regexp.escape(@row_separator)
- @row_end = Regexp.new(escaped_row_separator)
- if @row_separator.size > 1
- @row_ends = @row_separator.each_char.collect do |char|
- Regexp.new(Regexp.escape(char))
- end
- else
- @row_ends = nil
- end
-
- @cr = "\r".encode(@encoding)
- @lf = "\n".encode(@encoding)
- @cr_or_lf = Regexp.new("[\r\n]".encode(@encoding))
- @not_line_end = Regexp.new("[^\r\n]+".encode(@encoding))
- end
-
- def prepare_quoted
- if @quote_character
- @quotes = Regexp.new(@escaped_quote_character +
- "+".encode(@encoding))
- no_quoted_values = @escaped_quote_character.dup
- if @backslash_quote
- no_quoted_values << @escaped_backslash_character
- end
- @quoted_value = Regexp.new("[^".encode(@encoding) +
- no_quoted_values +
- "]+".encode(@encoding))
- end
- if @escaped_strip
- @split_column_separator = Regexp.new(@escaped_strip +
- "*".encode(@encoding) +
- @escaped_column_separator +
- @escaped_strip +
- "*".encode(@encoding))
- else
- if @column_separator == " ".encode(@encoding)
- @split_column_separator = Regexp.new(@escaped_column_separator)
- else
- @split_column_separator = @column_separator
- end
- end
- end
-
- def prepare_unquoted
- return if @quote_character.nil?
-
- no_unquoted_values = "\r\n".encode(@encoding)
- no_unquoted_values << @escaped_first_column_separator
- unless @liberal_parsing
- no_unquoted_values << @escaped_quote_character
- end
- if @escaped_strip
- no_unquoted_values << @escaped_strip
- end
- @unquoted_value = Regexp.new("[^".encode(@encoding) +
- no_unquoted_values +
- "]+".encode(@encoding))
- end
-
- def resolve_row_separator(separator)
- if separator == :auto
- cr = "\r".encode(@encoding)
- lf = "\n".encode(@encoding)
- if @input.is_a?(StringIO)
- pos = @input.pos
- separator = detect_row_separator(@input.read, cr, lf)
- @input.seek(pos)
- elsif @input.respond_to?(:gets)
- if @input.is_a?(File)
- chunk_size = 32 * 1024
- else
- chunk_size = 1024
- end
- begin
- while separator == :auto
- #
- # if we run out of data, it's probably a single line
- # (ensure will set default value)
- #
- break unless sample = @input.gets(nil, chunk_size)
-
- # extend sample if we're unsure of the line ending
- if sample.end_with?(cr)
- sample << (@input.gets(nil, 1) || "")
- end
-
- @samples << sample
-
- separator = detect_row_separator(sample, cr, lf)
- end
- rescue IOError
- # do nothing: ensure will set default
- end
- end
- separator = $INPUT_RECORD_SEPARATOR if separator == :auto
- end
- separator.to_s.encode(@encoding)
- end
-
- def detect_row_separator(sample, cr, lf)
- lf_index = sample.index(lf)
- if lf_index
- cr_index = sample[0, lf_index].index(cr)
- else
- cr_index = sample.index(cr)
- end
- if cr_index and lf_index
- if cr_index + 1 == lf_index
- cr + lf
- elsif cr_index < lf_index
- cr
- else
- lf
- end
- elsif cr_index
- cr
- elsif lf_index
- lf
- else
- :auto
- end
- end
-
- def prepare_line
- @lineno = 0
- @last_line = nil
- @scanner = nil
- end
-
- def last_line
- if @scanner
- @last_line ||= @scanner.keep_end
- else
- @last_line
- end
- end
-
- def prepare_header
- @return_headers = @options[:return_headers]
-
- headers = @options[:headers]
- case headers
- when Array
- @raw_headers = headers
- @use_headers = true
- when String
- @raw_headers = parse_headers(headers)
- @use_headers = true
- when nil, false
- @raw_headers = nil
- @use_headers = false
- else
- @raw_headers = nil
- @use_headers = true
- end
- if @raw_headers
- @headers = adjust_headers(@raw_headers)
- else
- @headers = nil
- end
- end
-
- def parse_headers(row)
- CSV.parse_line(row,
- col_sep: @column_separator,
- row_sep: @row_separator,
- quote_char: @quote_character)
- end
-
- def adjust_headers(headers)
- adjusted_headers = @header_fields_converter.convert(headers, nil, @lineno)
- adjusted_headers.each {|h| h.freeze if h.is_a? String}
- adjusted_headers
- end
-
- def prepare_parser
- @may_quoted = may_quoted?
- end
-
- def may_quoted?
- return false if @quote_character.nil?
-
- if @input.is_a?(StringIO)
- pos = @input.pos
- sample = @input.read
- @input.seek(pos)
- else
- return false if @samples.empty?
- sample = @samples.first
- end
- sample[0, 128].index(@quote_character)
- end
-
- SCANNER_TEST = (ENV["CSV_PARSER_SCANNER_TEST"] == "yes")
- if SCANNER_TEST
- class UnoptimizedStringIO
- def initialize(string)
- @io = StringIO.new(string)
- end
-
- def gets(*args)
- @io.gets(*args)
- end
-
- def each_line(*args, &block)
- @io.each_line(*args, &block)
- end
-
- def eof?
- @io.eof?
- end
- end
-
- def build_scanner
- inputs = @samples.collect do |sample|
- UnoptimizedStringIO.new(sample)
- end
- if @input.is_a?(StringIO)
- inputs << UnoptimizedStringIO.new(@input.read)
- else
- inputs << @input
- end
- chunk_size = ENV["CSV_PARSER_SCANNER_TEST_CHUNK_SIZE"] || "1"
- InputsScanner.new(inputs,
- @encoding,
- chunk_size: Integer(chunk_size, 10))
- end
- else
- def build_scanner
- string = nil
- if @samples.empty? and @input.is_a?(StringIO)
- string = @input.read
- elsif @samples.size == 1 and @input.respond_to?(:eof?) and @input.eof?
- string = @samples[0]
- end
- if string
- unless string.valid_encoding?
- index = string.lines(@row_separator).index do |line|
- !line.valid_encoding?
- end
- if index
- message = "Invalid byte sequence in #{@encoding}"
- raise MalformedCSVError.new(message, @lineno + index + 1)
- end
- end
- Scanner.new(string)
- else
- inputs = @samples.collect do |sample|
- StringIO.new(sample)
- end
- inputs << @input
- InputsScanner.new(inputs, @encoding)
- end
- end
- end
-
- def skip_needless_lines
- return unless @skip_lines
-
- while true
- @scanner.keep_start
- line = @scanner.scan_all(@not_line_end) || "".encode(@encoding)
- line << @row_separator if parse_row_end
- if skip_line?(line)
- @lineno += 1
- @scanner.keep_drop
- else
- @scanner.keep_back
- return
- end
- end
- end
-
- def skip_line?(line)
- case @skip_lines
- when String
- line.include?(@skip_lines)
- when Regexp
- @skip_lines.match?(line)
- else
- @skip_lines.match(line)
- end
- end
-
- def parse_no_quote(&block)
- @scanner.each_line(@row_separator) do |line|
- next if @skip_lines and skip_line?(line)
- original_line = line
- line = line.delete_suffix(@row_separator)
-
- if line.empty?
- next if @skip_blanks
- row = []
- else
- line = strip_value(line)
- row = line.split(@split_column_separator, -1)
- n_columns = row.size
- i = 0
- while i < n_columns
- row[i] = nil if row[i].empty?
- i += 1
- end
- end
- @last_line = original_line
- emit_row(row, &block)
- end
- end
-
- def parse_quotable_loose(&block)
- @scanner.keep_start
- @scanner.each_line(@row_separator) do |line|
- if @skip_lines and skip_line?(line)
- @scanner.keep_drop
- @scanner.keep_start
- next
- end
- original_line = line
- line = line.delete_suffix(@row_separator)
-
- if line.empty?
- if @skip_blanks
- @scanner.keep_drop
- @scanner.keep_start
- next
- end
- row = []
- elsif line.include?(@cr) or line.include?(@lf)
- @scanner.keep_back
- @need_robust_parsing = true
- return parse_quotable_robust(&block)
- else
- row = line.split(@split_column_separator, -1)
- n_columns = row.size
- i = 0
- while i < n_columns
- column = row[i]
- if column.empty?
- row[i] = nil
- else
- n_quotes = column.count(@quote_character)
- if n_quotes.zero?
- # no quote
- elsif n_quotes == 2 and
- column.start_with?(@quote_character) and
- column.end_with?(@quote_character)
- row[i] = column[1..-2]
- else
- @scanner.keep_back
- @need_robust_parsing = true
- return parse_quotable_robust(&block)
- end
- end
- i += 1
- end
- end
- @scanner.keep_drop
- @scanner.keep_start
- @last_line = original_line
- emit_row(row, &block)
- end
- @scanner.keep_drop
- end
-
- def parse_quotable_robust(&block)
- row = []
- skip_needless_lines
- start_row
- while true
- @quoted_column_value = false
- @unquoted_column_value = false
- @scanner.scan_all(@strip_value) if @strip_value
- value = parse_column_value
- if value
- @scanner.scan_all(@strip_value) if @strip_value
- if @field_size_limit and value.size >= @field_size_limit
- ignore_broken_line
- raise MalformedCSVError.new("Field size exceeded", @lineno)
- end
- end
- if parse_column_end
- row << value
- elsif parse_row_end
- if row.empty? and value.nil?
- emit_row([], &block) unless @skip_blanks
- else
- row << value
- emit_row(row, &block)
- row = []
- end
- skip_needless_lines
- start_row
- elsif @scanner.eos?
- break if row.empty? and value.nil?
- row << value
- emit_row(row, &block)
- break
- else
- if @quoted_column_value
- ignore_broken_line
- message = "Any value after quoted field isn't allowed"
- raise MalformedCSVError.new(message, @lineno)
- elsif @unquoted_column_value and
- (new_line = @scanner.scan(@cr_or_lf))
- ignore_broken_line
- message = "Unquoted fields do not allow new line " +
- "<#{new_line.inspect}>"
- raise MalformedCSVError.new(message, @lineno)
- elsif @scanner.rest.start_with?(@quote_character)
- ignore_broken_line
- message = "Illegal quoting"
- raise MalformedCSVError.new(message, @lineno)
- elsif (new_line = @scanner.scan(@cr_or_lf))
- ignore_broken_line
- message = "New line must be <#{@row_separator.inspect}> " +
- "not <#{new_line.inspect}>"
- raise MalformedCSVError.new(message, @lineno)
- else
- ignore_broken_line
- raise MalformedCSVError.new("TODO: Meaningful message",
- @lineno)
- end
- end
- end
- end
-
- def parse_column_value
- if @liberal_parsing
- quoted_value = parse_quoted_column_value
- if quoted_value
- unquoted_value = parse_unquoted_column_value
- if unquoted_value
- if @double_quote_outside_quote
- unquoted_value = unquoted_value.gsub(@quote_character * 2,
- @quote_character)
- if quoted_value.empty? # %Q{""...} case
- return @quote_character + unquoted_value
- end
- end
- @quote_character + quoted_value + @quote_character + unquoted_value
- else
- quoted_value
- end
- else
- parse_unquoted_column_value
- end
- elsif @may_quoted
- parse_quoted_column_value ||
- parse_unquoted_column_value
- else
- parse_unquoted_column_value ||
- parse_quoted_column_value
- end
- end
-
- def parse_unquoted_column_value
- value = @scanner.scan_all(@unquoted_value)
- return nil unless value
-
- @unquoted_column_value = true
- if @first_column_separators
- while true
- @scanner.keep_start
- is_column_end = @column_ends.all? do |column_end|
- @scanner.scan(column_end)
- end
- @scanner.keep_back
- break if is_column_end
- sub_separator = @scanner.scan_all(@first_column_separators)
- break if sub_separator.nil?
- value << sub_separator
- sub_value = @scanner.scan_all(@unquoted_value)
- break if sub_value.nil?
- value << sub_value
- end
- end
- value.gsub!(@backslash_quote_character, @quote_character) if @backslash_quote
- value
- end
-
- def parse_quoted_column_value
- quotes = @scanner.scan_all(@quotes)
- return nil unless quotes
-
- @quoted_column_value = true
- n_quotes = quotes.size
- if (n_quotes % 2).zero?
- quotes[0, (n_quotes - 2) / 2]
- else
- value = quotes[0, (n_quotes - 1) / 2]
- while true
- quoted_value = @scanner.scan_all(@quoted_value)
- value << quoted_value if quoted_value
- if @backslash_quote
- if @scanner.scan(@escaped_backslash)
- if @scanner.scan(@escaped_quote)
- value << @quote_character
- else
- value << @backslash_character
- end
- next
- end
- end
-
- quotes = @scanner.scan_all(@quotes)
- unless quotes
- ignore_broken_line
- message = "Unclosed quoted field"
- raise MalformedCSVError.new(message, @lineno)
- end
- n_quotes = quotes.size
- if n_quotes == 1
- break
- elsif (n_quotes % 2) == 1
- value << quotes[0, (n_quotes - 1) / 2]
- break
- else
- value << quotes[0, n_quotes / 2]
- end
- end
- value
- end
- end
-
- def parse_column_end
- return true if @scanner.scan(@column_end)
- return false unless @column_ends
-
- @scanner.keep_start
- if @column_ends.all? {|column_end| @scanner.scan(column_end)}
- @scanner.keep_drop
- true
- else
- @scanner.keep_back
- false
- end
- end
-
- def parse_row_end
- return true if @scanner.scan(@row_end)
- return false unless @row_ends
- @scanner.keep_start
- if @row_ends.all? {|row_end| @scanner.scan(row_end)}
- @scanner.keep_drop
- true
- else
- @scanner.keep_back
- false
- end
- end
-
- def strip_value(value)
- return value unless @strip
- return nil if value.nil?
-
- case @strip
- when String
- size = value.size
- while value.start_with?(@strip)
- size -= 1
- value = value[1, size]
- end
- while value.end_with?(@strip)
- size -= 1
- value = value[0, size]
- end
- else
- value.strip!
- end
- value
- end
-
- def ignore_broken_line
- @scanner.scan_all(@not_line_end)
- @scanner.scan_all(@cr_or_lf)
- @lineno += 1
- end
-
- def start_row
- if @last_line
- @last_line = nil
- else
- @scanner.keep_drop
- end
- @scanner.keep_start
- end
-
- def emit_row(row, &block)
- @lineno += 1
-
- raw_row = row
- if @use_headers
- if @headers.nil?
- @headers = adjust_headers(row)
- return unless @return_headers
- row = Row.new(@headers, row, true)
- else
- row = Row.new(@headers,
- @fields_converter.convert(raw_row, @headers, @lineno))
- end
- else
- # convert fields, if needed...
- row = @fields_converter.convert(raw_row, nil, @lineno)
- end
-
- # inject unconverted fields and accessor, if requested...
- if @unconverted_fields and not row.respond_to?(:unconverted_fields)
- add_unconverted_fields(row, raw_row)
- end
-
- yield(row)
- end
-
- # This method injects an instance variable <tt>unconverted_fields</tt> into
- # +row+ and an accessor method for +row+ called unconverted_fields(). The
- # variable is set to the contents of +fields+.
- def add_unconverted_fields(row, fields)
- class << row
- attr_reader :unconverted_fields
- end
- row.instance_variable_set(:@unconverted_fields, fields)
- row
- end
- end
-end
diff --git a/lib/csv/row.rb b/lib/csv/row.rb
deleted file mode 100644
index 4aa0f30911..0000000000
--- a/lib/csv/row.rb
+++ /dev/null
@@ -1,390 +0,0 @@
-# frozen_string_literal: true
-
-require "forwardable"
-
-class CSV
- #
- # A CSV::Row is part Array and part Hash. It retains an order for the fields
- # and allows duplicates just as an Array would, but also allows you to access
- # fields by name just as you could if they were in a Hash.
- #
- # All rows returned by CSV will be constructed from this class, if header row
- # processing is activated.
- #
- class Row
- #
- # Constructs a new CSV::Row from +headers+ and +fields+, which are expected
- # to be Arrays. If one Array is shorter than the other, it will be padded
- # with +nil+ objects.
- #
- # The optional +header_row+ parameter can be set to +true+ to indicate, via
- # CSV::Row.header_row?() and CSV::Row.field_row?(), that this is a header
- # row. Otherwise, the row assumes to be a field row.
- #
- # A CSV::Row object supports the following Array methods through delegation:
- #
- # * empty?()
- # * length()
- # * size()
- #
- def initialize(headers, fields, header_row = false)
- @header_row = header_row
- headers.each { |h| h.freeze if h.is_a? String }
-
- # handle extra headers or fields
- @row = if headers.size >= fields.size
- headers.zip(fields)
- else
- fields.zip(headers).each(&:reverse!)
- end
- end
-
- # Internal data format used to compare equality.
- attr_reader :row
- protected :row
-
- ### Array Delegation ###
-
- extend Forwardable
- def_delegators :@row, :empty?, :length, :size
-
- def initialize_copy(other)
- super
- @row = @row.dup
- end
-
- # Returns +true+ if this is a header row.
- def header_row?
- @header_row
- end
-
- # Returns +true+ if this is a field row.
- def field_row?
- not header_row?
- end
-
- # Returns the headers of this row.
- def headers
- @row.map(&:first)
- end
-
- #
- # :call-seq:
- # field( header )
- # field( header, offset )
- # field( index )
- #
- # This method will return the field value by +header+ or +index+. If a field
- # is not found, +nil+ is returned.
- #
- # When provided, +offset+ ensures that a header match occurs on or later
- # than the +offset+ index. You can use this to find duplicate headers,
- # without resorting to hard-coding exact indices.
- #
- 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
- 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
- end
- alias_method :[], :field
-
- #
- # :call-seq:
- # fetch( header )
- # fetch( header ) { |row| ... }
- # fetch( header, default )
- #
- # This method will fetch the field value by +header+. It has the same
- # behavior as Hash#fetch: if there is a field with the given +header+, its
- # value is returned. Otherwise, if a block is given, it is yielded the
- # +header+ and its result is returned; if a +default+ is given as the
- # second argument, it is returned; otherwise a KeyError is raised.
- #
- def fetch(header, *varargs)
- raise ArgumentError, "Too many arguments" if varargs.length > 1
- pair = @row.assoc(header)
- if pair
- pair.last
- else
- if block_given?
- yield header
- elsif varargs.empty?
- raise KeyError, "key not found: #{header}"
- else
- varargs.first
- end
- end
- end
-
- # Returns +true+ if there is a field with the given +header+.
- def has_key?(header)
- !!@row.assoc(header)
- end
- alias_method :include?, :has_key?
- alias_method :key?, :has_key?
- alias_method :member?, :has_key?
- alias_method :header?, :has_key?
-
- #
- # :call-seq:
- # []=( header, value )
- # []=( header, offset, value )
- # []=( index, value )
- #
- # Looks up the field by the semantics described in CSV::Row.field() and
- # assigns the +value+.
- #
- # Assigning past the end of the row with an index will set all pairs between
- # to <tt>[nil, nil]</tt>. Assigning to an unused header appends the new
- # pair.
- #
- def []=(*args)
- value = args.pop
-
- if args.first.is_a? Integer
- if @row[args.first].nil? # extending past the end with index
- @row[args.first] = [nil, value]
- @row.map! { |pair| pair.nil? ? [nil, nil] : pair }
- else # normal index assignment
- @row[args.first][1] = value
- end
- else
- index = index(*args)
- if index.nil? # appending a field
- self << [args.first, value]
- else # normal header assignment
- @row[index][1] = value
- end
- end
- end
-
- #
- # :call-seq:
- # <<( field )
- # <<( header_and_field_array )
- # <<( header_and_field_hash )
- #
- # If a two-element Array is provided, it is assumed to be a header and field
- # and the pair is appended. A Hash works the same way with the key being
- # the header and the value being the field. Anything else is assumed to be
- # a lone field which is appended with a +nil+ header.
- #
- # This method returns the row for chaining.
- #
- def <<(arg)
- if arg.is_a?(Array) and arg.size == 2 # appending a header and name
- @row << arg
- elsif arg.is_a?(Hash) # append header and name pairs
- arg.each { |pair| @row << pair }
- else # append field value
- @row << [nil, arg]
- end
-
- self # for chaining
- end
-
- #
- # A shortcut for appending multiple fields. Equivalent to:
- #
- # args.each { |arg| csv_row << arg }
- #
- # This method returns the row for chaining.
- #
- def push(*args)
- args.each { |arg| self << arg }
-
- self # for chaining
- end
-
- #
- # :call-seq:
- # delete( header )
- # delete( header, offset )
- # delete( index )
- #
- # Removes a pair from the row by +header+ or +index+. The pair is
- # located as described in CSV::Row.field(). The deleted pair is returned,
- # or +nil+ if a pair could not be found.
- #
- def delete(header_or_index, minimum_index = 0)
- if header_or_index.is_a? Integer # by index
- @row.delete_at(header_or_index)
- elsif i = index(header_or_index, minimum_index) # by header
- @row.delete_at(i)
- else
- [ ]
- end
- end
-
- #
- # The provided +block+ is passed a header and field for each pair in the row
- # and expected to return +true+ or +false+, depending on whether the pair
- # should be deleted.
- #
- # This method returns the row for chaining.
- #
- # If no block is given, an Enumerator is returned.
- #
- def delete_if(&block)
- return enum_for(__method__) { size } unless block_given?
-
- @row.delete_if(&block)
-
- self # for chaining
- end
-
- #
- # This method accepts any number of arguments which can be headers, indices,
- # Ranges of either, or two-element Arrays containing a header and offset.
- # Each argument will be replaced with a field lookup as described in
- # CSV::Row.field().
- #
- # If called with no arguments, all fields are returned.
- #
- def fields(*headers_and_or_indices)
- if headers_and_or_indices.empty? # return all fields--no arguments
- @row.map(&:last)
- else # or work like values_at()
- all = []
- headers_and_or_indices.each do |h_or_i|
- 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))
- else
- all << field(*Array(h_or_i))
- end
- end
- return all
- end
- end
- alias_method :values_at, :fields
-
- #
- # :call-seq:
- # index( header )
- # index( header, offset )
- #
- # This method will return the index of a field with the provided +header+.
- # The +offset+ can be used to locate duplicate header names, as described in
- # CSV::Row.field().
- #
- def index(header, minimum_index = 0)
- # find the pair
- index = headers[minimum_index..-1].index(header)
- # return the index at the right offset, if we found one
- index.nil? ? nil : index + minimum_index
- end
-
- #
- # Returns +true+ if +data+ matches a field in this row, and +false+
- # otherwise.
- #
- def field?(data)
- fields.include? data
- end
-
- include Enumerable
-
- #
- # 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.
- #
- # Support for Enumerable.
- #
- def each(&block)
- return enum_for(__method__) { size } unless block_given?
-
- @row.each(&block)
-
- self # for chaining
- end
-
- alias_method :each_pair, :each
-
- #
- # Returns +true+ if this row contains the same headers and fields in the
- # same order as +other+.
- #
- def ==(other)
- return @row == other.row if other.is_a? CSV::Row
- @row == other
- end
-
- #
- # Collapses the row into a simple Hash. Be warned that this discards field
- # order and clobbers duplicate fields.
- #
- def to_h
- hash = {}
- each do |key, _value|
- hash[key] = self[key] unless hash.key?(key)
- end
- hash
- end
- alias_method :to_hash, :to_h
-
- alias_method :to_ary, :to_a
-
- #
- # Returns the row as a CSV String. Headers are not used. Equivalent to:
- #
- # csv_row.fields.to_csv( options )
- #
- def to_csv(**options)
- fields.to_csv(**options)
- end
- alias_method :to_s, :to_csv
-
- #
- # Extracts the nested value specified by the sequence of +index+ or +header+ objects by calling dig at each step,
- # returning nil if any intermediate step is nil.
- #
- def dig(index_or_header, *indexes)
- value = field(index_or_header)
- if value.nil?
- nil
- elsif indexes.empty?
- value
- else
- unless value.respond_to?(:dig)
- raise TypeError, "#{value.class} does not have \#dig method"
- end
- value.dig(*indexes)
- end
- end
-
- #
- # A summary of fields, by header, in an ASCII compatible String.
- #
- def inspect
- str = ["#<", self.class.to_s]
- each do |header, field|
- str << " " << (header.is_a?(Symbol) ? header.to_s : header.inspect) <<
- ":" << field.inspect
- end
- str << ">"
- begin
- str.join('')
- rescue # any encoding error
- str.map do |s|
- e = Encoding::Converter.asciicompat_encoding(s.encoding)
- e ? s.encode(e) : s.force_encoding("ASCII-8BIT")
- end.join('')
- end
- end
- end
-end
diff --git a/lib/csv/table.rb b/lib/csv/table.rb
deleted file mode 100644
index e6c1ee11fa..0000000000
--- a/lib/csv/table.rb
+++ /dev/null
@@ -1,402 +0,0 @@
-# frozen_string_literal: true
-
-require "forwardable"
-
-class CSV
- #
- # A CSV::Table is a two-dimensional data structure for representing CSV
- # documents. Tables allow you to work with the data by row or column,
- # manipulate the data, and even convert the results back to CSV, if needed.
- #
- # All tables returned by CSV will be constructed from this class, if header
- # row processing is activated.
- #
- class Table
- #
- # Constructs a new CSV::Table from +array_of_rows+, which are expected
- # to be CSV::Row objects. All rows are assumed to have the same headers.
- #
- # The optional +headers+ parameter can be set to Array of headers.
- # If headers aren't set, headers are fetched from CSV::Row objects.
- # Otherwise, headers() method will return headers being set in
- # headers argument.
- #
- # A CSV::Table object supports the following Array methods through
- # delegation:
- #
- # * empty?()
- # * length()
- # * size()
- #
- def initialize(array_of_rows, headers: nil)
- @table = array_of_rows
- @headers = headers
- unless @headers
- if @table.empty?
- @headers = []
- else
- @headers = @table.first.headers
- end
- end
-
- @mode = :col_or_row
- end
-
- # The current access mode for indexing and iteration.
- attr_reader :mode
-
- # Internal data format used to compare equality.
- attr_reader :table
- protected :table
-
- ### Array Delegation ###
-
- extend Forwardable
- def_delegators :@table, :empty?, :length, :size
-
- #
- # Returns a duplicate table object, in column mode. This is handy for
- # chaining in a single call without changing the table mode, but be aware
- # that this method can consume a fair amount of memory for bigger data sets.
- #
- # This method returns the duplicate table for chaining. Don't chain
- # destructive methods (like []=()) this way though, since you are working
- # with a duplicate.
- #
- def by_col
- self.class.new(@table.dup).by_col!
- end
-
- #
- # Switches the mode of this table to column mode. All calls to indexing and
- # iteration methods will work with columns until the mode is changed again.
- #
- # This method returns the table and is safe to chain.
- #
- def by_col!
- @mode = :col
-
- self
- end
-
- #
- # Returns a duplicate table object, in mixed mode. This is handy for
- # chaining in a single call without changing the table mode, but be aware
- # that this method can consume a fair amount of memory for bigger data sets.
- #
- # This method returns the duplicate table for chaining. Don't chain
- # destructive methods (like []=()) this way though, since you are working
- # with a duplicate.
- #
- def by_col_or_row
- self.class.new(@table.dup).by_col_or_row!
- end
-
- #
- # Switches the mode of this table to mixed mode. All calls to indexing and
- # iteration methods will use the default intelligent indexing system until
- # the mode is changed again. In mixed mode an index is assumed to be a row
- # reference while anything else is assumed to be column access by headers.
- #
- # This method returns the table and is safe to chain.
- #
- def by_col_or_row!
- @mode = :col_or_row
-
- self
- end
-
- #
- # Returns a duplicate table object, in row mode. This is handy for chaining
- # in a single call without changing the table mode, but be aware that this
- # method can consume a fair amount of memory for bigger data sets.
- #
- # This method returns the duplicate table for chaining. Don't chain
- # destructive methods (like []=()) this way though, since you are working
- # with a duplicate.
- #
- def by_row
- self.class.new(@table.dup).by_row!
- end
-
- #
- # Switches the mode of this table to row mode. All calls to indexing and
- # iteration methods will work with rows until the mode is changed again.
- #
- # This method returns the table and is safe to chain.
- #
- def by_row!
- @mode = :row
-
- self
- end
-
- #
- # Returns the headers for the first row of this table (assumed to match all
- # other rows). The headers Array passed to CSV::Table.new is returned for
- # empty tables.
- #
- def headers
- if @table.empty?
- @headers.dup
- else
- @table.first.headers
- end
- end
-
- #
- # In the default mixed mode, this method returns rows for index access and
- # columns for header access. You can force the index association by first
- # calling by_col!() or by_row!().
- #
- # Columns are returned as an Array of values. Altering that Array has no
- # effect on the table.
- #
- 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)))
- @table[index_or_header]
- else # by header
- @table.map { |row| row[index_or_header] }
- end
- end
-
- #
- # In the default mixed mode, this method assigns rows for index access and
- # columns for header access. You can force the index association by first
- # calling by_col!() or by_row!().
- #
- # Rows may be set to an Array of values (which will inherit the table's
- # headers()) or a CSV::Row.
- #
- # Columns may be set to a single value, which is copied to each row of the
- # column, or an Array of values. Arrays of values are assigned to rows top
- # to bottom in row major order. Excess values are ignored and if the Array
- # does not have a value for each row the extra rows will receive a +nil+.
- #
- # Assigning to an existing column or row clobbers the data. Assigning to
- # new columns creates them at the right end of the table.
- #
- def []=(index_or_header, value)
- if @mode == :row or # by index
- (@mode == :col_or_row and index_or_header.is_a? Integer)
- if value.is_a? Array
- @table[index_or_header] = Row.new(headers, value)
- else
- @table[index_or_header] = value
- end
- else # set column
- unless index_or_header.is_a? Integer
- index = @headers.index(index_or_header) || @headers.size
- @headers[index] = index_or_header
- end
- if value.is_a? Array # multiple values
- @table.each_with_index do |row, i|
- if row.header_row?
- row[index_or_header] = index_or_header
- else
- row[index_or_header] = value[i]
- end
- end
- else # repeated value
- @table.each do |row|
- if row.header_row?
- row[index_or_header] = index_or_header
- else
- row[index_or_header] = value
- end
- end
- end
- end
- end
-
- #
- # The mixed mode default is to treat a list of indices as row access,
- # returning the rows indicated. Anything else is considered columnar
- # access. For columnar access, the return set has an Array for each row
- # with the values indicated by the headers in each Array. You can force
- # column or row mode using by_col!() or by_row!().
- #
- # You cannot mix column and row access.
- #
- def values_at(*indices_or_headers)
- if @mode == :row or # by indices
- ( @mode == :col_or_row and indices_or_headers.all? do |index|
- index.is_a?(Integer) or
- ( index.is_a?(Range) and
- index.first.is_a?(Integer) and
- index.last.is_a?(Integer) )
- end )
- @table.values_at(*indices_or_headers)
- else # by headers
- @table.map { |row| row.values_at(*indices_or_headers) }
- end
- end
-
- #
- # Adds a new row to the bottom end of this table. You can provide an Array,
- # which will be converted to a CSV::Row (inheriting the table's headers()),
- # or a CSV::Row.
- #
- # This method returns the table for chaining.
- #
- def <<(row_or_array)
- if row_or_array.is_a? Array # append Array
- @table << Row.new(headers, row_or_array)
- else # append Row
- @table << row_or_array
- end
-
- self # for chaining
- end
-
- #
- # A shortcut for appending multiple rows. Equivalent to:
- #
- # rows.each { |row| self << row }
- #
- # This method returns the table for chaining.
- #
- def push(*rows)
- rows.each { |row| self << row }
-
- self # for chaining
- end
-
- #
- # Removes and returns the indicated columns or rows. In the default mixed
- # mode indices refer to rows and everything else is assumed to be a column
- # headers. Use by_col!() or by_row!() to force the lookup.
- #
- def delete(*indexes_or_headers)
- if indexes_or_headers.empty?
- raise ArgumentError, "wrong number of arguments (given 0, expected 1+)"
- end
- deleted_values = indexes_or_headers.map do |index_or_header|
- if @mode == :row or # by index
- (@mode == :col_or_row and index_or_header.is_a? Integer)
- @table.delete_at(index_or_header)
- else # by header
- if index_or_header.is_a? Integer
- @headers.delete_at(index_or_header)
- else
- @headers.delete(index_or_header)
- end
- @table.map { |row| row.delete(index_or_header).last }
- end
- end
- if indexes_or_headers.size == 1
- deleted_values[0]
- else
- deleted_values
- end
- end
-
- #
- # Removes any column or row for which the block returns +true+. In the
- # default mixed mode or row mode, iteration is the standard row major
- # walking of rows. In column mode, iteration will +yield+ two element
- # tuples containing the column name and an Array of values for that column.
- #
- # This method returns the table for chaining.
- #
- # If no block is given, an Enumerator is returned.
- #
- def delete_if(&block)
- return enum_for(__method__) { @mode == :row or @mode == :col_or_row ? size : headers.size } unless block_given?
-
- 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 yield([header, self[header]])
- end
- end
-
- self # for chaining
- end
-
- include Enumerable
-
- #
- # In the default mixed mode or row mode, iteration is the standard row major
- # walking of rows. In column mode, iteration will +yield+ two element
- # tuples containing the column name and an Array of values for that column.
- #
- # This method returns the table for chaining.
- #
- # If no block is given, an Enumerator is returned.
- #
- def each(&block)
- return enum_for(__method__) { @mode == :col ? headers.size : size } unless block_given?
-
- if @mode == :col
- headers.each { |header| yield([header, self[header]]) }
- else
- @table.each(&block)
- end
-
- self # for chaining
- end
-
- # 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
- end
-
- #
- # Returns the table as an Array of Arrays. Headers will be the first row,
- # 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?
- end
-
- array
- end
-
- #
- # Returns the table as a complete CSV String. Headers will be listed first,
- # then all of the field rows.
- #
- # 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
-
- array.join("")
- end
- alias_method :to_s, :to_csv
-
- #
- # Extracts the nested value specified by the sequence of +index+ or +header+ objects by calling dig at each step,
- # returning nil if any intermediate step is nil.
- #
- def dig(index_or_header, *index_or_headers)
- value = self[index_or_header]
- if value.nil?
- nil
- elsif index_or_headers.empty?
- value
- else
- unless value.respond_to?(:dig)
- raise TypeError, "#{value.class} does not have \#dig method"
- end
- value.dig(*index_or_headers)
- end
- end
-
- # Shows the mode and size of this table in a US-ASCII String.
- def inspect
- "#<#{self.class} mode:#{@mode} row_count:#{to_a.size}>".encode("US-ASCII")
- end
- end
-end
diff --git a/lib/csv/version.rb b/lib/csv/version.rb
deleted file mode 100644
index 072400fe01..0000000000
--- a/lib/csv/version.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-# frozen_string_literal: true
-
-class CSV
- # The version of the installed library.
- VERSION = "3.1.2"
-end
diff --git a/lib/csv/writer.rb b/lib/csv/writer.rb
deleted file mode 100644
index 9243d23641..0000000000
--- a/lib/csv/writer.rb
+++ /dev/null
@@ -1,168 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "match_p"
-require_relative "row"
-
-using CSV::MatchP if CSV.const_defined?(:MatchP)
-
-class CSV
- # Note: Don't use this class directly. This is an internal class.
- class Writer
- #
- # A CSV::Writer receives an output, prepares the header, format and output.
- # It allows us to write new rows in the object and rewind it.
- #
- attr_reader :lineno
- attr_reader :headers
-
- def initialize(output, options)
- @output = output
- @options = options
- @lineno = 0
- @fields_converter = nil
- prepare
- if @options[:write_headers] and @headers
- self << @headers
- end
- @fields_converter = @options[:fields_converter]
- end
-
- #
- # Adds a new row
- #
- def <<(row)
- case row
- when Row
- row = row.fields
- when Hash
- row = @headers.collect {|header| row[header]}
- end
-
- @headers ||= row if @use_headers
- @lineno += 1
-
- row = @fields_converter.convert(row, nil, lineno) if @fields_converter
-
- converted_row = row.collect do |field|
- quote(field)
- end
- line = converted_row.join(@column_separator) + @row_separator
- if @output_encoding
- line = line.encode(@output_encoding)
- end
- @output << line
-
- self
- end
-
- #
- # Winds back to the beginning
- #
- def rewind
- @lineno = 0
- @headers = nil if @options[:headers].nil?
- end
-
- private
- def prepare
- @encoding = @options[:encoding]
-
- prepare_header
- prepare_format
- prepare_output
- end
-
- def prepare_header
- headers = @options[:headers]
- case headers
- when Array
- @headers = headers
- @use_headers = true
- when String
- @headers = CSV.parse_line(headers,
- col_sep: @options[:column_separator],
- row_sep: @options[:row_separator],
- quote_char: @options[:quote_character])
- @use_headers = true
- when true
- @headers = nil
- @use_headers = true
- else
- @headers = nil
- @use_headers = false
- end
- return unless @headers
-
- converter = @options[:header_fields_converter]
- @headers = converter.convert(@headers, nil, 0)
- @headers.each do |header|
- header.freeze if header.is_a?(String)
- end
- end
-
- def prepare_format
- @column_separator = @options[:column_separator].to_s.encode(@encoding)
- row_separator = @options[:row_separator]
- if row_separator == :auto
- @row_separator = $INPUT_RECORD_SEPARATOR.encode(@encoding)
- else
- @row_separator = row_separator.to_s.encode(@encoding)
- end
- @quote_character = @options[:quote_character]
- @force_quotes = @options[:force_quotes]
- unless @force_quotes
- @quotable_pattern =
- Regexp.new("[\r\n".encode(@encoding) +
- Regexp.escape(@column_separator) +
- Regexp.escape(@quote_character.encode(@encoding)) +
- "]".encode(@encoding))
- end
- @quote_empty = @options.fetch(:quote_empty, true)
- end
-
- def prepare_output
- @output_encoding = nil
- return unless @output.is_a?(StringIO)
-
- output_encoding = @output.internal_encoding || @output.external_encoding
- if @encoding != output_encoding
- if @options[:force_encoding]
- @output_encoding = output_encoding
- else
- compatible_encoding = Encoding.compatible?(@encoding, output_encoding)
- if compatible_encoding
- @output.set_encoding(compatible_encoding)
- @output.seek(0, IO::SEEK_END)
- end
- end
- end
- end
-
- def quote_field(field)
- field = String(field)
- encoded_quote_character = @quote_character.encode(field.encoding)
- encoded_quote_character +
- field.gsub(encoded_quote_character,
- encoded_quote_character * 2) +
- encoded_quote_character
- end
-
- def quote(field)
- if @force_quotes
- quote_field(field)
- else
- if field.nil? # represent +nil+ fields as empty unquoted fields
- ""
- else
- field = String(field) # Stringify fields
- # represent empty fields as empty quoted fields
- if (@quote_empty and field.empty?) or @quotable_pattern.match?(field)
- quote_field(field)
- else
- field # unquoted field
- end
- end
- end
- end
- end
-end
diff --git a/lib/debug.rb b/lib/debug.rb
index 6f519c6c77..fcbf849f0d 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -1,10 +1,14 @@
-# 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>
require 'continuation'
+if $SAFE > 0
+ STDERR.print "-r debug.rb is not available in safe mode\n"
+ exit 1
+end
+
require 'tracer'
require 'pp'
@@ -177,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 = []
@@ -427,7 +431,7 @@ class DEBUGGER__
pos = $2
if $1
klass = debug_silent_eval($1, binding)
- file = File.expand_path($1)
+ file = $1
end
if pos =~ /^\d+$/
pname = pos
@@ -1004,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 8c176dc82c..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,11 +44,11 @@ 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|
- if /\Ablock_given\?\z|\Aiterator\?\z|\A__.*__\z/ =~ m
+ if /\Ablock_given\?\z|iterator\?\z|\A__.*__\z/ =~ m
next
end
undef_method m
@@ -60,8 +64,8 @@ class Delegator < BasicObject
##
# :method: raise
- # Use #__raise__ if your Delegator does not have a object to delegate the
- # #raise method call.
+ # Use __raise__ if your Delegator does not have a object to delegate the
+ # raise method call.
#
#
@@ -75,16 +79,19 @@ class Delegator < BasicObject
#
# Handles the magic of delegation through \_\_getobj\_\_.
#
- ruby2_keywords def method_missing(m, *args, &block)
+ def method_missing(m, *args, &block)
r = true
target = self.__getobj__ {r = false}
-
- if r && target_respond_to?(target, m, false)
- target.__send__(m, *args, &block)
- elsif ::Kernel.method_defined?(m) || ::Kernel.private_method_defined?(m)
- ::Kernel.instance_method(m).bind_call(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
@@ -95,24 +102,14 @@ class Delegator < BasicObject
def respond_to_missing?(m, include_private)
r = true
target = self.__getobj__ {r = false}
- r &&= target_respond_to?(target, m, include_private)
- if r && include_private && !target_respond_to?(target, m, false)
- warn "delegator does not forward private method \##{m}", uplevel: 3
+ r &&= target.respond_to?(m, include_private)
+ if r && include_private && !target.respond_to?(m, false)
+ warn "#{caller(3)[0]}: delegator does not forward private method \##{m}"
return false
end
r
end
- # Handle BasicObject instances
- private def target_respond_to?(target, m, include_private)
- case target
- when Object
- target.respond_to?(m, include_private)
- else
- ::Kernel.instance_method(:respond_to?).bind_call(target, m, include_private)
- end
- end
-
#
# Returns the methods available to this delegate object as the union
# of this object's and \_\_getobj\_\_ methods.
@@ -156,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 !
@@ -193,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
@@ -204,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)
@@ -220,16 +209,39 @@ class Delegator < BasicObject
private :initialize_clone, :initialize_dup
##
+ # :method: trust
+ # Trust both the object returned by \_\_getobj\_\_ and self.
+ #
+
+ ##
+ # :method: untrust
+ # Untrust both the object returned by \_\_getobj\_\_ and self.
+ #
+
+ ##
+ # :method: taint
+ # Taint both the object returned by \_\_getobj\_\_ and self.
+ #
+
+ ##
+ # :method: untaint
+ # Untaint both the object returned by \_\_getobj\_\_ and self.
+ #
+
+ ##
# :method: freeze
# Freeze both the object returned by \_\_getobj\_\_ and self.
#
- def freeze
- __getobj__.freeze
- super()
+
+ [:trust, :untrust, :taint, :untaint, :freeze].each do |method|
+ define_method method do
+ __getobj__.send(method)
+ super()
+ end
end
@delegator_api = self.public_instance_methods
- def self.public_api # :nodoc:
+ def self.public_api # :nodoc:
@delegator_api
end
end
@@ -300,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)
@@ -333,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
@@ -347,14 +363,6 @@ end
# end
# end
#
-# or:
-#
-# MyClass = DelegateClass(ClassToDelegateTo) do # Step 1
-# def initialize
-# super(obj_of_ClassToDelegateTo) # Step 2
-# end
-# end
-#
# Here's a sample of use from Tempfile which is really a File object with a
# few special rules about storage location and when the File should be
# deleted. That makes for an almost textbook perfect example of how to use
@@ -378,15 +386,13 @@ end
# # ...
# end
#
-def DelegateClass(superclass, &block)
+def DelegateClass(superclass)
klass = Class.new(Delegator)
- ignores = [*::Delegator.public_api, :to_s, :inspect, :=~, :!~, :===]
- protected_instance_methods = superclass.protected_instance_methods
- protected_instance_methods -= ignores
- public_instance_methods = superclass.public_instance_methods
- public_instance_methods -= ignores
+ methods = superclass.instance_methods
+ methods -= ::Delegator.public_api
+ 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"
@@ -397,20 +403,15 @@ def DelegateClass(superclass, &block)
__raise__ ::ArgumentError, "cannot delegate to self" if self.equal?(obj)
@delegate_dc_obj = obj
end
- protected_instance_methods.each do |method|
- define_method(method, Delegator.delegating_block(method))
- protected method
- end
- public_instance_methods.each do |method|
+ methods.each do |method|
define_method(method, Delegator.delegating_block(method))
end
end
klass.define_singleton_method :public_instance_methods do |all=true|
- super(all) | superclass.public_instance_methods
+ super(all) - superclass.protected_instance_methods
end
klass.define_singleton_method :protected_instance_methods do |all=true|
super(all) | superclass.protected_instance_methods
end
- klass.module_eval(&block) if block
return klass
end
diff --git a/lib/delegate/delegate.gemspec b/lib/delegate/delegate.gemspec
deleted file mode 100644
index e51b50a98f..0000000000
--- a/lib/delegate/delegate.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-begin
- require_relative "lib/delegate/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "delegate"
- spec.version = Delegator::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Provides three abilities to delegate method calls to an object.}
- spec.description = %q{Provides three abilities to delegate method calls to an object.}
- spec.homepage = "https://github.com/ruby/delegate"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/delegate/version.rb b/lib/delegate/version.rb
deleted file mode 100644
index 456e8f772c..0000000000
--- a/lib/delegate/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class Delegator
- VERSION = "0.1.0"
-end
diff --git a/lib/did_you_mean.rb b/lib/did_you_mean.rb
deleted file mode 100644
index b8f92579ca..0000000000
--- a/lib/did_you_mean.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-require_relative "did_you_mean/version"
-require_relative "did_you_mean/core_ext/name_error"
-
-require_relative "did_you_mean/spell_checker"
-require_relative 'did_you_mean/spell_checkers/name_error_checkers'
-require_relative 'did_you_mean/spell_checkers/method_name_checker'
-require_relative 'did_you_mean/spell_checkers/key_error_checker'
-require_relative 'did_you_mean/spell_checkers/null_checker'
-require_relative 'did_you_mean/formatters/plain_formatter'
-require_relative 'did_you_mean/tree_spell_checker'
-
-# The +DidYouMean+ gem adds functionality to suggest possible method/class
-# names upon errors such as +NameError+ and +NoMethodError+. In Ruby 2.3 or
-# later, it is automatically activated during startup.
-#
-# @example
-#
-# methosd
-# # => NameError: undefined local variable or method `methosd' for main:Object
-# # Did you mean? methods
-# # method
-#
-# OBject
-# # => NameError: uninitialized constant OBject
-# # Did you mean? Object
-#
-# @full_name = "Yuki Nishijima"
-# first_name, last_name = full_name.split(" ")
-# # => NameError: undefined local variable or method `full_name' for main:Object
-# # Did you mean? @full_name
-#
-# @@full_name = "Yuki Nishijima"
-# @@full_anme
-# # => NameError: uninitialized class variable @@full_anme in Object
-# # Did you mean? @@full_name
-#
-# full_name = "Yuki Nishijima"
-# full_name.starts_with?("Y")
-# # => NoMethodError: undefined method `starts_with?' for "Yuki Nishijima":String
-# # Did you mean? start_with?
-#
-# hash = {foo: 1, bar: 2, baz: 3}
-# hash.fetch(:fooo)
-# # => KeyError: key not found: :fooo
-# # Did you mean? :foo
-#
-#
-# == Disabling +did_you_mean+
-#
-# Occasionally, you may want to disable the +did_you_mean+ gem for e.g.
-# debugging issues in the error object itself. You can disable it entirely by
-# specifying +--disable-did_you_mean+ option to the +ruby+ command:
-#
-# $ ruby --disable-did_you_mean -e "1.zeor?"
-# -e:1:in `<main>': undefined method `zeor?' for 1:Integer (NameError)
-#
-# When you do not have direct access to the +ruby+ command (e.g.
-# +rails console+, +irb+), you could applyoptions using the +RUBYOPT+
-# environment variable:
-#
-# $ RUBYOPT='--disable-did_you_mean' irb
-# irb:0> 1.zeor?
-# # => NoMethodError (undefined method `zeor?' for 1:Integer)
-#
-#
-# == Getting the original error message
-#
-# Sometimes, you do not want to disable the gem entirely, but need to get the
-# original error message without suggestions (e.g. testing). In this case, you
-# could use the +#original_message+ method on the error object:
-#
-# no_method_error = begin
-# 1.zeor?
-# rescue NoMethodError => error
-# error
-# end
-#
-# no_method_error.message
-# # => NoMethodError (undefined method `zeor?' for 1:Integer)
-# # Did you mean? zero?
-#
-# no_method_error.original_message
-# # => NoMethodError (undefined method `zeor?' for 1:Integer)
-#
-module DidYouMean
- # Map of error types and spell checker objects.
- SPELL_CHECKERS = Hash.new(NullChecker)
-
- # Adds +DidYouMean+ functionality to an error using a given spell checker
- def self.correct_error(error_class, spell_checker)
- SPELL_CHECKERS[error_class.name] = spell_checker
- error_class.prepend(Correctable) unless error_class < Correctable
- end
-
- correct_error NameError, NameErrorCheckers
- correct_error KeyError, KeyErrorChecker
- correct_error NoMethodError, MethodNameChecker
-
- # Returns the currenctly set formatter. By default, it is set to +DidYouMean::Formatter+.
- def self.formatter
- @@formatter
- end
-
- # Updates the primary formatter used to format the suggestions.
- def self.formatter=(formatter)
- @@formatter = formatter
- end
-
- self.formatter = PlainFormatter.new
-end
diff --git a/lib/did_you_mean/core_ext/name_error.rb b/lib/did_you_mean/core_ext/name_error.rb
deleted file mode 100644
index 77dcd520c0..0000000000
--- a/lib/did_you_mean/core_ext/name_error.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module DidYouMean
- module Correctable
- def original_message
- method(:to_s).super_method.call
- end
-
- def to_s
- msg = super.dup
- suggestion = DidYouMean.formatter.message_for(corrections)
-
- msg << suggestion if !msg.end_with?(suggestion)
- msg
- rescue
- super
- end
-
- def corrections
- @corrections ||= spell_checker.corrections
- end
-
- def spell_checker
- SPELL_CHECKERS[self.class.to_s].new(self)
- end
- end
-end
diff --git a/lib/did_you_mean/did_you_mean.gemspec b/lib/did_you_mean/did_you_mean.gemspec
deleted file mode 100644
index 8fe5723129..0000000000
--- a/lib/did_you_mean/did_you_mean.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-# coding: utf-8
-lib = File.expand_path('../lib', __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-begin
- require_relative "lib/did_you_mean/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "did_you_mean"
- spec.version = DidYouMean::VERSION
- spec.authors = ["Yuki Nishijima"]
- spec.email = ["mail@yukinishijima.net"]
- spec.summary = '"Did you mean?" experience in Ruby'
- spec.description = 'The gem that has been saving people from typos since 2014.'
- spec.homepage = "https://github.com/ruby/did_you_mean"
- spec.license = "MIT"
-
- spec.files = `git ls-files`.split($/).reject{|path| path.start_with?('evaluation/') }
- spec.test_files = spec.files.grep(%r{^(test)/})
- spec.require_paths = ["lib"]
-
- spec.required_ruby_version = '>= 2.5.0'
-
- spec.add_development_dependency "rake"
-end
diff --git a/lib/did_you_mean/experimental.rb b/lib/did_you_mean/experimental.rb
deleted file mode 100644
index f8e37e4532..0000000000
--- a/lib/did_you_mean/experimental.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-warn "Experimental features in the did_you_mean gem has been removed " \
- "and `require \"did_you_mean/experimental\"' has no effect."
diff --git a/lib/did_you_mean/experimental/initializer_name_correction.rb b/lib/did_you_mean/experimental/initializer_name_correction.rb
deleted file mode 100644
index b59c98e774..0000000000
--- a/lib/did_you_mean/experimental/initializer_name_correction.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen-string-literal: true
-
-require_relative '../levenshtein'
-
-module DidYouMean
- module Experimental
- module InitializerNameCorrection
- def method_added(name)
- super
-
- distance = Levenshtein.distance(name.to_s, 'initialize')
- if distance != 0 && distance <= 2
- warn "warning: #{name} might be misspelled, perhaps you meant initialize?"
- end
- end
- end
-
- ::Class.prepend(InitializerNameCorrection)
- end
-end
diff --git a/lib/did_you_mean/experimental/ivar_name_correction.rb b/lib/did_you_mean/experimental/ivar_name_correction.rb
deleted file mode 100644
index 322e422c6b..0000000000
--- a/lib/did_you_mean/experimental/ivar_name_correction.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-# frozen-string-literal: true
-
-require_relative '../../did_you_mean'
-
-module DidYouMean
- module Experimental #:nodoc:
- class IvarNameCheckerBuilder #:nodoc:
- attr_reader :original_checker
-
- def initialize(original_checker) #:nodoc:
- @original_checker = original_checker
- end
-
- def new(no_method_error) #:nodoc:
- IvarNameChecker.new(no_method_error, original_checker: @original_checker)
- end
- end
-
- class IvarNameChecker #:nodoc:
- REPLS = {
- "(irb)" => -> { Readline::HISTORY.to_a.last }
- }
-
- TRACE = TracePoint.trace(:raise) do |tp|
- e = tp.raised_exception
-
- if SPELL_CHECKERS.include?(e.class.to_s) && !e.instance_variable_defined?(:@frame_binding)
- e.instance_variable_set(:@frame_binding, tp.binding)
- end
- end
-
- attr_reader :original_checker
-
- def initialize(no_method_error, original_checker: )
- @original_checker = original_checker.new(no_method_error)
-
- @location = no_method_error.backtrace_locations.first
- @ivar_names = no_method_error.frame_binding.receiver.instance_variables
-
- no_method_error.remove_instance_variable(:@frame_binding)
- end
-
- def corrections
- original_checker.corrections + ivar_name_corrections
- end
-
- def ivar_name_corrections
- @ivar_name_corrections ||= SpellChecker.new(dictionary: @ivar_names).correct(receiver_name.to_s)
- end
-
- private
-
- def receiver_name
- return unless @original_checker.receiver.nil?
-
- abs_path = @location.absolute_path
- lineno = @location.lineno
-
- /@(\w+)*\.#{@original_checker.method_name}/ =~ line(abs_path, lineno).to_s && $1
- end
-
- def line(abs_path, lineno)
- if REPLS[abs_path]
- REPLS[abs_path].call
- elsif File.exist?(abs_path)
- File.open(abs_path) do |file|
- file.detect { file.lineno == lineno }
- end
- end
- end
- end
- end
-
- NameError.send(:attr, :frame_binding)
- SPELL_CHECKERS['NoMethodError'] = Experimental::IvarNameCheckerBuilder.new(SPELL_CHECKERS['NoMethodError'])
-end
diff --git a/lib/did_you_mean/formatters/plain_formatter.rb b/lib/did_you_mean/formatters/plain_formatter.rb
deleted file mode 100644
index e2d995f587..0000000000
--- a/lib/did_you_mean/formatters/plain_formatter.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen-string-literal: true
-
-module DidYouMean
- # The +DidYouMean::PlainFormatter+ is the basic, default formatter for the
- # gem. The formatter responds to the +message_for+ method and it returns a
- # human readable string.
- class PlainFormatter
-
- # Returns a human readable string that contains +corrections+. This
- # formatter is designed to be less verbose to not take too much screen
- # space while being helpful enough to the user.
- #
- # @example
- #
- # formatter = DidYouMean::PlainFormatter.new
- #
- # # displays suggestions in two lines with the leading empty line
- # puts formatter.message_for(["methods", "method"])
- #
- # Did you mean? methods
- # method
- # # => nil
- #
- # # displays an empty line
- # puts formatter.message_for([])
- #
- # # => nil
- #
- def message_for(corrections)
- corrections.empty? ? "" : "\nDid you mean? #{corrections.join("\n ")}"
- end
- end
-end
diff --git a/lib/did_you_mean/formatters/verbose_formatter.rb b/lib/did_you_mean/formatters/verbose_formatter.rb
deleted file mode 100644
index b8fe214d57..0000000000
--- a/lib/did_you_mean/formatters/verbose_formatter.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen-string-literal: true
-
-module DidYouMean
- # The +DidYouMean::VerboseFormatter+ uses extra empty lines to make the
- # suggestion stand out more in the error message.
- #
- # In order to activate the verbose formatter,
- #
- # @example
- #
- # OBject
- # # => NameError: uninitialized constant OBject
- # # Did you mean? Object
- #
- # require 'did_you_mean/verbose'
- #
- # OBject
- # # => NameError: uninitialized constant OBject
- # #
- # # Did you mean? Object
- # #
- #
- class VerboseFormatter
-
- # Returns a human readable string that contains +corrections+. This
- # formatter is designed to be less verbose to not take too much screen
- # space while being helpful enough to the user.
- #
- # @example
- #
- # formatter = DidYouMean::PlainFormatter.new
- #
- # puts formatter.message_for(["methods", "method"])
- #
- #
- # Did you mean? methods
- # method
- #
- # # => nil
- #
- def message_for(corrections)
- return "" if corrections.empty?
-
- output = "\n\n Did you mean? ".dup
- output << corrections.join("\n ")
- output << "\n "
- end
- end
-end
diff --git a/lib/did_you_mean/jaro_winkler.rb b/lib/did_you_mean/jaro_winkler.rb
deleted file mode 100644
index 56db130af4..0000000000
--- a/lib/did_you_mean/jaro_winkler.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-module DidYouMean
- module Jaro
- module_function
-
- def distance(str1, str2)
- str1, str2 = str2, str1 if str1.length > str2.length
- length1, length2 = str1.length, str2.length
-
- m = 0.0
- t = 0.0
- range = (length2 / 2).floor - 1
- range = 0 if range < 0
- flags1 = 0
- flags2 = 0
-
- # Avoid duplicating enumerable objects
- str1_codepoints = str1.codepoints
- str2_codepoints = str2.codepoints
-
- i = 0
- while i < length1
- last = i + range
- j = (i >= range) ? i - range : 0
-
- while j <= last
- if flags2[j] == 0 && str1_codepoints[i] == str2_codepoints[j]
- flags2 |= (1 << j)
- flags1 |= (1 << i)
- m += 1
- break
- end
-
- j += 1
- end
-
- i += 1
- end
-
- k = i = 0
- while i < length1
- if flags1[i] != 0
- j = index = k
-
- k = while j < length2
- index = j
- break(j + 1) if flags2[j] != 0
-
- j += 1
- end
-
- t += 1 if str1_codepoints[i] != str2_codepoints[index]
- end
-
- i += 1
- end
- t = (t / 2).floor
-
- m == 0 ? 0 : (m / length1 + m / length2 + (m - t) / m) / 3
- end
- end
-
- module JaroWinkler
- WEIGHT = 0.1
- THRESHOLD = 0.7
-
- module_function
-
- def distance(str1, str2)
- jaro_distance = Jaro.distance(str1, str2)
-
- if jaro_distance > THRESHOLD
- codepoints2 = str2.codepoints
- prefix_bonus = 0
-
- i = 0
- str1.each_codepoint do |char1|
- char1 == codepoints2[i] && i < 4 ? prefix_bonus += 1 : break
- i += 1
- end
-
- jaro_distance + (prefix_bonus * WEIGHT * (1 - jaro_distance))
- else
- jaro_distance
- end
- end
- end
-end
diff --git a/lib/did_you_mean/levenshtein.rb b/lib/did_you_mean/levenshtein.rb
deleted file mode 100644
index 098053470f..0000000000
--- a/lib/did_you_mean/levenshtein.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-module DidYouMean
- module Levenshtein # :nodoc:
- # This code is based directly on the Text gem implementation
- # Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher.
- #
- # Returns a value representing the "cost" of transforming str1 into str2
- def distance(str1, str2)
- n = str1.length
- m = str2.length
- return m if n.zero?
- return n if m.zero?
-
- d = (0..m).to_a
- x = nil
-
- # to avoid duplicating an enumerable object, create it outside of the loop
- str2_codepoints = str2.codepoints
-
- str1.each_codepoint.with_index(1) do |char1, i|
- j = 0
- while j < m
- cost = (char1 == str2_codepoints[j]) ? 0 : 1
- x = min3(
- d[j+1] + 1, # insertion
- i + 1, # deletion
- d[j] + cost # substitution
- )
- d[j] = i
- i = x
-
- j += 1
- end
- d[m] = x
- end
-
- x
- end
- module_function :distance
-
- private
-
- # detects the minimum value out of three arguments. This method is
- # faster than `[a, b, c].min` and puts less GC pressure.
- # See https://github.com/ruby/did_you_mean/pull/1 for a performance
- # benchmark.
- def min3(a, b, c)
- if a < b && a < c
- a
- elsif b < c
- b
- else
- c
- end
- end
- module_function :min3
- end
-end
diff --git a/lib/did_you_mean/spell_checker.rb b/lib/did_you_mean/spell_checker.rb
deleted file mode 100644
index e5106abba2..0000000000
--- a/lib/did_you_mean/spell_checker.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen-string-literal: true
-
-require_relative "levenshtein"
-require_relative "jaro_winkler"
-
-module DidYouMean
- class SpellChecker
- def initialize(dictionary:)
- @dictionary = dictionary
- end
-
- def correct(input)
- input = normalize(input)
- threshold = input.length > 3 ? 0.834 : 0.77
-
- words = @dictionary.select { |word| JaroWinkler.distance(normalize(word), input) >= threshold }
- words.reject! { |word| input == word.to_s }
- words.sort_by! { |word| JaroWinkler.distance(word.to_s, input) }
- words.reverse!
-
- # Correct mistypes
- threshold = (input.length * 0.25).ceil
- corrections = words.select { |c| Levenshtein.distance(normalize(c), input) <= threshold }
-
- # Correct misspells
- if corrections.empty?
- corrections = words.select do |word|
- word = normalize(word)
- length = input.length < word.length ? input.length : word.length
-
- Levenshtein.distance(word, input) < length
- end.first(1)
- end
-
- corrections
- end
-
- private
-
- def normalize(str_or_symbol) #:nodoc:
- str = str_or_symbol.to_s.downcase
- str.tr!("@", "")
- str
- end
- end
-end
diff --git a/lib/did_you_mean/spell_checkers/key_error_checker.rb b/lib/did_you_mean/spell_checkers/key_error_checker.rb
deleted file mode 100644
index be4bea7789..0000000000
--- a/lib/did_you_mean/spell_checkers/key_error_checker.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require_relative "../spell_checker"
-
-module DidYouMean
- class KeyErrorChecker
- def initialize(key_error)
- @key = key_error.key
- @keys = key_error.receiver.keys
- end
-
- def corrections
- @corrections ||= exact_matches.empty? ? SpellChecker.new(dictionary: @keys).correct(@key).map(&:inspect) : exact_matches
- end
-
- private
-
- def exact_matches
- @exact_matches ||= @keys.select { |word| @key == word.to_s }.map(&:inspect)
- end
- end
-end
diff --git a/lib/did_you_mean/spell_checkers/method_name_checker.rb b/lib/did_you_mean/spell_checkers/method_name_checker.rb
deleted file mode 100644
index 3a38245f0c..0000000000
--- a/lib/did_you_mean/spell_checkers/method_name_checker.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require_relative "../spell_checker"
-
-module DidYouMean
- class MethodNameChecker
- attr_reader :method_name, :receiver
-
- NAMES_TO_EXCLUDE = { NilClass => nil.methods }
- NAMES_TO_EXCLUDE.default = []
-
- # +MethodNameChecker::RB_RESERVED_WORDS+ is the list of reserved words in
- # Ruby that take an argument. Unlike
- # +VariableNameChecker::RB_RESERVED_WORDS+, these reserved words require
- # an argument, and a +NoMethodError+ is raised due to the presence of the
- # argument.
- #
- # The +MethodNameChecker+ will use this list to suggest a reversed word if
- # a +NoMethodError+ is raised and found closest matches.
- #
- # Also see +VariableNameChecker::RB_RESERVED_WORDS+.
- RB_RESERVED_WORDS = %i(
- alias
- case
- def
- defined?
- elsif
- end
- ensure
- for
- rescue
- super
- undef
- unless
- until
- when
- while
- yield
- )
-
- def initialize(exception)
- @method_name = exception.name
- @receiver = exception.receiver
- @private_call = exception.respond_to?(:private_call?) ? exception.private_call? : false
- end
-
- def corrections
- @corrections ||= SpellChecker.new(dictionary: RB_RESERVED_WORDS + method_names).correct(method_name) - names_to_exclude
- end
-
- def method_names
- if Object === receiver
- method_names = receiver.methods + receiver.singleton_methods
- method_names += receiver.private_methods if @private_call
- method_names.uniq!
- method_names
- else
- []
- end
- end
-
- def names_to_exclude
- Object === receiver ? NAMES_TO_EXCLUDE[receiver.class] : []
- end
- end
-end
diff --git a/lib/did_you_mean/spell_checkers/name_error_checkers.rb b/lib/did_you_mean/spell_checkers/name_error_checkers.rb
deleted file mode 100644
index 6e2aaa4cb1..0000000000
--- a/lib/did_you_mean/spell_checkers/name_error_checkers.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require_relative 'name_error_checkers/class_name_checker'
-require_relative 'name_error_checkers/variable_name_checker'
-
-module DidYouMean
- class << (NameErrorCheckers = Object.new)
- def new(exception)
- case exception.original_message
- when /uninitialized constant/
- ClassNameChecker
- when /undefined local variable or method/,
- /undefined method/,
- /uninitialized class variable/,
- /no member '.*' in struct/
- VariableNameChecker
- else
- NullChecker
- end.new(exception)
- end
- end
-end
diff --git a/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb b/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
deleted file mode 100644
index 924265b929..0000000000
--- a/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen-string-literal: true
-
-require_relative "../../spell_checker"
-
-module DidYouMean
- class ClassNameChecker
- attr_reader :class_name
-
- def initialize(exception)
- @class_name, @receiver, @original_message = exception.name, exception.receiver, exception.original_message
- end
-
- def corrections
- @corrections ||= SpellChecker.new(dictionary: class_names)
- .correct(class_name)
- .map(&:full_name)
- .reject {|qualified_name| @original_message.include?(qualified_name) }
- end
-
- def class_names
- scopes.flat_map do |scope|
- scope.constants.map do |c|
- ClassName.new(c, scope == Object ? "" : "#{scope}::")
- end
- end
- end
-
- def scopes
- @scopes ||= @receiver.to_s.split("::").inject([Object]) do |_scopes, scope|
- _scopes << _scopes.last.const_get(scope)
- end.uniq
- end
-
- class ClassName < String
- attr :namespace
-
- def initialize(name, namespace = '')
- super(name.to_s)
- @namespace = namespace
- end
-
- def full_name
- self.class.new("#{namespace}#{self}")
- end
- end
-
- private_constant :ClassName
- end
-end
diff --git a/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb b/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
deleted file mode 100644
index 3e51b4fa3a..0000000000
--- a/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-# frozen-string-literal: true
-
-require_relative "../../spell_checker"
-
-module DidYouMean
- class VariableNameChecker
- attr_reader :name, :method_names, :lvar_names, :ivar_names, :cvar_names
-
- NAMES_TO_EXCLUDE = { 'foo' => [:fork, :for] }
- NAMES_TO_EXCLUDE.default = []
-
- # +VariableNameChecker::RB_RESERVED_WORDS+ is the list of all reserved
- # words in Ruby. They could be declared like methods are, and a typo would
- # cause Ruby to raise a +NameError+ because of the way they are declared.
- #
- # The +:VariableNameChecker+ will use this list to suggest a reversed word
- # if a +NameError+ is raised and found closest matches, excluding:
- #
- # * +do+
- # * +if+
- # * +in+
- # * +or+
- #
- # Also see +MethodNameChecker::RB_RESERVED_WORDS+.
- RB_RESERVED_WORDS = %i(
- BEGIN
- END
- alias
- and
- begin
- break
- case
- class
- def
- defined?
- else
- elsif
- end
- ensure
- false
- for
- module
- next
- nil
- not
- redo
- rescue
- retry
- return
- self
- super
- then
- true
- undef
- unless
- until
- when
- while
- yield
- __LINE__
- __FILE__
- __ENCODING__
- )
-
- def initialize(exception)
- @name = exception.name.to_s.tr("@", "")
- @lvar_names = exception.respond_to?(:local_variables) ? exception.local_variables : []
- receiver = exception.receiver
-
- @method_names = receiver.methods + receiver.private_methods
- @ivar_names = receiver.instance_variables
- @cvar_names = receiver.class.class_variables
- @cvar_names += receiver.class_variables if receiver.kind_of?(Module)
- end
-
- def corrections
- @corrections ||= SpellChecker
- .new(dictionary: (RB_RESERVED_WORDS + lvar_names + method_names + ivar_names + cvar_names))
- .correct(name) - NAMES_TO_EXCLUDE[@name]
- end
- end
-end
diff --git a/lib/did_you_mean/spell_checkers/null_checker.rb b/lib/did_you_mean/spell_checkers/null_checker.rb
deleted file mode 100644
index 1306f69d4a..0000000000
--- a/lib/did_you_mean/spell_checkers/null_checker.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module DidYouMean
- class NullChecker
- def initialize(*); end
- def corrections; [] end
- end
-end
diff --git a/lib/did_you_mean/tree_spell_checker.rb b/lib/did_you_mean/tree_spell_checker.rb
deleted file mode 100644
index 6a5b485413..0000000000
--- a/lib/did_you_mean/tree_spell_checker.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-module DidYouMean
- # spell checker for a dictionary that has a tree
- # structure, see doc/tree_spell_checker_api.md
- class TreeSpellChecker
- attr_reader :dictionary, :dimensions, :separator, :augment
-
- def initialize(dictionary:, separator: '/', augment: nil)
- @dictionary = dictionary
- @separator = separator
- @augment = augment
- @dimensions = parse_dimensions
- end
-
- def correct(input)
- plausibles = plausible_dimensions input
- return no_idea(input) if plausibles.empty?
- suggestions = find_suggestions input, plausibles
- return no_idea(input) if suggestions.empty?
- suggestions
- end
-
- private
-
- def parse_dimensions
- ParseDimensions.new(dictionary, separator).call
- end
-
- def find_suggestions(input, plausibles)
- states = plausibles[0].product(*plausibles[1..-1])
- paths = possible_paths states
- leaf = input.split(separator).last
- ideas = find_ideas(paths, leaf)
- ideas.compact.flatten
- end
-
- def no_idea(input)
- return [] unless augment
- ::DidYouMean::SpellChecker.new(dictionary: dictionary).correct(input)
- end
-
- def find_ideas(paths, leaf)
- paths.map do |path|
- names = find_leaves(path)
- ideas = CorrectElement.new.call names, leaf
- ideas_to_paths ideas, leaf, names, path
- end
- end
-
- def ideas_to_paths(ideas, leaf, names, path)
- return nil if ideas.empty?
- return [path + separator + leaf] if names.include? leaf
- ideas.map { |str| path + separator + str }
- end
-
- def find_leaves(path)
- dictionary.map do |str|
- next unless str.include? "#{path}#{separator}"
- str.gsub("#{path}#{separator}", '')
- end.compact
- end
-
- def possible_paths(states)
- states.map do |state|
- state.join separator
- end
- end
-
- def plausible_dimensions(input)
- elements = input.split(separator)[0..-2]
- elements.each_with_index.map do |element, i|
- next if dimensions[i].nil?
- CorrectElement.new.call dimensions[i], element
- end.compact
- end
- end
-
- # parses the elements in each dimension
- class ParseDimensions
- def initialize(dictionary, separator)
- @dictionary = dictionary
- @separator = separator
- end
-
- def call
- leafless = remove_leaves
- dimensions = find_elements leafless
- dimensions.map do |elements|
- elements.to_set.to_a
- end
- end
-
- private
-
- def remove_leaves
- dictionary.map do |a|
- elements = a.split(separator)
- elements[0..-2]
- end.to_set.to_a
- end
-
- def find_elements(leafless)
- max_elements = leafless.map(&:size).max
- dimensions = Array.new(max_elements) { [] }
- (0...max_elements).each do |i|
- leafless.each do |elements|
- dimensions[i] << elements[i] unless elements[i].nil?
- end
- end
- dimensions
- end
-
- attr_reader :dictionary, :separator
- end
-
- # identifies the elements close to element
- class CorrectElement
- def initialize
- end
-
- def call(names, element)
- return names if names.size == 1
- str = normalize element
- return [str] if names.include? str
- checker = ::DidYouMean::SpellChecker.new(dictionary: names)
- checker.correct(str)
- end
-
- private
-
- def normalize(leaf)
- str = leaf.dup
- str.downcase!
- return str unless str.include? '@'
- str.tr!('@', ' ')
- end
- end
-end
diff --git a/lib/did_you_mean/verbose.rb b/lib/did_you_mean/verbose.rb
deleted file mode 100644
index 4e86f167ea..0000000000
--- a/lib/did_you_mean/verbose.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require_relative '../did_you_mean'
-require_relative 'formatters/verbose_formatter'
-
-DidYouMean.formatter = DidYouMean::VerboseFormatter.new
diff --git a/lib/did_you_mean/version.rb b/lib/did_you_mean/version.rb
deleted file mode 100644
index 6d3dd3a694..0000000000
--- a/lib/did_you_mean/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-module DidYouMean
- VERSION = "1.4.0"
-end
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 e2aaf701ce..ab352afa1d 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# = drb/drb.rb
#
@@ -47,9 +46,9 @@
# Translation of presentation on Ruby by Masatoshi Seki.
require 'socket'
-require 'io/wait'
-require 'monitor'
-require_relative 'eq'
+require 'thread'
+require 'fcntl'
+require 'drb/eq'
#
# == Overview
@@ -160,6 +159,8 @@ require_relative 'eq'
# # The object that handles requests on the server
# FRONT_OBJECT=TimeServer.new
#
+# $SAFE = 1 # disable eval() and friends
+#
# DRb.start_service(URI, FRONT_OBJECT)
# # Wait for the drb server thread to finish before exiting.
# DRb.thread.join
@@ -233,7 +234,7 @@ require_relative 'eq'
# def get_logger(name)
# if !@loggers.has_key? name
# # make the filename safe, then declare it to be so
-# fname = name.gsub(/[.\/\\\:]/, "_")
+# fname = name.gsub(/[.\/\\\:]/, "_").untaint
# @loggers[name] = Logger.new(name, @basedir + "/" + fname)
# end
# return @loggers[name]
@@ -243,6 +244,8 @@ require_relative 'eq'
#
# FRONT_OBJECT=LoggerFactory.new("/tmp/dlog")
#
+# $SAFE = 1 # disable eval() and friends
+#
# DRb.start_service(URI, FRONT_OBJECT)
# DRb.thread.join
#
@@ -282,7 +285,10 @@ require_relative 'eq'
# ro.instance_eval("`rm -rf *`")
#
# The dangers posed by instance_eval and friends are such that a
-# DRbServer should only be used when clients are trusted.
+# DRbServer should generally be run with $SAFE set to at least
+# level 1. This will disable eval() and related calls on strings
+# passed across the wire. The sample usage code given above follows
+# this practice.
#
# A DRbServer can be configured with an access control list to
# selectively allow or deny access from specified IP addresses. The
@@ -354,7 +360,7 @@ module DRb
# drb remains valid only while that object instance remains alive
# within the server runtime.
#
- # For alternative mechanisms, see DRb::TimerIdConv in drb/timeridconv.rb
+ # For alternative mechanisms, see DRb::TimerIdConv in rdb/timeridconv.rb
# and DRbNameIdConv in sample/name.rb in the full drb distribution.
class DRbIdConv
@@ -371,12 +377,7 @@ module DRb
# This implementation returns the object's __id__ in the local
# object space.
def to_id(obj)
- case obj
- when Object
- obj.nil? ? nil : obj.__id__
- when BasicObject
- obj.__id__
- end
+ obj.nil? ? nil : obj.__id__
end
end
@@ -559,14 +560,7 @@ module DRb
end
def dump(obj, error=false) # :nodoc:
- case obj
- when DRbUndumped
- obj = make_proxy(obj, error)
- when Object
- # nothing
- else
- obj = make_proxy(obj, error)
- end
+ obj = make_proxy(obj, error) if obj.kind_of? DRbUndumped
begin
str = Marshal::dump(obj)
rescue
@@ -594,9 +588,16 @@ module DRb
raise(DRbConnError, 'premature marshal format(can\'t read)') if str.size < sz
DRb.mutex.synchronize do
begin
+ save = Thread.current[:drb_untaint]
+ Thread.current[:drb_untaint] = []
Marshal::load(str)
rescue NameError, ArgumentError
DRbUnknown.new($!, str)
+ ensure
+ Thread.current[:drb_untaint].each do |x|
+ x.untaint
+ end
+ Thread.current[:drb_untaint] = save
end
end
end
@@ -744,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
@@ -768,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
@@ -791,15 +792,15 @@ 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:
- if /\Adrb([a-z0-9]+):/ =~ uri
+ def auto_load(uri, config) # :nodoc:
+ if uri =~ /^drb([a-z0-9]+):/
require("drb/#{$1}") rescue nil
end
end
@@ -815,13 +816,13 @@ module DRb
# :stopdoc:
private
def self.parse_uri(uri)
- if /\Adruby:\/\/(.*?):(\d+)(\?(.*))?\z/ =~ uri
+ if uri =~ /^druby:\/\/(.*?):(\d+)(\?(.*))?$/
host = $1
port = $2.to_i
option = $4
[host, port, option]
else
- raise(DRbBadScheme, uri) unless uri.start_with?('druby:')
+ raise(DRbBadScheme, uri) unless uri =~ /^druby:/
raise(DRbBadURI, 'can\'t parse uri:' + uri)
end
end
@@ -836,6 +837,8 @@ module DRb
# URI protocols.
def self.open(uri, config)
host, port, = parse_uri(uri)
+ host.untaint
+ port.untaint
soc = TCPSocket.open(host, port)
self.new(uri, soc, config)
end
@@ -844,11 +847,7 @@ module DRb
def self.getservername
host = Socket::gethostname
begin
- Socket::getaddrinfo(host, nil,
- Socket::AF_UNSPEC,
- Socket::SOCK_STREAM,
- 0,
- Socket::AI_PASSIVE)[0][3]
+ Socket::gethostbyname(host)[0]
rescue
'localhost'
end
@@ -950,7 +949,6 @@ module DRb
# returned by #open or by #accept, then it closes this particular
# client-server session.
def close
- shutdown
if @socket
@socket.close
@socket = nil
@@ -959,8 +957,14 @@ module DRb
end
def close_shutdown_pipe
- @shutdown_pipe_w.close
- @shutdown_pipe_r.close
+ 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
@@ -993,13 +997,13 @@ module DRb
# Graceful shutdown
def shutdown
- @shutdown_pipe_w.close
+ @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
@@ -1008,8 +1012,7 @@ module DRb
def set_sockopt(soc) # :nodoc:
soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
- rescue IOError, Errno::ECONNRESET, Errno::EINVAL
- # closed/shutdown socket, ignore error
+ soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC
end
end
@@ -1052,6 +1055,9 @@ module DRb
if DRb.here?(uri)
obj = DRb.to_obj(ref)
+ if ((! obj.tainted?) && Thread.current[:drb_untaint])
+ Thread.current[:drb_untaint].push(obj)
+ end
return obj
end
@@ -1088,14 +1094,7 @@ module DRb
def initialize(obj, uri=nil)
@uri = nil
@ref = nil
- case obj
- when Object
- is_nil = obj.nil?
- when BasicObject
- is_nil = false
- end
-
- if is_nil
+ if obj.nil?
return if uri.nil?
@uri, option = DRbProtocol.uri_option(uri, DRb.config)
@ref = DRbURIOption.new(option) unless option.nil?
@@ -1174,7 +1173,7 @@ module DRb
bt = []
result.backtrace.each do |x|
break if /`__send__'$/ =~ x
- if /\A\(druby:\/\// =~ x
+ if /^\(druby:\/\// =~ x
bt.push(x)
else
bt.push(prefix + x)
@@ -1195,54 +1194,6 @@ module DRb
end
end
- class ThreadObject
- include MonitorMixin
-
- def initialize(&blk)
- super()
- @wait_ev = new_cond
- @req_ev = new_cond
- @res_ev = new_cond
- @status = :wait
- @req = nil
- @res = nil
- @thread = Thread.new(self, &blk)
- end
-
- def alive?
- @thread.alive?
- end
-
- def kill
- @thread.kill
- @thread.join
- end
-
- def method_missing(msg, *arg, &blk)
- synchronize do
- @wait_ev.wait_until { @status == :wait }
- @req = [msg] + arg
- @status = :req
- @req_ev.broadcast
- @res_ev.wait_until { @status == :res }
- value = @res
- @req = @res = nil
- @status = :wait
- @wait_ev.broadcast
- return value
- end
- end
-
- def _execute()
- synchronize do
- @req_ev.wait_until { @status == :req }
- @res = yield(@req)
- @status = :res
- @res_ev.signal
- end
- end
- end
-
# Class handling the connection between a DRbObject and the
# server the real object lives on.
#
@@ -1254,50 +1205,26 @@ module DRb
# not normally need to deal with it directly.
class DRbConn
POOL_SIZE = 16 # :nodoc:
+ @mutex = Mutex.new
+ @pool = []
- def self.make_pool
- ThreadObject.new do |queue|
- pool = []
- while true
- queue._execute do |message|
- case(message[0])
- when :take then
- remote_uri = message[1]
- conn = nil
- new_pool = []
- pool.each do |c|
- if conn.nil? and c.uri == remote_uri
- conn = c if c.alive?
- else
- new_pool.push c
- end
- end
- pool = new_pool
- conn
- when :store then
- conn = message[1]
- pool.unshift(conn)
- pool.pop.close while pool.size > POOL_SIZE
- conn
+ def self.open(remote_uri) # :nodoc:
+ begin
+ conn = nil
+
+ @mutex.synchronize do
+ #FIXME
+ new_pool = []
+ @pool.each do |c|
+ if conn.nil? and c.uri == remote_uri
+ conn = c if c.alive?
else
- nil
+ new_pool.push c
end
end
+ @pool = new_pool
end
- end
- end
- @pool_proxy = nil
-
- def self.stop_pool
- @pool_proxy&.kill
- @pool_proxy = nil
- end
- def self.open(remote_uri) # :nodoc:
- begin
- @pool_proxy = make_pool unless @pool_proxy&.alive?
-
- conn = @pool_proxy.take(remote_uri)
conn = self.new(remote_uri) unless conn
succ, result = yield(conn)
return succ, result
@@ -1305,7 +1232,10 @@ module DRb
ensure
if conn
if succ
- @pool_proxy.store(conn)
+ @mutex.synchronize do
+ @pool.unshift(conn)
+ @pool.pop.close while @pool.size > POOL_SIZE
+ end
else
conn.close
end
@@ -1351,8 +1281,9 @@ module DRb
@@idconv = DRbIdConv.new
@@secondary_server = nil
@@argc_limit = 256
- @@load_limit = 0xffffffff
+ @@load_limit = 256 * 102400
@@verbose = false
+ @@safe_level = 0
# Set the default value for the :argc_limit option.
#
@@ -1382,8 +1313,11 @@ module DRb
@@idconv = idconv
end
- def self.default_safe_level(level) # :nodoc:
- # Remove in Ruby 3.0
+ # Set the default safe level to +level+. The default safe level is 0
+ #
+ # See #new for more information.
+ def self.default_safe_level(level)
+ @@safe_level = level
end
# Set the default value of the :verbose option.
@@ -1405,6 +1339,7 @@ module DRb
:tcp_acl => @@acl,
:load_limit => @@load_limit,
:argc_limit => @@argc_limit,
+ :safe_level => @@safe_level
}
default_config.update(hash)
end
@@ -1438,6 +1373,10 @@ module DRb
# :argc_limit :: the maximum number of arguments to a remote
# method accepted by the server. Defaults to
# 256.
+ # :safe_level :: The safe level of the DRbServer. The attribute
+ # sets $SAFE for methods performed in the main_loop.
+ # Defaults to 0.
+ #
# The default values of these options can be modified on
# a class-wide basis by the class methods #default_argc_limit,
# #default_load_limit, #default_acl, #default_id_conv,
@@ -1469,6 +1408,7 @@ module DRb
@front = front
@idconv = @config[:idconv]
+ @safe_level = @config[:safe_level]
@grp = ThreadGroup.new
@thread = run
@@ -1495,10 +1435,11 @@ module DRb
# The configuration of this DRbServer
attr_reader :config
- def safe_level # :nodoc:
- # Remove in Ruby 3.0
- 0
- end
+ # The safe level for this server. This is a number corresponding to
+ # $SAFE.
+ #
+ # The default safe_level is 0
+ attr_reader :safe_level
# Set whether to operate in verbose mode.
#
@@ -1526,7 +1467,12 @@ module DRb
if Thread.current['DRb'] && Thread.current['DRb']['server'] == self
Thread.current['DRb']['stop_service'] = true
else
- shutdown
+ if @protocol.respond_to? :shutdown
+ @protocol.shutdown
+ else
+ @thread.kill # xxx: Thread#kill
+ end
+ @thread.join
end
end
@@ -1545,18 +1491,6 @@ 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.
@@ -1586,9 +1520,9 @@ module DRb
# Coerce an object to a string, providing our own representation if
# to_s is not defined for the object.
def any_to_s(obj)
- "#{obj}:#{obj.class}"
+ obj.to_s + ":#{obj.class}"
rescue
- Kernel.instance_method(:to_s).bind_call(obj)
+ sprintf("#<%s:0x%lx>", obj.class, obj.__id__)
end
# Check that a method is callable via dRuby.
@@ -1604,27 +1538,14 @@ module DRb
raise(ArgumentError, "#{any_to_s(msg_id)} is not a symbol") unless Symbol == msg_id.class
raise(SecurityError, "insecure method `#{msg_id}'") if insecure_method?(msg_id)
- case obj
- when Object
- if obj.private_methods.include?(msg_id)
- desc = any_to_s(obj)
- raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
- elsif obj.protected_methods.include?(msg_id)
- desc = any_to_s(obj)
- raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
- else
- true
- end
+ if obj.private_methods.include?(msg_id)
+ desc = any_to_s(obj)
+ raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
+ elsif obj.protected_methods.include?(msg_id)
+ desc = any_to_s(obj)
+ raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
else
- if Kernel.instance_method(:private_methods).bind(obj).call.include?(msg_id)
- desc = any_to_s(obj)
- raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
- elsif Kernel.instance_method(:protected_methods).bind(obj).call.include?(msg_id)
- desc = any_to_s(obj)
- raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
- else
- true
- end
+ true
end
end
public :check_insecure_method
@@ -1632,6 +1553,7 @@ module DRb
class InvokeMethod # :nodoc:
def initialize(drb_server, client)
@drb_server = drb_server
+ @safe_level = drb_server.safe_level
@client = client
end
@@ -1640,22 +1562,34 @@ module DRb
@succ = false
setup_message
- if @block
- @result = perform_with_block
+ if $SAFE < @safe_level
+ info = Thread.current['DRb']
+ if @block
+ @result = Thread.new {
+ Thread.current['DRb'] = info
+ $SAFE = @safe_level
+ perform_with_block
+ }.value
+ else
+ @result = Thread.new {
+ Thread.current['DRb'] = info
+ $SAFE = @safe_level
+ perform_without_block
+ }.value
+ end
else
- @result = perform_without_block
+ if @block
+ @result = perform_with_block
+ else
+ @result = perform_without_block
+ end
end
@succ = true
- case @result
- when Array
- if @msg_id == :to_ary
- @result = DRbArray.new(@result)
- end
+ if @msg_id == :to_ary && @result.class == Array
+ @result = DRbArray.new(@result)
end
return @succ, @result
- rescue NoMemoryError, SystemExit, SystemStackError, SecurityError
- raise
- rescue Exception
+ rescue StandardError, ScriptError, Interrupt
@result = $!
return @succ, @result
end
@@ -1693,22 +1627,11 @@ module DRb
end
- require_relative 'invokemethod'
+ require 'drb/invokemethod'
class InvokeMethod
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
@@ -1732,17 +1655,17 @@ module DRb
succ = false
invoke_method = InvokeMethod.new(self, client)
succ, result = invoke_method.perform
- error_print(result) if !succ && verbose
- unless DRbConnError === result && result.message == 'connection closed'
- client.send_reply(succ, result)
+ if !succ && verbose
+ p result
+ result.backtrace.each do |x|
+ puts x
+ end
end
- rescue Exception => e
- error_print(e) if verbose
+ 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
@@ -1893,7 +1816,7 @@ module DRb
end
module_function :install_acl
- @mutex = Thread::Mutex.new
+ @mutex = Mutex.new
def mutex # :nodoc:
@mutex
end
@@ -1923,11 +1846,6 @@ module DRb
# Removes +server+ from the list of registered servers.
def remove_server(server)
@server.delete(server.uri)
- mutex.synchronize do
- if @primary_server == server
- @primary_server = nil
- end
- end
end
module_function :remove_server
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 a93d5d1576..327b553a25 100644
--- a/lib/drb/extserv.rb
+++ b/lib/drb/extserv.rb
@@ -1,10 +1,9 @@
-# frozen_string_literal: false
=begin
external service
Copyright (c) 2000,2002 Masatoshi SEKI
=end
-require_relative 'drb'
+require 'drb/drb'
require 'monitor'
module DRb
diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb
index 040e4e3e08..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_relative 'drb'
+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
@@ -61,7 +61,8 @@ module DRb
private
def invoke_thread
Thread.new do
- while name = @queue.pop
+ while true
+ name = @queue.pop
invoke_service_command(name, @@command[name])
end
end
diff --git a/lib/drb/gw.rb b/lib/drb/gw.rb
index 65a525476e..b3568ab08d 100644
--- a/lib/drb/gw.rb
+++ b/lib/drb/gw.rb
@@ -1,5 +1,4 @@
-# frozen_string_literal: false
-require_relative 'drb'
+require 'drb/drb'
require 'monitor'
module DRb
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 3d528c6172..efd8271a78 100644
--- a/lib/drb/ssl.rb
+++ b/lib/drb/ssl.rb
@@ -1,7 +1,6 @@
-# frozen_string_literal: false
require 'socket'
require 'openssl'
-require_relative 'drb'
+require 'drb/drb'
require 'singleton'
module DRb
@@ -162,7 +161,7 @@ module DRb
return
end
- rsa = OpenSSL::PKey::RSA.new(2048){|p, n|
+ rsa = OpenSSL::PKey::RSA.new(1024){|p, n|
next unless self[:verbose]
case p
when 0; $stderr.putc "." # BN_generate_prime
@@ -196,7 +195,7 @@ module DRb
if comment = self[:SSLCertComment]
cert.add_extension(ef.create_extension("nsComment", comment))
end
- cert.sign(rsa, OpenSSL::Digest::SHA256.new)
+ cert.sign(rsa, OpenSSL::Digest::SHA1.new)
@cert = cert
@pkey = rsa
@@ -226,13 +225,13 @@ module DRb
#
# Raises DRbBadScheme or DRbBadURI if +uri+ is not matching or malformed
def self.parse_uri(uri) # :nodoc:
- if /\Adrbssl:\/\/(.*?):(\d+)(\?(.*))?\z/ =~ uri
+ if uri =~ /^drbssl:\/\/(.*?):(\d+)(\?(.*))?$/
host = $1
port = $2.to_i
option = $4
[host, port, option]
else
- raise(DRbBadScheme, uri) unless uri.start_with?('drbssl:')
+ raise(DRbBadScheme, uri) unless uri =~ /^drbssl:/
raise(DRbBadURI, 'can\'t parse uri:' + uri)
end
end
@@ -248,6 +247,8 @@ module DRb
# configuration. Either a Hash or DRb::DRbSSLSocket::SSLConfig
def self.open(uri, config)
host, port, = parse_uri(uri)
+ host.untaint
+ port.untaint
soc = TCPSocket.open(host, port)
ssl_conf = SSLConfig::new(config)
ssl_conf.setup_ssl_context
@@ -334,7 +335,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 3ead98a7f2..423b4563fa 100644
--- a/lib/drb/timeridconv.rb
+++ b/lib/drb/timeridconv.rb
@@ -1,5 +1,4 @@
-# frozen_string_literal: false
-require_relative 'drb'
+require 'drb/drb'
require 'monitor'
module DRb
@@ -24,7 +23,7 @@ module DRb
@gc = {}
@renew = {}
@keeping = keeping
- @expires = nil
+ @expires = Time.now + @keeping
end
def add(obj)
@@ -32,16 +31,18 @@ module DRb
rotate
key = obj.__id__
@renew[key] = obj
- invoke_keeper
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
@@ -49,28 +50,25 @@ module DRb
private
def peek(key)
- return @renew.fetch(key) { @gc.fetch(key, @sentinel) }
- end
-
- def invoke_keeper
- return if @expires
- @expires = Time.now + @keeping
- on_gc
- 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}
+ synchronize do
+ return @renew.fetch(key) { @gc.fetch(key, @sentinel) }
+ end
end
def rotate
synchronize do
- if @expires &.< Time.now
- @gc = @renew # GCed
- @renew = {}
- @expires = @gc.empty? ? nil : Time.now + @keeping
+ return if @expires > Time.now
+ @gc = @renew # GCed
+ @renew = {}
+ @expires = Time.now + @keeping
+ end
+ end
+
+ def keeper
+ Thread.new do
+ loop do
+ rotate
+ sleep(@keeping)
end
end
end
diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
index 1629ad3bcd..3fb8d0ecce 100644
--- a/lib/drb/unix.rb
+++ b/lib/drb/unix.rb
@@ -1,6 +1,5 @@
-# frozen_string_literal: false
require 'socket'
-require_relative 'drb'
+require 'drb/drb'
require 'tmpdir'
raise(LoadError, "UNIXServer is required") unless defined?(UNIXServer)
@@ -15,18 +14,19 @@ module DRb
class DRbUNIXSocket < DRbTCPSocket
# :stopdoc:
def self.parse_uri(uri)
- if /\Adrbunix:(.*?)(\?(.*))?\z/ =~ uri
+ if /^drbunix:(.*?)(\?(.*))?$/ =~ uri
filename = $1
option = $3
[filename, option]
else
- raise(DRbBadScheme, uri) unless uri.start_with?('drbunix:')
+ raise(DRbBadScheme, uri) unless uri =~ /^drbunix:/
raise(DRbBadURI, 'can\'t parse uri:' + uri)
end
end
def self.open(uri, config)
filename, = parse_uri(uri)
+ filename.untaint
soc = UNIXSocket.open(filename)
self.new(uri, soc, config)
end
@@ -94,7 +94,6 @@ module DRb
public
def close
return unless @socket
- shutdown # DRbProtocol#shutdown
path = @socket.path if @server_mode
@socket.close
File.unlink(path) if @server_mode
@@ -109,7 +108,7 @@ module DRb
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/drb/weakidconv.rb b/lib/drb/weakidconv.rb
deleted file mode 100644
index ecf0bf515f..0000000000
--- a/lib/drb/weakidconv.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: false
-require_relative 'drb'
-require 'monitor'
-
-module DRb
-
- # To use WeakIdConv:
- #
- # DRb.start_service(nil, nil, {:idconv => DRb::WeakIdConv.new})
-
- class WeakIdConv < DRbIdConv
- class WeakSet
- include MonitorMixin
- def initialize
- super()
- @immutable = {}
- @map = ObjectSpace::WeakMap.new
- end
-
- def add(obj)
- synchronize do
- begin
- @map[obj] = self
- rescue ArgumentError
- @immutable[obj.__id__] = obj
- end
- return obj.__id__
- end
- end
-
- def fetch(ref)
- synchronize do
- @immutable.fetch(ref) {
- @map.each { |key, _|
- return key if key.__id__ == ref
- }
- raise RangeError.new("invalid reference")
- }
- end
- end
- end
-
- def initialize()
- super()
- @weak_set = WeakSet.new
- end
-
- def to_obj(ref) # :nodoc:
- return super if ref.nil?
- @weak_set.fetch(ref)
- end
-
- def to_id(obj) # :nodoc:
- return @weak_set.add(obj)
- end
- end
-end
-
-# DRb.install_id_conv(WeakIdConv.new)
diff --git a/lib/e2mmap.rb b/lib/e2mmap.rb
new file mode 100644
index 0000000000..1eb5b51678
--- /dev/null
+++ b/lib/e2mmap.rb
@@ -0,0 +1,172 @@
+#
+#--
+# e2mmap.rb - for Ruby 1.1
+# $Release Version: 2.0$
+# $Revision: 1.10 $
+# by Keiju ISHITSUKA
+#
+#++
+#
+# Helper module for easily defining exceptions with predefined messages.
+#
+# == Usage
+#
+# 1.
+# class Foo
+# extend Exception2MessageMapper
+# def_e2message ExistingExceptionClass, "message..."
+# def_exception :NewExceptionClass, "message..."[, superclass]
+# ...
+# end
+#
+# 2.
+# module Error
+# extend Exception2MessageMapper
+# def_e2message ExistingExceptionClass, "message..."
+# def_exception :NewExceptionClass, "message..."[, superclass]
+# ...
+# end
+# class Foo
+# include Error
+# ...
+# end
+#
+# foo = Foo.new
+# foo.Fail ....
+#
+# 3.
+# module Error
+# extend Exception2MessageMapper
+# def_e2message ExistingExceptionClass, "message..."
+# def_exception :NewExceptionClass, "message..."[, superclass]
+# ...
+# end
+# class Foo
+# extend Exception2MessageMapper
+# include Error
+# ...
+# end
+#
+# Foo.Fail NewExceptionClass, arg...
+# Foo.Fail ExistingExceptionClass, arg...
+#
+#
+module Exception2MessageMapper
+
+ E2MM = Exception2MessageMapper # :nodoc:
+
+ def E2MM.extend_object(cl)
+ super
+ cl.bind(self) unless cl < E2MM
+ end
+
+ def bind(cl)
+ self.module_eval %[
+ def Raise(err = nil, *rest)
+ Exception2MessageMapper.Raise(self.class, err, *rest)
+ end
+ alias Fail Raise
+
+ def self.included(mod)
+ mod.extend Exception2MessageMapper
+ end
+ ]
+ end
+
+ # Fail(err, *rest)
+ # err: exception
+ # rest: message arguments
+ #
+ def Raise(err = nil, *rest)
+ E2MM.Raise(self, err, *rest)
+ end
+ alias Fail Raise
+ alias fail Raise
+
+ # def_e2message(c, m)
+ # c: exception
+ # m: message_form
+ # define exception c with message m.
+ #
+ def def_e2message(c, m)
+ E2MM.def_e2message(self, c, m)
+ end
+
+ # def_exception(n, m, s)
+ # n: exception_name
+ # m: message_form
+ # s: superclass(default: StandardError)
+ # define exception named ``c'' with message m.
+ #
+ def def_exception(n, m, s = StandardError)
+ E2MM.def_exception(self, n, m, s)
+ end
+
+ #
+ # Private definitions.
+ #
+ # {[class, exp] => message, ...}
+ @MessageMap = {}
+
+ # E2MM.def_e2message(k, e, m)
+ # k: class to define exception under.
+ # e: exception
+ # m: message_form
+ # define exception c with message m.
+ #
+ def E2MM.def_e2message(k, c, m)
+ E2MM.instance_eval{@MessageMap[[k, c]] = m}
+ c
+ end
+
+ # E2MM.def_exception(k, n, m, s)
+ # k: class to define exception under.
+ # n: exception_name
+ # m: message_form
+ # s: superclass(default: StandardError)
+ # 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.const_set(n, e)
+ end
+
+ # Fail(klass, err, *rest)
+ # klass: class to define exception under.
+ # err: exception
+ # rest: message arguments
+ #
+ def E2MM.Raise(klass = E2MM, err = nil, *rest)
+ if form = e2mm_message(klass, err)
+ b = $@.nil? ? caller(1) : $@
+ b.shift if b[0] =~ /^#{Regexp.quote(__FILE__)}:/
+ raise err, sprintf(form, *rest), b
+ else
+ E2MM.Fail E2MM, ErrNotRegisteredException, err.inspect
+ end
+ end
+ class << E2MM
+ alias Fail Raise
+ end
+
+ def E2MM.e2mm_message(klass, exp)
+ for c in klass.ancestors
+ if mes = @MessageMap[[c,exp]]
+ m = klass.instance_eval('"' + mes + '"')
+ return m
+ end
+ end
+ nil
+ end
+ class << self
+ alias message e2mm_message
+ end
+
+ E2MM.def_exception(E2MM,
+ :ErrNotRegisteredException,
+ "not registered exception(%s)")
+end
+
+
diff --git a/lib/erb.rb b/lib/erb.rb
index d2ea64ab60..25654d62c5 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
@@ -57,6 +56,7 @@ require "cgi/util"
#
# There are several settings you can change when you use ERB:
# * the nature of the tags that are recognized;
+# * the value of <tt>$SAFE</tt> under which the template is run;
# * the binding used to resolve local variables in the template.
#
# See the ERB.new and ERB#result methods for more detail.
@@ -114,7 +114,7 @@ require "cgi/util"
# James Edward Gray II
# }.gsub(/^ /, '')
#
-# message = ERB.new(template, trim_mode: "%<>")
+# message = ERB.new(template, 0, "%<>")
#
# # Set up template data.
# to = "Community Spokesman <spokesman@ruby_community.org>"
@@ -247,20 +247,22 @@ require "cgi/util"
#
# == Notes
#
-# There are a variety of templating solutions available in various Ruby projects.
-# For example, RDoc, distributed with Ruby, uses its own template engine, which
-# can be reused elsewhere.
+# There are a variety of templating solutions available in various Ruby projects:
+# * ERB's big brother, eRuby, works the same but is written in C for speed;
+# * Amrita (smart at producing HTML/XML);
+# * cs/Template (written in C for speed);
+# * RDoc, distributed with Ruby, uses its own template engine, which can be reused elsewhere;
+# * and others; search {RubyGems.org}[https://rubygems.org/] or
+# {The Ruby Toolbox}[https://www.ruby-toolbox.com/].
#
-# Other popular engines could be found in the corresponding
-# {Category}[https://www.ruby-toolbox.com/categories/template_engines] of
-# The Ruby Toolbox.
+# Rails, the web application framework, uses ERB to create views.
#
class ERB
Revision = '$Date:: $' # :nodoc: #'
# Returns revision information for the erb.rb module.
def self.version
- "erb.rb [2.2.0 #{ERB::Revision.split[1]}]"
+ "erb.rb [2.1.0 #{ERB::Revision.split[1]}]"
end
end
@@ -277,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")
@@ -288,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:
#
@@ -299,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
#
@@ -344,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)
@@ -364,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
@@ -384,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
@@ -424,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)
@@ -433,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
@@ -448,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)
@@ -469,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 == '-%>'
@@ -494,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)
@@ -510,12 +516,12 @@ class ERB
end
end
end
- Scanner.register_scanner(SimpleScanner, nil, false)
+ 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)
@@ -526,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
@@ -569,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)
@@ -583,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:
@@ -662,13 +665,9 @@ class ERB
return [false, '>']
when 2
return [false, '<>']
- when 0, nil
+ when 0
return [false, nil]
when String
- unless mode.match?(/\A(%|-|>|<>){1,2}\z/)
- warn_invalid_trim_mode(mode, uplevel: 5)
- end
-
perc = mode.include?('%')
if mode.include?('-')
return [perc, '-']
@@ -680,7 +679,6 @@ class ERB
[perc, nil]
end
else
- warn_invalid_trim_mode(mode, uplevel: 5)
return [false, nil]
end
end
@@ -713,28 +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
-
- def warn_invalid_trim_mode(mode, uplevel:)
- warn "Invalid ERB trim mode: #{mode.inspect} (trim_mode: nil, 0, 1, 2, or String composed of '%' and/or '-', '>', '<>')", uplevel: uplevel + 1
end
end
end
@@ -746,7 +731,9 @@ class ERB
# Constructs a new ERB object with the template specified in _str_.
#
# An ERB object works by building a chunk of Ruby code that will output
- # the completed template when run.
+ # the completed template when run. If _safe_level_ is set to a non-nil value,
+ # ERB code will be run in a separate thread with <b>$SAFE</b> set to the
+ # provided level.
#
# If _trim_mode_ is passed a String containing one or more of the following
# modifiers, ERB will adjust its code generation as listed:
@@ -781,11 +768,11 @@ class ERB
# def build
# b = binding
# # create and run templates, filling member data variables
- # ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), trim_mode: "", eoutvar: "@product").result b
+ # ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), 0, "", "@product").result b
# <%= PRODUCT[:name] %>
# <%= PRODUCT[:desc] %>
# END_PRODUCT
- # ERB.new(<<-'END_PRICE'.gsub(/^\s+/, ""), trim_mode: "", eoutvar: "@price").result b
+ # ERB.new(<<-'END_PRICE'.gsub(/^\s+/, ""), 0, "", "@price").result b
# <%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %>
# <%= PRODUCT[:desc] %>
# END_PRICE
@@ -806,31 +793,14 @@ class ERB
# Chicken Fried Steak -- 9.95
# A well messages pattie, breaded and fried.
#
- def initialize(str, safe_level=NOT_GIVEN, legacy_trim_mode=NOT_GIVEN, legacy_eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: '_erbout')
- # Complex initializer for $SAFE deprecation at [Feature #14256]. Use keyword arguments to pass trim_mode or eoutvar.
- if safe_level != NOT_GIVEN
- warn 'Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.', uplevel: 1 if $VERBOSE || !ZERO_SAFE_LEVELS.include?(safe_level)
- end
- if legacy_trim_mode != NOT_GIVEN
- warn 'Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.', uplevel: 1 if $VERBOSE
- trim_mode = legacy_trim_mode
- end
- if legacy_eoutvar != NOT_GIVEN
- warn 'Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.', uplevel: 1 if $VERBOSE
- eoutvar = legacy_eoutvar
- end
-
+ def initialize(str, safe_level=nil, trim_mode=nil, eoutvar='_erbout')
+ @safe_level = safe_level
compiler = make_compiler(trim_mode)
set_eoutvar(compiler, eoutvar)
- @src, @encoding, @frozen_string = *compiler.compile(str)
+ @src, @encoding = *compiler.compile(str)
@filename = nil
@lineno = 0
- @_init = self.class.singleton_class
end
- NOT_GIVEN = Object.new
- private_constant :NOT_GIVEN
- ZERO_SAFE_LEVELS = [0, nil]
- private_constant :ZERO_SAFE_LEVELS
##
# Creates a new compiler for ERB. See ERB::Compiler.new for details
@@ -853,21 +823,6 @@ class ERB
# is run
attr_accessor :lineno
- #
- # Sets optional filename and line number that will be used in ERB code
- # evaluation and error reporting. See also #filename= and #lineno=
- #
- # erb = ERB.new('<%= some_x %>')
- # erb.render
- # # undefined local variable or method `some_x'
- # # from (erb):1
- #
- # erb.location = ['file.erb', 3]
- # # All subsequent error reporting would use new location
- # erb.render
- # # undefined local variable or method `some_x'
- # # from file.erb:4
- #
def location=((filename, lineno))
@filename = filename
@lineno = lineno if lineno
@@ -879,10 +834,10 @@ class ERB
# 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)
@@ -899,35 +854,22 @@ class ERB
# code evaluation.
#
def result(b=new_toplevel)
- unless @_init.equal?(self.class.singleton_class)
- raise ArgumentError, "not initialized"
- end
- eval(@src, b, (@filename || '(erb)'), @lineno)
- 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)
+ if @safe_level
+ proc {
+ $SAFE = @safe_level
+ eval(@src, b, (@filename || '(erb)'), @lineno)
+ }.call
+ else
+ eval(@src, b, (@filename || '(erb)'), @lineno)
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
@@ -939,9 +881,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:#{@encoding}\n"
mod.module_eval do
- eval(src, binding, fname, -1)
+ eval(magic_comment + "def #{methodname}\n" + src + "\nend\n", binding, fname, -2)
end
end
@@ -1019,8 +962,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 cd35c09dbc..0000000000
--- a/lib/fileutils.gemspec
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-source_version = ["", "lib/"].find do |dir|
- begin
- break File.open(File.join(__dir__, "#{dir}fileutils.rb")) {|f|
- f.gets("\n VERSION = ")
- f.gets[/\s*"(.+)"/, 1]
- }
- rescue Errno::ENOENT
- end
-end
-
-Gem::Specification.new do |s|
- s.name = "fileutils"
- s.version = source_version
- 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 = ["LICENSE.txt", "README.md", "Rakefile", "fileutils.gemspec", "lib/fileutils.rb"]
- s.required_ruby_version = ">= 2.3.0"
-
- s.authors = ["Minero Aoki"]
- s.email = [nil]
- s.homepage = "https://github.com/ruby/fileutils"
- s.license = "BSD-2-Clause"
-
- s.metadata = {
- "source_code_uri" => "https://github.com/ruby/fileutils"
- }
-end
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index a7ad65ae5e..932776c847 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -1,11 +1,3 @@
-# frozen_string_literal: true
-
-begin
- require 'rbconfig'
-rescue LoadError
- # for make mjit-headers
-end
-
#
# = fileutils.rb
#
@@ -22,58 +14,48 @@ end
#
# require 'fileutils'
#
-# FileUtils.cd(dir, **options)
-# FileUtils.cd(dir, **options) {|dir| block }
+# FileUtils.cd(dir, options)
+# FileUtils.cd(dir, options) {|dir| .... }
# FileUtils.pwd()
-# FileUtils.mkdir(dir, **options)
-# FileUtils.mkdir(list, **options)
-# FileUtils.mkdir_p(dir, **options)
-# FileUtils.mkdir_p(list, **options)
-# FileUtils.rmdir(dir, **options)
-# FileUtils.rmdir(list, **options)
-# FileUtils.ln(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.cp(src, dest, **options)
-# FileUtils.cp(list, dir, **options)
-# FileUtils.cp_r(src, dest, **options)
-# FileUtils.cp_r(list, dir, **options)
-# FileUtils.mv(src, dest, **options)
-# FileUtils.mv(list, dir, **options)
-# FileUtils.rm(list, **options)
-# FileUtils.rm_r(list, **options)
-# FileUtils.rm_rf(list, **options)
-# FileUtils.install(src, dest, **options)
-# FileUtils.chmod(mode, list, **options)
-# FileUtils.chmod_R(mode, list, **options)
-# FileUtils.chown(user, group, list, **options)
-# FileUtils.chown_R(user, group, list, **options)
-# FileUtils.touch(list, **options)
+# FileUtils.mkdir(dir, options)
+# FileUtils.mkdir(list, options)
+# FileUtils.mkdir_p(dir, options)
+# FileUtils.mkdir_p(list, options)
+# FileUtils.rmdir(dir, options)
+# FileUtils.rmdir(list, options)
+# FileUtils.ln(old, new, options)
+# FileUtils.ln(list, destdir, options)
+# FileUtils.ln_s(old, new, options)
+# FileUtils.ln_s(list, destdir, options)
+# FileUtils.ln_sf(src, dest, options)
+# FileUtils.cp(src, dest, options)
+# FileUtils.cp(list, dir, options)
+# FileUtils.cp_r(src, dest, options)
+# FileUtils.cp_r(list, dir, options)
+# FileUtils.mv(src, dest, options)
+# FileUtils.mv(list, dir, options)
+# FileUtils.rm(list, options)
+# FileUtils.rm_r(list, options)
+# FileUtils.rm_rf(list, options)
+# FileUtils.install(src, dest, mode = <src's>, options)
+# FileUtils.chmod(mode, list, options)
+# FileUtils.chmod_R(mode, list, options)
+# FileUtils.chown(user, group, list, options)
+# FileUtils.chown_R(user, group, list, options)
+# FileUtils.touch(list, options)
#
-# Possible <tt>options</tt> are:
-#
-# <tt>:force</tt> :: forced operation (rewrite files if exist, remove
-# directories if not empty, etc.);
-# <tt>:verbose</tt> :: print command to be run, in bash syntax, before
-# performing it;
-# <tt>:preserve</tt> :: preserve object's group, user and modification
-# time on copying;
-# <tt>:noop</tt> :: no changes are made (usable in combination with
-# <tt>:verbose</tt> which will print the command to run)
-#
-# Each method documents the options that it honours. See also ::commands,
-# ::options and ::options_of methods to introspect which command have which
-# options.
+# The <tt>options</tt> parameter is a hash of options, taken from the list
+# <tt>:force</tt>, <tt>:noop</tt>, <tt>:preserve</tt>, and <tt>:verbose</tt>.
+# <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
# either one file or a list of files in that argument. See the method
# documentation for examples.
#
-# There are some `low level' methods, which do not accept keyword arguments:
+# There are some `low level' methods, which do not accept any option:
#
-# FileUtils.copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
+# FileUtils.copy_entry(src, dest, preserve = false, dereference = false)
# FileUtils.copy_file(src, dest, preserve = false, dereference = true)
# FileUtils.copy_stream(srcstream, deststream)
# FileUtils.remove_entry(path, force = false)
@@ -101,14 +83,19 @@ end
# files/directories. This equates to passing the <tt>:noop</tt> and
# <tt>:verbose</tt> flags to methods in FileUtils.
#
+
module FileUtils
- VERSION = "1.4.1"
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.
#
@@ -121,30 +108,35 @@ module FileUtils
module_function :getwd
#
- # Changes the current directory to the directory +dir+.
+ # Options: verbose
#
- # If this method is called with block, resumes to the previous
- # working directory after the block execution has finished.
+ # Changes the current directory to the directory +dir+.
#
- # FileUtils.cd('/') # change directory
+ # If this method is called with block, resumes to the old
+ # working directory after the block execution finished.
#
- # FileUtils.cd('/', verbose: true) # change directory and report it
+ # FileUtils.cd('/', :verbose => true) # chdir and report it
#
- # FileUtils.cd('/') do # change directory
- # # ... # do something
+ # FileUtils.cd('/') do # chdir
+ # [...] # do something
# end # return to original directory
#
- def cd(dir, verbose: nil, &block) # :yield: dir
- fu_output_message "cd #{dir}" if verbose
- result = Dir.chdir(dir, &block)
- fu_output_message 'cd -' if verbose and block
- result
+ def cd(dir, options = {}, &block) # :yield: dir
+ fu_check_options options, OPT_TABLE['cd']
+ fu_output_message "cd #{dir}" if options[:verbose]
+ Dir.chdir(dir, &block)
+ fu_output_message 'cd -' if options[:verbose] and block
end
module_function :cd
alias chdir cd
module_function :chdir
+ OPT_TABLE['cd'] =
+ OPT_TABLE['chdir'] = [:verbose]
+
+ #
+ # Options: (none)
#
# Returns true if +new+ is newer than all +old_list+.
# Non-existent files are older than any file.
@@ -164,54 +156,61 @@ 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'
- # FileUtils.mkdir %w(tmp data)
- # FileUtils.mkdir 'notexist', noop: true # Does not really create.
- # FileUtils.mkdir 'tmp', mode: 0700
+ # FileUtils.mkdir %w( tmp data )
+ # 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,
#
# FileUtils.mkdir_p '/usr/local/lib/ruby'
#
- # causes to make following directories, if they do not exist.
- #
- # * /usr
- # * /usr/local
- # * /usr/local/lib
- # * /usr/local/lib/ruby
+ # causes to make following directories, if it does not exist.
+ # * /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)
@@ -222,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
@@ -241,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
@@ -253,58 +255,66 @@ module FileUtils
private_module_function :fu_mkdir
#
+ # Options: parents, noop, verbose
+ #
# Removes one or more directories.
#
# FileUtils.rmdir 'somedir'
# FileUtils.rmdir %w(somedir anydir otherdir)
# # Does not really remove directory; outputs message.
- # FileUtils.rmdir 'somedir', verbose: true, noop: true
+ # 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
@@ -313,64 +323,37 @@ module FileUtils
alias link ln
module_function :link
+ OPT_TABLE['ln'] =
+ OPT_TABLE['link'] = [:force, :noop, :verbose]
+
#
- # Hard link +src+ to +dest+. If +src+ is a directory, this method links
- # all its contents recursively. If +dest+ is a directory, links
- # +src+ to +dest/src+.
- #
- # +src+ can be a list of files.
- #
- # If +dereference_root+ is true, this method dereference tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
- # FileUtils.rm_r site_ruby + '/mylib', force: true
- # FileUtils.cp_lr 'lib/', site_ruby + '/mylib'
- #
- # # Examples of linking several files to target directory.
- # FileUtils.cp_lr %w(mail.rb field.rb debug/), site_ruby + '/tmail'
- # FileUtils.cp_lr Dir.glob('*.rb'), '/home/aamine/lib/ruby', noop: true, verbose: true
+ # Options: force noop verbose
#
- # # If you want to link all contents of a directory instead of the
- # # directory itself, c.f. src/x -> dest/x, src/y -> dest/y,
- # # use the following code.
- # FileUtils.cp_lr 'src/.', 'dest' # cp_lr('src', 'dest') makes dest/src, but this doesn't.
+ # <b><tt>ln_s(old, new, options = {})</tt></b>
#
- def cp_lr(src, dest, noop: nil, verbose: nil,
- dereference_root: true, remove_destination: false)
- fu_output_message "cp -lr#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if verbose
- return if noop
- fu_each_src_dest(src, dest) do |s, d|
- link_entry s, d, dereference_root, remove_destination
- end
- end
- module_function :cp_lr
-
+ # 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+.
#
- # :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)
+ # FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby'
+ # FileUtils.ln_s 'verylongsourcefilename.c', 'c', :force => true
#
- # In the first form, creates a symbolic link +link+ which points to +target+.
- # If +link+ already exists, raises Errno::EEXIST.
- # But if the <tt>force</tt> option is set, overwrites +link+.
+ # <b><tt>ln_s(list, destdir, options = {})</tt></b>
#
- # FileUtils.ln_s '/usr/bin/ruby', '/usr/local/bin/ruby'
- # FileUtils.ln_s 'verylongsourcefilename.c', 'c', force: true
+ # 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.
#
- # 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.
+ # If +destdir+ is not a directory, raises Errno::ENOTDIR.
#
- # FileUtils.ln_s Dir.glob('/bin/*.rb'), '/home/foo/bin'
+ # FileUtils.ln_s Dir.glob('bin/*.rb'), '/home/aamine/bin'
#
- 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
+ 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
@@ -379,40 +362,28 @@ 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
- #
- # Hard links a file system entry +src+ to +dest+.
- # If +src+ is a directory, this method links its contents recursively.
- #
- # Both of +src+ and +dest+ must be a path name.
- # +src+ must exist, +dest+ must not exist.
- #
- # If +dereference_root+ is true, this method dereferences the tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
- def link_entry(src, dest, dereference_root = false, remove_destination = false)
- Entry_.new(src, nil, dereference_root).traverse do |ent|
- destent = Entry_.new(dest, ent.rel, false)
- File.unlink destent.path if remove_destination && File.file?(destent.path)
- ent.link destent.path
- end
- end
- module_function :link_entry
+ 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+.
#
@@ -420,14 +391,15 @@ module FileUtils
#
# FileUtils.cp 'eval.c', 'eval.c.org'
# FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6'
- # FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6', verbose: true
+ # 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
@@ -435,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
@@ -442,17 +419,13 @@ module FileUtils
#
# +src+ can be a list of files.
#
- # If +dereference_root+ is true, this method dereference tree root.
- #
- # If +remove_destination+ is true, this method removes each destination file before copy.
- #
# # Installing Ruby library "mylib" under the site_ruby
- # FileUtils.rm_r site_ruby + '/mylib', force: true
+ # FileUtils.rm_r site_ruby + '/mylib', :force
# FileUtils.cp_r 'lib/', site_ruby + '/mylib'
#
# # 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,
@@ -460,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.
@@ -487,13 +465,9 @@ module FileUtils
# If +remove_destination+ is true, this method removes each destination file before copy.
#
def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
- if dereference_root
- src = File.realpath(src)
- end
-
- Entry_.new(src, nil, false).wrap_traverse(proc do |ent|
+ 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)
@@ -524,39 +498,43 @@ 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 'stuff.rb', '/notexist/lib/ruby', :force => true # no error
#
- # FileUtils.mv %w(junk.txt dust.txt), '/home/foo/.trash/'
- # FileUtils.mv Dir.glob('test*.rb'), 'test', noop: true, verbose: true
+ # 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
+ else
+ destent.remove_file if rename_cannot_overwrite_file?
end
end
begin
File.rename s, d
- rescue Errno::EXDEV,
- Errno::EPERM # move from unencrypted to encrypted dir (ext4)
+ 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
@@ -565,21 +543,32 @@ module FileUtils
alias move mv
module_function :move
+ OPT_TABLE['mv'] =
+ OPT_TABLE['move'] = [:force, :noop, :verbose, :secure]
+
+ def rename_cannot_overwrite_file? #:nodoc:
+ /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.
#
# FileUtils.rm %w( junk.txt dust.txt )
# FileUtils.rm Dir.glob('*.so')
- # FileUtils.rm 'NotExistFile', force: true # never raises exception
+ # 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
@@ -587,78 +576,103 @@ 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
# writable (including /tmp, whose permission is 1777), and the current
# process has strong privilege such as Unix super user (root), and the
# system has symbolic link. For secure removing, read the documentation
- # of remove_entry_secure carefully, and set :secure option to true.
- # Default is <tt>secure: false</tt>.
+ # of #remove_entry_secure carefully, and set :secure option to true.
+ # Default is :secure=>false.
#
- # NOTE: This method calls remove_entry_secure if :secure option is set.
- # See also remove_entry_secure.
+ # 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.
+ # 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,
# remove it recursively. This method is required to avoid TOCTTOU
- # (time-of-check-to-time-of-use) local security vulnerability of rm_r.
+ # (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
@@ -676,8 +690,8 @@ module FileUtils
#
# For details of this security vulnerability, see Perl's case:
#
- # * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448
- # * https://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].
#
@@ -701,38 +715,22 @@ module FileUtils
unless parent_st.sticky?
raise ArgumentError, "parent directory is world writable, FileUtils#remove_entry_secure does not work; abort: #{path.inspect} (parent directory mode #{'%o' % parent_st.mode})"
end
-
# freeze tree root
euid = Process.euid
- dot_file = fullpath + "/."
- begin
- File.open(dot_file) {|f|
- unless fu_stat_identical_entry?(st, f.stat)
- # symlink (TOC-to-TOU attack?)
- File.unlink fullpath
- return
- end
- f.chown euid, -1
- f.chmod 0700
- }
- rescue Errno::EISDIR # JRuby in non-native mode can't open files as dirs
- File.lstat(dot_file).tap {|fstat|
- unless fu_stat_identical_entry?(st, fstat)
- # symlink (TOC-to-TOU attack?)
- File.unlink fullpath
- return
- end
- File.chown euid, -1, dot_file
- File.chmod 0700, dot_file
- }
- end
-
- unless fu_stat_identical_entry?(st, File.lstat(fullpath))
- # TOC-to-TOU attack?
- File.unlink fullpath
- return
- end
-
+ File.open(fullpath + '/.') {|f|
+ unless fu_stat_identical_entry?(st, f.stat)
+ # symlink (TOC-to-TOU attack?)
+ File.unlink fullpath
+ return
+ end
+ f.chown euid, -1
+ f.chmod 0700
+ unless fu_stat_identical_entry?(st, File.lstat(fullpath))
+ # TOC-to-TOU attack?
+ File.unlink fullpath
+ return
+ end
+ }
# ---- tree root is frozen ----
root = Entry_.new(path)
root.preorder_traverse do |ent|
@@ -772,7 +770,7 @@ module FileUtils
# +path+ might be a regular file, a directory, or something.
# If +path+ is a directory, remove it recursively.
#
- # See also remove_entry_secure.
+ # See also #remove_entry_secure.
#
def remove_entry(path, force = false)
Entry_.new(path).postorder_traverse do |ent|
@@ -808,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)
@@ -833,15 +831,8 @@ module FileUtils
#
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
-
- if RUBY_VERSION > "2.4"
- sa = String.new(capacity: bsize)
- sb = String.new(capacity: bsize)
- else
- sa = String.new
- sb = String.new
- end
-
+ sa = ""
+ sb = ""
begin
a.read(bsize, sa)
b.read(bsize, sb)
@@ -852,40 +843,33 @@ 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.
#
- # 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)
+ # 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, 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
@@ -904,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)
@@ -917,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?
@@ -979,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+.
#
@@ -987,12 +968,12 @@ module FileUtils
# Absolute mode is
# FileUtils.chmod 0755, 'somecommand'
# FileUtils.chmod 0644, %w(my.rb your.rb his.rb her.rb)
- # FileUtils.chmod 0755, '/usr/bin/ruby', verbose: true
+ # FileUtils.chmod 0755, '/usr/bin/ruby', :verbose => true
#
# Symbolic mode is
# FileUtils.chmod "u=wrx,go=rx", 'somecommand'
# FileUtils.chmod "u=wr,go=rr", %w(my.rb your.rb his.rb her.rb)
- # FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', verbose: true
+ # FileUtils.chmod "u=wrx,go=rx", '/usr/bin/ruby', :verbose => true
#
# "a" :: is user, group, other mask.
# "u" :: is user's mask.
@@ -1009,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+.
@@ -1026,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+
@@ -1052,14 +1043,15 @@ module FileUtils
# the attribute.
#
# FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
- # FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
+ # 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|
@@ -1068,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.
@@ -1076,15 +1072,16 @@ module FileUtils
# method does not change the attribute.
#
# FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
- # FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', verbose: true
+ # 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|
@@ -1092,13 +1089,20 @@ 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
+ end
+
def fu_get_uid(user) #:nodoc:
return nil unless user
case user
@@ -1107,7 +1111,6 @@ module FileUtils
when /\A\d+\z/
user.to_i
else
- require 'etc'
Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil
end
end
@@ -1121,26 +1124,29 @@ module FileUtils
when /\A\d+\z/
group.to_i
else
- require 'etc'
Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil
end
end
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
@@ -1157,16 +1163,15 @@ module FileUtils
end
module_function :touch
+ OPT_TABLE['touch'] = [:noop, :verbose, :mtime, :nocreate]
+
private
module StreamUtils_
private
- case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
- when /mswin|mingw/
- def fu_windows?; true end
- else
- def fu_windows?; false end
+ def fu_windows?
+ /mswin|mingw|bccwin|emx/ =~ RUBY_PLATFORM
end
def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
@@ -1291,16 +1296,9 @@ module FileUtils
def entries
opts = {}
opts[:encoding] = ::Encoding::UTF_8 if fu_windows?
-
- files = if Dir.respond_to?(:children)
- Dir.children(path, **opts)
- else
- Dir.entries(path(), **opts)
- .reject {|n| n == '.' or n == '..' }
- end
-
- untaint = RUBY_VERSION < '2.7'
- files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
+ Dir.entries(path(), opts)\
+ .reject {|n| n == '.' or n == '..' }\
+ .map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
end
def stat
@@ -1355,24 +1353,7 @@ module FileUtils
end
end
- def link(dest)
- case
- when directory?
- if !File.exist?(dest) and descendant_directory?(dest, path)
- raise ArgumentError, "cannot link directory %s to itself %s" % [path, dest]
- end
- begin
- Dir.mkdir dest
- rescue
- raise unless File.directory?(dest)
- end
- else
- File.link path(), dest
- end
- end
-
def copy(dest)
- lstat
case
when file?
copy_file dest
@@ -1387,21 +1368,18 @@ module FileUtils
end
when symlink?
File.symlink File.readlink(path()), dest
- when chardev?, blockdev?
- raise "cannot handle device file"
+ when chardev?
+ raise "cannot handle device file" unless File.respond_to?(:mknod)
+ mknod dest, ?c, 0666, lstat().rdev
+ when blockdev?
+ raise "cannot handle device file" unless File.respond_to?(:mknod)
+ mknod dest, ?b, 0666, lstat().rdev
when socket?
- begin
- require 'socket'
- rescue LoadError
- raise "cannot handle socket"
- else
- raise "cannot handle socket" unless defined?(UNIXServer)
- end
- UNIXServer.new(dest).close
- File.chmod lstat().mode, dest
+ raise "cannot handle socket" unless File.respond_to?(:mknod)
+ mknod dest, nil, lstat().mode, 0
when pipe?
raise "cannot handle FIFO" unless File.respond_to?(:mkfifo)
- File.mkfifo dest, lstat().mode
+ mkfifo dest, 0666
when door?
raise "cannot handle door: #{path()}"
else
@@ -1422,7 +1400,6 @@ module FileUtils
if !st.symlink?
File.utime st.atime, st.mtime, path
end
- mode = st.mode
begin
if st.symlink?
begin
@@ -1432,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
@@ -1520,14 +1505,14 @@ module FileUtils
private
- @@fileutils_rb_have_lchmod = nil
+ $fileutils_rb_have_lchmod = nil
def have_lchmod?
# This is not MT-safe, but it does not matter.
- if @@fileutils_rb_have_lchmod == nil
- @@fileutils_rb_have_lchmod = check_have_lchmod?
+ if $fileutils_rb_have_lchmod == nil
+ $fileutils_rb_have_lchmod = check_have_lchmod?
end
- @@fileutils_rb_have_lchmod
+ $fileutils_rb_have_lchmod
end
def check_have_lchmod?
@@ -1538,14 +1523,14 @@ module FileUtils
return false
end
- @@fileutils_rb_have_lchown = nil
+ $fileutils_rb_have_lchown = nil
def have_lchown?
# This is not MT-safe, but it does not matter.
- if @@fileutils_rb_have_lchown == nil
- @@fileutils_rb_have_lchown = check_have_lchown?
+ if $fileutils_rb_have_lchown == nil
+ $fileutils_rb_have_lchown = check_have_lchown?
end
- @@fileutils_rb_have_lchown
+ $fileutils_rb_have_lchown
end
def check_have_lchown?
@@ -1563,17 +1548,14 @@ 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" : ""
def descendant_directory?(descendant, ascendant)
- if File::FNM_SYSCASE.nonzero?
- File.expand_path(File.dirname(descendant)).casecmp(File.expand_path(ascendant)) == 0
- else
- File.expand_path(File.dirname(descendant)) == File.expand_path(ascendant)
- end
+ /\A(?#{SYSCASE}:#{Regexp.quote(ascendant)})#{DIRECTORY_TERM}/ =~ File.dirname(descendant)
end
end # class Entry_
@@ -1612,32 +1594,41 @@ module FileUtils
end
private_module_function :fu_same?
- def fu_output_message(msg) #:nodoc:
- output = @fileutils_output if defined?(@fileutils_output)
- output ||= $stderr
- if defined?(@fileutils_label)
- msg = @fileutils_label + msg
+ def fu_check_options(options, optdecl) #:nodoc:
+ h = options.dup
+ optdecl.each do |opt|
+ h.delete opt
end
- output.puts msg
+ raise ArgumentError, "no such option: #{h.keys.join(' ')}" unless h.empty?
end
- private_module_function :fu_output_message
+ private_module_function :fu_check_options
- # 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
- }
+ 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
- public
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+
+ def fu_output_message(msg) #:nodoc:
+ @fileutils_output ||= $stderr
+ @fileutils_label ||= ''
+ @fileutils_output.puts @fileutils_label + msg
+ end
+ private_module_function :fu_output_message
#
- # Returns an Array of names of high-level methods that accept any keyword
- # arguments.
+ # 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
@@ -1646,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
@@ -1657,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
@@ -1667,29 +1658,26 @@ 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
#
- # Returns an Array of methods names which have the option +opt+.
+ # Returns an Array of method names which have the option +opt+.
#
# 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
- private
-
- LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern) # :nodoc:
- module LowMethods # :nodoc: internal use only
- private
- def _do_nothing(*)end
- ::FileUtils::LOW_METHODS.map {|name| alias_method name, :_do_nothing}
+ LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern)
+ module LowMethods
+ module_eval("private\n" + ::FileUtils::LOW_METHODS.map {|name| "def #{name}(*)end"}.join("\n"),
+ __FILE__, __LINE__)
end
- METHODS = singleton_methods() - [:private_module_function, # :nodoc:
+ METHODS = singleton_methods() - [:private_module_function,
:commands, :options, :have_option?, :options_of, :collect_method]
#
@@ -1699,18 +1687,21 @@ module FileUtils
#
module Verbose
include FileUtils
- names = ::FileUtils.collect_method(:verbose)
- names.each do |name|
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ ::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
@@ -1722,18 +1713,21 @@ module FileUtils
module NoWrite
include FileUtils
include LowMethods
- names = ::FileUtils.collect_method(:noop)
- names.each do |name|
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ ::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
@@ -1746,18 +1740,21 @@ module FileUtils
module DryRun
include FileUtils
include LowMethods
- names = ::FileUtils.collect_method(:noop)
- names.each do |name|
+ @fileutils_output = $stderr
+ @fileutils_label = ''
+ ::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 3f54cf6b93..55783a5695 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.
#
@@ -15,7 +14,7 @@
#
# Find.find(ENV["HOME"]) do |path|
# if FileTest.directory?(path)
-# if File.basename(path).start_with?('.')
+# if File.basename(path)[0] == ?.
# Find.prune # Don't look any further into this directory.
# else
# next
@@ -40,13 +39,13 @@ module Find
fs_encoding = Encoding.find("filesystem")
- paths.collect!{|d| raise Errno::ENOENT, d unless File.exist?(d); d.dup}.each do |path|
+ paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup}.each do |path|
path = path.to_path if path.respond_to? :to_path
enc = path.encoding == Encoding::US_ASCII ? fs_encoding : path.encoding
ps = [path]
while file = ps.shift
catch(:prune) do
- yield file.dup
+ yield file.dup.taint
begin
s = File.lstat(file)
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
@@ -55,15 +54,16 @@ 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
+ ps.unshift f.untaint
}
end
end
diff --git a/lib/forwardable.rb b/lib/forwardable.rb
index 4cfade470a..602cd8b815 100644
--- a/lib/forwardable.rb
+++ b/lib/forwardable.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: false
#
# forwardable.rb -
# $Release Version: 1.1$
@@ -57,9 +56,10 @@
#
# == Another example
#
-# You could use Forwardable as an alternative to inheritance, when you don't want
-# to inherit all methods from the superclass. For instance, here is how you might
-# add a range of +Array+ instance methods to a new class +Queue+:
+# We want to rely on what has come before obviously, but with delegation we can
+# take just the methods we need and even rename them as appropriate. In many
+# cases this is preferable to inheritance, which gives us the entire old
+# interface, even if much of it isn't needed.
#
# class Queue
# extend Forwardable
@@ -109,18 +109,20 @@
# +delegate.rb+.
#
module Forwardable
- require 'forwardable/impl'
- require "forwardable/version"
+ # Version of +forwardable.rb+
+ 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
# Takes a hash as its argument. The key is a symbol or an array of
- # symbols. These symbols correspond to method names, instance variable
- # names, or constant names (see def_delegator). The value is
+ # symbols. These symbols correspond to method names. The value is
# the accessor to which the methods will be delegated.
#
# :call-seq:
@@ -128,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
#
@@ -149,21 +150,18 @@ module Forwardable
# def_delegator :@records, :map
#
def def_instance_delegators(accessor, *methods)
- methods.each do |method|
- next if /\A__(?:send|id)__\z/ =~ method
+ methods.delete("__send__")
+ methods.delete("__id__")
+ for method in methods
def_instance_delegator(accessor, method)
end
end
# Define +method+ as delegator instance method with an optional
# alias name +ali+. Method calls to +ali+ will be delegated to
- # +accessor.method+. +accessor+ should be a method name, instance
- # variable name, or constant name. Use the full path to the
- # constant if providing the constant name.
- # Returns the name of the method defined.
+ # +accessor.method+.
#
# class MyQueue
- # CONST = 1
# extend Forwardable
# attr_reader :queue
# def initialize
@@ -171,67 +169,41 @@ module Forwardable
# end
#
# def_delegator :@queue, :push, :mypush
- # def_delegator 'MyQueue::CONST', :to_i
# end
#
# q = MyQueue.new
# q.mypush 42
# q.queue #=> [42]
# q.push 23 #=> NoMethodError
- # q.to_i #=> 1
#
def def_instance_delegator(accessor, method, ali = method)
- gen = Forwardable._delegator_method(self, accessor, method, ali)
+ accessor = accessor.to_s
+ if method_defined?(accessor) || private_method_defined?(accessor)
+ accessor = "#{accessor}()"
+ end
+ 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
- mod = Module === self ? self : singleton_class
- ret = mod.module_eval(&gen)
- mod.send(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7'
- ret
+ 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}
- end
- end
- end;
- end
end
# SingleForwardable can be used to setup delegation at the object level as well.
@@ -268,13 +240,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
#
@@ -289,8 +260,9 @@ module SingleForwardable
# def_delegator :@records, :map
#
def def_single_delegators(accessor, *methods)
- methods.each do |method|
- next if /\A__(?:send|id)__\z/ =~ method
+ methods.delete("__send__")
+ methods.delete("__id__")
+ for method in methods
def_single_delegator(accessor, method)
end
end
@@ -301,13 +273,24 @@ module SingleForwardable
# Defines a method _method_ which delegates to _accessor_ (i.e. it calls
# the method of the same name in _accessor_). If _new_name_ is
# provided, it is used as the name for the delegate method.
- # Returns the name of the method defined.
def def_single_delegator(accessor, method, ali = method)
- gen = Forwardable._delegator_method(self, accessor, method, ali)
+ accessor = accessor.to_s
+ if method_defined?(accessor) || private_method_defined?(accessor)
+ accessor = "#{accessor}()"
+ end
+
+ 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
+ }
- ret = instance_eval(&gen)
- singleton_class.send(:ruby2_keywords, ali) if RUBY_VERSION >= '2.7'
- ret
+ instance_eval(str, __FILE__, line_no)
end
alias delegate single_delegate
diff --git a/lib/forwardable/forwardable.gemspec b/lib/forwardable/forwardable.gemspec
deleted file mode 100644
index 2a3e637e26..0000000000
--- a/lib/forwardable/forwardable.gemspec
+++ /dev/null
@@ -1,23 +0,0 @@
-begin
- require_relative "lib/forwardable/version"
-rescue LoadError
- # for Ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "forwardable"
- spec.version = Forwardable::VERSION
- spec.authors = ["Keiju ISHITSUKA"]
- spec.email = ["keiju@ruby-lang.org"]
-
- spec.summary = %q{Provides delegation of specified methods to a designated object.}
- spec.description = %q{Provides delegation of specified methods to a designated object.}
- spec.homepage = "https://github.com/ruby/forwardable"
- spec.license = "BSD-2-Clause"
-
- spec.files = ["forwardable.gemspec", "lib/forwardable.rb", "lib/forwardable/impl.rb", "lib/forwardable/version.rb"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/forwardable/impl.rb b/lib/forwardable/impl.rb
deleted file mode 100644
index 58a9dfb69c..0000000000
--- a/lib/forwardable/impl.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# :stopdoc:
-module Forwardable
- 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/forwardable/version.rb b/lib/forwardable/version.rb
deleted file mode 100644
index 8f3e1f510e..0000000000
--- a/lib/forwardable/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module Forwardable
- # Version of +forwardable.rb+
- VERSION = "1.3.1"
- FORWARDABLE_VERSION = VERSION
-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/getoptlong/getoptlong.gemspec b/lib/getoptlong/getoptlong.gemspec
deleted file mode 100644
index 198bba83ac..0000000000
--- a/lib/getoptlong/getoptlong.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-begin
- require_relative "lib/getoptlong/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "getoptlong"
- spec.version = GetoptLong::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{GetoptLong for Ruby}
- spec.description = spec.summary
- spec.homepage = "https://github.com/ruby/getoptlong"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- # Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/getoptlong/version.rb b/lib/getoptlong/version.rb
deleted file mode 100644
index 6375fb8ad1..0000000000
--- a/lib/getoptlong/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class GetoptLong
- VERSION = "0.1.0"
-end
diff --git a/lib/ipaddr.gemspec b/lib/ipaddr.gemspec
deleted file mode 100644
index 2de9ef4881..0000000000
--- a/lib/ipaddr.gemspec
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-# 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.2"
- 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.license = "BSD-2-Clause"
-
- 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 7fff54b9d0..b0df4d3e6f 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# 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(':')
@@ -103,13 +102,13 @@ class IPAddr
# Creates a new ipaddr containing the given network byte ordered
# string form of an IP address.
- def self.new_ntoh(addr)
- return new(ntop(addr))
+ def IPAddr::new_ntoh(addr)
+ return IPAddr.new(IPAddr::ntop(addr))
end
# Convert a network byte ordered string form of an IP address into
# human readable form.
- def self.ntop(addr)
+ def IPAddr::ntop(addr)
case addr.size
when 4
s = addr.unpack('C4').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,8 +409,7 @@ class IPAddr
# Set current netmask to given mask.
def mask!(mask)
- case mask
- when String
+ if mask.kind_of?(String)
if mask =~ /\A\d+\z/
prefixlen = mask.to_i
else
@@ -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
@@ -594,8 +504,6 @@ class IPAddr
else
@mask_addr = (@family == Socket::AF_INET) ? IN4MASK : IN6MASK
end
- rescue InvalidAddressError => e
- raise e.class, "#{e.message}: #{addr}"
end
def coerce_other(other)
diff --git a/lib/irb.rb b/lib/irb.rb
index bcd6599af9..a7da846bc6 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 $
@@ -9,7 +8,7 @@
#
#
#
-require "ripper"
+require "e2mmap"
require "irb/init"
require "irb/context"
@@ -18,9 +17,8 @@ require "irb/extend-command"
require "irb/ruby-lex"
require "irb/input-method"
require "irb/locale"
-require "irb/color"
-require "irb/version"
+STDOUT.sync = true
# IRB stands for "interactive Ruby" and is a tool to interactively execute Ruby
# expressions read from the standard input.
@@ -44,13 +42,14 @@ require "irb/version"
# irb(main):006:1> end
# #=> nil
#
-# The singleline editor module or multiline editor module can be used with irb.
-# Use of multiline editor is default if it's installed.
+# The Readline extension module can be used with irb. Use of Readline is
+# default if it's installed.
#
# == Command line options
#
# 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
@@ -60,24 +59,21 @@ require "irb/version"
# -W[level=2] Same as `ruby -W`
# --inspect Use `inspect' for output (default except for bc mode)
# --noinspect Don't use inspect for output
-# --multiline Use multiline editor module
-# --nomultiline Don't use multiline editor module
-# --singleline Use singleline editor module
-# --nosingleline Don't use singleline editor module
-# --colorize Use colorization
-# --nocolorize Don't use colorization
+# --readline Use Readline extension module
+# --noreadline Don't use Readline extension module
# --prompt prompt-mode
# --prompt-mode prompt-mode
# Switch prompt mode. Pre-defined prompt modes are
# `default', `simple', `xmp' and `inf-ruby'
# --inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs.
-# Suppresses --multiline and --singleline.
+# Suppresses --readline.
# --simple-prompt Simple prompt mode
# --noprompt No prompt mode
# --tracer Display trace for each execution of commands.
# --back-trace-limit n
# Display backtrace top n and tail n. The default
# value is 16.
+# --irb_debug n Set internal debug level to n (not for popular use)
# -v, --version Print the version of irb
#
# == Configuration
@@ -95,24 +91,24 @@ require "irb/version"
# 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
# IRB.conf[:USE_LOADER] = false
-# IRB.conf[:USE_MULTILINE] = nil
-# IRB.conf[:USE_SINGLELINE] = nil
-# IRB.conf[:USE_COLORIZE] = true
+# IRB.conf[:USE_READLINE] = nil
# IRB.conf[:USE_TRACER] = false
# IRB.conf[:IGNORE_SIGINT] = true
# IRB.conf[:IGNORE_EOF] = false
# IRB.conf[:PROMPT_MODE] = :DEFAULT
# IRB.conf[:PROMPT] = {...}
+# IRB.conf[:DEBUG_LEVEL]=0
#
# === Auto indentation
#
-# To disable auto-indent mode in irb, add the following to your +.irbrc+:
+# To enable auto-indent mode in irb, add the following to your +.irbrc+:
#
-# IRB.conf[:AUTO_INDENT] = false
+# IRB.conf[:AUTO_INDENT] = true
#
# === Autocompletion
#
@@ -122,22 +118,15 @@ require "irb/version"
#
# === History
#
-# By default, irb will store the last 1000 commands you used in
-# <code>IRB.conf[:HISTORY_FILE]</code> (<code>~/.irb_history</code> by default).
+# By default, irb disables history and will not store any commands you used.
#
-# If you want to disable history, add the following to your +.irbrc+:
+# If you want to enable history, add the following to your +.irbrc+:
#
-# IRB.conf[:SAVE_HISTORY] = nil
+# IRB.conf[:SAVE_HISTORY] = 1000
#
-# See IRB::Context#save_history= for more information.
-#
-# The history of _results_ of commands evaluated is not stored by default,
-# but can be turned on to be stored with this +.irbrc+ setting:
-#
-# IRB.conf[:EVAL_HISTORY] = <number>
+# This will now store the last 1000 commands in <code>~/.irb_history</code>.
#
-# See IRB::Context#eval_history= and History class. The history of command
-# results is not permanently saved in any file.
+# See IRB::Context#save_history= for more information.
#
# == Customizing the IRB Prompt
#
@@ -148,7 +137,7 @@ require "irb/version"
# This example can be used in your +.irbrc+
#
# IRB.conf[:PROMPT][:MY_PROMPT] = { # name of prompt mode
-# :AUTO_INDENT => false, # disables auto-indent mode
+# :AUTO_INDENT => true, # enables auto-indent mode
# :PROMPT_I => ">> ", # simple prompt
# :PROMPT_S => nil, # prompt for continuated strings
# :PROMPT_C => nil, # prompt for continuated statement
@@ -169,7 +158,7 @@ require "irb/version"
# %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.
# %% # %
#
@@ -177,7 +166,6 @@ require "irb/version"
#
# IRB.conf[:PROMPT_MODE][:DEFAULT] = {
# :PROMPT_I => "%N(%m):%03n:%i> ",
-# :PROMPT_N => "%N(%m):%03n:%i> ",
# :PROMPT_S => "%N(%m):%03n:%i%l ",
# :PROMPT_C => "%N(%m):%03n:%i* ",
# :RETURN => "%s\n" # used to printf
@@ -281,9 +269,7 @@ require "irb/version"
# <code>_</code>::
# The value command executed, as a local variable
# <code>__</code>::
-# The history of evaluated commands. Available only if
-# <code>IRB.conf[:EVAL_HISTORY]</code> is not +nil+ (which is the default).
-# See also IRB::Context#eval_history= and IRB::History.
+# The history of evaluated commands
# <code>__[line_no]</code>::
# Returns the evaluation value at the given line number, +line_no+.
# If +line_no+ is a negative, the return value +line_no+ many lines before
@@ -319,7 +305,7 @@ require "irb/version"
# # check if Foo#foo is available
# irb(main):005:0> Foo.instance_methods #=> [:foo, ...]
#
-# # change the active session
+# # change the active sesssion
# irb(main):006:0> fg 2
# # define Foo#bar in the context of Foo
# irb.2(Foo):005:0> def bar
@@ -344,7 +330,7 @@ require "irb/version"
# 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
@@ -359,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
@@ -371,7 +357,9 @@ module IRB
def IRB.version
if v = @CONF[:VERSION] then return v end
- @CONF[:VERSION] = format("irb %s (%s)", @RELEASE_VERSION, @LAST_UPDATE_DATE)
+ require "irb/version"
+ rv = @RELEASE_VERSION.sub(/\.0/, "")
+ @CONF[:VERSION] = format("irb %s(%s)", rv, @LAST_UPDATE_DATE)
end
# The current IRB::Context of the session, see IRB.conf
@@ -385,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)
@@ -395,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.
@@ -420,60 +421,15 @@ module IRB
end
class Irb
- ASSIGNMENT_NODE_TYPES = [
- # Local, instance, global, class, constant, instance, and index assignment:
- # "foo = bar",
- # "@foo = bar",
- # "$foo = bar",
- # "@@foo = bar",
- # "::Foo = bar",
- # "a::Foo = bar",
- # "Foo = bar"
- # "foo.bar = 1"
- # "foo[1] = bar"
- :assign,
-
- # Operation assignment:
- # "foo += bar"
- # "foo -= bar"
- # "foo ||= bar"
- # "foo &&= bar"
- :opassign,
-
- # Multiple assignment:
- # "foo, bar = 1, 2
- :massign,
- ]
- # Note: instance and index assignment expressions could also be written like:
- # "foo.bar=(1)" and "foo.[]=(1, bar)", when expressed that way, the former
- # be parsed as :assign and echo will be suppressed, but the latter is
- # parsed as a :method_add_arg and the output won't be suppressed
-
# Creates a new irb session
- def initialize(workspace = nil, input_method = nil)
- @context = Context.new(self, workspace, input_method)
+ def initialize(workspace = nil, input_method = nil, output_method = nil)
+ @context = Context.new(self, workspace, input_method, output_method)
@context.main.extend ExtendCommandBundle
@signal_status = :IN_IRB
- @scanner = RubyLex.new
- 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
+ @scanner = RubyLex.new
+ @scanner.exception_on_syntax_error = false
end
-
# Returns the current context of this irb session
attr_reader :context
# The lexer used by this irb session
@@ -481,8 +437,6 @@ module IRB
# Evaluates input for this session.
def eval_input
- exc = nil
-
@scanner.set_prompt do
|ltype, indent, continue, line_no|
if ltype
@@ -500,16 +454,14 @@ module IRB
else
@context.io.prompt = p = ""
end
- if @context.auto_indent_mode and !@context.io.respond_to?(:auto_indent)
+ if @context.auto_indent_mode
unless ltype
- prompt_i = @context.prompt_i.nil? ? "" : @context.prompt_i
- ind = prompt(prompt_i, ltype, indent, line_no)[/.*\z/].size +
+ ind = prompt(@context.prompt_i, ltype, indent, line_no)[/.*\z/].size +
indent * 2 - p.size
ind += 2 if continue
@context.io.prompt = p + " " * ind if ind > 0
end
end
- @context.io.prompt
end
@scanner.set_input(@context.io) do
@@ -530,80 +482,58 @@ module IRB
end
end
- @scanner.set_auto_indent(@context) if @context.auto_indent_mode
-
@scanner.each_top_level_statement do |line, line_no|
signal_status(:IN_EVAL) do
begin
- line.untaint if RUBY_VERSION < '2.7'
- @context.evaluate(line, line_no, exception: exc)
- output_value if @context.echo? && (@context.echo_on_assignment? || !assignment_expression?(line))
+ line.untaint
+ @context.evaluate(line, line_no)
+ output_value if @context.echo?
+ exc = nil
rescue Interrupt => exc
rescue SystemExit, SignalException
raise
rescue Exception => exc
- else
- exc = nil
- next
end
- handle_exception(exc)
- end
- end
- end
-
- def handle_exception(exc)
- if exc.backtrace && exc.backtrace[0] =~ /\/irb(2)?(\/.*|-.*|\.rb)?:/ && exc.class.to_s !~ /^IRB/ &&
- !(SyntaxError === exc)
- irb_bug = true
- else
- irb_bug = false
- 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
+ else
+ irb_bug = false
+ end
- if STDOUT.tty?
- attr = ATTR_TTY
- print "#{attr[1]}Traceback#{attr[]} (most recent call last):\n"
- else
- attr = ATTR_PLAIN
- end
- messages = []
- lasts = []
- levels = 0
- if exc.backtrace
- count = 0
- exc.backtrace.each do |m|
- m = @context.workspace.filter_backtrace(m) or next unless irb_bug
- count += 1
- if attr == ATTR_TTY
- m = sprintf("%9d: from %s", count, m)
- else
- m = "\tfrom #{m}"
+ messages = []
+ lasts = []
+ levels = 0
+ if exc.backtrace
+ for m in exc.backtrace
+ m = @context.workspace.filter_backtrace(m) unless irb_bug
+ if m
+ if messages.size < @context.back_trace_limit
+ messages.push "\tfrom "+m
+ else
+ lasts.push "\tfrom "+m
+ if lasts.size > @context.back_trace_limit
+ lasts.shift
+ levels += 1
+ end
+ end
+ end
+ end
+ end
+ print messages.join("\n"), "\n"
+ unless lasts.empty?
+ printf "... %d levels...\n", levels if levels > 0
+ print lasts.join("\n"), "\n"
+ end
+ print "Maybe IRB bug!\n" if irb_bug
end
- if messages.size < @context.back_trace_limit
- messages.push(m)
- elsif lasts.size < @context.back_trace_limit
- lasts.push(m).shift
- levels += 1
+ if $SAFE > 2
+ abort "Error: irb does not work for $SAFE level higher than 2"
end
end
end
- if attr == ATTR_TTY
- unless lasts.empty?
- puts lasts.reverse
- printf "... %d levels...\n", levels if levels > 0
- end
- puts messages.reverse
- end
- m = exc.to_s.split(/\n/)
- print "#{attr[1]}#{exc.class} (#{attr[4]}#{m.shift}#{attr[0, 1]})#{attr[]}\n"
- puts m.map {|s| "#{attr[1]}#{s}#{attr[]}\n"}
- if attr == ATTR_PLAIN
- puts messages
- unless lasts.empty?
- puts lasts
- printf "... %d levels...\n", levels if levels > 0
- end
- end
- print "Maybe IRB bug!\n" if irb_bug
end
# Evaluates the given block using the given +path+ as the Context#irb_path
@@ -709,18 +639,10 @@ module IRB
when "l"
ltype
when "i"
- if indent < 0
- if $1
- "-".rjust($1.to_i)
- else
- "-"
- end
+ if $1
+ format("%" + $1 + "d", indent)
else
- if $1
- format("%" + $1 + "d", indent)
- else
- indent.to_s
- end
+ indent.to_s
end
when "n"
if $1
@@ -755,26 +677,6 @@ module IRB
end
format("#<%s: %s>", self.class, ary.join(", "))
end
-
- def assignment_expression?(line)
- # Try to parse the line and check if the last of possibly multiple
- # expressions is an assignment type.
-
- # If the expression is invalid, Ripper.sexp should return nil which will
- # result in false being returned. Any valid expression should return an
- # s-expression where the second selement of the top level array is an
- # array of parsed expressions. The first element of each expression is the
- # expression's type.
- verbose, $VERBOSE = $VERBOSE, nil
- result = ASSIGNMENT_NODE_TYPES.include?(Ripper.sexp(line)&.dig(1,-1,0))
- $VERBOSE = verbose
- result
- end
-
- ATTR_TTY = "\e[%sm"
- def ATTR_TTY.[](*a) self % a.join(";"); end
- ATTR_PLAIN = ""
- def ATTR_PLAIN.[](*) self; end
end
def @CONF.inspect
@@ -799,71 +701,3 @@ module IRB
array.join("\n")
end
end
-
-class Binding
- # Opens an IRB session where +binding.irb+ is called which allows for
- # interactive debugging. You can call any methods or variables available in
- # the current scope, and mutate state if you need to.
- #
- #
- # Given a Ruby file called +potato.rb+ containing the following code:
- #
- # class Potato
- # def initialize
- # @cooked = false
- # binding.irb
- # puts "Cooked potato: #{@cooked}"
- # end
- # end
- #
- # Potato.new
- #
- # Running <code>ruby potato.rb</code> will open an IRB session where
- # +binding.irb+ is called, and you will see the following:
- #
- # $ ruby potato.rb
- #
- # From: potato.rb @ line 4 :
- #
- # 1: class Potato
- # 2: def initialize
- # 3: @cooked = false
- # => 4: binding.irb
- # 5: puts "Cooked potato: #{@cooked}"
- # 6: end
- # 7: end
- # 8:
- # 9: Potato.new
- #
- # irb(#<Potato:0x00007feea1916670>):001:0>
- #
- # You can type any valid Ruby code and it will be evaluated in the current
- # context. This allows you to debug without having to run your code repeatedly:
- #
- # irb(#<Potato:0x00007feea1916670>):001:0> @cooked
- # => false
- # irb(#<Potato:0x00007feea1916670>):002:0> self.class
- # => Potato
- # irb(#<Potato:0x00007feea1916670>):003:0> caller.first
- # => ".../2.5.1/lib/ruby/2.5.0/irb/workspace.rb:85:in `eval'"
- # irb(#<Potato:0x00007feea1916670>):004:0> @cooked = true
- # => true
- #
- # You can exit the IRB session with the +exit+ command. Note that exiting will
- # resume execution where +binding.irb+ had paused it, as you can see from the
- # output printed to standard output in this example:
- #
- # irb(#<Potato:0x00007feea1916670>):005:0> exit
- # Cooked potato: true
- #
- #
- # See IRB@IRB+Usage for more information.
- def irb
- IRB.setup(source_location[0], argv: [])
- workspace = IRB::WorkSpace.new(self)
- STDOUT.print(workspace.code_around_binding)
- binding_irb = IRB::Irb.new(workspace)
- binding_irb.context.irb_path = File.expand_path(source_location[0])
- binding_irb.run(IRB.conf)
- end
-end
diff --git a/lib/irb/cmd/chws.rb b/lib/irb/cmd/chws.rb
index e9f257791c..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$
@@ -10,20 +9,20 @@
#
#
-require_relative "nop"
-require_relative "../ext/change-ws"
+require "irb/cmd/nop.rb"
+require "irb/ext/change-ws.rb"
# :stopdoc:
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 31d53dcaba..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,14 +13,14 @@
# :stopdoc:
module IRB
module ExtendCommand
- class Fork < Nop
+ class Fork<Nop
def execute
pid = send ExtendCommand.irb_original_method_name("fork")
unless pid
class << self
alias_method :exit, ExtendCommand.irb_original_method_name('exit')
end
- if block_given?
+ if iterator?
begin
yield
ensure
diff --git a/lib/irb/cmd/help.rb b/lib/irb/cmd/help.rb
index 0629479e92..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$
@@ -9,18 +8,17 @@
#
#
-require_relative "nop"
+require 'rdoc/ri/driver'
+
+require "irb/cmd/nop.rb"
# :stopdoc:
module IRB
module ExtendCommand
- class Help < Nop
- def execute(*names)
- require 'rdoc/ri/driver'
- IRB::ExtendCommand::Help.const_set(:Ri, RDoc::RI::Driver.new)
- rescue LoadError, SystemExit
- IRB::ExtendCommand::Help.remove_method(:execute)
- # raise NoMethodError in ensure
+ class Help<Nop
+ begin
+ Ri = RDoc::RI::Driver.new
+ rescue SystemExit
else
def execute(*names)
if names.empty?
@@ -36,9 +34,6 @@ module IRB
end
nil
end
- nil
- ensure
- execute(*names)
end
end
end
diff --git a/lib/irb/cmd/load.rb b/lib/irb/cmd/load.rb
index b6769a4124..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$
@@ -10,13 +9,13 @@
#
#
-require_relative "nop"
-require_relative "../ext/loader"
+require "irb/cmd/nop.rb"
+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 187b276e48..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$
@@ -10,26 +9,26 @@
#
#
-require_relative "nop"
-require_relative "../ext/workspaces"
+require "irb/cmd/nop.rb"
+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 1e18607d1a..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$
@@ -9,31 +8,31 @@
#
#
-require_relative "nop"
-require_relative "../ext/multi-irb"
+require "irb/cmd/nop.rb"
+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/color.rb b/lib/irb/color.rb
deleted file mode 100644
index d2b9674a71..0000000000
--- a/lib/irb/color.rb
+++ /dev/null
@@ -1,233 +0,0 @@
-# frozen_string_literal: true
-require 'reline'
-require 'ripper'
-
-module IRB # :nodoc:
- module Color
- CLEAR = 0
- BOLD = 1
- UNDERLINE = 4
- REVERSE = 7
- RED = 31
- GREEN = 32
- YELLOW = 33
- BLUE = 34
- MAGENTA = 35
- CYAN = 36
-
- TOKEN_KEYWORDS = {
- on_kw: ['nil', 'self', 'true', 'false', '__FILE__', '__LINE__'],
- on_const: ['ENV'],
- }
- private_constant :TOKEN_KEYWORDS
-
- # A constant of all-bit 1 to match any Ripper's state in #dispatch_seq
- ALL = -1
- private_constant :ALL
-
- begin
- # Following pry's colors where possible, but sometimes having a compromise like making
- # backtick and regexp as red (string's color, because they're sharing tokens).
- TOKEN_SEQ_EXPRS = {
- on_CHAR: [[BLUE, BOLD], ALL],
- on_backtick: [[RED, BOLD], ALL],
- on_comment: [[BLUE, BOLD], ALL],
- on_const: [[BLUE, BOLD, UNDERLINE], ALL],
- on_embexpr_beg: [[RED], ALL],
- on_embexpr_end: [[RED], ALL],
- on_embvar: [[RED], ALL],
- on_float: [[MAGENTA, BOLD], ALL],
- on_gvar: [[GREEN, BOLD], ALL],
- on_heredoc_beg: [[RED], ALL],
- on_heredoc_end: [[RED], ALL],
- on_ident: [[BLUE, BOLD], Ripper::EXPR_ENDFN],
- on_imaginary: [[BLUE, BOLD], ALL],
- on_int: [[BLUE, BOLD], ALL],
- on_kw: [[GREEN], ALL],
- on_label: [[MAGENTA], ALL],
- on_label_end: [[RED, BOLD], ALL],
- on_qsymbols_beg: [[RED, BOLD], ALL],
- on_qwords_beg: [[RED, BOLD], ALL],
- on_rational: [[BLUE, BOLD], ALL],
- on_regexp_beg: [[RED, BOLD], ALL],
- on_regexp_end: [[RED, BOLD], ALL],
- on_symbeg: [[YELLOW], ALL],
- on_symbols_beg: [[RED, BOLD], ALL],
- on_tstring_beg: [[RED, BOLD], ALL],
- on_tstring_content: [[RED], ALL],
- on_tstring_end: [[RED, BOLD], ALL],
- on_words_beg: [[RED, BOLD], ALL],
- on_parse_error: [[RED, REVERSE], ALL],
- compile_error: [[RED, REVERSE], ALL],
- }
- rescue NameError
- # Give up highlighting Ripper-incompatible older Ruby
- TOKEN_SEQ_EXPRS = {}
- end
- private_constant :TOKEN_SEQ_EXPRS
-
- class << self
- def colorable?
- $stdout.tty? && supported? && (/mswin|mingw/ =~ RUBY_PLATFORM || (ENV.key?('TERM') && ENV['TERM'] != 'dumb'))
- end
-
- def inspect_colorable?(obj, seen: {}.compare_by_identity)
- case obj
- when String, Symbol, Regexp, Integer, Float, FalseClass, TrueClass, NilClass
- true
- when Hash
- without_circular_ref(obj, seen: seen) do
- obj.all? { |k, v| inspect_colorable?(k, seen: seen) && inspect_colorable?(v, seen: seen) }
- end
- when Array
- without_circular_ref(obj, seen: seen) do
- obj.all? { |o| inspect_colorable?(o, seen: seen) }
- end
- when Range
- inspect_colorable?(obj.begin, seen: seen) && inspect_colorable?(obj.end, seen: seen)
- when Module
- !obj.name.nil?
- else
- false
- end
- end
-
- def clear
- return '' unless colorable?
- "\e[#{CLEAR}m"
- end
-
- def colorize(text, seq)
- return text unless colorable?
- seq = seq.map { |s| "\e[#{const_get(s)}m" }.join('')
- "#{seq}#{text}#{clear}"
- end
-
- # If `complete` is false (code is incomplete), this does not warn compile_error.
- # This option is needed to avoid warning a user when the compile_error is happening
- # because the input is not wrong but just incomplete.
- def colorize_code(code, complete: true)
- return code unless colorable?
-
- symbol_state = SymbolState.new
- colored = +''
- length = 0
-
- scan(code, allow_last_error: !complete) do |token, str, expr|
- in_symbol = symbol_state.scan_token(token)
- str.each_line do |line|
- line = Reline::Unicode.escape_for_print(line)
- if seq = dispatch_seq(token, expr, line, in_symbol: in_symbol)
- colored << seq.map { |s| "\e[#{s}m" }.join('')
- colored << line.sub(/\Z/, clear)
- else
- colored << line
- end
- end
- length += str.bytesize
- end
-
- # give up colorizing incomplete Ripper tokens
- if length != code.bytesize
- return Reline::Unicode.escape_for_print(code)
- end
-
- colored
- end
-
- private
-
- def without_circular_ref(obj, seen:, &block)
- return false if seen.key?(obj)
- seen[obj] = true
- block.call
- ensure
- seen.delete(obj)
- end
-
- # Ripper::Lexer::Elem#state is supported on Ruby 2.5+
- def supported?
- return @supported if defined?(@supported)
- @supported = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0')
- end
-
- def scan(code, allow_last_error:)
- pos = [1, 0]
-
- verbose, $VERBOSE = $VERBOSE, nil
- lexer = Ripper::Lexer.new(code)
- if lexer.respond_to?(:scan) # Ruby 2.7+
- lexer.scan.each do |elem|
- str = elem.tok
- next if allow_last_error and /meets end of file|unexpected end-of-input/ =~ elem.message
- next if ([elem.pos[0], elem.pos[1] + str.bytesize] <=> pos) <= 0
-
- str.each_line do |line|
- if line.end_with?("\n")
- pos[0] += 1
- pos[1] = 0
- else
- pos[1] += line.bytesize
- end
- end
-
- yield(elem.event, str, elem.state)
- end
- else
- lexer.parse.each do |elem|
- yield(elem.event, elem.tok, elem.state)
- end
- end
- $VERBOSE = verbose
- end
-
- def dispatch_seq(token, expr, str, in_symbol:)
- if token == :on_parse_error or token == :compile_error
- TOKEN_SEQ_EXPRS[token][0]
- elsif in_symbol
- [YELLOW]
- elsif TOKEN_KEYWORDS.fetch(token, []).include?(str)
- [CYAN, BOLD]
- elsif (seq, exprs = TOKEN_SEQ_EXPRS[token]; (expr & (exprs || 0)) != 0)
- seq
- else
- nil
- end
- end
- end
-
- # A class to manage a state to know whether the current token is for Symbol or not.
- class SymbolState
- def initialize
- # Push `true` to detect Symbol. `false` to increase the nest level for non-Symbol.
- @stack = []
- end
-
- # Return true if the token is a part of Symbol.
- def scan_token(token)
- prev_state = @stack.last
- case token
- when :on_symbeg, :on_symbols_beg, :on_qsymbols_beg
- @stack << true
- when :on_ident, :on_op, :on_const, :on_ivar, :on_cvar, :on_gvar, :on_kw
- if @stack.last # Pop only when it's Symbol
- @stack.pop
- return prev_state
- end
- when :on_tstring_beg
- @stack << false
- when :on_embexpr_beg
- @stack << false
- return prev_state
- when :on_tstring_end # :on_tstring_end may close Symbol
- @stack.pop
- return prev_state
- when :on_embexpr_end
- @stack.pop
- end
- @stack.last
- end
- end
- private_constant :SymbolState
- end
-end
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index 3536e8ec87..2d47f33d66 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -1,6 +1,5 @@
-# frozen_string_literal: false
#
-# irb/completion.rb -
+# irb/completor.rb -
# $Release Version: 0.9$
# $Revision$
# by Keiju ISHITSUKA(keiju@ishitsuka.com)
@@ -8,7 +7,6 @@
#
require "readline"
-autoload :RDoc, "rdoc"
module IRB
module InputCompletor # :nodoc:
@@ -36,13 +34,9 @@ module IRB
yield
]
- BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{("
-
CompletionProc = proc { |input|
- retrieve_completion_data(input).compact.map{ |i| i.encode(Encoding.default_external) }
- }
+ bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
- def self.retrieve_completion_data(input, bind: IRB.conf[:MAIN_CONTEXT].workspace.binding, doc_namespace: false)
case input
when /^((["'`]).*\2)\.([^.]*)$/
# String
@@ -50,11 +44,7 @@ module IRB
message = Regexp.quote($3)
candidates = String.instance_methods.collect{|m| m.to_s}
- if doc_namespace
- "String.#{message}"
- else
- select_message(receiver, message, candidates)
- end
+ select_message(receiver, message, candidates)
when /^(\/[^\/]*\/)\.([^.]*)$/
# Regexp
@@ -62,11 +52,7 @@ module IRB
message = Regexp.quote($2)
candidates = Regexp.instance_methods.collect{|m| m.to_s}
- if doc_namespace
- "Regexp.#{message}"
- else
- select_message(receiver, message, candidates)
- end
+ select_message(receiver, message, candidates)
when /^([^\]]*\])\.([^.]*)$/
# Array
@@ -74,28 +60,19 @@ module IRB
message = Regexp.quote($2)
candidates = Array.instance_methods.collect{|m| m.to_s}
- if doc_namespace
- "Array.#{message}"
- else
- select_message(receiver, message, candidates)
- end
+ select_message(receiver, message, candidates)
when /^([^\}]*\})\.([^.]*)$/
# Proc or Hash
receiver = $1
message = Regexp.quote($2)
- proc_candidates = Proc.instance_methods.collect{|m| m.to_s}
- hash_candidates = Hash.instance_methods.collect{|m| m.to_s}
- if doc_namespace
- ["Proc.#{message}", "Hash.#{message}"]
- else
- select_message(receiver, message, proc_candidates | hash_candidates)
- end
+ candidates = Proc.instance_methods.collect{|m| m.to_s}
+ candidates |= Hash.instance_methods.collect{|m| m.to_s}
+ select_message(receiver, message, candidates)
when /^(:[^:.]*)$/
# Symbol
- return nil if doc_namespace
if Symbol.respond_to?(:all_symbols)
sym = $1
candidates = Symbol.all_symbols.collect{|s| ":" + s.id2name}
@@ -108,11 +85,7 @@ module IRB
# Absolute Constant or class methods
receiver = $1
candidates = Object.constants.collect{|m| m.to_s}
- if doc_namespace
- candidates.find { |i| i == receiver }
- else
- candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
- end
+ candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
when /^([A-Z].*)::([^:.]*)$/
# Constant or class methods
@@ -124,11 +97,7 @@ module IRB
rescue Exception
candidates = []
end
- if doc_namespace
- "#{receiver}::#{message}"
- else
- select_message(receiver, message, candidates, "::")
- end
+ select_message(receiver, message, candidates, "::")
when /^(:[^:.]+)(\.|::)([^.]*)$/
# Symbol
@@ -137,33 +106,20 @@ module IRB
message = Regexp.quote($3)
candidates = Symbol.instance_methods.collect{|m| m.to_s}
- if doc_namespace
- "Symbol.#{message}"
- else
- select_message(receiver, message, candidates, sep)
- end
+ select_message(receiver, message, candidates, sep)
- when /^(?<num>-?(0[dbo])?[0-9_]+(\.[0-9_]+)?(([eE][+-]?[0-9]+)?i?|r)?)(?<sep>\.|::)(?<mes>[^.]*)$/
+ when /^(-?(0[dbo])?[0-9_]+(\.[0-9_]+)?([eE]-?[0-9]+)?)(\.|::)([^.]*)$/
# Numeric
- receiver = $~[:num]
- sep = $~[:sep]
- message = Regexp.quote($~[:mes])
+ receiver = $1
+ sep = $5
+ message = Regexp.quote($6)
begin
- instance = eval(receiver, bind)
- if doc_namespace
- "#{instance.class.name}.#{message}"
- else
- candidates = instance.methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates, sep)
- end
+ candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
rescue Exception
- if doc_namespace
- nil
- else
- candidates = []
- end
+ candidates = []
end
+ select_message(receiver, message, candidates, sep)
when /^(-?0x[0-9a-fA-F_]+)(\.|::)([^.]*)$/
# Numeric(0xFFFF)
@@ -172,30 +128,16 @@ module IRB
message = Regexp.quote($3)
begin
- instance = eval(receiver, bind)
- if doc_namespace
- "#{instance.class.name}.#{message}"
- else
- candidates = instance.methods.collect{|m| m.to_s}
- select_message(receiver, message, candidates, sep)
- end
+ candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
rescue Exception
- if doc_namespace
- nil
- else
- candidates = []
- end
+ candidates = []
end
+ select_message(receiver, message, candidates, sep)
when /^(\$[^.]*)$/
# global var
- gvar = $1
- all_gvars = global_variables.collect{|m| m.to_s}
- if doc_namespace
- all_gvars.find{ |i| i == gvar }
- else
- all_gvars.grep(Regexp.new(Regexp.quote(gvar)))
- end
+ regmessage = Regexp.new(Regexp.quote($1))
+ candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
when /^([^."].*)(\.|::)([^.]*)$/
# variable.func or func.func
@@ -203,7 +145,7 @@ module IRB
sep = $2
message = Regexp.quote($3)
- gv = eval("global_variables", bind).collect{|m| m.to_s}.append("true", "false", "nil")
+ gv = eval("global_variables", bind).collect{|m| m.to_s}
lv = eval("local_variables", bind).collect{|m| m.to_s}
iv = eval("instance_variables", bind).collect{|m| m.to_s}
cv = eval("self.class.constants", bind).collect{|m| m.to_s}
@@ -226,19 +168,24 @@ module IRB
else
# func1.func2
candidates = []
- to_ignore = ignored_modules
ObjectSpace.each_object(Module){|m|
- next if (to_ignore.include?(m) rescue true)
+ begin
+ name = m.name
+ rescue Exception
+ name = ""
+ end
+ begin
+ next if name != "IRB::Context" and
+ /^(IRB|SLex|RubyLex|RubyToken)/ =~ name
+ rescue Exception
+ next
+ end
candidates.concat m.instance_methods(false).collect{|x| x.to_s}
}
candidates.sort!
candidates.uniq!
end
- if doc_namespace
- "#{rec.class.name}#{sep}#{candidates.find{ |i| i == message }}"
- else
- select_message(receiver, message, candidates, sep)
- end
+ select_message(receiver, message, candidates, sep)
when /^\.([^.]*)$/
# unknown(maybe String)
@@ -247,50 +194,12 @@ module IRB
message = Regexp.quote($1)
candidates = String.instance_methods(true).collect{|m| m.to_s}
- if doc_namespace
- "String.#{candidates.find{ |i| i == message }}"
- else
- select_message(receiver, message, candidates)
- end
+ select_message(receiver, message, candidates)
else
candidates = eval("methods | private_methods | local_variables | instance_variables | self.class.constants", bind).collect{|m| m.to_s}
- conditions |= ReservedWords
-
- if doc_namespace
- candidates.find{ |i| i == input }
- else
- candidates.grep(/^#{Regexp.quote(input)}/)
- end
- end
- end
- PerfectMatchedProc = ->(matched) {
- RDocRIDriver ||= RDoc::RI::Driver.new
- if matched =~ /\A(?:::)?RubyVM/ and not ENV['RUBY_YES_I_AM_NOT_A_NORMAL_USER']
- File.open(File.join(__dir__, 'ruby_logo.aa')) do |f|
- RDocRIDriver.page do |io|
- IO.copy_stream(f, io)
- end
- end
- return
- end
- namespace = retrieve_completion_data(matched, doc_namespace: true)
- return unless matched
- if namespace.is_a?(Array)
- out = RDoc::Markup::Document.new
- namespace.each do |m|
- begin
- RDocRIDriver.add_method(out, m)
- rescue RDoc::RI::Driver::NotFoundError
- end
- end
- RDocRIDriver.display(out)
- else
- begin
- RDocRIDriver.display_names([namespace])
- rescue RDoc::RI::Driver::NotFoundError
- end
+ (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
end
}
@@ -308,30 +217,11 @@ module IRB
end
end
end
-
- def self.ignored_modules
- # We could cache the result, but this is very fast already.
- # By using this approach, we avoid Module#name calls, which are
- # relatively slow when there are a lot of anonymous modules defined.
- s = {}
-
- scanner = lambda do |m|
- next if s.include?(m) # IRB::ExtendCommandBundle::EXCB recurses.
- s[m] = true
- m.constants(false).each do |c|
- value = m.const_get(c)
- scanner.call(value) if value.is_a?(Module)
- end
- end
-
- %i(IRB RubyLex).each do |sym|
- next unless Object.const_defined?(sym)
- scanner.call(Object.const_get(sym))
- end
-
- s.delete(IRB::Context) if defined?(IRB::Context)
-
- s
- end
end
end
+
+if Readline.respond_to?("basic_word_break_characters=")
+ Readline.basic_word_break_characters= " \t\n`><=;|&{("
+end
+Readline.completion_append_character = nil
+Readline.completion_proc = IRB::InputCompletor::CompletionProc
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 686738cd40..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$
@@ -9,10 +8,8 @@
#
#
#
-require_relative "workspace"
-require_relative "inspector"
-require_relative "input-method"
-require_relative "output-method"
+require "irb/workspace"
+require "irb/inspector"
module IRB
# A class that wraps the current state of the irb session, including the
@@ -22,10 +19,10 @@ module IRB
#
# The optional +input_method+ argument:
#
- # +nil+:: uses stdin or Reidline or Readline
+ # +nil+:: uses stdin or Readline
# +String+:: uses a File
# +other+:: uses this as InputMethod
- def initialize(irb, workspace = nil, input_method = nil)
+ def initialize(irb, workspace = nil, input_method = nil, output_method = nil)
@irb = irb
if workspace
@workspace = workspace
@@ -39,25 +36,12 @@ module IRB
@rc = IRB.conf[:RC]
@load_modules = IRB.conf[:LOAD_MODULES]
- if IRB.conf.has_key?(:USE_SINGLELINE)
- @use_singleline = IRB.conf[:USE_SINGLELINE]
- elsif IRB.conf.has_key?(:USE_READLINE) # backward compatibility
- @use_singleline = IRB.conf[:USE_READLINE]
- else
- @use_singleline = nil
- end
- if IRB.conf.has_key?(:USE_MULTILINE)
- @use_multiline = IRB.conf[:USE_MULTILINE]
- elsif IRB.conf.has_key?(:USE_REIDLINE) # backward compatibility
- @use_multiline = IRB.conf[:USE_REIDLINE]
- else
- @use_multiline = nil
- end
- @use_colorize = IRB.conf[:USE_COLORIZE]
+ @use_readline = IRB.conf[:USE_READLINE]
@verbose = IRB.conf[:VERBOSE]
@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]
@@ -78,42 +62,23 @@ module IRB
case input_method
when nil
- @io = nil
- case use_multiline?
+ case use_readline?
when nil
- if STDIN.tty? && IRB.conf[:PROMPT_MODE] != :INF_RUBY && !use_singleline?
- # Both of multiline mode and singleline mode aren't specified.
- @io = ReidlineInputMethod.new
+ if (defined?(ReadlineInputMethod) && STDIN.tty? &&
+ IRB.conf[:PROMPT_MODE] != :INF_RUBY)
+ @io = ReadlineInputMethod.new
else
- @io = nil
+ @io = StdioInputMethod.new
end
when false
- @io = nil
+ @io = StdioInputMethod.new
when true
- @io = ReidlineInputMethod.new
- end
- unless @io
- case use_singleline?
- when nil
- if (defined?(ReadlineInputMethod) && STDIN.tty? &&
- IRB.conf[:PROMPT_MODE] != :INF_RUBY)
- @io = ReadlineInputMethod.new
- else
- @io = nil
- end
- when false
- @io = nil
- when true
- if defined?(ReadlineInputMethod)
- @io = ReadlineInputMethod.new
- else
- @io = nil
- end
+ if defined?(ReadlineInputMethod)
+ @io = ReadlineInputMethod.new
else
- @io = nil
+ @io = StdioInputMethod.new
end
end
- @io = StdioInputMethod.new unless @io
when String
@io = FileInputMethod.new(input_method)
@@ -124,15 +89,17 @@ module IRB
end
self.save_history = IRB.conf[:SAVE_HISTORY] if IRB.conf[:SAVE_HISTORY]
+ if output_method
+ @output_method = output_method
+ else
+ @output_method = StdioOutputMethod.new
+ end
+
@echo = IRB.conf[:ECHO]
if @echo.nil?
@echo = true
end
-
- @echo_on_assignment = IRB.conf[:ECHO_ON_ASSIGNMENT]
- if @echo_on_assignment.nil?
- @echo_on_assignment = false
- end
+ self.debug_level = IRB.conf[:DEBUG_LEVEL]
end
# The top-level workspace, see WorkSpace#main
@@ -148,9 +115,9 @@ module IRB
attr_reader :thread
# The current input method
#
- # Can be either StdioInputMethod, ReadlineInputMethod,
- # ReidlineInputMethod, FileInputMethod or other specified when the
- # context is created. See ::new for more # information on +input_method+.
+ # Can be either StdioInputMethod, ReadlineInputMethod, FileInputMethod or
+ # other specified when the context is created. See ::new for more
+ # information on +input_method+.
attr_accessor :io
# Current irb session
@@ -168,18 +135,12 @@ module IRB
# +input_method+ passed to Context.new
attr_accessor :irb_path
- # Whether multiline editor mode is enabled or not.
+ # Whether +Readline+ is enabled or not.
#
- # A copy of the default <code>IRB.conf[:USE_MULTILINE]</code>
- attr_reader :use_multiline
- # Whether singleline editor mode is enabled or not.
+ # A copy of the default <code>IRB.conf[:USE_READLINE]</code>
#
- # A copy of the default <code>IRB.conf[:USE_SINGLELINE]</code>
- attr_reader :use_singleline
- # Whether colorization is enabled or not.
- #
- # A copy of the default <code>IRB.conf[:USE_COLORIZE]</code>
- attr_reader :use_colorize
+ # See #use_readline= for more information.
+ attr_reader :use_readline
# A copy of the default <code>IRB.conf[:INSPECT_MODE]</code>
attr_reader :inspect_mode
@@ -202,17 +163,17 @@ module IRB
# Can be either the default <code>IRB.conf[:AUTO_INDENT]</code>, or the
# mode set by #prompt_mode=
#
- # To disable auto-indentation in irb:
+ # To enable auto-indentation in irb:
#
- # IRB.conf[:AUTO_INDENT] = false
+ # IRB.conf[:AUTO_INDENT] = true
#
# or
#
- # irb_context.auto_indent_mode = false
+ # irb_context.auto_indent_mode = true
#
# or
#
- # IRB.CurrentContext.auto_indent_mode = false
+ # IRB.CurrentContext.auto_indent_mode = true
#
# See IRB@Configuration for more information.
attr_accessor :auto_indent_mode
@@ -244,19 +205,14 @@ module IRB
# puts "omg"
# # omg
attr_accessor :echo
- # Whether to echo for assignment expressions
- #
- # Uses IRB.conf[:ECHO_ON_ASSIGNMENT] if available, or defaults to +false+.
- #
- # a = "omg"
- # IRB.CurrentContext.echo_on_assignment = true
- # a = "omg"
- # #=> omg
- attr_accessor :echo_on_assignment
# Whether verbose messages are displayed or not.
#
# A copy of the default <code>IRB.conf[:VERBOSE]</code>
attr_accessor :verbose
+ # The debug level of irb
+ #
+ # See #debug_level= for more information.
+ attr_reader :debug_level
# The limit of backtrace lines displayed as top +n+ and tail +n+.
#
@@ -267,33 +223,18 @@ module IRB
# See IRB@Command+line+options for more command line options.
attr_accessor :back_trace_limit
- # Alias for #use_multiline
- alias use_multiline? use_multiline
- # Alias for #use_singleline
- alias use_singleline? use_singleline
- # backward compatibility
- alias use_reidline use_multiline
- # backward compatibility
- alias use_reidline? use_multiline
- # backward compatibility
- alias use_readline use_singleline
- # backward compatibility
- alias use_readline? use_singleline
- # Alias for #use_colorize
- alias use_colorize? use_colorize
+ # Alias for #use_readline
+ alias use_readline? use_readline
# Alias for #rc
alias rc? rc
alias ignore_sigint? ignore_sigint
alias ignore_eof? ignore_eof
alias echo? echo
- alias echo_on_assignment? echo_on_assignment
# Returns whether messages are displayed or not.
def verbose?
if @verbose.nil?
- if @io.kind_of?(ReidlineInputMethod)
- false
- elsif defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
+ if defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
false
elsif !STDIN.tty? or @io.kind_of?(FileInputMethod)
true
@@ -306,11 +247,9 @@ module IRB
end
# Whether #verbose? is +true+, and +input_method+ is either
- # StdioInputMethod or ReidlineInputMethod or ReadlineInputMethod, see #io
- # for more information.
+ # StdioInputMethod or ReadlineInputMethod, see #io for more information.
def prompting?
verbose? || (STDIN.tty? && @io.kind_of?(StdioInputMethod) ||
- @io.kind_of?(ReidlineInputMethod) ||
(defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)))
end
@@ -321,7 +260,7 @@ module IRB
# to #last_value.
def set_last_value(value)
@last_value = value
- @workspace.local_variable_set :_, value
+ @workspace.evaluate self, "_ = IRB.CurrentContext.last_value"
end
# Sets the +mode+ of the prompt in this context.
@@ -409,13 +348,34 @@ module IRB
@inspect_mode
end
- def evaluate(line, line_no, exception: nil) # :nodoc:
+ # Obsolete method.
+ #
+ # Can be set using the +--noreadline+ and +--readline+ command line
+ # options.
+ #
+ # See IRB@Command+line+options for more command line options.
+ def use_readline=(opt)
+ print "This method is obsolete."
+ print "Do nothing."
+ end
+
+ # Sets the debug level of irb
+ #
+ # Can also be set using the +--irb_debug+ command line option.
+ #
+ # See IRB@Command+line+options for more command line options.
+ def debug_level=(value)
+ @debug_level = value
+ RubyLex.debug_level = value
+ end
+
+ # Whether or not debug mode is enabled, see #debug_level=.
+ def debug?
+ @debug_level > 0
+ end
+
+ def evaluate(line, line_no) # :nodoc:
@line_no = line_no
- if exception
- line_no -= 1
- line = "begin ::Kernel.raise _; rescue _.class\n#{line}\n""end"
- @workspace.local_variable_set(:_, exception)
- end
set_last_value(@workspace.evaluate(self, line, irb_path, line_no))
end
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 30e3fb901f..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$
@@ -22,7 +21,7 @@ module IRB # :nodoc:
def set_last_value(value)
_set_last_value(value)
- if defined?(@eval_history) && @eval_history
+ if @eval_history
@eval_history_values.push @line_no, @last_value
@workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
end
@@ -30,13 +29,9 @@ module IRB # :nodoc:
@last_value
end
- remove_method :eval_history= if method_defined?(:eval_history=)
- # The command result history limit. This method is not available until
- # #eval_history= was called with non-nil value (directly or via
- # setting <code>IRB.conf[:EVAL_HISTORY]</code> in <code>.irbrc</code>).
+ # The command result history limit.
attr_reader :eval_history
- # Sets command result history limit. Default value is set from
- # <code>IRB.conf[:EVAL_HISTORY]</code>.
+ # Sets command result history limit.
#
# +no+ is an Integer or +nil+.
#
@@ -45,9 +40,6 @@ module IRB # :nodoc:
# If +no+ is 0, the number of history items is unlimited.
#
# If +no+ is +nil+, execution result history isn't used (default).
- #
- # History values are available via <code>__</code> variable, see
- # IRB::History.
def eval_history=(no)
if no
if defined?(@eval_history) && @eval_history
@@ -65,51 +57,20 @@ module IRB # :nodoc:
end
end
- # Represents history of results of previously evaluated commands.
- #
- # Available via <code>__</code> variable, only if <code>IRB.conf[:EVAL_HISTORY]</code>
- # or <code>IRB::CurrentContext().eval_history</code> is non-nil integer value
- # (by default it is +nil+).
- #
- # Example (in `irb`):
- #
- # # Initialize history
- # IRB::CurrentContext().eval_history = 10
- # # => 10
- #
- # # Perform some commands...
- # 1 + 2
- # # => 3
- # puts 'x'
- # # x
- # # => nil
- # raise RuntimeError
- # # ...error raised
- #
- # # Inspect history (format is "<item number> <evaluated value>":
- # __
- # # => 1 10
- # # 2 3
- # # 3 nil
- #
- # __[1]
- # # => 10
- #
- class History
-
- def initialize(size = 16) # :nodoc:
+ class History # :nodoc:
+
+ def initialize(size = 16)
@size = size
@contents = []
end
- def size(size) # :nodoc:
+ def size(size)
if size != 0 && size < @size
@contents = @contents[@size - size .. @size]
end
@size = size
end
- # Get one item of the content (both positive and negative indexes work).
def [](idx)
begin
if idx >= 0
@@ -122,14 +83,14 @@ module IRB # :nodoc:
end
end
- def push(no, val) # :nodoc:
+ def push(no, val)
@contents.push [no, val]
@contents.shift if @size != 0 && @contents.size > @size
end
alias real_inspect inspect
- def inspect # :nodoc:
+ def inspect
if @contents.empty?
return real_inspect
end
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 74de1ecde5..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$
@@ -9,7 +8,8 @@
#
#
#
-fail CantShiftToMultiIrbMode unless defined?(Thread)
+IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
+require "thread"
module IRB
class JobManager
@@ -67,8 +67,8 @@ module IRB
# exception is raised.
def switch(key)
th, irb = search(key)
- fail IrbAlreadyDead unless th.alive?
- fail IrbSwitchedToCurrentThread if th == Thread.current
+ IRB.fail IrbAlreadyDead unless th.alive?
+ IRB.fail IrbSwitchedToCurrentThread if th == Thread.current
@current_job = irb
th.run
Thread.stop
@@ -84,7 +84,7 @@ module IRB
def kill(*keys)
for key in keys
th, _ = search(key)
- fail IrbAlreadyDead unless th.alive?
+ IRB.fail IrbAlreadyDead unless th.alive?
th.exit
end
end
@@ -114,7 +114,7 @@ module IRB
else
@jobs.find{|k, v| v.context.main.equal?(key)}
end
- fail NoSuchJob, key if job.nil?
+ IRB.fail NoSuchJob, key if job.nil?
job
end
@@ -122,7 +122,7 @@ module IRB
def delete(key)
case key
when Integer
- fail NoSuchJob, key unless @jobs[key]
+ IRB.fail NoSuchJob, key unless @jobs[key]
@jobs[key] = nil
else
catch(:EXISTS) do
@@ -135,7 +135,7 @@ module IRB
throw :EXISTS
end
end
- fail NoSuchJob, key
+ IRB.fail NoSuchJob, key
end
end
until assoc = @jobs.pop; end unless @jobs.empty?
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index c0d4d372b7..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 method_defined?(:save_history=)
# Sets <code>IRB.conf[:SAVE_HISTORY]</code> to the given +val+ and calls
# #init_save_history with this context.
#
@@ -58,6 +56,8 @@ module IRB
end
module HistorySavingAbility # :nodoc:
+ include Readline
+
def HistorySavingAbility.extended(obj)
IRB.conf[:AT_EXIT].push proc{obj.save_history}
obj.load_history
@@ -65,30 +65,18 @@ module IRB
end
def load_history
- return unless self.class.const_defined?(:HISTORY)
- history = self.class::HISTORY
if history_file = IRB.conf[:HISTORY_FILE]
history_file = File.expand_path(history_file)
end
history_file = IRB.rc_file("_history") unless history_file
if File.exist?(history_file)
open(history_file) do |f|
- f.each { |l|
- l = l.chomp
- if self.class == ReidlineInputMethod and history.last&.end_with?("\\")
- history.last.delete_suffix!("\\")
- history.last << "\n" << l
- else
- history << l
- end
- }
+ f.each {|l| HISTORY << l.chomp}
end
end
end
def save_history
- return unless self.class.const_defined?(:HISTORY)
- history = self.class::HISTORY
if num = IRB.conf[:SAVE_HISTORY] and (num = num.to_i) > 0
if history_file = IRB.conf[:HISTORY_FILE]
history_file = File.expand_path(history_file)
@@ -101,14 +89,12 @@ module IRB
File.chmod(0600, history_file)
end
rescue Errno::ENOENT
- rescue Errno::EPERM
- return
rescue
raise
end
open(history_file, 'w', 0600 ) do |f|
- hist = history.map{ |l| l.split("\n").join("\\\n") }
+ hist = HISTORY.to_a
f.puts(hist[-num..-1] || hist)
end
end
diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb
index e3e325e6e5..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$
@@ -9,20 +8,7 @@
#
#
#
-begin
- require "tracer"
-rescue LoadError
- $stderr.puts "Tracer extension of IRB is enabled but tracer gem doesn't found."
- module IRB
- TracerLoadError = true
- class Context
- def use_tracer=(opt)
- # do nothing
- end
- end
- end
- return # This is about to disable loading below
-end
+require "tracer"
module IRB
diff --git a/lib/irb/ext/use-loader.rb b/lib/irb/ext/use-loader.rb
index cb10e8a254..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$
@@ -10,8 +9,8 @@
#
#
-require_relative "../cmd/load"
-require_relative "loader"
+require "irb/cmd/load"
+require "irb/ext/loader"
class Object
alias __original__load__IRB_use_loader__ load
@@ -20,12 +19,10 @@ end
module IRB
module ExtendCommandBundle
- remove_method :irb_load if method_defined?(:irb_load)
# Loads the given file similarly to Kernel#load, see IrbLoader#irb_load
def irb_load(*opts, &b)
ExtendCommand::Load.execute(irb_context, *opts, &b)
end
- remove_method :irb_require if method_defined?(:irb_require)
# Loads the given file similarly to Kernel#require
def irb_require(*opts, &b)
ExtendCommand::Require.execute(irb_context, *opts, &b)
@@ -46,7 +43,6 @@ module IRB
alias use_loader? use_loader
- remove_method :use_loader= if method_defined?(:use_loader=)
# Sets IRB.conf[:USE_LOADER]
#
# See #use_loader for more information.
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 de145e962d..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$
@@ -32,7 +31,7 @@ module IRB # :nodoc:
# 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.
def irb_context
IRB.CurrentContext
end
@@ -46,80 +45,58 @@ module IRB # :nodoc:
]
@EXTEND_COMMANDS = [
- [
- :irb_current_working_workspace, :CurrentWorkingWorkspace, "irb/cmd/chws",
- [:irb_print_working_workspace, OVERRIDE_ALL],
- [:irb_cwws, OVERRIDE_ALL],
- [:irb_pwws, OVERRIDE_ALL],
- [:cwws, NO_OVERRIDE],
- [:pwws, NO_OVERRIDE],
- [:irb_current_working_binding, OVERRIDE_ALL],
- [:irb_print_working_binding, OVERRIDE_ALL],
- [:irb_cwb, OVERRIDE_ALL],
- [:irb_pwb, OVERRIDE_ALL],
- ],
- [
- :irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
- [:irb_chws, OVERRIDE_ALL],
- [:irb_cws, OVERRIDE_ALL],
- [:chws, NO_OVERRIDE],
- [:cws, NO_OVERRIDE],
- [:irb_change_binding, OVERRIDE_ALL],
- [:irb_cb, OVERRIDE_ALL],
- [:cb, NO_OVERRIDE],
- ],
+ [:irb_current_working_workspace, :CurrentWorkingWorkspace, "irb/cmd/chws",
+ [:irb_print_working_workspace, OVERRIDE_ALL],
+ [:irb_cwws, OVERRIDE_ALL],
+ [:irb_pwws, OVERRIDE_ALL],
+ [:cwws, NO_OVERRIDE],
+ [:pwws, NO_OVERRIDE],
+ [:irb_current_working_binding, OVERRIDE_ALL],
+ [:irb_print_working_binding, OVERRIDE_ALL],
+ [:irb_cwb, OVERRIDE_ALL],
+ [:irb_pwb, OVERRIDE_ALL],
+ ],
+ [:irb_change_workspace, :ChangeWorkspace, "irb/cmd/chws",
+ [:irb_chws, OVERRIDE_ALL],
+ [:irb_cws, OVERRIDE_ALL],
+ [:chws, NO_OVERRIDE],
+ [:cws, NO_OVERRIDE],
+ [:irb_change_binding, OVERRIDE_ALL],
+ [:irb_cb, OVERRIDE_ALL],
+ [:cb, NO_OVERRIDE]],
- [
- :irb_workspaces, :Workspaces, "irb/cmd/pushws",
- [:workspaces, NO_OVERRIDE],
- [:irb_bindings, OVERRIDE_ALL],
- [:bindings, NO_OVERRIDE],
- ],
- [
- :irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
- [:irb_pushws, OVERRIDE_ALL],
- [:pushws, NO_OVERRIDE],
- [:irb_push_binding, OVERRIDE_ALL],
- [:irb_pushb, OVERRIDE_ALL],
- [:pushb, NO_OVERRIDE],
- ],
- [
- :irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
- [:irb_popws, OVERRIDE_ALL],
- [:popws, NO_OVERRIDE],
- [:irb_pop_binding, OVERRIDE_ALL],
- [:irb_popb, OVERRIDE_ALL],
- [:popb, NO_OVERRIDE],
- ],
+ [:irb_workspaces, :Workspaces, "irb/cmd/pushws",
+ [:workspaces, NO_OVERRIDE],
+ [:irb_bindings, OVERRIDE_ALL],
+ [:bindings, NO_OVERRIDE]],
+ [:irb_push_workspace, :PushWorkspace, "irb/cmd/pushws",
+ [:irb_pushws, OVERRIDE_ALL],
+ [:pushws, NO_OVERRIDE],
+ [:irb_push_binding, OVERRIDE_ALL],
+ [:irb_pushb, OVERRIDE_ALL],
+ [:pushb, NO_OVERRIDE]],
+ [:irb_pop_workspace, :PopWorkspace, "irb/cmd/pushws",
+ [:irb_popws, OVERRIDE_ALL],
+ [:popws, NO_OVERRIDE],
+ [:irb_pop_binding, OVERRIDE_ALL],
+ [:irb_popb, OVERRIDE_ALL],
+ [:popb, NO_OVERRIDE]],
- [
- :irb_load, :Load, "irb/cmd/load"],
- [
- :irb_require, :Require, "irb/cmd/load"],
- [
- :irb_source, :Source, "irb/cmd/load",
- [:source, NO_OVERRIDE],
- ],
+ [:irb_load, :Load, "irb/cmd/load"],
+ [:irb_require, :Require, "irb/cmd/load"],
+ [:irb_source, :Source, "irb/cmd/load",
+ [:source, NO_OVERRIDE]],
- [
- :irb, :IrbCommand, "irb/cmd/subirb"],
- [
- :irb_jobs, :Jobs, "irb/cmd/subirb",
- [:jobs, NO_OVERRIDE],
- ],
- [
- :irb_fg, :Foreground, "irb/cmd/subirb",
- [:fg, NO_OVERRIDE],
- ],
- [
- :irb_kill, :Kill, "irb/cmd/subirb",
- [:kill, OVERRIDE_PRIVATE_ONLY],
- ],
+ [:irb, :IrbCommand, "irb/cmd/subirb"],
+ [:irb_jobs, :Jobs, "irb/cmd/subirb",
+ [:jobs, NO_OVERRIDE]],
+ [:irb_fg, :Foreground, "irb/cmd/subirb",
+ [:fg, NO_OVERRIDE]],
+ [:irb_kill, :Kill, "irb/cmd/subirb",
+ [:kill, OVERRIDE_PRIVATE_ONLY]],
- [
- :irb_help, :Help, "irb/cmd/help",
- [:help, NO_OVERRIDE],
- ],
+ [:irb_help, :Help, "irb/cmd/help",
+ [:help, NO_OVERRIDE]],
]
@@ -236,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"],
]
@@ -244,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
@@ -326,3 +305,4 @@ module IRB # :nodoc:
end
end
end
+
diff --git a/lib/irb/frame.rb b/lib/irb/frame.rb
index de54a98f1b..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$
@@ -10,18 +9,13 @@
#
#
+require "e2mmap"
+
module IRB
class Frame
- class FrameOverflow < StandardError
- def initialize
- super("frame overflow")
- end
- end
- class FrameUnderflow < StandardError
- def initialize
- super("frame underflow")
- end
- end
+ extend Exception2MessageMapper
+ def_exception :FrameOverflow, "frame overflow"
+ def_exception :FrameUnderflow, "frame underflow"
# Default number of stack frames
INIT_STACK_TIMES = 3
@@ -49,7 +43,7 @@ module IRB
# Raises FrameUnderflow if there are no frames in the given stack range.
def top(n = 0)
bind = @frames[-(n + CALL_STACK_OFFSET)]
- fail FrameUnderflow unless bind
+ Fail FrameUnderflow unless bind
bind
end
@@ -59,7 +53,7 @@ module IRB
# Raises FrameOverflow if there are no frames in the given stack range.
def bottom(n = 0)
bind = @frames[n]
- fail FrameOverflow unless bind
+ Fail FrameOverflow unless bind
bind
end
diff --git a/lib/irb/help.rb b/lib/irb/help.rb
index 7868a70a6c..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$
@@ -10,7 +9,7 @@
#
#
-require_relative 'magic-file'
+require 'irb/magic-file'
module IRB
# Outputs the irb help message, see IRB@Command+line+options.
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 2af872fd03..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,15 +12,15 @@
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
unless @CONF[:PROMPT][@CONF[:PROMPT_MODE]]
- fail UndefinedPromptMode, @CONF[:PROMPT_MODE]
+ IRB.fail(UndefinedPromptMode, @CONF[:PROMPT_MODE])
end
end
@@ -43,19 +42,18 @@ module IRB # :nodoc:
@CONF[:LOAD_MODULES] = []
@CONF[:IRB_RC] = nil
- @CONF[:USE_SINGLELINE] = false unless defined?(ReadlineInputMethod)
- @CONF[:USE_COLORIZE] = true
+ @CONF[:MATH_MODE] = false
+ @CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
@CONF[:INSPECT_MODE] = true
@CONF[:USE_TRACER] = false
@CONF[:USE_LOADER] = false
@CONF[:IGNORE_SIGINT] = true
@CONF[:IGNORE_EOF] = false
@CONF[:ECHO] = nil
- @CONF[:ECHO_ON_ASSIGNMENT] = nil
@CONF[:VERBOSE] = nil
@CONF[:EVAL_HISTORY] = nil
- @CONF[:SAVE_HISTORY] = 1000
+ @CONF[:SAVE_HISTORY] = nil
@CONF[:BACK_TRACE_LIMIT] = 16
@@ -84,7 +82,7 @@ module IRB # :nodoc:
:SIMPLE => {
:PROMPT_I => ">> ",
:PROMPT_N => ">> ",
- :PROMPT_S => "%l> ",
+ :PROMPT_S => nil,
:PROMPT_C => "?> ",
:RETURN => "=> %s\n"
},
@@ -106,7 +104,7 @@ module IRB # :nodoc:
}
@CONF[:PROMPT_MODE] = (STDIN.tty? ? :DEFAULT : :NULL)
- @CONF[:AUTO_INDENT] = true
+ @CONF[:AUTO_INDENT] = false
@CONF[:CONTEXT_MODE] = 3 # use binding in function on TOPLEVEL_BINDING
@CONF[:SINGLE_IRB] = false
@@ -114,6 +112,8 @@ module IRB # :nodoc:
@CONF[:LC_MESSAGES] = Locale.new
@CONF[:AT_EXIT] = []
+
+ @CONF[:DEBUG_LEVEL] = 0
end
def IRB.init_error
@@ -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,50 +145,38 @@ 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
when "--noinspect"
@CONF[:INSPECT_MODE] = false
- when "--singleline", "--readline", "--legacy"
- @CONF[:USE_SINGLELINE] = true
- when "--nosingleline", "--noreadline"
- @CONF[:USE_SINGLELINE] = false
- when "--multiline", "--reidline"
- @CONF[:USE_MULTILINE] = true
- when "--nomultiline", "--noreidline"
- @CONF[:USE_MULTILINE] = false
+ when "--readline"
+ @CONF[:USE_READLINE] = true
+ when "--noreadline"
+ @CONF[:USE_READLINE] = false
when "--echo"
@CONF[:ECHO] = true
when "--noecho"
@CONF[:ECHO] = false
- when "--echo-on-assignment"
- @CONF[:ECHO_ON_ASSIGNMENT] = true
- when "--noecho-on-assignment"
- @CONF[:ECHO_ON_ASSIGNMENT] = false
when "--verbose"
@CONF[:VERBOSE] = true
when "--noverbose"
@CONF[:VERBOSE] = false
- when "--colorize"
- @CONF[:USE_COLORIZE] = true
- when "--nocolorize"
- @CONF[:USE_COLORIZE] = 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"
@@ -198,26 +188,28 @@ 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
when "-v", "--version"
print IRB.version, "\n"
exit 0
when "-h", "--help"
- require_relative "help"
+ require "irb/help"
IRB.print_usage
exit 0
when "--"
- if opt = argv.shift
+ if opt = ARGV.shift
@CONF[:SCRIPT] = opt
$0 = opt
end
break
when /^-/
- fail UnrecognizedSwitch, opt
+ IRB.fail UnrecognizedSwitch, opt
else
@CONF[:SCRIPT] = opt
$0 = opt
@@ -262,7 +254,7 @@ module IRB # :nodoc:
when String
return rc_file
else
- fail IllegalRCNameGenerator
+ IRB.fail IllegalRCNameGenerator
end
end
@@ -274,11 +266,11 @@ module IRB # :nodoc:
if home = ENV["HOME"]
yield proc{|rc| home+"/.irb#{rc}"}
end
- current_dir = Dir.pwd
- yield proc{|rc| current_dir+"/.irb#{rc}"}
- yield proc{|rc| current_dir+"/irb#{rc.sub(/\A_?/, '.')}"}
- yield proc{|rc| current_dir+"/_irb#{rc}"}
- yield proc{|rc| current_dir+"/$irb#{rc}"}
+ home = Dir.pwd
+ yield proc{|rc| home+"/.irb#{rc}"}
+ yield proc{|rc| home+"/irb#{rc.sub(/\A_?/, '.')}"}
+ yield proc{|rc| home+"/_irb#{rc}"}
+ yield proc{|rc| home+"/$irb#{rc}"}
end
# loading modules
@@ -287,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 a1777d7904..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$
@@ -9,10 +8,8 @@
#
#
#
-require_relative 'src_encoding'
-require_relative 'magic-file'
-require_relative 'completion'
-require 'reline'
+require 'irb/src_encoding'
+require 'irb/magic-file'
module IRB
STDIN_FILE_NAME = "(line)" # :nodoc:
@@ -32,7 +29,7 @@ module IRB
#
# See IO#gets for more information.
def gets
- fail NotImplementedError, "gets"
+ IRB.fail NotImplementedError, "gets"
end
public :gets
@@ -118,7 +115,8 @@ module IRB
# See IO#gets for more information.
def gets
print @prompt
- @io.gets
+ l = @io.gets
+ l
end
# The external encoding for standard input.
@@ -141,12 +139,6 @@ module IRB
@stdin = IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
@stdout = IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
-
- if Readline.respond_to?("basic_word_break_characters=")
- Readline.basic_word_break_characters = IRB::InputCompletor::BASIC_WORD_BREAK_CHARACTERS
- end
- Readline.completion_append_character = nil
- Readline.completion_proc = IRB::InputCompletor::CompletionProc
end
# Reads the next line from this input method.
@@ -193,105 +185,7 @@ module IRB
def encoding
@stdin.external_encoding
end
-
- if Readline.respond_to?("basic_word_break_characters=")
- Readline.basic_word_break_characters = IRB::InputCompletor::BASIC_WORD_BREAK_CHARACTERS
- end
- Readline.completion_append_character = nil
- Readline.completion_proc = IRB::InputCompletor::CompletionProc
end
rescue LoadError
end
-
- class ReidlineInputMethod < InputMethod
- include Reline
- # Creates a new input method object using Readline
- def initialize
- super
-
- @line_no = 0
- @line = []
- @eof = false
-
- @stdin = ::IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
- @stdout = ::IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
-
- if Reline.respond_to?("basic_word_break_characters=")
- Reline.basic_word_break_characters = IRB::InputCompletor::BASIC_WORD_BREAK_CHARACTERS
- end
- Reline.completion_append_character = nil
- Reline.completion_proc = IRB::InputCompletor::CompletionProc
- Reline.output_modifier_proc =
- if IRB.conf[:USE_COLORIZE]
- proc do |output, complete:|
- next unless IRB::Color.colorable?
- IRB::Color.colorize_code(output, complete: complete)
- end
- else
- proc do |output|
- Reline::Unicode.escape_for_print(output)
- end
- end
- Reline.dig_perfect_match_proc = IRB::InputCompletor::PerfectMatchedProc
- end
-
- def check_termination(&block)
- @check_termination_proc = block
- end
-
- def dynamic_prompt(&block)
- @prompt_proc = block
- end
-
- def auto_indent(&block)
- @auto_indent_proc = block
- end
-
- # Reads the next line from this input method.
- #
- # See IO#gets for more information.
- def gets
- Reline.input = @stdin
- Reline.output = @stdout
- Reline.prompt_proc = @prompt_proc
- Reline.auto_indent_proc = @auto_indent_proc if @auto_indent_proc
- if l = readmultiline(@prompt, false, &@check_termination_proc)
- HISTORY.push(l) if !l.empty?
- @line[@line_no += 1] = l + "\n"
- else
- @eof = true
- l
- end
- end
-
- # Whether the end of this input method has been reached, returns +true+
- # if there is no more data to read.
- #
- # See IO#eof? for more information.
- def eof?
- @eof
- end
-
- # Whether this input method is still readable when there is no more data to
- # read.
- #
- # See IO#eof for more information.
- def readable_after_eof?
- true
- end
-
- # Returns the current line number for #io.
- #
- # #line counts the number of times #gets is called.
- #
- # See IO#lineno for more information.
- def line(line_no)
- @line[line_no]
- end
-
- # The external encoding for standard input.
- def encoding
- @stdin.external_encoding
- end
- end
end
diff --git a/lib/irb/inspector.rb b/lib/irb/inspector.rb
index bc7fb0b125..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$
@@ -106,22 +105,12 @@ module IRB # :nodoc:
Inspector.def_inspector([false, :to_s, :raw]){|v| v.to_s}
Inspector.def_inspector([true, :p, :inspect]){|v|
begin
- result = v.inspect
- if IRB.conf[:MAIN_CONTEXT]&.use_colorize? && Color.inspect_colorable?(v)
- result = Color.colorize_code(result)
- end
- result
+ v.inspect
rescue NoMethodError
puts "(Object doesn't support #inspect)"
end
}
- Inspector.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v|
- result = v.pretty_inspect.chomp
- if IRB.conf[:MAIN_CONTEXT]&.use_colorize? && Color.inspect_colorable?(v)
- result = Color.colorize_code(result)
- end
- result
- }
+ Inspector.def_inspector([:pp, :pretty_inspect], proc{require "pp"}){|v| v.pretty_inspect.chomp}
Inspector.def_inspector([:yaml, :YAML], proc{require "yaml"}){|v|
begin
YAML.dump(v)
diff --git a/lib/irb/irb.gemspec b/lib/irb/irb.gemspec
deleted file mode 100644
index c3208954c5..0000000000
--- a/lib/irb/irb.gemspec
+++ /dev/null
@@ -1,83 +0,0 @@
-begin
- require_relative "lib/irb/version"
-rescue LoadError
- # for Ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "irb"
- spec.version = IRB::VERSION
- spec.authors = ["Keiju ISHITSUKA"]
- spec.email = ["keiju@ruby-lang.org"]
-
- spec.summary = %q{Interactive Ruby command-line tool for REPL (Read Eval Print Loop).}
- spec.description = %q{Interactive Ruby command-line tool for REPL (Read Eval Print Loop).}
- spec.homepage = "https://github.com/ruby/irb"
- spec.license = "BSD-2-Clause"
-
- spec.files = [
- "Gemfile",
- "LICENSE.txt",
- "README.md",
- "Rakefile",
- "bin/console",
- "bin/setup",
- "doc/irb/irb-tools.rd.ja",
- "doc/irb/irb.rd.ja",
- "exe/irb",
- "irb.gemspec",
- "lib/irb.rb",
- "lib/irb/cmd/chws.rb",
- "lib/irb/cmd/fork.rb",
- "lib/irb/cmd/help.rb",
- "lib/irb/cmd/load.rb",
- "lib/irb/cmd/nop.rb",
- "lib/irb/cmd/pushws.rb",
- "lib/irb/cmd/subirb.rb",
- "lib/irb/color.rb",
- "lib/irb/completion.rb",
- "lib/irb/context.rb",
- "lib/irb/ext/change-ws.rb",
- "lib/irb/ext/history.rb",
- "lib/irb/ext/loader.rb",
- "lib/irb/ext/multi-irb.rb",
- "lib/irb/ext/save-history.rb",
- "lib/irb/ext/tracer.rb",
- "lib/irb/ext/use-loader.rb",
- "lib/irb/ext/workspaces.rb",
- "lib/irb/extend-command.rb",
- "lib/irb/frame.rb",
- "lib/irb/help.rb",
- "lib/irb/init.rb",
- "lib/irb/input-method.rb",
- "lib/irb/inspector.rb",
- "lib/irb/lc/.document",
- "lib/irb/lc/error.rb",
- "lib/irb/lc/help-message",
- "lib/irb/lc/ja/encoding_aliases.rb",
- "lib/irb/lc/ja/error.rb",
- "lib/irb/lc/ja/help-message",
- "lib/irb/locale.rb",
- "lib/irb/magic-file.rb",
- "lib/irb/notifier.rb",
- "lib/irb/output-method.rb",
- "lib/irb/ruby-lex.rb",
- "lib/irb/ruby_logo.aa",
- "lib/irb/src_encoding.rb",
- "lib/irb/version.rb",
- "lib/irb/workspace.rb",
- "lib/irb/ws-for-case-2.rb",
- "lib/irb/xmp.rb",
- "man/irb.1",
- ]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5")
-
- spec.add_dependency "reline", ">= 0.0.1"
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
-end
diff --git a/lib/irb/lc/error.rb b/lib/irb/lc/error.rb
index 798994e92c..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$
@@ -9,63 +8,24 @@
#
#
#
+require "e2mmap"
# :stopdoc:
module IRB
- class UnrecognizedSwitch < StandardError
- def initialize(val)
- super("Unrecognized switch: #{val}")
- end
- end
- class NotImplementedError < StandardError
- def initialize(val)
- super("Need to define `#{val}'")
- end
- end
- class CantReturnToNormalMode < StandardError
- def initialize
- super("Can't return to normal mode.")
- end
- end
- class IllegalParameter < StandardError
- def initialize(val)
- super("Invalid parameter(#{val}).")
- end
- end
- class IrbAlreadyDead < StandardError
- def initialize
- super("Irb is already dead.")
- end
- end
- class IrbSwitchedToCurrentThread < StandardError
- def initialize
- super("Switched to current thread.")
- end
- end
- class NoSuchJob < StandardError
- def initialize(val)
- super("No such job(#{val}).")
- end
- end
- class CantShiftToMultiIrbMode < StandardError
- def initialize
- super("Can't shift to multi irb mode.")
- end
- end
- class CantChangeBinding < StandardError
- def initialize(val)
- super("Can't change binding to (#{val}).")
- end
- end
- class UndefinedPromptMode < StandardError
- def initialize(val)
- super("Undefined prompt mode(#{val}).")
- end
- end
- class IllegalRCGenerator < StandardError
- def initialize
- super("Define illegal RC_NAME_GENERATOR.")
- end
- end
+
+ # exceptions
+ extend Exception2MessageMapper
+ def_exception :UnrecognizedSwitch, "Unrecognized switch: %s"
+ def_exception :NotImplementedError, "Need to define `%s'"
+ def_exception :CantReturnToNormalMode, "Can't return to normal mode."
+ def_exception :IllegalParameter, "Invalid parameter(%s)."
+ def_exception :IrbAlreadyDead, "Irb is already dead."
+ def_exception :IrbSwitchedToCurrentThread, "Switched to current thread."
+ def_exception :NoSuchJob, "No such job(%s)."
+ def_exception :CantShiftToMultiIrbMode, "Can't shift to multi irb mode."
+ def_exception :CantChangeBinding, "Can't change binding to (%s)."
+ def_exception :UndefinedPromptMode, "Undefined prompt mode(%s)."
+ def_exception :IllegalRCGenerator, 'Define illegal RC_NAME_GENERATOR.'
+
end
# :startdoc:
diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message
index a80facc9c5..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
@@ -22,19 +23,15 @@ Usage: irb.rb [options] [programfile] [arguments]
when new workspace was created
--echo Show result(default)
--noecho Don't show result
- --inspect Use `inspect' for output
- --noinspect Don't use inspect for output
- --multiline Use multiline editor module
- --nomultiline Don't use multiline editor module
- --singleline Use singleline editor module
- --nosingleline Don't use singleline editor module
- --colorize Use colorization
- --nocolorize Don't use colorization
+ --inspect Use `inspect' for output (default except for bc mode)
+ --noinspect Don't use inspect for output
+ --readline Use Readline extension module
+ --noreadline Don't use Readline extension module
--prompt prompt-mode/--prompt-mode prompt-mode
Switch prompt mode. Pre-defined prompt modes are
`default', `simple', `xmp' and `inf-ruby'
--inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs.
- Suppresses --multiline and --singleline.
+ Suppresses --readline.
--sample-book-mode/--simple-prompt
Simple prompt mode
--noprompt No prompt mode
@@ -43,6 +40,7 @@ Usage: irb.rb [options] [programfile] [arguments]
--back-trace-limit n
Display backtrace top n and tail n. The default
value is 16.
+ --irb_debug n Set internal debug level to n (not for popular use)
--verbose Show details
--noverbose Don't show details
-v, --version Print the version of irb
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 31ebb3b5f0..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$
@@ -9,64 +8,23 @@
#
#
#
+require "e2mmap"
# :stopdoc:
module IRB
- class UnrecognizedSwitch < StandardError
- def initialize(val)
- super("スイッãƒ(#{val})ãŒåˆ†ã‚Šã¾ã›ã‚“")
- end
- end
- class NotImplementedError < StandardError
- def initialize(val)
- super("`#{val}'ã®å®šç¾©ãŒå¿…è¦ã§ã™")
- end
- end
- class CantReturnToNormalMode < StandardError
- def initialize
- super("Normalãƒ¢ãƒ¼ãƒ‰ã«æˆ»ã‚Œã¾ã›ã‚“.")
- end
- end
- class IllegalParameter < StandardError
- def initialize(val)
- super("パラメータ(#{val})ãŒé–“é•ã£ã¦ã„ã¾ã™.")
- end
- end
- class IrbAlreadyDead < StandardError
- def initialize
- super("Irbã¯æ—¢ã«æ­»ã‚“ã§ã„ã¾ã™.")
- end
- end
- class IrbSwitchedToCurrentThread < StandardError
- def initialize
- super("カレントスレッドã«åˆ‡ã‚Šæ›¿ã‚りã¾ã—ãŸ.")
- end
- end
- class NoSuchJob < StandardError
- def initialize(val)
- super("ãã®ã‚ˆã†ãªã‚¸ãƒ§ãƒ–(#{val})ã¯ã‚りã¾ã›ã‚“.")
- end
- end
- class CantShiftToMultiIrbMode < StandardError
- def initialize
- super("multi-irb modeã«ç§»ã‚Œã¾ã›ã‚“.")
- end
- end
- class CantChangeBinding < StandardError
- def initialize(val)
- super("ãƒã‚¤ãƒ³ãƒ‡ã‚£ãƒ³ã‚°(#{val})ã«å¤‰æ›´ã§ãã¾ã›ã‚“.")
- end
- end
- class UndefinedPromptMode < StandardError
- def initialize(val)
- super("プロンプトモード(#{val})ã¯å®šç¾©ã•れã¦ã„ã¾ã›ã‚“.")
- end
- end
- class IllegalRCGenerator < StandardError
- def initialize
- super("RC_NAME_GENERATORãŒæ­£ã—ã定義ã•れã¦ã„ã¾ã›ã‚“.")
- end
- end
+ # exceptions
+ extend Exception2MessageMapper
+ def_exception :UnrecognizedSwitch, 'スイッãƒ(%s)ãŒåˆ†ã‚Šã¾ã›ã‚“'
+ def_exception :NotImplementedError, '`%s\'ã®å®šç¾©ãŒå¿…è¦ã§ã™'
+ def_exception :CantReturnToNormalMode, 'Normalãƒ¢ãƒ¼ãƒ‰ã«æˆ»ã‚Œã¾ã›ã‚“.'
+ def_exception :IllegalParameter, 'パラメータ(%s)ãŒé–“é•ã£ã¦ã„ã¾ã™.'
+ def_exception :IrbAlreadyDead, 'Irbã¯æ—¢ã«æ­»ã‚“ã§ã„ã¾ã™.'
+ def_exception :IrbSwitchedToCurrentThread, 'カレントスレッドã«åˆ‡ã‚Šæ›¿ã‚りã¾ã—ãŸ.'
+ def_exception :NoSuchJob, 'ãã®ã‚ˆã†ãªã‚¸ãƒ§ãƒ–(%s)ã¯ã‚りã¾ã›ã‚“.'
+ def_exception :CantShiftToMultiIrbMode, 'multi-irb modeã«ç§»ã‚Œã¾ã›ã‚“.'
+ def_exception :CantChangeBinding, 'ãƒã‚¤ãƒ³ãƒ‡ã‚£ãƒ³ã‚°(%s)ã«å¤‰æ›´ã§ãã¾ã›ã‚“.'
+ def_exception :UndefinedPromptMode, 'プロンプトモード(%s)ã¯å®šç¾©ã•れã¦ã„ã¾ã›ã‚“.'
+ def_exception :IllegalRCNameGenerator, 'RC_NAME_GENERATORãŒæ­£ã—ã定義ã•れã¦ã„ã¾ã›ã‚“.'
end
# :startdoc:
# vim:fileencoding=utf-8
diff --git a/lib/irb/lc/ja/help-message b/lib/irb/lc/ja/help-message
index 9794a8e24e..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 を追加ã™ã‚‹.
@@ -21,21 +22,16 @@ Usage: irb.rb [options] [programfile] [arguments]
オブジェクトã®ä½œæˆæ–¹æ³•ã‚’ 0 ã‹ã‚‰ 3 ã®ã„ãšã‚Œã‹ã«è¨­å®šã™ã‚‹.
--echo å®Ÿè¡Œçµæžœã‚’表示ã™ã‚‹(デフォルト).
--noecho å®Ÿè¡Œçµæžœã‚’表示ã—ãªã„.
- --inspect çµæžœå‡ºåŠ›ã«inspectを用ã„ã‚‹.
+ --inspect çµæžœå‡ºåŠ›ã«inspectを用ã„ã‚‹(bcモード以外ã¯ãƒ‡ãƒ•ォルト).
--noinspect çµæžœå‡ºåŠ›ã«inspectを用ã„ãªã„.
- --multiline マルãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’利用ã™ã‚‹.
- --nomultiline マルãƒãƒ©ã‚¤ãƒ³ã‚¨ãƒ‡ã‚£ã‚¿ã‚’利用ã—ãªã„.
- --singleline シングルラインエディタを利用ã™ã‚‹.
- --nosingleline シングルラインエディタを利用ã—ãªã„.
- --colorize 色付ã‘を利用ã™ã‚‹.
- --nocolorize 色付ã‘を利用ã—ãªã„.
+ --readline readlineライブラリを利用ã™ã‚‹.
+ --noreadline readlineライブラリを利用ã—ãªã„.
--prompt prompt-mode/--prompt-mode prompt-mode
プロンプトモードを切替ãˆã¾ã™. ç¾åœ¨å®šç¾©ã•れã¦ã„るプ
ロンプトモードã¯, default, simple, xmp, inf-rubyãŒ
用æ„ã•れã¦ã„ã¾ã™.
--inf-ruby-mode emacsã®inf-ruby-mode用ã®ãƒ—ロンプト表示を行ãªã†. 特
- ã«æŒ‡å®šãŒãªã„é™ã‚Š, シングルラインエディタã¨ãƒžãƒ«ãƒãƒ©
- インエディタã¯ä½¿ã‚ãªããªã‚‹.
+ ã«æŒ‡å®šãŒãªã„é™ã‚Š, readlineライブラリã¯ä½¿ã‚ãªããªã‚‹.
--sample-book-mode/--simple-prompt
éžå¸¸ã«ã‚·ãƒ³ãƒ—ルãªãƒ—ロンプトを用ã„るモードã§ã™.
--noprompt プロンプト表示を行ãªã‚ãªã„.
@@ -46,6 +42,8 @@ Usage: irb.rb [options] [programfile] [arguments]
ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹è¡¨ç¤ºã‚’ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã®é ­ã‹ã‚‰ n, 後ã‚
ã‹ã‚‰nã ã‘行ãªã†. デフォルトã¯16
+ --irb_debug n irbã®ãƒ‡ãƒãƒƒã‚°ãƒ¬ãƒ™ãƒ«ã‚’nã«è¨­å®šã™ã‚‹(éžæŽ¨å¥¨).
+
--verbose 詳細ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã™ã‚‹.
--noverbose 詳細ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã—ãªã„(デフォルト).
-v, --version irbã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’表示ã™ã‚‹.
diff --git a/lib/irb/locale.rb b/lib/irb/locale.rb
index ba833eced4..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$
@@ -21,7 +20,6 @@ module IRB # :nodoc:
LOCALE_DIR = "/lc/"
@@legacy_encoding_alias_map = {}.freeze
- @@loaded = []
def initialize(locale = nil)
@lang = @territory = @encoding_name = @modifier = nil
@@ -32,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
@@ -108,10 +106,7 @@ module IRB # :nodoc:
def load(file, priv=nil)
found = find(file)
if found
- unless @@loaded.include?(found)
- @@loaded << found # cache
- return real_load(found, priv)
- end
+ return real_load(found, priv)
else
raise LoadError, "No such file to load -- #{file}"
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 d0e413dd68..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$
@@ -10,21 +9,17 @@
#
#
-require_relative "output-method"
+require "e2mmap"
+require "irb/output-method"
module IRB
# An output formatter used internally by the lexer.
module Notifier
- class ErrUndefinedNotifier < StandardError
- def initialize(val)
- super("undefined notifier level: #{val} is specified")
- end
- end
- class ErrUnrecognizedLevel < StandardError
- def initialize(val)
- super("unrecognized notifier level: #{val} is specified")
- end
- end
+ extend Exception2MessageMapper
+ def_exception :ErrUndefinedNotifier,
+ "undefined notifier level: %d is specified"
+ def_exception :ErrUnrecognizedLevel,
+ "unrecognized notifier level: %s is specified"
# Define a new Notifier output source, returning a new CompositeNotifier
# with the given +prefix+ and +output_method+.
@@ -117,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)
@@ -166,10 +161,10 @@ module IRB
@level_notifier = value
when Integer
l = @notifiers[value]
- raise ErrUndefinedNotifier, value unless l
+ Notifier.Raise ErrUndefinedNotifier, value unless l
@level_notifier = l
else
- raise ErrUnrecognizedLevel, value unless l
+ Notifier.Raise ErrUnrecognizedLevel, value unless l
end
end
@@ -178,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
@@ -216,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 3fda708cb0..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$
@@ -10,21 +9,21 @@
#
#
+require "e2mmap"
+
module IRB
# An abstract output class for IO in irb. This is mainly used internally by
# IRB::Notifier. You can define your own output method to use with Irb.new,
# or Context.new
class OutputMethod
- class NotImplementedError < StandardError
- def initialize(val)
- super("Need to define `#{val}'")
- end
- end
+ extend Exception2MessageMapper
+ def_exception :NotImplementedError, "Need to define `%s'"
+
# Open this method to implement your own output method, raises a
# NotImplementedError if you don't define #print in your own class.
def print(*opts)
- raise NotImplementedError, "print"
+ OutputMethod.Raise NotImplementedError, "print"
end
# Prints the given +opts+, with a newline delimiter.
@@ -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 b4c31c16fe..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$
@@ -10,51 +9,74 @@
#
#
-require "ripper"
+require "e2mmap"
+require "irb/slex"
+require "irb/ruby-token"
# :stopdoc:
class RubyLex
- class TerminateLineInput < StandardError
- def initialize
- super("Terminate Line Input")
+ 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 RubyToken
+
+ class << self
+ attr_accessor :debug_level
+ def debug?
+ @debug_level > 0
end
end
+ @debug_level = 0
def initialize
+ lex_init
+ set_input(STDIN)
+
+ @seek = 0
@exp_line_no = @line_no = 1
+ @base_char_no = 0
+ @char_no = 0
+ @rests = []
+ @readed = []
+ @here_readed = []
+
@indent = 0
+ @indent_stack = []
+ @lex_state = EXPR_BEG
+ @space_seen = false
+ @here_header = false
+ @post_symbeg = false
+
@continue = false
@line = ""
+
+ @skip_space = false
+ @readed_auto_clean_up = false
+ @exception_on_syntax_error = true
+
@prompt = nil
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 @io.respond_to?(:check_termination)
- @io.check_termination do |code|
- code.gsub!(/\s*\z/, '').concat("\n")
- ltype, indent, continue, code_block_open = check_state(code)
- if ltype or indent > 0 or continue or code_block_open
- false
- else
- true
- end
- end
- end
- if @io.respond_to?(:dynamic_prompt)
- @io.dynamic_prompt do |lines|
- lines << '' if lines.empty?
- result = []
- lines.each_index { |i|
- c = lines[0..i].map{ |l| l + "\n" }.join
- ltype, indent, continue, code_block_open = check_state(c)
- result << @prompt.call(ltype, indent, continue || code_block_open, @line_no + i)
- }
- result
- end
- end
if p.respond_to?(:call)
@input = p
elsif block_given?
@@ -64,54 +86,119 @@ class RubyLex
end
end
- def set_prompt(p = nil, &block)
- p = block if block_given?
- if p.respond_to?(:call)
- @prompt = p
+ def get_readed
+ if idx = @readed.rindex("\n")
+ @base_char_no = @readed.size - (idx + 1)
else
- @prompt = Proc.new{print p}
+ @base_char_no += @readed.size
end
+
+ readed = @readed.join("")
+ @readed = []
+ readed
end
- def ripper_lex_without_warning(code)
- verbose, $VERBOSE = $VERBOSE, nil
- tokens = Ripper.lex(code)
- $VERBOSE = verbose
- tokens
+ def getc
+ while @rests.empty?
+ @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 set_auto_indent(context)
- if @io.respond_to?(:auto_indent) and context.auto_indent_mode
- @io.auto_indent do |lines, line_index, byte_pointer, is_newline|
- if is_newline
- md = lines[line_index - 1].match(/(\A +)/)
- prev_spaces = md.nil? ? 0 : md[1].count(' ')
- @tokens = ripper_lex_without_warning(lines[0..line_index].join("\n"))
- depth_difference = check_newline_depth_difference
- prev_spaces + depth_difference * 2
- else
- code = line_index.zero? ? '' : lines[0..(line_index - 1)].map{ |l| l + "\n" }.join
- last_line = lines[line_index]&.byteslice(0, byte_pointer)
- code += last_line if last_line
- @tokens = ripper_lex_without_warning(code)
- corresponding_token_depth = check_corresponding_token_depth
- if corresponding_token_depth
- corresponding_token_depth
- else
- nil
- end
- 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 check_state(code)
- @tokens = ripper_lex_without_warning(code)
- ltype = process_literal_type
- indent = process_nesting_level
- continue = process_continue
- code_block_open = check_code_block(code)
- [ltype, indent, continue, code_block_open]
+ 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.chars.to_a
+ 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
@@ -122,11 +209,20 @@ class RubyLex
def initialize_input
@ltype = nil
+ @quoted = nil
@indent = 0
+ @indent_stack = []
+ @lex_state = EXPR_BEG
+ @space_seen = false
+ @here_header = false
+
@continue = false
+ @post_symbeg = false
+
+ prompt
+
@line = ""
@exp_line_no = @line_no
- @code_block_open = false
end
def each_top_level_statement
@@ -134,14 +230,13 @@ class RubyLex
catch(:TERM_INPUT) do
loop do
begin
+ @continue = false
prompt
unless l = lex
throw :TERM_INPUT if @line == ''
else
- @line_no += l.count("\n")
- next if l == "\n"
@line.concat l
- if @code_block_open or @ltype or @continue or @indent > 0
+ if @ltype or @continue or @indent > 0
next
end
end
@@ -149,337 +244,926 @@ class RubyLex
@line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
- break if @io.eof?
+ 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
- line = @input.call
- if @io.respond_to?(:check_termination)
- return line # multiline
- end
- code = @line + (line.nil? ? '' : line)
- code.gsub!(/\s*\z/, '').concat("\n")
- @tokens = ripper_lex_without_warning(code)
- @continue = process_continue
- @code_block_open = check_code_block(code)
- @indent = process_nesting_level
- @ltype = process_literal_type
- line
+ 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?
+ nil
+ else
+ line
+ end
end
- def process_continue
- # last token is always newline
- if @tokens.size >= 2 and @tokens[-2][1] == :on_regexp_end
- # end of regexp literal
- return false
- elsif @tokens.size >= 2 and @tokens[-2][1] == :on_semicolon
- return false
- elsif @tokens.size >= 2 and @tokens[-2][1] == :on_kw and ['begin', 'else', 'ensure'].include?(@tokens[-2][2])
- return false
- elsif !@tokens.empty? and @tokens.last[2] == "\\\n"
- return true
- elsif @tokens.size >= 1 and @tokens[-1][1] == :on_heredoc_end # "EOH\n"
- return false
- elsif @tokens.size >= 2 and defined?(Ripper::EXPR_BEG) and @tokens[-2][3].anybits?(Ripper::EXPR_BEG | Ripper::EXPR_FNAME)
- # end of literal except for regexp
- return true
- end
- false
+ def token
+ @prev_seek = @seek
+ @prev_line_no = @line_no
+ @prev_char_no = @char_no
+ begin
+ begin
+ tk = @OP.match(self)
+ @space_seen = tk.kind_of?(TkSPACE)
+ @lex_state = EXPR_END if @post_symbeg && tk.kind_of?(TkOp)
+ @post_symbeg = tk.kind_of?(TkSYMBEG)
+ rescue SyntaxError
+ raise if @exception_on_syntax_error
+ tk = TkError.new(@seek, @line_no, @char_no)
+ end
+ end while @skip_space and tk.kind_of?(TkSPACE)
+ if @readed_auto_clean_up
+ get_readed
+ end
+ tk
end
- def check_code_block(code)
- return true if @tokens.empty?
- if @tokens.last[1] == :on_heredoc_beg
- return true
+ ENINDENT_CLAUSE = [
+ "case", "class", "def", "do", "for", "if",
+ "module", "unless", "until", "while", "begin"
+ ]
+ DEINDENT_CLAUSE = ["end"
+ ]
+
+ PERCENT_LTYPE = {
+ "q" => "\'",
+ "Q" => "\"",
+ "x" => "\`",
+ "r" => "/",
+ "w" => "]",
+ "W" => "]",
+ "i" => "]",
+ "I" => "]",
+ "s" => ":"
+ }
+
+ PERCENT_PAREN = {
+ "{" => "}",
+ "[" => "]",
+ "<" => ">",
+ "(" => ")"
+ }
+
+ 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
- begin # check if parser error are available
- verbose, $VERBOSE = $VERBOSE, nil
- case RUBY_ENGINE
- when 'jruby'
- JRuby.compile_ir(code)
+ @OP.def_rules(" ", "\t", "\f", "\r", "\13") do |op, io|
+ @space_seen = true
+ while getc =~ /[ \t\f\r\13]/; end
+ ungetc
+ Token(TkSPACE)
+ 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 = "="
+ until getc == "\n"; end
+ until peek_equal?("=end") && peek(4) =~ /\s/
+ until getc == "\n"; end
+ end
+ gets
+ @ltype = nil
+ Token(TkRD_COMMENT)
+ end
+
+ @OP.def_rule("\n") do |op, io|
+ print "\\n\n" if RubyLex.debug?
+ case @lex_state
+ when EXPR_BEG, EXPR_FNAME, EXPR_DOT
+ @continue = true
else
- RubyVM::InstructionSequence.compile(code)
- end
- rescue SyntaxError => e
- case e.message
- when /unterminated (?:string|regexp) meets end of file/
- # "unterminated regexp meets end of file"
- #
- # example:
- # /
- #
- # "unterminated string meets end of file"
- #
- # example:
- # '
- return true
- when /syntax error, unexpected end-of-input/
- # "syntax error, unexpected end-of-input, expecting keyword_end"
- #
- # example:
- # if ture
- # hoge
- # if false
- # fuga
- # end
- return true
- when /syntax error, unexpected keyword_end/
- # "syntax error, unexpected keyword_end"
- #
- # example:
- # if (
- # end
- #
- # example:
- # end
- return false
- when /syntax error, unexpected '\.'/
- # "syntax error, unexpected '.'"
- #
- # example:
- # .
- return false
- when /unexpected tREGEXP_BEG/
- # "syntax error, unexpected tREGEXP_BEG, expecting keyword_do or '{' or '('"
- #
- # example:
- # method / f /
- return false
+ @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
- ensure
- $VERBOSE = verbose
+ @here_header = false
+ @here_readed = []
+ Token(TkNL)
end
- if defined?(Ripper::EXPR_BEG)
- last_lex_state = @tokens.last[3]
- if last_lex_state.allbits?(Ripper::EXPR_BEG)
- return false
- elsif last_lex_state.allbits?(Ripper::EXPR_DOT)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_CLASS)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_FNAME)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_VALUE)
- return true
- elsif last_lex_state.allbits?(Ripper::EXPR_ARG)
- return false
+ @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
- false
- 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
+ if (ch == '\\')
+ read_escape
+ end
+ @lex_state = EXPR_END
+ Token(TkINTEGER)
+ end
+ end
+ end
+
+ @OP.def_rules("&", "&&", "|", "||") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op)
+ end
- def process_nesting_level
- indent = 0
- @tokens.each_with_index { |t, index|
- case t[1]
- when :on_lbracket, :on_lbrace, :on_lparen
- indent += 1
- when :on_rbracket, :on_rbrace, :on_rparen
- indent -= 1
- when :on_kw
- next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
- case t[2]
- when 'do'
- if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN | Ripper::EXPR_ARG)
- # method_with_block do; end
- indent += 1
+ @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
else
- # while cond do; end # also "until" or "for"
- # This "do" doesn't increment indent because "while" already
- # incremented.
+ @lex_state = EXPR_BEG
end
- when 'def', 'case', 'for', 'begin', 'class', 'module'
- indent += 1
- when 'if', 'unless', 'while', 'until'
- # postfix if/unless/while/until/rescue must be Ripper::EXPR_LABEL
- indent += 1 unless t[3].allbits?(Ripper::EXPR_LABEL)
- when 'end'
- indent -= 1
+ elsif @lex_state != EXPR_END and peek(0) =~ /[0-9]/
+ throw :RET, identify_number
+ 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
- # percent literals are not indented
- }
- indent
+ end
+
+ @OP.def_rules("..", "...") do
+ |op, io|
+ @lex_state = EXPR_BEG
+ Token(op)
+ end
+
+ lex_int2
end
- def check_newline_depth_difference
- depth_difference = 0
- @tokens.each_with_index do |t, index|
- case t[1]
- when :on_ignored_nl, :on_nl, :on_comment
- if index != (@tokens.size - 1)
- depth_difference = 0
+ 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|
+ 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
+ |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
- next
- when :on_sp
- next
- end
- case t[1]
- when :on_lbracket, :on_lbrace, :on_lparen
- depth_difference += 1
- when :on_rbracket, :on_rbrace, :on_rparen
- depth_difference -= 1
- when :on_kw
- next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
- case t[2]
- when 'do'
- if index > 0 and @tokens[index - 1][3].anybits?(Ripper::EXPR_CMDARG | Ripper::EXPR_ENDFN | Ripper::EXPR_ARG)
- # method_with_block do; end
- depth_difference += 1
+ @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
+ read_escape
+ 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("") do
+ |op, io|
+ printf "MATCH: start %s: %s\n", op, io.inspect if RubyLex.debug?
+ if peek(0) =~ /[0-9]/
+ t = identify_number
+ elsif peek(0) =~ /[^\x00-\/:-@\[-^`{-\x7F]/
+ t = identify_identifier
+ end
+ printf "MATCH: end %s: %s\n", op, io.inspect if RubyLex.debug?
+ t
+ end
+
+ p @OP if 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]/
+ while getc =~ /[0-9]/; end
+ ungetc
+ Token(TkNTH_REF)
+ when /\w/
+ ungetc
+ ungetc
+ identify_identifier
+ else
+ ungetc
+ Token("$")
+ end
+ 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) =~ /[^\x00-\/:-@\[-^`{-\x7F]/
+ print ":", ch, ":" if 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 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)
+ # check for ``class = val'' etc.
+ valid = true
+ case token
+ when "class"
+ valid = false unless peek_match?(/^\s*(<<|\w|::)/)
+ when "def"
+ valid = false if peek_match?(/^\s*(([+\-\/*&\|^]|<<|>>|\|\||\&\&)=|\&\&|\|\|)/)
+ when "do"
+ valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&)/)
+ when *ENINDENT_CLAUSE
+ valid = false if peek_match?(/^\s*([+\-\/*]?=|\*|<|>|\&|\|)/)
+ else
+ # no nothing
+ end
+ if valid
+ if token == "do"
+ if ![TkFOR, TkWHILE, TkUNTIL].include?(@indent_stack.last)
+ @indent += 1
+ @indent_stack.push token_c
+ end
+ else
+ @indent += 1
+ @indent_stack.push token_c
+ end
+ end
+
+ elsif DEINDENT_CLAUSE.include?(token)
+ @indent -= 1
+ @indent_stack.pop
+ end
+ @lex_state = trans[0]
else
- # while cond do; end # also "until" or "for"
- # This "do" doesn't increment indent because "while" already
- # incremented.
- end
- when 'def', 'case', 'for', 'begin', 'class', 'module'
- depth_difference += 1
- when 'if', 'unless', 'while', 'until'
- # postfix if/unless/while/until/rescue must be Ripper::EXPR_LABEL
- unless t[3].allbits?(Ripper::EXPR_LABEL)
- depth_difference += 1
+ @lex_state = EXPR_END
end
- when 'else', 'elsif', 'rescue', 'ensure', 'when', 'in'
- depth_difference += 1
end
+ return Token(token_c, token)
end
end
- depth_difference
+
+ 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
+ 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 check_corresponding_token_depth
- corresponding_token_depth = nil
- is_first_spaces_of_line = true
- is_first_printable_of_line = true
- spaces_of_nest = []
- spaces_at_line_head = 0
- @tokens.each_with_index do |t, index|
- case t[1]
- when :on_ignored_nl, :on_nl, :on_comment
- corresponding_token_depth = nil
- spaces_at_line_head = 0
- is_first_spaces_of_line = true
- is_first_printable_of_line = true
- next
- when :on_sp
- spaces_at_line_head = t[2].count(' ') if is_first_spaces_of_line
- is_first_spaces_of_line = false
- next
- end
- case t[1]
- when :on_lbracket, :on_lbrace, :on_lparen
- spaces_of_nest.push(spaces_at_line_head)
- when :on_rbracket, :on_rbrace, :on_rparen
- if is_first_printable_of_line
- corresponding_token_depth = spaces_of_nest.pop
- else
- spaces_of_nest.pop
- corresponding_token_depth = nil
+ def identify_here_document
+ ch = getc
+ if ch == "-"
+ ch = getc
+ indent = true
+ end
+ if /['"`]/ =~ ch
+ lt = ch
+ quoted = ""
+ while (c = getc) && c != lt
+ quoted.concat c
+ end
+ else
+ 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
+
+ @here_header = false
+
+ line = ""
+ while ch = getc
+ if ch == "\n"
+ if line == quoted
+ break
end
- when :on_kw
- next if index > 0 and @tokens[index - 1][3].allbits?(Ripper::EXPR_FNAME)
- case t[2]
- when 'def', 'do', 'case', 'for', 'begin', 'class', 'module'
- spaces_of_nest.push(spaces_at_line_head)
- when 'if', 'unless', 'while', 'until'
- # postfix if/unless/while/until/rescue must be Ripper::EXPR_LABEL
- unless t[3].allbits?(Ripper::EXPR_LABEL)
- spaces_of_nest.push(spaces_at_line_head)
+ line = ""
+ else
+ line.concat ch unless indent && line == "" && /\s/ =~ ch
+ if @ltype != "'" && ch == "#" && peek(0) == "{"
+ identify_string_dvar
+ end
+ end
+ end
+
+ @here_header = true
+ @here_readed.concat reserve
+ while ch = reserve.pop
+ ungetc ch
+ end
+
+ @ltype = ltback
+ @lex_state = EXPR_END
+ Token(Ltype2Token[lt])
+ end
+
+ def identify_quotation
+ ch = getc
+ if lt = PERCENT_LTYPE[ch]
+ ch = getc
+ elsif ch =~ /\W/
+ lt = "\""
+ else
+ RubyLex.fail SyntaxError, "unknown type of %string"
+ end
+ @quoted = ch unless @quoted = PERCENT_PAREN[ch]
+ identify_string(lt, @quoted)
+ end
+
+ def identify_number
+ @lex_state = EXPR_END
+
+ if peek(0) == "0" && peek(1) !~ /[.eE]/
+ 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]/
+ RubyLex.fail SyntaxError, "Invalid octal digit"
+ else
+ return Token(TkINTEGER)
+ end
+
+ len0 = true
+ non_digit = false
+ while ch = getc
+ if match =~ ch
+ if ch == "_"
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{ch}' in number"
+ else
+ non_digit = ch
+ end
+ else
+ non_digit = false
+ len0 = false
end
- when 'else', 'elsif', 'rescue', 'ensure', 'when', 'in'
- corresponding_token_depth = spaces_of_nest.last
- when 'end'
- if is_first_printable_of_line
- corresponding_token_depth = spaces_of_nest.pop
+ else
+ ungetc
+ if len0
+ RubyLex.fail SyntaxError, "numeric literal without digits"
+ end
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ break
+ end
+ end
+ return Token(TkINTEGER)
+ end
+
+ type = TkINTEGER
+ allow_point = true
+ allow_e = true
+ non_digit = false
+ while ch = getc
+ case ch
+ when /[0-9]/
+ non_digit = false
+ when "_"
+ non_digit = ch
+ when allow_point && "."
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ type = TkFLOAT
+ if peek(0) !~ /[0-9]/
+ type = TkINTEGER
+ ungetc
+ break
+ end
+ allow_point = false
+ when allow_e && "e", allow_e && "E"
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ type = TkFLOAT
+ if peek(0) =~ /[+-]/
+ getc
+ end
+ allow_e = false
+ allow_point = false
+ non_digit = ch
+ else
+ if non_digit
+ RubyLex.fail SyntaxError, "trailing `#{non_digit}' in number"
+ end
+ ungetc
+ break
+ end
+ end
+ Token(type)
+ end
+
+ def identify_string(ltype, quoted = ltype)
+ @ltype = ltype
+ @quoted = quoted
+ subtype = nil
+ begin
+ nest = 0
+ while ch = getc
+ if @quoted == ch and nest == 0
+ break
+ elsif @ltype != "'" && ch == "#" && peek(0) == "{"
+ identify_string_dvar
+ elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
+ subtype = true
+ elsif ch == '\\' and @ltype == "'" #'
+ case ch = getc
+ when "\\", "\n", "'"
else
- spaces_of_nest.pop
- corresponding_token_depth = nil
+ ungetc
end
+ elsif ch == '\\' #'
+ read_escape
end
+ if PERCENT_PAREN.values.include?(@quoted)
+ if PERCENT_PAREN[ch] == @quoted
+ nest += 1
+ elsif ch == @quoted
+ nest -= 1
+ end
+ end
+ end
+ if @ltype == "/"
+ while /[imxoesun]/ =~ peek(0)
+ getc
+ end
+ end
+ if subtype
+ Token(DLtype2Token[ltype])
+ else
+ Token(Ltype2Token[ltype])
end
- is_first_spaces_of_line = false
- is_first_printable_of_line = false
+ ensure
+ @ltype = nil
+ @quoted = nil
+ @lex_state = EXPR_END
end
- corresponding_token_depth
end
- def check_string_literal
- i = 0
- start_token = []
- end_type = []
- while i < @tokens.size
- t = @tokens[i]
- case t[1]
- when :on_tstring_beg
- start_token << t
- end_type << [:on_tstring_end, :on_label_end]
- when :on_regexp_beg
- start_token << t
- end_type << :on_regexp_end
- when :on_symbeg
- acceptable_single_tokens = %i{on_ident on_const on_op on_cvar on_ivar on_gvar on_kw}
- if (i + 1) < @tokens.size and acceptable_single_tokens.all?{ |t| @tokens[i + 1][1] != t }
- start_token << t
- end_type << :on_tstring_end
+ def identify_string_dvar
+ begin
+ getc
+
+ reserve_continue = @continue
+ reserve_ltype = @ltype
+ reserve_indent = @indent
+ reserve_indent_stack = @indent_stack
+ reserve_state = @lex_state
+ reserve_quoted = @quoted
+
+ @ltype = nil
+ @quoted = nil
+ @indent = 0
+ @indent_stack = []
+ @lex_state = EXPR_BEG
+
+ loop do
+ @continue = false
+ prompt
+ tk = token
+ if @ltype or @continue or @indent >= 0
+ next
end
- when :on_backtick
- start_token << t
- end_type << :on_tstring_end
- when :on_qwords_beg, :on_words_beg, :on_qsymbols_beg, :on_symbols_beg
- start_token << t
- end_type << :on_tstring_end
- when :on_heredoc_beg
- start_token << t
- end_type << :on_heredoc_end
- when *end_type.last
- start_token.pop
- end_type.pop
- end
- i += 1
- end
- start_token.last.nil? ? '' : start_token.last
+ break if tk.kind_of?(TkRBRACE)
+ end
+ ensure
+ @continue = reserve_continue
+ @ltype = reserve_ltype
+ @indent = reserve_indent
+ @indent_stack = reserve_indent_stack
+ @lex_state = reserve_state
+ @quoted = reserve_quoted
+ end
end
- def process_literal_type
- start_token = check_string_literal
- case start_token[1]
- when :on_tstring_beg
- case start_token[2]
- when ?" then ?"
- when /^%.$/ then ?"
- when /^%Q.$/ then ?"
- when ?' then ?'
- when /^%q.$/ then ?'
- end
- when :on_regexp_beg then ?/
- when :on_symbeg then ?:
- when :on_backtick then ?`
- when :on_qwords_beg then ?]
- when :on_words_beg then ?]
- when :on_qsymbols_beg then ?]
- when :on_symbols_beg then ?]
- when :on_heredoc_beg
- start_token[2] =~ /<<[-~]?(['"`])[_a-zA-Z0-9]+\1/
- case $1
- when ?" then ?"
- when ?' then ?'
- when ?` then ?`
- else ?"
+ def identify_comment
+ @ltype = "#"
+
+ while ch = getc
+ if ch == "\n"
+ @ltype = nil
+ ungetc
+ break
+ end
+ end
+ return Token(TkCOMMENT)
+ end
+
+ def read_escape
+ case ch = getc
+ when "\n", "\r", "\f"
+ when "\\", "n", "t", "r", "f", "v", "a", "e", "b", "s" #"
+ when /[0-7]/
+ ungetc ch
+ 3.times do
+ case ch = getc
+ when /[0-7]/
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
+ end
+
+ when "x"
+ 2.times do
+ case ch = getc
+ when /[0-9a-fA-F]/
+ when nil
+ break
+ else
+ ungetc
+ break
+ end
+ end
+
+ when "M"
+ if (ch = getc) != '-'
+ ungetc
+ else
+ if (ch = getc) == "\\" #"
+ read_escape
+ end
+ end
+
+ when "C", "c" #, "^"
+ if ch == "C" and (ch = getc) != "-"
+ ungetc
+ elsif (ch = getc) == "\\" #"
+ read_escape
end
else
- nil
+ # other characters
end
end
end
diff --git a/lib/irb/ruby-token.rb b/lib/irb/ruby-token.rb
new file mode 100644
index 0000000000..a80d81c9a5
--- /dev/null
+++ b/lib/irb/ruby-token.rb
@@ -0,0 +1,266 @@
+#
+# irb/ruby-token.rb - ruby tokens
+# $Release Version: 0.9.6$
+# $Revision$
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+#
+# --
+#
+#
+#
+# :stopdoc:
+module RubyToken
+ 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
+
+ class Token
+ def initialize(seek, line_no, char_no)
+ @seek = seek
+ @line_no = line_no
+ @char_no = char_no
+ end
+ attr_reader :seek, :line_no, :char_no
+ end
+
+ class TkNode < Token
+ def initialize(seek, line_no, char_no)
+ super
+ end
+ attr_reader :node
+ end
+
+ class TkId < Token
+ def initialize(seek, line_no, char_no, name)
+ super(seek, line_no, char_no)
+ @name = name
+ end
+ attr_reader :name
+ end
+
+ class TkVal < Token
+ def initialize(seek, line_no, char_no, value = nil)
+ super(seek, line_no, char_no)
+ @value = value
+ end
+ attr_reader :value
+ end
+
+ class TkOp < Token
+ attr_accessor :name
+ 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
+ end
+ attr_reader :op
+ end
+
+ class TkUnknownChar < Token
+ def initialize(seek, line_no, char_no, id)
+ super(seek, line_no, char_no)
+ @name = name
+ end
+ attr_reader :name
+ end
+
+ class TkError < Token
+ end
+
+ def Token(token, value = nil)
+ case token
+ when String
+ if (tk = TkReading2Token[token]).nil?
+ IRB.fail TkReading2TokenNoKey, token
+ end
+ tk = Token(tk[0], value)
+ if tk.kind_of?(TkOp)
+ tk.name = token
+ end
+ return tk
+ when Symbol
+ if (tk = TkSymbol2Token[token]).nil?
+ IRB.fail TkSymbol2TokenNoKey, token
+ end
+ return Token(tk[0], value)
+ else
+ if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
+ token.new(@prev_seek, @prev_line_no, @prev_char_no)
+ else
+ token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
+ end
+ end
+ end
+
+ TokenDefinitions = [
+ [:TkCLASS, TkId, "class", EXPR_CLASS],
+ [:TkMODULE, TkId, "module", EXPR_BEG],
+ [:TkDEF, TkId, "def", EXPR_FNAME],
+ [:TkUNDEF, TkId, "undef", EXPR_FNAME],
+ [:TkBEGIN, TkId, "begin", EXPR_BEG],
+ [:TkRESCUE, TkId, "rescue", EXPR_MID],
+ [:TkENSURE, TkId, "ensure", EXPR_BEG],
+ [:TkEND, TkId, "end", EXPR_END],
+ [:TkIF, TkId, "if", EXPR_BEG, :TkIF_MOD],
+ [:TkUNLESS, TkId, "unless", EXPR_BEG, :TkUNLESS_MOD],
+ [:TkTHEN, TkId, "then", EXPR_BEG],
+ [:TkELSIF, TkId, "elsif", EXPR_BEG],
+ [:TkELSE, TkId, "else", EXPR_BEG],
+ [:TkCASE, TkId, "case", EXPR_BEG],
+ [:TkWHEN, TkId, "when", EXPR_BEG],
+ [:TkWHILE, TkId, "while", EXPR_BEG, :TkWHILE_MOD],
+ [:TkUNTIL, TkId, "until", EXPR_BEG, :TkUNTIL_MOD],
+ [:TkFOR, TkId, "for", EXPR_BEG],
+ [:TkBREAK, TkId, "break", EXPR_END],
+ [:TkNEXT, TkId, "next", EXPR_END],
+ [:TkREDO, TkId, "redo", EXPR_END],
+ [:TkRETRY, TkId, "retry", EXPR_END],
+ [:TkIN, TkId, "in", EXPR_BEG],
+ [:TkDO, TkId, "do", EXPR_BEG],
+ [:TkRETURN, TkId, "return", EXPR_MID],
+ [:TkYIELD, TkId, "yield", EXPR_END],
+ [:TkSUPER, TkId, "super", EXPR_END],
+ [:TkSELF, TkId, "self", EXPR_END],
+ [:TkNIL, TkId, "nil", EXPR_END],
+ [:TkTRUE, TkId, "true", EXPR_END],
+ [:TkFALSE, TkId, "false", EXPR_END],
+ [:TkAND, TkId, "and", EXPR_BEG],
+ [:TkOR, TkId, "or", EXPR_BEG],
+ [:TkNOT, TkId, "not", EXPR_BEG],
+ [:TkIF_MOD, TkId],
+ [:TkUNLESS_MOD, TkId],
+ [:TkWHILE_MOD, TkId],
+ [:TkUNTIL_MOD, TkId],
+ [:TkALIAS, TkId, "alias", EXPR_FNAME],
+ [:TkDEFINED, TkId, "defined?", EXPR_END],
+ [:TklBEGIN, TkId, "BEGIN", EXPR_END],
+ [:TklEND, TkId, "END", EXPR_END],
+ [:Tk__LINE__, TkId, "__LINE__", EXPR_END],
+ [:Tk__FILE__, TkId, "__FILE__", EXPR_END],
+
+ [:TkIDENTIFIER, TkId],
+ [:TkFID, TkId],
+ [:TkGVAR, TkId],
+ [:TkCVAR, TkId],
+ [:TkIVAR, TkId],
+ [:TkCONSTANT, TkId],
+
+ [:TkINTEGER, TkVal],
+ [:TkFLOAT, TkVal],
+ [:TkSTRING, TkVal],
+ [:TkXSTRING, TkVal],
+ [:TkREGEXP, TkVal],
+ [:TkSYMBOL, 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],
+ [:TkASSOC, TkOp, "=>"],
+ [:TkQUESTION, TkOp, "?"], #?
+ [:TkCOLON, TkOp, ":"], #:
+
+ [:TkfLPAREN], # func( #
+ [:TkfLBRACK], # func[ #
+ [:TkfLBRACE], # func{ #
+ [:TkSTAR], # *arg
+ [:TkAMPER], # &arg #
+ [:TkSYMBEG], # :SYMBOL
+
+ [:TkGT, TkOp, ">"],
+ [:TkLT, TkOp, "<"],
+ [:TkPLUS, 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],
+ [:TkRD_COMMENT],
+ [:TkSPACE],
+ [:TkNL],
+ [:TkEND_OF_SCRIPT],
+
+ [:TkBACKSLASH, TkUnknownChar, "\\"],
+ [:TkAT, TkUnknownChar, "@"],
+ [:TkDOLLAR, TkUnknownChar, "$"],
+ ]
+
+ # {reading => token_class}
+ # {reading => [token_class, *opt]}
+ TkReading2Token = {}
+ TkSymbol2Token = {}
+
+ def RubyToken.def_token(token_n, super_token = Token, reading = nil, *opts)
+ token_n = token_n.id2name if token_n.kind_of?(Symbol)
+ if RubyToken.const_defined?(token_n)
+ IRB.fail AlreadyDefinedToken, token_n
+ end
+ token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}")
+
+ if reading
+ if TkReading2Token[reading]
+ IRB.fail TkReading2TokenDuplicateError, token_n, reading
+ end
+ 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
+end
+# :startdoc:
diff --git a/lib/irb/ruby_logo.aa b/lib/irb/ruby_logo.aa
deleted file mode 100644
index 043e6f85fb..0000000000
--- a/lib/irb/ruby_logo.aa
+++ /dev/null
@@ -1,38 +0,0 @@
-
- -+smJYYN?mm-
- HB"BBYT TQg NggT
- 9Q+g Nm,T 8g NJW
- YS+ N2NJ"Sg N?
- BQg #( gT Nggggk J
- 5j NJ NJ NNge
- #Q #JJ NgT N(
- @j bj mT J
- Bj @/d NJ (
- #q #(( NgT #J
- 5d #(t mT $d
- #q @(@J NJB;
- @( 5d ? HHH H HQmgggggggmN qD
- 5d #uN 2QdH E O
- 5 5JSd Nd NJH @d j
- Fd @J4d s NQH #d (
- #( #o6d Nd NgH #d #d
- 4 B&Od v NgT #d F
- #( 9JGd NH NgUd F
- #d #GJQ d NP $
- #J #U+#Q N Q # j
- j /W BQ+ BQ d NJ NJ
- - NjJH HBIjTQggPJQgW N W k #J
- #J b HYWgggN j s Nag d NN b #d
- #J 5- D s Ngg N d Nd F
- Fd BKH2 #+ s NNgg J Q J ]
- F H @ J N y K(d P I
- F4 E N? #d y #Q NJ E j
- F W Nd q m Bg NxW N(H-
- F d b @ m Hd gW vKJ
- NJ d K d s Bg aT FDd
- b # d N m BQ mV N>
- e5 Nd #d NggggggQWH HHHH NJ -
- m7 NW H N HSVO1z=?11-
- NgTH bB kH WBHWWHBHWmQgg&gggggNNN
- NNggggggNN
-
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
new file mode 100644
index 0000000000..f6c2bd92f5
--- /dev/null
+++ b/lib/irb/slex.rb
@@ -0,0 +1,281 @@
+#
+# irb/slex.rb - simple lex analyzer
+# $Release Version: 0.9.6$
+# $Revision$
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+#
+# --
+#
+#
+#
+
+require "e2mmap"
+require "irb/notifier"
+
+# :stopdoc:
+module IRB
+ class SLex
+
+ extend Exception2MessageMapper
+ def_exception :ErrNodeNothing, "node nothing"
+ def_exception :ErrNodeAlreadyExists, "node already exists"
+
+ DOUT = Notifier::def_notifier("SLex::")
+ D_WARN = DOUT::def_notifier(1, "Warn: ")
+ D_DEBUG = DOUT::def_notifier(2, "Debug: ")
+ D_DETAIL = DOUT::def_notifier(4, "Detail: ")
+
+ DOUT.level = Notifier::D_NOMSG
+
+ def initialize
+ @head = Node.new("")
+ end
+
+ def def_rule(token, preproc = nil, postproc = nil, &block)
+ D_DETAIL.pp token
+
+ postproc = block if block_given?
+ create(token, preproc, postproc)
+ end
+
+ def def_rules(*tokens, &block)
+ if block_given?
+ p = block
+ end
+ for token in tokens
+ def_rule(token, nil, p)
+ end
+ end
+
+ def preproc(token, proc)
+ node = search(token)
+ node.preproc=proc
+ end
+
+ #$BMW%A%'%C%/(B?
+ def postproc(token)
+ node = search(token, proc)
+ node.postproc=proc
+ end
+
+ def search(token)
+ @head.search(token.split(//))
+ end
+
+ def create(token, preproc = nil, postproc = nil)
+ @head.create_subnode(token.split(//), preproc, postproc)
+ end
+
+ def match(token)
+ case token
+ when Array
+ when String
+ return match(token.split(//))
+ else
+ return @head.match_io(token)
+ end
+ ret = @head.match(token)
+ D_DETAIL.exec_if{D_DETAIL.printf "match end: %s:%s\n", ret, token.inspect}
+ ret
+ end
+
+ def inspect
+ format("<SLex: @head = %s>", @head.inspect)
+ end
+
+ #----------------------------------------------------------------------
+ #
+ # class Node -
+ #
+ #----------------------------------------------------------------------
+ class Node
+ # if postproc is nil, this node is an abstract node.
+ # if postproc is non-nil, this node is a real node.
+ def initialize(preproc = nil, postproc = nil)
+ @Tree = {}
+ @preproc = preproc
+ @postproc = postproc
+ end
+
+ attr_accessor :preproc
+ attr_accessor :postproc
+
+ def search(chrs, opt = nil)
+ return self if chrs.empty?
+ ch = chrs.shift
+ if node = @Tree[ch]
+ node.search(chrs, opt)
+ else
+ if opt
+ chrs.unshift ch
+ self.create_subnode(chrs)
+ else
+ SLex.fail ErrNodeNothing
+ end
+ end
+ end
+
+ def create_subnode(chrs, preproc = nil, postproc = nil)
+ if chrs.empty?
+ if @postproc
+ D_DETAIL.pp node
+ SLex.fail ErrNodeAlreadyExists
+ else
+ D_DEBUG.puts "change abstract node to real node."
+ @preproc = preproc
+ @postproc = postproc
+ end
+ return self
+ end
+
+ ch = chrs.shift
+ if node = @Tree[ch]
+ if chrs.empty?
+ if node.postproc
+ DebugLogger.pp node
+ DebugLogger.pp self
+ DebugLogger.pp ch
+ DebugLogger.pp chrs
+ SLex.fail ErrNodeAlreadyExists
+ else
+ D_WARN.puts "change abstract node to real node"
+ node.preproc = preproc
+ node.postproc = postproc
+ end
+ else
+ node.create_subnode(chrs, preproc, postproc)
+ end
+ else
+ if chrs.empty?
+ node = Node.new(preproc, postproc)
+ else
+ node = Node.new
+ node.create_subnode(chrs, preproc, postproc)
+ end
+ @Tree[ch] = node
+ end
+ node
+ end
+
+ #
+ # chrs: String
+ # character array
+ # io must have getc()/ungetc(); and ungetc() must be
+ # able to be called arbitrary number of times.
+ #
+ def match(chrs, op = "")
+ D_DETAIL.print "match>: ", chrs, "op:", op, "\n"
+ if chrs.empty?
+ if @preproc.nil? || @preproc.call(op, chrs)
+ DOUT.printf(D_DETAIL, "op1: %s\n", op)
+ @postproc.call(op, chrs)
+ else
+ nil
+ end
+ else
+ ch = chrs.shift
+ if node = @Tree[ch]
+ if ret = node.match(chrs, op+ch)
+ return ret
+ else
+ chrs.unshift ch
+ if @postproc and @preproc.nil? || @preproc.call(op, chrs)
+ DOUT.printf(D_DETAIL, "op2: %s\n", op.inspect)
+ ret = @postproc.call(op, chrs)
+ return ret
+ else
+ return nil
+ end
+ end
+ else
+ chrs.unshift ch
+ if @postproc and @preproc.nil? || @preproc.call(op, chrs)
+ DOUT.printf(D_DETAIL, "op3: %s\n", op)
+ @postproc.call(op, chrs)
+ return ""
+ else
+ return nil
+ end
+ end
+ end
+ end
+
+ def match_io(io, op = "")
+ if op == ""
+ ch = io.getc
+ if ch == nil
+ return nil
+ end
+ else
+ ch = io.getc_of_rests
+ end
+ if ch.nil?
+ if @preproc.nil? || @preproc.call(op, io)
+ D_DETAIL.printf("op1: %s\n", op)
+ @postproc.call(op, io)
+ else
+ nil
+ end
+ else
+ if node = @Tree[ch]
+ if ret = node.match_io(io, op+ch)
+ ret
+ else
+ io.ungetc ch
+ if @postproc and @preproc.nil? || @preproc.call(op, io)
+ DOUT.exec_if{D_DETAIL.printf "op2: %s\n", op.inspect}
+ @postproc.call(op, io)
+ else
+ nil
+ end
+ end
+ else
+ io.ungetc ch
+ if @postproc and @preproc.nil? || @preproc.call(op, io)
+ D_DETAIL.printf("op3: %s\n", op)
+ @postproc.call(op, io)
+ else
+ nil
+ end
+ end
+ end
+ end
+ end
+ end
+end
+# :startdoc:
+
+if $0 == __FILE__
+ case $1
+ when "1"
+ tr = SLex.new
+ print "0: ", tr.inspect, "\n"
+ tr.def_rule("=") {print "=\n"}
+ print "1: ", tr.inspect, "\n"
+ tr.def_rule("==") {print "==\n"}
+ print "2: ", tr.inspect, "\n"
+
+ print "case 1:\n"
+ print tr.match("="), "\n"
+ print "case 2:\n"
+ print tr.match("=="), "\n"
+ print "case 3:\n"
+ print tr.match("=>"), "\n"
+
+ when "2"
+ tr = SLex.new
+ print "0: ", tr.inspect, "\n"
+ tr.def_rule("=") {print "=\n"}
+ print "1: ", tr.inspect, "\n"
+ tr.def_rule("==", proc{false}) {print "==\n"}
+ print "2: ", tr.inspect, "\n"
+
+ print "case 1:\n"
+ print tr.match("="), "\n"
+ print "case 2:\n"
+ print tr.match("=="), "\n"
+ print "case 3:\n"
+ print tr.match("=>"), "\n"
+ end
+ exit
+end
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 9b8bd9b161..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$
@@ -11,7 +10,6 @@
#
module IRB # :nodoc:
- VERSION = "1.2.1"
- @RELEASE_VERSION = VERSION
- @LAST_UPDATE_DATE = "2019-12-24"
+ @RELEASE_VERSION = "0.9.6"
+ @LAST_UPDATE_DATE = "09/06/30"
end
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index 794a511521..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$
@@ -9,9 +8,6 @@
#
#
#
-
-require "delegate"
-
module IRB # :nodoc:
class WorkSpace
# Creates a new workspace.
@@ -42,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__
@@ -52,21 +50,17 @@ EOF
@binding = BINDING_QUEUE.pop
when 3 # binding in function on TOPLEVEL_BINDING(default)
- @binding = eval("self.class.send(:remove_method, :irb_binding) if defined?(irb_binding); private; def irb_binding; binding; end; irb_binding",
+ @binding = eval("def irb_binding; private; binding; end; irb_binding",
TOPLEVEL_BINDING,
__FILE__,
__LINE__ - 3)
end
end
-
if main.empty?
@main = eval("self", @binding)
else
@main = main[0]
- end
- IRB.conf[:__MAIN__] = @main
-
- unless main.empty?
+ IRB.conf[:__MAIN__] = @main
case @main
when Module
@binding = eval("IRB.conf[:__MAIN__].module_eval('binding', __FILE__, __LINE__)", @binding, __FILE__, __LINE__)
@@ -74,33 +68,11 @@ EOF
begin
@binding = eval("IRB.conf[:__MAIN__].instance_eval('binding', __FILE__, __LINE__)", @binding, __FILE__, __LINE__)
rescue TypeError
- fail CantChangeBinding, @main.inspect
- end
- end
- end
-
- case @main
- when Object
- use_delegator = @main.frozen?
- else
- use_delegator = true
- end
-
- if use_delegator
- @main = SimpleDelegator.new(@main)
- IRB.conf[:__MAIN__] = @main
- @main.singleton_class.class_eval do
- private
- define_method(:exit) do |*a, &b|
- # Do nothing, will be overridden
+ IRB.fail CantChangeBinding, @main.inspect
end
- define_method(:binding, Kernel.instance_method(:binding))
- define_method(:local_variables, Kernel.instance_method(:local_variables))
end
- @binding = eval("IRB.conf[:__MAIN__].instance_eval('binding', __FILE__, __LINE__)", @binding, *@binding.source_location)
end
-
- @binding.local_variable_set(:_, nil)
+ eval("_=nil", @binding)
end
# The Binding of this workspace
@@ -114,67 +86,28 @@ EOF
eval(statements, @binding, file, line)
end
- def local_variable_set(name, value)
- @binding.local_variable_set(name, value)
- end
-
- def local_variable_get(name)
- @binding.local_variable_get(name)
- end
-
# error message manipulator
def filter_backtrace(bt)
- return nil if bt =~ /\/irb\/.*\.rb/
- return nil if bt =~ /\/irb\.rb/
case IRB.conf[:CONTEXT_MODE]
+ when 0
+ return nil if bt =~ /\(irb_local_binding\)/
when 1
- return nil if bt =~ %r!/tmp/irb-binding!
+ if(bt =~ %r!/tmp/irb-binding! or
+ bt =~ %r!irb/.*\.rb! or
+ bt =~ /irb\.rb/)
+ return nil
+ end
+ when 2
+ return nil if bt =~ /irb\/.*\.rb/
+ return nil if bt =~ /irb\.rb/
when 3
+ return nil if bt =~ /irb\/.*\.rb/
+ return nil if bt =~ /irb\.rb/
bt = bt.sub(/:\s*in `irb_binding'/, '')
end
bt
end
- def code_around_binding
- if @binding.respond_to?(:source_location)
- file, pos = @binding.source_location
- else
- file, pos = @binding.eval('[__FILE__, __LINE__]')
- end
-
- if defined?(::SCRIPT_LINES__[file]) && lines = ::SCRIPT_LINES__[file]
- code = ::SCRIPT_LINES__[file].join('')
- else
- begin
- code = File.read(file)
- rescue SystemCallError
- return
- end
- end
-
- # NOT using #use_colorize? of IRB.conf[:MAIN_CONTEXT] because this method may be called before IRB::Irb#run
- use_colorize = IRB.conf.fetch(:USE_COLORIZE, true)
- if use_colorize
- lines = Color.colorize_code(code).lines
- else
- lines = code.lines
- end
- pos -= 1
-
- start_pos = [pos - 5, 0].max
- end_pos = [pos + 5, lines.size - 1].min
-
- if use_colorize
- fmt = " %2s #{Color.colorize("%#{end_pos.to_s.length}d", [:BLUE, :BOLD])}: %s"
- else
- fmt = " %2s %#{end_pos.to_s.length}d: %s"
- end
- 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}#{Color.clear}\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 60cf3b4e4d..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$
@@ -11,7 +10,7 @@
#
require "irb"
-require_relative "frame"
+require "irb/frame"
# An example printer for irb.
#
diff --git a/lib/logger.rb b/lib/logger.rb
index f0b99f75a2..09c8943c94 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
# logger.rb - simple logging utility
# Copyright (C) 2000-2003, 2005, 2008, 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
#
@@ -12,12 +11,6 @@
require 'monitor'
-require_relative 'logger/version'
-require_relative 'logger/formatter'
-require_relative 'logger/log_device'
-require_relative 'logger/severity'
-require_relative 'logger/errors'
-
# == Description
#
# The Logger class provides a simple but sophisticated logging utility that
@@ -115,7 +108,7 @@ require_relative 'logger/errors'
# 3. Create a logger for the specified file.
#
# file = File.open('foo.log', File::WRONLY | File::APPEND)
-# # To create new logfile, add File::CREAT like:
+# # To create new (and to remove old) logfile, add File::CREAT like:
# # file = File.open('foo.log', File::WRONLY | File::APPEND | File::CREAT)
# logger = Logger.new(file)
#
@@ -183,19 +176,6 @@ require_relative 'logger/errors'
#
# # 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
@@ -212,10 +192,6 @@ require_relative 'logger/errors'
# 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|
@@ -223,13 +199,8 @@ require_relative 'logger/errors'
# 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$
if name
name = name.chomp(",v")
@@ -239,36 +210,31 @@ class Logger
rev ||= "v#{VERSION}"
ProgName = "#{name}/#{rev}"
+ class Error < RuntimeError # :nodoc:
+ end
+ # not used after 1.2.7. just for compat.
+ class ShiftingError < Error # :nodoc:
+ end
+
+ # Logging severity.
+ module Severity
+ # Low-level information, mostly for developers.
+ DEBUG = 0
+ # Generic (useful) information about system operation.
+ INFO = 1
+ # A warning.
+ WARN = 2
+ # A handleable error condition.
+ ERROR = 3
+ # An unhandleable error that results in a program crash.
+ FATAL = 4
+ # An unknown message that should always be logged.
+ UNKNOWN = 5
+ end
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
@@ -304,47 +270,28 @@ class Logger
# Returns +true+ iff the current severity level allows for the printing of
# +DEBUG+ messages.
- def debug?; level <= DEBUG; end
-
- # Sets the severity to DEBUG.
- def debug!; self.level = DEBUG; end
+ def debug?; @level <= DEBUG; end
# Returns +true+ iff the current severity level allows for the printing of
# +INFO+ messages.
- def info?; level <= INFO; end
-
- # Sets the severity to INFO.
- def info!; self.level = INFO; end
+ def info?; @level <= INFO; end
# Returns +true+ iff the current severity level allows for the printing of
# +WARN+ messages.
- def warn?; level <= WARN; end
-
- # Sets the severity to WARN.
- def warn!; self.level = WARN; end
+ def warn?; @level <= WARN; end
# Returns +true+ iff the current severity level allows for the printing of
# +ERROR+ messages.
- def error?; level <= ERROR; end
-
- # Sets the severity to ERROR.
- def error!; self.level = ERROR; end
+ def error?; @level <= ERROR; end
# Returns +true+ iff the current severity level allows for the printing of
# +FATAL+ messages.
- def fatal?; level <= FATAL; end
-
- # Sets the severity to FATAL.
- def fatal!; self.level = FATAL; end
+ def fatal?; @level <= FATAL; end
#
# :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
#
@@ -353,69 +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, which disables log file
- # rotation.
+ # +weekly+ or +monthly+).
# +shift_size+::
- # Maximum logfile size in bytes (only applies when +shift_age+ is a positive
- # Integer). 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'.
- # +binmode+::
- # Use binary mode on the log device. Default value is false.
- # +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,
- binmode: false, 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,
- binmode: binmode)
+ @logdev = LogDevice.new(logdev, :shift_age => shift_age,
+ :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
@@ -457,12 +363,10 @@ class Logger
#
def add(severity, message = nil, progname = nil)
severity ||= UNKNOWN
- if @logdev.nil? or severity < level
+ 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
@@ -482,7 +386,9 @@ class Logger
# device exists, return +nil+.
#
def <<(msg)
- @logdev&.write(msg)
+ unless @logdev.nil?
+ @logdev.write(msg)
+ end
end
#
@@ -569,13 +475,13 @@ class Logger
# Close the logging device.
#
def close
- @logdev&.close
+ @logdev.close if @logdev
end
private
# Severity label for logging (max 5 chars).
- SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY).freeze
+ SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY)
def format_severity(severity)
SEV_LABEL[severity] || 'ANY'
@@ -584,4 +490,248 @@ private
def format_message(severity, datetime, progname, msg)
(@formatter || @default_formatter).call(severity, datetime, progname, msg)
end
+
+
+ # Default formatter for log messages.
+ class Formatter
+ Format = "%s, [%s#%d] %5s -- %s: %s\n"
+
+ attr_accessor :datetime_format
+
+ def initialize
+ @datetime_format = nil
+ end
+
+ def call(severity, time, progname, msg)
+ Format % [severity[0..0], format_datetime(time), $$, severity, progname,
+ msg2str(msg)]
+ end
+
+ private
+
+ def format_datetime(time)
+ time.strftime(@datetime_format || "%Y-%m-%dT%H:%M:%S.%6N ".freeze)
+ end
+
+ def msg2str(msg)
+ case msg
+ when ::String
+ msg
+ when ::Exception
+ "#{ msg.message } (#{ msg.class })\n" <<
+ (msg.backtrace || []).join("\n")
+ else
+ msg.inspect
+ end
+ end
+ end
+
+ module Period
+ module_function
+
+ SiD = 24 * 60 * 60
+
+ def next_rotate_time(now, shift_age)
+ case shift_age
+ when /^daily$/
+ t = Time.mktime(now.year, now.month, now.mday) + SiD
+ 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
+ mday = 1
+ else
+ return now
+ end
+ 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$/
+ 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 + 1) + SiD / 2)
+ when /^monthly$/
+ t = Time.mktime(now.year, now.month, 1) - SiD / 2
+ else
+ return now
+ end
+ Time.mktime(t.year, t.month, t.mday, 23, 59, 59)
+ end
+ end
+
+ # Device used for logging messages.
+ class LogDevice
+ include Period
+
+ attr_reader :dev
+ attr_reader :filename
+
+ 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
+ @mutex.synchronize do
+ if @shift_age and @dev.respond_to?(:stat)
+ begin
+ check_shift_log
+ rescue
+ warn("log shifting failed. #{$!}")
+ end
+ end
+ begin
+ @dev.write(message)
+ rescue
+ warn("log writing failed. #{$!}")
+ end
+ end
+ rescue Exception => ignored
+ warn("log writing failed. #{ignored}")
+ end
+ end
+
+ def close
+ begin
+ @mutex.synchronize do
+ @dev.close rescue nil
+ end
+ rescue Exception
+ @dev.close rescue nil
+ end
+ end
+
+ private
+
+ def open_logfile(filename)
+ begin
+ open(filename, (File::WRONLY | File::APPEND))
+ rescue Errno::ENOENT
+ create_logfile(filename)
+ end
+ end
+
+ def create_logfile(filename)
+ begin
+ logdev = open(filename, (File::WRONLY | File::APPEND | File::CREAT | File::EXCL))
+ logdev.flock(File::LOCK_EX)
+ logdev.sync = true
+ add_log_header(logdev)
+ logdev.flock(File::LOCK_UN)
+ rescue Errno::EEXIST
+ # file is created by another process
+ logdev = open_logfile(filename)
+ logdev.sync = true
+ end
+ logdev
+ end
+
+ def add_log_header(file)
+ file.write(
+ "# Logfile created on %s by %s\n" % [Time.now.to_s, Logger::ProgName]
+ ) if file.size == 0
+ end
+
+ def check_shift_log
+ if @shift_age.is_a?(Integer)
+ # Note: always returns false if '0'.
+ if @filename && (@shift_age > 0) && (@dev.stat.size > @shift_size)
+ lock_shift_log { shift_log_age }
+ end
+ else
+ now = Time.now
+ if now >= @next_rotate_time
+ @next_rotate_time = next_rotate_time(now, @shift_age)
+ lock_shift_log { shift_log_period(previous_period_end(now, @shift_age)) }
+ end
+ end
+ end
+
+ if /mswin|mingw/ =~ RUBY_PLATFORM
+ def lock_shift_log
+ yield
+ end
+ else
+ def lock_shift_log
+ retry_limit = 8
+ retry_sleep = 0.1
+ begin
+ File.open(@filename, File::WRONLY | File::APPEND) do |lock|
+ lock.flock(File::LOCK_EX) # inter-process locking. will be unlocked at closing file
+ if File.identical?(@filename, lock) and File.identical?(lock, @dev)
+ yield # log shifting
+ else
+ # log shifted by another process (i-node before locking and i-node after locking are different)
+ @dev.close rescue nil
+ @dev = open_logfile(@filename)
+ @dev.sync = true
+ end
+ end
+ rescue Errno::ENOENT
+ # @filename file would not exist right after #rename and before #create_logfile
+ if retry_limit <= 0
+ warn("log rotation inter-process lock failed. #{$!}")
+ else
+ sleep retry_sleep
+ retry_limit -= 1
+ retry_sleep *= 2
+ retry
+ end
+ end
+ rescue
+ warn("log rotation inter-process lock failed. #{$!}")
+ end
+ end
+
+ def shift_log_age
+ (@shift_age-3).downto(0) do |i|
+ if FileTest.exist?("#{@filename}.#{i}")
+ File.rename("#{@filename}.#{i}", "#{@filename}.#{i+1}")
+ end
+ end
+ @dev.close rescue nil
+ File.rename("#{@filename}", "#{@filename}.0")
+ @dev = create_logfile(@filename)
+ return true
+ end
+
+ def shift_log_period(period_end)
+ 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}.#{postfix}.#{idx}"
+ break unless FileTest.exist?(age_file)
+ end
+ end
+ @dev.close rescue nil
+ File.rename("#{@filename}", age_file)
+ @dev = create_logfile(@filename)
+ return true
+ end
+ end
end
diff --git a/lib/logger/errors.rb b/lib/logger/errors.rb
deleted file mode 100644
index e8925e14ac..0000000000
--- a/lib/logger/errors.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-# not used after 1.2.7. just for compat.
-class Logger
- class Error < RuntimeError # :nodoc:
- end
- class ShiftingError < Error # :nodoc:
- end
-end
diff --git a/lib/logger/formatter.rb b/lib/logger/formatter.rb
deleted file mode 100644
index 852cffe033..0000000000
--- a/lib/logger/formatter.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class Logger
- # Default formatter for log messages.
- class Formatter
- Format = "%s, [%s#%d] %5s -- %s: %s\n"
-
- attr_accessor :datetime_format
-
- def initialize
- @datetime_format = nil
- end
-
- def call(severity, time, progname, msg)
- Format % [severity[0..0], format_datetime(time), $$, severity, progname,
- msg2str(msg)]
- end
-
- private
-
- def format_datetime(time)
- time.strftime(@datetime_format || "%Y-%m-%dT%H:%M:%S.%6N ")
- end
-
- def msg2str(msg)
- case msg
- when ::String
- msg
- when ::Exception
- "#{ msg.message } (#{ msg.class })\n#{ msg.backtrace.join("\n") if msg.backtrace }"
- else
- msg.inspect
- end
- end
- end
-end
diff --git a/lib/logger/log_device.rb b/lib/logger/log_device.rb
deleted file mode 100644
index fe7d54fb81..0000000000
--- a/lib/logger/log_device.rb
+++ /dev/null
@@ -1,205 +0,0 @@
-# frozen_string_literal: true
-
-require_relative 'period'
-
-class Logger
- # Device used for logging messages.
- class LogDevice
- include Period
-
- attr_reader :dev
- attr_reader :filename
- include MonitorMixin
-
- def initialize(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil, binmode: false)
- @dev = @filename = @shift_age = @shift_size = @shift_period_suffix = nil
- @binmode = binmode
- 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
- end
- end
-
- def write(message)
- begin
- synchronize do
- if @shift_age and @dev.respond_to?(:stat)
- begin
- check_shift_log
- rescue
- warn("log shifting failed. #{$!}")
- end
- end
- begin
- @dev.write(message)
- rescue
- warn("log writing failed. #{$!}")
- end
- end
- rescue Exception => ignored
- warn("log writing failed. #{ignored}")
- end
- end
-
- def close
- begin
- synchronize do
- @dev.close rescue nil
- end
- rescue Exception
- @dev.close rescue nil
- 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
- if log.respond_to?(:path)
- @filename = log.path
- end
- else
- @dev = open_logfile(log)
- @dev.sync = true
- @dev.binmode if @binmode
- @filename = log
- end
- end
-
- def open_logfile(filename)
- begin
- File.open(filename, (File::WRONLY | File::APPEND))
- rescue Errno::ENOENT
- create_logfile(filename)
- end
- end
-
- def create_logfile(filename)
- begin
- logdev = File.open(filename, (File::WRONLY | File::APPEND | File::CREAT | File::EXCL))
- logdev.flock(File::LOCK_EX)
- logdev.sync = true
- logdev.binmode if @binmode
- add_log_header(logdev)
- logdev.flock(File::LOCK_UN)
- rescue Errno::EEXIST
- # file is created by another process
- logdev = open_logfile(filename)
- logdev.sync = true
- end
- logdev
- end
-
- def add_log_header(file)
- file.write(
- "# Logfile created on %s by %s\n" % [Time.now.to_s, Logger::ProgName]
- ) if file.size == 0
- end
-
- def check_shift_log
- if @shift_age.is_a?(Integer)
- # Note: always returns false if '0'.
- if @filename && (@shift_age > 0) && (@dev.stat.size > @shift_size)
- lock_shift_log { shift_log_age }
- end
- else
- now = Time.now
- if now >= @next_rotate_time
- @next_rotate_time = next_rotate_time(now, @shift_age)
- lock_shift_log { shift_log_period(previous_period_end(now, @shift_age)) }
- end
- end
- end
-
- if /mswin|mingw/ =~ RUBY_PLATFORM
- def lock_shift_log
- yield
- end
- else
- def lock_shift_log
- retry_limit = 8
- retry_sleep = 0.1
- begin
- File.open(@filename, File::WRONLY | File::APPEND) do |lock|
- lock.flock(File::LOCK_EX) # inter-process locking. will be unlocked at closing file
- if File.identical?(@filename, lock) and File.identical?(lock, @dev)
- yield # log shifting
- else
- # log shifted by another process (i-node before locking and i-node after locking are different)
- @dev.close rescue nil
- @dev = open_logfile(@filename)
- @dev.sync = true
- end
- end
- rescue Errno::ENOENT
- # @filename file would not exist right after #rename and before #create_logfile
- if retry_limit <= 0
- warn("log rotation inter-process lock failed. #{$!}")
- else
- sleep retry_sleep
- retry_limit -= 1
- retry_sleep *= 2
- retry
- end
- end
- rescue
- warn("log rotation inter-process lock failed. #{$!}")
- end
- end
-
- def shift_log_age
- (@shift_age-3).downto(0) do |i|
- if FileTest.exist?("#{@filename}.#{i}")
- File.rename("#{@filename}.#{i}", "#{@filename}.#{i+1}")
- end
- end
- @dev.close rescue nil
- File.rename("#{@filename}", "#{@filename}.0")
- @dev = create_logfile(@filename)
- return true
- end
-
- def shift_log_period(period_end)
- suffix = period_end.strftime(@shift_period_suffix)
- age_file = "#{@filename}.#{suffix}"
- 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}"
- break unless FileTest.exist?(age_file)
- end
- end
- @dev.close rescue nil
- File.rename("#{@filename}", age_file)
- @dev = create_logfile(@filename)
- return true
- end
- end
-end
diff --git a/lib/logger/logger.gemspec b/lib/logger/logger.gemspec
deleted file mode 100644
index 8b3f70627a..0000000000
--- a/lib/logger/logger.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-begin
- require_relative "lib/logger/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "logger"
- spec.version = Logger::VERSION
- spec.authors = ["Naotoshi Seo", "SHIBATA Hiroshi"]
- spec.email = ["sonots@gmail.com", "hsbt@ruby-lang.org"]
-
- spec.summary = %q{Provides a simple logging utility for outputting messages.}
- spec.description = %q{Provides a simple logging utility for outputting messages.}
- spec.homepage = "https://github.com/ruby/logger"
- spec.license = "BSD-2-Clause"
-
- spec.files = Dir.glob("lib/**/*.rb") + ["logger.gemspec"]
- 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", ">= 0"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "test-unit"
- spec.add_development_dependency "rdoc"
-end
diff --git a/lib/logger/period.rb b/lib/logger/period.rb
deleted file mode 100644
index 0a291dbbbe..0000000000
--- a/lib/logger/period.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-class Logger
- module Period
- module_function
-
- SiD = 24 * 60 * 60
-
- def next_rotate_time(now, shift_age)
- case shift_age
- when 'daily'
- t = Time.mktime(now.year, now.month, now.mday) + SiD
- 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 'now', 'everytime'
- return now
- else
- raise ArgumentError, "invalid :shift_age #{shift_age.inspect}, should be daily, weekly, monthly, or everytime"
- 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
- end
- t
- end
-
- def previous_period_end(now, shift_age)
- case shift_age
- 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'
- t = Time.mktime(now.year, now.month, 1) - SiD / 2
- when 'now', 'everytime'
- return now
- else
- raise ArgumentError, "invalid :shift_age #{shift_age.inspect}, should be daily, weekly, monthly, or everytime"
- end
- Time.mktime(t.year, t.month, t.mday, 23, 59, 59)
- end
- end
-end
diff --git a/lib/logger/severity.rb b/lib/logger/severity.rb
deleted file mode 100644
index b38afb7d22..0000000000
--- a/lib/logger/severity.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class Logger
- # Logging severity.
- module Severity
- # Low-level information, mostly for developers.
- DEBUG = 0
- # Generic (useful) information about system operation.
- INFO = 1
- # A warning.
- WARN = 2
- # A handleable error condition.
- ERROR = 3
- # An unhandleable error that results in a program crash.
- FATAL = 4
- # An unknown message that should always be logged.
- UNKNOWN = 5
- end
-end
diff --git a/lib/logger/version.rb b/lib/logger/version.rb
deleted file mode 100644
index f90ce94e49..0000000000
--- a/lib/logger/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-class Logger
- VERSION = "1.4.2"
-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 fc0e8ef2f7..fb98d09323 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1,5 +1,4 @@
# encoding: utf-8
-# frozen_string_literal: false
#
# = matrix.rb
#
@@ -12,51 +11,125 @@
# Original Documentation:: Gavin Sinclair (sourced from <i>Ruby in a Nutshell</i> (Matsumoto, O'Reilly))
##
-require_relative "matrix/version"
+require "e2mmap.rb"
module ExceptionForMatrix # :nodoc:
- class ErrDimensionMismatch < StandardError
- def initialize(val = nil)
- if val
- super(val)
- else
- super("Dimension mismatch")
- end
- end
- end
-
- class ErrNotRegular < StandardError
- def initialize(val = nil)
- if val
- super(val)
- else
- super("Not Regular Matrix")
- end
- end
- end
-
- class ErrOperationNotDefined < StandardError
- def initialize(vals)
- if vals.is_a?(Array)
- super("Operation(#{vals[0]}) can\\'t be defined: #{vals[1]} op #{vals[2]}")
- else
- super(vals)
- end
- end
- end
-
- class ErrOperationNotImplemented < StandardError
- def initialize(vals)
- super("Sorry, Operation(#{vals[0]}) not implemented: #{vals[1]} op #{vals[2]}")
- end
- end
+ extend Exception2MessageMapper
+ def_e2message(TypeError, "wrong argument type %s (expected %s)")
+ def_e2message(ArgumentError, "Wrong # of arguments(%d for %d)")
+
+ def_exception("ErrDimensionMismatch", "\#{self.name} dimension mismatch")
+ def_exception("ErrNotRegular", "Not Regular Matrix")
+ def_exception("ErrOperationNotDefined", "Operation(%s) can\\'t be defined: %s op %s")
+ def_exception("ErrOperationNotImplemented", "Sorry, Operation(%s) not implemented: %s op %s")
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)
+# * Matrix.hstack(*matrices)
+# * Matrix.vstack(*matrices)
+#
+# 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)
+# * #adjugate
+# * #laplace_expansion(row_or_column: num)
+# * #cofactor_expansion(row_or_column: num)
+#
+# 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
+# * #hstack(*matrices)
+# * #rank
+# * #round
+# * #trace
+# * #tr
+# * #transpose
+# * #t
+# * #vstack(*matrices)
+#
+# 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
@@ -172,8 +245,8 @@ class Matrix
scalar(n, 1)
end
class << Matrix
- alias_method :unit, :identity
- alias_method :I, :identity
+ alias unit identity
+ alias I identity
end
#
@@ -239,10 +312,10 @@ class Matrix
# Matrix.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
#
def Matrix.vstack(x, *matrices)
- x = CoercionHelper.coerce_to_matrix(x)
+ raise TypeError, "Expected a Matrix, got a #{x.class}" unless x.is_a?(Matrix)
result = x.send(:rows).map(&:dup)
matrices.each do |m|
- m = CoercionHelper.coerce_to_matrix(m)
+ raise TypeError, "Expected a Matrix, got a #{m.class}" unless m.is_a?(Matrix)
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
@@ -260,11 +333,11 @@ class Matrix
# Matrix.hstack(x, y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
#
def Matrix.hstack(x, *matrices)
- x = CoercionHelper.coerce_to_matrix(x)
+ raise TypeError, "Expected a Matrix, got a #{x.class}" unless x.is_a?(Matrix)
result = x.send(:rows).map(&:dup)
total_column_count = x.column_count
matrices.each do |m|
- m = CoercionHelper.coerce_to_matrix(m)
+ raise TypeError, "Expected a Matrix, got a #{m.class}" unless m.is_a?(Matrix)
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
@@ -277,35 +350,6 @@ class Matrix
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|
- 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)
@@ -316,9 +360,10 @@ class Matrix
@column_count = column_count
end
- private def new_matrix(rows, column_count = rows[0].size) # :nodoc:
+ def new_matrix(rows, column_count = rows[0].size) # :nodoc:
self.class.send(:new, rows, column_count) # bypass privacy of Matrix.new
end
+ private :new_matrix
#
# Returns element (+i+,+j+) of the matrix. That is: row +i+, column +j+.
@@ -329,107 +374,12 @@ class Matrix
alias element []
alias component []
- #
- # :call-seq:
- # matrix[range, range] = matrix/element
- # matrix[range, integer] = vector/column_matrix/element
- # matrix[integer, range] = vector/row_matrix/element
- # matrix[integer, integer] = element
- #
- # Set element or elements of matrix.
def []=(i, j, v)
- raise FrozenError, "can't modify frozen Matrix" if frozen?
- rows = check_range(i, :row) or row = check_int(i, :row)
- columns = check_range(j, :column) or column = check_int(j, :column)
- if rows && columns
- set_row_and_col_range(rows, columns, v)
- elsif rows
- set_row_range(rows, column, v)
- elsif columns
- set_col_range(row, columns, v)
- else
- set_value(row, column, v)
- end
+ @rows[i][j] = v
end
alias set_element []=
alias set_component []=
- private :set_element, :set_component
-
- # Returns range or nil
- private def check_range(val, direction)
- return unless val.is_a?(Range)
- count = direction == :row ? row_count : column_count
- CoercionHelper.check_range(val, count, direction)
- end
-
- private def check_int(val, direction)
- count = direction == :row ? row_count : column_count
- CoercionHelper.check_int(val, count, direction)
- end
-
- private def set_value(row, col, value)
- raise ErrDimensionMismatch, "Expected a a value, got a #{value.class}" if value.respond_to?(:to_matrix)
-
- @rows[row][col] = value
- end
-
- private def set_row_and_col_range(row_range, col_range, value)
- if value.is_a?(Matrix)
- if row_range.size != value.row_count || col_range.size != value.column_count
- raise ErrDimensionMismatch, [
- 'Expected a Matrix of dimensions',
- "#{row_range.size}x#{col_range.size}",
- 'got',
- "#{value.row_count}x#{value.column_count}",
- ].join(' ')
- end
- source = value.instance_variable_get :@rows
- row_range.each_with_index do |row, i|
- @rows[row][col_range] = source[i]
- end
- elsif value.is_a?(Vector)
- raise ErrDimensionMismatch, 'Expected a Matrix or a value, got a Vector'
- else
- value_to_set = Array.new(col_range.size, value)
- row_range.each do |i|
- @rows[i][col_range] = value_to_set
- end
- end
- end
-
- private def set_row_range(row_range, col, value)
- if value.is_a?(Vector)
- raise ErrDimensionMismatch unless row_range.size == value.size
- set_column_vector(row_range, col, value)
- elsif value.is_a?(Matrix)
- raise ErrDimensionMismatch unless value.column_count == 1
- value = value.column(0)
- raise ErrDimensionMismatch unless row_range.size == value.size
- set_column_vector(row_range, col, value)
- else
- @rows[row_range].each{|e| e[col] = value }
- end
- end
-
- private def set_column_vector(row_range, col, value)
- value.each_with_index do |e, index|
- r = row_range.begin + index
- @rows[r][col] = e
- end
- end
-
- private def set_col_range(row, col_range, value)
- value = if value.is_a?(Vector)
- value.to_a
- elsif value.is_a?(Matrix)
- raise ErrDimensionMismatch unless value.row_count == 1
- value.row(0).to_a
- else
- Array.new(col_range.size, value)
- end
- raise ErrDimensionMismatch unless col_range.size == value.size
- @rows[row][col_range] = value
- end
+ private :[]=, :set_element, :set_component
#
# Returns the number of rows.
@@ -482,48 +432,16 @@ class Matrix
#
# Returns a matrix that is the result of iteration of the given block over all
# elements of the matrix.
- # Elements can be restricted by passing an argument:
- # * :all (default): yields all elements
- # * :diagonal: yields only elements on the diagonal
- # * :off_diagonal: yields all elements except on the diagonal
- # * :lower: yields only elements on or below the diagonal
- # * :strict_lower: yields only elements below the diagonal
- # * :strict_upper: yields only elements above the diagonal
- # * :upper: yields only elements on or above the diagonal
# Matrix[ [1,2], [3,4] ].collect { |e| e**2 }
# => 1 4
# 9 16
#
- def collect(which = :all, &block) # :yield: e
- return to_enum(:collect, which) unless block_given?
- dup.collect!(which, &block)
- end
- alias_method :map, :collect
-
- #
- # Invokes the given block for each element of matrix, replacing the element with the value
- # returned by the block.
- # Elements can be restricted by passing an argument:
- # * :all (default): yields all elements
- # * :diagonal: yields only elements on the diagonal
- # * :off_diagonal: yields all elements except on the diagonal
- # * :lower: yields only elements on or below the diagonal
- # * :strict_lower: yields only elements below the diagonal
- # * :strict_upper: yields only elements above the diagonal
- # * :upper: yields only elements on or above the diagonal
- #
- def collect!(which = :all)
- return to_enum(:collect!, which) unless block_given?
- raise FrozenError, "can't modify frozen Matrix" if frozen?
- each_with_index(which){ |e, row_index, col_index| @rows[row_index][col_index] = yield e }
- end
-
- alias map! collect!
-
- def freeze
- @rows.freeze
- super
+ def collect(&block) # :yield: e
+ return to_enum(:collect) unless block_given?
+ rows = @rows.collect{|row| row.collect(&block)}
+ new_matrix rows, column_count
end
+ alias map collect
#
# Yields all elements of the matrix, starting with those of the first row,
@@ -541,11 +459,12 @@ class Matrix
# # => prints the numbers 1 to 4
# Matrix[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]
#
- def each(which = :all, &block) # :yield: e
+ def each(which = :all) # :yield: e
return to_enum :each, which unless block_given?
last = column_count - 1
case which
when :all
+ block = Proc.new
@rows.each do |row|
row.each(&block)
end
@@ -765,7 +684,7 @@ class Matrix
#
def cofactor(row, column)
raise RuntimeError, "cofactor of empty matrix is not defined" if empty?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
det_of_minor = first_minor(row, column).determinant
det_of_minor * (-1) ** (row + column)
@@ -779,7 +698,7 @@ class Matrix
# -3 7
#
def adjugate
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
Matrix.build(row_count, column_count) do |row, column|
cofactor(column, row)
end
@@ -802,7 +721,7 @@ class Matrix
raise ArgumentError, "exactly one the row or column arguments must be specified"
end
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
raise RuntimeError, "laplace_expansion of empty matrix is not defined" if empty?
unless 0 <= num && num < row_count
@@ -825,7 +744,7 @@ class Matrix
# Raises an error if matrix is not square.
#
def diagonal?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
each(:off_diagonal).all?(&:zero?)
end
@@ -842,7 +761,7 @@ class Matrix
# Raises an error if matrix is not square.
#
def hermitian?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
each_with_index(:upper).all? do |e, row, col|
e == rows[col][row].conj
end
@@ -860,7 +779,7 @@ class Matrix
# Raises an error if matrix is not square.
#
def normal?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
rows.each_with_index do |row_i, i|
rows.each_with_index do |row_j, j|
s = 0
@@ -878,7 +797,7 @@ class Matrix
# Raises an error if matrix is not square.
#
def orthogonal?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
rows.each_with_index do |row, i|
column_count.times do |j|
s = 0
@@ -896,7 +815,7 @@ class Matrix
# Raises an error if matrix is not square.
#
def permutation?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
cols = Array.new(column_count)
rows.each_with_index do |row, i|
found = false
@@ -946,7 +865,7 @@ class Matrix
# Raises an error if matrix is not square.
#
def symmetric?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
each_with_index(:strict_upper) do |e, row, col|
return false if e != rows[col][row]
end
@@ -954,24 +873,11 @@ class Matrix
end
#
- # Returns +true+ if this is an antisymmetric matrix.
- # Raises an error if matrix is not square.
- #
- def antisymmetric?
- raise ErrDimensionMismatch unless square?
- each_with_index(:upper) do |e, row, col|
- return false unless e == -rows[col][row]
- end
- true
- end
- alias_method :skew_symmetric?, :antisymmetric?
-
- #
# Returns +true+ if this is a unitary matrix
# Raises an error if matrix is not square.
#
def unitary?
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
rows.each_with_index do |row, i|
column_count.times do |j|
s = 0
@@ -1018,11 +924,12 @@ class Matrix
end
#
- # Called for dup & clone.
+ # Returns a clone of the matrix, so that the contents of each do not reference
+ # identical objects.
+ # There should be no good reason to do this since Matrices are immutable.
#
- private def initialize_copy(m)
- super
- @rows = @rows.map(&:dup) unless frozen?
+ def clone
+ new_matrix @rows.map(&:dup), column_count
end
#
@@ -1054,7 +961,7 @@ class Matrix
r = self * m
return r.column(0)
when Matrix
- raise ErrDimensionMismatch if column_count != m.row_count
+ Matrix.Raise ErrDimensionMismatch if column_count != m.row_count
rows = Array.new(row_count) {|i|
Array.new(m.column_count) {|j|
@@ -1078,7 +985,7 @@ class Matrix
def +(m)
case m
when Numeric
- raise ErrOperationNotDefined, ["+", self.class, m.class]
+ Matrix.Raise ErrOperationNotDefined, "+", self.class, m.class
when Vector
m = self.class.column_vector(m)
when Matrix
@@ -1086,7 +993,7 @@ class Matrix
return apply_through_coercion(m, __method__)
end
- raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
+ Matrix.Raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
rows = Array.new(row_count) {|i|
Array.new(column_count) {|j|
@@ -1105,7 +1012,7 @@ class Matrix
def -(m)
case m
when Numeric
- raise ErrOperationNotDefined, ["-", self.class, m.class]
+ Matrix.Raise ErrOperationNotDefined, "-", self.class, m.class
when Vector
m = self.class.column_vector(m)
when Matrix
@@ -1113,7 +1020,7 @@ class Matrix
return apply_through_coercion(m, __method__)
end
- raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
+ Matrix.Raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
rows = Array.new(row_count) {|i|
Array.new(column_count) {|j|
@@ -1144,29 +1051,18 @@ 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
# 0 -1
#
def inverse
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
self.class.I(row_count).send(:inverse_from, self)
end
- alias_method :inv, :inverse
+ alias inv inverse
- private def inverse_from(src) # :nodoc:
+ def inverse_from(src) # :nodoc:
last = row_count - 1
a = src.to_a
@@ -1180,7 +1076,7 @@ class Matrix
akk = v
end
end
- raise ErrNotRegular if akk == 0
+ Matrix.Raise ErrNotRegular if akk == 0
if i != k
a[i], a[k] = a[k], a[i]
@rows[i], @rows[k] = @rows[k], @rows[i]
@@ -1209,6 +1105,7 @@ class Matrix
end
self
end
+ private :inverse_from
#
# Matrix exponentiation.
@@ -1219,7 +1116,7 @@ class Matrix
# => 67 96
# 48 99
#
- def **(other)
+ def ** (other)
case other
when Integer
x = self
@@ -1238,7 +1135,7 @@ class Matrix
v, d, v_inv = eigensystem
v * self.class.diagonal(*d.each(:diagonal).map{|e| e ** other}) * v_inv
else
- raise ErrOperationNotDefined, ["**", self.class, other.class]
+ Matrix.Raise ErrOperationNotDefined, "**", self.class, other.class
end
end
@@ -1250,13 +1147,6 @@ class Matrix
collect {|e| -e }
end
- #
- # Returns the absolute value elementwise
- #
- def abs
- collect(&:abs)
- end
-
#--
# MATRIX FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -1272,7 +1162,7 @@ class Matrix
# => 45
#
def determinant
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
m = @rows
case row_count
# Up to 4x4, give result using Laplacian expansion by minors.
@@ -1322,7 +1212,7 @@ class Matrix
# with smaller bignums (if any), while a matrix of Float will usually have
# intermediate results with better precision.
#
- private def determinant_bareiss
+ def determinant_bareiss
size = row_count
last = size - 1
a = to_a
@@ -1348,15 +1238,16 @@ class Matrix
end
sign * pivot
end
+ private :determinant_bareiss
#
# 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_method :det_e, :determinant_e
+ alias det_e determinant_e
#
# Returns a new matrix resulting by stacking horizontally
@@ -1411,7 +1302,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
@@ -1428,12 +1319,12 @@ class Matrix
# => 16
#
def trace
- raise ErrDimensionMismatch unless square?
+ Matrix.Raise ErrDimensionMismatch unless square?
(0...column_count).inject(0) do |tr, i|
tr + @rows[i][i]
end
end
- alias_method :tr, :trace
+ alias tr trace
#
# Returns the transpose of the matrix.
@@ -1449,7 +1340,7 @@ class Matrix
return self.class.empty(column_count, 0) if row_count.zero?
new_matrix @rows.transpose, row_count
end
- alias_method :t, :transpose
+ alias t transpose
#
# Returns a new matrix resulting by stacking vertically
@@ -1478,7 +1369,7 @@ class Matrix
def eigensystem
EigenvalueDecomposition.new(self)
end
- alias_method :eigen, :eigensystem
+ alias eigen eigensystem
#
# Returns the LUP decomposition of the matrix; see +LUPDecomposition+.
@@ -1493,7 +1384,7 @@ class Matrix
def lup
LUPDecomposition.new(self)
end
- alias_method :lup_decomposition, :lup
+ alias lup_decomposition lup
#--
# COMPLEX ARITHMETIC -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1511,7 +1402,7 @@ class Matrix
def conjugate
collect(&:conjugate)
end
- alias_method :conj, :conjugate
+ alias conj conjugate
#
# Returns the imaginary part of the matrix.
@@ -1525,7 +1416,7 @@ class Matrix
def imaginary
collect(&:imaginary)
end
- alias_method :imag, :imaginary
+ alias imag imaginary
#
# Returns the real part of the matrix.
@@ -1549,7 +1440,7 @@ class Matrix
def rect
[real, imag]
end
- alias_method :rectangular, :rect
+ alias rectangular rect
#--
# CONVERTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
@@ -1590,40 +1481,24 @@ 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
@rows.collect(&:dup)
end
- # Deprecated.
- #
- # Use map(&:to_f)
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
- # Deprecated.
- #
- # Use map(&:to_i)
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
- # Deprecated.
- #
- # Use map(&:to_r)
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
@@ -1662,7 +1537,7 @@ class Matrix
# Converts the obj to an Array. If copy is set to true
# a copy of obj will be made if necessary.
#
- private def convert_to_array(obj, copy = false) # :nodoc:
+ def convert_to_array(obj, copy = false) # :nodoc:
case obj
when Array
copy ? obj.dup : obj
@@ -1678,6 +1553,7 @@ class Matrix
converted
end
end
+ private :convert_to_array
end
extend ConversionHelper
@@ -1687,13 +1563,14 @@ class Matrix
# Applies the operator +oper+ with argument +obj+
# through coercion of +obj+
#
- private def apply_through_coercion(obj, oper)
+ def apply_through_coercion(obj, oper)
coercion = obj.coerce(self)
raise TypeError unless coercion.is_a?(Array) && coercion.length == 2
coercion[0].public_send(oper, coercion[1])
rescue
raise TypeError, "#{obj.inspect} can't be coerced into #{self.class}"
end
+ private :apply_through_coercion
#
# Helper method to coerce a value into a specific class.
@@ -1703,7 +1580,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
@@ -1717,30 +1594,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
-
- # Returns `nil` for non Ranges
- # Checks range validity, return canonical range with 0 <= begin <= end < count
- def self.check_range(val, count, kind)
- canonical = (val.begin + (val.begin < 0 ? count : 0))..
- (val.end ? val.end + (val.end < 0 ? count : 0) - (val.exclude_end? ? 1 : 0)
- : count - 1)
- unless 0 <= canonical.begin && canonical.begin <= canonical.end && canonical.end < count
- raise IndexError, "given range #{val} is outside of #{kind} dimensions: 0...#{count}"
- end
- canonical
- end
-
- def self.check_int(val, count, kind)
- val = CoercionHelper.coerce_to_int(val)
- if val >= count || val < -count
- raise IndexError, "given #{kind} #{val} is outside of #{-count}...#{count}"
- end
- val
- end
end
include CoercionHelper
@@ -1761,7 +1614,7 @@ class Matrix
when Numeric
Scalar.new(@value + other)
when Vector, Matrix
- raise ErrOperationNotDefined, ["+", @value.class, other.class]
+ Scalar.Raise ErrOperationNotDefined, "+", @value.class, other.class
else
apply_through_coercion(other, __method__)
end
@@ -1772,7 +1625,7 @@ class Matrix
when Numeric
Scalar.new(@value - other)
when Vector, Matrix
- raise ErrOperationNotDefined, ["-", @value.class, other.class]
+ Scalar.Raise ErrOperationNotDefined, "-", @value.class, other.class
else
apply_through_coercion(other, __method__)
end
@@ -1789,12 +1642,12 @@ class Matrix
end
end
- def /(other)
+ def / (other)
case other
when Numeric
Scalar.new(@value / other)
when Vector
- raise ErrOperationNotDefined, ["/", @value.class, other.class]
+ Scalar.Raise ErrOperationNotDefined, "/", @value.class, other.class
when Matrix
self * other.inverse
else
@@ -1802,15 +1655,15 @@ class Matrix
end
end
- def **(other)
+ def ** (other)
case other
when Numeric
Scalar.new(@value ** other)
when Vector
- raise ErrOperationNotDefined, ["**", @value.class, other.class]
+ Scalar.Raise ErrOperationNotDefined, "**", @value.class, other.class
when Matrix
#other.powered_by(self)
- raise ErrOperationNotImplemented, ["**", @value.class, other.class]
+ Scalar.Raise ErrOperationNotImplemented, "**", @value.class, other.class
else
apply_through_coercion(other, __method__)
end
@@ -1830,14 +1683,10 @@ end
# * Vector.[](*array)
# * Vector.elements(array, copy = true)
# * Vector.basis(size: n, index: k)
-# * Vector.zero(n)
#
# To access elements:
# * #[](i)
#
-# To set elements:
-# * #[]=(i, v)
-#
# To enumerate the elements:
# * #each2(v)
# * #collect2(v)
@@ -1846,13 +1695,11 @@ end
# * #angle_with(v)
# * Vector.independent?(*vs)
# * #independent?(*vs)
-# * #zero?
#
# Vector arithmetic:
# * #*(x) "is matrix or number"
# * #+(v)
# * #-(v)
-# * #/(v)
# * #+@
# * #-@
#
@@ -1860,15 +1707,12 @@ end
# * #inner_product(v), dot(v)
# * #cross_product(v), cross(v)
# * #collect
-# * #collect!
# * #magnitude
# * #map
-# * #map!
# * #map2(v)
# * #norm
# * #normalize
# * #r
-# * #round
# * #size
#
# Conversion to other data types:
@@ -1921,17 +1765,6 @@ class Vector
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)
@@ -1942,11 +1775,7 @@ class Vector
# ACCESSING
#
- # :call-seq:
- # vector[range]
- # vector[integer]
- #
- # Returns element or elements of the vector.
+ # Returns element number +i+ (starting at zero) of the vector.
#
def [](i)
@elements[i]
@@ -1954,51 +1783,12 @@ class Vector
alias element []
alias component []
- #
- # :call-seq:
- # vector[range] = new_vector
- # vector[range] = row_matrix
- # vector[range] = new_element
- # vector[integer] = new_element
- #
- # Set element or elements of vector.
- #
def []=(i, v)
- raise FrozenError, "can't modify frozen Vector" if frozen?
- if i.is_a?(Range)
- range = Matrix::CoercionHelper.check_range(i, size, :vector)
- set_range(range, v)
- else
- index = Matrix::CoercionHelper.check_int(i, size, :index)
- set_value(index, v)
- end
+ @elements[i]= v
end
alias set_element []=
alias set_component []=
- private :set_element, :set_component
-
- private def set_value(index, value)
- @elements[index] = value
- end
-
- private def set_range(range, value)
- if value.is_a?(Vector)
- raise ArgumentError, "vector to be set has wrong size" unless range.size == value.size
- @elements[range] = value.elements
- elsif value.is_a?(Matrix)
- raise ErrDimensionMismatch unless value.row_count == 1
- @elements[range] = value.row(0).elements
- else
- @elements[range] = Array.new(range.size, value)
- end
- end
-
- # Returns a vector with entries rounded to the given precision
- # (see Float#round)
- #
- def round(ndigits=0)
- map{|e| e.round(ndigits)}
- end
+ private :[]=, :set_element, :set_component
#
# Returns the number of elements in the vector.
@@ -2025,7 +1815,7 @@ class Vector
#
def each2(v) # :yield: e1, e2
raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
- raise ErrDimensionMismatch if size != v.size
+ Vector.Raise ErrDimensionMismatch if size != v.size
return to_enum(:each2, v) unless block_given?
size.times do |i|
yield @elements[i], v[i]
@@ -2039,7 +1829,7 @@ class Vector
#
def collect2(v) # :yield: e1, e2
raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
- raise ErrDimensionMismatch if size != v.size
+ Vector.Raise ErrDimensionMismatch if size != v.size
return to_enum(:collect2, v) unless block_given?
Array.new(size) do |i|
yield @elements[i], v[i]
@@ -2062,7 +1852,7 @@ class Vector
def Vector.independent?(*vs)
vs.each do |v|
raise TypeError, "expected Vector, got #{v.class}" unless v.is_a?(Vector)
- raise ErrDimensionMismatch unless v.size == vs.first.size
+ Vector.Raise ErrDimensionMismatch unless v.size == vs.first.size
end
return false if vs.count > vs.first.size
Matrix[*vs].rank.eql?(vs.count)
@@ -2081,27 +1871,6 @@ class Vector
self.class.independent?(self, *vs)
end
- #
- # Returns +true+ iff all elements are zero.
- #
- def zero?
- all?(&:zero?)
- end
-
- def freeze
- @elements.freeze
- super
- end
-
- #
- # Called for dup & clone.
- #
- private def initialize_copy(v)
- super
- @elements = @elements.dup unless frozen?
- end
-
-
#--
# COMPARING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#++
@@ -2120,6 +1889,13 @@ class Vector
end
#
+ # Returns a copy of the vector.
+ #
+ def clone
+ self.class.elements(@elements)
+ end
+
+ #
# Returns a hash-code for the vector.
#
def hash
@@ -2131,7 +1907,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
@@ -2141,7 +1917,7 @@ class Vector
when Matrix
Matrix.column_vector(self) * x
when Vector
- raise ErrOperationNotDefined, ["*", self.class, x.class]
+ Vector.Raise ErrOperationNotDefined, "*", self.class, x.class
else
apply_through_coercion(x, __method__)
end
@@ -2153,7 +1929,7 @@ class Vector
def +(v)
case v
when Vector
- raise ErrDimensionMismatch if size != v.size
+ Vector.Raise ErrDimensionMismatch if size != v.size
els = collect2(v) {|v1, v2|
v1 + v2
}
@@ -2171,7 +1947,7 @@ class Vector
def -(v)
case v
when Vector
- raise ErrDimensionMismatch if size != v.size
+ Vector.Raise ErrDimensionMismatch if size != v.size
els = collect2(v) {|v1, v2|
v1 - v2
}
@@ -2192,7 +1968,7 @@ class Vector
els = @elements.collect{|e| e / x}
self.class.elements(els, false)
when Matrix, Vector
- raise ErrOperationNotDefined, ["/", self.class, x.class]
+ Vector.Raise ErrOperationNotDefined, "/", self.class, x.class
else
apply_through_coercion(x, __method__)
end
@@ -2215,7 +1991,7 @@ class Vector
# Vector[4,7].inner_product Vector[10,1] => 47
#
def inner_product(v)
- raise ErrDimensionMismatch if size != v.size
+ Vector.Raise ErrDimensionMismatch if size != v.size
p = 0
each2(v) {|v1, v2|
@@ -2242,7 +2018,7 @@ class Vector
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
- raise ErrDimensionMismatch unless v.size == size
+ Vector.Raise ErrDimensionMismatch unless v.size == size
end
case size
when 2
@@ -2267,18 +2043,7 @@ class Vector
els = @elements.collect(&block)
self.class.elements(els, false)
end
- alias_method :map, :collect
-
- #
- # Like Array#collect!
- #
- def collect!(&block)
- return to_enum(:collect!) unless block_given?
- raise FrozenError, "can't modify frozen Vector" if frozen?
- @elements.collect!(&block)
- self
- end
- alias map! collect!
+ alias map collect
#
# Returns the modulus (Pythagorean distance) of the vector.
@@ -2287,8 +2052,8 @@ class Vector
def magnitude
Math.sqrt(@elements.inject(0) {|v, e| v + e.abs2})
end
- alias_method :r, :magnitude
- alias_method :norm, :magnitude
+ alias r magnitude
+ alias norm magnitude
#
# Like Vector#collect2, but returns a Vector instead of an Array.
@@ -2314,21 +2079,17 @@ class Vector
end
#
- # Returns an angle with another vector. Result is within the [0..Math::PI].
+ # 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)
- raise ErrDimensionMismatch if size != v.size
+ Vector.Raise ErrDimensionMismatch if size != v.size
prod = magnitude * v.magnitude
raise ZeroVectorError, "Can't get angle of zero vector" if prod == 0
- dot = inner_product(v)
- if dot.abs >= prod
- dot.positive? ? 0 : Math::PI
- else
- Math.acos(dot / prod)
- end
+
+ Math.acos( inner_product(v) / prod )
end
#--
@@ -2349,25 +2110,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 bf6637635a..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/
@@ -43,7 +42,7 @@ class Matrix
def eigenvector_matrix
Matrix.send(:new, build_eigenvectors.transpose)
end
- alias_method :v, :eigenvector_matrix
+ alias v eigenvector_matrix
# Returns the inverse of the eigenvector matrix +V+
#
@@ -52,7 +51,7 @@ class Matrix
r = r.transpose.inverse unless @symmetric
r
end
- alias_method :v_inv, :eigenvector_matrix_inv
+ alias v_inv eigenvector_matrix_inv
# Returns the eigenvalues in an array
#
@@ -73,7 +72,7 @@ class Matrix
def eigenvalue_matrix
Matrix.diagonal(*eigenvalues)
end
- alias_method :d, :eigenvalue_matrix
+ alias d eigenvalue_matrix
# Returns [eigenvector_matrix, eigenvalue_matrix, eigenvector_matrix_inv]
#
@@ -82,8 +81,8 @@ class Matrix
end
alias_method :to_a, :to_ary
-
- private def build_eigenvectors
+ private
+ def build_eigenvectors
# JAMA stores complex eigenvectors in a strange way
# See http://web.archive.org/web/20111016032731/http://cio.nist.gov/esd/emaildir/lists/jama/msg01021.html
@e.each_with_index.map do |imag, i|
@@ -96,10 +95,9 @@ class Matrix
end
end
end
-
# Complex scalar division.
- private def cdiv(xr, xi, yr, yi)
+ def cdiv(xr, xi, yr, yi)
if (yr.abs > yi.abs)
r = yi/yr
d = yr + r*yi
@@ -114,125 +112,125 @@ class Matrix
# Symmetric Householder reduction to tridiagonal form.
- private def tridiagonalize
+ def tridiagonalize
# This is derived from the Algol procedures tred2 by
# Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
# 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.
- private def diagonalize
+ def diagonalize
# This is derived from the Algol procedures tql2, by
# Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
# Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
@@ -351,7 +349,7 @@ class Matrix
# Nonsymmetric reduction to Hessenberg form.
- private def reduce_to_hessenberg
+ def reduce_to_hessenberg
# This is derived from the Algol procedures orthes and ortran,
# by Martin and Wilkinson, Handbook for Auto. Comp.,
# Vol.ii-Linear Algebra, and the corresponding
@@ -441,9 +439,11 @@ class Matrix
end
end
+
+
# Nonsymmetric reduction from Hessenberg to real Schur form.
- private def hessenberg_to_real_schur
+ def hessenberg_to_real_schur
# This is derived from the Algol procedure hqr2,
# by Martin and Wilkinson, Handbook for Auto. Comp.,
@@ -458,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
@@ -727,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
@@ -749,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
@@ -761,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 e37def75f6..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
@@ -78,7 +77,7 @@ class Matrix
def det
if (@row_count != @column_count)
- raise Matrix::ErrDimensionMismatch
+ Matrix.Raise Matrix::ErrDimensionMismatch
end
d = @pivot_sign
@column_count.times do |j|
@@ -94,11 +93,11 @@ class Matrix
def solve b
if (singular?)
- raise Matrix::ErrNotRegular, "Matrix is singular."
+ Matrix.Raise Matrix::ErrNotRegular, "Matrix is singular."
end
if b.is_a? Matrix
if (b.row_count != @row_count)
- raise Matrix::ErrDimensionMismatch
+ Matrix.Raise Matrix::ErrDimensionMismatch
end
# Copy right hand side with pivoting
@@ -128,7 +127,7 @@ class Matrix
else # same algorithm, specialized for simpler case of a vector
b = convert_to_array(b)
if (b.size != @row_count)
- raise Matrix::ErrDimensionMismatch
+ Matrix.Raise Matrix::ErrDimensionMismatch
end
# Copy right hand side with pivoting
diff --git a/lib/matrix/matrix.gemspec b/lib/matrix/matrix.gemspec
deleted file mode 100644
index 75f6b69a98..0000000000
--- a/lib/matrix/matrix.gemspec
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-begin
- require_relative "lib/matrix/version"
-rescue LoadError
- # for Ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "matrix"
- spec.version = Matrix::VERSION
- spec.authors = ["Marc-Andre Lafortune"]
- spec.email = ["ruby-core@marc-andre.ca"]
-
- spec.summary = %q{An implementation of Matrix and Vector classes.}
- spec.description = %q{An implementation of Matrix and Vector classes.}
- spec.homepage = "https://github.com/ruby/matrix"
- spec.license = "BSD-2-Clause"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/matrix.rb", "lib/matrix/eigenvalue_decomposition.rb", "lib/matrix/lup_decomposition.rb", "lib/matrix/version.rb", "matrix.gemspec"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
-end
diff --git a/lib/matrix/version.rb b/lib/matrix/version.rb
deleted file mode 100644
index e6f91dae3c..0000000000
--- a/lib/matrix/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-class Matrix
- VERSION = "0.2.0"
-end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index eabccd48eb..b38bd2e4f4 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
@@ -7,9 +6,8 @@ require 'rbconfig'
require 'fileutils'
require 'shellwords'
+# :stopdoc:
class String
- # :stopdoc:
-
# Wraps a string in escaped quotes if it contains whitespace.
def quote
/\s/ =~ self ? "\"#{self}\"" : "#{self}"
@@ -32,20 +30,15 @@ class String
def sans_arguments
self[/\A[^()]+/]
end
-
- # :startdoc:
end
class Array
- # :stopdoc:
-
# Wraps all strings in escaped quotes if they contain whitespace.
def quote
map {|s| s.quote}
end
-
- # :startdoc:
end
+# :startdoc:
##
# mkmf.rb is used by Ruby C extensions to generate a Makefile which will
@@ -135,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
@@ -181,7 +177,7 @@ module MakeMakefile
]
def install_dirs(target_prefix = nil)
- if $extout and $extmk
+ if $extout
dirs = [
['BINDIR', '$(extout)/bin'],
['RUBYCOMMONDIR', '$(extout)/common'],
@@ -247,12 +243,7 @@ module MakeMakefile
$topdir ||= RbConfig::CONFIG["topdir"]
$arch_hdrdir = "$(extout)/include/$(arch)"
else
- abort <<MESSAGE
-mkmf.rb can't find header files for ruby at #{$hdrdir}/ruby.h
-
-You might have to install separate package for the ruby development
-environment, ruby-dev or ruby-devel for example.
-MESSAGE
+ abort "mkmf.rb can't find header files for ruby at #{$hdrdir}/ruby.h"
end
CONFTEST = "conftest".freeze
@@ -260,7 +251,6 @@ MESSAGE
OUTFLAG = CONFIG['OUTFLAG']
COUTFLAG = CONFIG['COUTFLAG']
- CSRCFLAG = CONFIG['CSRCFLAG']
CPPOUTFILE = config_string('CPPOUTFILE') {|str| str.sub(/\bconftest\b/, CONFTEST)}
def rm_f(*files)
@@ -397,9 +387,8 @@ MESSAGE
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
@@ -434,10 +423,6 @@ EOM
EOM
end
- def conftest_source
- CONFTEST_C
- end
-
def create_tmpsrc(src)
src = "#{COMMON_HEADERS}\n#{src}"
src = yield(src) if block_given?
@@ -446,7 +431,7 @@ EOM
src.sub!(/[^\n]\z/, "\\&\n")
count = 0
begin
- open(conftest_source, "wb") do |cfile|
+ open(CONFTEST_C, "wb") do |cfile|
cfile.print src
end
rescue Errno::EACCES
@@ -478,13 +463,14 @@ MSG
xsystem(command, *opts)
ensure
log_src(src)
+ MakeMakefile.rm_rf "#{CONFTEST}.dSYM"
end
end
- def link_config(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_source}",
+ 'src' => "#{CONFTEST_C}",
'arch_hdrdir' => $arch_hdrdir.quote,
'top_srcdir' => $top_srcdir.quote,
'INCFLAGS' => "#$INCFLAGS",
@@ -495,29 +481,21 @@ MSG
'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
'LIBS' => "#{librubyarg} #{opt} #$LIBS")
conf['LIBPATH'] = libpathflag(libpath.map {|s| RbConfig::expand(s.dup, conf)})
- conf
- end
-
- def link_command(ldflags, *opts)
- conf = link_config(ldflags, *opts)
RbConfig::expand(TRY_LINK.dup, conf)
end
- def cc_config(opt="")
+ def cc_command(opt="")
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
'arch_hdrdir' => $arch_hdrdir.quote,
'top_srcdir' => $top_srcdir.quote)
- conf
- end
-
- def cc_command(opt="")
- conf = cc_config(opt)
RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
conf)
end
def cpp_command(outfile, opt="")
- conf = cc_config(opt)
+ conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
+ 'arch_hdrdir' => $arch_hdrdir.quote,
+ 'top_srcdir' => $top_srcdir.quote)
if $universal and (arch_flag = conf['ARCH_FLAG']) and !arch_flag.empty?
conf['ARCH_FLAG'] = arch_flag.gsub(/(?:\G|\s)-arch\s+\S+/, '')
end
@@ -525,7 +503,7 @@ MSG
conf)
end
- def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
+ def libpathflag(libpath=$LIBPATH|$DEFLIBPATH)
libpath.map{|x|
case x
when "$(topdir)", /\A\./
@@ -548,7 +526,6 @@ MSG
end
def try_link0(src, opt="", *opts, &b) # :nodoc:
- exe = CONFTEST+$EXEEXT
cmd = link_command("", opt)
if $universal
require 'tmpdir'
@@ -562,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
@@ -579,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
@@ -594,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}*"
@@ -629,69 +603,38 @@ 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
- end
+ def try_cppflags(flags)
+ try_header(MAIN_DOES_NOTHING, flags)
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
- end
+ def try_cflags(flags)
+ try_compile(MAIN_DOES_NOTHING, flags)
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
- end
+ def try_ldflags(flags)
+ try_link(MAIN_DOES_NOTHING, flags)
end
def try_static_assert(expr, headers = nil, opt = "", &b)
@@ -756,7 +699,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
@@ -775,8 +718,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})())"}
@@ -796,14 +737,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
@@ -816,7 +756,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
@@ -969,10 +909,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
@@ -985,10 +925,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
@@ -1019,9 +956,9 @@ SRC
# <code>--with-FOOlib</code> configuration option.
#
def have_library(lib, func = nil, headers = nil, opt = "", &b)
- dir_config(lib)
+ 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
@@ -1045,10 +982,10 @@ SRC
# library paths searched and linked against.
#
def find_library(lib, func, *paths, &b)
- dir_config(lib)
+ 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
@@ -1119,7 +1056,6 @@ SRC
# +HAVE_FOO_H+ preprocessor macro would be passed to the compiler.
#
def have_header(header, preheaders = nil, opt = "", &b)
- dir_config(header[/.*?(?=\/)|.*?(?=\.)/])
checking_for header do
if try_header(cpp_include(preheaders)+cpp_include(header), opt, &b)
$defs.push(format("-DHAVE_%s", header.tr_cpp))
@@ -1358,7 +1294,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
@@ -1401,7 +1337,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.
#
@@ -1511,7 +1447,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"
@@ -1522,7 +1458,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)
@@ -1545,7 +1481,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)
@@ -1584,7 +1520,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}
@@ -1763,10 +1698,6 @@ SRC
# application.
#
def dir_config(target, idefault=nil, ldefault=nil)
- if conf = $config_dirs[target]
- return conf
- end
-
if dir = with_config(target + "-dir", (idefault unless ldefault))
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
idefault = ldefault = nil
@@ -1797,7 +1728,7 @@ SRC
end
$LIBPATH = ldirs | $LIBPATH
- $config_dirs[target] = [idir, ldir]
+ [idir, ldir]
end
# Returns compile/link information about an installed library in a
@@ -1813,7 +1744,7 @@ SRC
#
# Where {option} is, for instance, <code>--cflags</code>.
#
- # The values obtained are appended to +$INCFLAGS+, +$CFLAGS+, +$LDFLAGS+ and
+ # The values obtained are appended to +$CFLAGS+, +$LDFLAGS+ and
# +$libs+.
#
# If an <code>option</code> argument is given, the config command is
@@ -1825,12 +1756,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")
@@ -1840,8 +1770,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
@@ -1869,9 +1798,9 @@ SRC
$LDFLAGS = [orig_ldflags, ldflags].join(' ')
Logging::message "package configuration for %s\n", pkg
- Logging::message "incflags: %s\ncflags: %s\nldflags: %s\nlibs: %s\n\n",
- incflags, cflags, ldflags, libs
- [[incflags, cflags].join(' '), ldflags, libs]
+ Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
+ cflags, ldflags, libs
+ [cflags, ldflags, libs]
else
Logging::message "package configuration for %s is not found\n", pkg
nil
@@ -1933,8 +1862,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. ####
@@ -1960,7 +1889,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
@@ -1974,7 +1903,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
@@ -1982,7 +1910,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
@@ -1990,7 +1917,6 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
headers << '$(RUBY_EXTCONF_H)' if $extconf_h
mk << %{
-CC_WRAPPER = #{CONFIG['CC_WRAPPER']}
CC = #{CONFIG['CC']}
CXX = #{CONFIG['CXX']}
LIBRUBY = #{CONFIG['LIBRUBY']}
@@ -2000,15 +1926,12 @@ 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}
-cppflags = #{CONFIG['cppflags']}
CCDLFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']}
CFLAGS = $(CCDLFLAGS) #$CFLAGS $(ARCH_FLAG)
INCFLAGS = -I. #$INCFLAGS
@@ -2050,21 +1973,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:
@@ -2076,7 +2006,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
@@ -2134,6 +2063,7 @@ RULES
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
line.gsub!(/\{\$\(VPATH\)\}/, "") unless $nmake
line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h)
+ line.gsub!(%r"\$\(hdrdir\)/(?!ruby(?![^:;/\s]))(?=[-\w]+\.h)", '\&ruby/')
if $nmake && /\A\s*\$\(RM|COPY\)/ =~ line
line.gsub!(%r"[-\w\./]{2,}"){$&.tr("/", "\\")}
line.gsub!(/(\$\((?!RM|COPY)[^:)]+)(?=\))/, '\1:/=\\')
@@ -2155,10 +2085,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
@@ -2218,7 +2145,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
@@ -2239,15 +2166,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(',')}}"
@@ -2268,10 +2191,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)'
@@ -2282,7 +2205,7 @@ RULES
origdef ||= ''
if $extout and $INSTALLFILES
- $cleanfiles.concat($INSTALLFILES.collect {|files, dir|File.join(dir, files.delete_prefix('./'))})
+ $cleanfiles.concat($INSTALLFILES.collect {|files, dir|File.join(dir, files.sub(/\A\.\//, ''))})
$distcleandirs.concat($INSTALLFILES.collect {|files, dir| dir})
end
@@ -2298,9 +2221,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}
@@ -2317,7 +2243,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)
@@ -2325,28 +2250,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
@@ -2364,19 +2282,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"
@@ -2387,12 +2304,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
@@ -2402,7 +2317,7 @@ 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")
if defined?($installed_list) and !$extout
@@ -2418,21 +2333,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
@@ -2454,6 +2361,7 @@ site-install-rb: install-rb
return unless target
+ mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b
mfile.print ".SUFFIXES: .#{(SRC_EXT + [$OBJEXT, $ASMEXT]).compact.join(' .')}\n"
mfile.print "\n"
@@ -2479,10 +2387,11 @@ site-install-rb: install-rb
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"
@@ -2503,7 +2412,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")
@@ -2526,23 +2435,15 @@ site-install-rb: install-rb
$enable_shared = config['ENABLE_SHARED'] == 'yes'
$defs = []
$extconf_h = nil
- $config_dirs = {}
-
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
end
$warnflags = config['warnflags'] unless $extmk
end
- if (w = rbconfig['CC_WRAPPER']) and !w.empty? and !File.executable?(w)
- rbconfig['CC_WRAPPER'] = config['CC_WRAPPER'] = ''
- end
$CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup
$CXXFLAGS = (with_config("cxxflags", arg_config("CXXFLAGS", config["CXXFLAGS"]))||'').dup
$ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
@@ -2569,7 +2470,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']
@@ -2586,7 +2486,6 @@ site-install-rb: install-rb
$extout_prefix ||= nil
$arg_config.clear
- $config_dirs.clear
dir_config("opt")
end
@@ -2622,8 +2521,7 @@ MESSAGE
src = src.sub(/\{/) do
$& +
"\n if (argc > 1000000) {\n" +
- refs.map {|n|" int (* volatile #{n}p)(void)=(int (*)(void))&#{n};\n"}.join("") +
- refs.map {|n|" printf(\"%d\", (*#{n}p)());\n"}.join("") +
+ refs.map {|n|" printf(\"%p\", &#{n});\n"}.join("") +
" }\n"
end
end
@@ -2639,6 +2537,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'
@@ -2697,12 +2597,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)$<'
+ COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
##
# Command which will translate C files to assembler sources in the generated Makefile
@@ -2747,7 +2647,7 @@ MESSAGE
##
# A C main function which does no work
- MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || "int main(int argc, char **argv)\n{\n return !!argv[argc];\n}"
+ MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || "int main(int argc, char **argv)\n{\n return 0;\n}"
UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
%w[int short long long\ long]
@@ -2775,51 +2675,6 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
realclean: distclean
"
-
- @lang = Hash.new(self)
-
- def self.[](name)
- @lang.fetch(name)
- end
-
- def self.[]=(name, mod)
- @lang[name] = mod
- end
-
- self["C++"] = Module.new do
- include MakeMakefile
- extend self
-
- CONFTEST_CXX = "#{CONFTEST}.#{config_string('CXX_EXT') || CXX_EXT[0]}"
-
- TRY_LINK_CXX = config_string('TRY_LINK_CXX') ||
- ((cmd = TRY_LINK.gsub(/\$\(C(?:C|(FLAGS))\)/, '$(CXX\1)')) != TRY_LINK && cmd) ||
- "$(CXX) #{OUTFLAG}#{CONFTEST}#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) " \
- "$(CXXFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
-
- def have_devel?
- unless defined? @have_devel
- @have_devel = true
- @have_devel = try_link(MAIN_DOES_NOTHING)
- end
- @have_devel
- end
-
- def conftest_source
- CONFTEST_CXX
- end
-
- def cc_command(opt="")
- conf = cc_config(opt)
- RbConfig::expand("$(CXX) #$INCFLAGS #$CPPFLAGS #$CXXFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_CXX}",
- conf)
- end
-
- def link_command(ldflags, *opts)
- conf = link_config(ldflags, *opts)
- RbConfig::expand(TRY_LINK_CXX.dup, conf)
- end
- end
end
include MakeMakefile
diff --git a/lib/monitor.rb b/lib/monitor.rb
new file mode 100644
index 0000000000..07394b5900
--- /dev/null
+++ b/lib/monitor.rb
@@ -0,0 +1,300 @@
+# = monitor.rb
+#
+# Copyright (C) 2001 Shugo Maeda <shugo@ruby-lang.org>
+#
+# This library is distributed under the terms of the Ruby license.
+# 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
+# monitor is that its methods are executed with mutual exclusion. That is, at
+# each point in time, at most one thread may be executing any of its methods.
+# This mutual exclusion greatly simplifies reasoning about the implementation
+# of monitors compared to reasoning about parallel code that updates a data
+# structure.
+#
+# You can read more about the general principles on the Wikipedia page for
+# Monitors[http://en.wikipedia.org/wiki/Monitor_%28synchronization%29]
+#
+# == Examples
+#
+# === Simple object.extend
+#
+# require 'monitor.rb'
+#
+# buf = []
+# buf.extend(MonitorMixin)
+# empty_cond = buf.new_cond
+#
+# # consumer
+# Thread.start do
+# loop do
+# buf.synchronize do
+# empty_cond.wait_while { buf.empty? }
+# print buf.shift
+# end
+# end
+# end
+#
+# # producer
+# while line = ARGF.gets
+# buf.synchronize do
+# buf.push(line)
+# empty_cond.signal
+# end
+# end
+#
+# The consumer thread waits for the producer thread to push a line to buf
+# while <tt>buf.empty?</tt>. The producer thread (main thread) reads a
+# line from ARGF and pushes it into buf then calls <tt>empty_cond.signal</tt>
+# to notify the consumer thread of new data.
+#
+# === Simple Class include
+#
+# require 'monitor'
+#
+# class SynchronizedArray < Array
+#
+# include MonitorMixin
+#
+# def initialize(*args)
+# super(*args)
+# end
+#
+# alias :old_shift :shift
+# alias :old_unshift :unshift
+#
+# def shift(n=1)
+# self.synchronize do
+# self.old_shift(n)
+# end
+# end
+#
+# def unshift(item)
+# self.synchronize do
+# self.old_unshift(item)
+# end
+# end
+#
+# # other methods ...
+# end
+#
+# +SynchronizedArray+ implements an Array with synchronized access to items.
+# This Class is implemented as subclass of Array which includes the
+# MonitorMixin module.
+#
+module MonitorMixin
+ #
+ # FIXME: This isn't documented in Nutshell.
+ #
+ # Since MonitorMixin.new_cond returns a ConditionVariable, and the example
+ # above calls while_wait and signal, this class should be documented.
+ #
+ class ConditionVariable
+ class Timeout < Exception; end
+
+ #
+ # Releases the lock held in the associated monitor 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.
+ #
+ def wait(timeout = nil)
+ @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
+
+ #
+ # Calls wait repeatedly while the given block yields a truthy value.
+ #
+ def wait_while
+ while yield
+ wait
+ end
+ end
+
+ #
+ # Calls wait repeatedly until the given block yields a truthy value.
+ #
+ def wait_until
+ until yield
+ wait
+ end
+ end
+
+ #
+ # Wakes up the first thread in line waiting for this lock.
+ #
+ def signal
+ @monitor.__send__(:mon_check_owner)
+ @cond.signal
+ end
+
+ #
+ # Wakes up all threads waiting for this lock.
+ #
+ def broadcast
+ @monitor.__send__(:mon_check_owner)
+ @cond.broadcast
+ end
+
+ private
+
+ def initialize(monitor)
+ @monitor = monitor
+ @cond = ::ConditionVariable.new
+ end
+ end
+
+ def self.extend_object(obj)
+ super(obj)
+ obj.__send__(:mon_initialize)
+ end
+
+ #
+ # Attempts to enter exclusive section. Returns +false+ if lock fails.
+ #
+ def mon_try_enter
+ if @mon_owner != Thread.current
+ unless @mon_mutex.try_lock
+ return false
+ end
+ @mon_owner = Thread.current
+ end
+ @mon_count += 1
+ return true
+ end
+ # For backward compatibility
+ alias try_mon_enter mon_try_enter
+
+ #
+ # Enters exclusive section.
+ #
+ def mon_enter
+ if @mon_owner != Thread.current
+ @mon_mutex.lock
+ @mon_owner = Thread.current
+ end
+ @mon_count += 1
+ end
+
+ #
+ # Leaves exclusive section.
+ #
+ def mon_exit
+ mon_check_owner
+ @mon_count -=1
+ if @mon_count == 0
+ @mon_owner = nil
+ @mon_mutex.unlock
+ end
+ end
+
+ #
+ # Enters exclusive section and executes the block. Leaves the exclusive
+ # section automatically when the block exits. See example under
+ # +MonitorMixin+.
+ #
+ def mon_synchronize
+ mon_enter
+ begin
+ yield
+ ensure
+ mon_exit
+ end
+ end
+ alias synchronize mon_synchronize
+
+ #
+ # Creates a new MonitorMixin::ConditionVariable associated with the
+ # receiver.
+ #
+ def new_cond
+ return ConditionVariable.new(self)
+ end
+
+ private
+
+ # Use <tt>extend MonitorMixin</tt> or <tt>include MonitorMixin</tt> instead
+ # of this constructor. Have look at the examples above to understand how to
+ # use this module.
+ def initialize(*args)
+ super
+ mon_initialize
+ end
+
+ # Initializes the MonitorMixin after being included in a class or when an
+ # object has been extended with the MonitorMixin
+ def mon_initialize
+ @mon_owner = nil
+ @mon_count = 0
+ @mon_mutex = Mutex.new
+ end
+
+ def mon_check_owner
+ if @mon_owner != Thread.current
+ raise ThreadError, "current thread not owner"
+ end
+ end
+
+ def mon_enter_for_cond(count)
+ @mon_owner = Thread.current
+ @mon_count = count
+ end
+
+ def mon_exit_for_cond
+ count = @mon_count
+ @mon_owner = nil
+ @mon_count = 0
+ return count
+ end
+end
+
+# Use the Monitor class when you want to have a lock object for blocks with
+# mutual exclusion.
+#
+# require 'monitor'
+#
+# lock = Monitor.new
+# lock.synchronize do
+# # exclusive access
+# end
+#
+class Monitor
+ include MonitorMixin
+ alias try_enter try_mon_enter
+ alias enter mon_enter
+ alias exit mon_exit
+end
+
+
+# Documentation comments:
+# - All documentation comes from Nutshell.
+# - MonitorMixin.new_cond appears in the example, but is not documented in
+# Nutshell.
+# - All the internals (internal modules Accessible and Initializable, class
+# ConditionVariable) appear in RDoc. It might be good to hide them, by
+# making them private, or marking them :nodoc:, etc.
+# - RDoc doesn't recognise aliases, so we have mon_synchronize documented, but
+# not synchronize.
+# - mon_owner is in Nutshell, but appears as an accessor in a separate module
+# here, so is hard/impossible to RDoc. Some other useful accessors
+# (mon_count and some queue stuff) are also in this module, and don't appear
+# directly in the RDoc output.
+# - in short, it may be worth changing the code layout in this file to make the
+# documentation easier
+
+# Local variables:
+# mode: Ruby
+# tab-width: 8
+# End:
diff --git a/lib/mutex_m.gemspec b/lib/mutex_m.gemspec
deleted file mode 100644
index 409ed5b7b2..0000000000
--- a/lib/mutex_m.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-begin
- require_relative "lib/mutex_m"
-rescue LoadError
- # for Ruby core repository
- require_relative "mutex_m"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "mutex_m"
- spec.version = Mutex_m::VERSION
- spec.authors = ["Keiju ISHITSUKA"]
- spec.email = ["keiju@ruby-lang.org"]
-
- spec.summary = %q{Mixin to extend objects to be handled like a Mutex.}
- spec.description = %q{Mixin to extend objects to be handled like a Mutex.}
- spec.homepage = "https://github.com/ruby/mutex_m"
- spec.license = "BSD-2-Clause"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/mutex_m.rb", "mutex_m.gemspec"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "test-unit"
-end
diff --git a/lib/mutex_m.rb b/lib/mutex_m.rb
index dd47934bea..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
@@ -25,23 +27,16 @@
# obj.extend Mutex_m
#
# Or mixin Mutex_m into your module to your class inherit Mutex instance
-# methods --- remember to call super() in your class initialize method.
+# methods.
#
# class Foo
# include Mutex_m
-# def initialize
-# # ...
-# super()
-# end
# # ...
# end
# obj = Foo.new
# # this obj can be handled like Mutex
#
module Mutex_m
-
- VERSION = "0.1.0"
-
def Mutex_m.define_aliases(cl) # :nodoc:
cl.module_eval %q{
alias locked? mu_locked?
@@ -106,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 d1e545c0c8..c9b80c6804 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
#
@@ -17,12 +16,7 @@
require "socket"
require "monitor"
-require_relative "protocol"
-require "time"
-begin
- require "openssl"
-rescue LoadError
-end
+require "net/protocol"
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,13 +100,6 @@ 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,
@@ -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
@@ -440,16 +301,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 +340,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 +368,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
@@ -521,13 +382,13 @@ module Net
# Constructs a TCPServer socket
def makeport # :nodoc:
- Addrinfo.tcp(@bare_sock.local_address.ip_address, 0).listen
+ TCPServer.open(@sock.addr[3], 0)
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 +405,41 @@ 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)
+ sendport(sock.addr[3], sock.addr[1])
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 +459,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
@@ -631,7 +487,9 @@ module Net
with_binary(true) do
begin
conn = transfercmd(cmd, rest_offset)
- while data = conn.read(blocksize)
+ loop do
+ data = conn.read(blocksize)
+ break if data == nil
yield(data)
end
conn.shutdown(Socket::SHUT_WR)
@@ -656,7 +514,9 @@ module Net
with_binary(false) do
begin
conn = transfercmd(cmd)
- while line = conn.gets
+ loop do
+ line = conn.gets
+ break if line == nil
yield(line.sub(/\r?\n\z/, ""), !line.match(/\n\z/).nil?)
end
conn.shutdown(Socket::SHUT_WR)
@@ -682,18 +542,14 @@ module Net
end
synchronize do
with_binary(true) do
- begin
- conn = transfercmd(cmd)
- while buf = file.read(blocksize)
- conn.write(buf)
- yield(buf) if block_given?
- end
- conn.shutdown(Socket::SHUT_WR)
- conn.read_timeout = 1
- conn.read
- ensure
- conn.close if conn
+ conn = transfercmd(cmd)
+ loop do
+ buf = file.read(blocksize)
+ break if buf == nil
+ conn.write(buf)
+ yield(buf) if block_given?
end
+ conn.close
voidresp
end
end
@@ -715,21 +571,17 @@ module Net
def storlines(cmd, file) # :yield: line
synchronize do
with_binary(false) do
- begin
- conn = transfercmd(cmd)
- while buf = file.gets
- if buf[-2, 2] != CRLF
- buf = buf.chomp + CRLF
- end
- conn.write(buf)
- yield(buf) if block_given?
+ conn = transfercmd(cmd)
+ loop do
+ buf = file.gets
+ break if buf == nil
+ if buf[-2, 2] != CRLF
+ buf = buf.chomp + CRLF
end
- conn.shutdown(Socket::SHUT_WR)
- conn.read_timeout = 1
- conn.read
- ensure
- conn.close if conn
+ conn.write(buf)
+ yield(buf) if block_given?
end
+ conn.close
voidresp
end
end
@@ -749,30 +601,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
@@ -783,25 +634,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
@@ -834,13 +683,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
@@ -853,9 +702,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
@@ -891,7 +740,7 @@ module Net
def nlst(dir = nil)
cmd = "NLST"
if dir
- cmd = "#{cmd} #{dir}"
+ cmd = cmd + " " + dir
end
files = []
retrlines(cmd) do |line|
@@ -907,238 +756,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
@@ -1159,41 +810,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
@@ -1201,7 +851,7 @@ module Net
# Removes a remote directory.
#
def rmdir(dirname)
- voidcmd("RMD #{dirname}")
+ voidcmd("RMD " + dirname)
end
#
@@ -1218,10 +868,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
#
@@ -1241,16 +891,10 @@ module Net
#
# Returns the status (STAT command).
#
- # pathname:: when stat is invoked with pathname as a parameter it acts like
- # list but a lot 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
@@ -1261,9 +905,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
@@ -1303,41 +947,6 @@ module Net
end
#
- # Issues a FEAT command
- #
- # Returns an array of supported optional features
- #
- def features
- resp = sendcmd("FEAT")
- if !resp.start_with?("211")
- raise FTPReplyError, resp
- end
-
- feats = []
- resp.split("\n").each do |line|
- next if !line.start_with?(' ') # skip status lines
-
- feats << line.strip
- end
-
- return feats
- end
-
- #
- # Issues an OPTS command
- # - name Should be the name of the option to set
- # - params is any optional parameters to supply with the option
- #
- # example: option('UTF8', 'ON') => 'OPTS UTF8 ON'
- #
- def option(name, params = nil)
- cmd = "OPTS #{name}"
- cmd += " #{params}" if params
-
- voidcmd(cmd)
- end
-
- #
# Closes the connection. Further operations are impossible until you open
# a new connection with #connect.
#
@@ -1366,7 +975,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)
@@ -1382,7 +991,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)
@@ -1419,11 +1028,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
@@ -1435,10 +1044,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
@@ -1460,7 +1086,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)
}
@@ -1468,11 +1094,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
@@ -1493,37 +1119,6 @@ module Net
return line
end
end
-
- if defined?(OpenSSL::SSL::SSLSocket)
- class BufferedSSLSocket < BufferedSocket
- def initialize(*args, **options)
- 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 88a174a248..bceee1c069 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
@@ -35,7 +34,7 @@ module Net #:nodoc:
#
# Net::HTTP provides a rich library which can be used to build HTTP
# user-agents. For more details about HTTP see
- # [RFC2616](http://www.ietf.org/rfc/rfc2616.txt).
+ # [RFC2616](http://www.ietf.org/rfc/rfc2616.txt)
#
# Net::HTTP is designed to work closely with URI. URI::HTTP#host,
# URI::HTTP#port and URI::HTTP#request_uri are designed to work with
@@ -87,7 +86,7 @@ module Net #:nodoc:
#
# == How to use Net::HTTP
#
- # The following example code can be used as the basis of an HTTP user-agent
+ # The following example code can be used as the basis of a HTTP user-agent
# which can perform a variety of request types using persistent
# connections.
#
@@ -104,13 +103,14 @@ module Net #:nodoc:
# open for multiple requests in the block if the server indicates it
# supports persistent connections.
#
- # If you wish to re-use a connection across multiple HTTP requests without
- # automatically closing it you can use ::new and then call #start and
- # #finish manually.
- #
# The request types Net::HTTP supports are listed below in the section "HTTP
# Request Classes".
#
+ # If you wish to re-use a connection across multiple HTTP requests without
+ # automatically closing it you can use ::new instead of ::start. #request
+ # will automatically open a connection to the server if one is not currently
+ # open. You can manually close the connection with #finish.
+ #
# For all the Net::HTTP request objects and shortcut request methods you may
# supply either a String for the request path or a URI from which Net::HTTP
# will extract the request path.
@@ -169,7 +169,7 @@ module Net #:nodoc:
# === POST
#
# A POST can be made using the Net::HTTP::Post request class. This example
- # creates a URL encoded POST body:
+ # creates a urlencoded POST body:
#
# uri = URI('http://www.example.com/todo.cgi')
# req = Net::HTTP::Post.new(uri)
@@ -186,10 +186,13 @@ module Net #:nodoc:
# res.value
# end
#
- # To send multipart/form-data use Net::HTTPHeader#set_form:
+ # At this time Net::HTTP does not support multipart/form-data. To send
+ # multipart/form-data use Net::HTTPRequest#body= and
+ # Net::HTTPRequest#content_type=:
#
# req = Net::HTTP::Post.new(uri)
- # req.set_form([['upload', File.open('foo.bar')]], 'multipart/form-data')
+ # req.body = multipart_data
+ # req.content_type = 'multipart/form-data'
#
# Other requests that can contain a body such as PUT can be created in the
# same way using the corresponding request class (Net::HTTP::Put).
@@ -218,7 +221,7 @@ module Net #:nodoc:
# === Basic Authentication
#
# Basic authentication is performed according to
- # [RFC2617](http://www.ietf.org/rfc/rfc2617.txt).
+ # [RFC2617](http://www.ietf.org/rfc/rfc2617.txt)
#
# uri = URI('http://example.com/index.html?key=value')
#
@@ -256,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 an HTTPS URL. Net::HTTP automatically turns 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
#
@@ -371,7 +369,6 @@ module Net #:nodoc:
# HTTPPreconditionRequired:: 428
# HTTPTooManyRequests:: 429
# HTTPRequestHeaderFieldsTooLarge:: 431
- # HTTPUnavailableForLegalReasons:: 451
# HTTPServerError:: 5xx
# HTTPInternalServerError:: 500
# HTTPNotImplemented:: 501
@@ -485,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:
@@ -556,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.
@@ -571,8 +550,8 @@ module Net #:nodoc:
# _opt_ :: optional hash
#
# _opt_ sets following values by its accessor.
- # The keys are ipaddr, ca_file, ca_path, cert, cert_store, ciphers,
- # close_on_empty_response, key, open_timeout, read_timeout, write_timeout, ssl_timeout,
+ # The keys are ca_file, ca_path, cert, cert_store, ciphers,
+ # close_on_empty_response, key, open_timeout, read_timeout, ssl_timeout,
# ssl_version, use_ssl, verify_callback, verify_depth and verify_mode.
# If you set :use_ssl as true, you can use https and default value of
# verify_mode is set as OpenSSL::SSL::VERIFY_PEER.
@@ -587,10 +566,8 @@ 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)
- http.ipaddr = opt[:ipaddr] if opt && opt[:ipaddr]
if opt
if opt[:use_ssl]
@@ -624,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()
@@ -642,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
@@ -661,7 +633,6 @@ module Net #:nodoc:
def initialize(address, port = nil)
@address = address
@port = (port || HTTP.default_port)
- @ipaddr = nil
@local_host = nil
@local_port = nil
@curr_http_version = HTTPVersion
@@ -670,11 +641,9 @@ module Net #:nodoc:
@close_on_empty_response = false
@socket = nil
@started = false
- @open_timeout = 60
+ @open_timeout = nil
@read_timeout = 60
- @write_timeout = 60
@continue_timeout = nil
- @max_retries = 1
@debug_output = nil
@proxy_from_env = false
@@ -687,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
@@ -707,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
@@ -729,21 +699,10 @@ module Net #:nodoc:
attr_writer :proxy_user
attr_writer :proxy_pass
- # The IP address to connect to/used to connect to
- def ipaddr
- started? ? @socket.io.peeraddr[3] : @ipaddr
- end
-
- # Set the IP address to connect to
- def ipaddr=(addr)
- raise IOError, "ipaddr value changed, but session already started" if started?
- @ipaddr = addr
- end
-
# 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)
@@ -752,41 +711,12 @@ module Net #:nodoc:
# it raises a Net::ReadTimeout exception. The default value is 60 seconds.
attr_reader :read_timeout
- # Number of seconds to wait for one block to be written (via one write(2)
- # call). Any number may be used, including Floats for fractional
- # seconds. If the HTTP object cannot write data in this many seconds,
- # it raises a Net::WriteTimeout exception. The default value is 60 seconds.
- # Net::WriteTimeout is not raised on Windows.
- attr_reader :write_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
@read_timeout = sec
end
- # Setter for the write_timeout attribute.
- def write_timeout=(sec)
- @socket.write_timeout = sec if @socket
- @write_timeout = sec
- end
-
# Seconds to wait for 100 Continue response. If the HTTP object does not
# receive a response in this many seconds it sends the request body. The
# default value is +nil+.
@@ -839,8 +769,6 @@ module Net #:nodoc:
:@key,
:@ssl_timeout,
:@ssl_version,
- :@min_version,
- :@max_version,
:@verify_callback,
:@verify_depth,
:@verify_mode,
@@ -854,8 +782,6 @@ module Net #:nodoc:
:key,
:ssl_timeout,
:ssl_version,
- :min_version,
- :max_version,
:verify_callback,
:verify_depth,
:verify_mode,
@@ -890,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
@@ -947,42 +867,20 @@ module Net #:nodoc:
def connect
if proxy? then
- conn_addr = proxy_address
- conn_port = proxy_port
+ conn_address = proxy_address
+ conn_port = proxy_port
else
- conn_addr = conn_address
- conn_port = port
+ conn_address = address
+ conn_port = port
end
- D "opening connection to #{conn_addr}:#{conn_port}..."
+ D "opening connection to #{conn_address}:#{conn_port}..."
s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
- begin
- TCPSocket.open(conn_addr, conn_port, @local_host, @local_port)
- rescue => e
- raise e, "Failed to open TCP connection to " +
- "#{conn_addr}:#{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,
- write_timeout: @write_timeout,
- continue_timeout: @continue_timeout,
- debug_output: @debug_output)
- buf = "CONNECT #{conn_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|
@@ -993,36 +891,47 @@ 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_addr}:#{conn_port}..."
+ 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)
+ D "SSL established"
+ end
+ @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
+ # 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 if @ssl_session
+ end
+ 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
- D "SSL established, protocol: #{s.ssl_version}, cipher: #{s.cipher[0]}"
end
- @socket = BufferedIO.new(s, read_timeout: @read_timeout,
- write_timeout: @write_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
- end
- raise
end
private :connect
@@ -1039,7 +948,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
@@ -1106,7 +1015,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
@@ -1116,17 +1029,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
@@ -1135,35 +1046,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
@@ -1174,7 +1070,7 @@ module Net #:nodoc:
# without proxy, obsolete
def conn_address # :nodoc:
- @ipaddr || address()
+ address()
end
def conn_port # :nodoc:
@@ -1182,12 +1078,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
@@ -1517,13 +1409,7 @@ module Net #:nodoc:
begin
begin_transport req
res = catch(:response) {
- begin
- req.exec @socket, @curr_http_version, edit_path(req.path)
- rescue Errno::EPIPE
- # Failure when writing full request, but we can probably
- # still read the received response.
- end
-
+ req.exec @socket, @curr_http_version, edit_path(req.path)
begin
res = HTTPResponse.read_new(@socket)
res.decode_content = req.decode_content
@@ -1539,18 +1425,18 @@ module Net #:nodoc:
rescue Net::OpenTimeout
raise
rescue Net::ReadTimeout, IOError, EOFError,
- Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, Errno::ETIMEDOUT,
+ Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE,
# 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
@@ -1558,23 +1444,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
@@ -1595,7 +1475,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
@@ -1646,10 +1526,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)
@@ -1661,17 +1542,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 da5f7a70fc..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.
@@ -20,14 +19,7 @@ class Net::HTTPServerException < Net::ProtoServerError
# We cannot use the name "HTTPServerError", it is the name of the response.
include Net::HTTPExceptions
end
-
-# for compatibility
-Net::HTTPClientException = Net::HTTPServerException
-
class Net::HTTPFatalError < Net::ProtoFatalError
include Net::HTTPExceptions
end
-module Net
- deprecate_constant(:HTTPServerException)
-end
diff --git a/lib/net/http/generic_request.rb b/lib/net/http/generic_request.rb
index 003f59d0ac..959a3c6510 100644
--- a/lib/net/http/generic_request.rb
+++ b/lib/net/http/generic_request.rb
@@ -1,8 +1,7 @@
-# frozen_string_literal: false
-# HTTPGenericRequest is the parent of the Net::HTTPRequest class.
-# Do not use this directly; use a subclass of Net::HTTPRequest.
+# HTTPGenericRequest is the parent of the HTTPRequest class.
+# Do not use this directly; use a subclass of HTTPRequest.
#
-# Mixes in the Net::HTTPHeader module to provide easier access to HTTP headers.
+# Mixes in the HTTPHeader module to provide easier access to HTTP headers.
#
class Net::HTTPGenericRequest
@@ -14,8 +13,6 @@ class Net::HTTPGenericRequest
@response_has_body = resbody
if URI === uri_or_path then
- raise ArgumentError, "not an HTTP URI" unless URI::HTTP === uri_or_path
- raise ArgumentError, "no host component for URI" unless uri_or_path.hostname
@uri = uri_or_path.dup
host = @uri.hostname.dup
host << ":".freeze << @uri.port.to_s if @uri.port != @uri.default_port
@@ -84,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
@@ -170,8 +167,9 @@ class Net::HTTPGenericRequest
def write(buf)
# avoid memcpy() of buf, buf can huge and eat memory bandwidth
- rv = buf.bytesize
- @sock.write("#{rv.to_s(16)}\r\n", buf, "\r\n")
+ @sock.write("#{buf.bytesize.to_s(16)}\r\n")
+ rv = @sock.write(buf)
+ @sock.write("\r\n")
rv
end
@@ -300,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
@@ -311,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
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb
index 8641be4eae..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: 3 if key?(key) and $VERBOSE
- if value.nil?
- warn "net/http: nil HTTP header: #{key}", uplevel: 3 if $VERBOSE
- else
- value = value.strip # raise error for invalid byte sequences
- if value.count("\r\n") > 0
- raise ArgumentError, "header #{key} has field value #{value.inspect}, this cannot include CR/LF"
- end
- @header[key.downcase.to_s] = [value]
- end
+ warn "net/http: warning: duplicated HTTP header: #{key}" if key?(key) and $VERBOSE
+ @header[key.downcase] = [value.strip]
end
end
@@ -36,17 +27,17 @@ module Net::HTTPHeader
# Returns the header field corresponding to the case-insensitive key.
# For example, a key of "Content-Type" might return "text/html"
def [](key)
- a = @header[key.downcase.to_s] or return nil
+ a = @header[key.downcase] or return nil
a.join(', ')
end
# Sets the header field corresponding to the case-insensitive key.
def []=(key, val)
unless val
- @header.delete key.downcase.to_s
+ @header.delete key.downcase
return val
end
- set_field(key, val)
+ @header[key.downcase] = [val]
end
# [Ruby 1.8.3]
@@ -65,39 +56,10 @@ module Net::HTTPHeader
# p request.get_fields('X-My-Header') #=> ["a", "b", "c"]
#
def add_field(key, val)
- stringified_downcased_key = key.downcase.to_s
- if @header.key?(stringified_downcased_key)
- append_field_value(@header[stringified_downcased_key], val)
+ if @header.key?(key.downcase)
+ @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.to_s] = 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.to_s] = [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
+ @header[key.downcase] = [val]
end
end
@@ -113,9 +75,8 @@ module Net::HTTPHeader
# #=> "session=al98axx; expires=Fri, 31-Dec-1999 23:58:23, query=rubyscript; expires=Fri, 31-Dec-1999 23:58:23"
#
def get_fields(key)
- stringified_downcased_key = key.downcase.to_s
- return nil unless @header[stringified_downcased_key]
- @header[stringified_downcased_key].dup
+ return nil unless @header[key.downcase]
+ @header[key.downcase].dup
end
# Returns the header field corresponding to the case-insensitive key.
@@ -123,21 +84,19 @@ module Net::HTTPHeader
# raises an IndexError if there's no header field named +key+
# See Hash#fetch
def fetch(key, *args, &block) #:yield: +key+
- a = @header.fetch(key.downcase.to_s, *args, &block)
+ a = @header.fetch(key.downcase, *args, &block)
a.kind_of?(Array) ? a.join(', ') : a
end
# Iterates through the header names and values, passing in the name
# and value to the code block supplied.
#
- # 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
@@ -147,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
@@ -162,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
@@ -173,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
@@ -184,12 +137,12 @@ module Net::HTTPHeader
# Removes a header field, specified by case-insensitive key.
def delete(key)
- @header.delete(key.downcase.to_s)
+ @header.delete(key.downcase)
end
# true if +key+ header exists.
def key?(key)
- @header.key?(key.downcase.to_s)
+ @header.key?(key.downcase)
end
# Returns a Hash consisting of header names and array of values.
@@ -206,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
@@ -218,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
@@ -323,7 +274,7 @@ module Net::HTTPHeader
end
# Returns "true" if the "transfer-encoding" header is present and
- # set to "chunked". This is an HTTP/1.1 feature, allowing
+ # set to "chunked". This is an HTTP/1.1 feature, allowing the
# the content to be sent in "chunks" without at the outset
# stating the entire content length.
def chunked?
@@ -422,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
@@ -475,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 5a94f95694..126c22160d 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
@@ -8,13 +7,11 @@
# header values both via hash-like methods and via individual readers.
#
# Note that each possible HTTP response code defines its own
-# HTTPResponse subclass. All classes are defined under the Net module.
-# Indentation indicates inheritance. For a list of the classes see Net::HTTP.
+# HTTPResponse subclass. These are listed below.
#
-# Correspondence <code>HTTP code => class</code> is stored in CODE_TO_OBJ
-# constant:
+# All classes are defined under the Net module. Indentation indicates
+# inheritance. For a list of the classes see Net::HTTP.
#
-# Net::HTTPResponse::CODE_TO_OBJ['404'] #=> Net::HTTPNotFound
#
class Net::HTTPResponse
class << self
@@ -119,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:
@@ -142,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
@@ -176,10 +171,6 @@ class Net::HTTPResponse
# If a block is given, the body is passed to the block, and
# the body is provided in fragments, as it is read in from the socket.
#
- # If +dest+ argument is given, response is read into that variable,
- # with <code>dest#<<</code> method (it could be String or IO, or any
- # other object responding to <code><<</code>).
- #
# Calling this method a second or subsequent time for the same
# HTTPResponse object will return the value already read.
#
@@ -248,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:
@@ -260,7 +251,7 @@ class Net::HTTPResponse
return yield @socket if self['content-range']
v = self['content-encoding']
- case v&.downcase
+ case v && v.downcase
when 'deflate', 'gzip', 'x-gzip' then
self.delete 'content-encoding'
@@ -386,7 +377,6 @@ class Net::HTTPResponse
end
block = proc do |compressed_chunk|
@inflate.inflate(compressed_chunk) do |chunk|
- compressed_chunk.clear
dest << chunk
end
end
diff --git a/lib/net/http/responses.rb b/lib/net/http/responses.rb
index 50352032df..1454a27a3e 100644
--- a/lib/net/http/responses.rb
+++ b/lib/net/http/responses.rb
@@ -1,6 +1,4 @@
-# frozen_string_literal: true
# :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
@@ -19,7 +17,7 @@ class Net::HTTPRedirection < Net::HTTPResponse # 3xx
end
class Net::HTTPClientError < Net::HTTPResponse # 4xx
HAS_BODY = true
- EXCEPTION_TYPE = Net::HTTPClientException # for backward compatibility
+ EXCEPTION_TYPE = Net::HTTPServerException # for backward compatibility
end
class Net::HTTPServerError < Net::HTTPResponse # 5xx
HAS_BODY = true
@@ -32,12 +30,7 @@ end
class Net::HTTPSwitchProtocol < Net::HTTPInformation # 101
HAS_BODY = false
end
-class Net::HTTPProcessing < Net::HTTPInformation # 102
- HAS_BODY = false
-end
-class Net::HTTPEarlyHints < Net::HTTPInformation # 103 - RFC 8297
- HAS_BODY = false
-end
+# 102 - RFC 2518; removed in RFC 4918
class Net::HTTPOK < Net::HTTPSuccess # 200
HAS_BODY = true
@@ -63,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
@@ -122,10 +113,9 @@ end
class Net::HTTPProxyAuthenticationRequired < Net::HTTPClientError # 407
HAS_BODY = true
end
-class Net::HTTPRequestTimeout < Net::HTTPClientError # 408
+class Net::HTTPRequestTimeOut < Net::HTTPClientError # 408
HAS_BODY = true
end
-Net::HTTPRequestTimeOut = Net::HTTPRequestTimeout
class Net::HTTPConflict < Net::HTTPClientError # 409
HAS_BODY = true
end
@@ -138,30 +128,24 @@ end
class Net::HTTPPreconditionFailed < Net::HTTPClientError # 412
HAS_BODY = true
end
-class Net::HTTPPayloadTooLarge < Net::HTTPClientError # 413
+class Net::HTTPRequestEntityTooLarge < Net::HTTPClientError # 413
HAS_BODY = true
end
-Net::HTTPRequestEntityTooLarge = Net::HTTPPayloadTooLarge
-class Net::HTTPURITooLong < Net::HTTPClientError # 414
+class Net::HTTPRequestURITooLong < Net::HTTPClientError # 414
HAS_BODY = true
end
-Net::HTTPRequestURITooLong = Net::HTTPURITooLong
Net::HTTPRequestURITooLarge = Net::HTTPRequestURITooLong
class Net::HTTPUnsupportedMediaType < Net::HTTPClientError # 415
HAS_BODY = true
end
-class Net::HTTPRangeNotSatisfiable < Net::HTTPClientError # 416
+class Net::HTTPRequestedRangeNotSatisfiable < Net::HTTPClientError # 416
HAS_BODY = true
end
-Net::HTTPRequestedRangeNotSatisfiable = Net::HTTPRangeNotSatisfiable
class Net::HTTPExpectationFailed < Net::HTTPClientError # 417
HAS_BODY = true
end
# 418 I'm a teapot - RFC 2324; a joke RFC
# 420 Enhance Your Calm - Twitter
-class Net::HTTPMisdirectedRequest < Net::HTTPClientError # 421 - RFC 7540
- HAS_BODY = true
-end
class Net::HTTPUnprocessableEntity < Net::HTTPClientError # 422 - RFC 4918
HAS_BODY = true
end
@@ -184,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
@@ -204,26 +185,19 @@ end
class Net::HTTPServiceUnavailable < Net::HTTPServerError # 503
HAS_BODY = true
end
-class Net::HTTPGatewayTimeout < Net::HTTPServerError # 504
+class Net::HTTPGatewayTimeOut < Net::HTTPServerError # 504
HAS_BODY = true
end
-Net::HTTPGatewayTimeOut = Net::HTTPGatewayTimeout
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
@@ -239,8 +213,6 @@ class Net::HTTPResponse
CODE_TO_OBJ = {
'100' => Net::HTTPContinue,
'101' => Net::HTTPSwitchProtocol,
- '102' => Net::HTTPProcessing,
- '103' => Net::HTTPEarlyHints,
'200' => Net::HTTPOK,
'201' => Net::HTTPCreated,
@@ -250,7 +222,6 @@ class Net::HTTPResponse
'205' => Net::HTTPResetContent,
'206' => Net::HTTPPartialContent,
'207' => Net::HTTPMultiStatus,
- '208' => Net::HTTPAlreadyReported,
'226' => Net::HTTPIMUsed,
'300' => Net::HTTPMultipleChoices,
@@ -260,7 +231,6 @@ class Net::HTTPResponse
'304' => Net::HTTPNotModified,
'305' => Net::HTTPUseProxy,
'307' => Net::HTTPTemporaryRedirect,
- '308' => Net::HTTPPermanentRedirect,
'400' => Net::HTTPBadRequest,
'401' => Net::HTTPUnauthorized,
@@ -270,17 +240,16 @@ class Net::HTTPResponse
'405' => Net::HTTPMethodNotAllowed,
'406' => Net::HTTPNotAcceptable,
'407' => Net::HTTPProxyAuthenticationRequired,
- '408' => Net::HTTPRequestTimeout,
+ '408' => Net::HTTPRequestTimeOut,
'409' => Net::HTTPConflict,
'410' => Net::HTTPGone,
'411' => Net::HTTPLengthRequired,
'412' => Net::HTTPPreconditionFailed,
- '413' => Net::HTTPPayloadTooLarge,
- '414' => Net::HTTPURITooLong,
+ '413' => Net::HTTPRequestEntityTooLarge,
+ '414' => Net::HTTPRequestURITooLong,
'415' => Net::HTTPUnsupportedMediaType,
- '416' => Net::HTTPRangeNotSatisfiable,
+ '416' => Net::HTTPRequestedRangeNotSatisfiable,
'417' => Net::HTTPExpectationFailed,
- '421' => Net::HTTPMisdirectedRequest,
'422' => Net::HTTPUnprocessableEntity,
'423' => Net::HTTPLocked,
'424' => Net::HTTPFailedDependency,
@@ -288,20 +257,17 @@ class Net::HTTPResponse
'428' => Net::HTTPPreconditionRequired,
'429' => Net::HTTPTooManyRequests,
'431' => Net::HTTPRequestHeaderFieldsTooLarge,
- '451' => Net::HTTPUnavailableForLegalReasons,
'500' => Net::HTTPInternalServerError,
'501' => Net::HTTPNotImplemented,
'502' => Net::HTTPBadGateway,
'503' => Net::HTTPServiceUnavailable,
- '504' => Net::HTTPGatewayTimeout,
+ '504' => Net::HTTPGatewayTimeOut,
'505' => Net::HTTPVersionNotSupported,
- '506' => Net::HTTPVariantAlsoNegotiates,
'507' => Net::HTTPInsufficientStorage,
- '508' => Net::HTTPLoopDetected,
- '510' => Net::HTTPNotExtended,
'511' => Net::HTTPNetworkAuthenticationRequired,
}
end
# :startdoc:
+
diff --git a/lib/net/http/status.rb b/lib/net/http/status.rb
deleted file mode 100644
index 8db3f7d9e3..0000000000
--- a/lib/net/http/status.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-# frozen_string_literal: true
-
-require_relative '../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',
- 103 => 'Early Hints',
- 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 d46721c82a..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,10 +13,10 @@
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
-require_relative 'http'
+require 'net/http'
require 'openssl'
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index aa46e47ef1..0517ca1385 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_relative '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
@@ -814,13 +808,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 +853,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 +919,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 +931,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
@@ -999,7 +969,7 @@ module Net
def self.decode_utf7(s)
return s.gsub(/&([^-]+)?-/n) {
if $1
- ($1.tr(",", "/") + "===").unpack1("m").encode(Encoding::UTF_8, Encoding::UTF_16BE)
+ ($1.tr(",", "/") + "===").unpack("m")[0].encode(Encoding::UTF_8, Encoding::UTF_16BE)
else
"&"
end
@@ -1012,8 +982,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 +1025,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 +1053,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 +1066,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,15 +1094,6 @@ module Net
end
end
- def tcp_socket(host, port)
- s = Socket.tcp(host, port, :connect_timeout => @open_timeout)
- s.setsockopt(:SOL_SOCKET, :SO_KEEPALIVE, true)
- s
- 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
@@ -1164,13 +1121,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)
@@ -1225,7 +1177,7 @@ module Net
end
def get_response
- buff = String.new
+ buff = ""
while true
s = @sock.gets(CRLF)
break unless s
@@ -1260,7 +1212,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"
@@ -1306,12 +1258,8 @@ module Net
when Integer
NumValidator.ensure_number(data)
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
@@ -1320,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)
@@ -1358,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|
@@ -1388,7 +1326,7 @@ module Net
else
put_string(" ")
end
- send_data(i, tag)
+ send_data(i)
end
put_string(")")
end
@@ -1423,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)
@@ -1435,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
@@ -1530,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
@@ -1553,7 +1486,7 @@ module Net
end
class Atom # :nodoc:
- def send_data(imap, tag)
+ def send_data(imap)
imap.send(:put_string, @data)
end
@@ -1568,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
@@ -1583,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
@@ -1598,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
@@ -1674,15 +1607,6 @@ module Net
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)
@@ -1698,14 +1622,6 @@ module Net
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}"
- raise DataFormatError, msg
- end
end
end
@@ -2035,7 +1951,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
@@ -2062,7 +1979,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
@@ -2091,7 +2009,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
@@ -2151,7 +2070,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
@@ -2256,10 +2176,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
@@ -2267,13 +2183,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
@@ -2372,8 +2283,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
@@ -2806,7 +2715,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)
@@ -2863,16 +2772,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
@@ -3238,7 +3137,7 @@ module Net
if atom
atom
else
- symbol = flag.capitalize.intern
+ symbol = flag.capitalize.untaint.intern
@flag_symbols[symbol] = true
if @flag_symbols.length > IMAP.max_flag_count
raise FlagCountError, "number of flag symbols exceeded"
@@ -3297,7 +3196,7 @@ module Net
end
def atom
- result = String.new
+ result = ""
while true
token = lookahead
if atom_token?(token)
@@ -3716,10 +3615,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 8712345301..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.
@@ -549,17 +548,16 @@ module Net
context = OpenSSL::SSL::SSLContext.new
context.set_params(@ssl_params)
s = OpenSSL::SSL::SSLSocket.new(s, context)
- s.hostname = @address
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?
@@ -571,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
@@ -602,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
@@ -759,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
#
@@ -772,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|
@@ -786,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|
@@ -800,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
@@ -820,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
@@ -832,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
@@ -845,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|
@@ -899,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/pop/net-pop.gemspec b/lib/net/pop/net-pop.gemspec
deleted file mode 100644
index 8166968d7d..0000000000
--- a/lib/net/pop/net-pop.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-begin
- require_relative "lib/net/pop/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "net-pop"
- spec.version = Net::POP3::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Ruby client library for POP3.}
- spec.description = %q{Ruby client library for POP3.}
- spec.homepage = "https://github.com/ruby/net-pop"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/net/pop/version.rb b/lib/net/pop/version.rb
deleted file mode 100644
index ef5c295cc3..0000000000
--- a/lib/net/pop/version.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Net
- class Protocol; end
- class POP3 < Protocol
- VERSION = "0.1.0"
- end
-end
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 07fbc6a21f..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
@@ -75,54 +55,20 @@ module Net # :nodoc:
# ReadTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be read within the read_timeout.
- class ReadTimeout < Timeout::Error
- def initialize(io = nil)
- @io = io
- end
- attr_reader :io
-
- def message
- msg = super
- if @io
- msg = "#{msg} with #{@io.inspect}"
- end
- msg
- end
- end
-
- ##
- # WriteTimeout, a subclass of Timeout::Error, is raised if a chunk of the
- # response cannot be written within the write_timeout. Not raised on Windows.
-
- class WriteTimeout < Timeout::Error
- def initialize(io = nil)
- @io = io
- end
- attr_reader :io
-
- def message
- msg = super
- if @io
- msg = "#{msg} with #{@io.inspect}"
- end
- msg
- end
- end
+ class ReadTimeout < Timeout::Error; end
class BufferedIO #:nodoc: internal use only
- def initialize(io, read_timeout: 60, write_timeout: 60, continue_timeout: nil, debug_output: nil)
+ def initialize(io)
@io = io
- @read_timeout = read_timeout
- @write_timeout = write_timeout
- @continue_timeout = continue_timeout
- @debug_output = debug_output
- @rbuf = ''.b
+ @read_timeout = 60
+ @continue_timeout = nil
+ @debug_output = nil
+ @rbuf = ''
end
attr_reader :io
attr_accessor :read_timeout
- attr_accessor :write_timeout
attr_accessor :continue_timeout
attr_accessor :debug_output
@@ -148,19 +94,17 @@ module Net # :nodoc:
public
- def read(len, dest = ''.b, 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
@@ -168,14 +112,13 @@ module Net # :nodoc:
dest
end
- def read_all(dest = ''.b)
+ 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
@@ -206,33 +149,27 @@ module Net # :nodoc:
BUFSIZE = 1024 * 16
def rbuf_fill
- tmp = @rbuf.empty? ? @rbuf : nil
- case rv = @io.read_nonblock(BUFSIZE, tmp, exception: false)
- when String
- return if rv.equal?(tmp)
- @rbuf << rv
- rv.clear
- return
- when :wait_readable
- (io = @io.to_io).wait_readable(@read_timeout) or raise Net::ReadTimeout.new(io)
- # 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 = @io.to_io).wait_writable(@read_timeout) or raise Net::ReadTimeout.new(io)
- # 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)
- if len == @rbuf.size
- s = @rbuf
- @rbuf = ''.b
- else
- s = @rbuf.slice!(0, len)
- end
+ s = @rbuf.slice!(0, len)
@debug_output << %Q[-> #{s.dump}\n] if @debug_output
s
end
@@ -243,9 +180,9 @@ module Net # :nodoc:
public
- def write(*strs)
+ def write(str)
writing {
- write0(*strs)
+ write0 str
}
end
@@ -269,34 +206,11 @@ module Net # :nodoc:
bytes
end
- def write0(*strs)
- @debug_output << strs.map(&:dump).join if @debug_output
- orig_written_bytes = @written_bytes
- strs.each_with_index do |str, i|
- need_retry = true
- case len = @io.write_nonblock(str, exception: false)
- when Integer
- @written_bytes += len
- len -= str.bytesize
- if len == 0
- if strs.size == i+1
- return @written_bytes - orig_written_bytes
- else
- need_retry = false
- # next string
- end
- elsif len < 0
- str = str.byteslice(len, -len)
- else # len > 0
- need_retry = false
- # next string
- end
- # continue looping
- when :wait_writable
- (io = @io.to_io).wait_writable(@write_timeout) or raise Net::WriteTimeout.new(io)
- # continue looping
- end while need_retry
- end
+ def write0(str)
+ @debug_output << str.dump if @debug_output
+ len = @io.write(str)
+ @written_bytes += len
+ len
end
#
@@ -322,7 +236,7 @@ module Net # :nodoc:
class InternetMessageIO < BufferedIO #:nodoc: internal use only
- def initialize(*, **)
+ def initialize(io)
super
@wbuf = nil
end
@@ -337,7 +251,7 @@ module Net # :nodoc:
read_bytes = 0
while (line = readuntil("\r\n")) != ".\r\n"
read_bytes += line.size
- yield line.delete_prefix('.')
+ yield line.sub(/\A\./, '')
end
LOG_on()
LOG "read message (#{read_bytes} bytes)"
@@ -399,7 +313,7 @@ module Net # :nodoc:
end
def using_each_crlf_line
- @wbuf = ''.b
+ @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 460ad08233..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.
@@ -38,7 +40,7 @@ module Net
include SMTPError
end
- # Represents SMTP error code 4xx, a temporary error.
+ # Represents SMTP error code 420 or 450, a temporary error.
class SMTPServerBusy < ProtoServerError
include SMTPError
end
@@ -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
@@ -831,6 +835,9 @@ module Net
end
def mailfrom(from_addr)
+ if $SAFE > 0
+ raise SecurityError, 'tainted from_addr' if from_addr.tainted?
+ end
getok("MAIL FROM:<#{from_addr}>")
end
@@ -856,6 +863,9 @@ module Net
end
def rcptto(to_addr)
+ if $SAFE > 0
+ raise SecurityError, 'tainted to_addr' if to_addr.tainted?
+ end
getok("RCPT TO:<#{to_addr}>")
end
@@ -915,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()
@@ -933,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"
@@ -1029,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/smtp/net-smtp.gemspec b/lib/net/smtp/net-smtp.gemspec
deleted file mode 100644
index e9635cd091..0000000000
--- a/lib/net/smtp/net-smtp.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-begin
- require_relative "lib/net/smtp/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "net-smtp"
- spec.version = Net::SMTP::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Simple Mail Transfer Protocol client library for Ruby.}
- spec.description = %q{Simple Mail Transfer Protocol client library for Ruby.}
- spec.homepage = "https://github.com/ruby/net-smtp"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/net/smtp/version.rb b/lib/net/smtp/version.rb
deleted file mode 100644
index 7f5aaaa6db..0000000000
--- a/lib/net/smtp/version.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Net
- class Protocol; end
- class SMTP < Protocol
- VERSION = "0.1.0"
- end
-end
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/observer/observer.gemspec b/lib/observer/observer.gemspec
deleted file mode 100644
index 625a30eada..0000000000
--- a/lib/observer/observer.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-begin
- require_relative "lib/observer/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "observer"
- spec.version = Observer::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Implementation of the Observer object-oriented design pattern.}
- spec.description = spec.summary
- spec.homepage = "https://github.com/ruby/observer"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- # Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/observer/version.rb b/lib/observer/version.rb
deleted file mode 100644
index 92b5098774..0000000000
--- a/lib/observer/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-module Observer
- VERSION = "0.1.0"
-end
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index c52f67f525..e49a09b192 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'
@@ -10,38 +9,23 @@ module Kernel
alias open_uri_original_open open # :nodoc:
end
- def open(name, *rest, **kw, &block) # :nodoc:
- if (name.respond_to?(:open) && !name.respond_to?(:to_path)) ||
- (name.respond_to?(:to_str) &&
- %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name &&
- (uri = URI.parse(name)).respond_to?(:open))
- warn('calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open', uplevel: 1)
- URI.open(name, *rest, **kw, &block)
- else
- open_uri_original_open(name, *rest, **kw, &block)
- end
- end
- module_function :open
-end
-
-module URI
# Allows the opening of various resources including URIs.
#
# If the first argument responds to the 'open' method, 'open' is called on
# it with the rest of the arguments.
#
- # If the first argument is a string that begins with <code>(protocol)://<code>, it is parsed by
+ # If the first argument is a string that begins with xxx://, it is parsed by
# URI.parse. If the parsed object responds to the 'open' method,
# 'open' is called on it with the rest of the arguments.
#
- # Otherwise, Kernel#open is called.
+ # Otherwise, the original Kernel#open is called.
#
# OpenURI::OpenRead#open provides URI::HTTP#open, URI::HTTPS#open and
# URI::FTP#open, Kernel#open.
#
# We can accept URIs and strings that begin with http://, https:// and
# ftp://. In these cases, the opened file object is extended by OpenURI::Meta.
- def self.open(name, *rest, &block)
+ def open(name, *rest, &block) # :doc:
if name.respond_to?(:open)
name.open(*rest, &block)
elsif name.respond_to?(:to_str) &&
@@ -50,10 +34,9 @@ module URI
uri.open(*rest, &block)
else
open_uri_original_open(name, *rest, &block)
- # After Kernel#open override is removed:
- #super
end
end
+ module_function :open
end
# OpenURI is an easy-to-use wrapper for Net::HTTP, Net::HTTPS and Net::FTP.
@@ -62,14 +45,14 @@ end
#
# It is possible to open an http, https or ftp URL as though it were a file:
#
-# URI.open("http://www.ruby-lang.org/") {|f|
+# open("http://www.ruby-lang.org/") {|f|
# f.each_line {|line| p line}
# }
#
# The opened file has several getter methods for its meta-information, as
# follows, since it is extended by OpenURI::Meta.
#
-# URI.open("http://www.ruby-lang.org/en") {|f|
+# open("http://www.ruby-lang.org/en") {|f|
# f.each_line {|line| p line}
# p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
# p f.content_type # "text/html"
@@ -80,7 +63,7 @@ end
#
# Additional header fields can be specified by an optional hash argument.
#
-# URI.open("http://www.ruby-lang.org/en/",
+# open("http://www.ruby-lang.org/en/",
# "User-Agent" => "Ruby/#{RUBY_VERSION}",
# "From" => "foo@bar.invalid",
# "Referer" => "http://www.ruby-lang.org/") {|f|
@@ -90,11 +73,11 @@ end
# The environment variables such as http_proxy, https_proxy and ftp_proxy
# are in effect by default. Here we disable proxy:
#
-# URI.open("http://www.ruby-lang.org/en/", :proxy => nil) {|f|
+# open("http://www.ruby-lang.org/en/", :proxy => nil) {|f|
# # ...
# }
#
-# See OpenURI::OpenRead.open and URI.open for more on available options.
+# See OpenURI::OpenRead.open and Kernel#open for more on available options.
#
# URI objects can be opened in a similar way.
#
@@ -124,7 +107,6 @@ module OpenURI
:ssl_verify_mode => nil,
:ftp_active_mode => false,
:redirect => true,
- :encoding => nil,
}
def OpenURI.check_options(options) # :nodoc:
@@ -158,12 +140,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' ||
@@ -272,7 +248,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:
@@ -293,9 +269,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
@@ -311,8 +284,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
@@ -363,7 +335,6 @@ module OpenURI
if options[:progress_proc] && Net::HTTPSuccess === resp
options[:progress_proc].call(buf.size)
end
- str.clear
}
}
}
@@ -552,16 +523,17 @@ module OpenURI
# It can be used to guess charset.
#
# If charset parameter and block is not given,
- # nil is returned except text type.
- # In that case, "utf-8" is returned as defined by RFC6838 4.2.1
+ # nil is returned except text type in HTTP.
+ # In that case, "iso-8859-1" is returned as defined by RFC2616 3.7.1.
def charset
type, *parameters = content_type_parse
if pair = parameters.assoc('charset')
pair.last.downcase
elsif block_given?
yield
- elsif type && %r{\Atext/} =~ type
- "utf-8" # RFC6838 4.2.1
+ elsif type && %r{\Atext/} =~ type &&
+ @base_uri && /\Ahttp\z/i =~ @base_uri.scheme
+ "iso-8859-1" # RFC2616 3.7.1
else
nil
end
@@ -661,8 +633,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.
@@ -800,7 +772,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 5e725317a4..6ec4a941d2 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -1,5 +1,3 @@
-# frozen_string_literal: true
-
#
# = open3.rb: Popen, but with stderr, too
#
@@ -81,13 +79,7 @@ module Open3
# If merged stdout and stderr output is not a problem, you can use Open3.popen2e.
# If you really need stdout and stderr output as separate strings, you can consider Open3.capture3.
#
- def popen3(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
+ def popen3(*cmd, **opts, &block)
in_r, in_w = IO.pipe
opts[:in] = in_r
in_w.sync = true
@@ -142,13 +134,7 @@ module Open3
# p o.read #=> "*"
# }
#
- def popen2(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
+ def popen2(*cmd, **opts, &block)
in_r, in_w = IO.pipe
opts[:in] = in_r
in_w.sync = true
@@ -191,13 +177,7 @@ module Open3
# }
# }
#
- def popen2e(*cmd, &block)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
+ def popen2e(*cmd, **opts, &block)
in_r, in_w = IO.pipe
opts[:in] = in_r
in_w.sync = true
@@ -212,13 +192,13 @@ module Open3
def popen_run(cmd, opts, child_io, parent_io) # :nodoc:
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
@@ -268,16 +248,7 @@ module Open3
# STDOUT.binmode; print thumbnail
# end
#
- def capture3(*cmd)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- stdin_data = opts.delete(:stdin_data) || ''
- binmode = opts.delete(:binmode)
-
+ def capture3(*cmd, stdin_data: '', binmode: false, **opts)
popen3(*cmd, opts) {|i, o, e, t|
if binmode
i.binmode
@@ -287,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
@@ -329,16 +296,7 @@ module Open3
# End
# image, s = Open3.capture2("gnuplot", :stdin_data=>gnuplot_commands, :binmode=>true)
#
- def capture2(*cmd)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- stdin_data = opts.delete(:stdin_data)
- binmode = opts.delete(:binmode)
-
+ def capture2(*cmd, stdin_data: nil, binmode: false, **opts)
popen2(*cmd, opts) {|i, o, t|
if binmode
i.binmode
@@ -347,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
@@ -377,16 +331,7 @@ module Open3
# # capture make log
# make_log, s = Open3.capture2e("make")
#
- def capture2e(*cmd)
- if Hash === cmd.last
- opts = cmd.pop.dup
- else
- opts = {}
- end
-
- stdin_data = opts.delete(:stdin_data)
- binmode = opts.delete(:binmode)
-
+ def capture2e(*cmd, stdin_data: nil, binmode: false, **opts)
popen2e(*cmd, opts) {|i, oe, t|
if binmode
i.binmode
@@ -395,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
@@ -451,13 +392,7 @@ module Open3
# stdin.close # send EOF to sort.
# p stdout.read #=> " 1\tbar\n 2\tbaz\n 3\tfoo\n"
# }
- def pipeline_rw(*cmds, &block)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
+ def pipeline_rw(*cmds, **opts, &block)
in_r, in_w = IO.pipe
opts[:in] = in_r
in_w.sync = true
@@ -507,13 +442,7 @@ module Open3
# p ts[1].value #=> #<Process::Status: pid 24913 exit 0>
# }
#
- def pipeline_r(*cmds, &block)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
+ def pipeline_r(*cmds, **opts, &block)
out_r, out_w = IO.pipe
opts[:out] = out_w
@@ -549,13 +478,7 @@ module Open3
# i.puts "hello"
# }
#
- def pipeline_w(*cmds, &block)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
+ def pipeline_w(*cmds, **opts, &block)
in_r, in_w = IO.pipe
opts[:in] = in_r
in_w.sync = true
@@ -608,13 +531,7 @@ module Open3
# p err_r.read # error messages of pdftops and lpr.
# }
#
- def pipeline_start(*cmds, &block)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
+ def pipeline_start(*cmds, **opts, &block)
if block
pipeline_run(cmds, opts, [], [], &block)
else
@@ -676,15 +593,9 @@ module Open3
# # 106
# # 202
#
- def pipeline(*cmds)
- if Hash === cmds.last
- opts = cmds.pop.dup
- else
- opts = {}
- end
-
+ def pipeline(*cmds, **opts)
pipeline_run(cmds, opts, [], []) {|ts|
- ts.map(&:value)
+ ts.map {|t| t.value }
}
end
module_function :pipeline
@@ -728,18 +639,18 @@ module Open3
end
pid = spawn(*cmd, cmd_opts)
wait_thrs << Process.detach(pid)
- r&.close
- w2&.close
+ r.close if r
+ w2.close if w2
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/open3/open3.gemspec b/lib/open3/open3.gemspec
deleted file mode 100644
index 65ddaa4723..0000000000
--- a/lib/open3/open3.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-begin
- require_relative "lib/open3/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "open3"
- spec.version = Open3::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Popen, but with stderr, too}
- spec.description = spec.summary
- spec.homepage = "https://github.com/ruby/open3"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = spec.homepage
-
- # Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/open3/version.rb b/lib/open3/version.rb
deleted file mode 100644
index c670b79ebc..0000000000
--- a/lib/open3/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-module Open3
- VERSION = "0.1.0"
-end
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 614ebc3eae..4f7d7c899d 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# optparse.rb - command-line option analysis with the OptionParser class.
#
@@ -118,145 +117,7 @@
# #=>
# # Usage: example.rb [options]
# # -n, --name=NAME Name to say hello to
-# # -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:
-#
-# $ ruby optparse-test.rb -r
-# optparse-test.rb:9:in `<main>': missing argument: -r (OptionParser::MissingArgument)
-# $ 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 below.
-#
-# ==== 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:
-#
-# $ ruby optparse-test.rb -t nonsense
-# ... invalid argument: -t nonsense (OptionParser::InvalidArgument)
-# $ ruby optparse-test.rb -t 10-11-12
-# 2010-11-12 00:00:00 -0500
-# $ 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!
-#
-# Used:
-#
-# $ ruby optparse-test.rb --user 1
-# #<struct User id=1, name="Sam">
-# $ ruby optparse-test.rb --user 2
-# #<struct User id=2, name="Gandalf">
-# $ ruby optparse-test.rb --user 3
-# optparse-test.rb:15:in `block in find_user': No User Found for id 3 (RuntimeError)
-#
-# === Store options to a Hash
-#
-# The +into+ option of +order+, +parse+ and so on methods stores command line options into a Hash.
-#
-# require 'optparse'
-#
-# params = {}
-# OptionParser.new do |opts|
-# opts.on('-a')
-# opts.on('-b NUM', Integer)
-# opts.on('-v', '--verbose')
-# end.parse!(into: params)
-#
-# p params
-#
-# Used:
-#
-# $ ruby optparse-test.rb -a
-# {:a=>true}
-# $ ruby optparse-test.rb -a -v
-# {:a=>true, :verbose=>true}
-# $ ruby optparse-test.rb -a -b 100
-# {:a=>true, :b=>100}
+# # -h, --help Prints this help#
#
# === Complete example
#
@@ -270,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
+# # Mandatory argument.
+# opts.on("-r", "--require LIBRARY",
+# "Require the LIBRARY before executing your script") do |lib|
+# options.library << lib
# end
-# # Another typical switch to print the version.
-# parser.on_tail("--version", "Show version") do
-# puts Version
-# exit
-# 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
@@ -439,7 +268,7 @@ class OptionParser
candidates = []
block.call do |k, *v|
(if Regexp === k
- kn = ""
+ kn = "".freeze
k === key
else
kn = defined?(k.id2name) ? k.id2name : k
@@ -534,9 +363,8 @@ class OptionParser
def initialize(pattern = nil, conv = nil,
short = nil, long = nil, arg = nil,
- desc = ([] if short or long), block = nil, &_block)
+ desc = ([] if short or long), block = Proc.new)
raise if Array === pattern
- block ||= _block
@pattern, @conv, @short, @long, @arg, @desc, @block =
pattern, conv, short, long, arg, desc, block
end
@@ -592,7 +420,7 @@ class OptionParser
# +max+ columns.
# +indent+:: Prefix string indents all summarized lines.
#
- def summarize(sdone = {}, ldone = {}, width = 1, max = width - 1, indent = "")
+ def summarize(sdone = [], ldone = [], width = 1, max = width - 1, indent = "")
sopts, lopts = [], [], nil
@short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short
@long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long
@@ -604,8 +432,8 @@ class OptionParser
while s = lopts.shift
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
+ l < max or sopts.empty? or left << ''
+ left[-1] << if left[-1].empty? then ' ' * 4 else ', ' end << s
end
if arg
@@ -655,7 +483,7 @@ class OptionParser
return if sopts.empty? and lopts.empty? # completely hidden
(sopts+lopts).each do |opt|
- # "(-x -c -r)-l[left justify]"
+ # "(-x -c -r)-l[left justify]" \
if /^--\[no-\](.+)$/ =~ opt
o = $1
yield("--#{o}", desc.join(""))
@@ -866,10 +694,6 @@ class OptionParser
__send__(id).complete(opt, icase, *pat, &block)
end
- def get_candidates(id)
- yield __send__(id).keys
- end
-
#
# Iterates over each option, passing the option to the +block+.
#
@@ -1167,7 +991,7 @@ XXX
#
def banner
unless @banner
- @banner = +"Usage: #{program_name} [options]"
+ @banner = "Usage: #{program_name} [options]"
visit(:add_banner, @banner)
end
@banner
@@ -1196,14 +1020,14 @@ XXX
# Version
#
def version
- (defined?(@version) && @version) || (defined?(::Version) && ::Version)
+ @version || (defined?(::Version) && ::Version)
end
#
# Release code
#
def release
- (defined?(@release) && @release) || (defined?(::Release) && ::Release) || (defined?(::RELEASE) && ::RELEASE)
+ @release || (defined?(::Release) && ::Release) || (defined?(::RELEASE) && ::RELEASE)
end
#
@@ -1211,7 +1035,7 @@ XXX
#
def ver
if v = version
- str = +"#{program_name} #{[v].join('.')}"
+ str = "#{program_name} #{[v].join('.')}"
str << " (#{v})" if v = release
str
end
@@ -1268,8 +1092,7 @@ XXX
# +indent+:: Indentation, defaults to @summary_indent.
#
def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk)
- nl = "\n"
- blk ||= proc {|l| to << (l.index(nl, -1) ? l : l + nl)}
+ blk ||= proc {|l| to << (l.index($/, -1) ? l : l + $/)}
visit(:summarize, {}, {}, width, max, indent, &blk)
to
end
@@ -1356,8 +1179,6 @@ XXX
# [Description:]
# Description string for the option.
# "Run verbosely"
- # If you give multiple description strings, each string will be printed
- # line by line.
#
# [Handler:]
# Handler for the parsed argument value. Either give a block or pass a
@@ -1420,8 +1241,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
@@ -1431,11 +1251,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
@@ -1444,8 +1263,7 @@ 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')
@@ -1548,25 +1366,21 @@ XXX
#
# Parses command line arguments +argv+ in order. When a block is given,
- # each non-option argument is yielded. When optional +into+ keyword
- # argument is provided, the parsed option values are stored there via
- # <code>[]=</code> method (so it can be Hash, or OpenStruct, or other
- # similar object).
+ # each non-option argument is yielded.
#
# 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:
@@ -1578,7 +1392,6 @@ XXX
# long option
when /\A--([^=]*)(?:=(.*))?/m
opt, rest = $1, $2
- opt.tr!('_', '-')
begin
sw, = complete(:long, opt, true)
rescue ParseError
@@ -1594,15 +1407,14 @@ 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
begin
sw, = complete(:short, opt)
# short option matched.
- val = arg.delete_prefix('-')
+ val = arg.sub(/\A-/, '')
has_arg = true
rescue InvalidOption
# if no short options match, try completion with long
@@ -1647,23 +1459,20 @@ XXX
#
# Parses command line arguments +argv+ in permutation mode and returns
- # list of non-option arguments. When optional +into+ keyword
- # argument is provided, the parsed option values are stored there via
- # <code>[]=</code> method (so it can be Hash, or OpenStruct, or other
- # similar object).
+ # 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
@@ -1671,36 +1480,33 @@ XXX
#
# Parses command line arguments +argv+ in order when environment variable
# POSIXLY_CORRECT is set, and in permutation mode otherwise.
- # When optional +into+ keyword argument is provided, the parsed option
- # values are stored there via <code>[]=</code> method (so it can be Hash,
- # or OpenStruct, or other similar object).
#
- 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
@@ -1768,7 +1574,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.
@@ -1777,41 +1583,26 @@ XXX
if pat.empty?
search(typ, opt) {|sw| return [sw, opt]} # exact match or...
end
- ambiguous = catch(:ambiguous) {
+ raise AmbiguousOption, catch(:ambiguous) {
visit(:complete, typ, opt, icase, *pat) {|o, *sw| return sw}
+ raise InvalidOption, opt
}
- exc = ambiguous ? AmbiguousOption : InvalidOption
- raise exc.new(opt, additional: self.method(:additional_message).curry[typ])
end
private :complete
- #
- # Returns additional info.
- #
- def additional_message(typ, opt)
- return unless typ and opt and defined?(DidYouMean::SpellChecker)
- all_candidates = []
- visit(:get_candidates, typ) do |candidates|
- all_candidates.concat(candidates)
- end
- all_candidates.select! {|cand| cand.is_a?(String) }
- checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
- DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
- end
-
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 : [])
@@ -1834,26 +1625,13 @@ XXX
# is not present. Returns whether successfully loaded.
#
# +filename+ defaults to basename of the program without suffix in a
- # directory ~/.options, then the basename with '.options' suffix
- # under XDG and Haiku standard places.
+ # directory ~/.options.
#
def load(filename = nil)
- unless filename
- basename = File.basename($0, '.*')
- return true if load(File.expand_path(basename, '~/.options')) rescue nil
- basename << ".options"
- return [
- # XDG
- ENV['XDG_CONFIG_HOME'],
- '~/.config',
- *ENV['XDG_CONFIG_DIRS']&.split(File::PATH_SEPARATOR),
-
- # Haiku
- '~/config/settings',
- ].any? {|dir|
- next if !dir or dir.empty?
- load(File.expand_path(basename, dir)) rescue nil
- }
+ begin
+ filename ||= File.expand_path(File.basename($0, '.*'), '~/.options')
+ rescue
+ return false
end
begin
parse(*IO.readlines(filename).each {|s| s.chomp!})
@@ -1913,7 +1691,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}
@@ -1922,13 +1700,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
}
@@ -1938,7 +1714,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
@@ -1962,14 +1738,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
}
@@ -1992,7 +1764,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
@@ -2023,18 +1795,15 @@ XXX
#
class ParseError < RuntimeError
# Reason which caused the error.
- Reason = 'parse error'
+ Reason = 'parse error'.freeze
- def initialize(*args, additional: nil)
- @additional = additional
- @arg0, = args
+ def initialize(*args)
@args = args
@reason = nil
end
attr_reader :args
attr_writer :reason
- attr_accessor :additional
#
# Pushes back erred argument(s) to +argv+.
@@ -2079,7 +1848,7 @@ XXX
# Default stringizing method to emit standard error message.
#
def message
- "#{reason}: #{args.join(' ')}#{additional[@arg0] if additional}"
+ reason + ': ' + args.join(' ')
end
alias to_s message
@@ -2089,42 +1858,42 @@ XXX
# Raises when ambiguously completable string is encountered.
#
class AmbiguousOption < ParseError
- const_set(:Reason, 'ambiguous option')
+ const_set(:Reason, 'ambiguous option'.freeze)
end
#
# Raises when there is an argument for a switch which takes no argument.
#
class NeedlessArgument < ParseError
- const_set(:Reason, 'needless argument')
+ const_set(:Reason, 'needless argument'.freeze)
end
#
# Raises when a switch with mandatory argument has no argument.
#
class MissingArgument < ParseError
- const_set(:Reason, 'missing argument')
+ const_set(:Reason, 'missing argument'.freeze)
end
#
# Raises when switch is undefined.
#
class InvalidOption < ParseError
- const_set(:Reason, 'invalid option')
+ const_set(:Reason, 'invalid option'.freeze)
end
#
# Raises when the given argument does not match required format.
#
class InvalidArgument < ParseError
- const_set(:Reason, 'invalid argument')
+ const_set(:Reason, 'invalid argument'.freeze)
end
#
# Raises when the given argument word can't be completed uniquely.
#
class AmbiguousArgument < InvalidArgument
- const_set(:Reason, 'ambiguous argument')
+ const_set(:Reason, 'ambiguous argument'.freeze)
end
#
@@ -2231,5 +2000,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 9d520101aa..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
@@ -13,8 +12,6 @@ class OptionParser::AC < OptionParser
end
end
- ARG_CONV = proc {|val| val.nil? ? true : val}
-
def _ac_arg_enable(prefix, name, help_string, block)
_check_ac_args(name, block)
@@ -22,9 +19,8 @@ class OptionParser::AC < OptionParser
ldesc = ["--#{prefix}-#{name}"]
desc = [help_string]
q = name.downcase
- ac_block = proc {|val| block.call(ARG_CONV.call(val))}
- enable = Switch::PlacedArgument.new(nil, ARG_CONV, sdesc, ldesc, nil, desc, ac_block)
- disable = Switch::NoArgument.new(nil, proc {false}, sdesc, ldesc, nil, desc, ac_block)
+ enable = Switch::NoArgument.new(nil, proc {true}, sdesc, ldesc, nil, desc, block)
+ disable = Switch::NoArgument.new(nil, proc {false}, sdesc, ldesc, nil, desc, block)
top.append(enable, [], ["enable-" + q], disable, ['disable-' + q])
enable
end
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 c40c897ff6..f51eb7b5db 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
#
# = ostruct.rb: OpenStruct implementation
#
@@ -15,68 +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.
#
-
-require_relative 'ostruct/version'
-
class OpenStruct
-
#
# Creates a new OpenStruct object. By default, the resulting OpenStruct
# object will have no attributes.
@@ -85,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 = {}
@@ -97,57 +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
#
- # call-seq:
- # ostruct.to_h -> hash
- # ostruct.to_h {|name, value| block } -> hash
- #
# 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:
#
- # If a block is given, the results of the block on each pair of
- # the receiver will be used as pairs.
+ # require 'ostruct'
+ # data = OpenStruct.new("country" => "Australia", :population => 20_000_000)
+ # data.to_h # => {:country => "Australia", :population => 20000000 }
#
- # require "ostruct"
- # data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
- # data.to_h # => {:country => "Australia", :capital => "Canberra" }
- # data.to_h {|name, value| [name.to_s, value.upcase] }
- # # => {"country" => "AUSTRALIA", "capital" => "CANBERRA" }
- #
- def to_h(&block)
- if block_given?
- @table.to_h(&block)
- else
- @table.dup
- end
+ 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
#
@@ -162,155 +141,89 @@ 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
- exception_class = defined?(FrozenError) ? FrozenError : RuntimeError
- raise exception_class, "can't modify frozen #{self.class}", caller(3)
+ raise RuntimeError, "can't modify frozen #{self.class}", caller(3)
end
@table
end
- private :modifiable?
+ protected :modifiable
#
# Used internally to defined properties on the
# 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!
-
- 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
- defined?(@table) && @table.key?(mname) || super
- end
+ protected :new_ostruct_member
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 (given #{len}, expected 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]
+ raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
end
- elsif @table.key?(mid)
- raise ArgumentError, "wrong number of arguments (given #{len}, expected 0)"
+ 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 an attribute.
+ # Sets the value of a member.
#
- # 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)
- #
- # person.delete_field("age") # => 70
- # person # => #<OpenStruct name="John", pension=300>
+ # require 'ostruct'
#
- # Setting the value to +nil+ will not remove the attribute:
+ # person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
#
- # 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.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:
@@ -319,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
#
@@ -365,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/ostruct/ostruct.gemspec b/lib/ostruct/ostruct.gemspec
deleted file mode 100644
index 4f8507045e..0000000000
--- a/lib/ostruct/ostruct.gemspec
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-begin
- require_relative "lib/ostruct/version"
-rescue LoadError
- # for Ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "ostruct"
- spec.version = OpenStruct::VERSION
- spec.authors = ["Marc-Andre Lafortune"]
- spec.email = ["ruby-core@marc-andre.ca"]
-
- spec.summary = %q{Class to build custom data structures, similar to a Hash.}
- spec.description = %q{Class to build custom data structures, similar to a Hash.}
- spec.homepage = "https://github.com/ruby/ostruct"
- spec.license = "BSD-2-Clause"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/ostruct.rb", "lib/ostruct/version.rb", "ostruct.gemspec"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
-end
diff --git a/lib/ostruct/version.rb b/lib/ostruct/version.rb
deleted file mode 100644
index 91a4044094..0000000000
--- a/lib/ostruct/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-class OpenStruct
- VERSION = "0.2.0"
-end
diff --git a/lib/pp.rb b/lib/pp.rb
index 81a9a1629c..3c73463c9c 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
#
@@ -89,7 +115,7 @@ class PP < PrettyPrint
# :stopdoc:
def PP.mcall(obj, mod, meth, *args, &block)
- mod.instance_method(meth).bind_call(obj, *args, &block)
+ mod.instance_method(meth).bind(obj).call(*args, &block)
end
# :startdoc:
@@ -106,17 +132,17 @@ class PP < PrettyPrint
# and preserves the previous set of objects being printed.
def guard_inspect_key
if Thread.current[:__recursive_key__] == nil
- Thread.current[:__recursive_key__] = {}.compare_by_identity
+ Thread.current[:__recursive_key__] = {}.taint
end
if Thread.current[:__recursive_key__][:inspect] == nil
- Thread.current[:__recursive_key__][:inspect] = {}.compare_by_identity
+ Thread.current[:__recursive_key__][:inspect] = {}.taint
end
save = Thread.current[:__recursive_key__][:inspect]
begin
- Thread.current[:__recursive_key__][:inspect] = {}.compare_by_identity
+ Thread.current[:__recursive_key__][:inspect] = {}.taint
yield
ensure
Thread.current[:__recursive_key__][:inspect] = save
@@ -149,20 +175,18 @@ class PP < PrettyPrint
# Object#pretty_print_cycle is used when +obj+ is already
# printed, a.k.a the object reference chain has a cycle.
def pp(obj)
- # If obj is a Delegator then use the object being delegated to for cycle
- # detection
- obj = obj.__getobj__ if defined?(::Delegator) and obj.is_a?(::Delegator)
+ id = obj.object_id
- if check_inspect_key(obj)
+ if check_inspect_key(id)
group {obj.pretty_print_cycle self}
return
end
begin
- push_inspect_key(obj)
+ push_inspect_key(id)
group {obj.pretty_print self}
ensure
- pop_inspect_key(obj) unless PP.sharing_detection
+ pop_inspect_key(id) unless PP.sharing_detection
end
end
@@ -176,7 +200,7 @@ class PP < PrettyPrint
# A convenience method, like object_group, but also reformats the Object's
# object_id.
def object_address_group(obj, &block)
- str = Kernel.instance_method(:to_s).bind_call(obj)
+ str = Kernel.instance_method(:to_s).bind(obj).call
str.chomp!('>')
group(1, str, '>', &block)
end
@@ -281,12 +305,12 @@ class PP < PrettyPrint
# This module provides predefined #pretty_print methods for some of
# the most commonly used built-in classes for convenience.
def pretty_print(q)
- umethod_method = Object.instance_method(:method)
+ method_method = Object.instance_method(:method).bind(self)
begin
- inspect_method = umethod_method.bind_call(self, :inspect)
+ 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
@@ -320,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_call(self, :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
@@ -388,22 +412,7 @@ class Range # :nodoc:
q.breakable ''
q.text(self.exclude_end? ? '...' : '..')
q.breakable ''
- q.pp self.end if self.end
- 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
+ q.pp self.end
end
end
@@ -516,40 +525,6 @@ class MatchData # :nodoc:
end
end
-class RubyVM::AbstractSyntaxTree::Node
- def pretty_print_children(q, names = [])
- children.zip(names) do |c, n|
- if n
- q.breakable
- q.text "#{n}:"
- end
- q.group(2) do
- q.breakable
- q.pp c
- end
- end
- end
-
- def pretty_print(q)
- q.group(1, "(#{type}@#{first_lineno}:#{first_column}-#{last_lineno}:#{last_column}", ")") {
- case type
- when :SCOPE
- pretty_print_children(q, %w"tbl args body")
- when :ARGS
- pretty_print_children(q, %w[pre_num pre_init opt first_post post_num post_init rest kw kwrest block])
- when :DEFN
- pretty_print_children(q, %w[mid body])
- when :ARYPTN
- pretty_print_children(q, %w[const pre rest post])
- when :HSHPTN
- pretty_print_children(q, %w[const kw kwrest])
- else
- pretty_print_children(q)
- end
- }
- end
-end
-
class Object < BasicObject # :nodoc:
include PP::ObjectMixin
end
@@ -569,27 +544,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.gemspec b/lib/prime.gemspec
deleted file mode 100644
index 6a9aa683e6..0000000000
--- a/lib/prime.gemspec
+++ /dev/null
@@ -1,27 +0,0 @@
-begin
- require_relative "lib/prime"
-rescue LoadError
- # for Ruby core repository
- require_relative "prime"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "prime"
- spec.version = Prime::VERSION
- spec.authors = ["Yuki Sonoda"]
- spec.email = ["yugui@yugui.jp"]
-
- spec.summary = %q{Prime numbers and factorization library.}
- spec.description = %q{Prime numbers and factorization library.}
- spec.homepage = "https://github.com/ruby/prime"
- spec.license = "BSD-2-Clause"
-
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/prime.rb", "lib/prime/version.rb", "prime.gemspec"]
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_development_dependency "bundler"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "test-unit"
-end
diff --git a/lib/prime.rb b/lib/prime.rb
index 5be12f24f5..b2b55f1f2e 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+.
#
@@ -95,15 +89,21 @@ end
# has many prime factors. e.g. for Prime#prime? .
class Prime
-
- VERSION = "0.1.1"
-
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
@@ -136,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)
@@ -149,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
@@ -210,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
@@ -225,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.
@@ -283,27 +289,15 @@ class Prime
end
# see +Enumerator+#with_index.
- def with_index(offset = 0, &block)
- return enum_for(:with_index, offset) { Float::INFINITY } unless block
- return each_with_index(&block) 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+.
@@ -327,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
@@ -348,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
@@ -366,7 +360,7 @@ class Prime
when 3; @prime = 5; @step = 2
end
end
- @prime
+ return @prime
end
alias next succ
def rewind
@@ -391,6 +385,13 @@ class Prime
@ulticheck_next_squared = 121 # @primes[@ulticheck_index + 1] ** 2
end
+ # Returns the cached prime numbers.
+ def cache
+ return @primes
+ end
+ alias primes cache
+ alias primes_so_far cache
+
# Returns the +index+th prime number.
#
# +index+ is a 0-based index.
@@ -411,11 +412,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
@@ -441,23 +442,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
+ return @generator.dup unless block_given?
+ loop do
+ yield succ
+ end
+ end
+ end
end
diff --git a/lib/profile.rb b/lib/profile.rb
new file mode 100644
index 0000000000..2aeecce908
--- /dev/null
+++ b/lib/profile.rb
@@ -0,0 +1,10 @@
+require 'profiler'
+
+RubyVM::InstructionSequence.compile_option = {
+ :trace_instruction => true,
+ :specialized_instruction => false
+}
+END {
+ Profiler__::print_profile(STDERR)
+}
+Profiler__::start_profile
diff --git a/lib/profiler.rb b/lib/profiler.rb
new file mode 100644
index 0000000000..e53951cbe6
--- /dev/null
+++ b/lib/profiler.rb
@@ -0,0 +1,148 @@
+# Profile provides a way to Profile your Ruby application.
+#
+# Profiling your program is a way of determining which methods are called and
+# how long each method takes to complete. This way you can detect which
+# methods are possible bottlenecks.
+#
+# Profiling your program will slow down your execution time considerably,
+# so activate it only when you need it. Don't confuse benchmarking with
+# profiling.
+#
+# There are two ways to activate Profiling:
+#
+# == Command line
+#
+# Run your Ruby script with <code>-rprofile</code>:
+#
+# ruby -rprofile example.rb
+#
+# If you're profiling an executable in your <code>$PATH</code> you can use
+# <code>ruby -S</code>:
+#
+# ruby -rprofile -S some_executable
+#
+# == From code
+#
+# Just require 'profile':
+#
+# require 'profile'
+#
+# def slow_method
+# 5000.times do
+# 9999999999999999*999999999
+# end
+# end
+#
+# def fast_method
+# 5000.times do
+# 9999999999999999+999999999
+# end
+# end
+#
+# slow_method
+# fast_method
+#
+# The output in both cases is a report when the execution is over:
+#
+# ruby -rprofile example.rb
+#
+# % cumulative self self total
+# time seconds seconds calls ms/call ms/call name
+# 68.42 0.13 0.13 2 65.00 95.00 Integer#times
+# 15.79 0.16 0.03 5000 0.01 0.01 Fixnum#*
+# 15.79 0.19 0.03 5000 0.01 0.01 Fixnum#+
+# 0.00 0.19 0.00 2 0.00 0.00 IO#set_encoding
+# 0.00 0.19 0.00 1 0.00 100.00 Object#slow_method
+# 0.00 0.19 0.00 2 0.00 0.00 Module#method_added
+# 0.00 0.19 0.00 1 0.00 90.00 Object#fast_method
+# 0.00 0.19 0.00 1 0.00 190.00 #toplevel
+
+module Profiler__
+ class Wrapper < Struct.new(:defined_class, :method_id, :hash) # :nodoc:
+ private :defined_class=, :method_id=, :hash=
+
+ def initialize(klass, mid)
+ super(klass, mid, nil)
+ self.hash = Struct.instance_method(:hash).bind(self).call
+ end
+
+ def to_s
+ "#{defined_class.inspect}#".sub(/\A\#<Class:(.*)>#\z/, '\1.') << method_id.to_s
+ end
+ alias inspect to_s
+ end
+
+ # internal values
+ @@start = nil # the start time that profiling began
+ @@stacks = nil # the map of stacks keyed by thread
+ @@maps = nil # the map of call data keyed by thread, class and id. Call data contains the call count, total time,
+ PROFILE_CALL_PROC = TracePoint.new(*%i[call c_call b_call]) {|tp| # :nodoc:
+ now = Process.times[0]
+ stack = (@@stacks[Thread.current] ||= [])
+ stack.push [now, 0.0]
+ }
+ PROFILE_RETURN_PROC = TracePoint.new(*%i[return c_return b_return]) {|tp| # :nodoc:
+ now = Process.times[0]
+ key = Wrapper.new(tp.defined_class, tp.method_id)
+ stack = (@@stacks[Thread.current] ||= [])
+ if tick = stack.pop
+ threadmap = (@@maps[Thread.current] ||= {})
+ data = (threadmap[key] ||= [0, 0.0, 0.0, key])
+ data[0] += 1
+ cost = now - tick[0]
+ data[1] += cost
+ data[2] += cost - tick[1]
+ stack[-1][1] += cost if stack[-1]
+ end
+ }
+module_function
+ # Starts the profiler.
+ #
+ # See Profiler__ for more information.
+ def start_profile
+ @@start = Process.times[0]
+ @@stacks = {}
+ @@maps = {}
+ PROFILE_CALL_PROC.enable
+ PROFILE_RETURN_PROC.enable
+ end
+ # Stops the profiler.
+ #
+ # See Profiler__ for more information.
+ def stop_profile
+ PROFILE_CALL_PROC.disable
+ PROFILE_RETURN_PROC.disable
+ end
+ # Outputs the results from the profiler.
+ #
+ # See Profiler__ for more information.
+ def print_profile(f)
+ stop_profile
+ total = Process.times[0] - @@start
+ if total == 0 then total = 0.01 end
+ totals = {}
+ @@maps.values.each do |threadmap|
+ threadmap.each do |key, data|
+ total_data = (totals[key] ||= [0, 0.0, 0.0, key])
+ total_data[0] += data[0]
+ total_data[1] += data[1]
+ total_data[2] += data[2]
+ end
+ end
+
+ # Maybe we should show a per thread output and a totals view?
+
+ data = totals.values
+ data = data.sort_by{|x| -x[2]}
+ sum = 0
+ f.printf " %% cumulative self self total\n"
+ f.printf " time seconds seconds calls ms/call ms/call name\n"
+ for d in data
+ sum += d[2]
+ f.printf "%6.2f %8.2f %8.2f %8d ", d[2]/total*100, sum, d[2], d[0]
+ f.printf "%8.2f %8.2f %s\n", d[2]*1000/d[0], d[1]*1000/d[0], d[3]
+ end
+ f.printf "%6.2f %8.2f %8.2f %8d ", 0.0, total, 0.0, 1 # ???
+ f.printf "%8.2f %8.2f %s\n", 0.0, total*1000, "#toplevel" # ???
+ end
+end
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 1180fd50a0..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
@@ -374,7 +367,7 @@ class PStore
def open_and_lock_file(filename, read_only)
if read_only
begin
- file = File.new(filename, **RD_ACCESS)
+ file = File.new(filename, RD_ACCESS)
begin
file.flock(File::LOCK_SH)
return file
@@ -386,7 +379,7 @@ class PStore
return nil
end
else
- file = File.new(filename, **RDWR_ACCESS)
+ file = File.new(filename, RDWR_ACCESS)
file.flock(File::LOCK_EX)
return file
end
@@ -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)
@@ -449,7 +442,7 @@ class PStore
def save_data_with_atomic_file_rename_strategy(data, file)
temp_filename = "#{@filename}.tmp.#{Process.pid}.#{rand 1000000}"
- temp_file = File.new(temp_filename, **WR_ACCESS)
+ temp_file = File.new(temp_filename, WR_ACCESS)
begin
temp_file.flock(File::LOCK_EX)
temp_file.write(data)
diff --git a/lib/pstore/pstore.gemspec b/lib/pstore/pstore.gemspec
deleted file mode 100644
index 408af0a078..0000000000
--- a/lib/pstore/pstore.gemspec
+++ /dev/null
@@ -1,29 +0,0 @@
-begin
- require_relative "lib/pstore/version"
-rescue LoadError # Fallback to load version file in ruby core repository
- require_relative "version"
-end
-
-Gem::Specification.new do |spec|
- spec.name = "pstore"
- spec.version = PStore::VERSION
- spec.authors = ["Yukihiro Matsumoto"]
- spec.email = ["matz@ruby-lang.org"]
-
- spec.summary = %q{Transactional File Storage for Ruby Objects}
- spec.description = spec.summary
- spec.homepage = "https://github.com/ruby/pstore"
- spec.license = "BSD-2-Clause"
-
- spec.metadata["homepage_uri"] = spec.homepage
- spec.metadata["source_code_uri"] = "https://github.com/ruby/pstore"
-
- # Specify which files should be added to the gem when it is released.
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-end
diff --git a/lib/pstore/version.rb b/lib/pstore/version.rb
deleted file mode 100644
index 0e7a3fbd15..0000000000
--- a/lib/pstore/version.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class PStore
- VERSION = "0.1.0"
-end
diff --git a/lib/racc.rb b/lib/racc.rb
deleted file mode 100644
index f6e4ac03a8..0000000000
--- a/lib/racc.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'racc/compat'
-require 'racc/debugflags'
-require 'racc/grammar'
-require 'racc/state'
-require 'racc/exception'
-require 'racc/info'
diff --git a/lib/racc/compat.rb b/lib/racc/compat.rb
deleted file mode 100644
index ccb033e2e0..0000000000
--- a/lib/racc/compat.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# $Id: 14fa1118eb3a23e85265e4f7afe2d5a297d69f9c $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of the GNU LGPL, see the file "COPYING".
-#
-
-unless Object.method_defined?(:__send)
- class Object
- alias __send __send__
- end
-end
-
-unless Object.method_defined?(:__send!)
- class Object
- alias __send! __send__
- end
-end
-
-unless Array.method_defined?(:map!)
- class Array
- if Array.method_defined?(:collect!)
- alias map! collect!
- else
- alias map! filter
- end
- end
-end
diff --git a/lib/racc/debugflags.rb b/lib/racc/debugflags.rb
deleted file mode 100644
index 1b5d2fe54c..0000000000
--- a/lib/racc/debugflags.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# $Id: 74ff4369ce53c7f45cfc2644ce907785104ebf6e $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of LGPL, see the file "COPYING".
-#
-
-module Racc
-
- class DebugFlags
- def DebugFlags.parse_option_string(s)
- parse = rule = token = state = la = prec = conf = false
- s.split(//).each do |ch|
- case ch
- when 'p' then parse = true
- when 'r' then rule = true
- when 't' then token = true
- when 's' then state = true
- when 'l' then la = true
- when 'c' then prec = true
- when 'o' then conf = true
- else
- raise "unknown debug flag char: #{ch.inspect}"
- end
- end
- new(parse, rule, token, state, la, prec, conf)
- end
-
- def initialize(parse = false, rule = false, token = false, state = false,
- la = false, prec = false, conf = false)
- @parse = parse
- @rule = rule
- @token = token
- @state = state
- @la = la
- @prec = prec
- @any = (parse || rule || token || state || la || prec)
- @status_logging = conf
- end
-
- attr_reader :parse
- attr_reader :rule
- attr_reader :token
- attr_reader :state
- attr_reader :la
- attr_reader :prec
-
- def any?
- @any
- end
-
- attr_reader :status_logging
- end
-
-end
diff --git a/lib/racc/exception.rb b/lib/racc/exception.rb
deleted file mode 100644
index 0069ca3443..0000000000
--- a/lib/racc/exception.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# $Id: ebb9798ad0b211e031670a12a1ab154678c1c8f3 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-# see the file "COPYING".
-
-module Racc
- class Error < StandardError; end
- class CompileError < Error; end
-end
diff --git a/lib/racc/grammar.rb b/lib/racc/grammar.rb
deleted file mode 100644
index 123f1f1834..0000000000
--- a/lib/racc/grammar.rb
+++ /dev/null
@@ -1,1113 +0,0 @@
-#
-# $Id: 3fcabd58bef02540bf78e8142469681cb9f975c2 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-# see the file "COPYING".
-
-require 'racc/compat'
-require 'racc/iset'
-require 'racc/sourcetext'
-require 'racc/logfilegenerator'
-require 'racc/exception'
-require 'forwardable'
-
-module Racc
-
- class Grammar
-
- def initialize(debug_flags = DebugFlags.new)
- @symboltable = SymbolTable.new
- @debug_symbol = debug_flags.token
- @rules = [] # :: [Rule]
- @start = nil
- @n_expected_srconflicts = nil
- @prec_table = []
- @prec_table_closed = false
- @closed = false
- @states = nil
- end
-
- attr_reader :start
- attr_reader :symboltable
- attr_accessor :n_expected_srconflicts
-
- def [](x)
- @rules[x]
- end
-
- def each_rule(&block)
- @rules.each(&block)
- end
-
- alias each each_rule
-
- def each_index(&block)
- @rules.each_index(&block)
- end
-
- def each_with_index(&block)
- @rules.each_with_index(&block)
- end
-
- def size
- @rules.size
- end
-
- def to_s
- "<Racc::Grammar>"
- end
-
- extend Forwardable
-
- def_delegator "@symboltable", :each, :each_symbol
- def_delegator "@symboltable", :each_terminal
- def_delegator "@symboltable", :each_nonterminal
-
- def intern(value, dummy = false)
- @symboltable.intern(value, dummy)
- end
-
- def symbols
- @symboltable.symbols
- end
-
- def nonterminal_base
- @symboltable.nt_base
- end
-
- def useless_nonterminal_exist?
- n_useless_nonterminals() != 0
- end
-
- def n_useless_nonterminals
- @n_useless_nonterminals ||=
- begin
- n = 0
- @symboltable.each_nonterminal do |sym|
- n += 1 if sym.useless?
- end
- n
- end
- end
-
- def useless_rule_exist?
- n_useless_rules() != 0
- end
-
- def n_useless_rules
- @n_useless_rules ||=
- begin
- n = 0
- each do |r|
- n += 1 if r.useless?
- end
- n
- end
- end
-
- def nfa
- (@states ||= States.new(self)).nfa
- end
-
- def dfa
- (@states ||= States.new(self)).dfa
- end
-
- alias states dfa
-
- def state_transition_table
- states().state_transition_table
- end
-
- def parser_class
- states = states() # cache
- if $DEBUG
- srcfilename = caller(1).first.slice(/\A(.*?):/, 1)
- begin
- write_log srcfilename + ".output"
- rescue SystemCallError
- end
- report = lambda {|s| $stderr.puts "racc: #{srcfilename}: #{s}" }
- if states.should_report_srconflict?
- report["#{states.n_srconflicts} shift/reduce conflicts"]
- end
- if states.rrconflict_exist?
- report["#{states.n_rrconflicts} reduce/reduce conflicts"]
- end
- g = states.grammar
- if g.useless_nonterminal_exist?
- report["#{g.n_useless_nonterminals} useless nonterminals"]
- end
- if g.useless_rule_exist?
- report["#{g.n_useless_rules} useless rules"]
- end
- end
- states.state_transition_table.parser_class
- end
-
- def write_log(path)
- File.open(path, 'w') {|f|
- LogFileGenerator.new(states()).output f
- }
- end
-
- #
- # Grammar Definition Interface
- #
-
- def add(rule)
- raise ArgumentError, "rule added after the Grammar closed" if @closed
- @rules.push rule
- end
-
- def added?(sym)
- @rules.detect {|r| r.target == sym }
- end
-
- def start_symbol=(s)
- raise CompileError, "start symbol set twice'" if @start
- @start = s
- end
-
- def declare_precedence(assoc, syms)
- raise CompileError, "precedence table defined twice" if @prec_table_closed
- @prec_table.push [assoc, syms]
- end
-
- def end_precedence_declaration(reverse)
- @prec_table_closed = true
- return if @prec_table.empty?
- table = reverse ? @prec_table.reverse : @prec_table
- table.each_with_index do |(assoc, syms), idx|
- syms.each do |sym|
- sym.assoc = assoc
- sym.precedence = idx
- end
- end
- end
-
- #
- # Dynamic Generation Interface
- #
-
- def Grammar.define(&block)
- env = DefinitionEnv.new
- env.instance_eval(&block)
- env.grammar
- end
-
- class DefinitionEnv
- def initialize
- @grammar = Grammar.new
- @seqs = Hash.new(0)
- @delayed = []
- end
-
- def grammar
- flush_delayed
- @grammar.each do |rule|
- if rule.specified_prec
- rule.specified_prec = @grammar.intern(rule.specified_prec)
- end
- end
- @grammar.init
- @grammar
- end
-
- def precedence_table(&block)
- env = PrecedenceDefinitionEnv.new(@grammar)
- env.instance_eval(&block)
- @grammar.end_precedence_declaration env.reverse
- end
-
- def method_missing(mid, *args, &block)
- unless mid.to_s[-1,1] == '='
- super # raises NoMethodError
- end
- target = @grammar.intern(mid.to_s.chop.intern)
- unless args.size == 1
- raise ArgumentError, "too many arguments for #{mid} (#{args.size} for 1)"
- end
- _add target, args.first
- end
-
- def _add(target, x)
- case x
- when Sym
- @delayed.each do |rule|
- rule.replace x, target if rule.target == x
- end
- @grammar.symboltable.delete x
- else
- x.each_rule do |r|
- r.target = target
- @grammar.add r
- end
- end
- flush_delayed
- end
-
- def _delayed_add(rule)
- @delayed.push rule
- end
-
- def _added?(sym)
- @grammar.added?(sym) or @delayed.detect {|r| r.target == sym }
- end
-
- def flush_delayed
- return if @delayed.empty?
- @delayed.each do |rule|
- @grammar.add rule
- end
- @delayed.clear
- end
-
- def seq(*list, &block)
- Rule.new(nil, list.map {|x| _intern(x) }, UserAction.proc(block))
- end
-
- def null(&block)
- seq(&block)
- end
-
- def action(&block)
- id = "@#{@seqs["action"] += 1}".intern
- _delayed_add Rule.new(@grammar.intern(id), [], UserAction.proc(block))
- id
- end
-
- alias _ action
-
- def option(sym, default = nil, &block)
- _defmetasyntax("option", _intern(sym), block) {|target|
- seq() { default } | seq(sym)
- }
- end
-
- def many(sym, &block)
- _defmetasyntax("many", _intern(sym), block) {|target|
- seq() { [] }\
- | seq(target, sym) {|list, x| list.push x; list }
- }
- end
-
- def many1(sym, &block)
- _defmetasyntax("many1", _intern(sym), block) {|target|
- seq(sym) {|x| [x] }\
- | seq(target, sym) {|list, x| list.push x; list }
- }
- end
-
- def separated_by(sep, sym, &block)
- option(separated_by1(sep, sym), [], &block)
- end
-
- def separated_by1(sep, sym, &block)
- _defmetasyntax("separated_by1", _intern(sym), block) {|target|
- seq(sym) {|x| [x] }\
- | seq(target, sep, sym) {|list, _, x| list.push x; list }
- }
- end
-
- def _intern(x)
- case x
- when Symbol, String
- @grammar.intern(x)
- when Racc::Sym
- x
- else
- raise TypeError, "wrong type #{x.class} (expected Symbol/String/Racc::Sym)"
- end
- end
-
- private
-
- def _defmetasyntax(type, id, action, &block)
- if action
- idbase = "#{type}@#{id}-#{@seqs[type] += 1}"
- target = _wrap(idbase, "#{idbase}-core", action)
- _regist("#{idbase}-core", &block)
- else
- target = _regist("#{type}@#{id}", &block)
- end
- @grammar.intern(target)
- end
-
- def _regist(target_name)
- target = target_name.intern
- unless _added?(@grammar.intern(target))
- yield(target).each_rule do |rule|
- rule.target = @grammar.intern(target)
- _delayed_add rule
- end
- end
- target
- end
-
- def _wrap(target_name, sym, block)
- target = target_name.intern
- _delayed_add Rule.new(@grammar.intern(target),
- [@grammar.intern(sym.intern)],
- UserAction.proc(block))
- target
- end
- end
-
- class PrecedenceDefinitionEnv
- def initialize(g)
- @grammar = g
- @prechigh_seen = false
- @preclow_seen = false
- @reverse = false
- end
-
- attr_reader :reverse
-
- def higher
- if @prechigh_seen
- raise CompileError, "prechigh used twice"
- end
- @prechigh_seen = true
- end
-
- def lower
- if @preclow_seen
- raise CompileError, "preclow used twice"
- end
- if @prechigh_seen
- @reverse = true
- end
- @preclow_seen = true
- end
-
- def left(*syms)
- @grammar.declare_precedence :Left, syms.map {|s| @grammar.intern(s) }
- end
-
- def right(*syms)
- @grammar.declare_precedence :Right, syms.map {|s| @grammar.intern(s) }
- end
-
- def nonassoc(*syms)
- @grammar.declare_precedence :Nonassoc, syms.map {|s| @grammar.intern(s)}
- end
- end
-
- #
- # Computation
- #
-
- def init
- return if @closed
- @closed = true
- @start ||= @rules.map {|r| r.target }.detect {|sym| not sym.dummy? }
- raise CompileError, 'no rule in input' if @rules.empty?
- add_start_rule
- @rules.freeze
- fix_ident
- compute_hash
- compute_heads
- determine_terminals
- compute_nullable_0
- @symboltable.fix
- compute_locate
- @symboltable.each_nonterminal {|t| compute_expand t }
- compute_nullable
- compute_useless
- end
-
- private
-
- def add_start_rule
- r = Rule.new(@symboltable.dummy,
- [@start, @symboltable.anchor, @symboltable.anchor],
- UserAction.empty)
- r.ident = 0
- r.hash = 0
- r.precedence = nil
- @rules.unshift r
- end
-
- # Rule#ident
- # LocationPointer#ident
- def fix_ident
- @rules.each_with_index do |rule, idx|
- rule.ident = idx
- end
- end
-
- # Rule#hash
- def compute_hash
- hash = 4 # size of dummy rule
- @rules.each do |rule|
- rule.hash = hash
- hash += (rule.size + 1)
- end
- end
-
- # Sym#heads
- def compute_heads
- @rules.each do |rule|
- rule.target.heads.push rule.ptrs[0]
- end
- end
-
- # Sym#terminal?
- def determine_terminals
- @symboltable.each do |s|
- s.term = s.heads.empty?
- end
- end
-
- # Sym#self_null?
- def compute_nullable_0
- @symboltable.each do |s|
- if s.terminal?
- s.snull = false
- else
- s.snull = s.heads.any? {|loc| loc.reduce? }
- end
- end
- end
-
- # Sym#locate
- def compute_locate
- @rules.each do |rule|
- t = nil
- rule.ptrs.each do |ptr|
- unless ptr.reduce?
- tok = ptr.dereference
- tok.locate.push ptr
- t = tok if tok.terminal?
- end
- end
- rule.precedence = t
- end
- end
-
- # Sym#expand
- def compute_expand(t)
- puts "expand> #{t.to_s}" if @debug_symbol
- t.expand = _compute_expand(t, ISet.new, [])
- puts "expand< #{t.to_s}: #{t.expand.to_s}" if @debug_symbol
- end
-
- def _compute_expand(t, set, lock)
- if tmp = t.expand
- set.update tmp
- return set
- end
- tok = nil
- set.update_a t.heads
- t.heads.each do |ptr|
- tok = ptr.dereference
- if tok and tok.nonterminal?
- unless lock[tok.ident]
- lock[tok.ident] = true
- _compute_expand tok, set, lock
- end
- end
- end
- set
- end
-
- # Sym#nullable?, Rule#nullable?
- def compute_nullable
- @rules.each {|r| r.null = false }
- @symboltable.each {|t| t.null = false }
- r = @rules.dup
- s = @symboltable.nonterminals
- begin
- rs = r.size
- ss = s.size
- check_rules_nullable r
- check_symbols_nullable s
- end until rs == r.size and ss == s.size
- end
-
- def check_rules_nullable(rules)
- rules.delete_if do |rule|
- rule.null = true
- rule.symbols.each do |t|
- unless t.nullable?
- rule.null = false
- break
- end
- end
- rule.nullable?
- end
- end
-
- def check_symbols_nullable(symbols)
- symbols.delete_if do |sym|
- sym.heads.each do |ptr|
- if ptr.rule.nullable?
- sym.null = true
- break
- end
- end
- sym.nullable?
- end
- end
-
- # Sym#useless?, Rule#useless?
- # FIXME: what means "useless"?
- def compute_useless
- @symboltable.each_terminal {|sym| sym.useless = false }
- @symboltable.each_nonterminal {|sym| sym.useless = true }
- @rules.each {|rule| rule.useless = true }
- r = @rules.dup
- s = @symboltable.nonterminals
- begin
- rs = r.size
- ss = s.size
- check_rules_useless r
- check_symbols_useless s
- end until r.size == rs and s.size == ss
- end
-
- def check_rules_useless(rules)
- rules.delete_if do |rule|
- rule.useless = false
- rule.symbols.each do |sym|
- if sym.useless?
- rule.useless = true
- break
- end
- end
- not rule.useless?
- end
- end
-
- def check_symbols_useless(s)
- s.delete_if do |t|
- t.heads.each do |ptr|
- unless ptr.rule.useless?
- t.useless = false
- break
- end
- end
- not t.useless?
- end
- end
-
- end # class Grammar
-
-
- class Rule
-
- def initialize(target, syms, act)
- @target = target
- @symbols = syms
- @action = act
- @alternatives = []
-
- @ident = nil
- @hash = nil
- @ptrs = nil
- @precedence = nil
- @specified_prec = nil
- @null = nil
- @useless = nil
- end
-
- attr_accessor :target
- attr_reader :symbols
- attr_reader :action
-
- def |(x)
- @alternatives.push x.rule
- self
- end
-
- def rule
- self
- end
-
- def each_rule(&block)
- yield self
- @alternatives.each(&block)
- end
-
- attr_accessor :ident
-
- attr_reader :hash
- attr_reader :ptrs
-
- def hash=(n)
- @hash = n
- ptrs = []
- @symbols.each_with_index do |sym, idx|
- ptrs.push LocationPointer.new(self, idx, sym)
- end
- ptrs.push LocationPointer.new(self, @symbols.size, nil)
- @ptrs = ptrs
- end
-
- def precedence
- @specified_prec || @precedence
- end
-
- def precedence=(sym)
- @precedence ||= sym
- end
-
- def prec(sym, &block)
- @specified_prec = sym
- if block
- unless @action.empty?
- raise CompileError, 'both of rule action block and prec block given'
- end
- @action = UserAction.proc(block)
- end
- self
- end
-
- attr_accessor :specified_prec
-
- def nullable?() @null end
- def null=(n) @null = n end
-
- def useless?() @useless end
- def useless=(u) @useless = u end
-
- def inspect
- "#<Racc::Rule id=#{@ident} (#{@target})>"
- end
-
- def ==(other)
- other.kind_of?(Rule) and @ident == other.ident
- end
-
- def [](idx)
- @symbols[idx]
- end
-
- def size
- @symbols.size
- end
-
- def empty?
- @symbols.empty?
- end
-
- def to_s
- "#<rule#{@ident}>"
- end
-
- def accept?
- if tok = @symbols[-1]
- tok.anchor?
- else
- false
- end
- end
-
- def each(&block)
- @symbols.each(&block)
- end
-
- def replace(src, dest)
- @target = dest
- @symbols = @symbols.map {|s| s == src ? dest : s }
- end
-
- end # class Rule
-
-
- class UserAction
-
- def UserAction.source_text(src)
- new(src, nil)
- end
-
- def UserAction.proc(pr = nil, &block)
- if pr and block
- raise ArgumentError, "both of argument and block given"
- end
- new(nil, pr || block)
- end
-
- def UserAction.empty
- new(nil, nil)
- end
-
- private_class_method :new
-
- def initialize(src, proc)
- @source = src
- @proc = proc
- end
-
- attr_reader :source
- attr_reader :proc
-
- def source?
- not @proc
- end
-
- def proc?
- not @source
- end
-
- def empty?
- not @proc and not @source
- end
-
- def name
- "{action type=#{@source || @proc || 'nil'}}"
- end
-
- alias inspect name
-
- end
-
-
- class OrMark
- def initialize(lineno)
- @lineno = lineno
- end
-
- def name
- '|'
- end
-
- alias inspect name
-
- attr_reader :lineno
- end
-
-
- class Prec
- def initialize(symbol, lineno)
- @symbol = symbol
- @lineno = lineno
- end
-
- def name
- "=#{@symbol}"
- end
-
- alias inspect name
-
- attr_reader :symbol
- attr_reader :lineno
- end
-
-
- #
- # A set of rule and position in it's RHS.
- # Note that the number of pointers is more than rule's RHS array,
- # because pointer points right edge of the final symbol when reducing.
- #
- class LocationPointer
-
- def initialize(rule, i, sym)
- @rule = rule
- @index = i
- @symbol = sym
- @ident = @rule.hash + i
- @reduce = sym.nil?
- end
-
- attr_reader :rule
- attr_reader :index
- attr_reader :symbol
-
- alias dereference symbol
-
- attr_reader :ident
- alias hash ident
- attr_reader :reduce
- alias reduce? reduce
-
- def to_s
- sprintf('(%d,%d %s)',
- @rule.ident, @index, (reduce?() ? '#' : @symbol.to_s))
- end
-
- alias inspect to_s
-
- def eql?(ot)
- @hash == ot.hash
- end
-
- alias == eql?
-
- def head?
- @index == 0
- end
-
- def next
- @rule.ptrs[@index + 1] or ptr_bug!
- end
-
- alias increment next
-
- def before(len)
- @rule.ptrs[@index - len] or ptr_bug!
- end
-
- private
-
- def ptr_bug!
- raise "racc: fatal: pointer not exist: self: #{to_s}"
- end
-
- end # class LocationPointer
-
-
- class SymbolTable
-
- include Enumerable
-
- def initialize
- @symbols = [] # :: [Racc::Sym]
- @cache = {} # :: {(String|Symbol) => Racc::Sym}
- @dummy = intern(:$start, true)
- @anchor = intern(false, true) # Symbol ID = 0
- @error = intern(:error, false) # Symbol ID = 1
- end
-
- attr_reader :dummy
- attr_reader :anchor
- attr_reader :error
-
- def [](id)
- @symbols[id]
- end
-
- def intern(val, dummy = false)
- @cache[val] ||=
- begin
- sym = Sym.new(val, dummy)
- @symbols.push sym
- sym
- end
- end
-
- attr_reader :symbols
- alias to_a symbols
-
- def delete(sym)
- @symbols.delete sym
- @cache.delete sym.value
- end
-
- attr_reader :nt_base
-
- def nt_max
- @symbols.size
- end
-
- def each(&block)
- @symbols.each(&block)
- end
-
- def terminals(&block)
- @symbols[0, @nt_base]
- end
-
- def each_terminal(&block)
- @terms.each(&block)
- end
-
- def nonterminals
- @symbols[@nt_base, @symbols.size - @nt_base]
- end
-
- def each_nonterminal(&block)
- @nterms.each(&block)
- end
-
- def fix
- terms, nterms = @symbols.partition {|s| s.terminal? }
- @symbols = terms + nterms
- @terms = terms
- @nterms = nterms
- @nt_base = terms.size
- fix_ident
- check_terminals
- end
-
- private
-
- def fix_ident
- @symbols.each_with_index do |t, i|
- t.ident = i
- end
- end
-
- def check_terminals
- return unless @symbols.any? {|s| s.should_terminal? }
- @anchor.should_terminal
- @error.should_terminal
- each_terminal do |t|
- t.should_terminal if t.string_symbol?
- end
- each do |s|
- s.should_terminal if s.assoc
- end
- terminals().reject {|t| t.should_terminal? }.each do |t|
- raise CompileError, "terminal #{t} not declared as terminal"
- end
- nonterminals().select {|n| n.should_terminal? }.each do |n|
- raise CompileError, "symbol #{n} declared as terminal but is not terminal"
- end
- end
-
- end # class SymbolTable
-
-
- # Stands terminal and nonterminal symbols.
- class Sym
-
- def initialize(value, dummyp)
- @ident = nil
- @value = value
- @dummyp = dummyp
-
- @term = nil
- @nterm = nil
- @should_terminal = false
- @precedence = nil
- case value
- when Symbol
- @to_s = value.to_s
- @serialized = value.inspect
- @string = false
- when String
- @to_s = value.inspect
- @serialized = value.dump
- @string = true
- when false
- @to_s = '$end'
- @serialized = 'false'
- @string = false
- when ErrorSymbolValue
- @to_s = 'error'
- @serialized = 'Object.new'
- @string = false
- else
- raise ArgumentError, "unknown symbol value: #{value.class}"
- end
-
- @heads = []
- @locate = []
- @snull = nil
- @null = nil
- @expand = nil
- @useless = nil
- end
-
- class << self
- def once_writer(nm)
- nm = nm.id2name
- module_eval(<<-EOS)
- def #{nm}=(v)
- raise 'racc: fatal: @#{nm} != nil' unless @#{nm}.nil?
- @#{nm} = v
- end
- EOS
- end
- end
-
- once_writer :ident
- attr_reader :ident
-
- alias hash ident
-
- attr_reader :value
-
- def dummy?
- @dummyp
- end
-
- def terminal?
- @term
- end
-
- def nonterminal?
- @nterm
- end
-
- def term=(t)
- raise 'racc: fatal: term= called twice' unless @term.nil?
- @term = t
- @nterm = !t
- end
-
- def should_terminal
- @should_terminal = true
- end
-
- def should_terminal?
- @should_terminal
- end
-
- def string_symbol?
- @string
- end
-
- def serialize
- @serialized
- end
-
- attr_writer :serialized
-
- attr_accessor :precedence
- attr_accessor :assoc
-
- def to_s
- @to_s.dup
- end
-
- alias inspect to_s
-
- def |(x)
- rule() | x.rule
- end
-
- def rule
- Rule.new(nil, [self], UserAction.empty)
- end
-
- #
- # cache
- #
-
- attr_reader :heads
- attr_reader :locate
-
- def self_null?
- @snull
- end
-
- once_writer :snull
-
- def nullable?
- @null
- end
-
- def null=(n)
- @null = n
- end
-
- attr_reader :expand
- once_writer :expand
-
- def useless?
- @useless
- end
-
- def useless=(f)
- @useless = f
- end
-
- end # class Sym
-
-end # module Racc
diff --git a/lib/racc/grammarfileparser.rb b/lib/racc/grammarfileparser.rb
deleted file mode 100644
index 5e7081f00a..0000000000
--- a/lib/racc/grammarfileparser.rb
+++ /dev/null
@@ -1,560 +0,0 @@
-#
-# $Id: 63bd084db2dce8a2c9760318faae6104717cead7 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of the GNU LGPL, see the file "COPYING".
-#
-
-require 'racc'
-require 'racc/compat'
-require 'racc/grammar'
-require 'racc/parserfilegenerator'
-require 'racc/sourcetext'
-require 'stringio'
-
-module Racc
-
- grammar = Grammar.define {
- g = self
-
- g.class = seq(:CLASS, :cname, many(:param), :RULE, :rules, option(:END))
-
- g.cname = seq(:rubyconst) {|name|
- @result.params.classname = name
- }\
- | seq(:rubyconst, "<", :rubyconst) {|c, _, s|
- @result.params.classname = c
- @result.params.superclass = s
- }
-
- g.rubyconst = separated_by1(:colon2, :SYMBOL) {|syms|
- syms.map {|s| s.to_s }.join('::')
- }
-
- g.colon2 = seq(':', ':')
-
- g.param = seq(:CONV, many1(:convdef), :END) {|*|
- #@grammar.end_convert_block # FIXME
- }\
- | seq(:PRECHIGH, many1(:precdef), :PRECLOW) {|*|
- @grammar.end_precedence_declaration true
- }\
- | seq(:PRECLOW, many1(:precdef), :PRECHIGH) {|*|
- @grammar.end_precedence_declaration false
- }\
- | seq(:START, :symbol) {|_, sym|
- @grammar.start_symbol = sym
- }\
- | seq(:TOKEN, :symbols) {|_, syms|
- syms.each do |s|
- s.should_terminal
- end
- }\
- | seq(:OPTION, :options) {|_, syms|
- syms.each do |opt|
- case opt
- when 'result_var'
- @result.params.result_var = true
- when 'no_result_var'
- @result.params.result_var = false
- when 'omit_action_call'
- @result.params.omit_action_call = true
- when 'no_omit_action_call'
- @result.params.omit_action_call = false
- else
- raise CompileError, "unknown option: #{opt}"
- end
- end
- }\
- | seq(:EXPECT, :DIGIT) {|_, num|
- if @grammar.n_expected_srconflicts
- raise CompileError, "`expect' seen twice"
- end
- @grammar.n_expected_srconflicts = num
- }
-
- g.convdef = seq(:symbol, :STRING) {|sym, code|
- sym.serialized = code
- }
-
- g.precdef = seq(:LEFT, :symbols) {|_, syms|
- @grammar.declare_precedence :Left, syms
- }\
- | seq(:RIGHT, :symbols) {|_, syms|
- @grammar.declare_precedence :Right, syms
- }\
- | seq(:NONASSOC, :symbols) {|_, syms|
- @grammar.declare_precedence :Nonassoc, syms
- }
-
- g.symbols = seq(:symbol) {|sym|
- [sym]
- }\
- | seq(:symbols, :symbol) {|list, sym|
- list.push sym
- list
- }\
- | seq(:symbols, "|")
-
- g.symbol = seq(:SYMBOL) {|sym| @grammar.intern(sym) }\
- | seq(:STRING) {|str| @grammar.intern(str) }
-
- g.options = many(:SYMBOL) {|syms| syms.map {|s| s.to_s } }
-
- g.rules = option(:rules_core) {|list|
- add_rule_block list unless list.empty?
- nil
- }
-
- g.rules_core = seq(:symbol) {|sym|
- [sym]
- }\
- | seq(:rules_core, :rule_item) {|list, i|
- list.push i
- list
- }\
- | seq(:rules_core, ';') {|list, *|
- add_rule_block list unless list.empty?
- list.clear
- list
- }\
- | seq(:rules_core, ':') {|list, *|
- next_target = list.pop
- add_rule_block list unless list.empty?
- [next_target]
- }
-
- g.rule_item = seq(:symbol)\
- | seq("|") {|*|
- OrMark.new(@scanner.lineno)
- }\
- | seq("=", :symbol) {|_, sym|
- Prec.new(sym, @scanner.lineno)
- }\
- | seq(:ACTION) {|src|
- UserAction.source_text(src)
- }
- }
-
- GrammarFileParser = grammar.parser_class
-
- if grammar.states.srconflict_exist?
- raise 'Racc boot script fatal: S/R conflict in build'
- end
- if grammar.states.rrconflict_exist?
- raise 'Racc boot script fatal: R/R conflict in build'
- end
-
- class GrammarFileParser # reopen
-
- class Result
- def initialize(grammar)
- @grammar = grammar
- @params = ParserFileGenerator::Params.new
- end
-
- attr_reader :grammar
- attr_reader :params
- end
-
- def GrammarFileParser.parse_file(filename)
- parse(File.read(filename), filename, 1)
- end
-
- def GrammarFileParser.parse(src, filename = '-', lineno = 1)
- new().parse(src, filename, lineno)
- end
-
- def initialize(debug_flags = DebugFlags.new)
- @yydebug = debug_flags.parse
- end
-
- def parse(src, filename = '-', lineno = 1)
- @filename = filename
- @lineno = lineno
- @scanner = GrammarFileScanner.new(src, @filename)
- @scanner.debug = @yydebug
- @grammar = Grammar.new
- @result = Result.new(@grammar)
- @embedded_action_seq = 0
- yyparse @scanner, :yylex
- parse_user_code
- @result.grammar.init
- @result
- end
-
- private
-
- def next_token
- @scanner.scan
- end
-
- def on_error(tok, val, _values)
- if val.respond_to?(:id2name)
- v = val.id2name
- elsif val.kind_of?(String)
- v = val
- else
- v = val.inspect
- end
- raise CompileError, "#{location()}: unexpected token '#{v}'"
- end
-
- def location
- "#{@filename}:#{@lineno - 1 + @scanner.lineno}"
- end
-
- def add_rule_block(list)
- sprec = nil
- target = list.shift
- case target
- when OrMark, UserAction, Prec
- raise CompileError, "#{target.lineno}: unexpected symbol #{target.name}"
- end
- curr = []
- list.each do |i|
- case i
- when OrMark
- add_rule target, curr, sprec
- curr = []
- sprec = nil
- when Prec
- raise CompileError, "'=<prec>' used twice in one rule" if sprec
- sprec = i.symbol
- else
- curr.push i
- end
- end
- add_rule target, curr, sprec
- end
-
- def add_rule(target, list, sprec)
- if list.last.kind_of?(UserAction)
- act = list.pop
- else
- act = UserAction.empty
- end
- list.map! {|s| s.kind_of?(UserAction) ? embedded_action(s) : s }
- rule = Rule.new(target, list, act)
- rule.specified_prec = sprec
- @grammar.add rule
- end
-
- def embedded_action(act)
- sym = @grammar.intern("@#{@embedded_action_seq += 1}".intern, true)
- @grammar.add Rule.new(sym, [], act)
- sym
- end
-
- #
- # User Code Block
- #
-
- def parse_user_code
- line = @scanner.lineno
- _, *blocks = *@scanner.epilogue.split(/^----/)
- blocks.each do |block|
- header, *body = block.lines.to_a
- label0, pathes = *header.sub(/\A-+/, '').split('=', 2)
- label = canonical_label(label0)
- (pathes ? pathes.strip.split(' ') : []).each do |path|
- add_user_code label, SourceText.new(File.read(path), path, 1)
- end
- add_user_code label, SourceText.new(body.join(''), @filename, line + 1)
- line += (1 + body.size)
- end
- end
-
- USER_CODE_LABELS = {
- 'header' => :header,
- 'prepare' => :header, # obsolete
- 'inner' => :inner,
- 'footer' => :footer,
- 'driver' => :footer # obsolete
- }
-
- def canonical_label(src)
- label = src.to_s.strip.downcase.slice(/\w+/)
- unless USER_CODE_LABELS.key?(label)
- raise CompileError, "unknown user code type: #{label.inspect}"
- end
- label
- end
-
- def add_user_code(label, src)
- @result.params.send(USER_CODE_LABELS[label]).push src
- end
-
- end
-
-
- class GrammarFileScanner
-
- def initialize(str, filename = '-')
- @lines = str.b.split(/\n|\r\n|\r/)
- @filename = filename
- @lineno = -1
- @line_head = true
- @in_rule_blk = false
- @in_conv_blk = false
- @in_block = nil
- @epilogue = ''
- @debug = false
- next_line
- end
-
- attr_reader :epilogue
-
- def lineno
- @lineno + 1
- end
-
- attr_accessor :debug
-
- def yylex(&block)
- unless @debug
- yylex0(&block)
- else
- yylex0 do |sym, tok|
- $stderr.printf "%7d %-10s %s\n", lineno(), sym.inspect, tok.inspect
- yield [sym, tok]
- end
- end
- end
-
- private
-
- def yylex0
- begin
- until @line.empty?
- @line.sub!(/\A\s+/, '')
- if /\A\#/ =~ @line
- break
- elsif /\A\/\*/ =~ @line
- skip_comment
- elsif s = reads(/\A[a-zA-Z_]\w*/)
- yield [atom_symbol(s), s.intern]
- elsif s = reads(/\A\d+/)
- yield [:DIGIT, s.to_i]
- elsif ch = reads(/\A./)
- case ch
- when '"', "'"
- yield [:STRING, eval(scan_quoted(ch))]
- when '{'
- lineno = lineno()
- yield [:ACTION, SourceText.new(scan_action(), @filename, lineno)]
- else
- if ch == '|'
- @line_head = false
- end
- yield [ch, ch]
- end
- else
- end
- end
- end while next_line()
- yield nil
- end
-
- def next_line
- @lineno += 1
- @line = @lines[@lineno]
- if not @line or /\A----/ =~ @line
- @epilogue = @lines.join("\n")
- @lines.clear
- @line = nil
- if @in_block
- @lineno -= 1
- scan_error! sprintf('unterminated %s', @in_block)
- end
- false
- else
- @line.sub!(/(?:\n|\r\n|\r)\z/, '')
- @line_head = true
- true
- end
- end
-
- ReservedWord = {
- 'right' => :RIGHT,
- 'left' => :LEFT,
- 'nonassoc' => :NONASSOC,
- 'preclow' => :PRECLOW,
- 'prechigh' => :PRECHIGH,
- 'token' => :TOKEN,
- 'convert' => :CONV,
- 'options' => :OPTION,
- 'start' => :START,
- 'expect' => :EXPECT,
- 'class' => :CLASS,
- 'rule' => :RULE,
- 'end' => :END
- }
-
- def atom_symbol(token)
- if token == 'end'
- symbol = :END
- @in_conv_blk = false
- @in_rule_blk = false
- else
- if @line_head and not @in_conv_blk and not @in_rule_blk
- symbol = ReservedWord[token] || :SYMBOL
- else
- symbol = :SYMBOL
- end
- case symbol
- when :RULE then @in_rule_blk = true
- when :CONV then @in_conv_blk = true
- end
- end
- @line_head = false
- symbol
- end
-
- def skip_comment
- @in_block = 'comment'
- until m = /\*\//.match(@line)
- next_line
- end
- @line = m.post_match
- @in_block = nil
- end
-
- $raccs_print_type = false
-
- def scan_action
- buf = ''
- nest = 1
- pre = nil
- @in_block = 'action'
- begin
- pre = nil
- if s = reads(/\A\s+/)
- # does not set 'pre'
- buf << s
- end
- until @line.empty?
- if s = reads(/\A[^'"`{}%#\/\$]+/)
- buf << (pre = s)
- next
- end
- case ch = read(1)
- when '{'
- nest += 1
- buf << (pre = ch)
- when '}'
- nest -= 1
- if nest == 0
- @in_block = nil
- buf.sub!(/[ \t\f]+\z/, '')
- return buf
- end
- buf << (pre = ch)
- when '#' # comment
- buf << ch << @line
- break
- when "'", '"', '`'
- buf << (pre = scan_quoted(ch))
- when '%'
- if literal_head? pre, @line
- # % string, regexp, array
- buf << ch
- case ch = read(1)
- when /[qQx]/n
- buf << ch << (pre = scan_quoted(read(1), '%string'))
- when /wW/n
- buf << ch << (pre = scan_quoted(read(1), '%array'))
- when /s/n
- buf << ch << (pre = scan_quoted(read(1), '%symbol'))
- when /r/n
- buf << ch << (pre = scan_quoted(read(1), '%regexp'))
- when /[a-zA-Z0-9= ]/n # does not include "_"
- scan_error! "unknown type of % literal '%#{ch}'"
- else
- buf << (pre = scan_quoted(ch, '%string'))
- end
- else
- # operator
- buf << '||op->' if $raccs_print_type
- buf << (pre = ch)
- end
- when '/'
- if literal_head? pre, @line
- # regexp
- buf << (pre = scan_quoted(ch, 'regexp'))
- else
- # operator
- buf << '||op->' if $raccs_print_type
- buf << (pre = ch)
- end
- when '$' # gvar
- buf << ch << (pre = read(1))
- else
- raise 'racc: fatal: must not happen'
- end
- end
- buf << "\n"
- end while next_line()
- raise 'racc: fatal: scan finished before parser finished'
- end
-
- def literal_head?(pre, post)
- (!pre || /[a-zA-Z_0-9]/n !~ pre[-1,1]) &&
- !post.empty? && /\A[\s\=]/n !~ post
- end
-
- def read(len)
- s = @line[0, len]
- @line = @line[len .. -1]
- s
- end
-
- def reads(re)
- m = re.match(@line) or return nil
- @line = m.post_match
- m[0]
- end
-
- def scan_quoted(left, tag = 'string')
- buf = left.dup
- buf = "||#{tag}->" + buf if $raccs_print_type
- re = get_quoted_re(left)
- sv, @in_block = @in_block, tag
- begin
- if s = reads(re)
- buf << s
- break
- else
- buf << @line
- end
- end while next_line()
- @in_block = sv
- buf << "<-#{tag}||" if $raccs_print_type
- buf
- end
-
- LEFT_TO_RIGHT = {
- '(' => ')',
- '{' => '}',
- '[' => ']',
- '<' => '>'
- }
-
- CACHE = {}
-
- def get_quoted_re(left)
- term = Regexp.quote(LEFT_TO_RIGHT[left] || left)
- CACHE[left] ||= /\A[^#{term}\\]*(?:\\.[^\\#{term}]*)*#{term}/
- end
-
- def scan_error!(msg)
- raise CompileError, "#{lineno()}: #{msg}"
- end
-
- end
-
-end # module Racc
diff --git a/lib/racc/info.rb b/lib/racc/info.rb
deleted file mode 100644
index b7db7b6c9b..0000000000
--- a/lib/racc/info.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# $Id: 8ab2cb5341529fe5e35956bb1a1f42ec9b9c6f5a $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-# see the file "COPYING".
-
-module Racc
- VERSION = '1.4.16'
- Version = VERSION
- Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
-end
diff --git a/lib/racc/iset.rb b/lib/racc/iset.rb
deleted file mode 100644
index 245bad8b50..0000000000
--- a/lib/racc/iset.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#
-# $Id: 31aa4331c08dfd4609c06eb5f94b7ef38dc708e1 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of the GNU LGPL, see the file "COPYING".
-#
-
-module Racc
-
- # An "indexed" set. All items must respond to :ident.
- class ISet
-
- def initialize(a = [])
- @set = a
- end
-
- attr_reader :set
-
- def add(i)
- @set[i.ident] = i
- end
-
- def [](key)
- @set[key.ident]
- end
-
- def []=(key, val)
- @set[key.ident] = val
- end
-
- alias include? []
- alias key? []
-
- def update(other)
- s = @set
- o = other.set
- o.each_index do |idx|
- if t = o[idx]
- s[idx] = t
- end
- end
- end
-
- def update_a(a)
- s = @set
- a.each {|i| s[i.ident] = i }
- end
-
- def delete(key)
- i = @set[key.ident]
- @set[key.ident] = nil
- i
- end
-
- def each(&block)
- @set.compact.each(&block)
- end
-
- def to_a
- @set.compact
- end
-
- def to_s
- "[#{@set.compact.join(' ')}]"
- end
-
- alias inspect to_s
-
- def size
- @set.nitems
- end
-
- def empty?
- @set.nitems == 0
- end
-
- def clear
- @set.clear
- end
-
- def dup
- ISet.new(@set.dup)
- end
-
- end # class ISet
-
-end # module Racc
diff --git a/lib/racc/logfilegenerator.rb b/lib/racc/logfilegenerator.rb
deleted file mode 100644
index 68593c41f6..0000000000
--- a/lib/racc/logfilegenerator.rb
+++ /dev/null
@@ -1,211 +0,0 @@
-#
-# $Id: 5e9d0a01b5d56fd9cdc3d5cb078b1a3e1bbaf779 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of the GNU LGPL, see the file "COPYING".
-#
-
-module Racc
-
- class LogFileGenerator
-
- def initialize(states, debug_flags = DebugFlags.new)
- @states = states
- @grammar = states.grammar
- @debug_flags = debug_flags
- end
-
- def output(out)
- output_conflict out; out.puts
- output_useless out; out.puts
- output_rule out; out.puts
- output_token out; out.puts
- output_state out
- end
-
- #
- # Warnings
- #
-
- def output_conflict(out)
- @states.each do |state|
- if state.srconf
- out.printf "state %d contains %d shift/reduce conflicts\n",
- state.stateid, state.srconf.size
- end
- if state.rrconf
- out.printf "state %d contains %d reduce/reduce conflicts\n",
- state.stateid, state.rrconf.size
- end
- end
- end
-
- def output_useless(out)
- @grammar.each do |rl|
- if rl.useless?
- out.printf "rule %d (%s) never reduced\n",
- rl.ident, rl.target.to_s
- end
- end
- @grammar.each_nonterminal do |t|
- if t.useless?
- out.printf "useless nonterminal %s\n", t.to_s
- end
- end
- end
-
- #
- # States
- #
-
- def output_state(out)
- out << "--------- State ---------\n"
-
- showall = @debug_flags.la || @debug_flags.state
- @states.each do |state|
- out << "\nstate #{state.ident}\n\n"
-
- (showall ? state.closure : state.core).each do |ptr|
- pointer_out(out, ptr) if ptr.rule.ident != 0 or showall
- end
- out << "\n"
-
- action_out out, state
- end
- end
-
- def pointer_out(out, ptr)
- buf = sprintf("%4d) %s :", ptr.rule.ident, ptr.rule.target.to_s)
- ptr.rule.symbols.each_with_index do |tok, idx|
- buf << ' _' if idx == ptr.index
- buf << ' ' << tok.to_s
- end
- buf << ' _' if ptr.reduce?
- out.puts buf
- end
-
- def action_out(f, state)
- sr = state.srconf && state.srconf.dup
- rr = state.rrconf && state.rrconf.dup
- acts = state.action
- keys = acts.keys
- keys.sort! {|a,b| a.ident <=> b.ident }
-
- [ Shift, Reduce, Error, Accept ].each do |klass|
- keys.delete_if do |tok|
- act = acts[tok]
- if act.kind_of?(klass)
- outact f, tok, act
- if sr and c = sr.delete(tok)
- outsrconf f, c
- end
- if rr and c = rr.delete(tok)
- outrrconf f, c
- end
-
- true
- else
- false
- end
- end
- end
- sr.each {|tok, c| outsrconf f, c } if sr
- rr.each {|tok, c| outrrconf f, c } if rr
-
- act = state.defact
- if not act.kind_of?(Error) or @debug_flags.any?
- outact f, '$default', act
- end
-
- f.puts
- state.goto_table.each do |t, st|
- if t.nonterminal?
- f.printf " %-12s go to state %d\n", t.to_s, st.ident
- end
- end
- end
-
- def outact(f, t, act)
- case act
- when Shift
- f.printf " %-12s shift, and go to state %d\n",
- t.to_s, act.goto_id
- when Reduce
- f.printf " %-12s reduce using rule %d (%s)\n",
- t.to_s, act.ruleid, act.rule.target.to_s
- when Accept
- f.printf " %-12s accept\n", t.to_s
- when Error
- f.printf " %-12s error\n", t.to_s
- else
- raise "racc: fatal: wrong act for outact: act=#{act}(#{act.class})"
- end
- end
-
- def outsrconf(f, confs)
- confs.each do |c|
- r = c.reduce
- f.printf " %-12s [reduce using rule %d (%s)]\n",
- c.shift.to_s, r.ident, r.target.to_s
- end
- end
-
- def outrrconf(f, confs)
- confs.each do |c|
- r = c.low_prec
- f.printf " %-12s [reduce using rule %d (%s)]\n",
- c.token.to_s, r.ident, r.target.to_s
- end
- end
-
- #
- # Rules
- #
-
- def output_rule(out)
- out.print "-------- Grammar --------\n\n"
- @grammar.each do |rl|
- if @debug_flags.any? or rl.ident != 0
- out.printf "rule %d %s: %s\n",
- rl.ident, rl.target.to_s, rl.symbols.join(' ')
- end
- end
- end
-
- #
- # Tokens
- #
-
- def output_token(out)
- out.print "------- Symbols -------\n\n"
-
- out.print "**Nonterminals, with rules where they appear\n\n"
- @grammar.each_nonterminal do |t|
- tmp = <<SRC
- %s (%d)
- on right: %s
- on left : %s
-SRC
- out.printf tmp, t.to_s, t.ident,
- symbol_locations(t.locate).join(' '),
- symbol_locations(t.heads).join(' ')
- end
-
- out.print "\n**Terminals, with rules where they appear\n\n"
- @grammar.each_terminal do |t|
- out.printf " %s (%d) %s\n",
- t.to_s, t.ident, symbol_locations(t.locate).join(' ')
- end
- end
-
- def symbol_locations(locs)
- locs.map {|loc| loc.rule.ident }.reject {|n| n == 0 }.uniq
- end
-
- end
-
-end # module Racc
diff --git a/lib/racc/parser-text.rb b/lib/racc/parser-text.rb
deleted file mode 100644
index 31b8e2c01f..0000000000
--- a/lib/racc/parser-text.rb
+++ /dev/null
@@ -1,643 +0,0 @@
-module Racc
- PARSER_TEXT = <<'__end_of_file__'
-# frozen_string_literal: false
-#--
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-#
-# As a special exception, when this code is copied by Racc
-# into a Racc output file, you may use that output file
-# without restriction.
-#++
-
-require 'racc/info'
-
-unless defined?(NotImplementedError)
- NotImplementedError = NotImplementError # :nodoc:
-end
-
-module Racc
- class ParseError < StandardError; end
-end
-unless defined?(::ParseError)
- ParseError = Racc::ParseError
-end
-
-# Racc is a LALR(1) parser generator.
-# It is written in Ruby itself, and generates Ruby programs.
-#
-# == Command-line Reference
-#
-# racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
-# [-e<var>rubypath</var>] [--embedded=<var>rubypath</var>]
-# [-v] [--verbose]
-# [-O<var>filename</var>] [--log-file=<var>filename</var>]
-# [-g] [--debug]
-# [-E] [--embedded]
-# [-l] [--no-line-convert]
-# [-c] [--line-convert-all]
-# [-a] [--no-omit-actions]
-# [-C] [--check-only]
-# [-S] [--output-status]
-# [--version] [--copyright] [--help] <var>grammarfile</var>
-#
-# [+filename+]
-# Racc grammar file. Any extension is permitted.
-# [-o+outfile+, --output-file=+outfile+]
-# A filename for output. default is <+filename+>.tab.rb
-# [-O+filename+, --log-file=+filename+]
-# Place logging output in file +filename+.
-# Default log file name is <+filename+>.output.
-# [-e+rubypath+, --executable=+rubypath+]
-# output executable file(mode 755). where +path+ is the Ruby interpreter.
-# [-v, --verbose]
-# verbose mode. create +filename+.output file, like yacc's y.output file.
-# [-g, --debug]
-# add debug code to parser class. To display debuggin information,
-# use this '-g' option and set @yydebug true in parser class.
-# [-E, --embedded]
-# Output parser which doesn't need runtime files (racc/parser.rb).
-# [-C, --check-only]
-# Check syntax of racc grammar file and quit.
-# [-S, --output-status]
-# Print messages time to time while compiling.
-# [-l, --no-line-convert]
-# turns off line number converting.
-# [-c, --line-convert-all]
-# Convert line number of actions, inner, header and footer.
-# [-a, --no-omit-actions]
-# Call all actions, even if an action is empty.
-# [--version]
-# print Racc version and quit.
-# [--copyright]
-# Print copyright and quit.
-# [--help]
-# Print usage and quit.
-#
-# == Generating Parser Using Racc
-#
-# To compile Racc grammar file, simply type:
-#
-# $ racc parse.y
-#
-# This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
-#
-# == Writing A Racc Grammar File
-#
-# If you want your own parser, you have to write a grammar file.
-# A grammar file contains the name of your parser class, grammar for the parser,
-# user code, and anything else.
-# When writing a grammar file, yacc's knowledge is helpful.
-# If you have not used yacc before, Racc is not too difficult.
-#
-# Here's an example Racc grammar file.
-#
-# class Calcparser
-# rule
-# target: exp { print val[0] }
-#
-# exp: exp '+' exp
-# | exp '*' exp
-# | '(' exp ')'
-# | NUMBER
-# end
-#
-# Racc grammar files resemble yacc files.
-# But (of course), this is Ruby code.
-# yacc's $$ is the 'result', $0, $1... is
-# an array called 'val', and $-1, $-2... is an array called '_values'.
-#
-# See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
-# more information on grammar files.
-#
-# == Parser
-#
-# Then you must prepare the parse entry method. There are two types of
-# parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
-#
-# Racc::Parser#do_parse is simple.
-#
-# It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
-# This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
-# EOF is [false, false].
-# (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
-# If you want to change this, see the grammar reference.
-#
-# Racc::Parser#yyparse is little complicated, but useful.
-# It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
-#
-# For example, <code>yyparse(obj, :scan)</code> causes
-# calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
-#
-# == Debugging
-#
-# When debugging, "-v" or/and the "-g" option is helpful.
-#
-# "-v" creates verbose log file (.output).
-# "-g" creates a "Verbose Parser".
-# Verbose Parser prints the internal status when parsing.
-# But it's _not_ automatic.
-# You must use -g option and set +@yydebug+ to +true+ in order to get output.
-# -g option only creates the verbose parser.
-#
-# === Racc reported syntax error.
-#
-# Isn't there too many "end"?
-# grammar of racc file is changed in v0.10.
-#
-# Racc does not use '%' mark, while yacc uses huge number of '%' marks..
-#
-# === Racc reported "XXXX conflicts".
-#
-# Try "racc -v xxxx.y".
-# It causes producing racc's internal log file, xxxx.output.
-#
-# === Generated parsers does not work correctly
-#
-# Try "racc -g xxxx.y".
-# This command let racc generate "debugging parser".
-# Then set @yydebug=true in your parser.
-# It produces a working log of your parser.
-#
-# == Re-distributing Racc runtime
-#
-# A parser, which is created by Racc, requires the Racc runtime module;
-# racc/parser.rb.
-#
-# Ruby 1.8.x comes with Racc runtime module,
-# you need NOT distribute Racc runtime files.
-#
-# If you want to include the Racc runtime module with your parser.
-# This can be done by using '-E' option:
-#
-# $ racc -E -omyparser.rb myparser.y
-#
-# This command creates myparser.rb which `includes' Racc runtime.
-# Only you must do is to distribute your parser file (myparser.rb).
-#
-# Note: parser.rb is ruby license, but your parser is not.
-# Your own parser is completely yours.
-module Racc
-
- unless defined?(Racc_No_Extentions)
- Racc_No_Extentions = false # :nodoc:
- end
-
- class Parser
-
- Racc_Runtime_Version = ::Racc::VERSION
- Racc_Runtime_Revision = '$Id: 7adc21ee7a5690f10b7ff399b8af4e2717b9d94c $'
-
- Racc_Runtime_Core_Version_R = ::Racc::VERSION
- Racc_Runtime_Core_Revision_R = '$Id: 7adc21ee7a5690f10b7ff399b8af4e2717b9d94c $'.split[1]
- begin
- if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
- require 'racc/cparse-jruby.jar'
- com.headius.racc.Cparse.new.load(JRuby.runtime, false)
- else
- require 'racc/cparse'
- end
- # Racc_Runtime_Core_Version_C = (defined in extension)
- Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
- unless new.respond_to?(:_racc_do_parse_c, true)
- raise LoadError, 'old cparse.so'
- end
- if Racc_No_Extentions
- raise LoadError, 'selecting ruby version of racc runtime core'
- end
-
- Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
- Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
- Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C # :nodoc:
- Racc_Runtime_Type = 'c' # :nodoc:
- rescue LoadError
-puts $!
-puts $!.backtrace
- Racc_Main_Parsing_Routine = :_racc_do_parse_rb
- Racc_YY_Parse_Method = :_racc_yyparse_rb
- Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R
- Racc_Runtime_Type = 'ruby'
- end
-
- def Parser.racc_runtime_type # :nodoc:
- Racc_Runtime_Type
- end
-
- def _racc_setup
- @yydebug = false unless self.class::Racc_debug_parser
- @yydebug = false unless defined?(@yydebug)
- if @yydebug
- @racc_debug_out = $stderr unless defined?(@racc_debug_out)
- @racc_debug_out ||= $stderr
- end
- arg = self.class::Racc_arg
- arg[13] = true if arg.size < 14
- arg
- end
-
- def _racc_init_sysvars
- @racc_state = [0]
- @racc_tstack = []
- @racc_vstack = []
-
- @racc_t = nil
- @racc_val = nil
-
- @racc_read_next = true
-
- @racc_user_yyerror = false
- @racc_error_status = 0
- end
-
- # The entry point of the parser. This method is used with #next_token.
- # If Racc wants to get token (and its value), calls next_token.
- #
- # Example:
- # def parse
- # @q = [[1,1],
- # [2,2],
- # [3,3],
- # [false, '$']]
- # do_parse
- # end
- #
- # def next_token
- # @q.shift
- # end
- class_eval %{
- def do_parse
- #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
- end
- }
-
- # The method to fetch next token.
- # If you use #do_parse method, you must implement #next_token.
- #
- # The format of return value is [TOKEN_SYMBOL, VALUE].
- # +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
- # for 'IDENT'. ";" (String) for ';'.
- #
- # The final symbol (End of file) must be false.
- def next_token
- raise NotImplementedError, "#{self.class}\#next_token is not defined"
- end
-
- def _racc_do_parse_rb(arg, in_debug)
- action_table, action_check, action_default, action_pointer,
- _, _, _, _,
- _, _, token_table, * = arg
-
- _racc_init_sysvars
- tok = act = i = nil
-
- catch(:racc_end_parse) {
- while true
- if i = action_pointer[@racc_state[-1]]
- if @racc_read_next
- if @racc_t != 0 # not EOF
- tok, @racc_val = next_token()
- unless tok # EOF
- @racc_t = 0
- else
- @racc_t = (token_table[tok] or 1) # error token
- end
- racc_read_token(@racc_t, tok, @racc_val) if @yydebug
- @racc_read_next = false
- end
- end
- i += @racc_t
- unless i >= 0 and
- act = action_table[i] and
- action_check[i] == @racc_state[-1]
- act = action_default[@racc_state[-1]]
- end
- else
- act = action_default[@racc_state[-1]]
- end
- while act = _racc_evalact(act, arg)
- ;
- end
- end
- }
- end
-
- # Another entry point for the parser.
- # If you use this method, you must implement RECEIVER#METHOD_ID method.
- #
- # RECEIVER#METHOD_ID is a method to get next token.
- # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
- class_eval %{
- def yyparse(recv, mid)
- #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), true)
- end
- }
-
- def _racc_yyparse_rb(recv, mid, arg, c_debug)
- action_table, action_check, action_default, action_pointer,
- _, _, _, _,
- _, _, token_table, * = arg
-
- _racc_init_sysvars
-
- catch(:racc_end_parse) {
- until i = action_pointer[@racc_state[-1]]
- while act = _racc_evalact(action_default[@racc_state[-1]], arg)
- ;
- end
- end
- recv.__send__(mid) do |tok, val|
- unless tok
- @racc_t = 0
- else
- @racc_t = (token_table[tok] or 1) # error token
- end
- @racc_val = val
- @racc_read_next = false
-
- i += @racc_t
- unless i >= 0 and
- act = action_table[i] and
- action_check[i] == @racc_state[-1]
- act = action_default[@racc_state[-1]]
- end
- while act = _racc_evalact(act, arg)
- ;
- end
-
- while !(i = action_pointer[@racc_state[-1]]) ||
- ! @racc_read_next ||
- @racc_t == 0 # $
- unless i and i += @racc_t and
- i >= 0 and
- act = action_table[i] and
- action_check[i] == @racc_state[-1]
- act = action_default[@racc_state[-1]]
- end
- while act = _racc_evalact(act, arg)
- ;
- end
- end
- end
- }
- end
-
- ###
- ### common
- ###
-
- def _racc_evalact(act, arg)
- action_table, action_check, _, action_pointer,
- _, _, _, _,
- _, _, _, shift_n,
- reduce_n, * = arg
- nerr = 0 # tmp
-
- if act > 0 and act < shift_n
- #
- # shift
- #
- if @racc_error_status > 0
- @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
- end
- @racc_vstack.push @racc_val
- @racc_state.push act
- @racc_read_next = true
- if @yydebug
- @racc_tstack.push @racc_t
- racc_shift @racc_t, @racc_tstack, @racc_vstack
- end
-
- elsif act < 0 and act > -reduce_n
- #
- # reduce
- #
- code = catch(:racc_jump) {
- @racc_state.push _racc_do_reduce(arg, act)
- false
- }
- if code
- case code
- when 1 # yyerror
- @racc_user_yyerror = true # user_yyerror
- return -reduce_n
- when 2 # yyaccept
- return shift_n
- else
- raise '[Racc Bug] unknown jump code'
- end
- end
-
- elsif act == shift_n
- #
- # accept
- #
- racc_accept if @yydebug
- throw :racc_end_parse, @racc_vstack[0]
-
- elsif act == -reduce_n
- #
- # error
- #
- case @racc_error_status
- when 0
- unless arg[21] # user_yyerror
- nerr += 1
- on_error @racc_t, @racc_val, @racc_vstack
- end
- when 3
- if @racc_t == 0 # is $
- # We're at EOF, and another error occurred immediately after
- # attempting auto-recovery
- throw :racc_end_parse, nil
- end
- @racc_read_next = true
- end
- @racc_user_yyerror = false
- @racc_error_status = 3
- while true
- if i = action_pointer[@racc_state[-1]]
- i += 1 # error token
- if i >= 0 and
- (act = action_table[i]) and
- action_check[i] == @racc_state[-1]
- break
- end
- end
- throw :racc_end_parse, nil if @racc_state.size <= 1
- @racc_state.pop
- @racc_vstack.pop
- if @yydebug
- @racc_tstack.pop
- racc_e_pop @racc_state, @racc_tstack, @racc_vstack
- end
- end
- return act
-
- else
- raise "[Racc Bug] unknown action #{act.inspect}"
- end
-
- racc_next_state(@racc_state[-1], @racc_state) if @yydebug
-
- nil
- end
-
- def _racc_do_reduce(arg, act)
- _, _, _, _,
- goto_table, goto_check, goto_default, goto_pointer,
- nt_base, reduce_table, _, _,
- _, use_result, * = arg
-
- state = @racc_state
- vstack = @racc_vstack
- tstack = @racc_tstack
-
- i = act * -3
- len = reduce_table[i]
- reduce_to = reduce_table[i+1]
- method_id = reduce_table[i+2]
- void_array = []
-
- tmp_t = tstack[-len, len] if @yydebug
- tmp_v = vstack[-len, len]
- tstack[-len, len] = void_array if @yydebug
- vstack[-len, len] = void_array
- state[-len, len] = void_array
-
- # tstack must be updated AFTER method call
- if use_result
- vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
- else
- vstack.push __send__(method_id, tmp_v, vstack)
- end
- tstack.push reduce_to
-
- racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
-
- k1 = reduce_to - nt_base
- if i = goto_pointer[k1]
- i += state[-1]
- if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
- return curstate
- end
- end
- goto_default[k1]
- end
-
- # This method is called when a parse error is found.
- #
- # ERROR_TOKEN_ID is an internal ID of token which caused error.
- # You can get string representation of this ID by calling
- # #token_to_str.
- #
- # ERROR_VALUE is a value of error token.
- #
- # value_stack is a stack of symbol values.
- # DO NOT MODIFY this object.
- #
- # This method raises ParseError by default.
- #
- # If this method returns, parsers enter "error recovering mode".
- def on_error(t, val, vstack)
- raise ParseError, sprintf("\nparse error on value %s (%s)",
- val.inspect, token_to_str(t) || '?')
- end
-
- # Enter error recovering mode.
- # This method does not call #on_error.
- def yyerror
- throw :racc_jump, 1
- end
-
- # Exit parser.
- # Return value is Symbol_Value_Stack[0].
- def yyaccept
- throw :racc_jump, 2
- end
-
- # Leave error recovering mode.
- def yyerrok
- @racc_error_status = 0
- end
-
- # For debugging output
- def racc_read_token(t, tok, val)
- @racc_debug_out.print 'read '
- @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
- @racc_debug_out.puts val.inspect
- @racc_debug_out.puts
- end
-
- def racc_shift(tok, tstack, vstack)
- @racc_debug_out.puts "shift #{racc_token2str tok}"
- racc_print_stacks tstack, vstack
- @racc_debug_out.puts
- end
-
- def racc_reduce(toks, sim, tstack, vstack)
- out = @racc_debug_out
- out.print 'reduce '
- if toks.empty?
- out.print ' <none>'
- else
- toks.each {|t| out.print ' ', racc_token2str(t) }
- end
- out.puts " --> #{racc_token2str(sim)}"
- racc_print_stacks tstack, vstack
- @racc_debug_out.puts
- end
-
- def racc_accept
- @racc_debug_out.puts 'accept'
- @racc_debug_out.puts
- end
-
- def racc_e_pop(state, tstack, vstack)
- @racc_debug_out.puts 'error recovering mode: pop token'
- racc_print_states state
- racc_print_stacks tstack, vstack
- @racc_debug_out.puts
- end
-
- def racc_next_state(curstate, state)
- @racc_debug_out.puts "goto #{curstate}"
- racc_print_states state
- @racc_debug_out.puts
- end
-
- def racc_print_stacks(t, v)
- out = @racc_debug_out
- out.print ' ['
- t.each_index do |i|
- out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
- end
- out.puts ' ]'
- end
-
- def racc_print_states(s)
- out = @racc_debug_out
- out.print ' ['
- s.each {|st| out.print ' ', st }
- out.puts ' ]'
- end
-
- def racc_token2str(tok)
- self.class::Racc_token_to_s_table[tok] or
- raise "[Racc Bug] can't convert token #{tok} to string"
- end
-
- # Convert internal ID of token symbol to the string.
- def token_to_str(t)
- self.class::Racc_token_to_s_table[t]
- end
-
- end
-
-end
-
-__end_of_file__
-end
diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb
index 56b4af9dea..f811ab6e78 100644
--- a/lib/racc/parser.rb
+++ b/lib/racc/parser.rb
@@ -1,5 +1,6 @@
-# frozen_string_literal: false
#--
+# $originalId: parser.rb,v 1.8 2006/07/06 11:42:07 aamine Exp $
+#
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
@@ -10,12 +11,6 @@
# without restriction.
#++
-require 'racc/info'
-
-unless defined?(NotImplementedError)
- NotImplementedError = NotImplementError # :nodoc:
-end
-
module Racc
class ParseError < StandardError; end
end
@@ -53,7 +48,7 @@ end
# [-v, --verbose]
# verbose mode. create +filename+.output file, like yacc's y.output file.
# [-g, --debug]
-# add debug code to parser class. To display debuggin information,
+# add debug code to parser class. To display debugging information,
# use this '-g' option and set @yydebug true in parser class.
# [-E, --embedded]
# Output parser which doesn't need runtime files (racc/parser.rb).
@@ -175,34 +170,29 @@ end
# This command creates myparser.rb which `includes' Racc runtime.
# Only you must do is to distribute your parser file (myparser.rb).
#
-# Note: parser.rb is ruby license, but your parser is not.
+# Note: parser.rb is LGPL, but your parser is not.
# Your own parser is completely yours.
module Racc
- unless defined?(Racc_No_Extentions)
- Racc_No_Extentions = false # :nodoc:
+ unless defined?(Racc_No_Extensions)
+ Racc_No_Extensions = false # :nodoc:
end
class Parser
- Racc_Runtime_Version = ::Racc::VERSION
- Racc_Runtime_Revision = '$Id: e754525bd317344c4284fca6fdce0a425979ade1 $'
+ Racc_Runtime_Version = '1.4.6'
+ Racc_Runtime_Revision = %w$originalRevision: 1.8 $[1]
- Racc_Runtime_Core_Version_R = ::Racc::VERSION
- Racc_Runtime_Core_Revision_R = '$Id: e754525bd317344c4284fca6fdce0a425979ade1 $'.split[1]
+ Racc_Runtime_Core_Version_R = '1.4.6'
+ Racc_Runtime_Core_Revision_R = %w$originalRevision: 1.8 $[1]
begin
- if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
- require 'racc/cparse-jruby.jar'
- com.headius.racc.Cparse.new.load(JRuby.runtime, false)
- else
- require 'racc/cparse'
- end
+ require 'racc/cparse'
# Racc_Runtime_Core_Version_C = (defined in extension)
Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
unless new.respond_to?(:_racc_do_parse_c, true)
raise LoadError, 'old cparse.so'
end
- if Racc_No_Extentions
+ if Racc_No_Extensions
raise LoadError, 'selecting ruby version of racc runtime core'
end
@@ -212,8 +202,6 @@ module Racc
Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C # :nodoc:
Racc_Runtime_Type = 'c' # :nodoc:
rescue LoadError
-puts $!
-puts $!.backtrace
Racc_Main_Parsing_Routine = :_racc_do_parse_rb
Racc_YY_Parse_Method = :_racc_yyparse_rb
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
@@ -266,11 +254,9 @@ puts $!.backtrace
# def next_token
# @q.shift
# end
- class_eval %{
def do_parse
- #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
+ __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
end
- }
# The method to fetch next token.
# If you use #do_parse method, you must implement #next_token.
@@ -287,7 +273,8 @@ puts $!.backtrace
def _racc_do_parse_rb(arg, in_debug)
action_table, action_check, action_default, action_pointer,
_, _, _, _,
- _, _, token_table, * = arg
+ _, _, token_table, _,
+ _, _, * = arg
_racc_init_sysvars
tok = act = i = nil
@@ -328,18 +315,19 @@ puts $!.backtrace
#
# RECEIVER#METHOD_ID is a method to get next token.
# It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
- class_eval %{
def yyparse(recv, mid)
- #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), true)
+ __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true)
end
- }
def _racc_yyparse_rb(recv, mid, arg, c_debug)
action_table, action_check, action_default, action_pointer,
- _, _, _, _,
- _, _, token_table, * = arg
+ _, _, _, _,
+ _, _, token_table, _,
+ _, _, * = arg
_racc_init_sysvars
+ act = nil
+ i = nil
catch(:racc_end_parse) {
until i = action_pointer[@racc_state[-1]]
@@ -366,9 +354,9 @@ puts $!.backtrace
;
end
- while !(i = action_pointer[@racc_state[-1]]) ||
- ! @racc_read_next ||
- @racc_t == 0 # $
+ while not(i = action_pointer[@racc_state[-1]]) or
+ not @racc_read_next or
+ @racc_t == 0 # $
unless i and i += @racc_t and
i >= 0 and
act = action_table[i] and
@@ -389,17 +377,16 @@ puts $!.backtrace
def _racc_evalact(act, arg)
action_table, action_check, _, action_pointer,
- _, _, _, _,
- _, _, _, shift_n,
- reduce_n, * = arg
- nerr = 0 # tmp
+ _, _, _, _,
+ _, _, _, shift_n, reduce_n,
+ _, _, * = arg
if act > 0 and act < shift_n
#
# shift
#
if @racc_error_status > 0
- @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
+ @racc_error_status -= 1 unless @racc_t == 1 # error token
end
@racc_vstack.push @racc_val
@racc_state.push act
@@ -443,13 +430,10 @@ puts $!.backtrace
case @racc_error_status
when 0
unless arg[21] # user_yyerror
- nerr += 1
on_error @racc_t, @racc_val, @racc_vstack
end
when 3
if @racc_t == 0 # is $
- # We're at EOF, and another error occurred immediately after
- # attempting auto-recovery
throw :racc_end_parse, nil
end
@racc_read_next = true
@@ -485,11 +469,10 @@ puts $!.backtrace
end
def _racc_do_reduce(arg, act)
- _, _, _, _,
- goto_table, goto_check, goto_default, goto_pointer,
- nt_base, reduce_table, _, _,
- _, use_result, * = arg
-
+ _, _, _, _,
+ goto_table, goto_check, goto_default, goto_pointer,
+ nt_base, reduce_table, _, _,
+ _, use_result, * = arg
state = @racc_state
vstack = @racc_vstack
tstack = @racc_tstack
@@ -585,6 +568,7 @@ puts $!.backtrace
toks.each {|t| out.print ' ', racc_token2str(t) }
end
out.puts " --> #{racc_token2str(sim)}"
+
racc_print_stacks tstack, vstack
@racc_debug_out.puts
end
diff --git a/lib/racc/parserfilegenerator.rb b/lib/racc/parserfilegenerator.rb
deleted file mode 100644
index ee1262db29..0000000000
--- a/lib/racc/parserfilegenerator.rb
+++ /dev/null
@@ -1,510 +0,0 @@
-#
-# $Id: fff07ebfd582f8dbc845e424908cb9f41f8bf42f $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-# see the file "COPYING".
-
-require 'enumerator'
-require 'racc/compat'
-require 'racc/sourcetext'
-require 'racc/parser-text'
-require 'rbconfig'
-
-module Racc
-
- class ParserFileGenerator
-
- class Params
- def self.bool_attr(name)
- module_eval(<<-End)
- def #{name}?
- @#{name}
- end
-
- def #{name}=(b)
- @#{name} = b
- end
- End
- end
-
- attr_accessor :filename
- attr_accessor :classname
- attr_accessor :superclass
- bool_attr :omit_action_call
- bool_attr :result_var
- attr_accessor :header
- attr_accessor :inner
- attr_accessor :footer
-
- bool_attr :debug_parser
- bool_attr :convert_line
- bool_attr :convert_line_all
- bool_attr :embed_runtime
- bool_attr :make_executable
- attr_accessor :interpreter
-
- def initialize
- # Parameters derived from parser
- self.filename = nil
- self.classname = nil
- self.superclass = 'Racc::Parser'
- self.omit_action_call = true
- self.result_var = true
- self.header = []
- self.inner = []
- self.footer = []
-
- # Parameters derived from command line options
- self.debug_parser = false
- self.convert_line = true
- self.convert_line_all = false
- self.embed_runtime = false
- self.make_executable = false
- self.interpreter = nil
- end
- end
-
- def initialize(states, params)
- @states = states
- @grammar = states.grammar
- @params = params
- end
-
- def generate_parser
- string_io = StringIO.new
-
- init_line_conversion_system
- @f = string_io
- parser_file
-
- string_io.rewind
- string_io.read
- end
-
- def generate_parser_file(destpath)
- init_line_conversion_system
- File.open(destpath, 'w') {|f|
- @f = f
- parser_file
- }
- File.chmod 0755, destpath if @params.make_executable?
- end
-
- private
-
- def parser_file
- shebang @params.interpreter if @params.make_executable?
- notice
- line
- if @params.embed_runtime?
- embed_library runtime_source()
- else
- require 'racc/parser.rb'
- end
- header
- parser_class(@params.classname, @params.superclass) {
- inner
- state_transition_table
- }
- footer
- end
-
- c = ::RbConfig::CONFIG
- RUBY_PATH = "#{c['bindir']}/#{c['ruby_install_name']}#{c['EXEEXT']}"
-
- def shebang(path)
- line '#!' + (path == 'ruby' ? RUBY_PATH : path)
- end
-
- def notice
- line %q[#]
- line %q[# DO NOT MODIFY!!!!]
- line %Q[# This file is automatically generated by Racc #{Racc::Version}]
- line %Q[# from Racc grammar file "#{@params.filename}".]
- line %q[#]
- end
-
- def runtime_source
- SourceText.new(::Racc::PARSER_TEXT, 'racc/parser.rb', 1)
- end
-
- def embed_library(src)
- line %[###### #{src.filename} begin]
- line %[unless $".index '#{src.filename}']
- line %[$".push '#{src.filename}']
- put src, @params.convert_line?
- line %[end]
- line %[###### #{src.filename} end]
- end
-
- def require(feature)
- line "require '#{feature}'"
- end
-
- def parser_class(classname, superclass)
- mods = classname.split('::')
- classid = mods.pop
- mods.each do |mod|
- indent; line "module #{mod}"
- cref_push mod
- end
- indent; line "class #{classid} < #{superclass}"
- cref_push classid
- yield
- cref_pop
- indent; line "end \# class #{classid}"
- mods.reverse_each do |mod|
- cref_pop
- indent; line "end \# module #{mod}"
- end
- end
-
- def header
- @params.header.each do |src|
- line
- put src, @params.convert_line_all?
- end
- end
-
- def inner
- @params.inner.each do |src|
- line
- put src, @params.convert_line?
- end
- end
-
- def footer
- @params.footer.each do |src|
- line
- put src, @params.convert_line_all?
- end
- end
-
- # Low Level Routines
-
- def put(src, convert_line = false)
- if convert_line
- replace_location(src) {
- @f.puts src.text
- }
- else
- @f.puts src.text
- end
- end
-
- def line(str = '')
- @f.puts str
- end
-
- def init_line_conversion_system
- @cref = []
- @used_separator = {}
- end
-
- def cref_push(name)
- @cref.push name
- end
-
- def cref_pop
- @cref.pop
- end
-
- def indent
- @f.print ' ' * @cref.size
- end
-
- def toplevel?
- @cref.empty?
- end
-
- def replace_location(src)
- sep = make_separator(src)
- @f.print 'self.class.' if toplevel?
- @f.puts "module_eval(<<'#{sep}', '#{src.filename}', #{src.lineno})"
- yield
- @f.puts sep
- end
-
- def make_separator(src)
- sep = unique_separator(src.filename)
- sep *= 2 while src.text.index(sep)
- sep
- end
-
- def unique_separator(id)
- sep = "...end #{id}/module_eval..."
- while @used_separator.key?(sep)
- sep.concat sprintf('%02x', rand(255))
- end
- @used_separator[sep] = true
- sep
- end
-
- #
- # State Transition Table Serialization
- #
-
- public
-
- def put_state_transition_table(f)
- @f = f
- state_transition_table
- end
-
- private
-
- def state_transition_table
- table = @states.state_transition_table
- table.use_result_var = @params.result_var?
- table.debug_parser = @params.debug_parser?
-
- line "##### State transition tables begin ###"
- line
- integer_list 'racc_action_table', table.action_table
- line
- integer_list 'racc_action_check', table.action_check
- line
- integer_list 'racc_action_pointer', table.action_pointer
- line
- integer_list 'racc_action_default', table.action_default
- line
- integer_list 'racc_goto_table', table.goto_table
- line
- integer_list 'racc_goto_check', table.goto_check
- line
- integer_list 'racc_goto_pointer', table.goto_pointer
- line
- integer_list 'racc_goto_default', table.goto_default
- line
- i_i_sym_list 'racc_reduce_table', table.reduce_table
- line
- line "racc_reduce_n = #{table.reduce_n}"
- line
- line "racc_shift_n = #{table.shift_n}"
- line
- sym_int_hash 'racc_token_table', table.token_table
- line
- line "racc_nt_base = #{table.nt_base}"
- line
- line "racc_use_result_var = #{table.use_result_var}"
- line
- @f.print(unindent_auto(<<-End))
- Racc_arg = [
- racc_action_table,
- racc_action_check,
- racc_action_default,
- racc_action_pointer,
- racc_goto_table,
- racc_goto_check,
- racc_goto_default,
- racc_goto_pointer,
- racc_nt_base,
- racc_reduce_table,
- racc_token_table,
- racc_shift_n,
- racc_reduce_n,
- racc_use_result_var ]
- End
- line
- string_list 'Racc_token_to_s_table', table.token_to_s_table
- line
- line "Racc_debug_parser = #{table.debug_parser}"
- line
- line '##### State transition tables end #####'
- actions
- end
-
- def integer_list(name, table)
- if table.size > 2000
- serialize_integer_list_compressed name, table
- else
- serialize_integer_list_std name, table
- end
- end
-
- def serialize_integer_list_compressed(name, table)
- # TODO: this can be made a LOT more clean with a simple split/map
- sep = "\n"
- nsep = ",\n"
- buf = ''
- com = ''
- ncom = ','
- co = com
- @f.print 'clist = ['
- table.each do |i|
- buf << co << i.to_s; co = ncom
- if buf.size > 66
- @f.print sep; sep = nsep
- @f.print "'", buf, "'"
- buf = ''
- co = com
- end
- end
- unless buf.empty?
- @f.print sep
- @f.print "'", buf, "'"
- end
- line ' ]'
-
- @f.print(<<-End)
- #{name} = arr = ::Array.new(#{table.size}, nil)
- idx = 0
- clist.each do |str|
- str.split(',', -1).each do |i|
- arr[idx] = i.to_i unless i.empty?
- idx += 1
- end
- end
- End
- end
-
- def serialize_integer_list_std(name, table)
- sep = ''
- line "#{name} = ["
- table.each_slice(10) do |ns|
- @f.print sep; sep = ",\n"
- @f.print ns.map {|n| sprintf('%6s', n ? n.to_s : 'nil') }.join(',')
- end
- line ' ]'
- end
-
- def i_i_sym_list(name, table)
- sep = ''
- line "#{name} = ["
- table.each_slice(3) do |len, target, mid|
- @f.print sep; sep = ",\n"
- @f.printf ' %d, %d, %s', len, target, mid.inspect
- end
- line " ]"
- end
-
- def sym_int_hash(name, h)
- sep = "\n"
- @f.print "#{name} = {"
- h.to_a.sort_by {|sym, i| i }.each do |sym, i|
- @f.print sep; sep = ",\n"
- @f.printf " %s => %d", sym.serialize, i
- end
- line " }"
- end
-
- def string_list(name, list)
- sep = " "
- line "#{name} = ["
- list.each do |s|
- @f.print sep; sep = ",\n "
- @f.print s.dump
- end
- line ' ]'
- end
-
- def actions
- @grammar.each do |rule|
- unless rule.action.source?
- raise "racc: fatal: cannot generate parser file when any action is a Proc"
- end
- end
-
- if @params.result_var?
- decl = ', result'
- retval = "\n result"
- default_body = ''
- else
- decl = ''
- retval = ''
- default_body = 'val[0]'
- end
- @grammar.each do |rule|
- line
- if rule.action.empty? and @params.omit_action_call?
- line "# reduce #{rule.ident} omitted"
- else
- src0 = rule.action.source || SourceText.new(default_body, __FILE__, 0)
- if @params.convert_line?
- src = remove_blank_lines(src0)
- delim = make_delimiter(src.text)
- @f.printf unindent_auto(<<-End),
- module_eval(<<'%s', '%s', %d)
- def _reduce_%d(val, _values%s)
- %s%s
- end
- %s
- End
- delim, src.filename, src.lineno - 1,
- rule.ident, decl,
- src.text, retval,
- delim
- else
- src = remove_blank_lines(src0)
- @f.printf unindent_auto(<<-End),
- def _reduce_%d(val, _values%s)
- %s%s
- end
- End
- rule.ident, decl,
- src.text, retval
- end
- end
- end
- line
- @f.printf unindent_auto(<<-'End'), decl
- def _reduce_none(val, _values%s)
- val[0]
- end
- End
- line
- end
-
- def remove_blank_lines(src)
- body = src.text.dup
- line = src.lineno
- while body.slice!(/\A[ \t\f]*(?:\n|\r\n|\r)/)
- line += 1
- end
- SourceText.new(body, src.filename, line)
- end
-
- def make_delimiter(body)
- delim = '.,.,'
- while body.index(delim)
- delim *= 2
- end
- delim
- end
-
- def unindent_auto(str)
- lines = str.lines.to_a
- n = minimum_indent(lines)
- lines.map {|line| detab(line).sub(indent_re(n), '').rstrip + "\n" }.join('')
- end
-
- def minimum_indent(lines)
- lines.map {|line| n_indent(line) }.min
- end
-
- def n_indent(line)
- line.slice(/\A\s+/).size
- end
-
- RE_CACHE = {}
-
- def indent_re(n)
- RE_CACHE[n] ||= /\A {#{n}}/
- end
-
- def detab(str, ts = 8)
- add = 0
- len = nil
- str.gsub(/\t/) {
- len = ts - ($`.size + add) % ts
- add += len - 1
- ' ' * len
- }
- end
-
- end
-
-end
diff --git a/lib/racc/pre-setup b/lib/racc/pre-setup
deleted file mode 100644
index 5027d865b7..0000000000
--- a/lib/racc/pre-setup
+++ /dev/null
@@ -1,13 +0,0 @@
-def generate_parser_text_rb(target)
- return if File.exist?(srcfile(target))
- $stderr.puts "generating #{target}..."
- File.open(target, 'w') {|f|
- f.puts "module Racc"
- f.puts " PARSER_TEXT = <<'__end_of_file__'"
- f.puts File.read(srcfile('parser.rb'))
- f.puts "__end_of_file__"
- f.puts "end"
- }
-end
-
-generate_parser_text_rb 'parser-text.rb'
diff --git a/lib/racc/racc.gemspec b/lib/racc/racc.gemspec
deleted file mode 100644
index 6beb16c5b4..0000000000
--- a/lib/racc/racc.gemspec
+++ /dev/null
@@ -1,105 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = "racc"
- s.version = "1.4.16"
- s.summary = "Racc is a LALR(1) parser generator"
- s.description = <<DESC
-Racc is a LALR(1) parser generator.
- It is written in Ruby itself, and generates Ruby program.
-
- NOTE: Ruby 1.8.x comes with Racc runtime module. You
- can run your parsers generated by racc 1.4.x out of the
- box.
-DESC
- s.authors = ["Minero Aoki", "Aaron Patterson"]
- s.email = [nil, "aaron@tenderlovemaking.com"]
- s.homepage = "http://i.loveruby.net/en/projects/racc/"
- s.licenses = ["MIT"]
- s.executables = ["racc", "racc2y", "y2racc"]
- s.files = [
- "COPYING", "ChangeLog", "DEPENDS", "Manifest.txt",
- "README.ja.rdoc", "README.rdoc", "Rakefile", "TODO", "bin/racc",
- "bin/racc2y", "bin/y2racc", "ext/racc/MANIFEST",
- "ext/racc/com/headius/racc/Cparse.java", "ext/racc/cparse.c",
- "ext/racc/depend", "ext/racc/extconf.rb", "fastcache/extconf.rb",
- "fastcache/fastcache.c", "lib/racc.rb", "lib/racc/compat.rb",
- "lib/racc/debugflags.rb", "lib/racc/exception.rb",
- "lib/racc/grammar.rb", "lib/racc/grammarfileparser.rb",
- "lib/racc/info.rb", "lib/racc/iset.rb",
- "lib/racc/logfilegenerator.rb", "lib/racc/parser-text.rb",
- "lib/racc/parser.rb", "lib/racc/parserfilegenerator.rb",
- "lib/racc/pre-setup", "lib/racc/sourcetext.rb",
- "lib/racc/state.rb", "lib/racc/statetransitiontable.rb",
- "lib/racc/static.rb", "misc/dist.sh", "rdoc/en/NEWS.en.rdoc",
- "rdoc/en/grammar.en.rdoc", "rdoc/ja/NEWS.ja.rdoc",
- "rdoc/ja/command.ja.html", "rdoc/ja/debug.ja.rdoc",
- "rdoc/ja/grammar.ja.rdoc", "rdoc/ja/index.ja.html",
- "rdoc/ja/parser.ja.rdoc", "rdoc/ja/usage.ja.html",
- "sample/array.y", "sample/array2.y", "sample/calc-ja.y",
- "sample/calc.y", "sample/conflict.y", "sample/hash.y",
- "sample/lalr.y", "sample/lists.y", "sample/syntax.y",
- "sample/yyerr.y", "setup.rb", "tasks/doc.rb", "tasks/email.rb",
- "test/assets/cadenza.y", "test/assets/cast.y",
- "test/assets/chk.y", "test/assets/conf.y",
- "test/assets/csspool.y", "test/assets/digraph.y",
- "test/assets/echk.y", "test/assets/edtf.y", "test/assets/err.y",
- "test/assets/error_recovery.y", "test/assets/expect.y",
- "test/assets/firstline.y", "test/assets/huia.y",
- "test/assets/ichk.y", "test/assets/intp.y",
- "test/assets/journey.y", "test/assets/liquor.y",
- "test/assets/machete.y", "test/assets/macruby.y",
- "test/assets/mailp.y", "test/assets/mediacloth.y",
- "test/assets/mof.y", "test/assets/namae.y", "test/assets/nasl.y",
- "test/assets/newsyn.y", "test/assets/noend.y",
- "test/assets/nokogiri-css.y", "test/assets/nonass.y",
- "test/assets/normal.y", "test/assets/norule.y",
- "test/assets/nullbug1.y", "test/assets/nullbug2.y",
- "test/assets/opal.y", "test/assets/opt.y",
- "test/assets/percent.y", "test/assets/php_serialization.y",
- "test/assets/recv.y", "test/assets/riml.y",
- "test/assets/rrconf.y", "test/assets/ruby18.y",
- "test/assets/ruby19.y", "test/assets/ruby20.y",
- "test/assets/ruby21.y", "test/assets/ruby22.y",
- "test/assets/scan.y", "test/assets/syntax.y",
- "test/assets/tp_plus.y", "test/assets/twowaysql.y",
- "test/assets/unterm.y", "test/assets/useless.y",
- "test/assets/yyerr.y", "test/bench.y", "test/helper.rb",
- "test/infini.y", "test/regress/cadenza", "test/regress/cast",
- "test/regress/csspool", "test/regress/edtf", "test/regress/huia",
- "test/regress/journey", "test/regress/liquor",
- "test/regress/machete", "test/regress/mediacloth",
- "test/regress/mof", "test/regress/namae", "test/regress/nasl",
- "test/regress/nokogiri-css", "test/regress/opal",
- "test/regress/php_serialization", "test/regress/riml",
- "test/regress/ruby18", "test/regress/ruby22",
- "test/regress/tp_plus", "test/regress/twowaysql",
- "test/scandata/brace", "test/scandata/gvar",
- "test/scandata/normal", "test/scandata/percent",
- "test/scandata/slash", "test/src.intp", "test/start.y",
- "test/test_chk_y.rb", "test/test_grammar_file_parser.rb",
- "test/test_racc_command.rb", "test/test_scan_y.rb",
- "test/testscanner.rb", "web/racc.en.rhtml", "web/racc.ja.rhtml"
- ]
- s.require_paths = ["lib"]
- s.rubygems_version = "3.1.0.pre1"
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.extensions = ["ext/racc/extconf.rb"]
- s.rdoc_options = ["--main", "README.rdoc"]
- s.extra_rdoc_files = [
- "Manifest.txt", "README.ja.rdoc", "README.rdoc",
- "rdoc/en/NEWS.en.rdoc", "rdoc/en/grammar.en.rdoc",
- "rdoc/ja/NEWS.ja.rdoc", "rdoc/ja/debug.ja.rdoc",
- "rdoc/ja/grammar.ja.rdoc", "rdoc/ja/parser.ja.rdoc",
- "README.ja.rdoc", "README.rdoc"
- ]
-
- if RUBY_PLATFORM =~ /java/
- s.files << 'lib/racc/cparse-jruby.jar'
- end
-
- s.add_development_dependency("rake-compiler", [">= 0.4.1"])
- s.add_development_dependency("minitest", ["~> 4.7"])
- s.add_development_dependency("rdoc", [">= 4.0", "< 7"])
- s.add_development_dependency("hoe", ["~> 3.18"])
-end
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/racc/sourcetext.rb b/lib/racc/sourcetext.rb
deleted file mode 100644
index b33ba29291..0000000000
--- a/lib/racc/sourcetext.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# $Id: 3b2d89d9ada2f5fcb043837dcc5c9631856d5b70 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of LGPL, see the file "COPYING".
-#
-
-module Racc
-
- class SourceText
- def initialize(text, filename, lineno)
- @text = text
- @filename = filename
- @lineno = lineno
- end
-
- attr_reader :text
- attr_reader :filename
- attr_reader :lineno
-
- def to_s
- "#<SourceText #{location()}>"
- end
-
- def location
- "#{@filename}:#{@lineno}"
- end
- end
-
-end
diff --git a/lib/racc/state.rb b/lib/racc/state.rb
deleted file mode 100644
index 51b1d83664..0000000000
--- a/lib/racc/state.rb
+++ /dev/null
@@ -1,969 +0,0 @@
-#
-# $Id: 6bd3136439c94cb8d928917f5e0de9c593181527 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the same terms of ruby.
-# see the file "COPYING".
-
-require 'racc/iset'
-require 'racc/statetransitiontable'
-require 'racc/exception'
-require 'forwardable'
-
-module Racc
-
- # A table of LALR states.
- class States
-
- include Enumerable
-
- def initialize(grammar, debug_flags = DebugFlags.new)
- @grammar = grammar
- @symboltable = grammar.symboltable
- @d_state = debug_flags.state
- @d_la = debug_flags.la
- @d_prec = debug_flags.prec
- @states = []
- @statecache = {}
- @actions = ActionTable.new(@grammar, self)
- @nfa_computed = false
- @dfa_computed = false
- end
-
- attr_reader :grammar
- attr_reader :actions
-
- def size
- @states.size
- end
-
- def inspect
- '#<state table>'
- end
-
- alias to_s inspect
-
- def [](i)
- @states[i]
- end
-
- def each_state(&block)
- @states.each(&block)
- end
-
- alias each each_state
-
- def each_index(&block)
- @states.each_index(&block)
- end
-
- extend Forwardable
-
- def_delegator "@actions", :shift_n
- def_delegator "@actions", :reduce_n
- def_delegator "@actions", :nt_base
-
- def should_report_srconflict?
- srconflict_exist? and
- (n_srconflicts() != @grammar.n_expected_srconflicts)
- end
-
- def srconflict_exist?
- n_srconflicts() != 0
- end
-
- def n_srconflicts
- @n_srconflicts ||= inject(0) {|sum, st| sum + st.n_srconflicts }
- end
-
- def rrconflict_exist?
- n_rrconflicts() != 0
- end
-
- def n_rrconflicts
- @n_rrconflicts ||= inject(0) {|sum, st| sum + st.n_rrconflicts }
- end
-
- def state_transition_table
- @state_transition_table ||= StateTransitionTable.generate(self.dfa)
- end
-
- #
- # NFA (Non-deterministic Finite Automaton) Computation
- #
-
- public
-
- def nfa
- return self if @nfa_computed
- compute_nfa
- @nfa_computed = true
- self
- end
-
- private
-
- def compute_nfa
- @grammar.init
- # add state 0
- core_to_state [ @grammar[0].ptrs[0] ]
- # generate LALR states
- cur = 0
- @gotos = []
- while cur < @states.size
- generate_states @states[cur] # state is added here
- cur += 1
- end
- @actions.init
- end
-
- def generate_states(state)
- puts "dstate: #{state}" if @d_state
-
- table = {}
- state.closure.each do |ptr|
- if sym = ptr.dereference
- addsym table, sym, ptr.next
- end
- end
- table.each do |sym, core|
- puts "dstate: sym=#{sym} ncore=#{core}" if @d_state
-
- dest = core_to_state(core.to_a)
- state.goto_table[sym] = dest
- id = sym.nonterminal?() ? @gotos.size : nil
- g = Goto.new(id, sym, state, dest)
- @gotos.push g if sym.nonterminal?
- state.gotos[sym] = g
- puts "dstate: #{state.ident} --#{sym}--> #{dest.ident}" if @d_state
-
- # check infinite recursion
- if state.ident == dest.ident and state.closure.size == 1
- raise CompileError,
- sprintf("Infinite recursion: state %d, with rule %d",
- state.ident, state.ptrs[0].rule.ident)
- end
- end
- end
-
- def addsym(table, sym, ptr)
- unless s = table[sym]
- table[sym] = s = ISet.new
- end
- s.add ptr
- end
-
- def core_to_state(core)
- #
- # convert CORE to a State object.
- # If matching state does not exist, create it and add to the table.
- #
-
- k = fingerprint(core)
- unless dest = @statecache[k]
- # not registered yet
- dest = State.new(@states.size, core)
- @states.push dest
-
- @statecache[k] = dest
-
- puts "core_to_state: create state ID #{dest.ident}" if @d_state
- else
- if @d_state
- puts "core_to_state: dest is cached ID #{dest.ident}"
- puts "core_to_state: dest core #{dest.core.join(' ')}"
- end
- end
-
- dest
- end
-
- def fingerprint(arr)
- arr.map {|i| i.ident }.pack('L*')
- end
-
- #
- # DFA (Deterministic Finite Automaton) Generation
- #
-
- public
-
- def dfa
- return self if @dfa_computed
- nfa
- compute_dfa
- @dfa_computed = true
- self
- end
-
- private
-
- def compute_dfa
- la = lookahead()
- @states.each do |state|
- state.la = la
- resolve state
- end
- set_accept
- @states.each do |state|
- pack state
- end
- check_useless
- end
-
- def lookahead
- #
- # lookahead algorithm ver.3 -- from bison 1.26
- #
-
- gotos = @gotos
- if @d_la
- puts "\n--- goto ---"
- gotos.each_with_index {|g, i| print i, ' '; p g }
- end
-
- ### initialize_LA()
- ### set_goto_map()
- la_rules = []
- @states.each do |state|
- state.check_la la_rules
- end
-
- ### initialize_F()
- f = create_tmap(gotos.size)
- reads = []
- edge = []
- gotos.each do |goto|
- goto.to_state.goto_table.each do |t, st|
- if t.terminal?
- f[goto.ident] |= (1 << t.ident)
- elsif t.nullable?
- edge.push goto.to_state.gotos[t].ident
- end
- end
- if edge.empty?
- reads.push nil
- else
- reads.push edge
- edge = []
- end
- end
- digraph f, reads
- if @d_la
- puts "\n--- F1 (reads) ---"
- print_tab gotos, reads, f
- end
-
- ### build_relations()
- ### compute_FOLLOWS
- path = nil
- edge = []
- lookback = Array.new(la_rules.size, nil)
- includes = []
- gotos.each do |goto|
- goto.symbol.heads.each do |ptr|
- path = record_path(goto.from_state, ptr.rule)
- lastgoto = path.last
- st = lastgoto ? lastgoto.to_state : goto.from_state
- if st.conflict?
- addrel lookback, st.rruleid(ptr.rule), goto
- end
- path.reverse_each do |g|
- break if g.symbol.terminal?
- edge.push g.ident
- break unless g.symbol.nullable?
- end
- end
- if edge.empty?
- includes.push nil
- else
- includes.push edge
- edge = []
- end
- end
- includes = transpose(includes)
- digraph f, includes
- if @d_la
- puts "\n--- F2 (includes) ---"
- print_tab gotos, includes, f
- end
-
- ### compute_lookaheads
- la = create_tmap(la_rules.size)
- lookback.each_with_index do |arr, i|
- if arr
- arr.each do |g|
- la[i] |= f[g.ident]
- end
- end
- end
- if @d_la
- puts "\n--- LA (lookback) ---"
- print_tab la_rules, lookback, la
- end
-
- la
- end
-
- def create_tmap(size)
- Array.new(size, 0) # use Integer as bitmap
- end
-
- def addrel(tbl, i, item)
- if a = tbl[i]
- a.push item
- else
- tbl[i] = [item]
- end
- end
-
- def record_path(begst, rule)
- st = begst
- path = []
- rule.symbols.each do |t|
- goto = st.gotos[t]
- path.push goto
- st = goto.to_state
- end
- path
- end
-
- def transpose(rel)
- new = Array.new(rel.size, nil)
- rel.each_with_index do |arr, idx|
- if arr
- arr.each do |i|
- addrel new, i, idx
- end
- end
- end
- new
- end
-
- def digraph(map, relation)
- n = relation.size
- index = Array.new(n, nil)
- vertices = []
- @infinity = n + 2
-
- index.each_index do |i|
- if not index[i] and relation[i]
- traverse i, index, vertices, map, relation
- end
- end
- end
-
- def traverse(i, index, vertices, map, relation)
- vertices.push i
- index[i] = height = vertices.size
-
- if rp = relation[i]
- rp.each do |proci|
- unless index[proci]
- traverse proci, index, vertices, map, relation
- end
- if index[i] > index[proci]
- # circulative recursion !!!
- index[i] = index[proci]
- end
- map[i] |= map[proci]
- end
- end
-
- if index[i] == height
- while true
- proci = vertices.pop
- index[proci] = @infinity
- break if i == proci
-
- map[proci] |= map[i]
- end
- end
- end
-
- # for debug
- def print_atab(idx, tab)
- tab.each_with_index do |i,ii|
- printf '%-20s', idx[ii].inspect
- p i
- end
- end
-
- def print_tab(idx, rel, tab)
- tab.each_with_index do |bin,i|
- print i, ' ', idx[i].inspect, ' << '; p rel[i]
- print ' '
- each_t(@symboltable, bin) {|t| print ' ', t }
- puts
- end
- end
-
- # for debug
- def print_tab_i(idx, rel, tab, i)
- bin = tab[i]
- print i, ' ', idx[i].inspect, ' << '; p rel[i]
- print ' '
- each_t(@symboltable, bin) {|t| print ' ', t }
- end
-
- # for debug
- def printb(i)
- each_t(@symboltable, i) do |t|
- print t, ' '
- end
- puts
- end
-
- def each_t(tbl, set)
- 0.upto( set.size ) do |i|
- (0..7).each do |ii|
- if set[idx = i * 8 + ii] == 1
- yield tbl[idx]
- end
- end
- end
- end
-
- #
- # resolve
- #
-
- def resolve(state)
- if state.conflict?
- resolve_rr state, state.ritems
- resolve_sr state, state.stokens
- else
- if state.rrules.empty?
- # shift
- state.stokens.each do |t|
- state.action[t] = @actions.shift(state.goto_table[t])
- end
- else
- # reduce
- state.defact = @actions.reduce(state.rrules[0])
- end
- end
- end
-
- def resolve_rr(state, r)
- r.each do |item|
- item.each_la(@symboltable) do |t|
- act = state.action[t]
- if act
- unless act.kind_of?(Reduce)
- raise "racc: fatal: #{act.class} in action table"
- end
- # Cannot resolve R/R conflict (on t).
- # Reduce with upper rule as default.
- state.rr_conflict act.rule, item.rule, t
- else
- # No conflict.
- state.action[t] = @actions.reduce(item.rule)
- end
- end
- end
- end
-
- def resolve_sr(state, s)
- s.each do |stok|
- goto = state.goto_table[stok]
- act = state.action[stok]
-
- unless act
- # no conflict
- state.action[stok] = @actions.shift(goto)
- else
- unless act.kind_of?(Reduce)
- puts 'DEBUG -------------------------------'
- p stok
- p act
- state.action.each do |k,v|
- print k.inspect, ' ', v.inspect, "\n"
- end
- raise "racc: fatal: #{act.class} in action table"
- end
-
- # conflict on stok
-
- rtok = act.rule.precedence
- case do_resolve_sr(stok, rtok)
- when :Reduce
- # action is already set
-
- when :Shift
- # overwrite
- act.decref
- state.action[stok] = @actions.shift(goto)
-
- when :Error
- act.decref
- state.action[stok] = @actions.error
-
- when :CantResolve
- # shift as default
- act.decref
- state.action[stok] = @actions.shift(goto)
- state.sr_conflict stok, act.rule
- end
- end
- end
- end
-
- ASSOC = {
- :Left => :Reduce,
- :Right => :Shift,
- :Nonassoc => :Error
- }
-
- def do_resolve_sr(stok, rtok)
- puts "resolve_sr: s/r conflict: rtok=#{rtok}, stok=#{stok}" if @d_prec
-
- unless rtok and rtok.precedence
- puts "resolve_sr: no prec for #{rtok}(R)" if @d_prec
- return :CantResolve
- end
- rprec = rtok.precedence
-
- unless stok and stok.precedence
- puts "resolve_sr: no prec for #{stok}(S)" if @d_prec
- return :CantResolve
- end
- sprec = stok.precedence
-
- ret = if rprec == sprec
- ASSOC[rtok.assoc] or
- raise "racc: fatal: #{rtok}.assoc is not Left/Right/Nonassoc"
- else
- (rprec > sprec) ? (:Reduce) : (:Shift)
- end
-
- puts "resolve_sr: resolved as #{ret.id2name}" if @d_prec
- ret
- end
-
- #
- # complete
- #
-
- def set_accept
- anch = @symboltable.anchor
- init_state = @states[0].goto_table[@grammar.start]
- targ_state = init_state.action[anch].goto_state
- acc_state = targ_state.action[anch].goto_state
-
- acc_state.action.clear
- acc_state.goto_table.clear
- acc_state.defact = @actions.accept
- end
-
- def pack(state)
- ### find most frequently used reduce rule
- act = state.action
- arr = Array.new(@grammar.size, 0)
- act.each do |t, a|
- arr[a.ruleid] += 1 if a.kind_of?(Reduce)
- end
- i = arr.max
- s = (i > 0) ? arr.index(i) : nil
-
- ### set & delete default action
- if s
- r = @actions.reduce(s)
- if not state.defact or state.defact == r
- act.delete_if {|t, a| a == r }
- state.defact = r
- end
- else
- state.defact ||= @actions.error
- end
- end
-
- def check_useless
- used = []
- @actions.each_reduce do |act|
- if not act or act.refn == 0
- act.rule.useless = true
- else
- t = act.rule.target
- used[t.ident] = t
- end
- end
- @symboltable.nt_base.upto(@symboltable.nt_max - 1) do |n|
- unless used[n]
- @symboltable[n].useless = true
- end
- end
- end
-
- end # class StateTable
-
-
- # A LALR state.
- class State
-
- def initialize(ident, core)
- @ident = ident
- @core = core
- @goto_table = {}
- @gotos = {}
- @stokens = nil
- @ritems = nil
- @action = {}
- @defact = nil
- @rrconf = nil
- @srconf = nil
-
- @closure = make_closure(@core)
- end
-
- attr_reader :ident
- alias stateid ident
- alias hash ident
-
- attr_reader :core
- attr_reader :closure
-
- attr_reader :goto_table
- attr_reader :gotos
-
- attr_reader :stokens
- attr_reader :ritems
- attr_reader :rrules
-
- attr_reader :action
- attr_accessor :defact # default action
-
- attr_reader :rrconf
- attr_reader :srconf
-
- def inspect
- "<state #{@ident}>"
- end
-
- alias to_s inspect
-
- def ==(oth)
- @ident == oth.ident
- end
-
- alias eql? ==
-
- def make_closure(core)
- set = ISet.new
- core.each do |ptr|
- set.add ptr
- if t = ptr.dereference and t.nonterminal?
- set.update_a t.expand
- end
- end
- set.to_a
- end
-
- def check_la(la_rules)
- @conflict = false
- s = []
- r = []
- @closure.each do |ptr|
- if t = ptr.dereference
- if t.terminal?
- s[t.ident] = t
- if t.ident == 1 # $error
- @conflict = true
- end
- end
- else
- r.push ptr.rule
- end
- end
- unless r.empty?
- if not s.empty? or r.size > 1
- @conflict = true
- end
- end
- s.compact!
- @stokens = s
- @rrules = r
-
- if @conflict
- @la_rules_i = la_rules.size
- @la_rules = r.map {|i| i.ident }
- la_rules.concat r
- else
- @la_rules_i = @la_rules = nil
- end
- end
-
- def conflict?
- @conflict
- end
-
- def rruleid(rule)
- if i = @la_rules.index(rule.ident)
- @la_rules_i + i
- else
- puts '/// rruleid'
- p self
- p rule
- p @rrules
- p @la_rules_i
- raise 'racc: fatal: cannot get reduce rule id'
- end
- end
-
- def la=(la)
- return unless @conflict
- i = @la_rules_i
- @ritems = r = []
- @rrules.each do |rule|
- r.push Item.new(rule, la[i])
- i += 1
- end
- end
-
- def rr_conflict(high, low, ctok)
- c = RRconflict.new(@ident, high, low, ctok)
-
- @rrconf ||= {}
- if a = @rrconf[ctok]
- a.push c
- else
- @rrconf[ctok] = [c]
- end
- end
-
- def sr_conflict(shift, reduce)
- c = SRconflict.new(@ident, shift, reduce)
-
- @srconf ||= {}
- if a = @srconf[shift]
- a.push c
- else
- @srconf[shift] = [c]
- end
- end
-
- def n_srconflicts
- @srconf ? @srconf.size : 0
- end
-
- def n_rrconflicts
- @rrconf ? @rrconf.size : 0
- end
-
- end # class State
-
-
- #
- # Represents a transition on the grammar.
- # "Real goto" means a transition by nonterminal,
- # but this class treats also terminal's.
- # If one is a terminal transition, .ident returns nil.
- #
- class Goto
- def initialize(ident, sym, from, to)
- @ident = ident
- @symbol = sym
- @from_state = from
- @to_state = to
- end
-
- attr_reader :ident
- attr_reader :symbol
- attr_reader :from_state
- attr_reader :to_state
-
- def inspect
- "(#{@from_state.ident}-#{@symbol}->#{@to_state.ident})"
- end
- end
-
-
- # LALR item. A set of rule and its lookahead tokens.
- class Item
- def initialize(rule, la)
- @rule = rule
- @la = la
- end
-
- attr_reader :rule
- attr_reader :la
-
- def each_la(tbl)
- la = @la
- 0.upto(la.size - 1) do |i|
- (0..7).each do |ii|
- if la[idx = i * 8 + ii] == 1
- yield tbl[idx]
- end
- end
- end
- end
- end
-
-
- # The table of LALR actions. Actions are either of
- # Shift, Reduce, Accept and Error.
- class ActionTable
-
- def initialize(rt, st)
- @grammar = rt
- @statetable = st
-
- @reduce = []
- @shift = []
- @accept = nil
- @error = nil
- end
-
- def init
- @grammar.each do |rule|
- @reduce.push Reduce.new(rule)
- end
- @statetable.each do |state|
- @shift.push Shift.new(state)
- end
- @accept = Accept.new
- @error = Error.new
- end
-
- def reduce_n
- @reduce.size
- end
-
- def reduce(i)
- case i
- when Rule then i = i.ident
- when Integer then ;
- else
- raise "racc: fatal: wrong class #{i.class} for reduce"
- end
-
- r = @reduce[i] or raise "racc: fatal: reduce action #{i.inspect} not exist"
- r.incref
- r
- end
-
- def each_reduce(&block)
- @reduce.each(&block)
- end
-
- def shift_n
- @shift.size
- end
-
- def shift(i)
- case i
- when State then i = i.ident
- when Integer then ;
- else
- raise "racc: fatal: wrong class #{i.class} for shift"
- end
-
- @shift[i] or raise "racc: fatal: shift action #{i} does not exist"
- end
-
- def each_shift(&block)
- @shift.each(&block)
- end
-
- attr_reader :accept
- attr_reader :error
-
- end
-
-
- class Shift
- def initialize(goto)
- @goto_state = goto
- end
-
- attr_reader :goto_state
-
- def goto_id
- @goto_state.ident
- end
-
- def inspect
- "<shift #{@goto_state.ident}>"
- end
- end
-
-
- class Reduce
- def initialize(rule)
- @rule = rule
- @refn = 0
- end
-
- attr_reader :rule
- attr_reader :refn
-
- def ruleid
- @rule.ident
- end
-
- def inspect
- "<reduce #{@rule.ident}>"
- end
-
- def incref
- @refn += 1
- end
-
- def decref
- @refn -= 1
- raise 'racc: fatal: act.refn < 0' if @refn < 0
- end
- end
-
- class Accept
- def inspect
- "<accept>"
- end
- end
-
- class Error
- def inspect
- "<error>"
- end
- end
-
- class SRconflict
- def initialize(sid, shift, reduce)
- @stateid = sid
- @shift = shift
- @reduce = reduce
- end
-
- attr_reader :stateid
- attr_reader :shift
- attr_reader :reduce
-
- def to_s
- sprintf('state %d: S/R conflict rule %d reduce and shift %s',
- @stateid, @reduce.ruleid, @shift.to_s)
- end
- end
-
- class RRconflict
- def initialize(sid, high, low, tok)
- @stateid = sid
- @high_prec = high
- @low_prec = low
- @token = tok
- end
-
- attr_reader :stateid
- attr_reader :high_prec
- attr_reader :low_prec
- attr_reader :token
-
- def to_s
- sprintf('state %d: R/R conflict with rule %d and %d on %s',
- @stateid, @high_prec.ident, @low_prec.ident, @token.to_s)
- end
- end
-
-end
diff --git a/lib/racc/statetransitiontable.rb b/lib/racc/statetransitiontable.rb
deleted file mode 100644
index 23df4102ec..0000000000
--- a/lib/racc/statetransitiontable.rb
+++ /dev/null
@@ -1,316 +0,0 @@
-#
-# $Id: 4c5f4311663b6d03050953d64d6a0e7905ff2216 $
-#
-# Copyright (c) 1999-2006 Minero Aoki
-#
-# This program is free software.
-# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public License version 2.1.
-# For details of LGPL, see the file "COPYING".
-#
-
-require 'racc/parser'
-
-unless Object.method_defined?(:funcall)
- class Object
- alias funcall __send__
- end
-end
-
-module Racc
-
- StateTransitionTable = Struct.new(:action_table,
- :action_check,
- :action_default,
- :action_pointer,
- :goto_table,
- :goto_check,
- :goto_default,
- :goto_pointer,
- :token_table,
- :reduce_table,
- :reduce_n,
- :shift_n,
- :nt_base,
- :token_to_s_table,
- :use_result_var,
- :debug_parser)
- class StateTransitionTable # reopen
- def StateTransitionTable.generate(states)
- StateTransitionTableGenerator.new(states).generate
- end
-
- def initialize(states)
- super()
- @states = states
- @grammar = states.grammar
- self.use_result_var = true
- self.debug_parser = true
- end
-
- attr_reader :states
- attr_reader :grammar
-
- def parser_class
- ParserClassGenerator.new(@states).generate
- end
-
- def token_value_table
- h = {}
- token_table().each do |sym, i|
- h[sym.value] = i
- end
- h
- end
- end
-
-
- class StateTransitionTableGenerator
-
- def initialize(states)
- @states = states
- @grammar = states.grammar
- end
-
- def generate
- t = StateTransitionTable.new(@states)
- gen_action_tables t, @states
- gen_goto_tables t, @grammar
- t.token_table = token_table(@grammar)
- t.reduce_table = reduce_table(@grammar)
- t.reduce_n = @states.reduce_n
- t.shift_n = @states.shift_n
- t.nt_base = @grammar.nonterminal_base
- t.token_to_s_table = @grammar.symbols.map {|sym| sym.to_s }
- t
- end
-
- def reduce_table(grammar)
- t = [0, 0, :racc_error]
- grammar.each_with_index do |rule, idx|
- next if idx == 0
- t.push rule.size
- t.push rule.target.ident
- t.push(if rule.action.empty? # and @params.omit_action_call?
- then :_reduce_none
- else "_reduce_#{idx}".intern
- end)
- end
- t
- end
-
- def token_table(grammar)
- h = {}
- grammar.symboltable.terminals.each do |t|
- h[t] = t.ident
- end
- h
- end
-
- def gen_action_tables(t, states)
- t.action_table = yytable = []
- t.action_check = yycheck = []
- t.action_default = yydefact = []
- t.action_pointer = yypact = []
- e1 = []
- e2 = []
- states.each do |state|
- yydefact.push act2actid(state.defact)
- if state.action.empty?
- yypact.push nil
- next
- end
- vector = []
- state.action.each do |tok, act|
- vector[tok.ident] = act2actid(act)
- end
- addent e1, vector, state.ident, yypact
- end
- set_table e1, e2, yytable, yycheck, yypact
- end
-
- def gen_goto_tables(t, grammar)
- t.goto_table = yytable2 = []
- t.goto_check = yycheck2 = []
- t.goto_pointer = yypgoto = []
- t.goto_default = yydefgoto = []
- e1 = []
- e2 = []
- grammar.each_nonterminal do |tok|
- tmp = []
-
- # decide default
- freq = Array.new(@states.size, 0)
- @states.each do |state|
- st = state.goto_table[tok]
- if st
- st = st.ident
- freq[st] += 1
- end
- tmp[state.ident] = st
- end
- max = freq.max
- if max > 1
- default = freq.index(max)
- tmp.map! {|i| default == i ? nil : i }
- else
- default = nil
- end
- yydefgoto.push default
-
- # delete default value
- tmp.pop until tmp.last or tmp.empty?
- if tmp.compact.empty?
- # only default
- yypgoto.push nil
- next
- end
-
- addent e1, tmp, (tok.ident - grammar.nonterminal_base), yypgoto
- end
- set_table e1, e2, yytable2, yycheck2, yypgoto
- end
-
- def addent(all, arr, chkval, ptr)
- max = arr.size
- min = nil
- arr.each_with_index do |item, idx|
- if item
- min ||= idx
- end
- end
- ptr.push(-7777) # mark
- arr = arr[min...max]
- all.push [arr, chkval, mkmapexp(arr), min, ptr.size - 1]
- end
-
- n = 2 ** 16
- begin
- Regexp.compile("a{#{n}}")
- RE_DUP_MAX = n
- rescue RegexpError
- n /= 2
- retry
- end
-
- def mkmapexp(arr)
- i = ii = 0
- as = arr.size
- map = ''
- maxdup = RE_DUP_MAX
- curr = nil
- while i < as
- ii = i + 1
- if arr[i]
- ii += 1 while ii < as and arr[ii]
- curr = '-'
- else
- ii += 1 while ii < as and not arr[ii]
- curr = '.'
- end
-
- offset = ii - i
- if offset == 1
- map << curr
- else
- while offset > maxdup
- map << "#{curr}{#{maxdup}}"
- offset -= maxdup
- end
- map << "#{curr}{#{offset}}" if offset > 1
- end
- i = ii
- end
- Regexp.compile(map, 'n')
- end
-
- def set_table(entries, dummy, tbl, chk, ptr)
- upper = 0
- map = '-' * 10240
-
- # sort long to short
- entries.sort! {|a,b| b[0].size <=> a[0].size }
-
- entries.each do |arr, chkval, expr, min, ptri|
- if upper + arr.size > map.size
- map << '-' * (arr.size + 1024)
- end
- idx = map.index(expr)
- ptr[ptri] = idx - min
- arr.each_with_index do |item, i|
- if item
- i += idx
- tbl[i] = item
- chk[i] = chkval
- map[i] = ?o
- end
- end
- upper = idx + arr.size
- end
- end
-
- def act2actid(act)
- case act
- when Shift then act.goto_id
- when Reduce then -act.ruleid
- when Accept then @states.shift_n
- when Error then @states.reduce_n * -1
- else
- raise "racc: fatal: wrong act type #{act.class} in action table"
- end
- end
-
- end
-
-
- class ParserClassGenerator
-
- def initialize(states)
- @states = states
- @grammar = states.grammar
- end
-
- def generate
- table = @states.state_transition_table
- c = Class.new(::Racc::Parser)
- c.const_set :Racc_arg, [table.action_table,
- table.action_check,
- table.action_default,
- table.action_pointer,
- table.goto_table,
- table.goto_check,
- table.goto_default,
- table.goto_pointer,
- table.nt_base,
- table.reduce_table,
- table.token_value_table,
- table.shift_n,
- table.reduce_n,
- false]
- c.const_set :Racc_token_to_s_table, table.token_to_s_table
- c.const_set :Racc_debug_parser, true
- define_actions c
- c
- end
-
- private
-
- def define_actions(c)
- c.module_eval "def _reduce_none(vals, vstack) vals[0] end"
- @grammar.each do |rule|
- if rule.action.empty?
- c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none)
- else
- c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc)
- c.module_eval(<<-End, __FILE__, __LINE__ + 1)
- def _reduce_#{rule.ident}(vals, vstack)
- _racc_action_#{rule.ident}(*vals)
- end
- End
- end
- end
- end
-
- end
-
-end # module Racc
diff --git a/lib/racc/static.rb b/lib/racc/static.rb
deleted file mode 100644
index bebbeb5aa6..0000000000
--- a/lib/racc/static.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'racc'
-require 'racc/parser'
-require 'racc/grammarfileparser'
-require 'racc/parserfilegenerator'
-require 'racc/logfilegenerator'
diff --git a/lib/rake.rb b/lib/rake.rb
new file mode 100644
index 0000000000..7366862ad0
--- /dev/null
+++ b/lib/rake.rb
@@ -0,0 +1,79 @@
+#--
+# 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.4.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/late_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..bd72a2efae
--- /dev/null
+++ b/lib/rake/application.rb
@@ -0,0 +1,790 @@
+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
+ args = handle_options
+ collect_command_line_tasks(args)
+ 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. Returns the command line
+ # arguments that we didn't understand, which should (in theory) be just
+ # task names and env vars.
+ 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(ARGV)
+ 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.
+ #
+ # `args` is the list of arguments to peruse to get the list of tasks.
+ # It should be the command line that was given to rake, less any
+ # recognised command-line options, which OptionParser.parse will
+ # have taken care of already.
+ def collect_command_line_tasks(args) # :nodoc:
+ @top_level_tasks = []
+ args.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..f29778ed5d
--- /dev/null
+++ b/lib/rake/cpu_counter.rb
@@ -0,0 +1,125 @@
+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
+
+ begin
+ require 'etc'
+ rescue LoadError
+ else
+ if Etc.respond_to?(:nprocessors)
+ def count
+ return Etc.nprocessors
+ end
+ end
+ end
+ end
+end
+
+unless Rake::CpuCounter.method_defined?(:count)
+ Rake::CpuCounter.class_eval <<-'end;', __FILE__, __LINE__+1
+ require 'rbconfig'
+
+ # TODO: replace with IO.popen using array-style arguments in Rake 11
+ require 'open3'
+
+ 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..26f4ca828c
--- /dev/null
+++ b/lib/rake/dsl_definition.rb
@@ -0,0 +1,201 @@
+# 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.
+ # Descriptions are shown with <code>rake -T</code> (up to the first
+ # sentence) and <code>rake -D</code> (the entire description).
+ #
+ # 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..d3b8cf9dc1
--- /dev/null
+++ b/lib/rake/ext/time.rb
@@ -0,0 +1,16 @@
+#--
+# Extensions to time to allow comparisons with early and late time classes.
+
+require 'rake/early_time'
+require 'rake/late_time'
+
+class Time # :nodoc: all
+ alias rake_original_time_compare :<=>
+ def <=>(other)
+ if Rake::EarlyTime === other || Rake::LateTime === 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..4c9b04074f
--- /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::LATE
+ 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/late_time.rb b/lib/rake/late_time.rb
new file mode 100644
index 0000000000..d959a7821f
--- /dev/null
+++ b/lib/rake/late_time.rb
@@ -0,0 +1,17 @@
+module Rake
+ # LateTime is a fake timestamp that occurs _after_ any other time value.
+ class LateTime
+ include Comparable
+ include Singleton
+
+ def <=>(other)
+ 1
+ end
+
+ def to_s
+ '<LATE TIME>'
+ end
+ end
+
+ LATE = LateTime.instance
+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..249ee72b11
--- /dev/null
+++ b/lib/rake/packagetask.rb
@@ -0,0 +1,199 @@
+# 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_path => @package_files do
+ @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..cbb9f5ee2f
--- /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 fc8ad9e144..a99e5dc309 100644
--- a/lib/rdoc.rb
+++ b/lib/rdoc.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
$DEBUG_RDOC = nil
# :main: README.rdoc
@@ -62,7 +61,10 @@ module RDoc
class Error < RuntimeError; end
- require 'rdoc/version'
+ ##
+ # RDoc version you are using
+
+ VERSION = '4.2.0'
##
# Method visibilities
@@ -107,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
@@ -122,6 +122,8 @@ module RDoc
autoload :RDoc, 'rdoc/rdoc'
+ autoload :TestCase, 'rdoc/test_case'
+
autoload :CrossReference, 'rdoc/cross_reference'
autoload :ERBIO, 'rdoc/erbio'
autoload :ERBPartial, 'rdoc/erb_partial'
@@ -143,11 +145,13 @@ module RDoc
autoload :KNOWN_CLASSES, 'rdoc/known_classes'
+ autoload :RubyLex, 'rdoc/ruby_lex'
+ autoload :RubyToken, 'rdoc/ruby_token'
autoload :TokenStream, 'rdoc/token_stream'
autoload :Comment, 'rdoc/comment'
- require 'rdoc/i18n'
+ autoload :I18n, 'rdoc/i18n'
# code objects
#
@@ -178,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 6b5e1b21a5..0000000000
--- a/lib/rdoc/.document
+++ /dev/null
@@ -1,2 +0,0 @@
-*.rb
-parser
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 7609080fbf..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]
@@ -210,7 +207,7 @@ class RDoc::ClassModule < RDoc::Context
normalize_comment comment
end
- comment = "#{@comment.to_s}\n---\n#{comment.to_s}" unless @comment.empty?
+ comment = "#{@comment}\n---\n#{comment}" unless @comment.empty?
super comment
end
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 9e90999eac..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.
@@ -24,11 +23,6 @@ class RDoc::Comment
attr_accessor :location
##
- # Line where this Comment was written
-
- attr_accessor :line
-
- ##
# For duck-typing when merging classes at load time
alias file location # :nodoc:
@@ -39,11 +33,6 @@ class RDoc::Comment
attr_reader :text
##
- # Alias for text
-
- alias to_s text
-
- ##
# Overrides the content returned by #parse. Use when there is no #text
# source for this comment
@@ -53,10 +42,9 @@ class RDoc::Comment
# Creates a new comment with +text+ that is found in the RDoc::TopLevel
# +location+.
- def initialize text = nil, location = nil, language = nil
+ def initialize text = nil, location = nil
@location = location
- @text = text.nil? ? nil : text.dup
- @language = language
+ @text = text
@document = nil
@format = 'rdoc'
@@ -125,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
@@ -148,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
##
@@ -221,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, '')
@@ -237,7 +215,7 @@ class RDoc::Comment
@text.nil? and @document
@document = nil
- @text = text.nil? ? nil : text.dup
+ @text = text
end
##
@@ -248,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 6caf0d6712..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
@@ -407,7 +400,6 @@ class RDoc::Context < RDoc::CodeObject
mod.section = current_section # TODO declaring context? something is
# wrong here...
mod.parent = self
- mod.full_name = nil
mod.store = @store
unless @done_documenting then
@@ -415,10 +407,6 @@ class RDoc::Context < RDoc::CodeObject
# this must be done AFTER adding mod to its parent, so that the full
# name is correct:
all_hash[mod.full_name] = mod
- if @store.unmatched_constant_alias[mod.full_name] then
- to, file = @store.unmatched_constant_alias[mod.full_name]
- add_module_alias mod, mod.name, to, file
- end
end
mod
@@ -489,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
@@ -516,52 +500,40 @@ class RDoc::Context < RDoc::CodeObject
end
##
- # Adds a module by +RDoc::NormalModule+ instance. See also #add_module.
-
- def add_module_by_normal_module(mod)
- add_class_or_module mod, @modules, @store.modules_hash
- end
-
- ##
# Adds an alias from +from+ (a class or module) to +name+ which was defined
# in +file+.
- def add_module_alias from, from_name, to, file
+ def add_module_alias from, name, file
return from if @done_documenting
- to_full_name = child_name to.name
+ to_name = child_name name
# if we already know this name, don't register an alias:
# see the metaprogramming in lib/active_support/basic_object.rb,
# where we already know BasicObject is a class when we find
# BasicObject = BlankSlate
- return from if @store.find_class_or_module to_full_name
+ return from if @store.find_class_or_module to_name
- unless from
- @store.unmatched_constant_alias[child_name(from_name)] = [to, file]
- return to
- end
+ to = from.dup
+ to.name = name
+ to.full_name = nil
- new_to = from.dup
- new_to.name = to.name
- new_to.full_name = nil
-
- if new_to.module? then
- @store.modules_hash[to_full_name] = new_to
- @modules[to.name] = new_to
+ if to.module? then
+ @store.modules_hash[to_name] = to
+ @modules[name] = to
else
- @store.classes_hash[to_full_name] = new_to
- @classes[to.name] = new_to
+ @store.classes_hash[to_name] = to
+ @classes[name] = to
end
# Registers a constant for this alias. The constant value and comment
# will be updated later, when the Ruby parser adds the constant
- const = RDoc::Constant.new to.name, nil, new_to.comment
+ const = RDoc::Constant.new name, nil, to.comment
const.record_location file
const.is_alias_for = from
add_constant const
- new_to
+ to
end
##
@@ -779,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
@@ -816,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
##
@@ -880,13 +850,7 @@ class RDoc::Context < RDoc::CodeObject
# Finds a method named +name+ with singleton value +singleton+.
def find_method(name, singleton)
- @method_list.find { |m|
- if m.singleton
- m.name == name && m.singleton == singleton
- else
- m.name == name && !m.singleton && !singleton
- end
- }
+ @method_list.find { |m| m.name == name && m.singleton == singleton }
end
##
@@ -1102,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
##
@@ -1190,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)
@@ -1256,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 07ba14c5c3..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.
@@ -19,16 +18,16 @@ class RDoc::CrossReference
#
# See CLASS_REGEXP_STR
- METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%|===|\[\]=?|<<|>>|-|\+|\*)(?:\([\w.+*/=<>-]*\))?'
+ METHOD_REGEXP_STR = '([a-z]\w*[!?=]?|%|===|\[\]=?|<<|>>)(?:\([\w.+*/=<>-]*\))?'
##
# Regular expressions matching text that should potentially have
- # cross-reference links generated are passed to add_regexp_handling. Note
- # that these expressions are meant to pick up text for which cross-references
+ # cross-reference links generated are passed to add_special. Note that
+ # these expressions are meant to pick up text for which cross-references
# have been suppressed, since the suppression characters are removed by the
# code that is triggered.
- CROSSREF_REGEXP = /(?:^|[\s()])
+ CROSSREF_REGEXP = /(?:^|\s)
(
(?:
# A::B::C.meth
@@ -76,7 +75,7 @@ class RDoc::CrossReference
# Version of CROSSREF_REGEXP used when <tt>--hyperlink-all</tt> is specified.
ALL_CROSSREF_REGEXP = /
- (?:^|[\s()])
+ (?:^|\s)
(
(?:
# A::B::C.meth
@@ -127,41 +126,23 @@ class RDoc::CrossReference
if /#{CLASS_REGEXP_STR}([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
type = $2
- if '.' == type # will find either #method or ::method
- method = $3
- else
- method = "#{type}#{$3}"
- end
+ type = '' if type == '.' # will find either #method or ::method
+ method = "#{type}#{$3}"
container = @context.find_symbol_module($1)
elsif /^([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
type = $1
- if '.' == type
- method = $2
- else
- method = "#{type}#{$2}"
- end
+ type = '' if type == '.'
+ method = "#{type}#{$2}"
container = @context
else
- type = nil
container = nil
end
if container then
- unless RDoc::TopLevel === container then
- if '.' == type then
- if 'new' == method then # AnyClassName.new will be class method
- ref = container.find_local_symbol method
- ref = container.find_ancestor_local_symbol method unless ref
- else
- ref = container.find_local_symbol "::#{method}"
- ref = container.find_ancestor_local_symbol "::#{method}" unless ref
- ref = container.find_local_symbol "##{method}" unless ref
- ref = container.find_ancestor_local_symbol "##{method}" unless ref
- end
- else
- ref = container.find_local_symbol method
- ref = container.find_ancestor_local_symbol method unless ref
- end
+ ref = container.find_local_symbol method
+
+ unless ref || RDoc::TopLevel === container then
+ ref = container.find_ancestor_local_symbol method
end
end
diff --git a/lib/rdoc/encoding.rb b/lib/rdoc/encoding.rb
index cf60badd24..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
@@ -7,18 +6,6 @@
module RDoc::Encoding
- HEADER_REGEXP = /^
- (?:
- \A\#!.*\n
- |
- ^\#\s+frozen[-_]string[-_]literal[=:].+\n
- |
- ^\#[^\n]+\b(?:en)?coding[=:]\s*(?<name>[^\s;]+).*\n
- |
- <\?xml[^?]*encoding=(?<quote>["'])(?<name>.*?)\k<quote>.*\n
- )+
- /xi # :nodoc:
-
##
# Reads the contents of +filename+ and handles any encoding directives in
# the file.
@@ -30,50 +17,50 @@ module RDoc::Encoding
# unknown character in the target encoding will be replaced with '?'
def self.read_file filename, encoding, force_transcode = false
- content = File.open filename, "rb" do |f| f.read end
+ content = open filename, "rb" do |f| f.read end
content.gsub!("\r\n", "\n") if RUBY_PLATFORM =~ /mswin|mingw/
utf8 = content.sub!(/\A\xef\xbb\xbf/, '')
- enc = RDoc::Encoding.detect_encoding content
- content = RDoc::Encoding.change_encoding content, enc if enc
-
- 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
@@ -86,51 +73,27 @@ 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
-
##
- # Detects the encoding of +string+ based on the magic comment
+ # Sets the encoding of +string+ based on the magic comment
- def self.detect_encoding string
- result = HEADER_REGEXP.match string
- name = result && result[:name]
+ def self.set_encoding string
+ string =~ /\A(?:#!.*\n)?(.*\n)/
- name ? Encoding.find(name) : nil
- end
+ first_line = $1
- ##
- # Removes magic comments and shebang
+ name = case first_line
+ when /^<\?xml[^?]*encoding=(["'])(.*?)\1/ then $2
+ when /\b(?:en)?coding[=:]\s*([^\s;]+)/i then $1
+ else return
+ end
- def self.remove_magic_comment string
- string.sub HEADER_REGEXP do |s|
- s.gsub(/[^\n]/, '')
- end
- end
+ string.sub! first_line, ''
- ##
- # 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
+ return unless Object.const_defined? :Encoding
+
+ enc = Encoding.find name
+ 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 820a25ae01..04a89fbd34 100644
--- a/lib/rdoc/erbio.rb
+++ b/lib/rdoc/erbio.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
require 'erb'
##
@@ -9,7 +8,7 @@ require 'erb'
#
# erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil
#
-# File.open 'hello.txt', 'w' do |io|
+# open 'hello.txt', 'w' do |io|
# erbio.result binding
# end
#
@@ -21,11 +20,7 @@ class RDoc::ERBIO < ERB
# Defaults +eoutvar+ to 'io', otherwise is identical to ERB's initialize
def initialize str, safe_level = nil, trim_mode = nil, eoutvar = 'io'
- if RUBY_VERSION >= '2.6'
- super(str, trim_mode: trim_mode, eoutvar: eoutvar)
- else
- super
- end
+ super
end
##
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 c5d47ef355..024040466d 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'
@@ -269,7 +268,7 @@ class RDoc::Generator::Darkfish
@options.static_path.each do |path|
unless File.directory? path then
- FileUtils.install path, @outputdir, **fu_options.merge(:mode => 0644)
+ FileUtils.install path, @outputdir, fu_options.merge(:mode => 0644)
next
end
@@ -278,9 +277,9 @@ class RDoc::Generator::Darkfish
dest_file = @outputdir + entry
if File.directory? entry then
- FileUtils.mkdir_p entry, **fu_options
+ FileUtils.mkdir_p entry, fu_options
else
- FileUtils.install entry, dest_file, **fu_options.merge(:mode => 0644)
+ FileUtils.install entry, dest_file, fu_options.merge(:mode => 0644)
end
end
end
@@ -313,16 +312,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 +342,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 +415,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 +433,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 +457,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 +482,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 +539,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})"
@@ -585,16 +557,16 @@ class RDoc::Generator::Darkfish
return unless source.exist?
begin
- FileUtils.mkdir_p File.dirname(destination), **options
+ FileUtils.mkdir_p File.dirname(destination), options
begin
- FileUtils.ln source, destination, **options
+ FileUtils.ln source, destination, options
rescue Errno::EEXIST
FileUtils.rm destination
retry
end
rescue
- FileUtils.cp source, destination, **options
+ FileUtils.cp source, destination, options
end
end
@@ -725,7 +697,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,20 +743,18 @@ 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(/\..*/, '')
erbout = "_erbout_#{file_var}"
end
- if RUBY_VERSION >= '2.6'
- template = klass.new template, trim_mode: '<>', eoutvar: erbout
- else
- template = klass.new template, nil, '<>', erbout
- end
+ template = klass.new template, nil, '<>', erbout
@template_cache[file] = template
template
end
end
+
diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb
index 3a1000033d..9d6f0d4356 100644
--- a/lib/rdoc/generator/json_index.rb
+++ b/lib/rdoc/generator/json_index.rb
@@ -1,9 +1,5 @@
-# frozen_string_literal: true
require 'json'
-begin
- require 'zlib'
-rescue LoadError
-end
+require 'zlib'
##
# The JsonIndex generator is designed to complement an HTML generator and
@@ -142,20 +138,17 @@ 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
end
- unless ENV['SOURCE_DATE_EPOCH'].nil?
- index_file.utime index_file.atime, Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
- end
Dir.chdir @template_dir do
Dir['**/*.js'].each do |source|
dest = File.join out_dir, source
- FileUtils.install source, dest, :mode => 0644, :preserve => true, :verbose => $DEBUG_RDOC
+ FileUtils.install source, dest, :mode => 0644, :verbose => $DEBUG_RDOC
end
end
end
@@ -164,8 +157,6 @@ class RDoc::Generator::JsonIndex
# 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
@@ -173,13 +164,13 @@ class RDoc::Generator::JsonIndex
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')
+ search_index = search_index_file.read
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.orig_name = search_index_file.to_s
gz.write search_index
gz.close
end
@@ -197,7 +188,7 @@ class RDoc::Generator::JsonIndex
Zlib::GzipWriter.open(outfile) do |gz|
gz.mtime = File.mtime(dest)
- gz.orig_name = dest.basename.to_s
+ gz.orig_name = dest.to_s
gz.write data
gz.close
end
@@ -298,3 +289,4 @@ class RDoc::Generator::JsonIndex
end
end
+
diff --git a/lib/rdoc/generator/markup.rb b/lib/rdoc/generator/markup.rb
index 41e132450d..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
#
@@ -65,6 +64,16 @@ end
class RDoc::MethodAttr
+ @add_line_numbers = false
+
+ class << self
+ ##
+ # Allows controlling whether <tt>#markup_code</tt> adds line numbers to
+ # the source code.
+
+ attr_accessor :add_line_numbers
+ end
+
##
# Prepend +src+ with line numbers. Relies on the first line of a source
# code listing having:
@@ -96,7 +105,7 @@ class RDoc::MethodAttr
##
# Turns the method's token stream into HTML.
#
- # Prepends line numbers if +options.line_numbers+ is true.
+ # Prepends line numbers if +add_line_numbers+ is true.
def markup_code
return '' unless @token_stream
@@ -116,7 +125,7 @@ class RDoc::MethodAttr
end
src.gsub!(/^#{' ' * indent}/, '') if indent > 0
- add_line_numbers(src) if options.line_numbers
+ add_line_numbers(src) if RDoc::MethodAttr.add_line_numbers
src
end
diff --git a/lib/rdoc/generator/pot.rb b/lib/rdoc/generator/pot.rb
index a12cba7505..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.
#
@@ -91,8 +90,8 @@ class RDoc::Generator::POT
extractor.extract
end
- require 'rdoc/generator/pot/message_extractor'
- require 'rdoc/generator/pot/po'
- require 'rdoc/generator/pot/po_entry'
+ autoload :MessageExtractor, 'rdoc/generator/pot/message_extractor'
+ autoload :PO, 'rdoc/generator/pot/po'
+ autoload :POEntry, 'rdoc/generator/pot/po_entry'
end
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..fe5822cc6b 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><a href="http://validator.w3.org/check/referer">Validate</a>
+ <p>Generated by <a href="http://docs.seattlerb.org/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>.
</footer>
diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml
index 8304310d4b..70f1c188d6 100644
--- a/lib/rdoc/generator/template/darkfish/_head.rhtml
+++ b/lib/rdoc/generator/template/darkfish/_head.rhtml
@@ -3,15 +3,11 @@
<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">
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
index 57302b5183..e9e721183b 100644
--- a/lib/rdoc/generator/template/darkfish/css/fonts.css
+++ b/lib/rdoc/generator/template/darkfish/css/fonts.css
@@ -17,7 +17,7 @@
font-weight: 400;
src: local("Source Code Pro"),
local("SourceCodePro-Regular"),
- url("../fonts/SourceCodePro-Regular.ttf") format("truetype");
+ url("fonts/SourceCodePro-Regular.ttf") format("truetype");
}
@font-face {
@@ -26,7 +26,7 @@
font-weight: 700;
src: local("Source Code Pro Bold"),
local("SourceCodePro-Bold"),
- url("../fonts/SourceCodePro-Bold.ttf") format("truetype");
+ url("fonts/SourceCodePro-Bold.ttf") format("truetype");
}
/*
@@ -46,7 +46,7 @@
font-weight: 300;
src: local("Lato Light"),
local("Lato-Light"),
- url("../fonts/Lato-Light.ttf") format("truetype");
+ url("fonts/Lato-Light.ttf") format("truetype");
}
@font-face {
@@ -55,7 +55,7 @@
font-weight: 300;
src: local("Lato Light Italic"),
local("Lato-LightItalic"),
- url("../fonts/Lato-LightItalic.ttf") format("truetype");
+ url("fonts/Lato-LightItalic.ttf") format("truetype");
}
@font-face {
@@ -64,7 +64,7 @@
font-weight: 700;
src: local("Lato Regular"),
local("Lato-Regular"),
- url("../fonts/Lato-Regular.ttf") format("truetype");
+ url("fonts/Lato-Regular.ttf") format("truetype");
}
@font-face {
@@ -73,7 +73,7 @@
font-weight: 700;
src: local("Lato Italic"),
local("Lato-Italic"),
- url("../fonts/Lato-RegularItalic.ttf") format("truetype");
+ url("fonts/Lato-RegularItalic.ttf") format("truetype");
}
/*
diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css
index a52e44ff8f..2f4dca7e08 100644
--- a/lib/rdoc/generator/template/darkfish/css/rdoc.css
+++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css
@@ -9,8 +9,6 @@
/* vim: ft=css et sw=2 ts=2 sts=2 */
/* Base Green is: #6C8C22 */
-.hide { display: none !important; }
-
* { padding: 0; margin: 0; }
body {
@@ -50,16 +48,6 @@ 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;
@@ -74,9 +62,6 @@ h6:target {
code,
pre {
font-family: "Source Code Pro", Monaco, monospace;
- background-color: rgba(27,31,35,0.05);
- padding: 0em 0.2em;
- border-radius: 0.2em;
}
/* @group Generic Classes */
@@ -106,7 +91,7 @@ pre {
.missing-docs {
font-size: 120%;
- background: white url(../images/wrench_orange.png) no-repeat 4px center;
+ background: white url(images/wrench_orange.png) no-repeat 4px center;
color: #ccc;
line-height: 2em;
border: 1px solid #d00;
@@ -150,11 +135,11 @@ pre {
.table-of-contents li .toc-toggle {
width: 16px;
height: 16px;
- background: url(../images/add.png) no-repeat;
+ background: url(images/add.png) no-repeat;
}
.table-of-contents li .toc-toggle.open {
- background: url(../images/delete.png) no-repeat;
+ background: url(images/delete.png) no-repeat;
}
/* @end */
@@ -276,13 +261,8 @@ ul.link-list .type {
-webkit-border-radius: 5px;
}
-dl.label-list dt {
- float: left;
- margin-right: 1em;
-}
-
.calls-super {
- background: url(../images/arrow_up.png) no-repeat right center;
+ background: url(images/arrow_up.png) no-repeat right center;
}
/* @end */
@@ -461,16 +441,7 @@ main header h3 {
/* @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;
+ display: none;
}
main .method-description .method-calls-super {
@@ -508,7 +479,7 @@ main .method-click-advice {
visibility: hidden;
padding-right: 20px;
line-height: 20px;
- background: url(../images/zoom.png) no-repeat right top;
+ background: url(images/zoom.png) no-repeat right top;
}
main .method-heading:hover .method-click-advice {
visibility: visible;
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/json_index/js/navigation.js b/lib/rdoc/generator/template/json_index/js/navigation.js
index dfad74b1ae..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,14 +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) e.preventDefault();
- this.select(this.current);
+ if (this.$current)
+ e.preventDefault();
+ 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 af303858b9..4cccbc66d3 100644
--- a/lib/rdoc/i18n.rb
+++ b/lib/rdoc/i18n.rb
@@ -1,10 +1,9 @@
-# frozen_string_literal: true
##
-# This module provides i18n related features.
+# This module provides i18n realated features.
module RDoc::I18n
autoload :Locale, 'rdoc/i18n/locale'
- require 'rdoc/i18n/text'
+ autoload :Text, 'rdoc/i18n/text'
end
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..a04068a435 100644
--- a/lib/rdoc/known_classes.rb
+++ b/lib/rdoc/known_classes.rb
@@ -1,4 +1,3 @@
-# frozen_string_literal: true
module RDoc
##
diff --git a/lib/rdoc/markdown.rb b/lib/rdoc/markdown.rb
index 43c70c8de6..033fc2be6d 100644
--- a/lib/rdoc/markdown.rb
+++ b/lib/rdoc/markdown.rb
@@ -1,5 +1,4 @@
# coding: UTF-8
-# frozen_string_literal: true
# :markup: markdown
##
@@ -15,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
#
@@ -82,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]
@@ -459,6 +446,8 @@ class RDoc::Markdown
else
return ans
end
+
+ return ans
end
end
@@ -491,6 +480,8 @@ class RDoc::Markdown
else
return ans
end
+
+ return ans
end
end
@@ -534,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
@@ -553,7 +549,6 @@ class RDoc::Markdown
:github,
:html,
:notes,
- :strike,
]
# :section: Extensions
@@ -604,11 +599,6 @@ class RDoc::Markdown
extension :notes
- ##
- # Enables the strike extension
-
- extension :strike
-
# :section:
##
@@ -697,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
@@ -833,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
@@ -1035,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
@@ -1052,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
@@ -1117,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
@@ -1128,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
@@ -1146,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
@@ -1217,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
@@ -1238,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
@@ -1259,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
@@ -1354,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
@@ -1381,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
@@ -1476,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
@@ -8451,162 +8455,7 @@ 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 = (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)
def _HtmlBlockInTags
_save = self.pos
@@ -8713,9 +8562,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
@@ -9483,7 +9329,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
@@ -9506,9 +9352,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
@@ -9835,7 +9678,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
@@ -9883,7 +9726,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
@@ -10198,166 +10041,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
@@ -10374,148 +10198,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
@@ -10550,89 +10373,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
- _tmp = match_string("**")
- unless _tmp
- self.pos = _save
- break
- end
_save1 = self.pos
- _tmp = _Whitespace()
+ _tmp = apply(:_StarLine)
_tmp = _tmp ? nil : true
self.pos = _save1
unless _tmp
self.pos = _save
break
end
- _tmp = _StartList()
- a = @result
+ _tmp = match_string("**")
unless _tmp
self.pos = _save
break
end
_save2 = 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
- _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
+ _tmp = _Spacechar()
+ _tmp = _tmp ? nil : true
+ self.pos = _save2
+ unless _tmp
+ self.pos = _save
break
- end # end sequence
+ end
+ _save3 = self.pos
+ _tmp = _Newline()
+ _tmp = _tmp ? nil : true
+ self.pos = _save3
+ unless _tmp
+ self.pos = _save
+ end
+ break
+ end # end sequence
- if _tmp
- while true
+ set_failed_rule :_TwoStarOpen unless _tmp
+ return _tmp
+ end
- _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
+ # TwoStarClose = !@Spacechar !@Newline Inline:a "**" { a }
+ def _TwoStarClose
- 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
@@ -10642,7 +10445,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
@@ -10650,24 +10453,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
@@ -10678,70 +10473,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
@@ -10754,110 +10526,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
@@ -10865,7 +10683,7 @@ class RDoc::Markdown
break
end # end sequence
- set_failed_rule :_Strike unless _tmp
+ set_failed_rule :_StrongUl unless _tmp
return _tmp
end
@@ -11044,7 +10862,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
@@ -11055,6 +10873,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
@@ -11163,119 +10986,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
@@ -14532,12 +14366,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()
@@ -14630,6 +14464,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)
@@ -15357,7 +15198,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
@@ -15448,7 +15289,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
@@ -15591,7 +15433,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
@@ -15833,7 +15675,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
@@ -16049,14 +15891,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 }")
@@ -16177,10 +16019,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", "(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)")
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\")")
@@ -16191,14 +16030,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 }")
@@ -16206,21 +16045,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)) .)* \"\\\"\"")
@@ -16252,13 +16097,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' }")
@@ -16275,10 +16121,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